/* WFD palette, from the department patch: black field, fire-engine red,
   gold lettering, maroon mountains. Barlow is modeled on highway signage. */
:root {
  --font-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #ece8e1;
  --text: #17130f;
  --muted: #625a52;
  --border: #ddd6cc;
  --accent: #c1121f;
  --accent-ink: #ffffff;
  --gold: #f2b705;
  --gold-ink: #17130f;
  --gold-text: #8a6400;
  --gold-soft: #fdf1c7;
  --maroon: #7d1128;
  --good: #1a7f37;
  --good-bg: #e5f3e8;
  --bad: #b42318;
  --bad-bg: #fbe9e7;
  --meh: #8a6400;
  --meh-bg: #fdf1c7;
  --header: #0d0b0a;
  --header-ink: #f5f3ef;
  --map-bg: #ece8e1;
  --map-city: #ffffff;
  --map-boundary: #c1121f;
  --map-road: #cbc4ba;
  --map-road-major: #7a7067;
  --map-label: #2a241f;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0b0a;
    --surface: #1a1715;
    --surface-2: #26211e;
    --text: #f3efe9;
    --muted: #a89e94;
    --border: #3a332e;
    --accent: #e3283a;
    --accent-ink: #ffffff;
    --gold: #f6c234;
    --gold-ink: #17130f;
    --gold-text: #f6c234;
    --gold-soft: #2e2510;
    --maroon: #b0304a;
    --good: #4ac26b;
    --good-bg: #12261a;
    --bad: #ff6b5e;
    --bad-bg: #2d1414;
    --meh: #f6c234;
    --meh-bg: #2e2510;
    --header: #000000;
    --map-bg: #120f0e;
    --map-city: #1c1816;
    --map-boundary: #e3283a;
    --map-road: #3d3631;
    --map-road-major: #857a70;
    --map-label: #ece6de;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0b0a; --surface: #1a1715; --surface-2: #26211e; --text: #f3efe9; --muted: #a89e94;
  --border: #3a332e; --accent: #e3283a; --accent-ink: #ffffff; --gold: #f6c234; --gold-ink: #17130f;
  --gold-text: #f6c234; --gold-soft: #2e2510; --maroon: #b0304a; --good: #4ac26b; --good-bg: #12261a;
  --bad: #ff6b5e; --bad-bg: #2d1414; --meh: #f6c234; --meh-bg: #2e2510; --header: #000000;
  --map-bg: #120f0e; --map-city: #1c1816; --map-boundary: #e3283a; --map-road: #3d3631;
  --map-road-major: #857a70; --map-label: #ece6de; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--font-body);
}
a { color: var(--accent); }
code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; font-size: 0.9em; }
kbd { font: 600 11px/1 ui-monospace, monospace; border: 1px solid var(--border); border-radius: 4px; padding: 2px 5px; color: var(--muted); margin-right: 8px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 10px 16px;
  background: var(--header); color: var(--header-ink);
  border-bottom: 3px solid var(--accent);
}
.brand { color: inherit; text-decoration: none; font-weight: 700; letter-spacing: 0.2px; }
.brand-mark { margin-right: 4px; }
nav { display: flex; gap: 4px; overflow-x: auto; }
nav a { color: var(--header-ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; opacity: 0.8; white-space: nowrap; font-size: 15px; }
nav a:hover, nav a.active { opacity: 1; background: rgba(255, 255, 255, 0.1); }

main { max-width: 960px; margin: 0 auto; padding: 16px 16px 48px; }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }

.banner { max-width: 960px; margin: 12px auto 0; padding: 8px 14px; border-radius: 10px; background: var(--meh-bg); color: var(--text); font-size: 14px; border: 1px solid var(--border); }
#banner { padding: 0 16px; }
#banner:empty { display: none; }

.hero h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 16px 0 6px; }
.hero p { color: var(--muted); margin: 0 0 20px; max-width: 60ch; }

.game-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.game-card {
  display: flex; gap: 14px; padding: 16px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.game-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.game-card h2 { margin: 0 0 2px; font-size: 19px; }
.game-card p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.game-icon { font-size: 30px; line-height: 1; }
.game-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.panel.small { font-size: 14px; }
.panel h3 { margin: 0 0 6px; }
.panel.error { border-color: var(--bad); }
.foot { font-size: 13px; color: var(--muted); margin-top: 20px; }

.game-title { font-size: 24px; margin: 8px 0 12px; }
.game-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
select, input[type="text"], .field input {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; min-height: 40px;
}

.scorebar { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scorebar b { color: var(--text); }

.tabs { display: flex; gap: 4px; overflow-x: auto; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.tab { flex: 1 0 auto; font: inherit; font-size: 14px; border: 0; background: transparent; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.tab.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.chip.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.progress small { color: var(--muted); font-size: 13px; }
.progress-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.progress-bar span { display: block; height: 100%; background: var(--good); transition: width 0.3s; }

.stage { display: flex; flex-direction: column; gap: 14px; }
.prompt {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.face-big { font-size: clamp(30px, 7vw, 46px); font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.face-big.addr { font-size: clamp(26px, 6vw, 38px); }
.face-mid { font-size: 21px; font-weight: 650; }
.face-sub { color: var(--muted); font-size: 14px; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.timer { font: 600 13px ui-monospace, monospace; color: var(--muted); }

.flashcard {
  font: inherit; color: inherit; cursor: pointer; width: 100%; min-height: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px;
}
.flashcard.flipped { border-color: var(--accent); }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-context { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.ladder { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.ladder span { padding: 3px 8px; border-radius: 6px; background: var(--surface-2); }
.ladder .here { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  font: inherit; font-size: 18px; font-weight: 600; color: var(--text); text-align: left;
  background: var(--surface); border: 2px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer;
}
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice.right, .rose-btn.right { border-color: var(--good); background: var(--good-bg); }
.choice.wrong, .rose-btn.wrong { border-color: var(--bad); background: var(--bad-bg); }
.rose-btn.close { border-color: var(--meh); background: var(--meh-bg); }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 16px; min-height: 42px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.good { border-color: var(--good); color: var(--good); }
.btn.bad { border-color: var(--bad); color: var(--bad); }
.btn.big { font-size: 24px; padding: 22px; min-height: 84px; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.lr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.verdict { border-radius: var(--radius); padding: 14px 16px; border: 1px solid; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.verdict p { margin: 0; }
.verdict.good { background: var(--good-bg); border-color: var(--good); }
.verdict.bad { background: var(--bad-bg); border-color: var(--bad); }
.verdict.meh { background: var(--meh-bg); border-color: var(--meh); }
.verdict > b { font-size: 18px; }
.verdict .card-context { text-align: left; }
.verdict .ladder { justify-content: flex-start; }

.station-card { display: flex; gap: 12px; align-items: center; text-align: left; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.station-card small { color: var(--muted); }
.station-badge { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }

.rose { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; width: 100%; margin: 0 auto; }
.rose-btn { font: inherit; font-size: 20px; font-weight: 700; color: var(--text); aspect-ratio: 1.4; background: var(--surface); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; }
.rose-btn:hover:not(:disabled) { border-color: var(--accent); }
.rose-center { display: grid; place-items: center; font-size: 26px; }

.directions { margin: 0; padding-left: 22px; font-size: 15px; }
.directions li { margin: 3px 0; }
.directions small { color: var(--muted); }
.turn { font-weight: 600; }
.turn.left { color: #2563eb; }
.turn.right { color: #c2410c; }
@media (prefers-color-scheme: dark) { .turn.left { color: #7aa7ff; } .turn.right { color: #ff9a5c; } }
details summary { cursor: pointer; font-weight: 600; }

.builder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.exit-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-weight: 600; }
.segs { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg { font: inherit; border: 0; background: var(--surface); color: var(--muted); padding: 8px 16px; cursor: pointer; }
.seg.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.step-row { display: flex; gap: 8px; align-items: center; }
.step-row input { flex: 1; min-width: 0; }
.onto { color: var(--muted); font-size: 14px; }
.icon-btn { font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.result:empty { display: none; }

.reveal { margin-top: 14px; }
.map-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.map-canvas { display: block; width: 100%; height: min(60vh, 520px); touch-action: none; cursor: grab; }
.map-tools { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.map-tools button { width: 36px; height: 36px; font: 600 15px system-ui, sans-serif; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.map-tools button.on { border-color: var(--accent); color: var(--accent); }

.station-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.setup-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.setup-grid .panel { margin-top: 0; }
@media (min-width: 820px) { .setup-grid { grid-template-columns: 1.6fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.field.check { flex-direction: row; align-items: center; }

@media (max-width: 520px) {
  .top { padding: 8px 12px; }
  .choices { grid-template-columns: 1fr; }
  .choice { font-size: 17px; padding: 12px; }
  .step-row { flex-wrap: wrap; }
  .step-row select { flex: 0 0 auto; }
}

/* Player chip, start screen, scoreboard */
.player-chip {
  margin-left: auto; color: var(--header-ink); text-decoration: none; font-size: 14px;
  padding: 5px 12px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; white-space: nowrap;
  max-width: 45vw; overflow: hidden; text-overflow: ellipsis;
}
.player-chip:hover { border-color: var(--accent); }
.splash {
  max-width: 460px; margin: 24px auto 0; display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center;
}
.splash h1 { margin: 0; font-size: clamp(30px, 7vw, 40px); line-height: 1.1; text-wrap: balance; }
.splash-mark { font-size: 54px; line-height: 1; }
.splash .lede { margin: 0; color: var(--muted); }
.splash-form { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.splash-form label { font-weight: 600; font-size: 14px; }
.splash-form .row { flex-wrap: nowrap; }
.splash-form input { flex: 1; min-width: 0; font-size: 17px; }
.form-error { margin: 0; color: var(--bad); font-size: 14px; }
.form-error:empty { display: none; }
.known { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.known .chips { justify-content: center; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.small { font-size: 13px; }
.board { margin-top: 4px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { width: 2.5em; }
tr.me td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
tr.me td:nth-child(2) { font-weight: 700; }
.panel.empty { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.panel.empty p { margin: 0; color: var(--muted); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 640px) {
  .top nav { order: 3; width: 100%; }
  .player-chip { order: 2; }
}

/* ---- WFD brand layer: red = action, gold = highlight/selection ---------- */
h1, h2, h3, .game-title, .face-big, .face-mid, .face-block, .brand, .btn.big, .rose-btn,
.station-badge, .scorebar b, .tab, .seg, th { font-family: var(--font-display); }
h1, .game-title { letter-spacing: 0.01em; text-wrap: balance; }
.game-title { font-size: 30px; font-weight: 700; text-transform: uppercase; }
.top { border-bottom: 3px solid var(--accent); box-shadow: 0 3px 0 var(--gold); margin-bottom: 3px; }
.brand { color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; font-size: 19px; display: inline-flex; align-items: center; gap: 8px; }
.brand svg { width: 24px; height: 24px; }
nav a { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.02em; }
nav a.active { color: var(--gold); background: rgba(242, 183, 5, 0.12); }
.player-chip { border-color: rgba(242, 183, 5, 0.45); }
.player-chip:hover { border-color: var(--gold); }

.hero {
  background: var(--header); color: var(--header-ink); border-radius: var(--radius);
  padding: 22px 20px; margin: 8px 0 16px; border-left: 6px solid var(--accent);
}
.hero h1 { color: var(--gold); text-transform: uppercase; margin: 0 0 6px; font-size: clamp(28px, 6vw, 42px); }
.hero p { color: #d9d2c8; margin: 0; }
.game-card:hover { border-color: var(--gold); }
.game-card h2 { font-size: 22px; text-transform: uppercase; letter-spacing: 0.02em; }

.tab.on { box-shadow: inset 0 -3px 0 var(--gold), 0 1px 2px rgba(0, 0, 0, 0.12); }
.chip.on { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }
.chip.done { color: var(--good); }
.progress-bar span { background: var(--gold); }
.station-badge { border: 3px solid var(--gold); }
.ladder .here { background: var(--gold); color: var(--gold-ink); }
.flashcard.flipped { border-color: var(--gold); }
.seg.on { background: var(--header); color: var(--gold); }
.btn.primary:hover { background: var(--maroon); border-color: var(--maroon); }
.face-big { font-weight: 700; }
.splash h1 { color: var(--text); text-transform: uppercase; }
.splash-mark svg { width: 64px; height: 64px; }

/* Rotations: deck switch, Learn mode, memory hooks */
.deck-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.deck-label { font: 600 12px var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.method { margin-top: 0; font-size: 15px; }
.method summary { font-family: var(--font-display); font-size: 17px; }
.method ol { margin: 10px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.method .tip { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.chunk-chips .chip { font-variant-numeric: tabular-nums; }
.learn-step { font: 600 12px var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.flashcard.learn { cursor: default; position: relative; gap: 4px; }
.flashcard.learn.major { border: 2px solid var(--gold); }
.face-block { font-size: clamp(54px, 14vw, 84px); font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.alias { font-size: 0.5em; color: var(--muted); font-weight: 500; }
.badge-major {
  align-self: center; background: var(--gold); color: var(--gold-ink);
  font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 4px;
}
.memory { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 560px; margin-top: 10px; text-align: left; }
.memory .hook, .memory .rule { padding: 10px 12px; border-radius: 8px; font-size: 16px; line-height: 1.45; }
.memory .hook { background: var(--gold-soft); border-left: 4px solid var(--gold); color: var(--text); }
.memory .rule { background: var(--surface-2); border-left: 4px solid var(--accent); color: var(--text); }
.mem-label { display: block; font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 2px; }
.memory .ladder { justify-content: flex-start; font-size: 14px; color: var(--muted); }
.row.end { justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.memory .also { padding: 10px 12px; border-radius: 8px; font-size: 15px; line-height: 1.45; background: var(--surface); border: 1px dashed var(--maroon); color: var(--text); }
.face-also { font: 600 15px var(--font-body); color: var(--maroon); text-transform: uppercase; letter-spacing: 0.06em; }
.hooks { display: flex; flex-direction: column; gap: 6px; }
.memory .hook-say { background: var(--surface-2); border-left-color: var(--maroon); font-style: italic; }
.memory .hook-link { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--gold); }
.side-rose .rose-btn { font-size: 18px; }

/* Responder / Transporter dashboard */
.drive-prompt { gap: 4px; }
.drive-prompt .hint { color: var(--gold-text); }
.dash { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: var(--header); color: var(--header-ink); border-radius: var(--radius); padding: 14px; }
.dash-left { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.compass svg { width: clamp(120px, 34vw, 170px); height: auto; display: block; }
.cmp-ring { fill: #1d1916; stroke: var(--gold); stroke-width: 3; }
.cmp-l { fill: #e9e2d8; font: 700 13px var(--font-display); }
.cmp-l.n { fill: var(--gold); }
.cmp-dot { fill: #8f857a; }
.cmp-needle { fill: #e3283a; stroke: #fff; stroke-width: 1; }
.cmp-tail { fill: #5d544c; }
.cmp-hub { fill: var(--gold); }
.compass g { transition: transform 0.25s ease; }
.heading-name { font: 600 13px var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: #cfc6bb; }
.heading-name b { color: var(--gold); font-size: 16px; }
.dash-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sign { background: #0f6b3a; color: #fff; border: 2px solid #fff; border-radius: 6px; padding: 6px 10px; box-shadow: 0 0 0 2px #0f6b3a; min-width: 0; }
.sign small { display: block; font: 600 10px var(--font-body); text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.sign b { display: block; font: 700 clamp(17px, 4.6vw, 22px) var(--font-display); line-height: 1.15; overflow-wrap: anywhere; }
.sign.cross { background: #20563a; box-shadow: 0 0 0 2px #20563a; }
.sign.cross b { font-size: clamp(14px, 3.8vw, 17px); }
.trip { font: 500 13px var(--font-body); color: #cfc6bb; font-variant-numeric: tabular-nums; }
/* Responder/Transporter: windshield and map side by side (stacked on phones),
   with see-through arrow buttons on the edges of each view. */
.drive-views { display: grid; gap: 12px; }
.drive-map { display: flex; flex-direction: column; min-width: 0; }
.drive-map .map-canvas { height: min(52vh, 420px); }
@media (min-width: 760px) {
  .drive-views { grid-template-columns: 1.45fr 1fr; }
  .drive-views .windshield { aspect-ratio: auto; height: min(58vh, 440px); max-height: none; }
  .drive-map { height: min(58vh, 440px); }
  .drive-map .map-wrap { flex: 1; min-height: 0; }
  .drive-map .map-canvas { height: 100%; }
}
.drive-views.done { grid-template-columns: 1fr; }
.drive-views.done .windshield { display: none; }
.drive-views.done .drive-map { height: auto; }
.drive-views.done .map-canvas { height: min(72vh, 680px); }
.edge-pads { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.edge-pad { position: absolute; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 52px; min-height: 46px; max-width: 30%; padding: 5px 10px; font: inherit; color: #fff; background: rgba(20, 17, 15, 0.36); border: 1.5px solid rgba(255, 255, 255, 0.55); border-radius: 12px; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); cursor: pointer; touch-action: manipulation; transition: background 0.12s, border-color 0.12s; }
.edge-pad:hover:not(:disabled) { background: rgba(20, 17, 15, 0.55); border-color: var(--gold); }
.edge-pad:active:not(:disabled) { background: rgba(242, 183, 5, 0.5); }
.edge-pad:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.edge-pad:disabled { opacity: 0.28; cursor: default; }
.edge-pad .pad-arrow { font-size: 20px; line-height: 1; color: var(--gold); }
.edge-pad .pad-sub { font: 600 12px var(--font-body); line-height: 1.15; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.edge-up { top: 8px; left: 50%; transform: translateX(-50%); }
.edge-down { bottom: 8px; left: 50%; transform: translateX(-50%); }
.edge-left { left: 8px; top: 50%; transform: translateY(-50%); }
.edge-right { right: 8px; top: 50%; transform: translateY(-50%); }
.edge-up:active:not(:disabled), .edge-down:active:not(:disabled) { transform: translateX(-50%) scale(0.96); }
.edge-left:active:not(:disabled), .edge-right:active:not(:disabled) { transform: translateY(-50%) scale(0.96); }
/* Windshield: clear of the heading readout, the pillars and the hood. */
.windshield .edge-up { top: 52px; }
.windshield .edge-down { bottom: 15%; }
.windshield .edge-left { left: 5.5%; }
.windshield .edge-right { right: 5.5%; }
/* Map: the zoom tools sit top right, so the right button stays mid-height. */
.map-wrap .edge-pads { z-index: 1; }
.drive-msg { background: var(--meh-bg); border: 1px solid var(--meh); border-radius: 10px; padding: 8px 12px; font-weight: 600; text-align: center; }
@media (max-width: 420px) { .dash { grid-template-columns: 1fr; justify-items: stretch; } .dash-left { flex-direction: row; justify-content: center; gap: 12px; } }

/* Windshield view */
.windshield { position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 62vh; border-radius: var(--radius); overflow: hidden; background: #0d0b0a; box-shadow: 0 0 0 3px #14110f, 0 0 0 5px var(--gold); }
.ws-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ws-chip { position: absolute; top: 14px; left: 30px; background: rgba(20, 17, 15, 0.78); color: #fff; border-radius: 8px; padding: 4px 10px; max-width: 55%; }
.ws-chip small { display: block; font: 600 10px var(--font-body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); }
.ws-chip b { font: 700 clamp(14px, 3.6vw, 18px) var(--font-display); overflow-wrap: anywhere; }
.ws-compass { position: absolute; top: 12px; right: 28px; display: flex; flex-direction: column; align-items: center; gap: 0; }
.ws-compass svg { width: clamp(48px, 11vw, 66px); height: auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.wsc-ring { fill: rgba(20, 17, 15, 0.85); stroke: var(--gold); stroke-width: 2.5; }
.wsc-l { fill: #e9e2d8; font: 700 9px var(--font-display); text-anchor: middle; }
.wsc-l.n { fill: var(--gold); }
.wsc-n { fill: #e3283a; stroke: #fff; stroke-width: 0.6; }
.wsc-s { fill: #6b625a; }
.wsc-hub { fill: var(--gold); }
.wsc-text { font: 700 12px var(--font-display); color: #fff; background: rgba(20, 17, 15, 0.78); border-radius: 4px; padding: 0 6px; margin-top: 2px; }
.ws-odo { position: absolute; right: 14px; bottom: 10px; display: flex; align-items: center; gap: 6px; background: #14110f; border: 2px solid var(--gold); border-radius: 6px; padding: 4px 8px; color: #fff; }
.ws-odo-label, .ws-odo-unit { font: 700 10px var(--font-body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); }
.ws-odo-digits { display: inline-flex; gap: 2px; font: 700 clamp(14px, 3.4vw, 18px) ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.ws-odo-digits .dig { background: linear-gradient(#2b2724, #0b0908 50%, #2b2724); border-radius: 2px; padding: 0 3px; min-width: 1ch; text-align: center; }
.ws-odo-digits .dot { color: var(--gold); }
.trip-line { font: 500 13px var(--font-body); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.patient { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.patient-addr { font: 700 clamp(22px, 5.4vw, 32px) var(--font-display); line-height: 1.1; font-variant-numeric: tabular-nums; }
.hosp-toggles { display: flex; flex-direction: column; gap: 6px; }
.hosp-toggles .chip:not(.on) { text-decoration: line-through; opacity: 0.7; }
.hosp-toggles summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.hosp-toggles[open] summary { margin-bottom: 6px; }
.ws-heading { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); min-width: 3.2em; text-align: center; background: rgba(20, 17, 15, 0.82); color: var(--gold); border: 2px solid var(--gold); border-radius: 8px; padding: 2px 10px; font: 700 clamp(16px, 4vw, 22px) var(--font-display); letter-spacing: 0.08em; }
.ws-chip { max-width: 34%; }

/* Mnemonic button + poster dialog */
.hook-btn { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 0; border-left: 4px solid var(--gold); }
.hook-btn:hover, .hook-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.hook-art { font-size: 34px; line-height: 1; flex: none; }
.hook-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hook-pegs { font-size: 15px; color: var(--muted); letter-spacing: 0.04em; }
.peg-key { font-size: 14px; margin: 6px 0 0; }
.poster-dialog { border: 0; padding: 14px; border-radius: 16px; background: var(--surface); color: var(--text); width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.poster-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.poster svg { width: 100%; height: auto; display: block; }
.poster-text { font-size: 17px; margin: 12px 2px 4px; }
.poster-pegs { font-size: 14px; margin: 0 2px 12px; }
.hook-img { width: 56px; height: 56px; flex: none; border-radius: 10px; background: #fff8e1; border: 2px solid var(--gold); }
.lr .btn.right { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.lr .btn.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.map-dest { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; background: var(--header); color: var(--header-ink); border: 2px solid var(--gold); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 8px 12px; }
.map-dest + .map-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.map-dest-label { font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); }
.map-dest b { font: 700 clamp(17px, 4.4vw, 21px) var(--font-display); }
.map-dest .muted { color: #cfc6bb; }
@media (max-width: 520px) {
  .edge-pad { min-width: 44px; min-height: 40px; max-width: 28%; padding: 3px 7px; border-radius: 10px; }
  .edge-pad .pad-arrow { font-size: 16px; }
  .edge-pad .pad-sub { font-size: 11px; }
  .windshield .edge-up { top: 62px; }
  .windshield .edge-left { left: 4%; }
  .windshield .edge-right { right: 4%; }
}
/* Cross-town avenues: the run strip (west on the left, majors as ticks). */
.strip { margin: 10px 0 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; align-self: stretch; width: 100%; max-width: 100%; min-width: 0; }
.strip svg { display: block; width: 100%; min-width: 480px; height: auto; }
.strip.compact svg { min-width: 480px; }
.strip .tick { stroke: var(--border); stroke-width: 2; }
.strip .tick.hot { stroke: var(--accent); stroke-width: 3; }
.strip .tick-label { font: 600 17px var(--font-body); fill: var(--muted); }
.strip .tick-label.hot { fill: var(--text); font-weight: 700; }
.strip .run { fill: var(--accent); }
.strip .piece { fill: var(--muted); opacity: 0.55; }
.strip .dir { font: 700 15px var(--font-display); fill: var(--muted); letter-spacing: 0.08em; }
.flashcard.ave { text-align: left; }
.flashcard.ave .face-big, .flashcard.ave .face-block { text-align: center; }
