/* Headlines use Avenir Next where the device has it (Mac, iPhone, iPad); elsewhere the free, self-hosted
   Nunito Sans stands in. Avenir Next is a licensed font, so it is never served from this site. */
@font-face { font-family: "RaceWatcher Display Fallback"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "RaceWatcher Display Fallback"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/nunito-sans-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "RaceWatcher Display Fallback"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "RaceWatcher Display Fallback"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/nunito-sans-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "RaceWatcher Display Fallback"; font-style: normal; font-weight: 800; font-display: swap; src: url("/static/fonts/nunito-sans-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "RaceWatcher Display Fallback"; font-style: normal; font-weight: 800; font-display: swap; src: url("/static/fonts/nunito-sans-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* RaceWatcher. Fonts are self-hosted on purpose: loading them from Google sends visitors' IPs to a third party (GDPR). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --ink: #0b0a08;
  --panel: #14120e;
  --raise: #1c1913;
  --line: #2b2619;
  --line-strong: #463d27;
  --text: #ece5d3;
  --muted: #9c937f;
  --gold: #d2a73f;
  --gold-bright: #ecc65e;
  --gold-dim: #6e5822;
  --loss: #e3735a;
  --gain: #8cbf75;
  --display: "Avenir Next", "Avenir Next LT Pro", "Avenir", "RaceWatcher Display Fallback", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ink); }
a { color: var(--gold-bright); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; padding-block: 12px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.12em;
  color: var(--text); text-decoration: none; text-transform: uppercase;
}
.brand svg { width: 22px; height: 22px; flex: none; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px;
  font-size: 14px; border-radius: 3px;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--gold-bright); }
.account { display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: transparent;
  padding: 8px 14px; border-radius: 3px; cursor: pointer;
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text);
}
.btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #120e04; }
.btn.primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: #120e04; }
.btn.lg { padding: 12px 20px; font-size: 15px; }

/* ---------- landing ---------- */
.hero { padding-block: 72px 56px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.eyebrow {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--gold); font-size: 14px; margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.005em; text-wrap: balance; margin: 0; line-height: 1.04; }
.hero h1 { font-size: clamp(36px, 5vw, 58px); text-transform: uppercase; letter-spacing: -0.005em; }
.hero h1 em { font-style: normal; color: var(--gold-bright); }
.lede { color: var(--muted); font-size: 17px; max-width: 34em; margin: 22px 0 30px; }
.lede strong { color: var(--text); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.preview {
  border: 1px solid var(--line-strong); background: var(--panel);
  border-radius: 4px; overflow: hidden;
}
.preview-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.preview .incident { border-bottom: 0; }

.band { border-top: 1px solid var(--line); }
.band .wrap { padding-block: 56px; }
.band h2 { font-size: 28px; text-transform: uppercase; letter-spacing: 0; margin-bottom: 28px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps li { border-top: 2px solid var(--gold-dim); padding-top: 16px; }
.steps .n { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 15px; letter-spacing: 0.12em; }
.steps h3 { font-size: 19px; margin: 4px 0 8px; }
.steps p { margin: 0; color: var(--muted); }
.steps code { font-family: var(--mono); font-size: 13px; color: var(--text); word-break: break-all; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.facts li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts li span:first-child { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-size: 14px; padding-top: 2px; }
.facts li span:last-child { color: var(--muted); }
.note-box { border-left: 2px solid var(--gold-dim); padding: 4px 0 4px 20px; color: var(--muted); max-width: 32em; }
.note-box h3 { color: var(--text); font-size: 22px; margin-bottom: 10px; }
.note-box p { margin: 0 0 12px; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer .wrap { padding-block: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- report ---------- */
.upload {
  margin-top: 28px; padding: 14px 18px;
  border: 1px dashed var(--line-strong); border-radius: 4px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  transition: border-color .15s, background .15s;
}
.upload.drag { border-color: var(--gold-bright); background: var(--raise); }
.upload .file { min-width: 0; flex: 1 1 260px; }
.upload .file b { display: block; font-family: var(--mono); font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.upload .file span { color: var(--muted); font-size: 13px; }
.upload .file code { font-family: var(--mono); font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.sample-flag { color: var(--gold); }
.error { color: var(--loss); font-size: 14px; margin-top: 10px; }

.race { padding-block: 36px 12px; }
.race .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.race h1 { font-size: clamp(30px, 4.4vw, 46px); text-transform: uppercase; letter-spacing: 0.01em; }
.tally { display: flex; flex-wrap: wrap; gap: 0; margin-top: 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tally div { padding: 12px 28px 12px 0; margin-right: 28px; border-right: 1px solid var(--line); }
.tally div:last-child { border-right: 0; }
.tally b { display: block; font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.tally span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 22px 14px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 57px); z-index: 4; background: var(--ink); }
.tabs { display: flex; gap: 0; border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; }
.tabs button {
  background: transparent; border: 0; padding: 9px 16px; cursor: pointer; font-weight: 500; font-size: 14px;
  color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.tabs button + button { border-left: 1px solid var(--line-strong); }
.tabs button[aria-selected="true"] { background: var(--gold); color: #120e04; }
.tabs button:not([aria-selected="true"]):hover { color: var(--text); }
.tabs .count { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 2px; background: var(--raise); color: var(--text); }
.tabs button[aria-selected="true"] .count { background: #120e04; color: var(--gold-bright); }
.controls .spacer { flex: 1; }
.select-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
select {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 3px;
  padding: 8px 10px; max-width: 220px;
}
.list-note { color: var(--muted); font-size: 13px; margin: 0 0 10px; }

.incidents { border-top: 1px solid var(--line); }
.incident { border-bottom: 1px solid var(--line); }
.incident > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 54px 118px minmax(0, 1fr) auto 76px 18px; gap: 16px; align-items: center;
  padding: 14px 4px;
}
.incident > summary::-webkit-details-marker { display: none; }
.incident > summary:hover { background: var(--panel); }
.incident[open] > summary { background: var(--panel); }
.inc-id { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; }
.inc-when { font-size: 13px; line-height: 1.3; }
.inc-when b { display: block; font-weight: 600; font-size: 14px; }
.inc-when span { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.inc-cars { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; }
.car { white-space: nowrap; font-size: 14px; }
.num {
  display: inline-block; min-width: 2.2em; text-align: center; font-family: var(--display); font-weight: 700;
  font-size: 14px; padding: 0 4px; margin-right: 6px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--gold-bright);
}
.vs { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  padding: 2px 7px; border-radius: 2px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap;
}
.tag.out { border-color: var(--loss); color: var(--loss); }
.tag.dmg { color: var(--text); }
.tag.pen { border-color: var(--gold); color: var(--gold-bright); }
.impact { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.impact i { display: block; width: 9px; background: var(--line-strong); border-radius: 1px; }
.impact i:nth-child(1) { height: 5px; } .impact i:nth-child(2) { height: 8px; } .impact i:nth-child(3) { height: 11px; }
.impact i:nth-child(4) { height: 14px; } .impact i:nth-child(5) { height: 16px; }
.impact i.on { background: var(--gold); }
.chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.incident[open] .chev { transform: rotate(180deg); color: var(--gold); }

.detail { padding: 4px 4px 24px 74px; background: var(--panel); display: grid; gap: 18px; }
.detail .summary-line { margin: 0; color: var(--muted); max-width: 70ch; }
.replay { display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.replay b { color: var(--text); font-weight: 500; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
.pos { font-family: var(--mono); white-space: nowrap; }
.chg-loss { color: var(--loss); } .chg-gain { color: var(--gain); } .chg-none { color: var(--muted); }
.out-text { color: var(--loss); }
.sub-h { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; color: var(--gold); margin: 0 0 6px; }
.touches { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.touches .t { font-family: var(--mono); color: var(--muted); font-size: 12px; margin-left: 8px; }
.footnote { color: var(--muted); font-size: 12px; margin: 0; }
.empty { padding: 40px 0; color: var(--muted); }

/* ---------- dialog ---------- */
dialog {
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  border-radius: 4px; padding: 28px; width: min(420px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog h2 { font-size: 28px; text-transform: uppercase; margin-bottom: 18px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; }
.field input { background: var(--ink); border: 1px solid var(--line-strong); border-radius: 3px; padding: 10px 12px; }
.field input:focus { border-color: var(--gold); outline: none; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.dialog-msg { color: var(--gold-bright); font-size: 14px; margin: 10px 0 0; }

.preview .incident > summary { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; cursor: default; }
.preview .incident > summary .inc-id { grid-row: span 3; align-self: start; }
.preview .incident > summary .inc-when { grid-column: 2; display: flex; gap: 10px; align-items: baseline; }
.preview .incident > summary .inc-when b { display: inline; }
.preview .incident > summary .impact { grid-column: 3; grid-row: 1; }
.preview .incident > summary .inc-cars { grid-column: 2 / 4; }
.preview .incident > summary .tags { grid-column: 2 / 4; justify-content: flex-start; }
.preview .incident > summary .chev { display: none; }
.preview .incident + .incident { border-top: 1px solid var(--line); }
.preview-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.detail table { min-width: 680px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 44px 40px; gap: 36px; }
  .split, .steps { grid-template-columns: minmax(0, 1fr); }
  .incident > summary { grid-template-columns: 44px minmax(0, 1fr) 18px; gap: 6px 12px; }
  .incident > summary .inc-id { grid-row: span 3; align-self: start; }
  .incident > summary .inc-when { grid-column: 2; display: flex; gap: 10px; align-items: baseline; }
  .incident > summary .inc-when b { display: inline; }
  .incident > summary .chev { grid-column: 3; grid-row: 1; }
  .incident > summary .inc-cars { grid-column: 2 / 4; }
  .incident > summary .tags { grid-column: 2; justify-content: flex-start; }
  .incident > summary .impact { grid-column: 3; grid-row: 3; }
  .detail { padding-left: 4px; }
  .controls { top: calc(env(safe-area-inset-top, 0px) + 53px); }
}
@media (max-width: 560px) {
  .topbar .wrap { flex-wrap: wrap; row-gap: 6px; }
  .brand { margin-right: auto; }
  .nav { order: 3; width: 100%; margin: 0 -10px; }
  .account .btn { padding: 7px 10px; }
  .tally div { padding-right: 16px; margin-right: 16px; }
  .facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .controls { position: static; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* =====================================================================
   App pages (accounts, race list, upload, legal). Same rules as the report:
   hairlines over boxes, gold only for what you can act on or must notice.
   ===================================================================== */
main { flex: 1 0 auto; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--gold); color: #120e04; padding: 8px 12px; }
.skip:focus { left: 8px; }
.account form { margin: 0; }
.user-chip { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.user-chip a { color: var(--text); text-decoration: none; }
.user-chip a:hover { color: var(--gold-bright); }
.btn.link { border-color: transparent; color: var(--muted); padding-inline: 8px; }
.btn.link:hover { color: var(--text); border-color: transparent; }
.btn.danger { border-color: var(--loss); color: var(--loss); }
.btn.danger:hover { background: var(--loss); color: #120e04; border-color: var(--loss); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; justify-content: center; }

.flash { border-bottom: 1px solid var(--gold-dim); background: #19150b; }
.flash .wrap { padding-block: 10px; font-size: 14px; color: var(--gold-bright); }
.notice { border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); padding: 12px 16px; font-size: 14px; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notice form { margin: 0 0 0 auto; }
.notice strong { color: var(--text); font-weight: 500; }

/* page head */
.page-head { padding-block: 40px 20px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 42px); text-transform: uppercase; letter-spacing: 0.01em; }
.page-head .grow { flex: 1; min-width: 0; }
.page-head p { color: var(--muted); margin: 8px 0 0; }
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--gold-bright); }

/* forms */
.field label, .label { font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea, .input {
  background: var(--ink); border: 1px solid var(--line-strong); border-radius: 3px; padding: 10px 12px; width: 100%; max-width: none;
}
.field textarea { min-height: 120px; resize: vertical; font: inherit; color: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); outline: none; }
.field .hint { color: var(--muted); font-size: 13px; }
.field .err, .form-err { color: var(--loss); font-size: 13px; }
.form-err { font-size: 14px; border-left: 2px solid var(--loss); padding: 4px 0 4px 12px; margin: 0 0 16px; }
.field[aria-invalid="true"] input { border-color: var(--loss); }
.check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; margin-bottom: 12px; color: var(--muted); }
.check input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--gold); }
.check a { color: var(--text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { color: var(--muted); font-size: 14px; margin-top: 18px; }

/* auth pages: form on the left, a real incident on the right */
.auth { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 72px; padding-block: 56px 72px; align-items: start; }
.auth h1 { font-size: 34px; text-transform: uppercase; margin-bottom: 8px; }
.auth .sub { color: var(--muted); margin: 0 0 28px; }
.auth aside { border-left: 1px solid var(--line); padding-left: 48px; color: var(--muted); }
.auth aside h2 { color: var(--text); font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px; }
.auth aside ol { padding-left: 20px; margin: 0 0 24px; display: grid; gap: 8px; }
.auth aside .preview { margin-top: 8px; }

/* race list: a results sheet */
.races { width: 100%; border-collapse: collapse; }
.races th { padding: 8px 16px 8px 0; }
.races td { padding: 14px 16px 14px 0; vertical-align: middle; }
.races tbody tr { position: relative; }
.races tbody tr:hover { background: var(--panel); }
.races td:first-child { padding-left: 4px; }
.races .race-name a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.races .race-name a::after { content: ""; position: absolute; inset: 0; }
.races .race-name a:focus-visible { outline: none; }
.races tr:focus-within { outline: 2px solid var(--gold-bright); outline-offset: -2px; }
.races .race-name .sub { margin-top: 2px; }
.races .n { font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.races .n.zero { color: var(--muted); }
.races .mono { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.status.ready::before { background: var(--gain); }
.status.queued::before, .status.processing::before { background: var(--gold); }
.status.done::before { background: var(--gold-bright); }
.status.failed::before { background: var(--loss); }
.col-hide-sm { }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 4px; padding: 40px 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.empty-state h2 { font-size: 22px; text-transform: uppercase; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0; max-width: 46em; }
.empty-state code, .path { font-family: var(--mono); font-size: 13px; color: var(--text); overflow-wrap: anywhere; }

/* upload */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 56px; padding-bottom: 72px; }
.drop { border: 1px dashed var(--line-strong); border-radius: 4px; padding: 32px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; display: block; }
.drop:hover, .drop.drag { border-color: var(--gold-bright); background: var(--panel); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.drop b { display: block; font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: 14px; }
.drop .chosen { font-family: var(--mono); color: var(--gold-bright); font-size: 14px; margin-top: 10px; display: block; overflow-wrap: anywhere; }
.step-label { font-family: var(--display); font-weight: 600; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-size: 13px; margin: 0 0 6px; }
.locked { border: 1px solid var(--line); border-radius: 4px; padding: 18px 20px; margin-top: 28px; }
.locked h3 { font-size: 20px; text-transform: uppercase; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.locked p { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.pill { font-family: var(--body); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 2px; border: 1px solid var(--gold); color: var(--gold-bright); }
.side-help { color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: 28px; }
.side-help h2 { color: var(--text); font-size: 20px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.side-help ol { padding-left: 18px; display: grid; gap: 8px; margin: 0 0 20px; }
.busy { display: none; color: var(--muted); font-size: 14px; margin-left: 12px; }
form.sending .busy { display: inline; }

/* race page extras */
.race-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.race-actions form { margin: 0; display: flex; gap: 8px; }
.race-actions details { position: relative; }
.race-actions details > summary { list-style: none; }
.race-actions details > summary::-webkit-details-marker { display: none; }
.popover { position: absolute; z-index: 6; top: calc(100% + 6px); left: 0; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 4px; padding: 14px; width: min(340px, calc(100vw - 32px)); display: grid; gap: 10px; }
.popover p { margin: 0; color: var(--muted); font-size: 14px; }
.replay-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; margin-top: 22px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.replay-panel .grow { flex: 1 1 320px; min-width: 0; }
.replay-panel b { font-weight: 500; }
.replay-panel p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.clips { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.clips video { width: 100%; border: 1px solid var(--line-strong); border-radius: 3px; background: #000; }
.clips figcaption { font-size: 12px; color: var(--muted); }
.sample-banner { margin-top: 24px; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: 4px; margin-bottom: 40px; }
.plan { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.plan + .plan { border-left: 1px solid var(--line-strong); }
.plan.featured { background: var(--panel); }
.plan h2 { font-size: 26px; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.plan .price { font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--gold-bright); }
.plan .price small { font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 400; }
.plan p { color: var(--muted); margin: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; flex: 1; }
.plan li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
.plan li::before { content: ""; width: 10px; height: 2px; background: var(--gold); margin-top: 10px; }
.plan li.no { color: var(--muted); }
.plan li.no::before { background: var(--line-strong); }
.plan .fine { font-size: 12px; color: var(--muted); }
.faq { max-width: 760px; padding-bottom: 72px; }
.faq h2 { font-size: 24px; text-transform: uppercase; margin-bottom: 16px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 500; }
.faq details p { color: var(--muted); margin: 0 0 16px; }

/* account */
.settings { display: grid; gap: 0; max-width: 860px; padding-bottom: 72px; }
.settings section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.settings h2 { font-size: 20px; text-transform: uppercase; letter-spacing: .04em; }
.settings .desc { color: var(--muted); font-size: 13px; margin-top: 6px; }
.settings form { display: grid; gap: 4px; max-width: 440px; }
.settings dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; margin: 0 0 16px; font-size: 14px; }
.settings dt { color: var(--muted); }
.settings dd { margin: 0; }
.danger-zone h2 { color: var(--loss); }

/* legal prose */
.prose { max-width: 760px; padding-bottom: 72px; }
.prose h1 { font-size: clamp(34px, 5vw, 46px); text-transform: uppercase; margin: 40px 0 6px; }
.prose .updated { color: var(--muted); font-family: var(--mono); font-size: 13px; margin: 0 0 28px; }
.prose h2 { font-size: 22px; text-transform: uppercase; letter-spacing: .03em; margin: 36px 0 10px; }
.prose h3 { font-size: 18px; margin: 22px 0 6px; }
.prose p, .prose li { color: #cfc7b3; }
.prose ul, .prose ol { padding-left: 22px; display: grid; gap: 6px; }
.prose table { margin: 12px 0 20px; }
.prose .todo { background: #3a2a0c; color: var(--gold-bright); padding: 0 4px; border-radius: 2px; font-family: var(--mono); font-size: 13px; }
.prose .tldr { border-left: 2px solid var(--gold); padding: 6px 0 6px 18px; margin: 0 0 28px; }
.prose .tldr p { margin: 0 0 6px; color: var(--text); }

/* footer */
.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: start; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); text-decoration: underline; }

/* welcome extras */
.compare { width: 100%; }
.compare td:first-child { color: var(--text); }
.compare td { color: var(--muted); }
.compare .yes { color: var(--gold-bright); }
.who { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.who div { border-top: 1px solid var(--line-strong); padding-top: 14px; }
.who h3 { font-size: 20px; text-transform: uppercase; margin-bottom: 6px; }
.who p { color: var(--muted); margin: 0; font-size: 14px; }
.cta-band { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { margin: 0 !important; }

@media (max-width: 860px) {
  .auth, .upload-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 32px 56px; }
  .auth aside, .side-help { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--line-strong); }
  .settings section { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .empty-state { grid-template-columns: minmax(0, 1fr); padding: 28px 20px; }
  .who { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .site-foot .wrap { grid-template-columns: minmax(0, 1fr); }
  .col-hide-sm { display: none; }
}
@media (max-width: 560px) {
  .user-chip .who-name { display: none; }
  .races th:nth-child(2), .races td:nth-child(2), .races th:nth-child(n+4), .races td:nth-child(n+4) { display: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-24 { margin-top: 24px; } .mt-28 { margin-top: 28px; } .mb-72 { margin-bottom: 72px; } .pb-72 { padding-bottom: 72px; } .ml-auto { margin-left: auto; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.drop.compact { padding: 10px 16px; }
.clips figure { margin: 0; }
.acct-sm { display: none; }
@media (max-width: 560px) { .acct-sm { display: inline; } }
.plan-state { color: var(--muted); font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.progress-bar { width: 100%; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress-bar i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .2s; }
