:root {
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --surface-2: #f0efec;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --chart-grid: #e1e0d9;
  --chart-chrome: #c3c2b7;
  --mercury: #2a78d6;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --link: #1c5cab;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0d0d0d; --surface-1: #1a1a19; --surface-2: #2c2c2a;
    --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #898781;
    --chart-grid: #2c2c2a; --chart-chrome: #383835;
    --mercury: #3987e5; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --link: #86b6ef; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0d0d0d; --surface-1: #1a1a19; --surface-2: #2c2c2a;
  --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #898781;
  --chart-grid: #2c2c2a; --chart-chrome: #383835;
  --mercury: #3987e5; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --link: #86b6ef; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0 auto; max-width: calc(1100px + 32px); padding: 0 16px 32px;
  background: var(--page); color: var(--text-primary);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; overflow-wrap: anywhere; }
h1 { font-size: 1.6rem; margin: 24px 0 4px; }
h2 { font-size: 1.2rem; margin: 32px 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 6px; }
header { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.lede, .secondary, .note, .legend, .status { color: var(--text-secondary); }
.lede { margin: 0; max-width: 60ch; }
header .segmented { margin-top: 28px; }
.segmented { display: inline-flex; border: 1px solid var(--chart-chrome); border-radius: 8px; overflow: hidden; }
.segmented button {
  font: inherit; font-size: 0.9rem; padding: 4px 12px; border: 0; cursor: pointer;
  background: var(--surface-1); color: var(--text-secondary);
}
.segmented button + button { border-left: 1px solid var(--chart-chrome); }
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--text-primary); font-weight: 600; }
button:focus-visible, a:focus-visible, tr:focus-visible, .scroll:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.summary {
  display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start;
  background: var(--surface-1); border: 1px solid var(--chart-grid); border-radius: 12px; padding: 16px; margin-top: 24px;
}
@media (max-width: 720px) { .summary { grid-template-columns: 1fr; } .thermo-wrap { max-width: 240px; margin: 0 auto; } }
.thermo { width: 100%; height: auto; display: block; }
.thermo .tube { fill: var(--surface-2); stroke: var(--chart-chrome); stroke-width: 1.5; }
.thermo .bulb, .thermo .mercury { fill: var(--mercury); }
.thermo .median { fill: var(--text-secondary); }
.thermo .gate { stroke: var(--text-primary); stroke-width: 2; }
.thermo .gate.unmeasured { stroke: var(--text-muted); stroke-dasharray: 4 3; }
.thermo .leader { stroke: var(--text-muted); }
.thermo .lit { fill: var(--status-good); }
.thermo .unlit { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }
.thermo .check { fill: none; stroke: #fff; stroke-width: 1.8; }
.thermo .label { font-size: 10.5px; fill: var(--text-primary); }
.thermo .label.secondary { fill: var(--text-secondary); }
.headline p { margin: 0 0 6px; }
.headline .big { font-size: 1.5rem; font-weight: 650; line-height: 1.25; margin-bottom: 10px; }
.gates { padding-left: 20px; margin: 16px 0; }
.gates li { margin-bottom: 4px; }
.status { font-size: 0.9rem; border-top: 1px solid var(--chart-grid); padding-top: 10px; }

.legend { font-size: 0.85rem; margin: 12px 0 4px; }
.legend .key { display: inline-block; width: 22px; border-top: 2px solid var(--series-1); vertical-align: middle; margin: 0 4px 0 8px; }
.legend .key:first-child { margin-left: 0; }
.legend .key.dashed { border-top-style: dashed; }
.legend .sym { margin-left: 10px; }
.chart { background: var(--surface-1); border: 1px solid var(--chart-grid); border-radius: 12px; padding: 8px; min-height: 80px; overflow: hidden; }
.chart svg { display: block; max-width: 100%; cursor: pointer; }
.empty { color: var(--text-secondary); padding: 16px; margin: 0; }
.note { font-size: 0.85rem; margin: 4px 8px; }

table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--chart-grid); vertical-align: top; }
th { color: var(--text-secondary); font-weight: 600; }
#runs .scroll { overflow-x: auto; }
#runs tbody tr { cursor: pointer; }
#runs tbody tr:hover { background: var(--surface-2); }
#runs td:nth-child(n+5):nth-child(-n+14) { font-variant-numeric: tabular-nums; }
#runs button { margin-top: 12px; font: inherit; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--chart-chrome); background: var(--surface-1); color: var(--text-primary); cursor: pointer; }
.outcome .icon { display: inline-block; width: 1em; text-align: center; }
.outcome.valid .icon { color: var(--status-good); }
.outcome.availability_warning .icon { color: var(--status-warning); }
.outcome.invalid .icon, .outcome.no_data .icon { color: var(--text-muted); }
.outcome.failed .icon { color: var(--status-critical); }
@media (max-width: 640px) {
  #runs table, #runs tbody, #runs tr, #runs td { display: block; }
  #runs thead { display: none; }
  #runs tr { border: 1px solid var(--chart-grid); border-radius: 8px; margin-bottom: 10px; padding: 6px 0; background: var(--surface-1); }
  #runs td { display: grid; grid-template-columns: 9em 1fr; gap: 8px; border: 0; padding: 2px 10px; }
  #runs td::before { content: attr(data-label); color: var(--text-secondary); }
}

.details { background: var(--surface-1); border: 1px solid var(--chart-chrome); border-radius: 12px; padding: 4px 16px 16px; margin-top: 24px; }
.details-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.details-head h2 { overflow-wrap: anywhere; }
.details .kv th { width: 14em; font-weight: 500; }
.details .components td:nth-child(1), .details .components td:nth-child(5) { overflow-wrap: anywhere; }
.details .components td:nth-child(3), .details .components td:nth-child(4) { max-width: 22em; }
.details .badge { margin-left: 8px; font-size: 0.75rem; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-primary); }
@media (max-width: 640px) {
  .details .kv th { width: auto; }
  .details .components thead { display: none; }
  .details .components tr, .details .components td { display: block; border: 0; padding: 2px 0; }
  .details .components tr { border-bottom: 1px solid var(--chart-grid); padding: 6px 0; }
}
.method p { max-width: 75ch; }
footer { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--chart-grid); font-size: 0.9rem; }
.notice { background: var(--surface-2); padding: 12px; border-radius: 8px; }
h2[tabindex="-1"]:focus { outline: none; }
