:root {
  --bg: #f7f7f5; --card: #ffffff; --ink: #1d1d1b; --muted: #6b6b66; --line: #e3e2dd;
  --accent: #2f5bd3; --bad: #b3261e;
  --s0: #2f5bd3; --s1: #d97a1f; --s2: #2e8b57; --s3: #8e44ad; --s4: #c0392b; --s5: #7f8c8d;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151515; --card: #1f1f1e; --ink: #ecebe6; --muted: #a3a29b; --line: #34332f;
    --accent: #7ea2ff; --bad: #ff8a80;
    --s0: #7ea2ff; --s1: #f0a65a; --s2: #6cc893; --s3: #c49be0; --s4: #ff8a80; --s5: #b8bfc0;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.bar h1 { font-size: 18px; margin: 0; margin-right: auto; }
.filters { display: flex; gap: 14px; }
label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
select, button { font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; }
button { cursor: pointer; background: var(--accent); color: #fff; border-color: var(--accent); }
button.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 40px; }
.status { color: var(--muted); }
.status.error { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile, .card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.tile { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--muted); }
.card { padding: 12px 14px; margin-top: 14px; overflow-x: auto; }
.card h2 { font-size: 14px; margin: 0 0 8px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 0 14px; }
.grid .wide { grid-column: 1 / -1; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { color: var(--muted); }
.chart svg { width: 100%; height: 220px; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; }
.legend li::before { content: ""; display: inline-block; width: 10px; height: 10px;
  border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: currentColor; }
.s0 { fill: var(--s0); color: var(--s0); } .s1 { fill: var(--s1); color: var(--s1); }
.s2 { fill: var(--s2); color: var(--s2); } .s3 { fill: var(--s3); color: var(--s3); }
.s4 { fill: var(--s4); color: var(--s4); } .s5 { fill: var(--s5); color: var(--s5); }
.legend li { color: var(--ink); }
.legend li.s0::before { background: var(--s0); } .legend li.s1::before { background: var(--s1); }
.legend li.s2::before { background: var(--s2); } .legend li.s3::before { background: var(--s3); }
.legend li.s4::before { background: var(--s4); } .legend li.s5::before { background: var(--s5); }
.note { color: var(--muted); font-size: 12px; margin-top: 18px; }
[hidden] { display: none !important; }
