:root {
  --bg: #fafaf8; --fg: #1d2127; --muted: #5d6673; --card: #ffffff; --line: #dcdfe4;
  --accent: #1f4e79; --warn-bg: #fff3c4; --warn-fg: #5c4400; --fail: #b00020;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171b; --fg: #e6e8eb; --muted: #9aa3ae; --card: #1c2025; --line: #323941;
    --accent: #8ab4e0; --warn-bg: #4a3b00; --warn-fg: #ffe9a3; --fail: #ff6b81;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font); }
a { color: var(--accent); }
main, .top, footer { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.7rem; margin: 1.2rem 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: .2rem 0 .3rem; }
.lead { color: var(--muted); max-width: 70ch; }
.note, footer { color: var(--muted); font-size: .9rem; }
.top { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding-top: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
nav a { text-decoration: none; }
.menu { position: relative; }
.menu summary { cursor: pointer; color: var(--accent); }
.menu div { position: absolute; z-index: 5; background: var(--card); border: 1px solid var(--line);
  padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 220px; right: 0; }
.banner { background: var(--warn-bg); color: var(--warn-fg); padding: 12px 16px; text-align: center;
  border-bottom: 2px solid var(--fail); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px;
  margin: 12px 0; min-width: 0; }
.card h3 + .note { margin: 0 0 6px; }
.empty { color: var(--muted); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); }
.scrollx { overflow-x: auto; max-width: 100%; }
.chart { width: 100%; min-height: 240px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 12px 0;
  position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 8px 0; }
.controls label, .chip { font-size: .9rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 14px; padding: 2px 10px; background: var(--card); cursor: pointer; }
.chip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chip.off { opacity: .45; text-decoration: line-through; }
select { font: inherit; padding: 2px 6px; background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 4px; }
.tablewrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; font-size: .9rem; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mark { color: var(--muted); font-weight: 700; cursor: help; text-align: center; }
.mono, code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.mono { word-break: break-all; }
pre { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); padding: 8px; }
.key .mk { display: inline-block; border: 1px dashed var(--muted); border-radius: 3px; padding: 0 5px;
  font-weight: 700; }
.key .mk.fail { color: var(--fail); border-color: var(--fail); }
.reasons { color: var(--muted); font-size: .85rem; }
footer { padding-top: 24px; padding-bottom: 32px; }
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .card { padding: 10px; }
  .chart { min-height: 280px; }
  .chart.wide { min-width: 960px; }
  .menu div { right: auto; left: 0; }
}
p code, li code, td code, th code { overflow-wrap: anywhere; }
.switch { font-size: .9rem; margin-left: auto; }
.switch select { max-width: 280px; }
.reportbar { max-width: 1180px; margin: 8px auto 0; padding: 6px 16px; font-size: .9rem; color: var(--muted);
  border-left: 3px solid var(--accent); }
.findings .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.finding h3 a { text-decoration: none; }
.finding p { margin: .3rem 0; }
.finding ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
.notes { border-left: 3px solid var(--muted); }
.pickers { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0; }
.pickers input, .pickers button, .tablebar button { font: inherit; padding: 2px 8px; background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 4px; }
.pickers button, .tablebar button { cursor: pointer; }
.summary { max-width: 80ch; }
.tablebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.sortable th button { all: unset; cursor: pointer; font-weight: 700; }
.sortable th button:focus-visible { outline: 2px solid var(--accent); }
.date { display: inline-block; font-variant-numeric: tabular-nums; font-size: .85rem; padding: 0 6px; border-radius: 4px;
  background: var(--line); color: var(--fg); white-space: nowrap; }
.reportbar .date { margin-right: 6px; }
.dateline { margin: 0 0 4px; }
th .date { margin-top: 2px; font-weight: normal; }
.banner.testrun { background: var(--line); color: var(--fg); }
.tag { display: inline-block; font-size: .8rem; padding: 0 6px; border-radius: 4px; border: 1px solid var(--muted);
  color: var(--muted); margin-left: 4px; }
