/* Best in Class: the sport-broadcast look from the approved mock-ups.
   One self-hosted variable face (Saira): wide + black for headlines, normal
   width for reading. Judges are often older and outdoors in sun: big type,
   strong contrast, 48px+ targets. Components use only the tokens below;
   keep the two dark blocks in step. */

@font-face {
  font-family: "Saira";
  src: url(/fonts/saira-latin-var.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 125%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f2f2ef;
  --surface: #ffffff;
  --sunk: #e7e7e3;
  --ink: #16161d;
  --muted: #555661;
  --line: #d6d6d1;
  --rule: #9a9aa0;
  --accent: #d3201a;        /* fills with white text */
  --accent-text: #c01c16;   /* red used as text on the page */
  --accent-on-carbon: #ff5a50;
  --win: #7d0d0a;
  --win-ink: #ffffff;
  --carbon: #16161d;
  --on-carbon: #ffffff;
  --on-carbon-muted: #c4c5cf;
  --ok: #17703a;
  --ok-bg: #dcefe2;
  --warn: #7a4300;
  --warn-bg: #f7e3c6;
  --danger: #a8170f;
  --focus: #1f5fd1;
  --scrim: rgba(10, 10, 14, .55);
  --shadow: 0 1px 2px rgba(22,22,29,.06), 0 6px 18px -8px rgba(22,22,29,.18);
  --sans: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --page: 600px;
  --tap: 48px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101117; --surface: #1a1b23; --sunk: #23252f; --ink: #f3f3f0; --muted: #a8a9b5; --line: #2e303b; --rule: #5d5f6c;
    --accent: #e2251d; --accent-text: #ff6a60; --accent-on-carbon: #ff6a60; --win: #8f1411; --win-ink: #ffffff;
    --carbon: #07080c; --on-carbon: #ffffff; --on-carbon-muted: #b4b5c1;
    --ok: #6fd896; --ok-bg: #17321f; --warn: #ffc77a; --warn-bg: #3a2a12; --danger: #ff8a80; --focus: #8fb2ff; --scrim: rgba(0,0,0,.7);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px -10px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101117; --surface: #1a1b23; --sunk: #23252f; --ink: #f3f3f0; --muted: #a8a9b5; --line: #2e303b; --rule: #5d5f6c;
  --accent: #e2251d; --accent-text: #ff6a60; --accent-on-carbon: #ff6a60; --win: #8f1411; --win-ink: #ffffff;
  --carbon: #07080c; --on-carbon: #ffffff; --on-carbon-muted: #b4b5c1;
  --ok: #6fd896; --ok-bg: #17321f; --warn: #ffc77a; --warn-bg: #3a2a12; --danger: #ff8a80; --focus: #8fb2ff; --scrim: rgba(0,0,0,.7);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px -10px rgba(0,0,0,.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule) var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-stretch: 100%; font-size: 18px; line-height: 1.45;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; overflow-wrap: anywhere; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.sprite { display: none; }
.i { width: 24px; height: 24px; flex: none; display: block; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* The broadcast voice */
.display { font-stretch: 125%; font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; line-height: .95; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.page-title { font-size: 34px; margin: 4px 0 16px; }

/* ---- shell ---- */
.app { outline: none; min-height: 100dvh; display: flex; flex-direction: column; }
.page { width: 100%; max-width: var(--page); margin: 0 auto; padding: 22px 20px 120px; flex: 1; }
.page.plain { padding-bottom: 48px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.offline-banner { position: fixed; left: 0; right: 0; top: 0; z-index: 30; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--warn-bg); color: var(--warn); text-align: center; font-weight: 700; font-size: 16px; }
.noscript { padding: 16px; }
.offline-page { display: grid; place-items: center; min-height: 80dvh; padding: 20px; }
.offline-page .card { max-width: 420px; }

.topbar {
  background: repeating-linear-gradient(118deg, transparent 0 46px, rgba(255,255,255,.045) 46px 92px), var(--carbon);
  color: var(--on-carbon);
  padding-top: env(safe-area-inset-top);
}
.topbar-in { display: flex; align-items: center; gap: 4px; max-width: var(--page); margin: 0 auto; padding: 10px 8px 10px 12px; min-height: 68px; }
.wide .topbar-in { max-width: 1200px; padding-inline: 20px 12px; }
.wordmark { font-stretch: 125%; font-weight: 900; font-size: 19px; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1; text-decoration: none; display: flex; align-items: center; gap: 9px; min-height: 48px; color: var(--on-carbon); white-space: nowrap; }
.wordmark i { display: block; width: 22px; height: 14px; background: var(--accent); transform: skewX(-20deg); }
.topbar .title { flex: 1; min-width: 0; padding-left: 4px; }
.topbar .title small { display: block; color: var(--on-carbon-muted); font-size: 14px; line-height: 1.2; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title strong { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer, .spacer { flex: 1; }
.topbar .iconbtn { color: var(--on-carbon); }
.topbar .iconbtn:hover { background: rgba(255,255,255,.1); }
.topbar .textlink { color: var(--on-carbon); text-decoration: none; font-weight: 700; font-size: 17px; min-height: 48px; display: inline-flex; align-items: center; padding: 0 12px; }

.tabs { display: flex; background: var(--surface); border-bottom: 2px solid var(--line); }
.tabs-in { display: flex; width: 100%; max-width: var(--page); margin: 0 auto; }
.tabs a, .tabs button { flex: 1; text-align: center; text-decoration: none; padding: 14px 4px 12px; min-height: 54px; font-weight: 600; font-size: 18px; color: var(--muted); position: relative; background: none; border: 0; cursor: pointer; }
.tabs [aria-current], .tabs [aria-selected="true"] { color: var(--ink); font-weight: 800; }
.tabs [aria-current]::after, .tabs [aria-selected="true"]::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -2px; height: 4px; background: var(--accent); }

.botnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.botnav ul { list-style: none; margin: 0 auto; padding: 0; display: flex; max-width: var(--page); }
.botnav li { flex: 1; }
.botnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px 10px; min-height: 66px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; position: relative; }
.botnav a[aria-current] { color: var(--ink); font-weight: 800; }
.botnav a[aria-current]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 4px; background: var(--accent); }
.botnav .i { width: 26px; height: 26px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 10px; }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; }
.section-head span { color: var(--muted); font-size: 16px; text-align: right; }

/* ---- buttons ---- */
.btn {
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border-radius: 12px; border: 0; font-weight: 800; font-size: 19px; line-height: 1.1;
  text-decoration: none; cursor: pointer; background: var(--sunk); color: var(--ink); transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ghost, .btn-secondary { background: transparent; box-shadow: inset 0 0 0 2.5px var(--ink); color: var(--ink); }
.btn-danger { background: transparent; box-shadow: inset 0 0 0 2.5px var(--danger); color: var(--danger); }
.btn-link { background: transparent; color: var(--accent-text); padding-inline: 4px; min-height: var(--tap); }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--ink); text-decoration: none; flex: none; }
.iconbtn:hover { background: var(--sunk); }
.pill { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px 0 22px; border: 2.5px solid var(--ink); border-radius: 999px; background: transparent; font-weight: 700; font-size: 19px; cursor: pointer; max-width: 100%; }
.pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; background: transparent; border: 0; color: var(--accent-text); font-weight: 800; font-size: 19px; padding: 0; cursor: pointer; text-align: left; }
.fab { position: fixed; right: max(20px, calc(50% - var(--page) / 2 + 20px)); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 6; box-shadow: 0 2px 4px rgba(0,0,0,.18), 0 12px 24px -10px rgba(0,0,0,.45); border-radius: 999px; padding: 0 24px 0 18px; }

/* ---- fields ---- */
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 700; font-size: 16px; }
.field .hint { color: var(--muted); font-size: 16px; margin: 0; }
.field .error { color: var(--danger); font-size: 16px; font-weight: 700; margin: 0; }
.input { width: 100%; min-height: 56px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-size: 19px; font-weight: 600; }
textarea.input { padding: 12px 16px; min-height: 110px; resize: vertical; line-height: 1.4; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.input:focus-visible { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input::placeholder { color: var(--muted); font-weight: 500; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 0; }
.swatches legend { font-weight: 700; font-size: 16px; margin-bottom: 6px; padding: 0; }
.swatches label { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; position: relative; }
.swatches input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatches input:checked + span { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.25); }
.swatches input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 10px; }

/* ---- card, tags, numbers ---- */
.card { background: var(--surface); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.badge, .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; padding: 3px 10px; border-radius: 6px; white-space: nowrap; background: var(--sunk); color: var(--ink); }
.tag-ok, .badge { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag .i, .badge .i { width: 16px; height: 16px; }
.carno { display: inline-grid; place-items: center; min-width: 58px; height: 44px; padding: 0 8px; background: var(--ink); color: var(--bg); font-stretch: 125%; font-weight: 900; font-size: 19px; border-radius: 6px; letter-spacing: -0.02em; flex: none; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 20px; margin-bottom: 6px; }

/* ---- sheet (a <dialog>: focus stays inside, Esc closes) ---- */
.sheet { border: 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); max-height: 92dvh; overflow: auto; }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: rise .2s ease-out; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 24px; }
.sheet form, .sheet .stack { gap: 16px; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 20px; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

/* ---- toast ---- */
.toasts { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); z-index: 40; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 700; animation: rise .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.toast .btn { min-height: 40px; margin-left: auto; padding: 0 12px; background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; font-size: 16px; }

/* ---- organizer: shows list ---- */
.showlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.showlist a { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); text-decoration: none; min-height: 88px; }
.showlist .what { flex: 1; min-width: 0; }
.showlist b { display: block; font-stretch: 112%; font-size: 21px; font-weight: 800; line-height: 1.2; }
.showlist span.meta { color: var(--muted); font-size: 16px; }

/* ---- setup ---- */
.show-card { background: var(--surface); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.show-card h1 { font-size: 32px; margin-bottom: 6px; }
.show-card .meta { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.unlock { display: grid; gap: 12px; background: var(--warn-bg); color: var(--warn); border-radius: 16px; padding: 18px 20px; margin-top: 16px; }
.unlock p { margin: 0; font-weight: 600; }
.unlock b { color: var(--ink); }
[data-theme="dark"] .unlock b { color: var(--warn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .unlock b { color: var(--warn); } }
.unlocked { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; margin: 16px 0 0; }
.classes { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.classes li { border-bottom: 1px solid var(--line); }
.classes button { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 72px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.classes .swatch { width: 10px; align-self: stretch; border-radius: 3px; transform: skewX(-12deg); flex: none; }
.classes .name { flex: 1; min-width: 0; }
.classes .name b { display: block; font-size: 19px; line-height: 1.25; }
.classes .name span { color: var(--muted); font-size: 16px; }
.classes .count { font-stretch: 125%; font-weight: 900; font-size: 24px; min-width: 40px; text-align: right; line-height: 1.1; }
.classes .count small { display: block; font-stretch: 100%; font-weight: 600; font-size: 13px; color: var(--muted); }
.classes .chev { color: var(--muted); }
.criteria { display: grid; gap: 10px; }
.crit-row { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 0 8px 0 18px; min-height: 64px; font-weight: 700; font-size: 18px; }
.crit-row .cname { flex: 1; min-width: 0; background: none; border: 0; text-align: left; font-weight: 700; padding: 10px 0; cursor: pointer; min-height: 48px; }
.crit-row .pts { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 16px; }
.crit-row .pts b { color: var(--ink); font-size: 19px; min-width: 22px; text-align: right; }
.stepper { display: flex; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; margin-left: 8px; }
.stepper button { width: 48px; height: 48px; border: 0; background: var(--surface); font-weight: 800; font-size: 22px; cursor: pointer; }
.stepper button + button { border-left: 2px solid var(--line); }
.stepper button:disabled { color: var(--rule); cursor: not-allowed; }
.locked-note { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 16px; margin: 10px 0 0; }
.judge-code { display: flex; align-items: center; gap: 16px; background: var(--carbon); color: var(--on-carbon); border-radius: 16px; padding: 18px 20px; }
/* one line, shrinking with the screen so even the widest code (MWW-888888) fits beside the QR down to 360px */
.judge-code .code { font-stretch: 125%; font-weight: 900; font-size: clamp(18px, 12vw - 23px, 30px); letter-spacing: .04em; line-height: 1; white-space: nowrap; }
.judge-code p { margin: 4px 0 0; color: var(--on-carbon-muted); font-size: 16px; line-height: 1.35; }
.judge-code .qrbox { width: 96px; height: 96px; background: #fff; border-radius: 10px; flex: none; padding: 2px; }
[data-theme="dark"] .judge-code { box-shadow: inset 0 0 0 1px var(--line); }
.qr { display: block; width: 100%; height: 100%; }
.invite-link { display: flex; gap: 8px; margin-top: 12px; }
.invite-link .input { font-size: 15px; min-height: 52px; }
.people { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.people li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 72px; }
.people .who { flex: 1; min-width: 0; }
.people .who b { display: block; font-size: 19px; }
.people .who span { color: var(--muted); font-size: 16px; }
.people .is-waiting .who .tag { margin-top: 4px; color: var(--warn); }
.btn-approve { min-height: var(--tap); padding: 0 16px; font-size: 17px; gap: 6px; }
.waiting .tag { justify-self: start; }
.waiting p { margin: 0; }
.meter { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter.done i { background: var(--ok); }

/* ---- cars ---- */
.tally { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.tally div { padding: 14px 14px 12px; min-width: 0; }
.tally div + div { border-left: 1px solid var(--line); }
.tally b { display: block; font-stretch: 125%; font-weight: 900; font-size: 28px; line-height: 1.05; }
.tally span { color: var(--muted); font-size: 15px; font-weight: 600; }
.tally .done b { color: var(--ok); }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 14px -20px 6px; padding: 0 20px 4px; scrollbar-width: none; }
.filters button { flex: none; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: 16px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { margin: 0 0 12px; }
.list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 2px solid var(--rule); }
.list li > a, .list li > button { display: flex; align-items: center; gap: 14px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 84px; width: 100%; background: none; text-align: left; cursor: pointer; }
.list .car { flex: 1; min-width: 0; }
.list .car b { display: block; font-size: 18px; line-height: 1.25; }
.list .car span { display: block; color: var(--muted); font-size: 16px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .state { text-align: right; flex: none; }
.car-scores { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.car-scores li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.car-scores li span { color: var(--muted); }

/* ---- judging ---- */
.join-hero { background: repeating-linear-gradient(118deg, transparent 0 46px, rgba(255,255,255,.045) 46px 92px), var(--carbon); color: var(--on-carbon); padding: 8px 20px 28px; }
.join-hero-in { max-width: var(--page); margin: 0 auto; }
.join-hero h1 { font-size: 40px; }
.join-hero p { color: var(--on-carbon-muted); margin: 12px 0 0; font-size: 18px; }
.codefield .input { font-stretch: 125%; font-weight: 900; font-size: 28px; letter-spacing: .06em; text-transform: uppercase; min-height: 64px; }
.jump { display: flex; gap: 10px; margin: 0 0 8px; }
.jump .input { font-stretch: 112%; font-weight: 800; font-size: 22px; }
.jump .btn { flex: none; }
.progress { height: 6px; background: var(--carbon); }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.carhead { background: var(--carbon); color: var(--on-carbon); padding: 6px 20px 24px; }
.carhead-in { max-width: var(--page); margin: 0 auto; }
.carhead .big { font-stretch: 125%; font-weight: 900; font-size: 84px; line-height: .9; letter-spacing: -0.03em; display: flex; align-items: flex-start; gap: 6px; }
.carhead .big small { font-size: 34px; color: var(--accent-on-carbon); line-height: 1.2; }
.carhead h1 { margin: 10px 0 2px; font-size: 24px; font-weight: 800; line-height: 1.2; }
.carhead p { margin: 0; color: var(--on-carbon-muted); font-size: 17px; }
.classchip { display: inline-block; margin-top: 12px; padding: 4px 12px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; }
.score-page { padding-top: 18px; padding-bottom: 150px; }
.crit { background: var(--surface); border-radius: 16px; padding: 16px 14px 14px; margin: 0 0 14px; box-shadow: var(--shadow); border: 0; min-width: 0; }
.crit legend { float: left; width: 100%; padding: 0; }
.crit-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px 12px; }
.crit-top h2 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; }
.crit-score { font-size: 17px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.crit-score b { font-stretch: 125%; font-weight: 900; font-size: 30px; color: var(--ink); }
.crit.todo .crit-score b { color: var(--muted); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; clear: both; }
.scale button { height: 60px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); font-stretch: 112%; font-weight: 800; font-size: 24px; cursor: pointer; padding: 0; }
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.note { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; border-radius: 12px; border: 2px dashed var(--rule); background: transparent; color: var(--muted); font-weight: 700; font-size: 17px; padding: 0 16px; cursor: pointer; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.savebar .in { max-width: calc(var(--page) - 32px); margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.savebar .total { line-height: 1.05; white-space: nowrap; }
.savebar .total b { font-stretch: 125%; font-weight: 900; font-size: 36px; }
.savebar .total span { color: var(--muted); font-weight: 700; font-size: 18px; }
.savebar .total small { display: block; color: var(--muted); font-size: 15px; font-weight: 600; }
.savebar .btn { flex: 1; min-height: 64px; font-size: 20px; }
.status-done { color: var(--ok); }

/* ---- results ---- */
.results-title { font-size: 40px; margin: 26px 0 20px; }
.winner { display: flex; align-items: center; gap: 16px; background: var(--win); color: var(--win-ink); border-radius: 14px; padding: 18px 18px 18px 20px; position: relative; overflow: hidden; }
.winner::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(118deg, transparent 0 38px, rgba(255,255,255,.06) 38px 76px); pointer-events: none; }
.winner .pos { font-stretch: 125%; font-weight: 900; font-size: 54px; line-height: .9; letter-spacing: -0.03em; position: relative; }
.winner .pos sup { font-size: 22px; vertical-align: top; margin-left: 2px; }
.winner .who { flex: 1; min-width: 0; position: relative; }
.winner .who small { display: block; font-size: 15px; font-weight: 600; opacity: .92; }
.winner .who b { display: block; font-size: 21px; font-weight: 800; line-height: 1.2; }
.winner .who span { font-size: 16px; opacity: .92; }
.winner .medal { width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--win); display: grid; place-items: center; flex: none; position: relative; }
.winner .medal .i { width: 30px; height: 30px; }
.table { width: 100%; border-collapse: collapse; margin-top: 26px; }
.table th { text-align: left; font-weight: 600; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; padding: 0 0 10px; border-bottom: 2px solid var(--rule); }
.table td { padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 18px; }
.table .num { text-align: right; }
.table .p { width: 52px; font-weight: 800; font-size: 20px; }
.table .c b { display: block; font-weight: 700; line-height: 1.25; }
.table .c span { color: var(--muted); font-size: 16px; }
.table td.num { font-stretch: 112%; font-weight: 800; font-size: 20px; width: 64px; }
.table tr.podium .p { color: var(--accent-text); }
.foot { color: var(--muted); font-size: 16px; margin: 16px 0 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.pending { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 16px; margin: 0 0 16px; }
.class-picker { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.class-picker button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: 18px; cursor: pointer; text-align: left; }
.class-picker button[aria-current="true"] { border-color: var(--ink); }
.class-picker .swatch { width: 10px; height: 28px; border-radius: 3px; transform: skewX(-12deg); flex: none; }
.awards { display: grid; gap: 18px; }
.award-class h3 { font-stretch: 112%; font-size: 20px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.award-class h3 .swatch { width: 10px; height: 22px; border-radius: 3px; transform: skewX(-12deg); }
.award-class ol { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.award-class li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.award-class li .pl { font-stretch: 125%; font-weight: 900; width: 48px; flex: none; color: var(--accent-text); }
.award-class li .c { flex: 1; min-width: 0; }
.award-class li .c span { display: block; color: var(--muted); font-size: 16px; }
.award-class li .pts { font-weight: 800; }
.announce { position: fixed; inset: 0; z-index: 60; background: repeating-linear-gradient(118deg, transparent 0 64px, rgba(255,255,255,.04) 64px 128px), var(--carbon); color: var(--on-carbon); display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); }
.announce .top { display: flex; justify-content: space-between; align-items: center; color: var(--on-carbon-muted); font-weight: 700; }
.announce .top .iconbtn { color: var(--on-carbon); }
.announce .body { flex: 1; display: grid; align-content: center; gap: 12px; max-width: 900px; margin: 0 auto; width: 100%; }
.announce .cls { color: var(--accent-on-carbon); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; }
.announce .place { font-stretch: 125%; font-weight: 900; font-size: clamp(64px, 18vw, 160px); line-height: .9; }
.announce .car { font-size: clamp(28px, 6vw, 52px); font-weight: 800; line-height: 1.1; }
.announce .owner { font-size: clamp(20px, 4vw, 32px); color: var(--on-carbon-muted); }
.announce .nav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; max-width: 900px; margin: 0 auto; width: 100%; }
.announce .btn-ghost { box-shadow: inset 0 0 0 2.5px var(--on-carbon); color: var(--on-carbon); }

/* ---- landing ---- */
.landing .wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hero { background: repeating-linear-gradient(118deg, transparent 0 64px, rgba(255,255,255,.04) 64px 128px), var(--carbon); color: var(--on-carbon); padding-bottom: 40px; padding-top: env(safe-area-inset-top); }
.hero .nav { display: flex; align-items: center; gap: 8px; min-height: 72px; }
.hero .iconbtn { color: var(--on-carbon); }
.hero .iconbtn:hover { background: rgba(255,255,255,.1); }
.hero .signin { color: var(--on-carbon); text-decoration: none; font-weight: 700; font-size: 17px; min-height: 48px; display: inline-flex; align-items: center; padding: 0 12px; }
.hero-grid { display: grid; gap: 36px; padding-top: 22px; }
.hero h1 { font-size: clamp(44px, 11vw, 92px); line-height: .92; }
.hero h1 span { display: block; }
.lede { font-size: 20px; line-height: 1.45; color: var(--on-carbon-muted); margin: 20px 0 28px; max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.cta-row .price { color: var(--on-carbon-muted); font-size: 17px; }
.cta-row .price b { color: var(--on-carbon); font-size: 20px; }
.board { background: var(--bg); color: var(--ink); border-radius: 22px; padding: 22px 20px 10px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); max-width: 440px; width: 100%; justify-self: center; }
.board .bh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.board .bh b { font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: 22px; line-height: 1; }
.live { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--accent-text); }
.live i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.bw { display: flex; align-items: center; gap: 14px; background: var(--win); color: #fff; border-radius: 12px; padding: 14px 16px; }
.bw .pos { font-stretch: 125%; font-weight: 900; font-size: 40px; line-height: .9; }
.bw .who { flex: 1; min-width: 0; }
.bw .who b { display: block; font-size: 18px; line-height: 1.2; }
.bw .who span { font-size: 15px; opacity: .92; }
.bw .pts { font-stretch: 112%; font-weight: 800; font-size: 22px; }
.board table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.board td { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.board tr:last-child td { border-bottom: 0; }
.board td:first-child { width: 36px; font-weight: 800; }
.board td:last-child { text-align: right; font-weight: 800; }
section.block { padding: 64px 0 8px; }
.block h2 { font-size: clamp(32px, 7vw, 54px); margin-bottom: 26px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--rule); }
.steps li { align-content: start; display: grid; grid-template-columns: 64px 1fr; gap: 6px 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps .n { font-stretch: 125%; font-weight: 900; font-size: 40px; line-height: 1; color: var(--accent-text); grid-row: span 2; }
.steps b { font-size: 21px; line-height: 1.25; }
.steps p { margin: 0; color: var(--muted); font-size: 18px; }
.why { display: grid; gap: 14px; }
.why > div { background: var(--surface); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.why .i { width: 32px; height: 32px; color: var(--accent-text); margin-bottom: 12px; }
.why b { display: block; font-size: 21px; line-height: 1.25; margin-bottom: 6px; }
.why p { margin: 0; color: var(--muted); font-size: 18px; }
.why .wide { background: var(--carbon); color: var(--on-carbon); }
.why .wide p { color: var(--on-carbon-muted); }
.why .wide .i { color: var(--accent-on-carbon); }
[data-theme="dark"] .why .wide, [data-theme="dark"] .board { box-shadow: inset 0 0 0 1px var(--line); }
.scoredemo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 16px; max-width: 300px; }
.scoredemo span { height: 46px; border-radius: 8px; border: 2px solid rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.scoredemo .on { background: var(--accent); border-color: var(--accent); color: #fff; }
.price-card { background: var(--surface); border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow); display: grid; gap: 22px; }
.price-card .amt { font-stretch: 125%; font-weight: 900; font-size: 88px; line-height: .85; letter-spacing: -0.03em; }
.price-card .amt small { font-size: 22px; font-stretch: 100%; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.price-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.price-card li { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; }
.price-card li .i { color: var(--ok); margin-top: 1px; }
.price-card .pnote { color: var(--muted); font-size: 16px; margin: 12px 0 0; }
.landing footer { padding: 56px 0 40px; color: var(--muted); font-size: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
@media (min-width: 900px) {
  .landing .wrap { padding: 0 48px; }
  .hero { padding-bottom: 72px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; align-items: center; padding-top: 48px; gap: 56px; }
  .lede { font-size: 22px; }
  .steps { grid-template-columns: repeat(4, 1fr); border-top: 0; gap: 28px; }
  .steps li { grid-template-columns: 1fr; border-top: 2px solid var(--rule); border-bottom: 0; padding-top: 18px; }
  .steps .n { grid-row: auto; font-size: 48px; margin-bottom: 8px; }
  .why { grid-template-columns: repeat(3, 1fr); }
  .why .wide { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; }
  .why .wide b { font-size: 30px; }
  .price-card { grid-template-columns: auto 1fr; gap: 56px; padding: 40px 48px; align-items: center; }
  section.block { padding-top: 96px; }
}

/* ---- base screens (account, sign-in, kit) ---- */
.plans { display: grid; gap: 12px; }
.kit-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-swatch { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); }
.sw-canvas { background: var(--bg); } .sw-surface { background: var(--surface); } .sw-accent { background: var(--accent); }
.sw-accent-soft { background: var(--sunk); } .sw-danger { background: var(--danger); } .sw-warn { background: var(--warn); }

/* ---- print: awards sheet and dash cards ---- */
.print-only { display: none; }
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #bbb; --rule: #000; --accent-text: #b0140f; --sunk: #eee; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .topbar, .tabs, .botnav, .fab, .toasts, .no-print, .offline-banner, .skip { display: none !important; }
  .print-only { display: block; }
  .page { max-width: none; padding: 0; }
  .card, .show-card { box-shadow: none; }
  .award-class { break-inside: avoid; }
  .dash-cards { display: block; }
  .dash-card { break-after: page; }
  @page { margin: 14mm; }
}
.dash-cards { display: grid; gap: 16px; }
.dash-card { background: #fff; color: #000; border-radius: 16px; padding: 22px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.dash-card .no { font-stretch: 125%; font-weight: 900; font-size: 120px; line-height: .85; letter-spacing: -0.04em; }
.dash-card .show { font-weight: 800; text-transform: uppercase; font-size: 16px; letter-spacing: .03em; }
.dash-card .car { font-size: 22px; font-weight: 800; line-height: 1.2; margin-top: 8px; }
.dash-card .cls { font-size: 17px; color: #444; }
.dash-card .qrbox { width: 150px; height: 150px; }
.dash-card .scan { font-size: 13px; color: #444; text-align: center; margin-top: 4px; }
@media print { .dash-card { box-shadow: none; border: 2px solid #000; min-height: 120mm; } .dash-card .no { font-size: 200pt; } .dash-card .qrbox { width: 60mm; height: 60mm; } }
.price-card [data-cta] { margin-top: 22px; }
.share-row { margin-top: 12px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 22px 0 16px; }
.fab.low { bottom: calc(24px + env(safe-area-inset-bottom)); }
.sheet .btn { width: 100%; }
.sheet .row2 .btn { width: auto; }
.swatch-dot { width: 10px; align-self: stretch; border-radius: 3px; transform: skewX(-12deg); flex: none; }
.bigqr { width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto; }
.bigcode { text-align: center; font-stretch: 125%; font-weight: 900; font-size: 40px; letter-spacing: .05em; margin: 14px 0 6px; }
.center { text-align: center; }
.gap { height: 10px; }
.award-class h3 .i { color: var(--accent-text); }
.row2 .btn { white-space: normal; padding: 0 14px; text-align: center; min-width: 0; }
@media (max-width: 459px) { .hero .nav .judges-link { display: none; } .hero .signin { padding: 0 8px; } }
[hidden] { display: none !important; }
@media (max-width: 559px) {
  .dash-card { grid-template-columns: 1fr; justify-items: start; }
  .dash-card .no { font-size: 104px; }
  .dash-card .qrbox { width: 140px; height: 140px; }
}
/* toasts sit above whatever is pinned to the bottom, never on top of it */
body:has(.fab:not(.low)) .toasts { bottom: calc(156px + env(safe-area-inset-bottom)); }
body:has(.fab.low) .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
body:has(.savebar) .toasts { bottom: calc(104px + env(safe-area-inset-bottom)); }
.hero h1 { overflow-wrap: normal; }
@media (min-width: 900px) { .hero h1 { font-size: clamp(56px, 5.4vw, 84px); } }
