:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11,11,11,0.10);
  --series: #2a78d6;
  --track: #cde2fb;
  --good-text: #006300;
  --bad-text: #d03b3b;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255,255,255,0.10);
    --series: #3987e5;
    --track: #184f95;
    --good-text: #0ca30c;
    --bad-text: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255,255,255,0.10);
  --series: #3987e5;
  --track: #184f95;
  --good-text: #0ca30c;
  --bad-text: #e66767;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 24px 16px 64px;
}
main { max-width: 1180px; margin: 0 auto; }
header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 4px; }
h1 { font-size: 20px; margin: 0; font-weight: 650; }
.sub { color: var(--text-secondary); font-size: 13px; margin: 0 0 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.hero { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; margin-bottom: 16px; }
.hero > *, .two-col > * { min-width: 0; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
.hero-figure .label, .tile .label { color: var(--text-secondary); font-size: 12px; }
.hero-figure .value { font-size: 48px; font-weight: 650; line-height: 1.1; margin: 4px 0 8px; }
.hero-figure .line { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.chart-title { font-size: 13px; color: var(--text-secondary); }
.chart-wrap { position: relative; }
.toggle {
  font: inherit; font-size: 12px; color: var(--text-secondary); background: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px;
}
.toggle:hover { background: var(--surface-2); }
svg text { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg .bar { cursor: default; outline: none; }
svg .bar:hover, svg .bar:focus { opacity: 0.8; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; display: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.tooltip strong { display: block; font-size: 14px; color: var(--text-primary); }
.tooltip span { color: var(--text-secondary); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.tile .value { font-size: 22px; font-weight: 600; margin-top: 2px; }
.tile .note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
section { margin-bottom: 28px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.section-note { color: var(--text-secondary); font-size: 13px; margin: 0 0 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.two-col section { margin-bottom: 0; }
ul.facts, ol.todo { margin: 0; padding-left: 20px; }
ul.facts li, ol.todo li { margin: 4px 0; }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 9px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--good-text); }
.neg { color: var(--bad-text); }
.muted { color: var(--text-muted); }
.empty { color: var(--text-muted); padding: 14px; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status .icon { font-size: 11px; line-height: 1; }
.status.critical .icon { color: var(--critical); }
.status.serious .icon { color: var(--serious); }
.status.warning .icon { color: var(--warning); }
.status.good .icon { color: var(--good); }
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter svg { display: block; }
details.more summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; padding: 8px 9px; }
footer { color: var(--text-muted); font-size: 12px; margin-top: 32px; }
