/* Every Stadium 2027 — a logbook, not a dashboard.
   Dark by default because most of this gets read in a car at night; light
   theme is a full peer, not an afterthought. Density over whitespace: the
   point of the thing is seeing a lot of stops at once. */

:root {
  --accent: #e0703a;
  --mlb: #d8442f;
  --nba: #e08a2b;
  --nhl: #3b8fd4;
  --nfl: #5aa15c;

  --bg: #14161a;
  --bg-2: #1a1d23;
  --panel: #1e222a;
  --panel-2: #252a33;
  --line: #2f3540;
  --line-soft: #262b34;
  --ink: #e8eaee;
  --ink-2: #a7aebb;
  /* --ink-3 carries the city line on every venue card, every date, every
     table header — ~1,900 nodes. At #737c8b it measured 3.4-3.8:1 on the panel
     backgrounds, under AA. These are the values stream mode already used. */
  --ink-3: #939bab;
  --ok: #5cb279;
  --warn: #e3ab52;
  --bad: #e2705f;

  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shell: 1440px;
}

:root[data-theme="light"] {
  --bg: #f4f2ee;
  /* Status text on a select needs 4.5:1; the league hues are too light. */
  --st-shot-ink: #1f6fb0;
  --st-sched-ink: #b4521c;
  /* Accent that clears 4.5:1 on the light ground, for small text. */
  --accent-ink: #b4521c;
  --bg-2: #eceae5;
  --panel: #ffffff;
  --panel-2: #f6f4f0;
  --line: #d9d5cd;
  --line-soft: #e6e2da;
  --ink: #1c1f24;
  --ink-2: #545c68;
  --ink-3: #5f6874;
  --ok: #2f7449;
  --warn: #8a5c12;
  --bad: #a8382b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* rem-based so stream mode can scale the whole page from one number */
  font: 0.94rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* ------------------------------------------------------------ stream mode --
   For being on screen at 1080p. Scales the type up from the root, tightens
   contrast, and enlarges hit targets so nothing needs a careful click on air.
   Off by default — the planning UI is deliberately dense. */

:root { --accent-ink: var(--accent); }
:root[data-theme="dark"] { --accent-ink: var(--accent); }
:root[data-stream="on"] { font-size: 21px; --shell: 1760px; }
:root[data-stream="on"] { --ink-2: #c3c9d4; --ink-3: #939bab; --line: #3b424f; }
:root[data-stream="on"][data-theme="light"] { --ink-2: #3d444e; --ink-3: #5f6874; --line: #c3bdb1; }
:root[data-stream="on"] .nav a { padding: 15px 20px; }
:root[data-stream="on"] .subnav a { padding: 11px 16px; }
:root[data-stream="on"] .card { padding: 20px; border-radius: 13px; }
:root[data-stream="on"] .btn { padding: 10px 16px; }
:root[data-stream="on"] th, :root[data-stream="on"] td { padding: 10px 11px; }
:root[data-stream="on"] .tiny { font-size: 0.8rem; }
:root[data-stream="on"] .navkey { display: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
input[type="number"] { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ shell -- */

.stickytop { position: sticky; top: 0; z-index: 60; background: var(--bg); }

.topbar {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--shell); margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand-mark {
  font: 700 0.72rem/1 var(--mono); letter-spacing: 0.14em;
  color: var(--bg); background: var(--accent);
  padding: 6px 7px; border-radius: 5px; text-transform: uppercase;
}
.brand-name { font-weight: 660; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.topbar-progress { display: flex; align-items: baseline; gap: 5px; margin-right: 4px; }
.topbar-count { font-weight: 680; font-size: 1.02rem; letter-spacing: -0.01em; }
.topbar-word { color: var(--ink-3); font-size: 0.76rem; }
@media (max-width: 640px) { .topbar-word { display: none; } }

.btn-icon {
  padding: 6px 10px; font-size: 1rem; line-height: 1;
  background: transparent; border-color: transparent; color: var(--ink-2);
}
.btn-icon:hover { color: var(--ink); border-color: var(--line); }
.btn-icon.on { color: var(--accent); border-color: var(--accent); }

/* Primary nav: five groups, big targets. */
.nav {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.nav-in {
  max-width: var(--shell); margin: 0 auto; padding: 0 12px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  align-items: stretch;
}
.nav-in::-webkit-scrollbar { display: none; }
/* The fifth group sat entirely off-screen on a phone with nothing to suggest
   the row scrolled at all. */
.nav { position: relative; }
.nav::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 26px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--bg));
  opacity: 0; transition: opacity 120ms;
}
@media (max-width: 700px) {
  /* Five pillars do not fit one phone-width row, so the fifth (Content) used to
     sit entirely off-screen behind the pinned gear — a whole section a phone
     user could not see existed. Wrap to two rows: every pillar visible, no
     horizontal scroll, no hidden nav. */
  .nav-in { flex-wrap: wrap; overflow-x: visible; }
  .nav::after { display: none; }
  .nav-pin { z-index: 1; align-items: flex-start; }
  .nav a { padding: 10px 10px; font-size: 0.92rem; }
}
.nav a {
  padding: 12px 18px; font-size: 0.98rem; font-weight: 580;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 6px;
}
.nav a:hover { color: var(--ink); background: var(--panel-2); }
.nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.nav a .n { font: 600 0.72rem/1 var(--mono); color: var(--ink-3); }

/* Secondary nav: siblings of the active group only. */
.subnav { border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.subnav-in {
  max-width: var(--shell); margin: 0 auto; padding: 0 12px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.subnav-in::-webkit-scrollbar { display: none; }
.subnav a {
  padding: 8px 13px; font-size: 0.87rem; font-weight: 520;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  display: flex; align-items: center; gap: 7px; border-radius: 6px; margin: 4px 0;
}
.subnav a:hover { color: var(--ink); background: var(--panel); }
.subnav a.on { color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.navkey {
  font: 600 0.65rem/1 var(--mono); color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px;
}
.subnav a.on .navkey { color: var(--accent); border-color: var(--accent); }

main { max-width: var(--shell); margin: 0 auto; padding: 20px 18px 80px; }

.view-head { margin-bottom: 16px; }
.view-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 78ch; font-size: 0.9rem; }

/* ------------------------------------------------------------- primitives -- */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.card + .card { margin-top: 12px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { min-width: 0; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.74rem; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.spacer { flex: 1; }

.btn {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 12px; font-size: 0.85rem; font-weight: 530;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #16110d; font-weight: 620; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 4px 8px; font-size: 0.78rem; }
.btn-ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

input[type="text"], input[type="number"], input[type="date"], input[type="time"],
input[type="url"], select, textarea {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 9px; width: 100%;
  font-size: 0.88rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -1px; border-color: var(--accent);
}
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
label.field { display: block; }
label.field > span {
  display: block; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 4px; font-weight: 600;
}
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.88rem; }
label.check input { width: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 0.7rem/1 var(--mono); letter-spacing: 0.04em;
  padding: 3px 6px; border-radius: 4px;
  background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip-MLB { color: var(--mlb); border-color: color-mix(in srgb, var(--mlb) 45%, transparent); }
.chip-NBA { color: var(--nba); border-color: color-mix(in srgb, var(--nba) 45%, transparent); }
.chip-NHL { color: var(--nhl); border-color: color-mix(in srgb, var(--nhl) 45%, transparent); }
.chip-NFL { color: var(--nfl); border-color: color-mix(in srgb, var(--nfl) 45%, transparent); }
.chip-ok  { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.chip-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.chip-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }

.note {
  border-left: 3px solid var(--line); padding: 9px 12px;
  background: var(--panel-2); border-radius: 0 7px 7px 0;
  font-size: 0.85rem; color: var(--ink-2);
}
.note-warn { border-left-color: var(--warn); }
.note-bad { border-left-color: var(--bad); }
.note-info { border-left-color: var(--nhl); }
.note strong { color: var(--ink); }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-3); font-weight: 660;
  padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
.table-scroll { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }

/* --------------------------------------------------------------- statline -- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 10px; }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 13px;
}
.stat .k {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3); font-weight: 660;
}
.stat .v {
  font: 640 1.5rem/1.15 var(--sans); font-variant-numeric: tabular-nums;
  margin-top: 5px; letter-spacing: -0.02em;
}
.stat .s { font-size: 0.76rem; color: var(--ink-3); margin-top: 3px; }

.bar { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ----------------------------------------------------------------- venues -- */

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 12px;
}
.filters input[type="text"] { width: auto; flex: 1 1 220px; }
.filters select { width: auto; }

.toggle-group { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.toggle-group button {
  background: var(--panel); border: 0; border-right: 1px solid var(--line);
  padding: 6px 10px; font-size: 0.8rem; cursor: pointer; color: var(--ink-2);
}
.toggle-group button:last-child { border-right: 0; }
.toggle-group button.on { background: var(--accent); color: #16110d; font-weight: 620; }
/* A six-tab group (Content) does not fit one phone row, and the group clips its
   overflow — the last tab, "Gear & template", was simply cut off. On a phone,
   break the single segmented pill into wrapping chips so every tab is visible
   and tappable. */
@media (max-width: 700px) {
  .toggle-group { flex-wrap: wrap; overflow: visible; border: 0; gap: 6px; }
  .toggle-group button {
    border: 1px solid var(--line); border-radius: 7px;
  }
  .toggle-group button.on { border-color: var(--accent); }
}

.venue-row { cursor: pointer; }
.venue-row .name { font-weight: 570; }
.venue-row.done .name { color: var(--ok); }
.venue-row.done .name::before { content: "✓ "; }

.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); gap: 10px; }
.vcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 7px;
}
.vcard:hover { border-color: var(--ink-3); }
.vcard.done { border-left: 3px solid var(--ok); }
.vcard.routed { border-left: 3px solid var(--accent); }
.vcard .vname { font-weight: 600; line-height: 1.25; }
.vcard .vloc { color: var(--ink-3); font-size: 0.8rem; }

/* ---------------------------------------------------------------- drawer -- */

.drawer-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 100; display: flex; justify-content: flex-end;
}
.drawer {
  background: var(--bg); width: min(660px, 100%); height: 100%;
  overflow-y: auto; border-left: 1px solid var(--line);
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.drawer-head { display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { flex: 1; }
/* flex:0 0 auto is load-bearing: the drawer is a flex column, and an 81-row
   games table used to shrink this bar to 1px, trapping the user on the Games
   tab with no way back to Visit or Costs. */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  overflow-x: auto; flex: 0 0 auto;
}
.drawer-head, .club-switch, .drawer > .note { flex: 0 0 auto; }
.tab-body { min-height: 0; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 11px; font-size: 0.85rem; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* -------------------------------------------------------------- calendar -- */

.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 14px; }
.month { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px; }
.month h3 { margin-bottom: 8px; font-size: 0.9rem; }
.month table { table-layout: fixed; }
.month th { padding: 2px; text-align: center; font-size: 0.6rem; border: 0; }
.month td {
  padding: 0; border: 0; height: 34px; vertical-align: top;
  text-align: center; position: relative;
}
.day {
  height: 100%; border-radius: 5px; padding: 2px 0 0;
  font-size: 0.72rem; font-family: var(--mono); color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid transparent;
}
.day.has { color: var(--ink); cursor: pointer; }
.day.has:hover { border-color: var(--ink-3); }
.day.stop { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--ink); font-weight: 700; }
.day.today { outline: 1px solid var(--accent); }
.dots { display: flex; gap: 2px; }
.dots i { width: 4px; height: 4px; border-radius: 99px; display: block; }

/* ------------------------------------------------------------------- map -- */

.map-wrap {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px; overflow: hidden;
}
.map-wrap svg { width: 100%; height: auto; display: block; touch-action: none; }
.state { fill: var(--panel-2); stroke: var(--line); stroke-width: 0.8; }
:root[data-theme="light"] .state { fill: #e4e0d8; stroke: #cfcabf; }
.state.ca { fill: color-mix(in srgb, var(--panel-2) 60%, var(--bg)); }
.vdot { cursor: pointer; stroke: var(--bg); stroke-width: 1.2; }
.vdot:hover { stroke: var(--ink); stroke-width: 2; }
.vdot.done { stroke: var(--ok); stroke-width: 2; }
.routeline { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: 0.75; stroke-linejoin: round; }
.homedot { fill: var(--ink); stroke: var(--bg); stroke-width: 1.5; }
.maplabel { font: 600 9px var(--sans); fill: var(--ink-2); pointer-events: none; }

/* ---------------------------------------------------------------- season -- */

.season-grid { overflow-x: auto; }
.season-grid table { min-width: 760px; table-layout: fixed; }
.season-grid td { padding: 0; height: 26px; border-bottom: 1px solid var(--bg); }
.seg { height: 20px; border-radius: 3px; display: block; }

.density { display: flex; gap: 1px; align-items: flex-end; height: 46px; }
.density i { flex: 1; background: var(--accent); opacity: 0.8; border-radius: 1px 1px 0 0; min-height: 1px; }

/* ------------------------------------------------------------- itinerary -- */

.leg { display: flex; gap: 12px; align-items: stretch; }
.leg-rail { width: 22px; display: flex; flex-direction: column; align-items: center; flex: none; }
.leg-rail .dot {
  width: 11px; height: 11px; border-radius: 99px; background: var(--accent);
  margin-top: 5px; flex: none;
}
.leg-rail .line { flex: 1; width: 2px; background: var(--line); }
.leg-body { flex: 1; padding-bottom: 14px; min-width: 0; }
.leg-drive {
  font-size: 0.78rem; color: var(--ink-3); font-family: var(--mono);
  padding: 3px 0 7px;
}
.leg-drive.over { color: var(--warn); }

/* ---------------------------------------------------------------- toasts -- */

/* Bottom-centre. Not the right corner: that is where a streamer's camera box
   sits, and this is the only channel for sync and save failures. Not the
   middle of the frame either — low enough to stay out of the content. */
.toasts {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  max-width: min(420px, 90vw);
}
.toast {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ok);
  padding: 9px 14px; border-radius: 7px; font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35); transition: opacity 0.4s, transform 0.4s;
}
.toast-warn { border-left-color: var(--warn); }
.toast-bad { border-left-color: var(--bad); }
.toast.out { opacity: 0; transform: translateY(6px); }

.empty { text-align: center; padding: 34px 18px; color: var(--ink-3); }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }

/* ---------------------------------------------------------------- On Deck --
   Four blocks on a 1080p screen: progress, next stop, route map, trip day.
   Everything oversized on purpose — this is the view that gets streamed. */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Gives any .sr-only inside a wide table a containing block the scroller can
   actually clip. */
th, td { position: relative; }

.deck-intro { margin-bottom: 14px; }
.deck-intro h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
.deck-intro p { color: var(--ink-2); font-size: 0.92rem; max-width: 62ch; margin-top: 3px; }

.deck-grid {
  display: grid; gap: 14px;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr) minmax(420px, 1.7fr);
  grid-template-areas: "prog next map" "day next map";
  align-items: stretch;
}
.deck-progress { grid-area: prog; }
.deck-next { grid-area: next; display: flex; flex-direction: column; }
.deck-map { grid-area: map; }
.deck-day { grid-area: day; }

@media (max-width: 1180px) {
  .deck-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "prog next" "map map" "day day"; }
}
@media (max-width: 720px) {
  .deck-grid { grid-template-columns: 1fr; grid-template-areas: "prog" "next" "map" "day"; }
}

.deck-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px;
}
.deck-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 700; margin-bottom: 10px;
}
.deck-sub { color: var(--ink-2); font-size: 0.86rem; }

.deck-huge { display: flex; align-items: baseline; gap: 10px; }
.deck-huge-n {
  font-size: clamp(3.6rem, 8vw, 6rem); font-weight: 700;
  line-height: 0.92; letter-spacing: -0.045em; font-variant-numeric: tabular-nums;
}
.deck-huge-of {
  font-size: clamp(1.3rem, 2.4vw, 2rem); font-weight: 600;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.deck-bar { height: 12px; margin: 14px 0 9px; }
.deck-leagues {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 8px; margin-top: 16px;
}
.deck-league {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  background: var(--panel-2); border-radius: 8px; padding: 8px 10px;
}
.deck-league-n { font-size: 1.15rem; font-weight: 660; }

.deck-venue {
  font-size: clamp(1.5rem, 2.9vw, 2.3rem); font-weight: 680;
  line-height: 1.08; letter-spacing: -0.03em; cursor: pointer;
}
.deck-venue:hover { color: var(--accent); }
.deck-city { color: var(--ink-2); font-size: 1.02rem; margin-top: 6px; }
.deck-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 10px; margin-top: 18px;
}
.deck-fact { background: var(--panel-2); border-radius: 9px; padding: 10px 12px; }
.deck-fact-k {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 700;
}
.deck-fact-v {
  font-size: 1.32rem; font-weight: 660; margin-top: 4px;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.deck-fact-s { font-size: 0.75rem; color: var(--ink-3); margin-top: 3px; }
.btn-deck { padding: 11px 18px; font-size: 0.95rem; font-weight: 620; }
.deck-empty { text-align: center; padding: 24px 8px; }
.deck-empty-h { font-size: 1.3rem; font-weight: 640; margin-bottom: 6px; }

/* The map card spans both rows, so let the SVG grow into the height instead of
   sitting at the top with dead space under it. */
.deck-map { display: flex; flex-direction: column; }
.deck-map-wrap {
  background: var(--bg-2); border-radius: 10px; padding: 4px;
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0;
}
.deck-map-wrap svg { width: 100%; height: 100%; max-height: 100%; display: block; }
.routeline.done { stroke: var(--ok); opacity: 1; }
.deck-maplegend {
  display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap;
}
.deck-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink-2); }
.deck-legend-item i { width: 11px; height: 11px; border-radius: 99px; display: block; }
.deck-maplegend-n { font-size: 0.86rem; color: var(--ink-2); }

.deck-date {
  font-size: clamp(1.2rem, 2.1vw, 1.7rem); font-weight: 660;
  letter-spacing: -0.02em; margin: 4px 0 9px;
}
.deck-datepick { max-width: 190px; }
/* Scroll inside the block rather than stretching the whole row — the map card
   in the next column is sized by this row's height. */
.deck-games {
  margin-top: 12px; display: flex; flex-direction: column; gap: 6px;
  max-height: 42vh; overflow-y: auto;
}
.deck-game {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border-radius: 8px; padding: 8px 11px; cursor: pointer;
}
.deck-game:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.deck-game-body { flex: 1; min-width: 0; }
.deck-game-v { font-weight: 580; font-size: 0.92rem; }
.deck-game-m { font-size: 0.78rem; color: var(--ink-3); }
.deck-game-t { font-size: 0.86rem; color: var(--ink-2); white-space: nowrap; }

/* ------------------------------------------------------- command palette -- */

.pal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; backdrop-filter: blur(3px);
}
.pal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  width: min(680px, 100%); max-height: 76vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}
.pal-head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pal-input {
  border: 0 !important; background: transparent !important; font-size: 1.15rem !important;
  padding: 4px 2px !important; outline: none !important;
}
.pal-list { overflow-y: auto; padding: 6px; }
.pal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 8px; cursor: pointer;
}
.pal-row.on { background: var(--accent); color: #16110d; }
.pal-kind {
  font: 700 0.6rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); width: 48px; flex: none;
}
.pal-row.on .pal-kind { color: #16110d; opacity: 0.75; }
.pal-label { font-weight: 560; flex: none; }
.pal-hint { color: var(--ink-3); font-size: 0.8rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-row.on .pal-hint { color: #16110d; opacity: 0.75; }
.pal-key, kbd {
  font: 600 0.72rem/1 var(--mono); border: 1px solid var(--line);
  border-radius: 4px; padding: 3px 6px; color: var(--ink-2); background: var(--bg-2);
}
.pal-row.on .pal-key { border-color: rgba(0,0,0,0.3); color: #16110d; background: transparent; }
.pal-empty { padding: 22px; text-align: center; color: var(--ink-3); }

.pal-help { padding: 0 0 16px; }
.help-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px; padding: 16px;
}
.help-group h3 { margin-bottom: 9px; color: var(--ink-2); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.07em; }
.help-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 0.87rem; }
.help-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.help-row kbd { flex: none; min-width: 34px; text-align: center; }

/* --------------------------------------------------------------- content -- */

.platgroup { border-top: 1px solid var(--line-soft); padding: 8px 0 4px; }
.platgroup:first-child { border-top: none; }
.platgroup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.platgroup-head .pname { font-weight: 600; font-size: 0.86rem; }
.platgroup-head .btn { margin-left: auto; }
.fmt-sel { font-size: 0.78rem; padding: 3px 6px; }
.platgroup .plat { display: grid; grid-template-columns: auto auto 1fr 1.4fr auto; gap: 6px; align-items: center; margin-bottom: 4px; }
@media (max-width: 560px) { .platgroup .plat { grid-template-columns: 1fr 1fr; } }

.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 8px; }
.plat {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  background: var(--panel-2); display: flex; flex-direction: column; gap: 5px;
}
.plat .pname { font-weight: 600; font-size: 0.86rem; }
.status-sel { font-size: 0.78rem; padding: 3px 6px; }
.st-idea { color: var(--ink-2); }
.st-shot { color: var(--nhl); }
:root[data-theme="light"] .st-shot { color: var(--st-shot-ink); }
.st-edit { color: var(--warn); }
/* Scheduled had no rule at all, so it inherited the ghost-button grey and read
   as an empty cell — in the one column you open this grid to scan. */
.st-sched { color: var(--accent); }
:root[data-theme="light"] .st-sched { color: var(--st-sched-ink); }
.st-live { color: var(--ok); }
/* A .chip sits on --panel-2, lighter than the panels the density cells use, so
   the dark-theme shot/scheduled hues drop under AA on it (4.16 / 4.49). The chip
   form gets brighter inks; the light-theme .st-* overrides above are more
   specific and keep their darker inks, and the plain (density-cell) hues are
   unchanged. */
.chip.st-shot { color: #58a5e6; }
.chip.st-sched { color: #ee8a5a; }

/* First-run "make it yours / saves in this browser" note. Sibling of <main>,
   so it survives navigation; dismissed once, for good. */
.introbar {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  margin: 12px 20px 0; padding: 12px 16px; border-radius: 10px;
  font-size: 0.9rem; line-height: 1.4;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
}
.introbar > div { min-width: 0; }
.introbar button { flex-shrink: 0; }

/* ---------------------------------------------------- the front-door gate -- */
.gate {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent),
    var(--bg);
}
.gate-card {
  width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px 26px;
  box-shadow: 0 12px 40px -20px rgba(0, 0, 0, 0.5);
}
.gate-badge {
  display: inline-block; font: 800 0.9rem/1 var(--mono); letter-spacing: 0.06em;
  color: #16110d; background: var(--accent);
  padding: 5px 9px; border-radius: 6px; margin-bottom: 14px;
}
.gate-title { font-size: 1.7rem; line-height: 1.1; margin: 0 0 6px; text-wrap: balance; }
.gate-sub { color: var(--ink-2); margin: 0 0 18px; font-size: 0.98rem; line-height: 1.45; }
.gate-note { font-size: 0.9rem; margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; }
.gate-note-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.gate-note-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.gate-choices { display: flex; flex-direction: column; gap: 12px; }
.gate-choice {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 15px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  transition: border-color 120ms, transform 60ms;
}
.gate-choice:hover { border-color: var(--accent); }
.gate-choice:active { transform: translateY(1px); }
.gate-choice-primary {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
}
.gate-choice-t { font-weight: 680; font-size: 1.05rem; }
.gate-choice-d { font-size: 0.86rem; color: var(--ink-2); line-height: 1.35; }
.gate-back {
  background: none; border: 0; color: var(--ink-2); cursor: pointer;
  font-size: 0.85rem; padding: 0; margin-bottom: 10px;
}
.gate-back:hover { color: var(--ink); }
.gate-form { display: flex; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.gate-input {
  flex: 1 1 180px; min-width: 0; padding: 11px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-2); color: var(--ink);
}
.gate-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.gate-go { flex: 0 0 auto; }
.gate-msg { font-size: 0.9rem; margin: 6px 0 0; min-height: 1em; }
.gate-msg-ok { color: var(--ok); }
.gate-msg-bad { color: var(--bad); }
.gate-linkslot { margin-top: 12px; }
.gate-enter { display: inline-block; }
@media (max-width: 460px) {
  .gate-card { padding: 22px 18px; border-radius: 14px; }
  .gate-title { font-size: 1.45rem; }
}

/* @stadiumyear follow links — shared by the gate and the follow page. */
.socials { margin-top: 20px; text-align: center; }
.socials-label {
  display: block; font-size: 0.82rem; color: var(--ink-2);
  margin-bottom: 9px; letter-spacing: 0.01em;
}
.socials-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.social-link {
  font-size: 0.85rem; font-weight: 560; text-decoration: none;
  color: var(--ink-2); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  transition: color 120ms, border-color 120ms;
}
.social-link:hover { color: var(--ink); border-color: var(--accent); }
.social-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A full trip is ~200 cards and 86,000px of page. Off-screen ones do not need
   laying out until they are scrolled to; the size hint keeps the scrollbar
   honest so this does not turn into jumpy scrolling. */
.daylist > .daycard { content-visibility: auto; contain-intrinsic-size: 0 320px; }

.daycard.is-linked { outline: 2px solid var(--accent); outline-offset: 2px; }
.daylink { font-size: 0.72rem; padding: 2px 8px; }

/* --------------------------------------------------------------- run-up -- */
tr.row-current { background: color-mix(in srgb, var(--accent) 12%, transparent); }
tr.row-current td:first-child { font-weight: 640; }

.prep { display: grid; gap: 10px; }
.prep-card {
  display: grid; grid-template-columns: 168px 1fr; gap: 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 16px 18px;
  border-left: 3px solid var(--line);
}
.prep-card.pc-release { border-left-color: var(--accent); }
.prep-card.pc-decision { border-left-color: var(--bad); }
.prep-card.pc-build { border-left-color: var(--ink-3); }
.prep-card.done { opacity: 0.62; }
.prep-card.done .pc-title { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.prep-card.overdue { border-left-color: var(--warn); }
.pc-flag {
  font: 700 0.58rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 99px;
  padding: 2px 7px; align-self: flex-start;
}
.pc-rail { display: flex; flex-direction: column; gap: 8px; }
.pc-date { font: 600 0.86rem/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.pc-kind {
  font: 700 0.6rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 99px; align-self: flex-start; border: 1px solid var(--line);
}
.pck-release { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pck-decision { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.pck-build { color: var(--ink-3); }
.pc-title { font-size: 1.02rem; font-weight: 600; margin-bottom: 4px; }
.pc-body { color: var(--ink-2); font-size: 0.92rem; line-height: 1.5; }
.pc-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .prep-card { grid-template-columns: 1fr; gap: 8px; } }

/* The call sheet: a shoot day as timed blocks. Distinct from the travel blocks
   above it, because it is read at a different moment — the morning, on a phone,
   deciding when to get moving. */
.callsheet {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.cs-head {
  font: 700 0.66rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.cs-blocks { display: grid; gap: 2px; }
.cs-block {
  display: grid; grid-template-columns: max-content 1fr; gap: 12px; align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid var(--line-soft);
}
.cs-at { min-width: 52px; white-space: nowrap; }
.cs-block:last-child { border-bottom: none; }
.cs-at {
  font: 600 0.86rem/1.3 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--ink); text-align: right;
}
.cs-label { font-size: 0.9rem; font-weight: 520; }
.cs-note { font-size: 0.78rem; color: var(--ink-3); margin-top: 2px; }
.cs-dot { font-size: 0.7rem; }
.cs-film { color: var(--accent); }
.cs-game { color: var(--ok); }
.cs-gates { color: var(--warn); }
.cs-leave, .cs-drive { color: var(--ink-3); }
.cs-edit { color: var(--nba); }
@media print { .callsheet { break-inside: avoid; } }

/* Real controls that have to look like the text they replaced. */
.linkbtn {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.stopnum-t {
  font: 700 8px/1 var(--mono); fill: var(--accent); pointer-events: none;
  user-select: none;
}
.stopnum { pointer-events: none; }

.movebox {
  width: 46px; padding: 2px 4px; font-size: 0.78rem; text-align: center;
}
/* Hide the spinners: this is a "type 7, press Enter" box, not a stepper. */
.movebox::-webkit-outer-spin-button, .movebox::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.movebox { -moz-appearance: textfield; appearance: textfield; }

.rowlink { color: inherit; text-decoration: none; }
.rowlink:hover { text-decoration: underline; }

/* Off-screen until tabbed to. */
.skip {
  position: fixed; top: -60px; left: 12px; z-index: 400;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font-size: 0.9rem; text-decoration: none;
  transition: top 120ms ease-out;
}
.skip:focus { top: 12px; }

.shot { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.86rem; }
.shot.done { color: var(--ink-3); text-decoration: line-through; }

/* A short viewport is either a zoomed-in stream capture or a laptop in
   landscape. Three sticky rows at full padding took a third of the frame;
   tighten them rather than hide navigation the keyboard cannot replace. */
@media (max-height: 700px) {
  .topbar-in { padding: 5px 12px; }
  .nav a { padding: 6px 12px; }
  .subnav a { padding: 4px 10px; }
  .brand-sub { display: none; }
  :root[data-stream="on"] .nav a { padding: 7px 14px; }
  :root[data-stream="on"] .subnav a { padding: 5px 12px; }
  :root[data-stream="on"] .topbar-in { padding: 6px 12px; }
}

/* Five icon buttons plus the brand and the counter do not fit 320px, and
   adding the privacy toggle is what tipped it over. Stream mode is not a
   320px-phone feature; it stays on the keyboard and in the palette. Privacy
   stays visible, because showing someone your screen is. */
@media (max-width: 430px) {
  /* The brand name was clipping to "E…" at 390 and vanishing at 360, and it is
     the one thing on this bar nobody needs. Stream mode stays: it is the
     legibility mode, and a phone in sunlight is where you want it. */
  .brand-name, .brand-sub { display: none; }
  .topbar-word { display: none; }
  .icon-txt { font-size: 0.56rem; }
  .btn-icon-txt { min-width: 40px; padding: 0 6px; }
}

@media (max-width: 380px) {
  /* Four controls plus a counter do not fit 320px. The counter is the one
     thing here that is repeated elsewhere — the Venues tab carries it. */
  .topbar-progress { display: none; }
  .topbar-in { gap: 4px; }
}

@media (max-width: 720px) {
  .topbar-in { padding: 9px 12px; }
  main { padding: 14px 12px 70px; }
  .brand-sub { display: none; }
  .card { padding: 12px; }
  .drawer { padding: 14px; }
  .table-scroll { margin: 0 -12px; padding: 0 12px; }
}

@media print {
  /* Overriding body alone left every card on var(--panel), so with "background
     graphics" on — which is the default in several save-as-PDF paths — a
     printed Day by Day was seventeen pages of near-black slabs with dark grey
     text on them. Repoint the tokens instead. */
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --bg: #fff; --bg-2: #fff; --panel: #fff; --panel-2: #fff;
    --ink: #000; --ink-2: #333; --ink-3: #555;
    --line: #bbb; --line-soft: #ddd;
  }
  .nav, .topbar, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; border-color: #bbb; }
  /* Chromium re-anchors fixed elements per page, so this printed as a pill on
     every sheet. */
  .skip, .introbar { display: none !important; }
  /* The day-type, ticket-status and format selects printed as live form
     widgets inside an otherwise clean call sheet. Flatten them to their text. */
  select, .daytype-sel, .status-sel, .fmt-sel {
    -webkit-appearance: none; appearance: none;
    border: none !important; background: none !important;
    padding: 0 !important; color: #000 !important; font: inherit;
  }
}

/* ------------------------------------------------- clubs, venue pages, wx -- */

/* One pill per club in a building. A half-done shared arena has to read at a
   glance, otherwise you cannot tell MSG-with-the-Knicks from MSG-complete. */
.clubpill {
  font: 600 0.72rem/1 var(--sans);
  padding: 4px 7px; border-radius: 5px; cursor: pointer;
  background: var(--panel-2); color: var(--ink-2);
  border: 1px solid var(--line); white-space: nowrap;
}
.clubpill:hover { border-color: var(--ink-3); color: var(--ink); }
.clubpill.done {
  color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.drawer-team {
  font: 700 0.72rem/1 var(--mono); letter-spacing: 0.1em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 5px;
}
.club-switch {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px;
}

/* Temperature range bar: left offset is the low, width is the daily swing. */
table.wx td { padding: 5px 8px; }
.wx-track {
  background: var(--bg-2); border-radius: 99px; height: 9px;
  overflow: hidden; min-width: 60px;
}
.wx-track > i { display: block; height: 100%; border-radius: 99px; }

@media (max-width: 620px) {
  .deck-huge-n { font-size: 3.2rem; }
  .drawer { width: 100%; }
}

/* A stop that cannot be dated yet is context, not a result — mute the whole
   row so it never reads as a scheduled game. */
tr.row-unresolved td { opacity: 0.5; }
tr.row-unresolved:hover td { opacity: 0.8; }

/* Months the building is actually in use — the rest of the year is trivia. */
tr.wx-season td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
tr.wx-season td:first-child { font-weight: 660; }


/* ---------------------------------------------- stream-mode legibility --
   rem fractions below ~0.8 stayed under 16px even at a 21px root, which is
   exactly the text that names things: stat keys, table headers, league chips.
   On camera those are the labels a viewer needs most. */
:root[data-stream="on"] .tiny,
:root[data-stream="on"] .stat .k,
:root[data-stream="on"] .deck-fact-k,
:root[data-stream="on"] .deck-label,
:root[data-stream="on"] th,
:root[data-stream="on"] .chip,
:root[data-stream="on"] .month th { font-size: 0.82rem; }
:root[data-stream="on"] .deck-fact-s,
:root[data-stream="on"] .tiny.dim { font-size: 0.8rem; }
/* The calendar's entire signal is these dots. 4px does not survive encoding. */
:root[data-stream="on"] .dots i { width: 7px; height: 7px; }
:root[data-stream="on"] .month td { height: 42px; }

/* Venue-page cards need real width for their tables; at a 1760px shell the
   auto-fit was packing five columns and clipping every one. */
.venue-grid { grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); }

/* Light-theme map was a beige blob: 1.10:1 fill against the card. */
:root[data-theme="light"] .state { fill: #dcd6ca; stroke: #b3aa99; }
:root[data-theme="light"][data-stream="on"] .state { fill: #d5cec0; stroke: #9c927e; }

/* Saturated red on near-black is the worst case for video encoding. */
.chip-MLB { color: #ef6a56; }
:root[data-theme="light"] .chip-MLB { color: #b5341f; }

/* On Deck has to fit 1080p: the progress number and the route total must be
   visible in the same frame. */
@media (min-height: 700px) {
  .deck-map-wrap { max-height: 52vh; }
  .deck-games { max-height: 30vh; }
}

/* ------------------------------------------------------------ day cards -- */
.daylist { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.daycard {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px; border-left: 4px solid var(--line);
}
.daycard.type-game { border-left-color: var(--accent); }
.daycard.type-drive { border-left-color: var(--nhl); }
.daycard.type-rest { border-left-color: var(--ink-3); }
.daycard.has-problem { border-left-color: var(--bad); }
.daycard.is-today { box-shadow: 0 0 0 1px var(--accent); }
.dayhead {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.daydate { font-weight: 660; font-size: 1.05rem; letter-spacing: -0.015em; }
.daytype { font-size: 0.62rem; letter-spacing: 0.09em; }
.dt-game { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dt-drive { color: var(--nhl); border-color: color-mix(in srgb, var(--nhl) 45%, transparent); }
.dt-rest { color: var(--ink-3); }
.dt-home { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.daytype-sel {
  font: 600 0.66rem/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 999px; background: transparent;
  border: 1px solid var(--line);
}
.type-home { border-left: 3px solid var(--ok); }
.daybody {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.dayblock { background: var(--panel-2); border-radius: 8px; padding: 9px 11px; }
.dayblock-k {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-3); font-weight: 700; margin-bottom: 5px;
}
.dayfact { font-weight: 580; font-size: 0.92rem; }
.tk-in { font-size: 0.76rem; padding: 4px 6px; }
.tk-purchased { color: var(--ok); }
.tk-planned { color: var(--warn); }
.tk-none { color: var(--ink-3); }
:root[data-stream="on"] .dayblock-k, :root[data-stream="on"] .daytype { font-size: 0.78rem; }

@media print {
  .daycard { break-inside: avoid; page-break-inside: avoid; border-color: #999; }
  .daylist { gap: 6px; }
  .filters, .stats { display: none !important; }
}


/* --------------------------------------------------------- alert banner --
   Save failures used to be a 3-second toast while every later edit silently
   failed to persist. This stays until it is dealt with. */
/* Slides rather than snaps: this appears mid-session, and an instant 66px
   jump of the whole page reads as the app breaking. */
.alertbar { animation: alertin 220ms ease-out; }
@keyframes alertin { from { max-height: 0; opacity: 0; } to { max-height: 120px; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .alertbar { animation: none; } }
.alertbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 18px; font-size: 0.86rem; font-weight: 560;
  border-top: 1px solid var(--line);
}
.alert-bad { background: var(--bad); color: #fff; }
.alert-warn { background: var(--warn); color: #1a1206; }
.alertbar .btn { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); color: inherit; }

/* ------------------------------------------------------------- touch ----
   Coarse pointers get real targets. The itinerary delete button sat 3px from
   the reorder button, unconfirmed, 124 times, to be used in a moving car. */
@media (pointer: coarse) {
  .btn-sm, .clubpill, .tabs button, .btn-icon {
    min-height: 44px; min-width: 44px;
  }
  .tabs button { padding: 10px 14px; }
  .clubpill { padding: 10px 12px; }
  /* iOS Safari zooms any focused field under 16px and never zooms back out. */
  input, select, textarea { font-size: 16px !important; }
  /* No keyboard on a phone, so the shortcut hints are just stealing width. */
  .navkey { display: none; }
  .leg-body .row .btn-sm { margin-left: 2px; }
  .leg-body .btn-danger { margin-left: 10px; }
}

/* The drawer is full-width on a phone, so there is no backdrop to tap — the
   close button has to stay reachable however far you scroll. */
.drawer-head {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg); padding-bottom: 8px;
}

/* viewport-fit=cover was set without any insets, so on a notched phone the
   header sat under the status bar and toasts under the home indicator. */
.topbar-in, .nav-in, .subnav-in, main {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}
.toasts { bottom: calc(18px + env(safe-area-inset-bottom)); }


/* Pinned settings link, outside the scrolling nav strip. */
.nav { display: flex; align-items: stretch; }
.nav .nav-in { flex: 1; min-width: 0; }
.nav-pin {
  display: flex; align-items: stretch; flex: none;
  border-left: 1px solid var(--line); background: var(--bg);
}
.nav-pin a {
  display: flex; align-items: center; padding: 0 14px; font-size: 1.05rem;
  color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent;
}
.nav-pin a.on { color: var(--ink); border-bottom-color: var(--accent); }
.icon-txt { font: 700 0.62rem/1 var(--mono); letter-spacing: 0.08em; }
/* These two carry a word, not a glyph — a square icon box clipped PRIVATE to
   "PRIVAT". white-space matters as much as the width. */
.btn-icon-txt { width: auto; min-width: 44px; padding: 0 10px; white-space: nowrap; }
.offline-chip { flex: none; }
/* .chip sets display, which outranks the user-agent [hidden] rule, so the
   chip took up space on every viewport while claiming to be hidden. */
.offline-chip[hidden] { display: none !important; }
.brand-sub {
  color: var(--ink-3); font-size: 0.78rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 900px) { .brand-sub { display: none; } }

/* The header was 147px of a 664px phone screen. */
@media (max-width: 640px) {
  .topbar-in { padding-top: 6px; padding-bottom: 6px; gap: 8px; }
  .nav a { padding: 10px 13px; font-size: 0.92rem; }
  .subnav a { padding: 6px 10px; }
  .view-head p { font-size: 0.86rem; }
}

/* An edge fade so a scrollable nav looks scrollable. */
.nav-in, .subnav-in {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
}
@media (min-width: 900px) { .nav-in, .subnav-in { -webkit-mask-image: none; mask-image: none; } }


@media print {
  .subnav, .alertbar, .nav-pin, .toasts { display: none !important; }
  /* Placeholders were printing as if they were content. */
  .daycard input::placeholder { color: transparent; }
  .daycard input { border: none; padding-left: 0; }
  .daycard .dayblock { break-inside: avoid; }
}


/* ------------------------------------------- stream legibility, part 2 --
   The first pass floored .tiny/.chip/th and missed everything else under
   0.78rem. At a 21px root these were still 13-15px, and 15.1px was the
   calendar day number — a thing you have to read to pick a date on air. */
:root[data-stream="on"] .icon-txt { font-size: 0.8rem; }
:root[data-stream="on"] .brand-mark,
:root[data-stream="on"] .drawer-team,
:root[data-stream="on"] .clubpill,
:root[data-stream="on"] .nav a .n,
:root[data-stream="on"] .topbar-word,
:root[data-stream="on"] label.field > span,
:root[data-stream="on"] .dayblock-k,
:root[data-stream="on"] .daytype { font-size: 0.82rem; }
:root[data-stream="on"] .day { font-size: 0.86rem; }

/* Light-theme chips were 2.4-3.2:1 — the site's primary visual language,
   unreadable once a stream encoder has had it. */
:root[data-theme="light"] .chip-NBA { color: #8a4d05; }
:root[data-theme="light"] .chip-NHL { color: #1a5a8f; }
:root[data-theme="light"] .chip-NFL { color: #2f6b31; }
:root[data-theme="light"] .chip-warn { color: #855107; }
:root[data-theme="light"] .icon-txt { color: #9c4415; }
:root[data-theme="dark"] .chip-NHL { color: #6cb3ec; }
.btn-danger { color: #e2705f; }
:root[data-theme="light"] .btn-danger { color: #a32d1a; }
.alert-bad { background: #a8331f; }

/* Focus was the UA default: black on a dark panel, i.e. invisible. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* A disabled primary button still looked pressable. */
.btn-primary:disabled { background: var(--panel-2); border-color: var(--line); color: var(--ink-3); }

/* Cards are anchors now. */
a.vcard { text-decoration: none; color: inherit; }

/* A disabled toggle should not offer a pointer. */
.toggle-group button:disabled { opacity: 0.45; cursor: not-allowed; }


/* The 44px rule only covered four selectors; these are the rest of what a
   thumb actually hits, including every primary button. */
@media (pointer: coarse) {
  .btn, .toggle-group button, .subnav a, .nav-pin a, .status-sel, .tk-in,
  .fmt-sel, .filters select, .social-link {
    min-height: 44px;
  }
  .social-link { display: inline-flex; align-items: center; }
  .nav-pin a { min-width: 48px; justify-content: center; }
  .toggle-group button { padding: 10px 14px; }
  /* Gating which leagues count should not be a 13px hit area. */
  input[type="checkbox"] { width: 22px; height: 22px; }
  label.check { gap: 12px; padding: 6px 0; }
  .tk-in, .status-sel { font-size: 16px; }
}

/* viewport-fit=cover plus a standalone manifest puts the header under the
   status bar once installed to a home screen. */
.stickytop { padding-top: env(safe-area-inset-top); }
main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* label.check input{width:auto} outranked the coarse-pointer rule, so the
   checkboxes that gate which leagues count stayed 13px wide. */
@media (pointer: coarse) {
  label.check input[type="checkbox"],
  input[type="checkbox"] { width: 22px; height: 22px; flex: none; }
}

@media (pointer: coarse) {
  /* The checkbox itself is 22px; the LABEL is the hit area, so that is what
     has to clear 44. */
  label.check { min-height: 44px; align-items: center; }
}
