/* 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: #737c8b;
  --ok: #4f9d69;
  --warn: #d1953c;
  --bad: #cf5a4e;

  --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;
  --bg-2: #eceae5;
  --panel: #ffffff;
  --panel-2: #f6f4f0;
  --line: #d9d5cd;
  --line-soft: #e6e2da;
  --ink: #1c1f24;
  --ink-2: #545c68;
  --ink-3: #838b97;
}

* { 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[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; }
.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; }

.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(20rem, 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-right, not centre: on stream a centred toast lands straight over the
   thing the viewer is looking at. */
.toasts {
  position: fixed; bottom: 18px; right: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  max-width: min(420px, 60vw);
}
.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;
}

.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-row kbd { flex: none; min-width: 34px; text-align: center; }

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

.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-3); }
.st-shot { color: var(--nhl); }
.st-edit { color: var(--warn); }
.st-live { color: var(--ok); }

.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; }

@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 {
  .nav, .topbar, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; border-color: #bbb; }
}

/* ------------------------------------------------- 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); }
.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. */
.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; }
.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 {
    min-height: 44px;
  }
  .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; }
}
