/* Theme and proportions taken from Antigravity's boards 6 and 7 (1376px wide). */
:root {
  --bg: #0f1013;
  --rail: #121317;
  --panel: #15171b;
  --node: #1a1c21;
  --raised: #202329;
  --hover: #1b1e23;
  --line: #22252b;
  --border: #2a2e35;
  --border-2: #363a43;
  --track: #454a54;

  --text: #e8e9ec;
  --text-2: #c4c7cd;
  --muted: #8d919a;
  --dim: #6b6f78;
  --blue: #86a3d4;

  /* Direction: always paired with a glyph and a word */
  --in: #32a86e;
  --out: #d35b5b;
  --cond: #c6903a;
  --in-fill: #23704a;
  --in-ink: #e3f5ea;
  --out-fill: #9c3b3b;
  --out-ink: #fbe3e3;
  --cond-fill: #b9873a;
  --cond-ink: #1a1206;
  --own-fill: #34404d;
  --own-ink: #c9d1db;

  --ui: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; /* the app face: JetBrains Mono, Roboto Condensed for the narrow parts */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --narrow: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --r: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--ui); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: #3a4252; color: var(--text); }
input { caret-color: var(--blue); }
* { scrollbar-color: var(--track) transparent; scrollbar-width: thin; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
h2 { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.c-in { color: var(--in); }
.c-out { color: var(--out); }
.c-cond { color: var(--cond); }
.c-muted { color: var(--muted); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--line); }
.brand { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px; font: 500 17px/1 var(--mono); letter-spacing: 0.08em; color: var(--text); }
.brand svg { color: var(--muted); flex: none; }
.league { display: grid; grid-template-columns: 1fr 1fr; height: 34px; margin: 4px 14px 14px; padding: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
.league button { border-radius: 4px; font: 500 13px/1 var(--ui); text-align: center; color: var(--muted); }
.league [aria-pressed="true"] { background: var(--raised); color: var(--text); }
.league button:disabled { color: var(--dim); cursor: not-allowed; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav hr { margin: 8px 10px; border: 0; border-top: 1px solid var(--line); }
.nav a { height: 36px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 6px; font: 500 14px/1 var(--ui); color: var(--text-2); }
.nav .ic { width: 18px; height: 18px; color: var(--muted); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current="page"] { background: var(--raised); color: var(--text); }
.nav a[aria-current="page"] .ic, .nav a:hover .ic { color: var(--text); }
.rail-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--line); font: 400 12px/1.7 var(--ui); color: var(--muted); }
.rail-foot .dot { width: 10px; height: 10px; margin-right: 8px; fill: currentColor; vertical-align: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 28px; padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 8px; font: 500 14px/1 var(--ui); white-space: nowrap; color: var(--muted); }
.crumb a, .crumb button { display: inline-flex; align-items: center; min-height: 32px; } /* a thumb-sized target */
.crumb .first { color: var(--muted); }
.crumb .sep { color: var(--dim); }
.crumb .cur { color: var(--text); }
.crumb button { color: var(--muted); }
.crumb button:hover { color: var(--text); }
.top-slot { flex: 1; display: flex; align-items: center; gap: 28px; min-width: 0; }
.search { width: 420px; max-width: 100%; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; font: 400 14px/1 var(--ui); color: var(--muted); }
.search .ic { width: 16px; height: 16px; }
.search span { flex: 1; }
kbd { padding: 3px 6px; border: 1px solid var(--border-2); border-radius: 4px; font: 500 11px/1 var(--ui); color: var(--muted); }
.search:hover { border-color: var(--track); color: var(--text-2); }
.search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { margin-left: auto; display: flex; gap: 18px; font: 500 13px/1 var(--ui); white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Trade view controls in the top bar (board 7) */
.seg { display: inline-flex; height: 34px; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 4px; font: 500 13px/1 var(--ui); color: var(--text-2); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.asof { display: inline-flex; align-items: center; gap: 10px; font: 500 13px/1 var(--ui); color: var(--text-2); white-space: nowrap; }
.asof label { color: var(--muted); }
.asof output { color: var(--text); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 96px; height: 2px; background: var(--track); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 1px; background: var(--text-2); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 1px; background: var(--text-2); }
input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--border-2); border-radius: 6px; font: 500 13px/1 var(--ui); color: var(--text); white-space: nowrap; }
.icon-btn { width: 38px; padding: 0; }
.icon-btn .ic { width: 18px; height: 18px; }
.btn-line:hover { background: var(--raised); }
.btn-line[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.push { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
/* Board 7 sets its top bar in the condensed face; board 6 keeps mono. */
.shell[data-view="trade"] :is(.crumb, .seg button, .asof, .btn-line) { font-family: var(--narrow); font-size: 18px; }
.shell[data-view="trade"] .crumb b { font-weight: 500; }
.menu-btn, .menu-close, .m-only { display: none; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(5, 7, 10, 0.7); }

/* ---------- Dashboard pages (board 6) ---------- */
.page { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 32px; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.panel-head { height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font: 600 14px/1 var(--ui); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-select { height: 30px; padding: 0 6px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 5px; font: 500 13px/1 var(--ui); color: var(--text); }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.note { font: 400 13px/1.55 var(--ui); color: var(--muted); }
p.note { max-width: 80ch; }
.note a, .src { color: var(--blue); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.kpi { padding: 16px 20px 18px; border-right: 1px solid var(--border); }
.kpi:last-child { border-right: 0; }
.kpi-label { font: 500 12px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi-num { margin-top: 10px; font: 500 30px/1.05 var(--ui); letter-spacing: -0.02em; color: var(--text); }
.kpi-sub { margin-top: 6px; font: 400 12px/1.35 var(--ui); color: var(--muted); text-wrap: pretty; } /* wraps rather than cut off */

/* Scoreboard chip: code on the main colour, slanted accent in the second. */
.team { display: inline-flex; flex: none; height: 32px; border-radius: 4px; overflow: hidden; background: var(--team, var(--raised)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.team b { display: flex; align-items: center; padding: 0 9px; font: 700 13px/1 var(--mono); letter-spacing: 0.06em; color: #fff; }
.team i { width: 12px; background: var(--team2); clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%); }
.team:not([style]) i { display: none; } /* old franchise codes have no colours */
.team.sm { height: 22px; border-radius: 3px; vertical-align: middle; }
.team.sm b { padding: 0 6px; font-size: 11px; }
.team.sm i { width: 9px; clip-path: polygon(4px 0, 100% 0, 100% 100%, 0 100%); }
.head-card .team { height: 40px; }
.head-card .team b { padding: 0 12px; font-size: 16px; }
.head-card .team i { width: 16px; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }

.h2h { width: 100%; height: 78px; display: grid; grid-template-columns: max-content 26px max-content minmax(0, 1fr) 84px; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.h2h:last-child { border-bottom: 0; }
.h2h:hover { background: var(--hover); }
.vs { font: 500 12px/1 var(--ui); color: var(--muted); text-align: center; }
.h2h-mid { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-left: 4px; }
.h2h-labels { display: flex; justify-content: space-between; gap: 8px; font: 500 12px/1 var(--ui); white-space: nowrap; }
.h2h-labels span { display: inline-flex; align-items: center; gap: 4px; }
.bar { display: flex; gap: 3px; height: 14px; }
.bar span { display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 3px; font: 600 11px/1 var(--ui); color: var(--bg); }
.bar .b-out { background: var(--out); }
.bar .b-in { background: var(--in); }
.h2h-net { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font: 500 13px/1 var(--ui); color: var(--text); }
.h2h-net > span:first-child { font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }

.matrix { width: 100%; border-collapse: collapse; table-layout: fixed; }
.matrix th { height: 38px; font: 500 13px/1 var(--ui); color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.matrix th:first-child { width: 56px; }
.matrix tbody th { font-size: 13px; color: var(--text-2); }
.matrix td, .matrix tbody th { height: 100px; padding: 8px 4px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.matrix tbody th { border-left: 0; }
.chips { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; max-width: 100%; padding: 0 8px; overflow: hidden; border-radius: 5px; font: 500 12px/1 var(--ui); white-space: nowrap; }
.chip.in { background: rgba(50, 168, 110, 0.13); color: #93d3b0; box-shadow: inset 0 0 0 1px rgba(50, 168, 110, 0.26); }
.chip.out { background: rgba(211, 91, 91, 0.13); color: #eaa7a7; box-shadow: inset 0 0 0 1px rgba(211, 91, 91, 0.26); }
.chip.cond { background: rgba(198, 144, 58, 0.13); color: #e1c08a; box-shadow: inset 0 0 0 1px rgba(198, 144, 58, 0.26); }
.chip.own { background: var(--raised); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-2); }

.log { width: 100%; border-collapse: collapse; table-layout: fixed; font: 400 14px/1.3 var(--ui); }
.log th { height: 36px; padding: 0 16px; text-align: left; font: 500 11px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.log td { height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.log tr:last-child td { border-bottom: 0; }
.log tr[data-href] { cursor: pointer; }
.log tr[data-href]:hover td, .log tr.on td { background: var(--hover); }
.log .num { text-align: right; }
.log a:hover, .log button:hover { text-decoration: underline; }
.log .act { text-align: right; }
.log .src { color: var(--blue); }
.log td.c-in { color: var(--in); }
.log td.c-out { color: var(--out); }
.log td.c-muted { color: var(--muted); }
/* Record colours: winning green, losing red; brighter past .600 and under .400 */
.wp-key { float: right; display: flex; gap: 14px; font: 400 12px/14px var(--mono); }
.sec-head > .c-muted { margin-left: 10px; font-weight: 400; font-size: 13px; }
.log.fit { table-layout: auto; }
/* Phones: desktop column widths starve the name column ("J…") and push the rest past the panel. There the
   table sizes to its content: names and other text may wrap, numbers stay on one line. The directory
   lists keep their own phone layout (.dirt). */
@media (min-width: 601px) and (max-width: 960px) {
  #view-draft .stack .log, #view-player .log, #view-api .log { min-width: 560px; }
}
@media (max-width: 600px) {
  .log:not(.stats, .dirt, .ss, .tl) { table-layout: auto; }
  .log:not(.stats, .dirt, .ss, .tl) col { width: auto !important; }
  .log:not(.stats, .dirt, .ss, .tl) th, .log:not(.stats, .dirt, .ss, .tl) td { padding: 0 8px; }
  .log:not(.stats, .dirt, .ss, .tl) th { white-space: normal; line-height: 1.25; }
  .log:not(.stats, .dirt, .ss, .tl) th:first-child, .log:not(.stats, .dirt, .ss, .tl) td:first-child { padding-left: 14px; }
  .log:not(.stats, .dirt, .ss, .tl) th:last-child, .log:not(.stats, .dirt, .ss, .tl) td:last-child { padding-right: 14px; }
  .log:not(.stats, .dirt, .ss, .tl) td:not(.num) { white-space: normal; overflow-wrap: break-word; padding-block: 8px; }
  .chart-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  /* Wide tables keep every column and scroll in their own box with the first column pinned. */
  .scroll-x > .log :is(th, td):first-child { position: sticky; left: 0; z-index: 1; }
  :where(.scroll-x > .log) :is(th, td):first-child { background: var(--panel); }
  .chart-head span { line-height: 1.35; }
}
/* Directory lists (players, coaches) */
#pl-profile { display: contents; }
.dirt th:first-child { width: 100%; }  /* the name column takes the slack; the rest size to content */
.dir-tools .seg { margin-left: auto; height: 38px; }
.az { display: flex; flex-wrap: wrap; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.az button, .pager button { min-width: 28px; height: 28px; padding: 0 7px; border-radius: 4px; font: 500 12px/1 var(--mono); color: var(--text-2); }
.az button:hover:not(:disabled), .pager button:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.az button[aria-pressed="true"], .pager button[aria-current="page"] { background: var(--raised); color: var(--text); }
.az button:disabled, .pager button:disabled { color: var(--dim); cursor: default; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 14px; border-top: 1px solid var(--border); }
.pager nav { display: flex; align-items: center; gap: 2px; }
.pager .gap { padding: 0 4px; color: var(--muted); }
@media (max-width: 960px) {
  .dirt th:first-child { width: auto; }
  .dirt th, .dirt td:first-child { white-space: normal; } /* names and headers wrap so the numbers fit beside them */
  .dirt td:first-child { min-width: 7em; }
  .dirt th, .dirt td { padding: 0 8px; }
  .dirt th:first-child, .dirt td:first-child { padding-left: 14px; }
  .dirt th:last-child, .dirt td:last-child { padding-right: 14px; }
  .dirt td:first-child, .dirt th:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); }
}
.log tr[data-pay] { cursor: pointer; }
.log tr[data-pay]:hover td { background: var(--hover); }
.log td.wp-hi, .wp-key .wp-hi, .kpi-num.wp-hi { color: #43c486; font-weight: 600; }
.log td.wp-up, .wp-key .wp-up, .kpi-num.wp-up { color: #8cc7a6; }
.log td.wp-dn, .wp-key .wp-dn, .kpi-num.wp-dn { color: #dc9c9c; }
.log td.wp-lo, .wp-key .wp-lo, .kpi-num.wp-lo { color: #e66a6a; font-weight: 600; }
.log td .pct { margin-left: 2px; font-weight: 400; opacity: 0.8; } /* the % beside a record, in its colour */

/* ---------- Trade lineage (board 7) ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 320px; flex: 1; }
.canvas { min-width: 0; padding: 28px 24px 40px; overflow: auto; }
.split { margin-bottom: 40px; padding: 16px 20px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); font-family: var(--narrow); }
.split-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; font: 400 30px/1 var(--narrow); white-space: nowrap; }
.split-top span { color: var(--muted); }
.split .bar { height: 32px; }
.split .bar span { font: 500 15px/1 var(--narrow); }
.split-sub { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; font: 400 19px/1.2 var(--narrow); color: var(--muted); }

.tree { display: flex; align-items: center; }
.tree + .tree { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.team-root { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.team-root .r-sub { font: 400 15px/1 var(--narrow); letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.root { width: 108px; flex: none; padding: 14px 8px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 3px; text-align: center; font: 400 18px/1.25 var(--narrow); color: var(--text); }
.root-link { width: 22px; height: 3px; flex: none; background: var(--in); }
.branches { display: flex; flex-direction: column; gap: 18px; padding-left: 22px; }
.branch { position: relative; display: flex; align-items: center; }
.branch::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; height: 3px; margin-top: -1px; background: var(--in); }
.branch::after { content: ""; position: absolute; left: -22px; top: -9px; bottom: -9px; width: 3px; background: var(--in); }
.branch:first-child::after { top: calc(50% - 1px); }
.branch:last-child::after { bottom: calc(50% - 2px); }
.branch:only-child::after { display: none; }

.edge { position: relative; flex: none; min-width: 56px; display: flex; flex-direction: column; color: var(--in); }
.edge .e-label { position: absolute; bottom: 10px; left: 0; right: 0; padding: 0 8px; text-align: center; font: 400 15px/1 var(--narrow); white-space: nowrap; }
.edge .e-line { height: 3px; background: currentColor; }
.edge .e-size { visibility: hidden; height: 0; padding: 0 8px; font: 400 15px/1 var(--narrow); white-space: nowrap; }
.edge.out { color: var(--out); }
.edge.cond { color: var(--cond); }
.edge.cond .e-line { background: repeating-linear-gradient(90deg, var(--cond) 0 7px, transparent 7px 12px); }
.edge.future { color: var(--muted); }
.edge.future .e-line { background: repeating-linear-gradient(90deg, var(--border-2) 0 4px, transparent 4px 8px); }
.edge.arrow .e-line { margin-right: 9px; }
.edge.arrow::after { content: ""; position: absolute; right: 0; bottom: -5px; border-left: 10px solid currentColor; border-top: 6.5px solid transparent; border-bottom: 6.5px solid transparent; }

.node { flex: none; min-width: 150px; max-width: 250px; min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 9px 16px 9px 14px; background: var(--node); border: 1px solid var(--border-2); border-left: 6px solid var(--stripe, var(--border-2)); border-radius: 3px; font-family: var(--narrow); color: var(--text); }
.node:hover { background: var(--raised); }
.node[aria-pressed="true"] { background: var(--raised); outline: 2px solid var(--text); outline-offset: -1px; }
.node.s-in { --stripe: var(--in); }
.node.s-out { --stripe: var(--out); }
.node.s-cond { --stripe: var(--cond); }
.node.exit { border-left-width: 1px; padding-left: 16px; }
.node.future { background: transparent; border-style: dashed; border-left-width: 1px; padding-left: 19px; }
.node.future .n-title, .node.future .n-head { color: var(--muted); }
.n-head { font: 400 17px/1.15 var(--narrow); white-space: nowrap; }
.n-title { font: 400 21px/1.15 var(--narrow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-sub { font: 400 16px/1.15 var(--narrow); color: var(--muted); white-space: nowrap; }
.empty { padding: 24px 0; font: 400 17px/1.4 var(--narrow); color: var(--muted); }
.empty b { font-weight: 500; color: var(--text-2); }

.inspector { position: sticky; top: 64px; height: calc(100vh - 64px); display: flex; flex-direction: column; border-left: 1px solid var(--line); font-family: var(--narrow); }
.tabs { display: flex; height: 46px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { padding: 0 11px; font: 400 15px/1 var(--narrow); letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tabs button:hover { color: var(--text-2); }
.tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--text); }
.insp { flex: 1; display: flex; flex-direction: column; padding: 22px 22px 20px; overflow: auto; }
.i-name { font: 400 30px/1.1 var(--narrow); }
.i-sub { margin-top: 6px; font: 400 19px/1.25 var(--narrow); color: var(--muted); }
.i-why { margin: 14px 0 22px; font: 400 17px/1.4 var(--narrow); color: var(--text-2); }
.seasons { display: grid; grid-template-columns: 68px minmax(0, 1fr) 44px 58px; align-items: center; column-gap: 12px; font: 400 17px/1 var(--narrow); }
.seasons .h { padding-bottom: 14px; color: var(--muted); }
.seasons .r { height: 36px; display: flex; align-items: center; }
.seasons .after { opacity: 0.35; }
.seasons .v { justify-content: flex-end; color: var(--muted); }
.blk { height: 22px; border-radius: 1px; }
.blk.in { width: 92%; background: var(--in); }
.blk.cond { width: 92%; background: repeating-linear-gradient(135deg, var(--cond) 0 4px, #8a6a2a 4px 8px); }
.blk.out { width: 28%; background: var(--out); }
.blk.conv { width: 28%; background: var(--track); }
.i-hint { margin-top: 14px; font: 400 15px/1.4 var(--narrow); color: var(--muted); }
.etag { margin-top: 22px; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 6px; font: 400 12px/1.55 var(--mono); color: var(--text-2); word-break: break-all; }
.insp > .etag:last-child { margin-top: auto; }
.etag a { color: var(--blue); }
.etag a:hover { text-decoration: underline; }
.prov { list-style: none; }
.prov li { padding: 12px 0; border-bottom: 1px solid var(--line); font: 400 17px/1.35 var(--narrow); color: var(--text-2); }
.prov li:first-child { padding-top: 0; }
.prov .p-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font: 500 12px/1.2 var(--ui); color: var(--muted); }
.prov a { font: 400 12px/1.4 var(--mono); color: var(--blue); }
.code.wrap { white-space: pre-wrap; word-break: break-all; }
.code { padding: 12px 14px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font: 400 13px/1.55 var(--mono); color: var(--text-2); white-space: pre; }

/* ---------- Draft capital, player, API ---------- */
.draft-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.flow { white-space: nowrap; }
.flow .c-out { margin-left: 10px; }

.player-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.pc-id { display: flex; align-items: center; gap: 18px; min-width: 0; }
h1 { font: inherit; }

/* Players and Compare */
.picker { position: relative; width: 420px; max-width: 100%; flex: none; }
.pick-in { width: 100%; height: 38px; padding: 0 12px 0 36px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%238d919a%27 stroke-width=%272%27 stroke-linecap=%27round%27%3E%3Ccircle cx=%2710.5%27 cy=%2710.5%27 r=%276.5%27/%3E%3Cpath d=%27m15.5 15.5 5 5%27/%3E%3C/svg%3E") 12px 50% / 16px no-repeat; border: 1px solid var(--border-2); border-radius: 6px; font: 400 14px/1 var(--ui); color: var(--text); outline: none; }
.pick-in::placeholder { color: var(--muted); }
.pick-in:focus { border-color: var(--blue); }
.pick-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); }
.sec-tabs { padding: 0 6px; border-bottom-color: var(--border); overflow-x: auto; } /* ten sections outgrow even a desktop panel */
.pc-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sec-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; font: 500 14px/1 var(--ui); letter-spacing: 0; text-transform: none; }
.sec-tabs .ic { width: 16px; height: 16px; }
.count { min-width: 20px; padding: 3px 6px; border-radius: 10px; background: var(--raised); font: 500 11px/1 var(--ui); text-align: center; color: var(--muted); }
.count:empty { display: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); border-bottom: 1px solid var(--border); }
.facts div { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.facts dt { font: 500 11px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin-top: 8px; font: 500 15px/1.3 var(--ui); color: var(--text); }
.sec-head { padding: 22px 20px 0; font: 600 14px/1 var(--ui); color: var(--text); }
.pad-x { padding-left: 20px; padding-right: 20px; }
.pad-y { padding-top: 18px; padding-bottom: 18px; }
#pl-body > .note:last-child { padding-bottom: 18px; }
.steps { list-style: none; padding: 16px 20px 4px; }
.steps > li { position: relative; padding: 0 0 22px 28px; font: 400 14px/1.5 var(--ui); color: var(--text-2); }
.steps > li::before { content: ""; position: absolute; left: 3px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--dot, var(--border-2)); box-shadow: 0 0 0 3px var(--panel); }
.steps > li::after { content: ""; position: absolute; left: 8px; top: 21px; bottom: 3px; width: 1px; background: var(--border-2); }
.steps > li:last-child::after { display: none; }
.steps > li.in { --dot: var(--in); }
.steps > li.out { --dot: var(--out); }
.steps > li.mv { --dot: var(--blue); }
.steps.compact > li { padding-bottom: 14px; }
.st-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font: 500 12px/1.3 var(--ui); color: var(--muted); }
.st-title { display: flex; align-items: center; gap: 10px; margin-top: 4px; font: 500 16px/1.3 var(--ui); color: var(--text); }
.st-text { margin-top: 4px; max-width: 920px; }
.st-lead { margin-top: 4px; font: 500 15px/1.35 var(--ui); color: var(--text); }
.st-lines { margin-top: 4px; max-width: 920px; padding-left: 18px; color: var(--text-2); }
.st-lines li { margin-top: 2px; }
.st-lines li::marker { color: var(--dim); }
.st-note { margin-top: 6px; font: 400 12px/1.4 var(--ui); color: var(--muted); }
.steps a, .facts a, .tmini a, .sheet a, .st-top a { color: var(--blue); }
.steps a:hover, .tmini a:hover, .sheet a:hover, .linkish:hover { text-decoration: underline; }
.linkish { color: var(--blue); }
button.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.tmini { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 10px; max-width: 920px; background: var(--node); border: 1px solid var(--border); border-radius: 6px; }
.tm-side { padding: 10px 12px; border-right: 1px solid var(--line); }
.tm-side:nth-last-child(2) { border-right: 0; }
.tm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font: 500 11px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tm-side ul { list-style: none; font: 400 14px/1.5 var(--ui); color: var(--text-2); }
.tm-side li.hi { color: var(--text); font-weight: 500; }
.tm-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 18px; padding: 8px 12px; border-top: 1px solid var(--line); font: 500 12px/1 var(--ui); }
.cmp-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.cmp-bar .picker { width: auto; }
.cmp-bar .btn-line { height: 38px; }
.cmp-names { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font: 600 22px/1.2 var(--ui); letter-spacing: -0.01em; }
.sheet-link { padding: 14px 16px; border-bottom: 1px solid var(--border); font: 400 15px/1.5 var(--ui); color: var(--text-2); }
.sheet-link b { font-weight: 500; color: var(--text); }
.math td:first-child { color: var(--text-2); }
.math tbody tr:hover td { background: var(--hover); }
.fates { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); border-top: 1px solid var(--border); }
.fate { min-width: 0; padding-top: 12px; border-right: 1px solid var(--border); }
.fate:last-child { border-right: 0; }
.fate .tm-head { padding: 0 16px; }
.log.wrap td { height: auto; padding-top: 9px; padding-bottom: 9px; white-space: normal; line-height: 1.35; }
.log tr.hi td { background: var(--raised); color: var(--text); }
.player-card .i-name { font: 600 26px/1.15 var(--ui); letter-spacing: -0.015em; }
.player-card .i-sub { margin-top: 6px; font: 400 14px/1.45 var(--ui); }
.pad { padding: 18px 20px; font-family: var(--narrow); }
.chain { display: flex; align-items: center; padding: 28px 20px; overflow-x: auto; }

.api-pad { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.prose { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; font: 400 14px/1.6 var(--ui); color: var(--text-2); }
.prose b { font-weight: 500; color: var(--text); }
.empty-panel { padding: 36px 24px; display: flex; flex-direction: column; gap: 10px; max-width: 720px; font: 400 14px/1.6 var(--ui); color: var(--text-2); }
.empty-panel b { font-weight: 500; color: var(--text); }

/* ---------- Icons ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.chip .ic { width: 12px; height: 12px; }

/* ---------- Profiles: players, coaches, teams ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 13px; font: 500 12px/1 var(--ui); color: var(--text-2); }
.tag .ic { color: var(--cond); }
/* Honours band under the player card: count, condensed label, years; NBA row first, the rest quieter */
.hon-band { padding: 14px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.hon-band:empty { display: none; }
.hon { display: grid; margin: 0; }
.hon-row { display: grid; grid-template-columns: 96px 1fr; align-items: baseline; gap: 16px; }
.hon-row + .hon-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.hon dt { font: 500 12px/22px var(--narrow); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hon dd { margin: 0; }
.hon ul { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; padding: 0; list-style: none; }
.hon-e { display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.hon-e b { font: 600 13px/22px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.hon-l { font: 500 15px/22px var(--narrow); letter-spacing: 0.03em; text-transform: uppercase; color: var(--text); }
.hon-y { font: 400 12px/22px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.hon-e .ic { width: 14px; height: 14px; align-self: center; }
.hon-e.top .hon-l { font-weight: 700; }
.hon-e.gold .hon-l, .hon-e.gold .ic { color: #e3b448; }
.hon-e.cup .ic { color: #7fb8e6; }
.hon-e.silver .ic { color: #c4ced4; }
.hon-row.else .hon-l { font-size: 14px; color: var(--text-2); }
.hon-row.else b { color: var(--text-2); }
.hon-more .linkish { font: 500 14px/22px var(--narrow); letter-spacing: 0.03em; text-transform: uppercase; }
@media (max-width: 600px) {
  .hon-band { padding: 12px 14px; }
  .hon-row { grid-template-columns: 1fr; gap: 4px; }
  .hon ul { gap: 4px 18px; }
  .hon-e { white-space: normal; }
}
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.chart { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; font: 600 14px/1 var(--ui); }
.chart-head span { font: 400 12px/1 var(--ui); color: var(--muted); }
.bars { position: relative; display: flex; align-items: stretch; gap: 2px; height: 132px; border-bottom: 1px solid var(--border-2); }
.bars .col { position: relative; flex: 1 1 0; min-width: 2px; max-width: 56px; display: flex; flex-direction: column; justify-content: flex-end; }
.bars .col i { display: block; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--blue); opacity: 0.85; }
.bars .col.alt i { background: var(--track); }
.bars .col:hover i { opacity: 1; background: var(--text-2); }
.bars .col .ic { position: absolute; left: 50%; margin-left: -6px; width: 12px; height: 12px; color: var(--cond); }
.bars .ref { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--track); pointer-events: none; }
.bars .ref span { position: absolute; right: 0; top: -15px; font: 500 11px/1 var(--ui); color: var(--muted); }
.axis { display: flex; justify-content: space-between; padding-top: 6px; font: 500 11px/1 var(--ui); color: var(--muted); }
.scroll-x { overflow-x: auto; }
/* While a table runs past the right edge, that edge fades out to say there's more; at the end it's crisp again. */
@property --more { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes more { 0%, 90% { --more: 48px; } 100% { --more: 0px; } }
@supports (animation-timeline: scroll()) {
  :is(.scroll-x, .sec-tabs) { mask-image: linear-gradient(to left, transparent, #000 var(--more)); animation: more linear both; animation-timeline: scroll(x self); }
}
.log.stats { table-layout: auto; min-width: 860px; }
.log.stats th, .log.stats td { padding: 0 10px; }
.log.stats th:first-child, .log.stats td:first-child { padding-left: 20px; }
.log.stats td.num, .log.stats th.num { text-align: right; }
.log.stats tr.sum td { background: var(--node); font-weight: 500; }
.log .ic.c-cond { margin-left: 6px; }
.log a { color: var(--blue); }
.log .lead { color: var(--text); font-weight: 500; }
.up { color: var(--in); }
.down { color: var(--out); }
.flat { color: var(--muted); }
.inj { list-style: none; }
.inj > li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 220px; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.inj > li:last-child { border-bottom: 0; }
.inj .when { font: 600 15px/1.3 var(--ui); color: var(--text); }
.inj .when small { display: block; margin-top: 4px; font: 400 12px/1.3 var(--ui); color: var(--muted); }
.inj blockquote { margin: 0 0 8px; font: 400 14px/1.55 var(--ui); color: var(--text-2); }
.inj blockquote:last-child { margin-bottom: 0; }
.inj cite { display: block; margin-top: 2px; font: normal 400 12px/1.3 var(--ui); color: var(--muted); }
.inj .eff { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 6px 14px; align-content: start; font: 400 13px/1.2 var(--ui); color: var(--muted); }
.inj .eff b { font-weight: 500; color: var(--text); text-align: right; }
.dir-tools { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dir-tools .pick-in { max-width: 360px; }
.dir-tools .note { margin-left: auto; }
/* Sortable tables (sortable.js): header buttons, arrow on the left of number columns so labels stay flush. */
table[data-sort] th .sort-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer;  min-width: 24px; min-height: 28px;}
table[data-sort] th.num .sort-btn { flex-direction: row-reverse; }
table[data-sort] th .sort-btn:hover, table[data-sort] th[aria-sort] { color: var(--text); }
table[data-sort] th .arr { width: 8px; }
table[data-sort] th[aria-sort="ascending"] .arr::after { content: "↑"; }
table[data-sort] th[aria-sort="descending"] .arr::after { content: "↓"; }
/* Teams list */
.tl { table-layout: auto; min-width: 1100px; } /* columns fit their content: no cut-off names */
.tl .tl-team { display: inline-flex; align-items: center; gap: 12px; color: var(--text); } /* the row is the link; the chip carries the colour */
.tl td { height: 48px; }
.tl tbody tr { cursor: pointer; }
.tl tbody tr:hover td { background: var(--hover); }
.log .lg { margin-left: 6px; font-size: 12px; }
/* Team seasons: a column per playoff round, the NBA Cup and trophies */
.ss { table-layout: auto; min-width: 1100px; }
.ss td { height: 44px; }
.ss th, .ss td { padding: 0 10px; }
.ss th:first-child, .ss td:first-child { padding-left: 20px; }
.ss .res { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--mono); white-space: nowrap; }
.ss .res + .res { margin-left: 12px; }
.ss .res b { font-weight: 700; }
.ss .res .c-muted { font: 400 12px/1 var(--ui); }
.tro { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font: 600 12px/1 var(--ui); }
.tro .ic { width: 16px; height: 16px; }
.tro.gold { color: #e3b448; }
.tro.silver { color: #c4ced4; }
.tro.cup { color: #7fb8e6; }
.head-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.head-card h1 { font: 600 26px/1.15 var(--ui); letter-spacing: -0.015em; }
.head-card .i-sub { margin-top: 6px; font: 400 14px/1.45 var(--ui); color: var(--muted); }
.head-card .push { display: flex; gap: 8px; }

/* ---------- Officials ---------- */
.ref-q { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; }
.ref-q > div { padding: 16px 20px; border-right: 1px solid var(--border); }
.ref-q > div:last-child { border-right: 0; }
.ref-q h3 { margin-bottom: 10px; font: 600 13px/1 var(--ui); color: var(--text-2); }
.chips-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 5px 8px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 6px; }
.chips-in:focus-within { border-color: var(--blue); }
.chips-in input { flex: 1; min-width: 160px; height: 28px; background: none; border: 0; outline: none; font: 400 14px/1 var(--ui); color: var(--text); }
.chips-in input::placeholder { color: var(--muted); }
.ref-chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; background: var(--raised); border: 1px solid var(--border-2); border-radius: 13px; font: 500 12px/1 var(--ui); }
.ref-chip button { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; color: var(--muted); }
.ref-chip button:hover { background: var(--border-2); color: var(--text); }
.seg.wide { display: flex; margin-bottom: 10px; }
.seg.wide button { flex: 1; justify-content: center; }
.subj { display: grid; gap: 8px; }
.subj .picker { width: 100%; }
.ref-out .log td.c-muted { color: var(--muted); }

/* ---------- Omnibar, tooltip ---------- */
.omni-mask { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; background: rgba(5, 7, 10, 0.78); }
.omni { width: min(640px, 92vw); overflow: hidden; background: var(--panel); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.omni-input { width: 100%; height: 52px; padding: 0 16px; background: var(--rail); border: 0; border-bottom: 1px solid var(--border); font: 400 16px/1 var(--ui); color: var(--text); outline: none; }
.omni-list { list-style: none; max-height: 360px; overflow-y: auto; }
.omni-list li { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font: 400 14px/1.3 var(--ui); color: var(--text-2); cursor: pointer; }
.omni-list li > .ic { width: 16px; height: 16px; color: var(--muted); }
.omni-list .o-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-list .o-main small { margin-left: 8px; font-size: 12px; color: var(--muted); }
.omni-list li[aria-selected="true"], .omni-list li:hover { background: var(--raised); color: var(--text); }
.omni-list .kind { flex: none; color: var(--muted); font: 500 11px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; }
.tip { position: fixed; z-index: 60; pointer-events: none; max-width: 320px; padding: 7px 10px; background: var(--raised); border: 1px solid var(--border-2); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); font: 400 12px/1.45 var(--ui); color: var(--text); white-space: pre-line; }

@media (max-width: 1280px) {
  .row-2, .draft-grid { grid-template-columns: minmax(0, 1fr); }
  .legend { display: none; }
}

/* Phones and small tablets: the rail becomes a drawer behind the menu button. */
@media (max-width: 960px) {
  .tl { min-width: 0; }
  .tl .tl-name { display: none; } /* the chip names the team; the numbers stay in view */
  .ss th:first-child, .ss td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); }
  .tl th:first-child, .tl td:first-child { position: sticky; left: 0; z-index: 1; padding-right: 10px; background: var(--panel); }
  html { -webkit-text-size-adjust: 100%; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); height: auto; overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; }
  .menu-open .rail { transform: none; visibility: visible; transition: transform 0.2s ease; box-shadow: 16px 0 40px rgba(0, 0, 0, 0.5); }
  body:has(.menu-open) { overflow: hidden; }
  .menu-close { display: inline-flex; position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--muted); }
  .menu-close .ic { width: 20px; height: 20px; }
  .nav a { height: 44px; }
  .m-only { display: inline; }

  .topbar { flex-wrap: wrap; height: auto; min-height: 60px; gap: 8px 12px; padding: 8px 12px; }
  .menu-btn { display: inline-flex; flex: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--border-2); border-radius: var(--r); color: var(--text-2); }
  .crumb { flex: 1; min-width: 0; gap: 8px; font-size: 14px; overflow: hidden; }
  .crumb > * { flex: none; }
  .crumb > :last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .crumb .first, .crumb .first + .sep { display: none; }
  #top-default { flex: none; gap: 0; }
  .search { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .search kbd { display: none; }
  .search span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  /* trade header: menu, crumb and Account on top; the branch filter, then the as-of slider across the width */
  #top-trade { order: 2; flex: 1 0 100%; flex-wrap: wrap; gap: 10px 14px; }
  #top-trade .asof { flex: 1 0 100%; }
  #top-trade .asof input { flex: 1; min-width: 0; }
  .seg { flex: none; height: 36px; }
  .seg button { padding: 0 10px; }
  .push { margin-left: 0; }

  .page { gap: 12px; padding: 12px 12px 24px; }
  .panel { overflow-x: auto; }
  .panel-head { height: auto; min-height: 48px; padding: 10px 12px; }
  .panel-head { flex-wrap: wrap; } /* a note or button that doesn't fit beside the title goes below it */
  .panel-head h2 { flex: none; max-width: 100%; white-space: normal; line-height: 1.3; }
  .panel-head h2 { font-size: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 14px 14px; }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .kpi-label { font-size: 11px; }
  .kpi-num { margin-top: 8px; font-size: 24px; }

  .h2h { height: auto; grid-template-columns: max-content 18px max-content minmax(0, 1fr); row-gap: 10px; padding: 12px; }
  .h2h-mid { grid-row: 2; grid-column: 1 / -1; padding-left: 0; }
  .h2h-net { grid-row: 1; grid-column: 4; flex-direction: row; gap: 8px; }
  .matrix td, .matrix tbody th { height: 64px; }

  /* The log becomes one card per trade. */
  .log.cards, .log.cards tbody { display: block; }
  .log.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .log.cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .log.cards tr:last-child { border-bottom: 0; }
  .log.cards tr[data-href]:hover { background: var(--hover); }
  .log.cards tr[data-href]:hover td { background: none; }
  .log.cards td { height: auto; padding: 0; border: 0; font-size: 15px; }
  .log.cards td:nth-child(1) { grid-area: 1 / 1; color: var(--muted); }
  .log.cards td:nth-child(2) { grid-area: 2 / 1; }
  .log.cards td:nth-child(3) { grid-area: 3 / 1 / 4 / 3; }
  .log.cards td:nth-child(4) { grid-area: 4 / 1 / 5 / 3; }
  .log.cards td:nth-child(5) { grid-area: 1 / 2; }
  .log.cards td:nth-child(6) { grid-area: 2 / 2; }
  .draft-grid > .panel:first-child { max-height: 300px; overflow-y: auto; }

  .work { grid-template-columns: minmax(0, 1fr); }
  .canvas { padding: 14px 12px 24px; }
  .split { margin-bottom: 24px; padding: 12px 14px; }
  .split-top { gap: 10px; font-size: 22px; }
  .split .bar { height: 22px; }
  .split-sub { flex-direction: column; gap: 4px; font-size: 15px; }
  .split-sub b { margin-right: 6px; font-weight: 500; color: var(--text); }
  #tree { overflow-x: auto; padding-bottom: 6px; }
  .root { width: 84px; padding: 10px 6px; font-size: 15px; }
  /* Club root sits above its branches on phones, which saves a column of width. */
  .tree { flex-direction: column; align-items: flex-start; }
  .team-root { width: auto; flex-direction: row; gap: 10px; padding: 6px 12px 6px 6px; }
  .team-root .r-sub { font-size: 14px; }
  .tree .root-link { width: 3px; height: 12px; margin-left: 12px; }
  .branches { gap: 12px; padding-left: 34px; }
  .branch::after { top: -6px; bottom: -6px; }
  .tree .branch:first-child::after { top: 0; }
  .node { min-width: 118px; min-height: 62px; padding: 7px 12px 7px 10px; }
  .node.exit { padding-left: 12px; }
  .node.future { padding-left: 15px; }
  .n-head { font-size: 14px; }
  .n-title { font-size: 17px; }
  .n-sub { font-size: 13px; }
  .edge { min-width: 40px; }
  .edge .e-label, .edge .e-size { font-size: 13px; }
  .inspector { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); scroll-margin-top: 120px; }
  .tabs button { flex: 1; text-align: center; }
  .insp { padding: 18px 14px; overflow: visible; }
  .insp > .etag:last-child { margin-top: 22px; }

  .player-card { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px; }
  .pc-id { gap: 14px; }
  .picker { width: 100%; }
  .sec-tabs { padding: 0; }
  .sec-tabs button { padding: 0 12px; font-size: 13px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts dd { font-size: 14px; }
  .sec-head, .pad-x { padding-left: 14px; padding-right: 14px; }
  .steps { padding: 14px 14px 2px; }
  .steps > li { padding-left: 24px; font-size: 14px; }
  .st-title { font-size: 15px; }
  .cmp-bar { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .cmp-bar .btn-line { justify-self: center; }
  .cmp-names { font-size: 18px; }
  .fates { grid-template-columns: minmax(0, 1fr); }
  .fate { border-right: 0; border-bottom: 1px solid var(--border); }
  .player-card .i-name { font-size: 22px; }
  .player-card .i-sub { font-size: 13px; }
  .pad { padding: 14px; }
  .seasons { grid-template-columns: 64px minmax(0, 1fr) 36px 48px; column-gap: 10px; }
  .chain { padding: 20px 14px; }
  .api-pad { padding: 12px; }
  #ep { max-width: 62%; }
  .prose { padding: 14px; }
  .empty-panel { padding: 24px 14px; }
  .omni-mask { padding: 10px; }
  .omni { width: 100%; }
  .omni-list { max-height: 60vh; }
  .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.k5 .kpi:nth-child(5) { grid-column: 1 / -1; border-top: 1px solid var(--border); }
  .inj > li { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .head-card { flex-wrap: wrap; padding: 14px; }
  .head-card > :nth-child(2) { flex: 1 1 180px; min-width: 0; } /* the name beside its chip, as on a team page */
  .head-card h1 { font-size: 22px; }
  .head-card .push { margin-left: 0; width: 100%; }
  .ref-q { grid-template-columns: minmax(0, 1fr); }
  .ref-q > div { border-right: 0; border-bottom: 1px solid var(--border); padding: 14px; }
  .dir-tools { flex-wrap: wrap; }
  .dir-tools .note { margin-left: 0; }
  .chart { padding: 14px; }
}
/* Loading screen: shows while data.js downloads, removed once the first view renders. */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--bg); color: var(--muted); transition: opacity 0.25s ease, visibility 0.25s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-word { font: 500 22px/1 var(--mono); letter-spacing: 0.3em; margin-right: -0.3em; color: var(--text); }
.boot-bar { width: 160px; height: 2px; background: var(--line); overflow: hidden; }
.boot-bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--blue); animation: boot 1.1s ease-in-out infinite; }
.boot-note { font: 400 13px/1 var(--ui); color: var(--muted); }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  .boot { transition: none; }
  .boot-bar::after { animation: none; width: 100%; }
}

@media (max-width: 960px) and (prefers-reduced-motion: reduce) {
  .rail, .menu-open .rail { transition: none; }
}

/* Long lists inside a panel scroll on their own, header kept in view */
.cap { max-height: 520px; overflow: auto; padding-top: 0; }
.cap thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }

/* Teammates and honours */
.log.wrap td { white-space: normal; height: auto; padding-top: 10px; padding-bottom: 10px; line-height: 1.6; }
.log td.lead { color: var(--text); }
.log tr.likely td { color: var(--text-2); }
.lvl { font: 500 11px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.tag.sm { height: 20px; padding: 0 8px; font-size: 11px; vertical-align: 1px; }
.seg .count, .acc .count { margin-left: 6px; color: var(--muted); font-weight: 400; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; padding: 16px 20px 4px; }
.acc { border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; background: var(--node); }
.acc h3 { display: flex; align-items: baseline; font: 600 13px/1 var(--ui); color: var(--text); margin-bottom: 10px; }
.acc ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font: 400 13px/1.45 var(--ui); color: var(--text-2); }
.acc li .ic { width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px; }
.medal { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.medal.gold { background: var(--cond); }
.medal.silver { background: #a9adb5; }
.medal.bronze { background: #9a6b46; }
