:root {
  color-scheme: light;
  --ink: #18232b;
  --muted: #65737b;
  --line: #dfe5e6;
  --panel: #ffffff;
  --page: #f3f5f2;
  --navy: #0e2733;
  --navy-2: #183d4a;
  --teal: #2b8c82;
  --orange: #ed8a3d;
  --yellow: #f7c85a;
  --red: #ba514b;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; color: var(--ink); background: var(--page); min-width: 320px; }
button, input, select { font: inherit; }
.page-shell { max-width: 1440px; margin: 0 auto; padding: 34px 32px 56px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 50px); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin-bottom: 7px; font-size: 22px; letter-spacing: -.02em; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.snapshot-box { display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 8px; padding: 12px 15px; border: 1px solid var(--line); background: rgba(255,255,255,.72); font-size: 13px; color: var(--muted); white-space: nowrap; }
.snapshot-box strong { grid-column: 2; color: var(--ink); font-size: 14px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(43,140,130,.12); }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; padding: 14px 17px; color: #3d4a4e; background: #fff9e8; border-left: 4px solid var(--yellow); }
.notice p { margin: 0; font-size: 14px; line-height: 1.55; }
.notice-mark { display: grid; place-items: center; width: 21px; height: 21px; flex: 0 0 21px; border-radius: 50%; background: var(--yellow); color: #5b4510; font-weight: 800; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi-card { min-height: 124px; padding: 18px 19px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; justify-content: space-between; }
.kpi-card span, .kpi-card small { color: var(--muted); font-size: 13px; }
.kpi-card strong { font-size: 34px; letter-spacing: -.05em; color: var(--navy); }
.kpi-card.accent { background: var(--navy); border-color: var(--navy); }
.kpi-card.accent span, .kpi-card.accent small { color: #b8d3d5; }
.kpi-card.accent strong { color: var(--yellow); }
.panel { margin-bottom: 22px; padding: 23px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 8px 30px rgba(14,39,51,.035); }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.panel-heading.compact { align-items: center; }
.panel-note { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.scope-chip { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--line); background: #f8faf9; color: var(--muted); font-size: 13px; white-space: nowrap; }
.scope-chip strong { color: var(--navy); font-weight: 750; }
.select-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
select, input { min-height: 38px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--ink); padding: 8px 11px; outline: none; }
select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(43,140,130,.12); }
.trend-controls { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 9px; }
.check-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); background: #fbfcfb; color: #425157; font-size: 12px; cursor: pointer; }
.check-pill:has(input:checked) { border-color: var(--teal); background: #edf8f5; color: var(--navy); }
.check-pill input { min-height: auto; accent-color: var(--teal); }
.chart-wrap { overflow: hidden; width: 100%; min-height: 310px; background: linear-gradient(180deg, #fcfdfc 0%, #f7f9f8 100%); border: 1px solid #edf0ef; }
#trendChart { display: block; width: 100%; height: auto; min-height: 310px; }
.grid-line { stroke: #dfe7e5; stroke-width: 1; }
.axis-label { fill: #77868a; font-size: 11px; }
.series-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.point { stroke: #fff; stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 11px; color: #526168; font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.split-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 22px; }
.region-list { display: grid; gap: 10px; margin-top: 18px; }
.region-row { display: grid; grid-template-columns: 116px 1fr 42px; gap: 10px; align-items: center; font-size: 13px; }
.region-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 9px; overflow: hidden; background: #edf1f0; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #74bbb0); }
.region-value { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow: auto; max-width: 100%; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 10px 9px; border-bottom: 2px solid var(--navy); color: var(--muted); font-size: 11px; letter-spacing: .05em; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px 9px; border-bottom: 1px solid #edf0f0; vertical-align: top; line-height: 1.45; }
.data-table tbody tr:hover { background: #f7faf9; }
.data-table td:first-child { font-weight: 700; color: var(--navy); }
.keyword-table td:nth-child(3), .keyword-table td:nth-child(4), .keyword-table td:nth-child(5) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 99px; background: #edf5f3; color: #216b63; font-size: 11px; white-space: nowrap; }
.badge.warn { background: #fff4e6; color: #9a5a1d; }
.badge.muted { background: #f0f2f2; color: #6d797c; }
.signal-strong { color: #18766b; font-weight: 800; }
.signal-mixed { color: #a15a1d; font-weight: 800; }
.signal-uncertain { color: var(--red); font-weight: 800; }
.control-row { display: flex; align-items: center; gap: 10px; }
.search-wrap input { width: 220px; }
.count-label { color: var(--muted); font-size: 13px; }
.related-scroll { max-height: 430px; }
.footer { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 5px 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.footer div { display: flex; gap: 10px; }
.footer strong { color: var(--ink); white-space: nowrap; }
code { color: var(--navy-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.empty { padding: 24px 9px; color: var(--muted); text-align: center; }
@media (max-width: 980px) {
  .page-shell { padding: 26px 18px 42px; }
  .topbar, .panel-heading { align-items: flex-start; flex-direction: column; }
  .snapshot-box { align-self: stretch; grid-template-columns: auto 1fr; }
  .snapshot-box strong { grid-column: 2; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
  .control-row { width: 100%; justify-content: space-between; }
  .search-wrap { flex: 1; }
  .search-wrap input { width: 100%; }
}
@media (max-width: 560px) {
  .page-shell { padding: 21px 12px 34px; }
  .kpi-grid { gap: 8px; }
  .kpi-card { min-height: 110px; padding: 14px; }
  .kpi-card strong { font-size: 28px; }
  .panel { padding: 16px; }
  .control-row { align-items: stretch; flex-direction: column; }
  .region-row { grid-template-columns: 90px 1fr 34px; gap: 7px; }
  .footer { grid-template-columns: 1fr; gap: 12px; }
}
