:root {
  color-scheme: light;
  --page: #F3F4F6; --surface: #FFFFFF; --surface-2: #F8F9FB;
  --ink: #101828; --ink-2: #475467; --muted: #8A93A3; --grid: #E6E8EC; --axis: #C9CDD4; --ring: rgba(16,24,40,.10);
  --brand: #1C2B4A; --brand-ink: #FFFFFF; --accent: #D9641F;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --good: #0ca30c; --good-text: #006300; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b;
  --seq-track: #cde2fb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0E131B; --surface: #171F2C; --surface-2: #1D2634;
    --ink: #EEF1F6; --ink-2: #B7BFCC; --muted: #8A93A3; --grid: #26303F; --axis: #3A4557; --ring: rgba(255,255,255,.10);
    --brand: #22304A; --brand-ink: #EEF1F6; --accent: #F08A4A;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --good-text: #0ca30c; --seq-track: #1c3a5e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0E131B; --surface: #171F2C; --surface-2: #1D2634;
  --ink: #EEF1F6; --ink-2: #B7BFCC; --muted: #8A93A3; --grid: #26303F; --axis: #3A4557; --ring: rgba(255,255,255,.10);
  --brand: #22304A; --brand-ink: #EEF1F6; --accent: #F08A4A;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --good-text: #0ca30c; --seq-track: #1c3a5e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.45; }
a { color: inherit; }
.top { background: var(--brand); color: var(--brand-ink); padding: 14px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top .name { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.top .name small { display: block; font-weight: 400; font-size: 11px; opacity: .75; letter-spacing: .08em; text-transform: uppercase; }
.top .spacer { flex: 1; }
.range { display: flex; gap: 4px; background: rgba(255,255,255,.08); padding: 4px; }
.range button { background: transparent; border: 0; color: inherit; font: inherit; font-size: 12px; padding: 6px 10px; cursor: pointer; opacity: .8; }
.range button[aria-pressed="true"] { background: var(--surface); color: var(--ink); opacity: 1; font-weight: 600; }
.range button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.badge { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border: 1px solid rgba(255,255,255,.3); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 20px 60px; display: grid; gap: 18px; }
.row { display: grid; gap: 14px; }
.kpis { grid-template-columns: 1.5fr repeat(5, 1fr); }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpis .hero { grid-column: 1 / -1; } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--ring); padding: 16px 18px; min-width: 0; }
.card h2 { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 4px; }
.card .sub { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.tile .label { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.tile .value { font-size: 26px; font-weight: 600; line-height: 1.1; }
.tile .delta { font-size: 12px; margin-top: 6px; color: var(--ink-2); }
.tile .delta b { font-weight: 600; }
.tile .delta.up-good b, .tile .delta.down-good b { color: var(--good-text); }
.tile .delta.up-bad b, .tile .delta.down-bad b { color: var(--crit); }
.tile svg { display: block; margin-top: 8px; width: 100%; height: 28px; }
.hero .value { font-size: 44px; }
.meter { margin-top: 10px; height: 10px; background: var(--seq-track); position: relative; }
.meter .fill { height: 100%; background: var(--s1); }
.meter .tick { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--ink); }
.meter-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.two { grid-template-columns: 1.6fr 1fr; }
.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) { .two, .three { grid-template-columns: 1fr; } }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th { text-align: right; font-weight: 600; font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
tr.total td { font-weight: 600; border-bottom: 0; background: var(--surface-2); }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px; }
.tablewrap { overflow-x: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin: 0 0 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font-family: inherit; font-size: 11px; fill: var(--muted); }
svg.chart .grid line { stroke: var(--grid); stroke-width: 1; }
svg.chart .axis { stroke: var(--axis); stroke-width: 1; }
svg.chart .lbl { fill: var(--ink-2); font-size: 11px; }
svg.chart .lbl.strong { fill: var(--ink); font-weight: 600; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12px; padding: 6px 9px; border-radius: 3px; display: none; z-index: 10; white-space: nowrap; }
.brief p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink); }
.brief p b { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chips button { font: inherit; font-size: 12px; background: var(--surface-2); border: 1px solid var(--ring); color: var(--ink); padding: 6px 10px; cursor: pointer; }
.chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--surface); }
.chips button:focus-visible { outline: 2px solid var(--accent); }
.answer { font-size: 13.5px; border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--surface-2); min-height: 44px; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.src { border: 1px solid var(--ring); padding: 8px 10px; font-size: 12px; background: var(--surface-2); }
.src b { display: block; font-weight: 600; font-size: 13px; color: var(--ink); }
.src span { color: var(--muted); }
.src i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 5px; }
.src i.pending { background: var(--warn); }
.foot { font-size: 12px; color: var(--muted); text-align: center; }
.gate { position: fixed; inset: 0; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; z-index: 100; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.gate form { background: var(--surface); color: var(--ink); padding: 28px 30px; width: 320px; max-width: 90vw; }
.gate h1 { font-size: 18px; margin: 0 0 4px; }
.gate p { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.gate input { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); margin-bottom: 10px; }
.gate button { width: 100%; font: inherit; font-size: 14px; font-weight: 600; padding: 10px; background: var(--accent); color: #fff; border: 0; cursor: pointer; }
.gate .err { color: var(--crit); font-size: 12px; min-height: 16px; margin-top: 6px; }
