@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap");

/* Taco Trek: one green ("verde") at full strength on small marks only (runner dots, progress,
   the main button); its pale tints carry the areas. Status colours are for status alone.
   Our own name, mark and colours throughout: Taco Bell appears only as plain text naming the stops. */
:root {
  --ground: #f6f8f6;
  --surface: #ffffff;
  --raised: #f1f4f1;
  --active: #e9eee9;
  --border: #e3e8e3;
  --rule: #eef1ee;
  --control: #cfd6cf;
  --text: #121a15;
  --muted: #59635c;
  --accent: #1f7a4d;
  --accent-ink: #0f4d2e;
  --accent-soft: #eef7f1;
  --accent-track: #d6ebde;
  --negative: #c4242a;
  --negative-soft: #ffedea;
  --negative-ink: #831c1e;
  --warning: #b7791f;
  --warning-soft: #fffbeb;
  --warning-line: #fde68a;
  --warning-ink: #92400e;
  --idle: #8b958e;
  --focus: #1f6feb;
  --radius: 8px;
  --radius-control: 6px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* One gutter for every edge, growing with the screen. */
  --gutter: clamp(16px, 1.4vw, 32px);

  /* Names the map reads (map.ts). */
  --verde: var(--accent); --salsa: var(--negative); --cheddar: var(--warning);
  --stone: var(--idle); --ink: var(--text); --paper: var(--ground);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d0f0e; --surface: #151816; --raised: #1c201d; --active: #242a26;
    --border: #232825; --rule: #1d221f; --control: #3f4741;
    --text: #eef2ef; --muted: #a9b2ab;
    --accent: #4fbf84; --accent-ink: #a5e0bf; --accent-soft: #15241b; --accent-track: #1f3a2a;
    --negative: #f0646a; --negative-soft: #2c191a; --negative-ink: #ffb4b0;
    --warning: #f2c14e; --warning-soft: #2a2414; --warning-line: #5a4a1c; --warning-ink: #f6d58a;
    --idle: #77817a; --focus: #6aa5ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0d0f0e; --surface: #151816; --raised: #1c201d; --active: #242a26;
  --border: #232825; --rule: #1d221f; --control: #3f4741;
  --text: #eef2ef; --muted: #a9b2ab;
  --accent: #4fbf84; --accent-ink: #a5e0bf; --accent-soft: #15241b; --accent-track: #1f3a2a;
  --negative: #f0646a; --negative-soft: #2c191a; --negative-ink: #ffb4b0;
  --warning: #f2c14e; --warning-soft: #2a2414; --warning-line: #5a4a1c; --warning-ink: #f6d58a;
  --idle: #77817a; --focus: #6aa5ff; color-scheme: dark;
}

/* Everything below is sized in rem, so the whole page keeps its proportions:
   ~15px type on a laptop, ~17px at 1920 and ~20px on a 2560 monitor. */
html { font-size: clamp(15px, calc(9px + 0.42vw), 20px); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--text);
  font: 1rem/1.45 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sub { font-size: 0.875rem; color: var(--muted); }
.num, .count b, table.runners { font-variant-numeric: tabular-nums; }

/* ---------- Top bar: mark, race, live state, counts ---------- */
.top {
  display: flex; align-items: center; gap: 0.75rem 1.5rem; flex-wrap: wrap;
  padding: 0.875rem var(--gutter);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.mark { width: 2.25rem; height: 2.25rem; flex: none; display: block; }
.brand-text { min-width: 0; }
.brand h1 { font-size: 1.375rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0; white-space: nowrap; }
.brand h1 .page { font-weight: 500; color: var(--muted); }
.brand h1 .page::before { content: "/"; margin: 0 0.4em; color: var(--control); }
.race-line { margin: 0.125rem 0 0; font-size: 0.875rem; color: var(--muted); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.race-line .race { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race-state { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.race-state::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--idle); }
.race-state.live::before { background: var(--accent); box-shadow: 0 0 0 0.1875rem var(--accent-track); }
.race-state.live { color: var(--accent-ink); }

/* The counts are one strip split by hairlines, label over value. */
.counts { display: flex; margin-left: auto; }
.count { display: flex; flex-direction: column; align-items: flex-start; padding: 0 1.125rem; border-left: 1px solid var(--border); min-width: 5.5rem; }
.count:first-child { border-left: 0; }
.count:last-child { padding-right: 0; }
.count span { font-size: 0.8125rem; color: var(--muted); order: -1; white-space: nowrap; }
.count b { font-size: 1.5rem; line-height: 1.15; font-weight: 600; }
.count.attn b { color: var(--negative); }

.demo-bar {
  display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap;
  padding: 0.4375rem var(--gutter); font-size: 0.875rem;
  background: var(--warning-soft); color: var(--warning-ink); border-bottom: 1px solid var(--warning-line);
}
.demo-bar strong { font-weight: 700; }
.demo-bar .clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.demo-bar select { padding: 0.125rem 0.25rem; border: 1px solid var(--warning-line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); }
.demo-bar .btn { border-color: var(--warning-line); background: var(--surface); color: var(--text); }
.demo-bar a { color: var(--warning-ink); font-weight: 600; }

/* ---------- Route strip (the signature element): every runner on the line of stops ---------- */
.strip-wrap { padding: 0.5rem var(--gutter) 0.25rem; background: var(--surface); border-bottom: 1px solid var(--border); }
/* The strip is drawn to whatever height it is given (see renderStrip). */
.strip { width: 100%; height: clamp(5.5rem, 13vh, 9rem); display: block; overflow: visible; font-size: 0.75rem; }
.strip .road { stroke: var(--control); stroke-width: 4; stroke-linecap: round; }
.strip .stop circle { fill: var(--surface); stroke: var(--text); stroke-width: 2.5; }
.strip .stop.endpoint circle { fill: var(--text); }
.strip .stop text { font: 600 1em var(--font); fill: var(--text); }
.strip .stop .mi { font: 400 0.95em var(--font); fill: var(--muted); }
.strip .dot { fill: var(--accent); }
.strip .dot.finished { fill: var(--idle); }
.strip .dot.warn { fill: var(--warning); }
.strip .dot.urgent { fill: var(--negative); }
.strip .dot.away { fill: var(--warning); }
.strip .dot.sel { stroke: var(--text); stroke-width: 2.5; }

/* ---------- Buttons & inputs ---------- */
.btn {
  border: 1px solid var(--control); background: var(--surface); border-radius: var(--radius-control);
  padding: 0.4375rem 0.875rem; cursor: pointer; font-weight: 600; line-height: 1.2;
  transition: background-color .12s, border-color .12s, transform .08s;
}
.btn:hover { background: var(--raised); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger { border-color: var(--negative); color: var(--negative); }
.btn.danger:hover { background: var(--negative-soft); }
.btn.small { padding: 0.3125rem 0.625rem; font-size: 0.8125rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.input {
  width: 100%; padding: 0.5rem 0.75rem; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--surface);
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-track); }

/* Progress: a pale track with the full green to the runner's share of the course. */
.track { display: block; height: 0.3125rem; border-radius: 99px; background: var(--accent-track); overflow: hidden; }
.track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.track.done i { background: var(--idle); }

/* ---------- Map ---------- */
.map { position: relative; min-height: 320px; background: var(--raised); }
.map .maplibregl-ctrl-attrib { font-size: 11px; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.875rem; }
.cp-pin {
  font: 700 0.75rem/1 var(--font); background: var(--text); color: var(--surface);
  padding: 0.25rem 0.375rem; border-radius: 4px; white-space: nowrap; transform: translateY(-14px);
}

/* ---------- Trend & status chips ---------- */
.trend { font-weight: 600; white-space: nowrap; font-size: 0.875rem; }
.trend.closing { color: var(--accent); }
.trend.away { color: var(--negative); }
.trend.stopped, .trend.steady, .trend.unknown { color: var(--muted); }
.status { flex: none; font-size: 0.75rem; font-weight: 500; padding: 0.125rem 0.5rem; border-radius: 99px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.status.on_course { background: var(--accent-soft); color: var(--accent-ink); }
.status.finished { background: var(--active); color: var(--text); }
.tag { flex: none; font-size: 0.75rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 99px; white-space: nowrap; }
.tag.urgent { background: var(--negative-soft); color: var(--negative-ink); }
.tag.warn { background: var(--warning-soft); color: var(--warning-ink); box-shadow: inset 0 0 0 1px var(--warning-line); }
.tag.info { background: var(--raised); color: var(--text); }

/* ---------- Spectator layout ---------- */
.spect { display: grid; grid-template-columns: clamp(300px, 24vw, 520px) minmax(0, 1fr); }
.spect .side {
  padding: 1rem var(--gutter) 0.75rem; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; min-height: 0;
}
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.side-head h2, .alerts h2, .table-head h2 { font-size: 1.125rem; line-height: 1.2; font-weight: 600; margin: 0; }
.map-wrap { position: relative; min-width: 0; min-height: 0; display: grid; }
.spect .map { min-height: 520px; }
.runner-list { list-style: none; margin: 0 calc(-0.5rem); padding: 0; overflow: auto; max-height: 60vh; }
.runner-list li + li .runner-row { box-shadow: inset 0 1px 0 var(--rule); }
.runner-row {
  width: 100%; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: 0.25rem 0.625rem; align-items: center;
  padding: 0.625rem 0.5rem; background: none; border: 0; border-radius: var(--radius-control); text-align: left; cursor: pointer;
  transition: background-color .12s;
}
.runner-row:hover { background: var(--raised); }
.runner-row.sel, .runner-list li + li .runner-row.sel { background: var(--accent-soft); box-shadow: none; }
.runner-row .who { min-width: 0; display: grid; gap: 0.1875rem; }
.runner-row .name { font-weight: 600; }
.runner-row .line2 { display: flex; align-items: center; gap: 0.5rem; }
.runner-row .line2 .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.runner-row .line2 .track { flex: 0 0 3.5rem; }
.star { background: none; border: 0; cursor: pointer; color: var(--control); padding: 0; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; transition: color .12s, transform .12s; }
.star svg { width: 1.125rem; height: 1.125rem; fill: currentColor; }
.star:hover { color: var(--warning); }
.star:active { transform: scale(.9); }
.star[aria-pressed="true"] { color: var(--warning); }
.empty { color: var(--muted); padding: 1rem 0.5rem; }
.side-note { margin: 0; padding-top: 0.625rem; font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--rule); }

/* The focused runner floats over the map, so the list beside it never moves. */
.detail {
  position: absolute; z-index: 3; top: var(--gutter); left: var(--gutter);
  width: clamp(280px, 22vw, 440px); max-height: calc(100% - 2 * var(--gutter)); overflow: auto;
  padding: 1rem 1.125rem 1.125rem; background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .12);
}
.detail h2 { font-size: 1.25rem; line-height: 1.15; font-weight: 700; margin: 0 0 0.125rem; padding-right: 4rem; }
.detail .x { position: absolute; top: 0.75rem; right: 0.75rem; }
.detail .big { display: flex; align-items: baseline; gap: 0.5rem; font-size: 1.75rem; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 0.875rem; }
.detail .big .sub { font-weight: 400; }
.detail .track { margin-top: 0.5rem; height: 0.375rem; }
.detail dl, dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3125rem 1rem; margin: 0.875rem 0 0; font-size: 0.875rem; }
.detail dt, dl.facts dt { color: var(--muted); }
.detail dd, dl.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.splits { list-style: none; padding: 0; margin: 0.75rem 0 0; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.splits li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3125rem 0; border-top: 1px solid var(--rule); }
.splits li span:first-child { font-weight: 600; }
.splits li span:last-child { color: var(--muted); }
.detail .actions { margin-top: 0.875rem; }

/* ---------- Admin layout ---------- */
.admin {
  display: grid; grid-template-columns: clamp(280px, 22vw, 420px) minmax(0, 1fr);
  grid-template-rows: minmax(360px, 46vh) auto;
  grid-template-areas: "alerts map" "table table";
}
.admin > * { min-width: 0; min-height: 0; }
.alerts { grid-area: alerts; overflow: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 1rem var(--gutter); }
.alerts h2 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
#alert-count:not(:empty) { font-size: 0.75rem; font-weight: 700; min-width: 1.5rem; padding: 0.0625rem 0.4375rem; border-radius: 99px; background: var(--negative); color: #fff; text-align: center; font-variant-numeric: tabular-nums; }
.alert {
  display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.625rem; padding: 0.75rem 0.875rem; margin-bottom: 0.5rem;
  border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), inset 3px 0 0 var(--warning);
  cursor: pointer; transition: background-color .12s;
}
.alert:hover { background: var(--raised); }
.alert.p0 { background: var(--negative-soft); box-shadow: inset 3px 0 0 var(--negative); }
.alert.acked { opacity: .7; }
.alert .who { font-weight: 600; }
.alert .what { font-size: 0.875rem; }
.alert.p0 .what { color: var(--negative-ink); font-weight: 600; }
.alert .when { font-size: 0.75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.alert .msg { grid-column: 1 / -1; font-size: 0.875rem; }
.alert .actions { grid-column: 1 / -1; display: flex; gap: 0.375rem; flex-wrap: wrap; margin-top: 0.25rem; }
.admin .map { grid-area: map; }
.table-area { grid-area: table; padding: 1rem var(--gutter) 0; background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.table-head { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.table-head .input { max-width: 18rem; margin-left: auto; padding-top: 0.375rem; padding-bottom: 0.375rem; }
.filters { display: flex; gap: 0.125rem; flex-wrap: wrap; padding: 0.1875rem; background: var(--raised); border-radius: var(--radius); }
.filters button { border: 0; background: none; border-radius: var(--radius-control); padding: 0.25rem 0.75rem; cursor: pointer; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.tbl-scroll { overflow: auto; max-height: 70vh; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
table.runners { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.runners th { position: sticky; top: 0; background: var(--surface); z-index: 1; text-align: left; font-weight: 500; font-size: 0.8125rem; color: var(--muted); padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.runners th button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
table.runners th button:hover { color: var(--text); }
table.runners th.num, table.runners td.num { text-align: right; }
table.runners td { padding: 0.5625rem 0.625rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.runners td:first-child { box-shadow: inset 3px 0 0 transparent; color: var(--muted); }
table.runners td.name { font-weight: 600; }
table.runners tr { cursor: pointer; }
table.runners tbody tr:hover td { background: var(--raised); }
table.runners tr.sel td { background: var(--accent-soft); }
table.runners tr.has-urgent td:first-child { box-shadow: inset 3px 0 0 var(--negative); }
table.runners tr.has-warn td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.pct-cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.pct-cell .track { width: 3.5rem; }
.batt.low { color: var(--negative); font-weight: 600; }

/* Drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(clamp(380px, 28vw, 560px), 100vw); background: var(--surface);
  padding: 1.25rem 1.25rem 1.75rem; overflow: auto; z-index: 20;
  box-shadow: 0 0 0 1px var(--border), -12px 0 32px rgb(0 0 0 / .12);
  transform: translateX(100%); visibility: hidden; transition: transform .22s cubic-bezier(.2,.8,.2,1), visibility 0s .22s;
}
.drawer.open { transform: none; visibility: visible; transition: transform .22s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer.open { transition: none; } }
.drawer h2 { font-size: 1.5rem; line-height: 1.1; font-weight: 700; margin: 0; padding-right: 4rem; }
.drawer .close { position: absolute; top: 1rem; right: 1rem; }
.drawer .chips { display: flex; gap: 0.375rem; flex-wrap: wrap; margin: 0.75rem 0 0; }
.drawer section { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.drawer h3 { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin: 0 0 0.5rem; }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 0.625rem; padding: 0.75rem; background: var(--raised); border-radius: var(--radius); }
.contact + .contact { margin-top: 0.375rem; }
.contact > div { min-width: 0; }
.contact .who { font-weight: 600; overflow-wrap: anywhere; }
.contact a.call { font-weight: 600; font-size: 0.875rem; text-decoration: none; background: var(--accent); color: #fff; padding: 0.4375rem 0.875rem; border-radius: var(--radius-control); white-space: nowrap; }
.contact a.call:hover { background: var(--accent-ink); }
.contact a.call.quiet { background: var(--surface); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--control); }
.medical { padding: 0.625rem 0.75rem; background: var(--warning-soft); color: var(--warning-ink); border: 1px solid var(--warning-line); border-radius: var(--radius); }
.drawer .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.drawer textarea { min-height: 4.5rem; resize: vertical; }

.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .25); z-index: 19; display: none; }
.scrim.open { display: block; }

.toast {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface);
  padding: 0.625rem 1rem; border-radius: var(--radius); font-weight: 600; z-index: 30; display: none;
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
.toast.show { display: block; }

/* ---------- Fit the screen (laptops and up) ----------
   The page is exactly one screen tall; the lists and the table scroll inside their own panes. */
@media (min-width: 861px) and (min-height: 560px) {
  body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body > main { flex: 1 1 auto; min-height: 0; }

  .spect { grid-template-rows: minmax(0, 1fr); }
  .spect .map { min-height: 0; }
  .runner-list { flex: 1 1 auto; min-height: 0; max-height: none; }

  .admin {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.25fr);
    grid-template-areas: "alerts map" "alerts table";
  }
  .admin .map { min-height: 0; }
  .tbl-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }
}
/* Big monitors: room for the whole table beside the map. */
@media (min-width: 2400px) and (min-height: 560px) {
  .admin {
    grid-template-columns: clamp(300px, 15vw, 420px) minmax(0, 1fr) minmax(0, 2fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "alerts map table";
  }
  .table-area { border-top: 0; border-left: 1px solid var(--border); }
}

/* ---------- Phones and small tablets: one column, the page scrolls ---------- */
@media (max-width: 860px) {
  .top { padding: 0.75rem 1.25rem; }
  .brand h1 { font-size: 1.25rem; }
  .counts { margin-left: 0; width: 100%; }
  .count { flex: 1 1 0; min-width: 0; padding: 0 0.75rem; }
  .count:first-child { padding-left: 0; }
  .count:last-child { padding-right: 0; }
  .count span { white-space: normal; line-height: 1.2; }
  .strip-wrap, .table-area, .demo-bar, .alerts, .spect .side { padding-left: 1.25rem; padding-right: 1.25rem; }
  .spect { grid-template-columns: 1fr; }
  .spect .side { border-right: 0; border-top: 1px solid var(--border); order: 2; }
  .map-wrap { order: 1; }
  .spect .map { min-height: 55vh; }
  .detail { top: auto; bottom: 0.75rem; left: 0.75rem; right: 0.75rem; width: auto; max-height: 70%; }
  .admin { grid-template-columns: 1fr; grid-template-rows: auto 50vh auto; grid-template-areas: "alerts" "map" "table"; }
  .alerts { border-right: 0; border-bottom: 1px solid var(--border); max-height: 50vh; }
  .table-head .input { max-width: none; margin-left: 0; }
  .filters { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .filters button { white-space: nowrap; }
  .tbl-scroll { margin: 0 -1.25rem; padding: 0; max-height: 75vh; }
  /* The table stays a table on a phone: it scrolls inside its frame with the bib and name pinned. */
  table.runners td:nth-child(-n+2), table.runners th:nth-child(-n+2) { position: sticky; background: var(--surface); z-index: 1; }
  table.runners th:nth-child(-n+2) { z-index: 2; }
  table.runners td:first-child, table.runners th:first-child { left: 0; padding-left: 1.25rem; }
  table.runners td:nth-child(2), table.runners th:nth-child(2) { left: 3.5rem; box-shadow: 1px 0 0 var(--rule); }
  .drawer { width: 100vw; }
}
@media (max-width: 480px) {
  .brand h1 .page { display: none; }
}
