:root {
  color-scheme: light;
  --surface-0: #f4f4f2;  --surface-1: #fcfcfb;  --surface-2: #ffffff;
  --line: #e2e1dc;       --line-strong: #c9c8c2;
  --text-primary: #0b0b0b; --text-secondary: #52514e; --text-muted: #7a7974;
  --accent: #2a78d6;     --accent-ink: #ffffff;
  --series-1: #2a78d6;
  --good: #0ca30c; --warning: #fab219; --critical: #d03b3b; --neutral: #9a9994;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #121211; --surface-1: #1a1a19; --surface-2: #232322;
    --line: #2f2f2d; --line-strong: #454542;
    --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #8f8e87;
    --accent: #3987e5; --series-1: #3987e5;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #121211; --surface-1: #1a1a19; --surface-2: #232322;
  --line: #2f2f2d; --line-strong: #454542;
  --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #8f8e87;
  --accent: #3987e5; --series-1: #3987e5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--surface-0); color: var(--text-primary);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
h1 { font-size: 18px; margin: 0; } h2 { font-size: 17px; margin: 0 0 6px; } h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin: 22px 0 8px; }
.muted { color: var(--text-muted); } .sr-only { position: absolute; left: -9999px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; background: var(--surface-1); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex: none; }
.top-actions { display: flex; gap: 8px; }
main { max-width: 1240px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.login { max-width: 440px; margin: 48px auto; }
.login form { display: flex; gap: 8px; margin-top: 12px; }
.login input { flex: 1; }
input, select { font: inherit; color: var(--text-primary); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
.btn { font: inherit; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-primary); cursor: pointer; min-height: 38px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.msg { min-height: 1.4em; margin: 10px 0 0; color: var(--text-secondary); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.tile:hover, .tile.active { border-color: var(--accent); }
.tile .n { font-size: 28px; font-weight: 600; line-height: 1.1; }
.tile .l { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; border: 1.5px solid var(--surface-1); box-shadow: 0 0 0 1px currentColor; }
.dot.good { background: var(--good); color: var(--good); } .dot.warning { background: var(--warning); color: var(--warning); }
.dot.critical { background: var(--critical); color: var(--critical); } .dot.neutral { background: var(--neutral); color: var(--neutral); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters #q { flex: 1 1 220px; } .check { display: flex; gap: 6px; align-items: center; color: var(--text-secondary); }
.count { margin-left: auto; font-size: 13px; }
.table-wrap { padding: 0; overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank th, .rank td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rank th { position: sticky; top: 0; background: var(--surface-1); color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.rank td.num, .rank th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank tbody tr { cursor: pointer; } .rank tbody tr:hover { background: var(--surface-2); }
.rank td.loc { font-weight: 600; white-space: normal; min-width: 180px; }
.band { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.chip { display: inline-block; font-size: 11.5px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text-secondary); margin: 1px 3px 1px 0; }
.pts { display: inline-flex; gap: 2px; align-items: flex-end; height: 18px; vertical-align: middle; margin-right: 6px; }
.pts i { display: block; width: 6px; background: var(--series-1); border-radius: 2px 2px 0 0; opacity: .85; min-height: 2px; }
.pts i.zero { background: var(--line-strong); }
.trend-down { color: var(--critical); } .trend-up { color: var(--good); }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 100vw); background: var(--surface-1); border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 20; display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 4px 16px 24px; overflow-y: auto; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 15; }
.d-score { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 0; }
.hero { font-size: 40px; font-weight: 700; line-height: 1; }
.chart { height: 170px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; r: 4; }
.chart .pt.hot { r: 5.5; }
.chart .cross { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 8px; font-size: 12px; color: var(--text-primary); transform: translate(-50%, -110%); white-space: nowrap; box-shadow: var(--shadow); }
.comps { display: grid; grid-template-columns: 110px 1fr 56px; gap: 6px 10px; align-items: center; font-size: 13px; }
.comps .bar { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.comps .bar i { display: block; height: 100%; background: var(--series-1); border-radius: 4px 0 0 4px; }
.comps .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.lines { margin: 0; padding-left: 18px; } .lines li { margin: 4px 0; }
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--text-muted); } .facts dd { margin: 0; }
.empty { padding: 28px; text-align: center; color: var(--text-muted); }
@media (max-width: 720px) { .rank th:nth-child(3), .rank td:nth-child(3), .rank th:nth-child(7), .rank td:nth-child(7), .rank th:nth-child(9), .rank td:nth-child(9), .rank th:nth-child(10), .rank td:nth-child(10) { display: none; } .hero { font-size: 32px; } }
