:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-2: #eef0f4;
  --text: #1b1f24;
  --muted: #5d6673;
  --border: #dde1e7;
  --accent: #1f5fbf;
  --accent-soft: #e6eefb;
  --row-alt: #fafbfc;
  --radius: 8px;
  --series-1: #2a78d6;
  --series-2: #d4632a;
  --chart-muted: #c3c7ce;
  --chart-grid: #eceef1;
  --won: #e8f1fc;
  --tip-bg: #ffffff;
  --crumb: #5f4130;
  --crumb-text: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418;
    --surface: #191d23;
    --surface-2: #20252d;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --border: #2c333d;
    --accent: #7fb0ff;
    --accent-soft: #1c2a40;
    --row-alt: #151a20;
    --series-1: #3987e5;
    --series-2: #d96b33;
    --chart-muted: #3a424d;
    --chart-grid: #222831;
    --won: #18263a;
    --tip-bg: #222831;
    --crumb: #6e4f3c;
    --crumb-text: #ffffff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
/* the trade finder is a tool, not history: set apart at the right as a pill */
.tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-link { padding: 4px 12px; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tool-link:hover { text-decoration: none; background: var(--accent); color: var(--bg); }

.menu { position: relative; }
.menu summary { cursor: pointer; color: var(--accent); list-style: none; }
.menu summary::after { content: " ▾"; }
.menu[open] .menu-list {
  position: absolute;
  top: 28px;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 4px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.15);
}

main { max-width: 1200px; margin: 0 auto; padding: 16px; }
footer { max-width: 1200px; margin: 0 auto; padding: 24px 16px; color: var(--muted); font-size: 13px; }

h1 { font-size: 28px; margin: 8px 0 12px; }
h2 { font-size: 20px; margin: 32px 0 8px; padding-top: 8px; border-top: 1px solid var(--border); }
h3 { font-size: 16px; margin: 20px 0 6px; }
section { scroll-margin-top: 64px; }
.note, .crumbs { color: var(--muted); margin: 0 0 8px; }
.pager { display: flex; gap: 16px; }

.toc, .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.toc a, .chips a {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  background: var(--surface);
}
.chips a[aria-current="page"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.cards .feature { grid-column: span 2; }
.card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card span { color: var(--muted); font-size: 13px; }
@media (max-width: 480px) { .cards .feature { grid-column: 1 / -1; } }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 0 24px; }
.split > div { min-width: 0; }

.finish { margin: 0; padding-left: 28px; columns: 2; max-width: 420px; }
.finish li:first-child { font-weight: 700; }

.table-wrap { overflow-x: auto; width: fit-content; max-width: 100%; margin: 6px 0 12px; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th, table.data td { padding: 5px 10px; border-bottom: 1px solid var(--border); text-align: left; }
table.data thead th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }
table.data tbody th { font-weight: 600; background: var(--surface); }
table.data tbody tr:nth-child(even) td { background: var(--row-alt); }
table.data tbody tr:hover td { background: var(--accent-soft); }
table.data tr:last-child td, table.data tr:last-child th { border-bottom: 0; }
table.sortable thead th { cursor: pointer; user-select: none; }
table.sortable thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
table.sortable thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }

.tab-bar { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.tab-bar button {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.tab-bar button[aria-selected="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* --- notes, stats, timeline ---------------------------------------------------------------- */
.notes { margin: 4px 0 16px; padding-left: 20px; }
.notes li { margin: 2px 0; }
.tie-note { margin-top: 4px; font-style: italic; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 16px; }
.stat { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.timeline { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; }
.finish-cell { display: flex; flex-direction: column; align-items: center; width: 44px; padding: 4px 0;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; }
.finish-cell strong { font-size: 16px; }
.finish-cell.p1 { background: var(--series-1); color: var(--bg); border-color: var(--series-1); }
.finish-cell.p2, .finish-cell.p3 { border-color: var(--series-1); }
.finish-cell.crumb { background: var(--crumb); color: var(--crumb-text); border-color: var(--crumb); }
.finish-cell:hover { text-decoration: none; border-color: var(--accent); }
.champions { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.champ { display: flex; flex-direction: column; padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.champ span { color: var(--muted); font-size: 12px; }
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 0 24px; }
.hero > div { min-width: 0; }

/* --- box scores ------------------------------------------------------------------------------ */
.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 10px; }
.box { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.box-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px; background: var(--surface-2); }
.box-head .side { display: flex; gap: 6px; align-items: baseline; }
.box-head .side.won { font-weight: 700; }
.box-head .score { font-variant-numeric: tabular-nums; }
.tag { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 12px; }
.box-body { display: grid; grid-template-columns: 1fr 1fr; }
.lineup { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lineup + .lineup { border-left: 1px solid var(--border); }
.lineup td { padding: 2px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.lineup .slot { color: var(--muted); width: 34px; }
.lineup .num { text-align: right; width: 32px; }
.lineup .bench td { color: var(--muted); }

/* --- next week's preview (home page) ---------------------------------------------------------- */
.preview .muted { color: var(--muted); font-weight: 400; }
.preview .r { text-align: right; }
.preview td { vertical-align: middle; }
.pv-mid { width: 150px; min-width: 100px; text-align: center; }
@media (max-width: 520px) { .preview :is(th, td):nth-child(4) { display: none; } .preview td { padding-left: 6px; padding-right: 6px; } }
.pv-pcts { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.pv-bar { display: flex; gap: 2px; height: 6px; margin-top: 3px; }
.pv-bar span { border-radius: 3px; min-width: 4px; }
.pv-bar .a { background: var(--series-1); } .pv-bar .b { background: var(--series-2); }
.pv-byes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 4px 0 10px; }
.pv-byes-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pv-bye { padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); font-size: 14px; }
.preview + .pv-byes, .table-wrap + h3 { margin-top: 18px; }
.pv-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-up { color: #2e8b57; font-weight: 600; } .pv-dn { color: #c9433f; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.pv-up) { color: #4cbb7f; } :root:not([data-theme="light"]) :is(.pv-dn) { color: #e5625d; } }
:root[data-theme="dark"] .pv-up { color: #4cbb7f; } :root[data-theme="dark"] .pv-dn { color: #e5625d; }

/* --- bracket --------------------------------------------------------------------------------- */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 12px; overflow-x: auto; }
.round h3 { margin-top: 0; }
.match { position: relative; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.match .tag { display: block; margin: 0; border-radius: 0; padding: 2px 10px; }
.match.bye { opacity: 0.75; }
.team { display: flex; justify-content: space-between; padding: 5px 10px; font-variant-numeric: tabular-nums; }
.team + .team { border-top: 1px solid var(--border); }
.team.won { background: var(--won); font-weight: 700; }
.team.crumb-row { background: var(--accent-soft); font-weight: 700; }
.round .muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.data .rd { color: var(--muted); }

/* --- record book ----------------------------------------------------------------------------- */
.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px 16px; align-items: start; }
.record { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 12px 10px; }
.record h3 { margin: 8px 0 6px; font-size: 15px; }
.record .note { font-size: 12px; margin: -2px 0 6px; }
.rec-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-hero { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--accent-soft); border-radius: 6px; }
.rec-hero .rec-value { font-size: 26px; font-weight: 800; min-width: 56px; text-align: center; line-height: 1.1; }
.rec-holders { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rec-hero .rec-who { display: block; font-weight: 700; font-size: 15px; }
.rec-hero .rec-detail { display: block; font-size: 12px; color: var(--muted); }
.rec-rest { list-style: none; margin: 6px 0 0; padding: 0; }
.rec-rest li { display: grid; grid-template-columns: 16px 44px auto 1fr; gap: 6px; align-items: baseline; padding: 2px 0; font-size: 13px; }
.rec-rest .rec-rank { color: var(--muted); font-size: 12px; }
.rec-rest.plain li { grid-template-columns: 30px auto 1fr; }
.rec-rest .rec-value { text-align: right; }
.rec-rest .rec-who { font-weight: 600; white-space: nowrap; }
.rec-rest .rec-detail { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* --- charts ---------------------------------------------------------------------------------- */
.chart { margin: 4px 0 16px; max-width: 720px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 11px system-ui, sans-serif; }
.chart .axis { fill: var(--muted); }
.chart .label { fill: var(--text); font-size: 12px; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .plot { fill: none; }
.chart .ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .line { fill: none; stroke: var(--chart-muted); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--chart-muted); stroke: var(--bg); stroke-width: 2; }
.chart .dot.big, .chart .dot.faint { fill: var(--series-1); }
.chart .dot.faint { opacity: 0.55; stroke-width: 1; }
.chart .mean { stroke: var(--text); stroke-width: 2; }
.chart .leader { stroke: var(--chart-muted); stroke-width: 1; }
.chart .series { cursor: pointer; outline: none; }
.chart .series:hover .line, .chart .series:focus .line { stroke: var(--series-1); stroke-width: 3; }
.chart .series:hover .dot, .chart .series:focus .dot { fill: var(--series-1); opacity: 1; }
.chart .series:hover .label, .chart .series:focus .label { font-weight: 700; }
.chart svg:has(.series:hover) .series:not(:hover) { opacity: 0.35; }
/* tooltips: small cards in the page's colors (charts.tip() builds the rich ones) */
.tip { position: fixed; z-index: 50; pointer-events: none; max-width: 300px; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--tip-bg); color: var(--text); font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.18), 0 1px 3px rgb(0 0 0 / 0.12); animation: tip-in 90ms ease-out; }
.tip.rich { min-width: 180px; padding: 8px 10px 7px; }
@keyframes tip-in { from { opacity: 0; transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .tip { animation: none; } }
.tip-head { font-weight: 600; font-size: 13px; padding-bottom: 5px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.tip-row { display: flex; justify-content: space-between; gap: 14px; }
.tip-row .v { font-variant-numeric: tabular-nums; }
.tip-row.strong { font-weight: 600; }
.tip-row.muted { color: var(--muted); }
.tip-foot { margin-top: 5px; color: var(--muted); font-size: 11.5px; }
details > summary { cursor: pointer; color: var(--accent); margin: 8px 0; }

/* --- crumb ----------------------------------------------------------------------------------- */
.crumb-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px 20px; }
.crumb-year h3 { margin: 8px 0 2px; }
.crumb-year .note { margin: 0 0 4px; font-size: 13px; }
.crumb-year .lineup { border: 1px solid var(--border); border-radius: 6px; }
.crumb-row td { font-weight: 700; background: var(--accent-soft); }
.champ.crumb strong { color: var(--muted); }
.menu[open] .menu-list.menu-col { grid-template-columns: 1fr; min-width: 150px; }
.menu[open] .menu-list.menu-years { grid-template-columns: repeat(4, 56px); }
.menu-list a { padding: 3px 6px; border-radius: 4px; white-space: nowrap; }
.menu-list a:hover { background: var(--accent-soft); text-decoration: none; }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 2px 0; }
.menu-label { padding: 4px 6px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.menu-list a[aria-current="page"] { font-weight: 700; color: var(--text); }
.site-header nav > a.active, .menu.active > summary { color: var(--text); font-weight: 600; }
.menu[open] { z-index: 10; }
/* the nav on wide screens: one row, the panel wrapper doesn't affect layout */
.nav-panel { display: contents; }
.nav-toggle { display: none; }
/* phones: one slim row (name + Menu button); the menu opens as a panel below it */
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; padding: 8px 16px; }
  .nav-toggle { display: inline-flex; margin-left: auto; padding: 5px 12px; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--accent); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
  .nav-panel { display: none; flex-basis: 100%; padding: 8px 0 4px; }
  .site-header.nav-open .nav-panel { display: block; }
  .site-header nav { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-header nav > a, .menu summary { display: block; padding: 8px 4px; border-bottom: 1px solid var(--border); }
  .menu[open] .menu-list { position: static; box-shadow: none; margin: 4px 0 8px; }
  .menu[open] .menu-list.menu-years { grid-template-columns: repeat(5, 1fr); }
  .tools { margin: 12px 0 4px; }
  .tool-link { flex: 1; text-align: center; padding: 8px 12px; }
}
.award { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.award h3 { margin: 0 0 4px; }
.award .tag { margin-left: 6px; }
.path { color: var(--muted); font-size: 13px; }
.chart .bar { fill: var(--series-1); }
.chart .bar:hover { opacity: 0.8; }
td.heat { background: color-mix(in srgb, var(--series-1) var(--heat), transparent) !important; text-align: right; }
td.heat.crumbish { background: color-mix(in srgb, var(--crumb) calc(var(--heat) * 1.5), transparent) !important; }
table.odds td { text-align: center; }

/* former managers toggle */
.former-hidden { display: none; }
.former-toggle { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 0 0 -8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.former-toggle[hidden] { display: none; }
/* the checkbox drawn as a sliding switch */
:is(.former-toggle, .switch) input { appearance: none; position: relative; width: 30px; height: 17px; margin: 0; border-radius: 999px;
  background: var(--chart-muted); cursor: pointer; transition: background 0.15s; }
:is(.former-toggle, .switch) input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: transform 0.15s; }
:is(.former-toggle, .switch) input:checked { background: var(--series-1); }
:is(.former-toggle, .switch) input:checked::before { transform: translateX(13px); }
:is(.former-toggle, .switch) input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { :is(.former-toggle, .switch) input, :is(.former-toggle, .switch) input::before { transition: none; } }

/* stat corrections */
.lede-stats { font-size: 17px; margin: 4px 0 8px; }
.corr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.corr-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.corr-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.corr-teams { font-size: 16px; margin: 4px 0; }
.corr-score { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.corr-score .was { color: var(--muted); text-decoration: line-through; font-weight: 600; font-size: 18px; }
.corr-score .arrow { color: var(--muted); font-weight: 400; }
.corr-result { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.corr-list { margin: 0; padding-left: 18px; font-size: 13px; }
.corr-list .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.corr-list .pts.up { color: var(--accent); }
.corr-picture { font-size: 13px; margin: 0 0 6px; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); }

/* win probability */
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 8px 20px; }
.wp-grid h3 { margin: 10px 0 0; font-size: 15px; }
.wp-grid h3 .muted { color: var(--muted); font-weight: 400; font-size: 13px; }
/* matchup charts: the first team in blue (series-1), the second in orange (series-2) */
.chart .pj-line { fill: none; stroke-width: 2.25; stroke-linejoin: round; }
.chart .pj-now { fill: none; stroke-width: 1.5; stroke-dasharray: 3 3; opacity: 0.75; }
.chart .s0 { stroke: var(--series-1); } .chart .s1 { stroke: var(--series-2); }
.chart .label.t0 { fill: var(--series-1); font-weight: 600; } .chart .label.t1 { fill: var(--series-2); font-weight: 600; }
.chart .label.small { font-size: 10.5px; font-weight: 500; }
.chart .lane { stroke: var(--chart-grid); stroke-width: 1; }
.chart .wp-line { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.8; }
.chart .wp-fill { stroke: none; opacity: 0.22; }
.chart .wp-fill.s0 { fill: var(--series-1); } .chart .wp-fill.s1 { fill: var(--series-2); }
.chart .hit rect { fill: transparent; }
.chart .hit line { stroke: var(--muted); stroke-width: 1; opacity: 0; }
.chart .hit:hover line { opacity: 0.6; }
.chart .wp-play { fill: var(--bg); stroke-width: 1.5; stroke-linejoin: round; cursor: pointer; }
.chart .wp-play.s0:hover, .chart .wp-play.s0:focus { fill: var(--series-1); }
.chart .wp-play.s1:hover, .chart .wp-play.s1:focus { fill: var(--series-2); }
.chart .wp-play.combo.s0 { fill: var(--series-1); } .chart .wp-play.combo.s1 { fill: var(--series-2); }

/* expandable charts */
figure.chart.expandable { position: relative; }
.chart-expand { position: absolute; top: 0; right: 0; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0.7; }
.chart-expand:hover, .chart-expand:focus-visible { opacity: 1; color: var(--text); }
.wp-grid .chart-expand { top: -30px; }
#odds .chart-expand { top: -30px; }  /* up beside the matchup title, clear of the end labels */
.chart-dialog { width: min(1400px, 96vw); max-width: none; padding: 12px 18px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text); }
.chart-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
.chart-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 600; font-size: 17px; }
.chart-close { border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.chart-close:hover { color: var(--text); }
.chart-dialog .chart { max-width: none; margin: 0; }
.chart-dialog-tools { display: flex; align-items: center; gap: 12px; }
.zoom-hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.chart-reset { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 400; cursor: pointer; }
.chart-reset:hover { background: var(--surface, var(--bg)); border-color: var(--muted); }
.chart-dialog svg.zoomable { cursor: crosshair; touch-action: none; user-select: none; }
.chart .zoom-band { fill: var(--series-1); fill-opacity: 0.12; stroke: var(--series-1); stroke-opacity: 0.5; stroke-dasharray: 3 3; pointer-events: none; }

/* playoff machine */
.m-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 12px 0 16px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.m-controls label { display: flex; gap: 6px; align-items: center; }
.m-controls select, .m-controls button { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; }
.m-controls button { cursor: pointer; }
.m-controls button:hover { border-color: var(--muted); }
.m-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .m-layout { grid-template-columns: 1fr; } }
.m-results { position: sticky; top: 64px; }
.m-results h2 { margin-top: 0; }
.m-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
.m-week h3 { margin: 6px 0 6px; font-size: 14px; }
.m-game { display: grid; grid-template-columns: 1fr auto auto 1fr; gap: 4px; margin-bottom: 5px; }
.m-game button { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; cursor: pointer; text-align: left; display: flex; justify-content: space-between; gap: 6px; }
.m-game button:last-child { flex-direction: row-reverse; text-align: right; }
.m-game button.m-sim, .m-game button.m-tie { justify-content: center; color: var(--muted); min-width: 28px; padding: 5px 6px; }
.m-game button:hover { border-color: var(--muted); }
.m-game button.on { background: var(--series-1); border-color: var(--series-1); color: var(--bg); font-weight: 600; }
.m-game button.on .muted { color: inherit; opacity: 0.8; }
.m-game button.m-sim.on { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.m-game button.m-tie.on { background: var(--accent-soft); border-color: var(--series-1); color: var(--text); }
.m-scores { display: none; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
body.m-editing .m-scores { display: flex; }
.m-game .m-pts { display: none; }
body.m-editing .m-game .m-pts { display: inline; }
.m-scores input { width: 72px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 6px; }
.m-scores input:last-child { text-align: right; }
.m-game .m-pts.typed { color: inherit; opacity: 1; font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; }
.m-game button { white-space: nowrap; }
.switch { display: flex; align-items: center; gap: 6px; cursor: pointer; }
td.won-cell { font-weight: 700; background: var(--won); }
/* live */
.live-dot { color: var(--muted); }
.tool-link.live-link.on { border-color: #e5484d; color: #e5484d; background: transparent; }
.tool-link.live-link.on .live-dot { color: #e5484d; }
.tool-link.live-link.on:hover { background: #e5484d; color: #fff; }
.tool-link.live-link.on:hover .live-dot { color: #fff; }
.live-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 10px; }
.live-head h1 { margin: 0; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.live-badge.on { background: #e5484d; color: #fff; }
.live-badge.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: live-pulse 1.6s ease-in-out infinite; }
.live-badge.off { background: var(--surface-2); color: var(--muted); }
@keyframes live-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .live-badge.on::before { animation: none; } }
.live-updated { color: var(--muted); font-size: 14px; }
.live-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 4px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--muted); }
.live-legend li { display: inline-flex; align-items: center; gap: 6px; }
.live-legend .lg-solid { stroke: var(--text); stroke-width: 2.25; }
.live-legend .lg-dotted { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: 0.75; }
.live-legend .lg-dot { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; }
.live-legend .lg-star { fill: var(--text); }
.live-legend .lg-shade { fill: var(--series-1); opacity: 0.35; }
.live-about { margin: 6px 0 4px; font-size: 14px; }
.live-about ul { color: var(--muted); margin: 6px 0 0; padding-left: 20px; max-width: 80ch; }
.live-about li { margin: 2px 0; }
.live-note { margin: -2px 0 4px; font-size: 13px; }
/* live scoreboard: one box per team in its chart color, facing each other */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 36px 6px 0; }
.half { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 6px 12px; border-radius: 10px; }
.half.a { background: color-mix(in srgb, var(--series-1) 20%, transparent); border: 1px solid var(--series-1); }
.half.b { background: color-mix(in srgb, var(--series-2) 20%, transparent); border: 1px solid var(--series-2);
  grid-template-columns: auto 1fr; text-align: right; }
.half .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.half .sc { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.half .wp, .half .pj { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.half .wp { font-weight: 600; }
.half [data-tip] { cursor: help; }
.half[data-m] { cursor: pointer; } .half[data-m]:hover { filter: brightness(1.15); }
.half[data-m]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the lineup popup on the Live page */
.lineup-dialog { width: min(680px, 96vw); padding: 0; overflow: hidden; }
.lu-head { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 14px 16px 12px 18px;
  border-left: 5px solid var(--c); background: color-mix(in srgb, var(--c) 16%, var(--bg)); }
.lu-head.a, .lu-list.a { --c: var(--series-1); } .lu-head.b, .lu-list.b { --c: var(--series-2); }
.lu-team { font-size: 20px; font-weight: 700; }
.lu-sub { font-size: 13px; color: var(--muted); }
.lu-score { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lu-list { list-style: none; margin: 0; padding: 4px 0; max-height: 70vh; overflow-y: auto; }
.lu-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 170px 96px 40px 46px; align-items: center; gap: 10px;
  padding: 8px 16px; border-top: 1px solid var(--border); }
.lu-row:first-child { border-top: 0; }
.lu-slot { justify-self: start; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.lu-who { min-width: 0; } .lu-who b { font-weight: 600; }
.lu-line { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 2px; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.lu-line .st { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.lu-line .st-k { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c);
  opacity: .9; margin-right: 1px; }
.lu-line .st-dot { opacity: .5; }
.lu-line b { font-weight: 700; color: var(--text); }
.lu-line b.bad { color: #e5625d; }
.lu-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.lu-game { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.lu-game .clock, .lu-row .clock { flex: none; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--c);
  background: conic-gradient(var(--c) calc(var(--played) * 1turn), transparent 0); }
.lu-row.on .lu-game { color: var(--text); }
.lu-pts { text-align: right; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lu-more { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lu-row.done .lu-who b { color: var(--muted); }
.lu-vs { display: grid; gap: 3px; font-size: 12px; font-variant-numeric: tabular-nums; cursor: help; }
.lu-vs .muted { color: var(--muted); }
.lu-bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); }
.lu-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--c); }
.lu-bar .tick { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.lu-vs-n.up { color: #2e8b57; } .lu-vs-n.dn { color: #c9433f; }
:root[data-theme="dark"] .lu-vs-n.up { color: #4cbb7f; } :root[data-theme="dark"] .lu-vs-n.dn { color: #e5625d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lu-vs-n.up { color: #4cbb7f; }
  :root:not([data-theme="light"]) .lu-vs-n.dn { color: #e5625d; } }
.lu-foot { display: flex; justify-content: space-between; padding: 10px 16px 14px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .lu-row { grid-template-columns: 34px minmax(0, 1fr) 40px 44px; }
  .lu-game { grid-column: 2; grid-row: 2; }
  .lu-vs { grid-column: 2; grid-row: 3; max-width: 200px; }
}
.half.a { --c: var(--series-1); } .half.b { --c: var(--series-2); }
.half .clocks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.half.b .clocks { justify-content: flex-end; }
/* a starter's game as a little clock: it fills in as the game is played (empty = not started, full = done) */
.half .clock { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--c);
  background: conic-gradient(var(--c) calc(var(--played) * 1turn), transparent 0); }
.half .left { grid-column: 1 / -1; margin-top: 3px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.half.b .left { text-align: right; }
.half.lead .wp { color: var(--text); }
.half.a .pj { text-align: right; } .half.b .pj { text-align: left; }
.wp-grid .duo + .chart .chart-expand, .wp-grid .live-note + .chart .chart-expand { top: -46px; }
.live-about b { color: var(--text); font-weight: 600; }
.chart .rv-game { fill: var(--bg); stroke: var(--muted); stroke-width: 1.25; cursor: pointer; }
.chart .rv-game.s0 { stroke: var(--series-1); } .chart .rv-game.s1 { stroke: var(--series-2); }
.chart .rv-game.playoff.s0 { fill: var(--series-1); } .chart .rv-game.playoff.s1 { fill: var(--series-2); }
.chart .rv-game:hover, .chart .rv-game:focus { r: 5; }
/* ⓘ: the details behind a section's one-line note (hover, or tap on a phone) */
button.info { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 4px;
  padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 15px; font-weight: 400;
  line-height: 1; vertical-align: 2px; cursor: help; }
button.info:hover, button.info:focus-visible { color: var(--accent); }
h3 button.info { font-size: 13px; width: 17px; height: 17px; }
.tip.info-tip { max-width: 340px; white-space: normal; }
.tip.info-tip .tip-head { margin-bottom: 6px; }
.tip-point { margin: 0 0 5px; line-height: 1.45; }
.tip-point:last-child { margin-bottom: 0; }
.tip-point b { font-weight: 600; }

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

/* --- the prime-time watch guide (top of the Live page) ----------------------------------------- */
.watch { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 8px 0 18px; background: var(--surface); }
.watch .w-head { display: grid; gap: 8px; }
.watch .w-game { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.watch .w-game h2 { margin: 0; padding: 0; border: 0; font-size: 20px; }
.watch .m { color: var(--muted); font-weight: 400; }
.watch .clockb { display: inline-flex; padding: 4px 12px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.watch .ball { display: inline-flex; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 700; }
.watch .ball.rz { background: #e5484d; color: #fff; }
.watch .ball[hidden] { display: none; }
.watch h3.w { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.watch .n1 { color: var(--series-1); } .watch .n2 { color: var(--series-2); }
.watch .who .n1, .watch .who .n2 { font-weight: 700; }
.watch .stakes { display: grid; gap: 8px; }
.watch .stake { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 10px 14px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.watch .stake .meterbox { grid-column: 1 / -1; }
.watch .who { font-weight: 600; } .watch .who .m { font-variant-numeric: tabular-nums; }
.watch .need { font-size: 13.5px; margin-top: 2px; }
.watch .need .sep { display: inline-block; width: 1px; height: 12px; background: var(--border); margin: 0 10px; vertical-align: -1px; }
.watch .pct { text-align: right; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.watch .pct span { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.watch .c1 { --c: var(--series-1); } .watch .c2 { --c: var(--series-2); }
.watch .meter { position: relative; height: 16px; border-radius: 8px; background: var(--surface-2); margin: 32px 0 0; }
.watch .meter .fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--c); }
.watch .meter .ghost { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: repeating-linear-gradient(135deg,
  color-mix(in srgb, var(--c) 45%, transparent) 0 4px, color-mix(in srgb, var(--c) 20%, transparent) 4px 8px); }
.watch .meter .pmark { position: absolute; top: 3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  border: 2px solid var(--c); background: var(--bg); }
.watch .meter .goal { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: var(--text);
  border-radius: 2px; box-shadow: 0 0 0 2px var(--bg); }
.watch .meter .goal::before { content: "▼"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--text); }
.watch .meter .flag { position: absolute; bottom: 30px; transform: translateX(-50%); font-size: 12px; font-weight: 700; white-space: nowrap; }
.watch .meter .hi { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px dotted var(--text); }
.watch .meter .hilab { position: absolute; top: 22px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.watch .ctx { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.watch .meter .zero { position: absolute; top: 0; bottom: -8px; width: 0; border-left: 1.5px dashed var(--muted); }
.watch .meter .zero::after { content: "start"; position: absolute; top: 24px; left: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.watch .meter .end { position: absolute; top: 20px; font-size: 11.5px; color: var(--muted); }
.watch .meter .end.l { left: 0; } .watch .meter .end.r { right: 0; }
.watch .meter-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; font-size: 13px;
  font-variant-numeric: tabular-nums; margin-top: 24px; }
.watch .meter-cap b { font-weight: 600; }
.watch .meter-cap .pj { color: var(--muted); }
.watch .long { font-size: 13px; color: var(--muted); margin-top: 8px; }
.watch .poss { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 12px; }
.watch .side { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.watch .side.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.watch .side h4 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; }
.watch .side h4 .now { font-size: 11px; color: #e5484d; font-weight: 700; letter-spacing: .05em; }
.watch .sub { font-size: 11.5px; color: var(--muted); margin: 8px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.watch .pl { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 0;
  border-top: 1px solid var(--border); font-size: 13.5px; }
.watch .pl .nm b { font-weight: 600; } .watch .pl .nm .m { display: block; font-size: 12px; }
.watch .pl .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.watch .pl.muted-row { opacity: .6; }
.watch .own { justify-self: start; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent);
  font-weight: 700; font-size: 12.5px; }
.watch .tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.watch .tag.big { border-color: var(--accent); color: var(--text); }
.watch .tag.good { border-color: #4cbb7f; color: #4cbb7f; }
.watch .pl[data-tip] { cursor: help; }
.watch .ctx .sep { display: inline-block; width: 1px; height: 11px; background: var(--border); margin: 0 10px; vertical-align: -1px; }
@media (max-width: 560px) { .watch :is(.need, .ctx) .part { display: block; } .watch :is(.need, .ctx) .sep { display: none; } }

/* --- power rankings -------------------------------------------------------------------------- */
.power td { font-variant-numeric: tabular-nums; vertical-align: middle; }
.power .r { text-align: right; } .power .c { text-align: center; }
.pw-up { color: #2e8b57; font-size: 12px; font-weight: 600; } .pw-dn { color: #c9433f; font-size: 12px; font-weight: 600; }
.pw-bar-cell { width: 40%; min-width: 100px; }
.pw-div { position: relative; height: 8px; }
.pw-div span { position: absolute; top: 0; height: 8px; border-radius: 4px; }
.pw-div .mid { left: 50%; width: 1px; top: -3px; height: 14px; background: var(--muted); border-radius: 0; }
.pw-div .a { background: var(--series-1); } .pw-div .b { background: var(--series-2); }
.chart .pw-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.chart .pw-dot { fill: var(--series-1); stroke: var(--bg); stroke-width: 2; }
.chart .pw-hit { fill: transparent; }
