:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7872;
  --border: rgba(11, 11, 11, 0.10);
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --s1: #2a78d6;
  --s2: #eb6834;
  --good: #0ca30c;
  --warning: #fab219;
  --rose-0: #86b6ef; --rose-1: #5598e7; --rose-2: #2a78d6; --rose-3: #1c5cab; --rose-4: #104281;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #898781;
    --border: rgba(255, 255, 255, 0.10);
    --grid: #2c2c2a;
    --axis: #383835;
    --s1: #3987e5;
    --s2: #d95926;
    --rose-0: #184f95; --rose-1: #256abf; --rose-2: #3987e5; --rose-3: #6da7ec; --rose-4: #9ec5f4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --text: #f0efec; --text-2: #c3c2b7; --muted: #898781;
  --border: rgba(255, 255, 255, 0.10); --grid: #2c2c2a; --axis: #383835;
  --s1: #3987e5; --s2: #d95926;
  --rose-0: #184f95; --rose-1: #256abf; --rose-2: #3987e5; --rose-3: #6da7ec; --rose-4: #9ec5f4;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 8px 24px; max-width: 1180px; margin: 0 auto; padding: 24px 16px 8px;
}
h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 17px; font-weight: 650; }
h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.sub { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.status { margin: 0; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); }
.status.stale .dot { border-radius: 0; background: var(--warning); clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 11px; height: 10px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px 32px; }
section { margin-top: 20px; }

.empty {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; color: var(--text-2);
}

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tile, .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.tile.hero { grid-column: span 1; }
.big { margin: 0; font-size: 38px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; display: flex; align-items: baseline; gap: 6px; }
.big small { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.meta { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.arrow { width: 26px; height: 26px; margin-left: auto; align-self: center; fill: var(--s1); transition: transform .4s; }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.chips { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.chips button {
  appearance: none; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px;
  font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer;
}
.chips button:hover { background: var(--grid); }
.chips button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.chips button:focus-visible { outline: 2px solid var(--s1); outline-offset: 1px; }

.charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.card .note { font-weight: 400; color: var(--muted); margin-left: 6px; }
.plot { width: 100%; min-height: 230px; position: relative; }
.plot .u-legend { font-size: 12px; text-align: left; }
.plot .u-legend .u-series { padding: 2px 8px 0 0; }
.plot .u-legend .u-marker { border-radius: 2px; }
.plot .u-legend th { color: var(--text-2); font-weight: 500; }
.plot .u-cursor-x, .plot .u-cursor-y { border-color: var(--muted) !important; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; display: none; min-width: 120px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); border-radius: 8px; padding: 7px 10px; font-size: 12px;
}
.tip .tt { color: var(--text-2); margin-bottom: 3px; }
.tip .row { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.tip .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tip .row b { margin-left: auto; padding-left: 12px; }
.empty-plot { color: var(--muted); font-size: 13px; padding: 80px 0; text-align: center; }

.two { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.rose { display: flex; justify-content: center; }
.rose svg { width: 100%; max-width: 340px; height: auto; }
.rose text { fill: var(--text-2); font-size: 11px; }
.rose .ring { fill: none; stroke: var(--grid); stroke-width: 1; }
.rose .spoke { stroke: var(--grid); stroke-width: 1; }
.rose .wedge { stroke: var(--surface); stroke-width: 1.5; }
.key { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-2); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

footer { max-width: 1180px; margin: 0 auto; padding: 0 16px 28px; color: var(--muted); font-size: 12px; }

@media (max-width: 520px) {
  .big { font-size: 32px; }
  .top { padding-top: 16px; }
}
