:root {
  color-scheme: light;
  --bg: #fffdf8;
  --surface: #fff;
  --surface-soft: #f7f4ee;
  --ink: #231a3b;
  --ink-secondary: #504760;
  --muted: #736c80;
  --line: #e7e1ed;
  --accent: #49357c;
  --accent-soft: #f0ebfa;
  --button: #2b2048;
  --button-ink: #fff;
  --star: #ffd23f;
  --green: #247b55;
  --green-soft: #edf7f0;
  --danger: #a5303e;
  --danger-soft: #fff0f1;
  --shadow: 0 5px 24px rgba(35, 26, 59, .035);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #120f26;
  --surface: #1c1838;
  --surface-soft: #241f40;
  --ink: #f7f2ff;
  --ink-secondary: #d3cbe4;
  --muted: #ada4c4;
  --line: #3d3455;
  --accent: #c2b1ff;
  --accent-soft: #30264b;
  --button: #ffd84d;
  --button-ink: #251b39;
  --star: #ffd84d;
  --green: #92d4ac;
  --green-soft: #1f352f;
  --danger: #ffb6c2;
  --danger-soft: #432532;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #120f26; --surface: #1c1838; --surface-soft: #241f40;
    --ink: #f7f2ff; --ink-secondary: #d3cbe4; --muted: #ada4c4;
    --line: #3d3455; --accent: #c2b1ff; --accent-soft: #30264b;
    --button: #ffd84d; --button-ink: #251b39; --star: #ffd84d;
    --green: #92d4ac; --green-soft: #1f352f;
    --danger: #ffb6c2; --danger-soft: #432532; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.65; overflow-wrap: break-word; word-break: keep-all; }
button, input { font: inherit; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; }
p, h1, h2 { margin: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 10; padding: 10px 20px; background: var(--button); color: var(--button-ink); border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1264px; margin: auto; min-height: 100px; padding: 20px 32px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; font-weight: 850; letter-spacing: -.5px; }
.brand img { width: 56px; height: 42px; object-fit: contain; }
.brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .1px; font-weight: 550; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 750; line-height: 1.4; white-space: nowrap; transition: background .15s, border-color .15s; }
.button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.button-quiet { background: transparent; }
.button-primary { background: var(--button); color: var(--button-ink); border-color: transparent; }
.button-primary:hover:not(:disabled) { background: var(--button); filter: brightness(1.12); }
.icon-button { width: 44px; padding: 8px; font-size: 20px; background: transparent; }
.wrap { max-width: 1264px; margin: auto; padding: 46px 32px 28px; min-height: calc(100vh - 180px); }
.auth-gate { width: min(100%, 640px); margin: 30px auto 70px; text-align: center; background: var(--surface); padding: 46px 32px 34px; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.auth-emblem { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 24px; font-size: 42px; color: #533e22; background: #fff2bc; border-radius: 24px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .2px; }
h1 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.35; letter-spacing: -1.4px; font-weight: 850; }
.auth-gate h1 { margin-top: 10px; }
.gate-description { margin: 18px auto 24px; max-width: 360px; color: var(--muted); font-size: 15px; }
.gate-note { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 0 auto 20px; color: var(--ink-secondary); font-size: 13px; }
.lock-icon { color: var(--accent); }
.login-button { min-height: 52px; padding: 13px 26px; font-size: 15px; }
.google-icon { display: grid; place-items: center; width: 24px; height: 24px; background: #fff; border-radius: 50%; color: #4285f4; font: 800 16px Arial, sans-serif; }
.gate-status { margin: 16px auto 0; max-width: 460px; color: var(--muted); font-size: 13px; min-height: 22px; }
.gate-status.is-error { color: var(--danger); }
.privacy-note { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.85; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 32px; }
.page-heading h1 { margin-top: 5px; }
.intro { margin-top: 10px; color: var(--muted); font-size: 14px; }
.private-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 30px; font-size: 12px; font-weight: 700; color: var(--green); background: var(--green-soft); white-space: nowrap; margin-top: 10px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.period-control { display: flex; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.period-control button { min-height: 42px; padding: 8px 17px; background: transparent; color: var(--muted); border: 0; border-radius: 10px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.period-control button:hover { color: var(--ink); background: var(--surface-soft); }
.period-control button[aria-pressed="true"] { background: var(--button); color: var(--button-ink); box-shadow: 0 2px 5px rgba(35, 26, 59, .1); }
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.auto-refresh { display: inline-flex; gap: 7px; align-items: center; font-size: 12px; color: var(--muted); margin-right: 8px; cursor: pointer; min-height: 44px; }
.auto-refresh input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.period-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 15px; margin: 16px 0 18px; font-size: 12px; color: var(--muted); }
.message { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; font-size: 13px; margin: 10px 0 18px; }
.message.error { background: var(--danger-soft); color: var(--danger); }
#statistics { transition: opacity .15s; }
#statistics[aria-busy="true"] { opacity: .6; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { padding: 24px 24px 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.metric-primary { background: var(--accent-soft); border-color: transparent; }
.metric .metric-label { font-size: 13px; font-weight: 800; color: var(--ink-secondary); }
.metric strong { display: block; margin: 12px 0 5px; font-size: clamp(30px, 4vw, 40px); line-height: 1.15; letter-spacing: -1.3px; font-variant-numeric: tabular-nums; }
.metric-primary strong { color: var(--accent); }
.metric p:last-child { color: var(--muted); font-size: 11px; line-height: 1.6; }
.recent-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; color: var(--muted); padding: 16px 2px 24px; font-size: 12px; }
.recent-strip strong { color: var(--green); font-size: 12px; }
.recent-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.empty-state { display: flex; gap: 15px; align-items: center; padding: 20px; margin-bottom: 20px; background: var(--surface-soft); border-radius: 16px; }
.empty-state > span { color: var(--accent); font-size: 30px; }
.empty-state h2 { font-size: 15px; }
.empty-state p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 25px; box-shadow: var(--shadow); min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.panel-heading .eyebrow { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
h2 { font-size: 18px; line-height: 1.4; letter-spacing: -.5px; }
.chart-legend, .unit-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; align-items: center; gap: 7px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.trend-chart { width: 100%; min-height: 180px; }
.trend-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart-area { fill: var(--accent); opacity: .08; }
.chart-line { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.data-table { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.data-table summary { color: var(--muted); font-size: 12px; cursor: pointer; padding: 5px 0; }
.table-scroll { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 650; color: var(--muted); background: var(--surface-soft); }
.breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.rank-list { padding: 0; margin: 0; list-style: none; }
.rank-item { margin: 0 0 17px; }
.rank-item:last-child { margin-bottom: 0; }
.rank-line { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 8px; font-size: 13px; }
.rank-label { color: var(--ink-secondary); min-width: 0; overflow-wrap: anywhere; }
.rank-count { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-count small { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 7px; }
.rank-meter { display: block; width: 100%; height: 6px; border-radius: 6px; overflow: hidden; background: var(--surface-soft); }
.rank-meter span { display: block; height: 100%; background: var(--accent); opacity: .7; border-radius: inherit; min-width: 2px; }
.list-empty { padding: 20px 0 30px; text-align: center; color: var(--muted); font-size: 13px; }
.panel-note { margin-top: 20px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.data-guide { margin-top: 30px; padding: 23px 25px; background: var(--surface-soft); border-radius: 18px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.data-guide h2 { color: var(--ink-secondary); font-size: 13px; margin-bottom: 8px; }
.data-guide p + p { margin-top: 6px; }
.limit-note { color: var(--danger); }
.footer { display: flex; justify-content: space-between; gap: 16px; max-width: 1264px; margin: auto; padding: 24px 32px 30px; font-size: 11px; color: var(--muted); }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
@media (max-width: 950px) {
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; justify-content: flex-end; }
  .auto-refresh { margin-right: auto; }
  .metric { padding: 20px 16px; }
}
@media (max-width: 650px) {
  .header { min-height: 82px; padding: 15px 16px; gap: 12px; }
  .brand { gap: 4px; font-size: 16px; }
  .brand img { width: 43px; height: 34px; }
  .brand small { font-size: 10px; }
  .header-actions { gap: 6px; }
  .header-actions .button { font-size: 11px; padding: 9px 11px; }
  .header-actions .icon-button { width: 40px; font-size: 18px; }
  .home-link { display: none; }
  .wrap { padding: 27px 16px 20px; }
  .auth-gate { margin: 8px auto 34px; padding: 32px 20px 24px; border-radius: 22px; }
  .gate-description { font-size: 13px; }
  .gate-note { font-size: 11px; }
  .privacy-note { font-size: 11px; }
  .page-heading { display: block; margin-bottom: 23px; }
  .intro { font-size: 12px; }
  .private-badge { margin-top: 13px; font-size: 11px; }
  .period-control { width: 100%; }
  .period-control button { flex: 1; font-size: 12px; padding-inline: 8px; }
  .toolbar-actions { flex-wrap: wrap; gap: 6px; }
  .toolbar-actions .button { font-size: 11px; padding-inline: 11px; }
  .auto-refresh { font-size: 11px; margin-right: auto; gap: 5px; }
  .period-meta { font-size: 10px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 18px 16px; border-radius: 16px; }
  .metric .metric-label { font-size: 12px; }
  .metric strong { font-size: 33px; margin-top: 10px; }
  .metric p:last-child { font-size: 10px; }
  .recent-strip { font-size: 10px; padding-bottom: 19px; }
  .recent-strip strong { font-size: 11px; }
  .panel { padding: 19px 16px; border-radius: 18px; }
  .panel-heading { margin-bottom: 18px; }
  h2 { font-size: 16px; }
  .chart-legend { font-size: 10px; }
  .trend-chart { min-height: 140px; }
  .chart-axis { font-size: 12px; }
  .breakdown-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .data-guide { padding: 20px 18px; font-size: 11px; }
  .footer { padding: 20px 18px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
