/* Labor Day Drink-A-Thon: the league site's one stylesheet. No build step.

   How to use it (the short version; the long version is docs/WEBSITE.md "Design system"):
   - Colours, spacing, radii and type sizes are tokens on :root. Use var(--...), never hex.
   - Dark is the default. Light follows prefers-color-scheme, and the header toggle pins
     either one with <html data-theme="light|dark">.
   - Page furniture: .section (open, no box) for most things, .card (a surface) only when
     a block needs to stand apart, .row-list for compact tappable rows.
   - Numbers: .tnum for aligned digits, .score-xl / .score-lg / .score-md for scores.
   - Status: .pill.live / .pill.final / .pill.upcoming (plus .win .bonus .warn .bad).
   - Teams: the team_badge macro in templates/_ui.html; any element carrying
     style="{{ team_style(team) }}" gets --team (fill) and --team-ink (text/border). */

/* ================================================================ tokens */

:root {
  color-scheme: dark;

  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 30px;
  --fs-3xl: 40px;

  /* spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --gutter: 16px;

  /* shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* chrome sizes */
  --header-h: 54px;
  --tabbar-h: 60px;
  --maxw: 1120px;

  /* colour: dark (default) */
  --bg: #0b100e;
  --surface: #151d19;        /* cards, rows; ui.DARK_SURFACE */
  --surface-2: #1c2621;      /* hover, inputs, raised bits */
  --line: #25312b;
  --line-strong: #34443b;
  --ink: #ecf2ee;
  --ink-2: #a8b7ae;          /* secondary text */
  --ink-3: #7d8f85;          /* tertiary text, labels */
  --accent: #4ade80;         /* the brand green */
  --accent-ink: #04210f;     /* text on an accent fill */
  --accent-soft: rgba(74, 222, 128, .12);
  --accent-line: rgba(74, 222, 128, .38);
  --live: #ff5d5d;
  --live-soft: rgba(255, 93, 93, .14);
  --info: #7dd3fc;
  --info-soft: rgba(125, 211, 252, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, .13);
  --bonus: #f59e0b;
  --bonus-soft: rgba(245, 158, 11, .14);
  --away: #60a5fa;           /* second side in two-bar meters */
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  --header-bg: rgba(11, 16, 14, .94);

  /* legacy names kept so older templates and inline styles still resolve */
  --bg-2: var(--surface-2);
  --panel: var(--surface);
  --ink-dim: var(--ink-2);
  --ink-faint: var(--ink-3);
  --accent-dim: var(--accent-soft);
  --radius: var(--r-md);
  --muted: var(--ink-3);
}

/* Light: the same tokens, redefined. Kept twice on purpose (media query and manual pin);
   there is no preprocessor to share them. Edit both blocks together. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f5f4;
    --surface: #ffffff;
    --surface-2: #eef2f0;
    --line: #dde4e0;
    --line-strong: #c6d0ca;
    --ink: #0f1a14;
    --ink-2: #3f4f46;
    --ink-3: #5c6c63;
    --accent: #15803d;
    --accent-ink: #ffffff;
    --accent-soft: rgba(21, 128, 61, .10);
    --accent-line: rgba(21, 128, 61, .35);
    --live: #dc2626;
    --live-soft: rgba(220, 38, 38, .10);
    --info: #0369a1;
    --info-soft: rgba(3, 105, 161, .09);
    --warn: #a16207;
    --warn-soft: rgba(202, 138, 4, .12);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, .09);
    --bonus: #b45309;
    --bonus-soft: rgba(217, 119, 6, .12);
    --away: #2563eb;
    --shadow: 0 1px 2px rgba(15, 26, 20, .06), 0 6px 20px rgba(15, 26, 20, .06);
    --header-bg: rgba(243, 245, 244, .94);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --line: #dde4e0;
  --line-strong: #c6d0ca;
  --ink: #0f1a14;
  --ink-2: #3f4f46;
  --ink-3: #5c6c63;
  --accent: #15803d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(21, 128, 61, .10);
  --accent-line: rgba(21, 128, 61, .35);
  --live: #dc2626;
  --live-soft: rgba(220, 38, 38, .10);
  --info: #0369a1;
  --info-soft: rgba(3, 105, 161, .09);
  --warn: #a16207;
  --warn-soft: rgba(202, 138, 4, .12);
  --bad: #b91c1c;
  --bad-soft: rgba(185, 28, 28, .09);
  --bonus: #b45309;
  --bonus-soft: rgba(217, 119, 6, .12);
  --away: #2563eb;
  --shadow: 0 1px 2px rgba(15, 26, 20, .06), 0 6px 20px rgba(15, 26, 20, .06);
  --header-bg: rgba(243, 245, 244, .94);
}

/* Team colour. ui.team_style() puts --team and --team-bright on the element; --team-ink
   is the one to use for text and borders (bright on dark, base on light). */
[style*="--team"] { --team-ink: var(--team-bright); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) [style*="--team"] { --team-ink: var(--team); }
}
:root[data-theme="light"] [style*="--team"] { --team-ink: var(--team); }

/* ================================================================ base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs-base)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

img, svg { max-width: 100%; }

h1 { font-size: var(--fs-2xl); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 var(--sp-1); font-weight: 750; }
h2 { font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -.01em; margin: var(--sp-8) 0 var(--sp-3); font-weight: 700; }
h3 { font-size: var(--fs-md); line-height: 1.3; margin: var(--sp-5) 0 var(--sp-2); font-weight: 650; }
p { margin: 0 0 var(--sp-3); }

.huge { font-size: 64px; margin: 0; line-height: 1; }
.lede { color: var(--ink-2); margin: 0 0 var(--sp-5); font-size: var(--fs-base); }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.center { text-align: center; }
.small { font-size: var(--fs-xs); }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 var(--sp-1);
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.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;
}

/* ---------------------------------------------------------------- numbers and scores */

.tnum, .num, .score, [class*="score-"] { font-variant-numeric: tabular-nums; }
.score-xl { font-size: var(--fs-3xl); font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score-lg { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.score-md { font-size: var(--fs-lg); font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.score-dim { color: var(--ink-3); }

/* ================================================================ shell */

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 8px; }

/* Top header: one row everywhere. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-3);
}
.brand {
  display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0;
  font-weight: 750; letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-logo { width: 30px; height: 30px; flex: none; border-radius: 8px; display: block; }
.brand-name { font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-season { font-weight: 500; color: var(--ink-3); font-size: var(--fs-sm); margin-left: 2px; }

.topnav { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-radius: var(--r-pill); border: 1px solid transparent; background: transparent;
  color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }

/* The theme toggle shows the moon in light mode and the sun in dark mode. */
.theme-toggle .i-sun { display: block; }
.theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .i-moon { display: block; }
}
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-pill);
  background: var(--team, var(--accent)); color: #fff; font-weight: 750; font-size: var(--fs-sm);
  letter-spacing: .02em;
}
.avatar.plain { background: var(--accent); color: var(--accent-ink); }
a.avatar:hover { text-decoration: none; filter: brightness(1.08); }

.account { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.who { color: var(--ink-2); }
.account .account-name { display: none; }
.account form.inline button.link { white-space: nowrap; }
.pip {
  font: 700 10px/1 var(--font); letter-spacing: .08em;
  background: var(--warn); color: #231a02; padding: 3px 6px; border-radius: 4px;
}

/* Desktop nav, shown above 720px. */
.topnav a {
  color: var(--ink-2); padding: 7px 11px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.topnav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.topnav a.on { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.topnav a.despot-link { color: var(--warn); }

/* Bottom tab bar, phones only. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1 1 0; min-width: 0; height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  position: relative;
}
.tabbar a:hover { text-decoration: none; color: var(--ink-2); }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px;
  border-radius: 0 0 2px 2px; background: var(--accent);
}
.tabbar a .tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

main.wrap { padding-top: var(--sp-5); padding-bottom: var(--sp-8); min-height: 60vh; }

/* Quiet footer. On phones its bottom padding is what keeps content clear of the tab bar. */
.foot {
  padding-top: var(--sp-4);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--sp-6));
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs); color: var(--ink-3);
}
.foot p { margin: 2px 0; }
.foot a { color: var(--ink-2); }

@media (min-width: 721px) {
  .tabbar { display: none; }
  .topnav { display: flex; gap: 2px; margin-left: var(--sp-4); overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .top-actions { margin-left: auto; }
  .account .account-name { display: inline; }
  main.wrap { padding-top: var(--sp-8); padding-bottom: var(--sp-10); }
  .foot { padding-bottom: var(--sp-8); }
  h1 { font-size: 34px; }
}

/* ================================================================ blocks */

/* An open section: heading, content, no box. The default for page structure. */
.section { margin: 0 0 var(--sp-8); }
.section > h2:first-child, .section-head h2 { margin-top: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.section-head h2 { margin-bottom: 0; }
.section-head a { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }

/* A surface. Use when a block must stand apart (a form, the headline game). */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-4); margin-bottom: var(--sp-4);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.raised { box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.card-head h1, .card-head h2 { margin-top: 0; }
@media (min-width: 721px) { .card { padding: var(--sp-5); } }

.grid { display: grid; gap: var(--sp-4); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.grid > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }

.stack > * + * { margin-top: var(--sp-3); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }

/* ---------------------------------------------------------------- row list
   Compact tappable rows on one surface, instead of a card per item.
   <ul class="row-list">
     <li><a class="row-item" href="...">
       <span class="row-main"><span class="row-title">Name</span><span class="row-sub">detail</span></span>
       <span class="row-end">42</span>
     </a></li>
     <li class="row-item">... a row that is not a link ...</li>
   </ul>
   .row-list.bare drops the surface (rows inside a card). */
.row-list {
  list-style: none; margin: 0 0 var(--sp-4); padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
}
.row-list.bare { background: none; border: none; border-radius: 0; }
.row-list > li { border-bottom: 1px solid var(--line); }
.row-list > li:last-child { border-bottom: none; }
.row-item {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: nowrap;
  padding: var(--sp-3) var(--sp-4); min-height: 52px; color: var(--ink);
}
.row-list.bare .row-item { padding-left: 0; padding-right: 0; }
button.row-item { width: 100%; background: none; border: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
a.row-item:hover, button.row-item:hover { background: var(--surface-2); text-decoration: none; }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: var(--fs-sm); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.row-end { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.row-chevron { flex: none; color: var(--ink-3); width: 18px; height: 18px; }
.row-icon { flex: none; width: 22px; height: 22px; color: var(--ink-2); }
.row-item.me, .row-list > li.me { background: var(--accent-soft); }
.row-list .divider-label {
  padding: 6px var(--sp-4); font-size: var(--fs-xs); color: var(--ink-3);
  background: var(--surface-2); letter-spacing: .02em;
}

/* ---------------------------------------------------------------- banners */

.banner {
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); margin-bottom: var(--sp-4);
  font-size: 14px; border: 1px solid transparent; border-left-width: 3px;
}
.banner.ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); border-left-color: var(--accent); }
.banner.bad { background: var(--bad-soft); border-color: var(--bad-soft); border-left-color: var(--bad); color: var(--ink); }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-soft); border-left-color: var(--warn); color: var(--ink); }
.banner.live {
  background: var(--info-soft); border-color: var(--info-soft); border-left-color: var(--info);
  color: var(--ink); display: flex; flex-direction: column; gap: 4px;
}
.banner.live strong { color: var(--ink); }

/* ---------------------------------------------------------------- pills and tags */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 9px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap; vertical-align: middle;
}
.pill.live { background: var(--live-soft); color: var(--live); border-color: transparent; }
.pill.live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: pill-pulse 1.6s ease-in-out infinite;
}
.pill.final { background: transparent; color: var(--ink-3); border-color: var(--line-strong); }
.pill.upcoming { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.win { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.bonus { background: var(--bonus-soft); color: var(--bonus); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.sm { font-size: 10px; padding: 3px 7px; }

@keyframes pill-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}
@media (prefers-reduced-motion: reduce) {
  .pill.live::before { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* .tag: the older, smaller chip. Still used across pages. */
.tag {
  display: inline-block; font: 650 10px/1.2 var(--font); letter-spacing: .06em;
  padding: 4px 7px; border-radius: var(--r-pill); background: var(--surface-2);
  color: var(--ink-2); border: 1px solid var(--line); text-transform: uppercase;
  vertical-align: middle; max-width: 100%;
}
.tag.ir { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.bonus { background: var(--bonus-soft); color: var(--bonus); border-color: transparent; }
.tag.win { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.live { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag.locked { background: rgba(167, 139, 250, .14); color: #a78bfa; border-color: transparent; }

/* ---------------------------------------------------------------- team badge */

.team-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%;
  color: var(--ink); vertical-align: middle;
}
a.team-badge:hover { text-decoration: none; }
a.team-badge:hover .team-name { text-decoration: underline; }
.team-mono {
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--team, #475569); color: #fff;
  font: 750 11px/1 var(--font); letter-spacing: .02em;
}
.team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.team-badge.xs .team-mono { width: 20px; height: 20px; font-size: 9px; }
.team-badge.sm .team-mono { width: 24px; height: 24px; font-size: 10px; }
.team-badge.lg { gap: var(--sp-3); }
.team-badge.lg .team-mono { width: 40px; height: 40px; font-size: 15px; }
.team-badge.lg .team-name { font-size: var(--fs-md); }
.team-badge.xl { gap: var(--sp-3); }
.team-badge.xl .team-mono { width: 56px; height: 56px; font-size: 20px; }
.team-badge.xl .team-name { font-size: var(--fs-xl); font-weight: 750; }
.team-badge.mono-only { gap: 0; }
.team-ink { color: var(--team-ink, var(--ink)); }
.team-stripe { border-left: 3px solid var(--team-ink, var(--line)); }

/* ---------------------------------------------------------------- info (i) */

details.info { display: inline; position: static; }
details.info > summary {
  display: inline-grid; place-items: center; list-style: none; cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; vertical-align: -3px; margin-left: 2px;
  border: 1px solid var(--line-strong); color: var(--ink-3);
  font: 700 11px/1 Georgia, "Times New Roman", serif; font-style: italic;
}
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary::marker { content: ""; }
details.info > summary:hover, details.info[open] > summary { color: var(--accent); border-color: var(--accent); }
details.info > .info-body {
  position: fixed; z-index: 60;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--sp-3));
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--sp-3) var(--sp-4);
  font: 400 14px/1.45 var(--font); letter-spacing: 0; text-transform: none; text-align: left;
  white-space: normal;
}
details.info > .info-body .info-close {
  float: right; margin: -4px -8px 0 8px; background: none; border: none; color: var(--ink-3);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
@media (min-width: 721px) {
  details.info > .info-body { bottom: var(--sp-6); }
}

/* ================================================================ tables */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font: 650 11px/1.3 var(--font); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.divider td { border-top: 2px dashed var(--accent-line); font-size: var(--fs-xs); }
tr.me { background: var(--accent-soft); }
tr.me:hover { background: var(--accent-soft); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* A table that must stay a table scrolls sideways inside this, never the page. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.card > .table-scroll, .card .table-scroll { margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4); max-width: none; }
@media (min-width: 721px) {
  .card > .table-scroll, .card .table-scroll { margin: 0 calc(-1 * var(--sp-5)); padding: 0 var(--sp-5); }
}

/* ================================================================ forms */

label { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=datetime-local], input[type=date], input[type=file], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
textarea { min-height: 76px; resize: vertical; }
.field { margin-bottom: var(--sp-4); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 180px; margin-bottom: 0; }
form.inline { display: inline; }
@media (max-width: 720px) {
  /* 16px stops iOS zooming into a focused field. */
  input[type=text], input[type=email], input[type=password], input[type=number],
  input[type=search], input[type=datetime-local], input[type=date], select, textarea { font-size: 16px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 16px; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font: 650 14px/1.2 var(--font); cursor: pointer;
  text-align: center;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: #b4332f; color: #fff; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
button.link {
  background: none; border: none; color: var(--ink-2); cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline;
}
button.link:hover { color: var(--ink); }

/* ================================================================ page pieces */

/* Week picker: one scrollable strip on phones, never two rows. */
.weekbar {
  position: relative; display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) var(--sp-4);
  padding: 2px var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.weekbar::-webkit-scrollbar { display: none; }
.weekbar a {
  flex: none; min-width: 38px; height: 36px; display: inline-grid; place-items: center; padding: 0 10px;
  border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2);
  font: 650 14px/1 var(--font); font-variant-numeric: tabular-nums; border: 1px solid var(--line);
  white-space: nowrap;
}
.weekbar a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.weekbar a:hover { text-decoration: none; color: var(--ink); }
.weekbar a.on:hover { color: var(--accent-ink); }
@media (min-width: 721px) { .weekbar { flex-wrap: wrap; margin-left: 0; margin-right: 0; padding: 0; } }

/* A game tile (scoreboard, home). */
.matchup {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); color: var(--ink);
}
a.matchup:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.matchup .side { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: 6px 0; }
.matchup .side > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.matchup .side.won { font-weight: 700; }
.matchup .side.lost { color: var(--ink-3); }
.matchup .side.lost .score { color: var(--ink-3); }
.matchup .score { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; flex: none; }
.matchup .meta {
  border-top: 1px solid var(--line); margin-top: var(--sp-2); padding-top: var(--sp-2);
  font-size: var(--fs-xs); color: var(--ink-3);
}
.card .side { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: 6px 0; }
.card .side .score { font-size: 32px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.card .side.lost { color: var(--ink-3); }
.meta { font-size: var(--fs-sm); color: var(--ink-3); }

.catgrid { width: 100%; }
.catgrid td.bar { width: 36%; min-width: 80px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 2px 0; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.away > span { background: var(--away); }

.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-size: 22px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat span.muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

.todo { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: none; }
.todo .count { font-size: 17px; font-weight: 800; min-width: 28px; font-variant-numeric: tabular-nums; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: none; }

.pick-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.pick-list label {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0; min-height: 46px;
  border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; cursor: pointer;
}
.pick-list label:last-child { border-bottom: none; }
.pick-list label:hover { background: var(--surface-2); }
.pick-list input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.pick-list .locked-row { opacity: .55; }
.reveal-row { background: var(--info-soft); }

/* Win odds (lddt.web.odds) */
.odds { margin: var(--sp-2) 0 4px; font-size: var(--fs-sm); }
.odds-names { display: flex; justify-content: space-between; gap: var(--sp-2); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.odds-names .fav { color: var(--ink); font-weight: 650; }
.odds-bar { height: 6px; border-radius: 3px; background: var(--away); overflow: hidden; margin-top: 4px; opacity: .9; }
.odds-bar span { display: block; height: 100%; background: var(--accent); }

/* The More page: a big tappable list. */
.more-list .row-item { min-height: 56px; font-size: var(--fs-md); }

/* Offline page (static/offline.html). */
.offline { max-width: 420px; margin: 18vh auto 0; text-align: center; padding: 0 var(--gutter); }

@media (max-width: 720px) {
  .huge { font-size: 46px; }
  th, td { padding: 9px 8px; }
}

@media print {
  .topbar, .tabbar, .foot { display: none; }
  main.wrap { padding: 0; }
}

/* ---- lineup ---- */
/* The lineup editor (templates/lineup.html, static/lineup.js). Tokens only. */

.lu-head { margin-bottom: var(--sp-3); }
.lu-head h1 { margin-top: var(--sp-2); }
.lu-deadlines { margin: var(--sp-2) 0 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.8; }
.lu-deadline-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); }
.lu-deadlines .deadline-when { font-weight: 650; color: var(--ink); }
.lu-deadlines .deadline-left::before { content: "\00b7\00a0"; }
.lu-deadlines .eyebrow { display: inline; margin-right: 2px; }

/* Sticky counter and win odds: stays under the header while the list scrolls. */
.lu-sticky {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 20;
  margin: 0 calc(-1 * var(--gutter)) var(--sp-4);
  padding: var(--sp-3) var(--gutter);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 721px) {
  .lu-sticky { margin-left: 0; margin-right: 0; border: 1px solid var(--line); border-radius: var(--r-lg); }
}
.lu-countbar { display: flex; align-items: center; gap: var(--sp-3); }
.lu-count { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lu-count-num { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.lu-count-num b { font-size: var(--fs-2xl); color: var(--warn); }
.lu-count.is-ok .lu-count-num b { color: var(--accent); }
.lu-count.is-over .lu-count-num b { color: var(--bad); }
.lu-count-note { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; }
.lu-count.is-ok .lu-count-note { color: var(--accent); }
.lu-count.is-over .lu-count-note { color: var(--bad); }
.lu-save { flex: none; min-height: 48px; min-width: 104px; font-size: var(--fs-md); }

.lu-odds { margin-top: var(--sp-3); transition: opacity .15s; }
.lu-odds[hidden], .lu-cats-wrap[hidden] { display: none; }
.lu-odds.is-busy { opacity: .6; }
.lu-odds-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); font-size: var(--fs-sm); }
.lu-odds-label { color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-odds-num { flex: none; font-size: var(--fs-md); color: var(--ink); }
.lu-odds.is-up .lu-odds-num { color: var(--accent); }
.lu-odds.is-down .lu-odds-num { color: var(--bad); }
.lu-odds-bar { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.lu-odds-mark { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); opacity: 0; }
.lu-odds.is-up .lu-odds-mark, .lu-odds.is-down .lu-odds-mark { opacity: .8; }
.lu-odds.is-down .lu-odds-bar span { background: var(--bad); }
.lu-odds-bar span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .3s ease; }
@media (prefers-reduced-motion: reduce) { .lu-odds-bar span { transition: none; } }

/* Eight category chips, four across. */
.lu-cats-wrap { margin-bottom: var(--sp-5); }
.lu-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 721px) { .lu-cats { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.lu-cat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0;
  padding: 6px 8px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
}
.lu-cat-label { font-size: 11px; font-weight: 650; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-cat-val { font-size: var(--fs-md); line-height: 1.15; color: var(--ink); }
.lu-cat.is-good { background: var(--accent-soft); border-color: transparent; }
.lu-cat.is-good .lu-cat-val { color: var(--accent); }
.lu-cat.is-bad { background: var(--bad-soft); border-color: transparent; }
.lu-cat.is-bad .lu-cat-val { color: var(--bad); }
.lu-cat-delta { font-size: 11px; font-weight: 700; min-height: 14px; line-height: 14px; }
.lu-cat.is-up .lu-cat-delta { color: var(--accent); }
.lu-cat.is-down .lu-cat-delta { color: var(--bad); }
.lu-cats-note { margin: var(--sp-2) 0 0; }

/* Player rows: the whole row is the label. */
.lu-section { margin-bottom: var(--sp-6); }
.lu-section .section-head h2 { font-size: var(--fs-md); }
.lu-list > li { position: relative; }
.lu-row {
  display: flex; align-items: center; gap: var(--sp-3); margin: 0;
  padding: var(--sp-3) var(--sp-4); min-height: 60px;
  color: var(--ink); font-size: var(--fs-base); font-weight: 400; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.lu-row:not(.is-fixed):hover { background: var(--surface-2); }
.lu-row.is-on, .lu-row.is-on:not(.is-fixed):hover { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lu-row.is-fixed { cursor: default; }
.lu-row.is-locked { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink-3); }
.lu-row.is-ineligible .row-title { color: var(--ink-3); }
.lu-row .row-title { white-space: normal; }
.lu-row .row-sub { white-space: nowrap; }

/* The tick: a 26px circle inside a row-high tap target. */
.lu-check {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface);
  display: inline-grid; place-items: center; cursor: inherit;
}
.lu-check::after {
  content: ""; width: 7px; height: 12px; margin-top: -3px;
  border: solid var(--accent-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
  opacity: 0;
}
.lu-check:checked { background: var(--accent); border-color: var(--accent); }
.lu-check:checked::after { opacity: 1; }
.lu-check:disabled { opacity: .5; }
.lu-check:checked:disabled { background: var(--ink-3); border-color: var(--ink-3); opacity: 1; }
.lu-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lu-proj { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lu-proj-label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-right: 2px;
}
.lu-reason { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.lu-row.is-played .lu-reason { color: var(--info); }
.lu-row.is-ineligible .lu-reason { color: var(--bad); }
.lu-pills { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.lu-pill-locked { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.lu-ir .row-item { min-height: 56px; }

/* ---- home, scoreboard, matchup ----
   Page-specific pieces for templates/home.html, scoreboard.html, matchup.html and the
   shared _odds.html / _live.html partials. Tokens only; team colours arrive through
   style="{{ team_style(team) }}" as --team / --team-ink. */

/* Live strip (_live.html): one compact line, details behind the (i). */
.live-strip {
  display: flex; flex-direction: column; gap: 6px;
  margin: 0 0 var(--sp-4); padding: var(--sp-2) var(--sp-3);
  background: var(--live-soft); border-radius: var(--r-md);
  font-size: var(--fs-sm); color: var(--ink);
}
.live-strip-top { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.live-strip-text { flex: 1 1 auto; min-width: 0; }
.live-strip-games { display: flex; gap: 6px var(--sp-3); flex-wrap: wrap; font-size: var(--fs-xs); }
.live-game { white-space: nowrap; }
.live-strip-error { font-size: var(--fs-xs); color: var(--bad); }

/* Win odds (_odds.html): each side of the bar in its team's colour. */
.odds { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); }
.odds-names {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2);
  color: var(--ink-3);
}
.odds-side { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 42%; }
.odds-side.right { justify-content: flex-end; }
.odds-side b { font-weight: 750; color: var(--ink-2); }
.odds-side.fav b { color: var(--team-ink, var(--ink)); }
.odds-side.fav { color: var(--ink-2); }
.odds-label { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; font-weight: 650; white-space: nowrap; }
.odds-bar {
  display: flex; gap: 2px; height: 6px; margin-top: 6px; border-radius: var(--r-pill);
  background: var(--surface-2); overflow: hidden; opacity: 1;
}
.odds-bar .odds-seg { display: block; height: 100%; background: var(--team-ink, var(--accent)); }
.odds-seg.right { margin-left: auto; }
.odds.compact { margin-top: var(--sp-2); }
.odds.compact .odds-bar { height: 4px; margin-top: 0; }
.odds-note { margin-top: 4px; font-size: var(--fs-xs); color: var(--ink-3); }

/* A head-to-head board shared by the home headline game and the matchup header:
   team | score | dash | score | team */
.mygame-board, .h2h-board {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
  align-items: start; gap: var(--sp-2); color: var(--ink); margin-top: var(--sp-3);
}
a.mygame-board:hover { text-decoration: none; }
.mg-team, .h2h-team {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
  text-align: center; color: var(--ink);
}
a.h2h-team:hover { text-decoration: none; }
a.h2h-team:hover .h2h-name { text-decoration: underline; }
.mg-name, .h2h-name {
  font-weight: 650; font-size: var(--fs-sm); line-height: 1.25; max-width: 100%;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mg-dash { display: block; width: 10px; height: 3px; border-radius: 2px; background: var(--line-strong); margin-top: 19px; }
.mygame-board .score-xl, .h2h-board .score-xl { min-width: 1ch; text-align: center; }
.board-vs {
  margin-top: 10px; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}

/* Home: header and deadlines. */
.home-head { margin-bottom: var(--sp-4); }
.home-head h1 { margin-bottom: var(--sp-1); }
.home-deadlines { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.home-deadlines .deadline { display: inline-flex; align-items: baseline; gap: 6px; }
.home-deadlines .eyebrow { margin: 0; }
.deadline-group { display: inline-flex; align-items: baseline; gap: 4px; }
.home-deadlines .deadline-when { font-weight: 650; }

/* Home: your game. */
.mygame { padding: var(--sp-4); margin-bottom: var(--sp-4); }
.mygame-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.mygame-top .eyebrow { margin: 0; }
.mygame .odds { margin-top: var(--sp-4); }
.mygame-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.mygame-link { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); font-weight: 650; white-space: nowrap; }
.mygame-link .icon { width: 16px; height: 16px; }

/* Category chips: green for your side, dim for theirs. */
.chips {
  list-style: none; margin: var(--sp-4) -6px 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
}
.chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0;
  padding: 7px 5px 6px 7px; border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid transparent; color: var(--ink-2);
}
.chip-label { font-size: 11px; font-weight: 650; letter-spacing: -.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-value { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.chip-chance { opacity: .8; }
.chip-bonus {
  font: 800 10px/1 var(--font); padding: 2px 4px; border-radius: 4px;
  background: var(--bonus-soft); color: var(--bonus);
}
.chip.mine { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chip.mine .chip-label { color: var(--ink); }
.chip.theirs { background: transparent; border-color: var(--line); color: var(--ink-3); }
.chip.level { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-2); }
.chip.open .chip-value { font-weight: 700; font-size: var(--fs-sm); color: var(--ink-2); }
.chip.open.fav { background: var(--accent-soft); }
.chip.open.fav .chip-value { color: var(--accent); }
.chip.open.dog { background: transparent; border-color: var(--line); }
.chip.open.dog .chip-value { color: var(--ink-3); }

/* Home: lineup nudge. */
.nudge {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-6); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.nudge.warn { background: var(--warn-soft); border-color: transparent; }
.nudge-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nudge-text b { font-weight: 650; }
.nudge .btn { flex: none; }

/* Compact game rows (home). */
.game-row { padding-top: 10px; padding-bottom: 10px; }
.game-sides { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.game-side { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.game-side .team-badge { flex: 1 1 auto; }
.game-side.lost .team-name { color: var(--ink-3); font-weight: 500; }
.game-side.lost .team-mono { opacity: .55; }
.game-score { flex: none; min-width: 2ch; text-align: right; font-size: var(--fs-lg); font-weight: 800; line-height: 1; }
.game-side.lost .game-score { color: var(--ink-3); }
.game-chance { flex: none; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 650; min-width: 3.2ch; text-align: right; }
.game-chance.fav { color: var(--ink); font-weight: 800; }
.game-chance.small { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); }
.seed {
  flex: none; font-size: 10px; font-weight: 700; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 4px;
}
.section-head h2.cluster { gap: var(--sp-2); }

/* Home: standings snippet. */
.standings-mini .row-item { min-height: 46px; padding-top: 8px; padding-bottom: 8px; }
.standings-mini .team-badge { flex: 1 1 auto; }
.standings-mini .rank { flex: none; width: 1.6em; color: var(--ink-3); font-weight: 650; font-size: var(--fs-sm); }
.standings-mini .row-end { display: flex; align-items: baseline; gap: var(--sp-3); }
.standings-mini .diff { min-width: 3ch; color: var(--ink-3); font-size: var(--fs-sm); }
.standings-mini .divider-label { display: flex; align-items: center; gap: 4px; }
.standings-mini li.me { box-shadow: inset 3px 0 0 var(--accent); }

/* Scoreboard. */
.page-head { margin-bottom: var(--sp-3); }
.page-head p { margin: 0; }
.games-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.game-card {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
a.game-card:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-2); }
.gc-foot {
  display: flex; align-items: center; gap: var(--sp-2); min-width: 0; margin-top: 2px;
  font-size: var(--fs-xs); color: var(--ink-3);
}
.gc-foot .pill { font-size: 10px; padding: 3px 7px; }
.gc-foot .gc-round { margin-left: auto; white-space: nowrap; }
.gc-side { display: flex; align-items: center; gap: var(--sp-2); min-height: 34px; min-width: 0; }
.gc-side .team-badge { flex: 1 1 auto; }
.gc-side .score-lg { flex: none; min-width: 2ch; text-align: right; }
.gc-side.lost .team-name { color: var(--ink-3); font-weight: 500; }
.gc-side.lost .team-mono { opacity: .55; }
.gc-chance { flex: none; font-size: var(--fs-xs); color: var(--ink-3); }
.gc-chance.big { font-size: var(--fs-md); font-weight: 650; color: var(--ink-3); min-width: 3.5ch; text-align: right; }
.gc-chance.big.fav { color: var(--ink); font-weight: 800; }
.gc-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard-foot { margin-top: var(--sp-4); }
.empty-state { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--ink-3); }

/* Matchup. */
.back-link { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-3); color: var(--ink-2); }
.back-link .icon { width: 16px; height: 16px; }
.icon.flip { transform: scaleX(-1); }
.h2h-head { margin-bottom: var(--sp-6); }
.h2h-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.h2h-top .eyebrow { margin: 0; }
.h2h-status { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }

.cat-rows {
  list-style: none; margin: 0 0 var(--sp-3); padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.cat-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 116px minmax(0, 1fr);
  align-items: stretch; border-bottom: 1px solid var(--line); min-height: 54px;
}
.cat-row:last-child { border-bottom: none; }
.cat-mid {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px; text-align: center; min-width: 0;
}
.cat-label { font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
.cat-label details.info > summary { width: 16px; height: 16px; font-size: 10px; vertical-align: -2px; }
.cat-note { font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.cat-row.decider .cat-note { color: var(--info); }
.cat-side {
  display: flex; align-items: center; gap: 6px; padding: 8px var(--sp-3); min-width: 0;
  color: var(--ink-2);
}
.cat-side .cat-total { flex: none; }
.cat-fill { flex: 1 1 auto; }
.cat-total { font-size: var(--fs-lg); font-weight: 700; line-height: 1; }
.cat-side.win { color: var(--team-ink, var(--accent)); background: var(--surface-2); }
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .cat-side.win { background: color-mix(in srgb, var(--team-ink) 14%, transparent); }
}
.cat-side.win .cat-total { font-weight: 800; }
.cat-side.home.win { box-shadow: inset 3px 0 0 var(--team-ink); }
.cat-side.away.win { box-shadow: inset -3px 0 0 var(--team-ink); }
.cat-chance { font-size: var(--fs-xs); color: var(--ink-3); }
.cat-side .pill.bonus, .chip-bonus { text-transform: none; letter-spacing: 0; }
.cat-chance.fav { color: var(--ink); font-weight: 700; }
.cat-side.lean { color: var(--team-ink, var(--ink)); }
.cat-side.lean .cat-total { font-weight: 800; }

.lineups { display: grid; gap: 0 var(--sp-6); grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); margin-top: var(--sp-6); }
.lineup .section-head h2 { font-size: var(--fs-md); min-width: 0; }
.lineup .section-head h2 .team-badge { max-width: 100%; }
.player-row { min-height: 50px; padding-top: 8px; padding-bottom: 8px; }
.player-row .row-title { font-size: var(--fs-base); }
.player-meta { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.player-row .row-sub { color: var(--ink-2); white-space: nowrap; }

/* ---- standings, teams, team, schedule, players, rules ---- */

.page-head { margin-bottom: var(--sp-5); }
.page-head .lede { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.warn-ink { color: var(--warn); }

/* Standings rows: seed, badge, record over differential. */
.standing-seed {
  flex: none; width: 22px; text-align: right; font-weight: 700; font-size: var(--fs-sm);
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.row-main > .team-badge { max-width: 100%; }
.standing-sub { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: 1px; padding-left: 36px; }
.standing-sub .tag { font-size: 9px; padding: 2px 6px; }
.standing-row { padding-top: 10px; padding-bottom: 10px; }
.standing-sub:empty { display: none; }
.standing-owner { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standing-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.standing-record { letter-spacing: -.01em; }
.standing-diff { font-size: var(--fs-xs); font-weight: 650; color: var(--ink-3); }
.standing-diff.up { color: var(--accent); }
.standing-diff.down { color: var(--bad); }
.standings-list .divider-label { font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.standings-list .divider-label.bitch-label { color: var(--bonus); background: var(--bonus-soft); }
.provisional-note { margin: calc(-1 * var(--sp-3)) 0 var(--sp-3); }

/* The playoff cut line: a dashed accent rule with its label sitting on it. */
.row-list > li.cutline {
  position: relative; height: 28px; border-bottom: none;
  display: flex; align-items: center; justify-content: center;
}
.row-list > li.cutline::before {
  content: ""; position: absolute; left: var(--sp-4); right: var(--sp-4); top: 50%;
  border-top: 2px dashed var(--accent-line);
}
.cutline-label {
  position: relative; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--accent-line); color: var(--accent);
  font: 700 10px/1.4 var(--font); letter-spacing: .08em; text-transform: uppercase;
}

/* Collapsed explanations ("How seeding works", the full rules). */
details.fold {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: var(--sp-2);
}
details.fold > summary {
  display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; list-style: none;
  padding: var(--sp-3) var(--sp-4); min-height: 50px; font-weight: 650;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::marker { content: ""; }
details.fold > summary:hover { background: var(--surface-2); border-radius: var(--r-lg); }
details.fold > summary > span:first-child { flex: 1 1 auto; min-width: 0; }
.fold-rule { flex: none; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); }
.fold-chevron { flex: none; width: 18px; height: 18px; color: var(--ink-3); transition: transform .15s ease; }
details.fold[open] > summary .fold-chevron { transform: rotate(90deg); }
.fold-body { padding: 0 var(--sp-4) var(--sp-3); border-top: 1px solid var(--line); }
.fold-body > :first-child { margin-top: var(--sp-3); }
.fold-body ul.plain li { padding: 8px 0; }
@media (prefers-reduced-motion: reduce) { .fold-chevron { transition: none; } }

/* Teams list and waiver order. */
.team-list-sub { padding-left: 36px; }
.order-row .row-main { flex-direction: row; }

/* Team page header. */
.team-hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  border-top: 4px solid var(--team-ink, var(--accent));
  padding: var(--sp-4); margin-bottom: var(--sp-4);
}
.team-hero-id { min-width: 0; }
.team-hero .team-badge.xl { max-width: 100%; }
.team-hero .team-badge.xl .team-name { white-space: normal; line-height: 1.15; }
.team-hero-sub {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin: var(--sp-2) 0 0 68px; color: var(--ink-2); font-size: var(--fs-sm);
}
.team-hero-sub:empty { display: none; }
.stat-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2);
  margin: var(--sp-4) 0 0; padding-top: var(--sp-3); border-top: 1px solid var(--line);
}
.stat-strip .stat { margin: 0; }
.stat-strip dt {
  display: flex; align-items: center; gap: 2px; white-space: nowrap;
  font-size: 11px; line-height: 18px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .05em; font-weight: 650;
}
.stat-strip dt details.info > summary { vertical-align: 0; width: 16px; height: 16px; font-size: 10px; }
.stat-strip dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 800; line-height: 1.2; }
.team-actions { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.team-actions .btn:first-child { flex: 1 1 auto; }
@media (min-width: 721px) {
  .team-hero { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); padding: var(--sp-5); }
  .stat-strip { margin: 0; padding: 0; border-top: none; gap: var(--sp-5); flex: none; }
  .team-actions .btn:first-child { flex: none; }
}
.lineup-problems ul { margin: var(--sp-2) 0; padding-left: var(--sp-5); }
.lineup-problems li { margin-bottom: 4px; }
.week-row .row-main { gap: 4px; }
.week-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.lineup-status { margin-top: calc(-1 * var(--sp-2)); gap: 6px; }
.lineup-status .deadline { display: inline-flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.lineup-status .eyebrow { margin: 0; }
.roster-flags { flex-wrap: nowrap; gap: 6px; }
.pill.result-loss { color: var(--ink-3); }
.season-week {
  flex: none; width: 24px; text-align: right; font-weight: 700; font-size: var(--fs-sm);
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.season-row .row-main { gap: 2px; }
.season-end { display: flex; align-items: center; gap: var(--sp-2); }

/* Schedule: one row per game, two stacked sides. */
.schedule-head h2 { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.schedule-deadlines { margin-bottom: var(--sp-4); gap: var(--sp-4); font-size: var(--fs-sm); }
.schedule-deadlines .deadline, .rules-deadlines .deadline { display: inline-flex; gap: 6px; align-items: baseline; }
.schedule-deadlines .eyebrow, .rules-deadlines .eyebrow { margin: 0; }
.group-label { margin-top: var(--sp-5); }
.game-teams { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* Scoped under .game-teams: the home page's scoreboard has its own .game-side rules. */
.game-teams .game-side.won .team-name { font-weight: 750; }
.game-teams .game-side.lost .team-name { color: var(--ink-3); font-weight: 600; }
.game-seed {
  flex: none; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); width: 16px; text-align: right;
}
.game-teams .game-score { font-weight: 750; }
.game-note { font-size: var(--fs-xs); color: var(--ink-3); padding-left: 32px; }
.game-final { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.game-note .pill { font-size: 10px; padding: 3px 7px; }

/* Players. */
.player-search { margin-bottom: var(--sp-4); }
.search-line { display: flex; gap: var(--sp-2); }
.search-line input { flex: 1 1 auto; min-width: 0; }
.search-line .btn { flex: none; }
.search-options { margin-top: var(--sp-3); gap: var(--sp-3); }
.check-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
  padding: 7px 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 600;
}
.check-chip input { width: 16px; height: 16px; margin: 0; }
.week-pick { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-sm); }
.week-pick select { width: auto; min-height: 36px; padding: 5px 10px; }
.result-count { margin-bottom: var(--sp-2); }
.player-line { color: var(--ink-2); }
.player-end { display: flex; align-items: center; gap: 6px; max-width: 46%; min-width: 0; }
.player-end .team-badge { min-width: 0; }
.player-end .team-name { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.free-agent { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }
.player-name .pill { margin-left: 4px; vertical-align: 1px; }

/* Player detail. */
.back-link { margin: 0 0 var(--sp-2); }
.back-link a { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.back-chevron { width: 16px; height: 16px; transform: rotate(180deg); }
.player-hero { margin-bottom: var(--sp-4); }
.player-hero-sub { margin: var(--sp-2) 0 0; }
.holder-row .row-main { gap: 4px; }
.cat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.cat-cell { background: var(--surface); padding: 10px var(--sp-3); min-width: 0; }
.cat-cell dt {
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-cell dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 800; line-height: 1.2; }
.cat-cell.zero dd { color: var(--ink-3); font-weight: 600; }
.week-line { white-space: normal; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Rules. */
.rules-summary h2 { margin-top: 0; }
ol.steps { margin: 0 0 var(--sp-4); padding: 0; list-style: none; counter-reset: step; }
ol.steps > li {
  counter-increment: step; position: relative; padding: 8px 0 8px 36px;
  border-bottom: 1px solid var(--line); color: var(--ink-2);
}
ol.steps > li:last-child { border-bottom: none; }
ol.steps > li strong { color: var(--ink); }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 8px;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font: 750 12px/1 var(--font);
}
.rules-deadlines { gap: var(--sp-4); font-size: var(--fs-sm); }
.cat-num {
  flex: none; width: 22px; text-align: right; font-weight: 700; font-size: var(--fs-sm); color: var(--ink-3);
}
.cat-list .row-title { display: flex; align-items: center; gap: var(--sp-2); }
.cat-list .row-sub { white-space: normal; }
.rules-full > h2 { margin-top: 0; }

/* Chromium lays an inline <details> out as a block; keep the (i) on its line of text. */
.page-head details.info, .section-head details.info, .divider-label details.info,
.rules-summary details.info, .fold-body details.info { display: inline-block; }

/* Wide screens: rosters and game lists in two columns. */
@media (min-width: 900px) {
  .row-list.roster-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .row-list.roster-grid > li:nth-child(odd) { border-right: 1px solid var(--line); }
  .row-list.roster-grid > li:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}

/* ---- recap, notifications ---- */

/* Weekly recap (templates/recap.html). */
.recap-head { margin-bottom: var(--sp-5); }
.recap-head .lede { margin-bottom: 0; }
.recap-headline { border-top: 3px solid var(--team-ink, var(--accent)); }
.recap-headline h2 { margin: var(--sp-1) 0 var(--sp-4); font-size: var(--fs-xl); line-height: 1.2; }
.recap-headline p { color: var(--ink-2); }
.recap-scores { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.recap-more { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); font-weight: 650; }
.recap-more .icon { width: 16px; height: 16px; }
.recap-side { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
.recap-side .team-badge { flex: 1 1 auto; }
.recap-side > [class*="score-"] { flex: none; }
.recap-side.lost .team-name { color: var(--ink-2); font-weight: 500; }
.recap-side.lost > [class*="score-"] { color: var(--ink-3); }
.recap-game .row-main { gap: var(--sp-2); }
.recap-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-3); }
.recap-line { font-variant-numeric: tabular-nums; margin-right: var(--sp-1); }
.recap-note { font-size: var(--fs-sm); color: var(--ink-2); }
.recap-call .team-badge { flex: none; align-self: flex-start; margin-top: 2px; }
.recap-count { font-size: var(--fs-xl); font-weight: 800; line-height: 1; }
.recap-count small { display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.recap-move { white-space: nowrap; }
.recap-move small { display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: 700; }
.recap-move.up small { color: var(--accent); }
.recap-move.down small { color: var(--bad); }
.recap-cat { margin: 0 0 2px; }
.recap-value { font-size: var(--fs-lg); font-weight: 750; }
.recap-pager { display: flex; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-8); }

/* Notifications page (templates/notifications.html, static/notify.js). */
.notify-copy { min-width: 0; }
.notify-copy h2 { margin: 0 0 2px; font-size: var(--fs-md); }
.notify-copy .row-sub { margin: 0; }
.notify-foot { margin-top: var(--sp-3); flex-wrap: wrap; }
.notify-foot p { margin: 0; }
.notify-sub { white-space: normal; }
.notify-card [hidden], .banner[hidden] { display: none; }
.switch { position: relative; display: inline-flex; flex: none; width: 52px; height: 32px; margin: 0; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track {
  position: relative; width: 100%; height: 100%; border-radius: var(--r-pill);
  background: var(--line-strong); transition: background .15s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink-2); transition: transform .15s ease, background .15s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-track { opacity: .45; }
@media (prefers-reduced-motion: reduce) {
  .switch-track, .switch-track::after { transition: none; }
}

/* ---- moves, waivers, trades, account, despot ---- */
/* Owned by the moves/waivers/trades/account/sign-in/error/Despot-console pages.
   Prefixes: tx- (moves, waivers, trades), dc- (Despot console), acct- (account, sign-in),
   err- (error page). Tokens only. */

/* Page head: title, one plain line, an optional action on the right. */
.tx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.tx-head h1 { margin: 0; }
.tx-head .lede { margin: var(--sp-1) 0 0; }
.tx-head > .btn { flex: none; margin-top: 4px; }

/* Bigger, thumb-sized buttons, and a row of them that shares the width on phones. */
.btn.lg { min-height: 50px; padding: 12px 20px; font-size: 16px; }
.btn.ghost-bad { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.ghost-bad:hover { background: var(--bad-soft); filter: none; }
.btn .icon { width: 18px; height: 18px; }
.tx-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.tx-actions > .btn, .tx-actions > form { flex: 1 1 0; min-width: 0; }
.tx-actions > form > .btn { width: 100%; }
.tx-actions.fit > .btn, .tx-actions.fit > form { flex: 0 0 auto; }

/* Headline numbers: three small tiles in one row. */
.tx-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin: 0 0 var(--sp-6); }
.tx-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-3); min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.tx-kpi-label { font-size: var(--fs-xs); font-weight: 650; color: var(--ink-3); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.tx-kpi-value { font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-kpi-value small { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.tx-kpi-sub { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.35; }
.tx-kpi.good .tx-kpi-value { color: var(--accent); }
.tx-kpi.bad { border-color: var(--bad); background: var(--bad-soft); }
.tx-kpi.bad .tx-kpi-value { color: var(--bad); }
.tx-kpi .deadline { display: flex; flex-direction: column; }
.tx-kpi .deadline-left { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.02em; order: -1; white-space: nowrap; }
.tx-kpi .deadline-when { font-size: var(--fs-xs); color: var(--ink-3); }
@media (max-width: 480px) {
  .tx-kpi { padding: 10px; }
  .tx-kpi-value, .tx-kpi .deadline-left { font-size: 19px; }
}

/* A numbered circle: priority, rank, step. */
.tx-num {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--ink-2); font: 750 13px/1 var(--font); font-variant-numeric: tabular-nums;
}
.tx-num.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Rows that wrap their title instead of cutting it off. */
.row-item.tx-wrap { align-items: flex-start; }
.row-item.tx-wrap .row-title { white-space: normal; }
.row-item.tx-wrap .row-end { padding-top: 2px; }

/* The move feed. */
.row-item > .team-badge { flex: none; }
.tx-feed .team-badge.mono-only { margin-top: 1px; }
.tx-move-team { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; }
.tx-move-text { font-weight: 600; line-height: 1.35; }
.tx-move-line { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.tx-move-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.tx-filter { display: flex; gap: var(--sp-2); align-items: center; margin: 0 0 var(--sp-3); }
.tx-filter select { flex: 1 1 auto; }

/* Waiver claims. */
.tx-claim-add { font-weight: 650; }
.tx-claim-drop { font-size: var(--fs-sm); color: var(--ink-3); }
.tx-claim-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; }
.tx-withdraw { border: 1px solid var(--line-strong); color: var(--ink-2); }
.tx-withdraw:hover { color: var(--bad); border-color: var(--bad); }
.tx-editor-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-3);
  align-items: start; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line);
}
.tx-editor-row:last-child { border-bottom: none; }
.tx-editor-row .tx-num { margin-top: 22px; }
.tx-editor-fields { display: grid; gap: var(--sp-2); min-width: 0; }
.tx-editor-fields label { margin-bottom: 2px; font-size: var(--fs-xs); font-weight: 650; color: var(--ink-3); }
.tx-editor-tools { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.tx-editor-tools .icon-btn { width: 40px; height: 40px; border-color: var(--line); background: var(--surface-2); border-radius: var(--r-md); }
.tx-editor-tools .icon-btn[disabled] { opacity: .35; cursor: default; }
.tx-editor-tools .icon-btn.remove { color: var(--bad); }
.tx-editor-empty { padding: var(--sp-4); color: var(--ink-3); }
.tx-search { display: flex; gap: var(--sp-2); }
.tx-search input { flex: 1 1 auto; min-width: 0; }
.tx-search .btn { flex: none; }

/* Trades. */
.tx-trade { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--sp-3); }
.tx-trade.attention { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.tx-trade-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4) 0; }
.tx-trade-meta { font-size: var(--fs-xs); color: var(--ink-3); }
.tx-trade-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); align-items: start; }
.tx-trade-side { min-width: 0; }
.tx-trade-side .team-badge { margin-bottom: 4px; }
.tx-trade-side .eyebrow { margin: 0 0 2px; }
.tx-trade-side ul { list-style: none; margin: 0; padding: 0; }
.tx-trade-side li { padding: 3px 0; line-height: 1.3; }
.tx-trade-side li b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.tx-trade-side li span { font-size: var(--fs-xs); color: var(--ink-3); }
.tx-trade-swap { color: var(--ink-3); padding-top: 40px; }
.tx-trade-swap .icon { width: 20px; height: 20px; }
.tx-trade-note { margin: 0 var(--sp-4) var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-sm); }
.tx-trade-foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
.tx-trade-foot .field { margin-bottom: var(--sp-2); }
.tx-trade-foot p { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--ink-3); }
.tx-pick-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-2); }
.tx-pick-head h3 { margin: 0; }
.tx-pick-head .muted { font-size: var(--fs-xs); }
.pick-list label:has(input:checked) { background: var(--accent-soft); }

.tx-banner-row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.tx-banner-row .deadline { display: flex; gap: 6px; align-items: baseline; }
.dc-more { cursor: pointer; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; min-height: 32px; display: flex; align-items: center; }

/* Forms that lay out in two columns when there is room, one on a phone. */
.tx-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0 var(--sp-3); }
.tx-check {
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0;
  color: var(--ink); font-size: 14px; cursor: pointer;
}
.tx-check input { width: 20px; height: 20px; flex: none; }

/* ---------------------------------------------------------------- Despot console */

.dc-nav {
  position: relative; display: flex; gap: 6px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) var(--sp-5); padding: 2px var(--gutter);
  -webkit-overflow-scrolling: touch;
}
.dc-nav::-webkit-scrollbar { display: none; }
.dc-nav a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font: 650 14px/1 var(--font); white-space: nowrap;
}
.dc-nav a .icon { width: 16px; height: 16px; }
.dc-nav a:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); }
.dc-nav a.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.dc-nav-count { background: var(--warn); color: var(--bg); border-radius: var(--r-pill); font-size: 11px; padding: 3px 6px; }
@media (min-width: 721px) { .dc-nav { flex-wrap: wrap; margin-left: 0; margin-right: 0; padding: 0; } }

.dc-deadlines { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin: var(--sp-3) 0 var(--sp-5); }
.dc-deadlines .deadline { display: flex; flex-direction: column; }
.dc-deadlines .deadline-when { font-weight: 650; }
.dc-deadlines .deadline-left { font-size: var(--fs-sm); }

/* "Needs a ruling": a count, what it is, one button. */
.dc-count {
  flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px;
  border-radius: var(--r-md); font: 800 18px/1 var(--font); font-variant-numeric: tabular-nums;
  background: var(--warn-soft); color: var(--warn);
}
.dc-count.bad { background: var(--bad-soft); color: var(--bad); }
.dc-count.info { background: var(--info-soft); color: var(--info); }
.dc-count.ok { background: var(--accent-soft); color: var(--accent); }
.dc-todo .row-title { white-space: normal; }
.dc-todo .row-end .btn { white-space: nowrap; }
.dc-ok-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--sp-8); }

/* The week console: numbered, collapsible steps in the order the job gets done. */
.dc-step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: var(--sp-3); overflow: hidden; scroll-margin-top: calc(var(--header-h) + var(--sp-3));
}
.dc-step > summary {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  min-height: 60px; cursor: pointer; list-style: none;
}
.dc-step > summary::-webkit-details-marker { display: none; }
.dc-step > summary::marker { content: ""; }
.dc-step > summary:hover { background: var(--surface-2); }
.dc-step-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dc-step-title { font-weight: 700; font-size: var(--fs-md); line-height: 1.3; }
.dc-step-sub { font-size: var(--fs-sm); color: var(--ink-3); }
.dc-step > summary .row-chevron { transform: rotate(90deg); transition: transform .15s; }
.dc-step[open] > summary .row-chevron { transform: rotate(-90deg); }
.dc-step[open] > summary { border-bottom: 1px solid var(--line); }
.dc-step.done > summary .tx-num { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.dc-step.needs > summary .tx-num { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.dc-step-body { padding: var(--sp-4); }
.dc-step-body > h3:first-child { margin-top: 0; }
.dc-step-body .row-list { margin-bottom: var(--sp-4); }
.dc-step-body .row-list:last-child { margin-bottom: 0; }
.dc-step-body .row-list .row-item { padding-left: var(--sp-3); padding-right: var(--sp-3); }
.dc-help { font-size: var(--fs-sm); color: var(--ink-3); margin: 0 0 var(--sp-3); }
.dc-block ~ .dc-block { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.dc-block > h3 { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .dc-step > summary .row-chevron { transition: none; } }

/* Compact scoreboard rows. */
.dc-game { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--sp-3); align-items: center; }
.dc-game .score { font-weight: 800; font-size: var(--fs-md); font-variant-numeric: tabular-nums; text-align: right; }
.dc-game .lost { color: var(--ink-3); }
.dc-game .lost .team-name { color: var(--ink-3); font-weight: 500; }

/* Acquisition order in short columns. */
.dc-order { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 6px var(--sp-4); }
.dc-order li { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-sm); }
.dc-order .tx-num { width: 24px; height: 24px; font-size: 11px; }
.dc-order .team-badge { flex: 1 1 auto; }
.dc-order .adds { flex: none; color: var(--ink-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* Team pickers: a strip of monograms on a roster page, a grid on the dashboard. */
.dc-teams-strip { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) var(--sp-4); padding: 2px var(--gutter); }
.dc-teams-strip::-webkit-scrollbar { display: none; }
.dc-teams-strip a { flex: none; border-radius: var(--r-pill); padding: 2px; border: 2px solid transparent; }
.dc-teams-strip a.on { border-color: var(--team-ink, var(--accent)); }
.dc-teams-strip a:hover { text-decoration: none; }
@media (min-width: 721px) { .dc-teams-strip { flex-wrap: wrap; margin-left: 0; margin-right: 0; padding: 0; } }
.dc-teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: 6px; margin-bottom: var(--sp-8); }
.dc-teamgrid a {
  display: flex; align-items: center; min-width: 0; padding: var(--sp-2) var(--sp-3); min-height: 48px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink);
}
.dc-teamgrid a:hover { text-decoration: none; background: var(--surface-2); }
.dc-teamgrid .team-name { font-size: var(--fs-sm); }
@media (max-width: 420px) { .dc-teamgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* An inline add form under a free-agent row. */
.dc-add { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-3); margin-top: var(--sp-2); }
.dc-add select { width: auto; min-height: 36px; padding: 4px 10px; }
.dc-add .tx-check { min-height: 36px; font-size: var(--fs-sm); gap: 6px; }
.dc-add .tx-check input { width: 18px; height: 18px; }
.dc-add .btn { margin-left: auto; }

/* The audit log. */
.dc-audit-action { font-family: var(--mono); font-size: var(--fs-sm); }
.row-sub.dc-audit-detail { overflow-wrap: anywhere; white-space: normal; }

/* ---------------------------------------------------------------- account and sign-in */

.acct-auth { max-width: 400px; margin: var(--sp-6) auto var(--sp-8); }
.acct-auth-mark { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: var(--sp-5); }
.acct-auth-mark img { width: 64px; height: 64px; border-radius: 16px; margin-bottom: var(--sp-3); box-shadow: var(--shadow); }
.acct-auth-mark h1 { margin: 0 0 var(--sp-1); }
.acct-auth-mark p { color: var(--ink-2); margin: 0; }
.acct-auth .card { padding: var(--sp-5); }
.acct-auth .card .field:last-of-type { margin-bottom: var(--sp-5); }
.btn.acct-google {
  width: 100%; min-height: 52px; font-size: 16px; gap: 10px;
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.btn.acct-google svg { width: 20px; height: 20px; }
.acct-or { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0; color: var(--ink-3); font-size: var(--fs-sm); }
.acct-or::before, .acct-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.acct-foot { text-align: center; color: var(--ink-3); font-size: var(--fs-sm); margin-top: var(--sp-4); }

.acct-hero { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-6); min-width: 0; }
.acct-hero .avatar { width: 56px; height: 56px; font-size: 22px; flex: none; }
.acct-hero > div { min-width: 0; }
.acct-hero h1 { margin: 0; font-size: var(--fs-xl); }
.acct-hero p { margin: 2px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.acct-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.acct-dot.off { background: var(--line-strong); }

/* ---------------------------------------------------------------- error page */

.err { max-width: 440px; margin: 8vh auto var(--sp-10); text-align: center; }
.err-code {
  display: inline-grid; place-items: center; width: 112px; height: 112px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
  font: 800 38px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-bottom: var(--sp-5);
}
.err h1 { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.err p { color: var(--ink-2); }
.err-detail { font-size: var(--fs-sm); color: var(--ink-3); }
.err .tx-actions { justify-content: center; margin-top: var(--sp-5); }
.err .tx-actions > .btn { flex: 0 1 160px; }
