/* ============================================================
   키워드 스코프 — 무료 키워드·트렌드 분석기
   디자인 토큰
   ============================================================ */
:root {
  --bg: #f4f5fb;
  --bg-soft: #eceef8;
  --panel: #ffffff;
  --ink: #171a2b;
  --ink-soft: #3c4157;
  --muted: #6b7185;
  --line: #e4e6f1;
  --line-strong: #d3d7e6;
  --brand: #4f46e5;
  --brand-strong: #3f37c9;
  --brand-soft: #ecebff;
  --accent: #0f9b8e;
  --accent-soft: #e2f7f4;
  --warn: #b45309;
  --danger: #d0342c;
  --grade-s: #0f9b8e;
  --grade-a: #2563eb;
  --grade-b: #a16207;
  --grade-c: #c2410c;
  --grade-d: #9f1239;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 43, 0.04), 0 1px 3px rgba(23, 26, 43, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(35, 31, 92, 0.18);
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR',
    'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 480px at 50% -160px, #e9e7ff 0%, rgba(233, 231, 255, 0) 70%), var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--brand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   헤더
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(228, 230, 241, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--brand) 0%, #7c6cf6 55%, #22c1b1 120%);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.7);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* 배지 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.badge--demo {
  background: #fff4e5;
  color: #a35a00;
  border-color: #ffd9a8;
}

.badge--live {
  background: #e7f8f2;
  color: #0a7a68;
  border-color: #b8ecdd;
}

.badge--checking {
  background: #eef0f8;
  color: var(--muted);
  border-color: var(--line);
}

.badge--error {
  background: #fdecea;
  color: #a5281f;
  border-color: #f7c9c4;
}

.badge--inline {
  font-size: 11px;
  padding: 2px 8px;
  vertical-align: 1px;
}

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #f7f7fd;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 1px;
}

.btn--primary {
  background: linear-gradient(180deg, #5b52ee 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  border-color: #4a41d8;
}

.btn--primary:hover {
  background: linear-gradient(180deg, #655cf3 0%, var(--brand-strong) 100%);
}

.btn--primary:disabled {
  opacity: 0.62;
  cursor: progress;
  box-shadow: none;
}

.btn--ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: #f6f7fc;
  border-color: #c3c8dd;
}

.btn--accent {
  background: var(--accent-soft);
  color: #0a7a68;
  border-color: #b6e8e0;
}

.btn--accent:hover {
  background: #d5f2ee;
}

.btn--sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 9px;
}

.btn.is-loading .btn-label::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   광고 자리 (레이아웃 여백 확보용)
   ============================================================ */
.ad-slot {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, #fafbff 0 12px, #f4f5fb 12px 24px);
  color: #b6bad0;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  overflow: hidden;
}

.ad-slot--top {
  min-height: 90px;
  margin-top: 18px;
}

.ad-slot--side {
  min-height: 250px;
}

.ad-slot--bottom {
  min-height: 120px;
  margin: 8px 0 32px;
}

/* ============================================================
   레이아웃
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
  padding-top: 20px;
  padding-bottom: 40px;
}

.col-main {
  min-width: 0;
}

.col-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 84px;
}

.hero {
  padding: 16px 2px 20px;
}

.hero h1 {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand) 10%, #0f9b8e 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  max-width: 720px;
}

/* ============================================================
   패널 공통
   ============================================================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 750;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.count-pill {
  display: inline-block;
  min-width: 30px;
  padding: 1px 8px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  vertical-align: 1px;
}

/* ============================================================
   검색 폼
   ============================================================ */
.search-panel {
  padding: 18px 18px 14px;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.field-head label {
  font-weight: 700;
  font-size: 14px;
}

.field-meta {
  font-size: 12px;
  color: var(--muted);
}

#keywordInput {
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fcfcff;
  resize: vertical;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#keywordInput::placeholder {
  color: #a5a9bd;
}

#keywordInput:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.kbd-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  background: #fafbff;
}

.status-bar {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  min-height: 18px;
}

.status-bar.is-error {
  color: var(--danger);
}

.status-bar.is-ok {
  color: #0a7a68;
}

.status-bar strong {
  color: var(--ink-soft);
}

/* ============================================================
   결과
   ============================================================ */
.results {
  display: block;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 2px 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 17px;
  font-weight: 750;
}

.section-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  max-width: 460px;
}

.summary-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #22c1b1);
  opacity: 0.9;
}

.summary-card.is-primary {
  border-color: #cfcbff;
  box-shadow: 0 6px 24px -14px rgba(79, 70, 229, 0.55);
}

.summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.summary-kw {
  font-size: 15px;
  font-weight: 750;
  word-break: break-all;
  letter-spacing: -0.02em;
}

.summary-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.summary-total {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.summary-total strong {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.summary-total span {
  font-size: 12px;
  color: var(--muted);
}

.ratio-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 99px;
  background: #eef0f8;
  overflow: hidden;
  display: flex;
}

.ratio-bar i {
  display: block;
  height: 100%;
}

.ratio-bar .pc {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.ratio-bar .mo {
  background: linear-gradient(90deg, #22c1b1, #16a394);
}

.ratio-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ratio-legend b {
  color: var(--ink-soft);
  font-weight: 650;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.stat {
  min-width: 0;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.stat-value {
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 등급 칩 */
.grade {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.5;
  border: 1px solid transparent;
}

.grade b {
  font-size: 12px;
}

.grade--best {
  color: #fff;
  background: var(--grade-s);
  border-color: #0b8578;
}

.grade--good {
  color: #1d4ed8;
  background: #e8effe;
  border-color: #c8d9fd;
}

.grade--mid {
  color: #92610a;
  background: #fdf5e3;
  border-color: #f2e0b0;
}

.grade--bad {
  color: #a33c0c;
  background: #fdefe6;
  border-color: #f6d3bd;
}

.grade--worst {
  color: #8c1233;
  background: #fdeaf0;
  border-color: #f7c7d6;
}

.grade--none {
  color: var(--muted);
  background: #f3f4fa;
  border-color: var(--line);
}

.trend-up {
  color: #0a7a68;
  font-weight: 700;
}

.trend-down {
  color: #c2410c;
  font-weight: 700;
}

.trend-flat {
  color: var(--muted);
  font-weight: 600;
}

/* ============================================================
   차트
   ============================================================ */
.chart-panel .panel-tools select,
.select-inline select {
  appearance: none;
  padding: 7px 30px 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7185' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 11px center;
  font-size: 13px;
  font-weight: 600;
  max-width: 220px;
}

.chart {
  position: relative;
  width: 100%;
  height: 268px;
  min-height: 200px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart .grid-line {
  stroke: #eceef7;
  stroke-width: 1;
}

.chart .axis-text {
  fill: #8b90a6;
  font-size: 11px;
  font-family: var(--font);
}

.chart .series-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .area-fill {
  opacity: 0.14;
}

.chart .point {
  stroke: #fff;
  stroke-width: 2;
}

.chart .hover-line {
  stroke: #b9bcd0;
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: rgba(23, 26, 43, 0.94);
  color: #fff;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.5;
  transform: translate(-50%, 0);
  white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
}

.chart-tooltip b {
  font-size: 12px;
}

.chart-tooltip .tt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.chart-tooltip .tt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.chart-tooltip .tt-val {
  margin-left: auto;
  padding-left: 12px;
  font-variant-numeric: tabular-nums;
}

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-soft);
  cursor: pointer;
}

.legend-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-btn[aria-pressed='false'] {
  opacity: 0.42;
  text-decoration: line-through;
}

.caption {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
  text-align: right;
}

.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ============================================================
   필터 · 표
   ============================================================ */
.filters {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 0.85fr) 1.1fr auto;
  gap: 10px;
  padding: 12px;
  background: #fafbff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.filter input,
.filter select {
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
}

.filter input:focus,
.filter select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.filter--action {
  justify-content: flex-end;
}

.filter-hint {
  margin: 8px 2px 12px;
  font-size: 12px;
  color: var(--muted);
}

.filter-hint b {
  color: var(--ink-soft);
}

.table-scroll {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: 640px;
}

.kw-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  min-width: 780px;
}

.kw-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f8fd;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  padding: 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.kw-table thead th.num {
  text-align: right;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

.kw-table thead th.num .sort-btn {
  justify-content: flex-end;
}

.sort-btn:hover {
  color: var(--brand-strong);
  background: #f0f1fb;
}

.sort-btn:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.4);
  outline-offset: -2px;
}

.sort-btn[data-active='true'] {
  color: var(--brand-strong);
}

.sort-btn .arrow {
  font-size: 9px;
  opacity: 0.9;
}

.kw-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f2f9;
  vertical-align: middle;
  white-space: nowrap;
}

.kw-table tbody tr:hover td {
  background: #fbfbff;
}

.kw-table tbody tr.is-top td {
  background: #f6fffd;
}

.kw-table tbody tr.is-top:hover td {
  background: #effcf9;
}

.kw-table tbody tr:last-child td {
  border-bottom: 0;
}

.kw-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kw-table td.col-rank {
  color: #a3a7bb;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  width: 44px;
}

.kw-name {
  font-weight: 650;
  color: var(--ink);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.kw-name mark {
  background: #fff2b8;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.kw-sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.cell-strong {
  font-weight: 700;
}

.sat-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.sat-ratio {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.comp {
  font-size: 12px;
  font-weight: 650;
}

.comp--1 {
  color: #0a7a68;
}

.comp--2 {
  color: #a16207;
}

.comp--3 {
  color: #b3402c;
}

.dir {
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.empty-row td {
  text-align: center;
  padding: 34px 12px !important;
  color: var(--muted);
  font-size: 13px;
  white-space: normal;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.page-size select {
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 12.5px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  background: #f4f5fd;
  border-color: #c6cbe0;
}

.pagination button[aria-current='page'] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

.pagination .ellipsis {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.disclaimer {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
  padding: 0 2px 8px;
}

.disclaimer strong {
  color: var(--ink-soft);
}

/* ============================================================
   사이드 · 푸터
   ============================================================ */
.tip-panel {
  padding: 16px;
}

.tip-panel h2 {
  font-size: 14px;
  font-weight: 750;
  margin-bottom: 10px;
}

.tips {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tips li::marker {
  color: var(--brand);
  font-weight: 700;
}

.tip-body {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 12px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 20px 0 28px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.footer-inner p:first-child {
  font-weight: 700;
  color: var(--ink-soft);
}

.noscript {
  padding: 16px;
  text-align: center;
  background: #fdecea;
  color: #a5281f;
}

/* ============================================================
   설정 다이얼로그
   ============================================================ */
.dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px -30px rgba(23, 26, 43, 0.55);
  color: var(--ink);
  background: #fff;
}

.dialog::backdrop {
  background: rgba(20, 22, 38, 0.42);
  backdrop-filter: blur(2px);
}

.dialog-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialog-form h2 {
  font-size: 18px;
}

.dialog-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}

.dialog-desc code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: #f2f3fa;
  padding: 1px 5px;
  border-radius: 5px;
}

.dialog-form label {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.dialog-form input[type='url'] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  font-family: var(--mono);
}

.dialog-form input[type='url']:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.settings-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.settings-status.is-ok {
  color: #0a7a68;
}

.settings-status.is-error {
  color: var(--danger);
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.dialog-actions .spacer {
  flex: 1;
}

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 1080px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 18px;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter--action {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .col-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
  }

  .ad-slot--side {
    min-height: 120px;
  }

  .hero h1 {
    font-size: 24px;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 14px;
  }

  body {
    font-size: 14.5px;
  }

  .header-inner {
    min-height: 56px;
    gap: 8px;
  }

  .brand-text span {
    display: none;
  }

  .badge {
    font-size: 11px;
    padding: 4px 9px 4px 7px;
  }

  .btn--sm {
    padding: 6px 10px;
    font-size: 12px;
  }

  .hero {
    padding: 10px 2px 14px;
  }

  .hero h1 {
    font-size: 21px;
  }

  .hero-sub {
    font-size: 13px;
  }

  .ad-slot--top {
    min-height: 70px;
    margin-top: 12px;
  }

  .panel {
    padding: 14px;
    border-radius: 14px;
  }

  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .filter--action {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
  }

  .chart {
    height: 216px;
  }

  .chart-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .caption {
    margin-left: 0;
    text-align: left;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-head h2 {
    font-size: 15px;
  }

  .table-scroll {
    max-height: 70vh;
    border-radius: 10px;
  }

  .kw-table {
    font-size: 12.5px;
    min-width: 720px;
  }

  .kw-table thead th:first-child,
  .kw-table tbody td:first-child {
    display: none;
  }

  .kw-table thead th:nth-child(2),
  .kw-table tbody td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 1px 0 0 var(--line);
  }

  .kw-table thead th:nth-child(2) {
    background: #f7f8fd;
    z-index: 3;
  }

  .kw-table tbody tr.is-top td:nth-child(2) {
    background: #f6fffd;
  }

  .kw-name {
    max-width: 132px;
  }

  .table-foot {
    gap: 8px;
  }

  .pagination button {
    min-width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .kbd-hint {
    display: none;
  }

  .dialog-form {
    padding: 18px;
  }

  .ad-slot--bottom {
    min-height: 90px;
  }
}

@media (max-width: 380px) {
  .search-actions .btn {
    flex: 1 1 auto;
  }

  .summary-total strong {
    font-size: 23px;
  }

  .summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
