/* Stadium Log — light "day game" theme. Team logos are drawn for light backgrounds,
   so the map stays pale and lets the logos carry the colour. */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/vendor/fonts/atkinson-400.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/vendor/fonts/atkinson-700.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 600 800; font-display: swap; src: url(/vendor/fonts/bigshoulders.woff2) format("woff2"); }

:root {
  --paper: #e9eef2;      /* behind the map */
  --land: #ffffff;
  --border: #b4c0cb;     /* state outlines */
  --canada: #f4f6f8;
  --ink: #14202e;
  --ink-2: #44525f;
  --mute: #6b7885;
  --rule: #d6dde3;
  --panel: #ffffff;
  --wash: #f4f7f9;
  --pole: #f5c518;       /* foul-pole yellow: planned */
  --pole-soft: #fff4c2;
  --pole-ink: #5b4600;
  --turf: #1b7a47;       /* visited */
  --turf-soft: #dff2e6;
  --mlb: #3b6fb6; --mlb-tint: #eaf1fb;   /* league colours: blue / leather brown / orange, clear of the status colours */
  --nfl: #8a5a2b; --nfl-tint: #f6ede2;
  --nba: #e0701f; --nba-tint: #fdeee0;
  --violet: #5b3fc4;     /* team seen, new stadium not yet */
  --violet-soft: #ebe6fb;
  --focus: #1a56c4;
  --danger: #b3261e;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --top-h: 64px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.45; color: var(--ink);
  background: var(--paper); -webkit-text-size-adjust: 100%; overflow: hidden;
  display: flex; flex-direction: column; height: 100vh; height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--focus); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top {
  position: relative; z-index: 20; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  flex: none; padding: 8px 20px; background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 4px; }
.brand h1 { margin: 0; font: 800 30px/1 var(--display); letter-spacing: .02em; }
.score { display: flex; gap: 18px; flex: 1; min-width: 0; }
.tally { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; min-width: 112px; }
.tally b { font: 800 34px/.9 var(--display); }
.tally span { font-size: 13px; color: #b9c4cf; }
.tally .sub2 { grid-column: 1 / -1; font-size: 12.5px; color: #b9c4cf; margin-top: 3px; }
.tally .bar { grid-column: 1 / -1; height: 4px; margin-top: 5px; background: #33465a; border-radius: 2px; overflow: hidden; }
.tally .bar i { display: block; height: 100%; background: var(--pole); border-radius: 2px; transition: width .4s ease; }
.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.seg { display: inline-flex; background: #26384b; border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; color: #cfd8e0; padding: 6px 14px; border-radius: 6px; font-weight: 700; min-height: 36px; }
.seg button[aria-checked="true"] { background: #fff; color: var(--ink); }
.tabs { display: inline-flex; gap: 4px; }
.tabs a { color: #cfd8e0; text-decoration: none; padding: 7px 12px; border-radius: 6px; font-weight: 700; min-height: 36px; display: inline-flex; align-items: center; }
.tabs a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--pole); border-radius: 0; }
.btn {
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 14px; font-weight: 700; min-height: 40px;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn.sm { padding: 4px 10px; min-height: 32px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.pole { background: var(--pole); border-color: var(--pole); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.top .btn.account { background: transparent; color: #fff; border-color: #5b6e80; }
.top .btn.account.on { border-color: var(--pole); }

/* ---------- views ---------- */
main { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; }
#view-map { background: var(--paper); }
#map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
.land { fill: var(--land); stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.canada { fill: var(--canada); stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.geo-label { font: 600 13px var(--body); fill: #9aa7b3; letter-spacing: .12em; }

.node { cursor: pointer; outline: none; }
.node .disc { fill: var(--tint, #fff); stroke: #c3ccd5; stroke-width: 1.5; stroke-linejoin: round; }
.node image { transition: opacity .15s; }
.node.todo image { filter: grayscale(1); opacity: .62; }
.node.todo .disc { fill: color-mix(in srgb, var(--tint, #f6f8fa) 55%, #fff); }
.node.visited .disc { stroke: var(--turf); stroke-width: 2.5; }
.node.planned .disc { stroke: var(--pole); stroke-width: 2.5; stroke-dasharray: 4 3; }
.node:hover .disc, .node:focus-visible .disc, .node.active .disc { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: none; }
.node:hover image, .node:focus-visible image, .node.active image { filter: none; opacity: 1; }
.node .leader { stroke: #8e9ba8; stroke-width: 1; }
.node .anchor { fill: #8e9ba8; }
.node.visited .anchor { fill: var(--turf); }
.node .stub { fill: var(--turf); stroke: #fff; stroke-width: 1.5; }
.node .tick { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.node.newstad .disc { stroke: var(--violet); stroke-width: 2.5; }
.node.newstad .anchor { fill: var(--violet); }
.node.stadonly .disc { stroke: var(--turf); stroke-width: 2.5; stroke-dasharray: 2 3; }
.node.stadonly image { filter: grayscale(.7); opacity: .8; }
.node .stub.new { fill: var(--violet); }
.node .star { fill: #fff; }
.node .stub.stad { fill: #fff; stroke: var(--turf); }
.node .tick-stad { stroke: var(--turf); }
.node .diamond { fill: var(--pole); stroke: var(--ink); stroke-width: 1.2; }
.node.dim { opacity: .12; pointer-events: none; }
.node:focus-visible .disc { stroke: var(--focus); stroke-width: 3.5; }

.legend {
  position: absolute; left: 16px; bottom: 16px; max-width: calc(100% - 90px); font-size: 14px; color: var(--ink-2);
  background: rgba(255,255,255,.92); padding: 7px 12px; border-radius: 8px; border: 1px solid var(--rule);
}
.legend summary { cursor: pointer; font-weight: 700; list-style: none; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary::after { content: "  ▾"; }
.legend:not([open]) summary::after { content: "  ▸"; }
.legendbody { display: flex; gap: 8px 14px; flex-wrap: wrap; margin-top: 8px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; border: 2.5px solid; background: #fff; }
.lg-visited { border-color: var(--turf); }
.lg-todo { border-color: #c3ccd5; background: #eef1f4; }
.lg-plan { border-color: var(--pole); border-style: dashed; }
.lg-new { border-color: var(--violet); }
.lg-stad { border-color: var(--turf); border-style: dotted; }
.zoom { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.zoom button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 20px; line-height: 1; font-weight: 700; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--mute); }
.asof { position: absolute; left: 16px; top: 12px; margin: 0; font-size: 13px; color: var(--mute); }

/* league glyphs: circle = MLB, rounded square = NFL, hexagon = NBA (the same shapes the map uses) */
.lgl { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; flex: none; }
.lgl.mlb { background: var(--mlb); border-radius: 50%; }
.lgl.nfl { background: var(--nfl); border-radius: 3px; }
.lgl.nba { background: var(--nba); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.legend .lgkey { display: inline-flex; align-items: center; gap: 2px; }
.legend .lgkey .lgl { margin-left: 8px; }
.legend .lgkey .lgl:first-child { margin-left: 0; }
.node.l-mlb { --tint: var(--mlb-tint); }
.node.l-nfl { --tint: var(--nfl-tint); }
.node.l-nba { --tint: var(--nba-tint); }

/* city hubs */
.hub { cursor: pointer; outline: none; }
.hub .hubdisc { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.hub:hover .hubdisc, .hub:focus-visible .hubdisc { stroke-width: 3; }
.hub:focus-visible .hubdisc { stroke: var(--focus); }
.hub .hubcount circle { fill: var(--ink); stroke: #fff; stroke-width: 1.5; }
.hub .hubcount text { fill: #fff; font: 700 11px var(--body); }
.hub .hublabel { font: 700 11.5px var(--body); fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.hub .hubx { fill: var(--ink); font: 700 18px var(--body); }
.hub.open .hubdisc { fill: var(--pole); stroke: var(--ink); }
.hub .leader { stroke: #8e9ba8; stroke-width: 1; }
.hubrows { display: grid; gap: 6px; margin-top: 10px; }
.hubrow { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hubrow img { width: 26px; height: 26px; object-fit: contain; }
.hubrow small { color: var(--ink-2); }

/* ---------- hover / tap card ---------- */
.card {
  position: fixed; z-index: 40; width: 300px; max-width: calc(100vw - 20px); background: var(--panel); border-radius: 12px;
  border: 1px solid var(--rule); box-shadow: 0 10px 30px rgba(20,32,46,.22); padding: 14px 14px 12px; pointer-events: auto;
}
.card header { display: flex; gap: 12px; align-items: center; }
.card img.logo { width: 52px; height: 52px; object-fit: contain; flex: none; }
.card h3 { margin: 0; font: 800 24px/1.05 var(--display); letter-spacing: .01em; }
.card .sub { font-size: 14px; color: var(--ink-2); }
.card dl { margin: 10px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 14px; }
.card dt { color: var(--mute); }
.card dd { margin: 0; }
.card .row { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.dia { width: 14px; height: 14px; display: inline-block; transform: rotate(45deg) scale(.82); border: 2px solid var(--ink); background: transparent; flex: none; }
.dia.on { background: var(--turf); border-color: var(--turf); }
.dia.new { background: var(--violet); border-color: var(--violet); }
.dia.stad { background: var(--turf-soft); border-color: var(--turf); }
.dia.planned { background: var(--pole); border-color: var(--ink); }
.asof-note { font-size: 12.5px; color: var(--mute); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 44; background: rgba(20,32,46,.35); }
.drawer {
  position: fixed; z-index: 50; top: var(--top-h); right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel);
  border-left: 1px solid var(--rule); box-shadow: -12px 0 32px rgba(20,32,46,.16); overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(105%); transition: transform .22s ease; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.dr-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--panel); border-bottom: 1px solid var(--rule); }
.dr-head img { width: 76px; height: 76px; object-fit: contain; flex: none; }
.dr-head h2 { margin: 0; font: 800 36px/.98 var(--display); letter-spacing: .01em; }
.dr-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.dr-close { margin-left: auto; align-self: flex-start; border: 0; background: var(--wash); width: 40px; height: 40px; border-radius: 50%; font-size: 22px; line-height: 1; flex: none; }
.dr-body { padding: 4px 18px 40px; }
.sec { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.sec:last-child { border-bottom: 0; }
.sec h3 { margin: 0 0 10px; font: 800 22px/1 var(--display); letter-spacing: .02em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px 18px; margin: 0; }
.facts dt { font-size: 13px; color: var(--mute); }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.facts dd small { display: block; font-weight: 400; color: var(--ink-2); }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 700; min-height: 40px; }
.stamp { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.stamp.yes { background: var(--turf-soft); color: var(--turf); }
.stamp.newst { background: var(--violet-soft); color: var(--violet); }
.stamp.stadonly { background: var(--turf-soft); color: var(--turf); }
.stamp.no { background: var(--wash); color: var(--ink-2); }
.stamp.planned { background: var(--pole-soft); color: var(--pole-ink); }

/* trip "ticket stubs" */
.trip { position: relative; margin: 0 0 14px; padding: 14px 14px 12px 18px; background: var(--wash); border-radius: 10px; border-left: 6px solid var(--turf); }
.trip::after { content: ""; position: absolute; right: 74px; top: 8px; bottom: 8px; border-left: 2px dashed #cdd6dd; }
.trip .when { font: 800 22px/1.1 var(--display); letter-spacing: .02em; }
.trip .match { margin-top: 2px; font-weight: 700; }
.trip .meta { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.trip .notes { margin: 8px 0 0; white-space: pre-wrap; }
.trip .when, .trip .match, .trip .meta { padding-right: 84px; }
.trip .stubscore { position: absolute; right: 8px; top: 12px; width: 60px; text-align: center; font: 800 26px/1 var(--display); white-space: nowrap; }
.trip .stubscore small { display: block; font: 700 12px var(--body); margin-top: 4px; letter-spacing: .06em; }
.trip .stubscore.w { color: var(--turf); } .trip .stubscore.l { color: var(--danger); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; cursor: zoom-in; background: #dde3e8; }
.photos .x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(20,32,46,.8); color: #fff; font-size: 16px; line-height: 1; }
.trip .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.empty { color: var(--ink-2); margin: 0 0 8px; }

/* postseason */
.ribbon { display: inline-block; margin: 0 0 6px; padding: 2px 10px; border-radius: 6px; background: var(--pole); color: var(--ink); font-weight: 700; font-size: 14px; }
.lg-post { border: 0 !important; background: none !important; color: #b58900; font-style: normal; width: auto; height: auto; margin-right: 4px; font-size: 16px; line-height: 1; }
.node .postbadge { fill: var(--pole); stroke: var(--ink); stroke-width: 1.2; }
.node .poststar { fill: var(--ink); }
.tabs a.owner-only { display: none; }
body.is-owner .tabs a.owner-only { display: inline-flex; }

/* log games screen */
#view-log { overflow-y: auto; background: var(--paper); }
.logwrap { max-width: 980px; margin: 0 auto; padding: 22px 20px 120px; display: grid; gap: 16px; }
.logwrap h2 { margin: 0; font: 800 30px/1 var(--display); letter-spacing: .02em; }
.logbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.logbar .fld { min-width: 150px; }
.logsum { color: var(--ink-2); margin: 0; }
.grow { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.grow label { display: grid; grid-template-columns: 28px 92px minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.grow label:last-child { border-bottom: 0; }
.grow label.logged { background: var(--turf-soft); cursor: default; }
.grow label.future { opacity: .5; cursor: default; }
.grow input[type=checkbox] { width: 20px; height: 20px; }
.grow .gd { font-weight: 700; }
.grow .gm { min-width: 0; }
.grow .gm small { display: block; color: var(--ink-2); font-size: 13.5px; }
.grow .gr { font-weight: 700; text-align: right; white-space: nowrap; }
.res-W { color: var(--turf); } .res-L { color: var(--danger); }
.stagechip { display: inline-block; background: var(--pole-soft); color: var(--pole-ink); border: 1px solid #ecd780; border-radius: 6px; padding: 0 6px; font-size: 12.5px; font-weight: 700; margin-left: 6px; }
.logfoot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 12px; align-items: center; padding: 12px 16px; background: var(--ink); color: #fff; }
.logfoot .btn { background: var(--pole); border-color: var(--pole); color: var(--ink); }

/* one-tap logging */
.quick { margin: 0 0 14px; padding: 12px 12px 10px; background: var(--pole-soft); border: 1px solid #ecd780; border-radius: 10px; }
.qrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #ecd780; }
.qrow:first-of-type { border-top: 0; }
.qscore { margin-left: 8px; font-size: 14px; color: var(--ink-2); font-weight: 400; }
.road + .road { margin-top: 12px; }

.shared { margin: 4px 0 14px; padding: 10px 12px; background: var(--wash); border-radius: 10px; }
.srow { padding: 5px 0; font-size: 15px; }

/* A real input kept in the layout (so it behaves on iOS) but visually replaced by its label button. */
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.filebtn { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.filebtn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.picks .perr { color: var(--danger); background: #fdecea; }
.updatebar { position: fixed; z-index: 100; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(20,32,46,.35); font-weight: 700; }
.chooser { display: grid; gap: 8px; justify-items: start; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; width: 100%; }
.picks figure { margin: 0; position: relative; }
.picks img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: #dde3e8; }
.picks .pname { display: grid; place-items: center; aspect-ratio: 1; padding: 4px; text-align: center; font-size: 11px; overflow: hidden; word-break: break-all; background: var(--wash); border-radius: 8px; }
.picks .x { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20,32,46,.85); color: #fff; font-size: 16px; line-height: 1; }

/* history timeline: a real sequence, so it gets a spine */
.tl { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.tl::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
.tl li { position: relative; padding: 0 0 14px; }
.tl li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; background: #fff; border: 2.5px solid var(--ink); transform: rotate(45deg) scale(.8); }
.tl li.now::before { background: var(--turf); border-color: var(--turf); }
.tl b { display: block; }
.tl .yrs { font-weight: 700; color: var(--ink-2); font-size: 14px; }
.tl .note { font-size: 14px; color: var(--ink-2); }
.titles { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.titles li { background: var(--pole-soft); border: 1px solid #ecd780; border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.titles b { font: 800 20px/1 var(--display); margin-right: 6px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 12px; margin-top: 12px; padding: 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; }
.form h4 { margin: 0; font: 800 20px/1 var(--display); letter-spacing: .02em; }
.fld { display: grid; gap: 4px; font-size: 14px; }
.fld > span { font-weight: 700; color: var(--ink-2); }
.fld input, .fld select, .fld textarea { border: 1.5px solid #aab6c1; border-radius: 8px; padding: 9px 10px; background: #fff; min-height: 42px; width: 100%; }
.fld textarea { min-height: 76px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 13px; color: var(--mute); margin: 0; }
.err { color: var(--danger); font-weight: 700; font-size: 14px; margin: 0; }
.owner-only { display: none; }
body.is-owner .owner-only { display: revert; }
body.is-owner span.owner-only, body.is-owner a.owner-only { display: inline; }
body.is-owner .owner-only.flex { display: flex; }
body.is-owner .owner-only.block { display: block; }

/* ---------- plan tab ---------- */
#view-plan { overflow-y: auto; background: var(--paper); }
.plan { max-width: 1100px; margin: 0 auto; padding: 22px 20px 80px; display: grid; gap: 28px; }
.plan h2 { margin: 0 0 12px; font: 800 30px/1 var(--display); letter-spacing: .02em; }
.plan .lede { margin: -6px 0 14px; color: var(--ink-2); max-width: 62ch; }
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.nx { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 14px; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; border-top: 5px solid var(--pole); cursor: pointer; text-align: left; width: 100%; }
.nx img { width: 56px; height: 56px; object-fit: contain; }
.nx b { display: block; font: 800 24px/1.05 var(--display); }
.nx .when { font-weight: 700; margin-top: 4px; }
.nx .sub { font-size: 14px; color: var(--ink-2); }
.nx .match { margin-top: 6px; font-size: 13.5px; background: var(--turf-soft); color: var(--turf); padding: 3px 8px; border-radius: 6px; display: inline-block; font-weight: 700; }
.years { display: flex; gap: 10px; flex-wrap: wrap; }
.yr { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; min-width: 150px; }
.yr.now { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.yr b { font: 800 24px/1 var(--display); }
.yr .lg-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.yr .lg-row .dia { margin: 0 2px; }
.yr .need { font-size: 13px; color: var(--pole-ink); background: var(--pole-soft); border-radius: 6px; padding: 2px 8px; margin-top: 8px; display: inline-block; }
.div-block { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.div-block + .div-block { margin-top: 12px; }
.div-block h3 { margin: 0; padding: 10px 16px; font: 800 20px/1 var(--display); letter-spacing: .03em; background: var(--wash); border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; }
.div-block h3 small { font: 400 13px var(--body); color: var(--mute); letter-spacing: 0; }
.trow { display: grid; grid-template-columns: 30px 44px minmax(0, 1.2fr) minmax(0, 1.4fr); gap: 10px 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.trow:last-child { border-bottom: 0; }
.trow.done .nm { color: var(--ink-2); }
.trow .lg-img { width: 40px; height: 40px; object-fit: contain; }
.trow.todo .lg-img { filter: grayscale(1); opacity: .6; }
.trow .nm { font-weight: 700; background: none; border: 0; padding: 0; text-align: left; font-size: 16px; }
.trow .nm:hover { text-decoration: underline; }
.trow .vn { font-size: 13.5px; color: var(--ink-2); display: block; font-weight: 400; }
.trow .pl { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; background: var(--wash); border: 1px solid var(--rule); color: var(--ink); }
button.chip:hover { border-color: var(--ink); }
.chip.pl-chip { background: var(--pole-soft); border-color: #ecd780; color: var(--pole-ink); }
.chip.newst { background: var(--violet-soft); border-color: #cfc5f3; color: var(--violet); }
.chip.road { background: var(--turf-soft); border-color: #b8dcc6; color: var(--turf); }
.trow .editor { grid-column: 1 / -1; }
.diabtn { width: 30px; height: 30px; display: grid; place-items: center; background: none; border: 0; padding: 0; }

/* ---------- dialogs, toast, lightbox ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(420px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(20,32,46,.35); color: var(--ink); }
.dialog::backdrop { background: rgba(20,32,46,.5); }
.dialog form, .dialog .box { padding: 22px; display: grid; gap: 14px; }
.dialog h2 { margin: 0; font: 800 30px/1 var(--display); }
.divider { text-align: center; color: var(--mute); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.pk { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: calc(100vw - 32px); font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8,14,22,.92); display: grid; place-items: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 6px; }
.lightbox p { color: #e6edf3; text-align: center; margin: 10px 0 0; }
.lightbox button { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 24px; background: #fff; }

/* ---------- small screens: compact header, drawer becomes a bottom sheet ---------- */
@media (max-width: 760px) {
  .top { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 8px 12px 10px; align-items: center; }
  .controls { display: contents; }
  .brand { grid-column: 1; grid-row: 1; margin: 0; }
  .brand h1 { font-size: 26px; }
  .btn.account { grid-column: 2; grid-row: 1; }
  #filter { grid-column: 1; grid-row: 2; justify-self: start; }
  .tabs { grid-column: 2; grid-row: 2; }
  .score { grid-column: 1 / -1; grid-row: 3; gap: 14px; }
  .tally { min-width: 0; flex: 1; }
  .tally b { font-size: 26px; }
  .tally span { font-size: 12.5px; }
  .tabs a { padding: 7px 8px; }
  .drawer { top: 10dvh; width: 100vw; border-left: 0; border-radius: 16px 16px 0 0; transform: translateY(105%); box-shadow: 0 -10px 30px rgba(20,32,46,.25); }
  .dr-head img { width: 60px; height: 60px; }
  .dr-head h2 { font-size: 30px; }
  .legend { left: 8px; bottom: 8px; font-size: 13px; padding: 5px 9px; max-width: calc(100% - 70px); }
  .hub .hublabel { display: none; }
  .zoom { right: 8px; bottom: 8px; }
  .zoom button { width: 44px; height: 44px; }
  .asof { left: 10px; top: 8px; }
  .trow { grid-template-columns: 30px 40px 1fr; }
  .trow .pl { grid-column: 2 / -1; }
  .card { left: 10px !important; right: 10px; top: auto !important; bottom: 10px; width: auto; max-width: none; }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .toast, .tally .bar i, .node image { transition: none; }
}
