/* LFFL v2. Palette, type and chips carried over from the v1 site (site_template.html):
   navy bands, coloured position chips, alternating grey position blocks, peach injury-list block.
   One typeface (Barlow); hierarchy from weight and size only. */
:root {
  --bg: #eef1f5; --paper: #ffffff; --block: #eef1f4; --ink: #12202f; --muted: #5b6878; --rule: #dde2e8;
  --band: #0a1e31; --band-ink: #f2f2f2; --il: #fbe3d6; --label: #e1e4e8; --plus: #e00000; --plus-bg: #ffffff;
  --focus: #0f9ed5; --face-bg: #dfe5ec; --good: #2f6a1b;
  --head-bg: linear-gradient(180deg, #d9ebf7 0%, #b9d5ea 100%); --head-ink: #164a70; --head-rule: #a6c3d9;
  --badge-bg: transparent;
  --font: "Barlow", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --fs: 15px; --fs-sm: 13px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a121b; --paper: #111d29; --block: #182634; --ink: #e5ebf1; --muted: #93a1b0; --rule: #23364a;
    --band: #1c3654; --band-ink: #f2f5f8; --il: #3a2a22; --label: #1d2b39; --plus: #ff6b6b; --plus-bg: #111d29;
    --face-bg: #26384b; --good: #8fd16f;
    --head-bg: linear-gradient(180deg, #23435c 0%, #1b364c 100%); --head-ink: #d3e6f3; --head-rule: #2e5170;
    --badge-bg: #e8edf2; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a121b; --paper: #111d29; --block: #182634; --ink: #e5ebf1; --muted: #93a1b0; --rule: #23364a;
  --band: #1c3654; --band-ink: #f2f5f8; --il: #3a2a22; --label: #1d2b39; --plus: #ff6b6b; --plus-bg: #111d29;
  --face-bg: #26384b; --good: #8fd16f;
  --head-bg: linear-gradient(180deg, #23435c 0%, #1b364c 100%); --head-ink: #d3e6f3; --head-rule: #2e5170;
  --badge-bg: #e8edf2; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--fs);
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
}
a { color: inherit; }
.wrap { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.wrap > * { min-width: 0; }
.caps { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.top { display: flex; align-items: center; gap: 14px; padding: 16px 0 4px; flex-wrap: wrap; }
.top .crest { width: 52px; height: auto; }
.top .brand { font-weight: 700; font-size: 22px; text-decoration: none; line-height: 1; }
.top .brand small { display: block; font-weight: 500; font-size: var(--fs-sm); color: var(--muted); margin-top: 3px; }
nav.views { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav.views a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: var(--fs-sm);
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
nav.views a:hover { background: var(--paper); color: var(--ink); }
nav.views a[aria-current="page"] { background: var(--band); color: var(--band-ink); }
@media (max-width: 760px) {
  nav.views { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  nav.views a { padding: 7px 9px; white-space: nowrap; }
}

h1 { font-weight: 700; font-size: clamp(24px, 4.5vw, 32px); line-height: 1.1; margin: 8px 0 0; text-wrap: balance; }
h2.sec-h { margin: 10px 0 -8px; color: var(--muted); }
.head { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.head h1 { flex: 1 1 auto; }

/* Controls */
form.controls, .controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.field { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 7px 12px; display: grid; gap: 2px; }
.field label, .field .lbl { color: var(--muted); }
.field select, .field input { font: 600 var(--fs)/1.2 var(--font); color: var(--ink); background: transparent; border: 0; padding: 2px 0; }
.field select { cursor: pointer; }
.field input { min-width: 150px; outline: none; }
.field select option { background: var(--paper); color: var(--ink); }
.field b { font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button.go { font: 600 var(--fs-sm)/1 var(--font); text-transform: uppercase; letter-spacing: .05em; border: 0;
  border-radius: 10px; padding: 0 16px; background: var(--band); color: var(--band-ink); cursor: pointer; }

/* Sheets and tables */
.sheet { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { background: var(--head-bg); color: var(--head-ink); font-size: 11px; padding: 11px 8px 9px; text-align: center;
  white-space: nowrap; border-bottom: 1px solid var(--head-rule); }
th a { text-decoration: none; }
th a[aria-current] { text-decoration: underline; text-underline-offset: 3px; }
th.l, td.l { text-align: left; }
td { padding: 5px 8px; height: 38px; text-align: center; border-bottom: 1px solid var(--rule); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody + thead th { border-top: 1px solid var(--head-rule); }
tr.alt td { background: var(--block); }
tbody.il td { background: var(--il); }
td.strong, td .strong { font-weight: 700; }
td.wrap-ok { white-space: normal; }
td.neg, .neg { color: var(--plus); }
td.best { font-weight: 700; color: var(--good); }
td.rank { color: var(--muted); width: 32px; }
.mgr { font-weight: 600; text-decoration: none; }
.mgr small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
a.mgr:hover, a.pl-link:hover { text-decoration: underline; }
table.grid td, table.grid th { padding-inline: 5px; }
table.grid td:first-child { position: sticky; left: 0; background: var(--paper); z-index: 1; }

/* Player cell */
.pl { display: flex; align-items: center; min-width: 0; }
.pl-link { text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.face { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--face-bg); margin-right: 8px;
  object-fit: cover; box-shadow: 0 0 0 1px var(--rule); }
.flag { flex: none; width: 20px; height: 15px; margin-right: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.badge { display: inline-block; width: 28px; height: 28px; padding: 2px; object-fit: contain; vertical-align: middle;
  background: var(--badge-bg); border-radius: 6px; }

/* Chips */
.chip { display: inline-grid; place-items: center; min-width: 36px; height: 24px; padding: 0 6px;
  font: 600 var(--fs-sm)/1 var(--font); letter-spacing: .02em; }
.st { min-width: 30px; }
.st-ok { background: #b8dcab; color: #3b7d22; }
.st-7 { background: #ffff99; color: #af5526; }
.st-14 { background: #ff9900; color: #111; }
.st-plus { background: var(--plus-bg); color: var(--plus); font-size: 17px; box-shadow: inset 0 0 0 1px var(--rule); }
.st-rc { background: #ffabab; color: #111; }
.st-afc { background: #c00000; color: #fff; }
.pk { display: inline-block; padding: 2px 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pk-xi { background: var(--band); color: var(--band-ink); }
.pk-on { background: #b8dcab; color: #2f6a1b; }
.pk-off { background: #fbe3d6; color: #9a4a1f; }
.pk-bench { background: var(--label); color: var(--muted); }
.tag { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--label); color: var(--muted); }

/* Cards: gameweek teams, player page */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px;
  background: var(--band); color: var(--band-ink); }
.card-h a { text-decoration: none; font-weight: 600; }
.card-h .pts { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card ul { list-style: none; margin: 0; padding: 4px 0; }
.card li { display: flex; align-items: center; gap: 8px; padding: 3px 12px; }
.card li .pl { flex: 1; }
.card li .p { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }
.card .chip { min-width: 30px; height: 20px; font-size: 11px; }

.profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding: 16px; align-items: center; }
.profile .photo { position: relative; width: 120px; height: 120px; }
.profile .photo img.big { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--face-bg); }
.profile .photo .badge { position: absolute; right: -6px; bottom: -2px; width: 38px; height: 38px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); color: var(--muted); align-items: baseline; }
.facts b { color: var(--ink); font-size: var(--fs); font-variant-numeric: tabular-nums; }
.note { padding: 12px 16px; border-top: 1px solid var(--rule); font-size: var(--fs-sm); line-height: 1.45; white-space: normal; }
.why { color: var(--muted); font-size: 12px; white-space: normal; text-align: left; }
@media (max-width: 520px) { .profile { grid-template-columns: 1fr; } .hide-sm { display: none; } }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.feed li:last-child { border-bottom: 0; }
.feed .day { background: var(--block); font-weight: 600; color: var(--muted); }
.feed .cost { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

.problems { background: #fff4e5; color: #6b3d00; border: 1px solid #f3c98b; border-radius: 10px; padding: 10px 14px; font-size: var(--fs-sm); }
footer { color: var(--muted); font-size: var(--fs-sm); display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between;
  border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 10px; }
.empty { padding: 18px; color: var(--muted); }

/* Buttons, messages, forms (picking a team, admin) */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border: 0; border-radius: 10px;
  background: var(--band); color: var(--band-ink); font: 600 var(--fs-sm)/1 var(--font); text-transform: uppercase;
  letter-spacing: .05em; text-decoration: none; cursor: pointer; }
.btn.light { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.msg { border-radius: 10px; padding: 10px 14px; font-size: var(--fs-sm); line-height: 1.45; }
.msg ul { margin: 4px 0 0; padding-left: 18px; }
.msg.err { background: #fde8e8; color: #8a1c1c; border: 1px solid #f3b4b4; }
.msg.warn { background: #fff4e5; color: #6b3d00; border: 1px solid #f3c98b; }
.msg.ok { background: #e7f5e1; color: #2f6a1b; border: 1px solid #b8dcab; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.err { background: #3b1a1a; color: #ffb4b4; border-color: #6b2a2a; }
  :root:not([data-theme="light"]) .msg.warn { background: #3a2a12; color: #ffd59a; border-color: #6b4a1a; }
  :root:not([data-theme="light"]) .msg.ok { background: #1c3318; color: #b8e6a6; border-color: #2f5a26; } }
input.note { width: 100%; min-width: 120px; font: 400 var(--fs-sm)/1.2 var(--font); color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 6px; padding: 6px 8px; }
tr.locked td { opacity: .75; }
.tally { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sticky-bar { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap; border-top: 1px solid var(--rule); z-index: 2; }
code.link { display: block; padding: 10px; background: var(--block); border-radius: 8px; word-break: break-all; font-size: 13px; }
form.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
form.stack > * { min-width: 0; }
.xs-only { display: none; }
@media (max-width: 640px) {
  .pick-table .xs-hide, .pick-table .flag { display: none; }
  .pick-table .xs-only { display: block; font-size: 12px; margin-top: 2px; white-space: normal; }
  .pick-table td { padding-inline: 4px; }
  .pick-table td.l { white-space: normal; }
}

/* Pick team: the squad list beside a pitch, as on the v1 site's Lineup tab.
   The pitch is its own world, the same in light and dark. */
.lu-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.lu-grid > * { min-width: 0; }
@media (max-width: 860px) { .lu-grid { grid-template-columns: minmax(0, 1fr); } }
.pick-table td { height: 44px; padding-inline: 5px; }
.pick-table td:first-child, .pick-table th:first-child { padding-left: 12px; }
.pick-table input.xi-box { width: 20px; height: 20px; accent-color: var(--band); cursor: pointer; }
.pick-table tr.on td { background: color-mix(in srgb, var(--focus) 14%, var(--paper)); }
.pick-table .face { border-radius: 0; background: none; box-shadow: none; object-position: top; }
.pick-table span.face { visibility: hidden; }
.lu-card { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.lu-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.lu-head img { width: 44px; height: auto; }
.lu-head b { display: block; font-size: 18px; }
.lu-head span { color: var(--muted); font-size: 13px; }
.pitch-wrap { display: grid; }
.pitch { position: relative; padding: 18px 4px 22px; background: repeating-linear-gradient(180deg, #2f8f46 0 48px, #2a8340 48px 96px);
  border-top: 1px solid #1f6a33; }
.pitch .lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.pitch .lines * { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.rows { position: relative; display: grid; gap: 14px; min-height: 380px; align-content: space-evenly; }
.prow { display: flex; justify-content: space-evenly; align-items: flex-start; gap: 2px; }
.pc { width: 82px; display: grid; justify-items: center; text-align: center; position: relative; }
.pc.ahead { margin-top: 24px; }
.pc.nudge { margin-top: 12px; }
.pc-img { position: relative; width: 56px; height: 56px; }
.pc-img .face { width: 56px; height: 56px; margin: 0; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 2px 6px rgba(0,0,0,.3); object-fit: cover; object-position: top; }
.pc-img span.face { display: block; }
.pc-img .badge { position: absolute; right: -8px; bottom: -2px; width: 24px; height: 24px; padding: 1px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.pc-img .chip.pos { position: absolute; left: -10px; bottom: -2px; width: 26px; min-width: 26px; height: 16px; font-size: 10px; padding: 0; }
.sub-ic { position: absolute; left: -8px; top: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.sub-ic.lock { background: #fff; }
.pc-name { margin-top: 6px; max-width: 100%; background: #0a1e31; color: #fff; font-size: 12px; font-weight: 600; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-fx { background: #fff; color: #0a1e31; font-size: 11px; font-weight: 600; padding: 2px 5px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lu-empty { color: #e6f2e9; text-align: center; font-size: 14px; padding: 40px 0; }
.bench { background: #1c5a2c; border-top: 1px solid #1f6a33; padding: 12px 12px 14px; display: grid; gap: 8px; }
.bench-h { color: #e6f2e9; font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.sub-row { display: grid; grid-template-columns: 26px minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.sub-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #0a1e31; font-weight: 700; font-size: 13px; }
.sub-row select, .bench input.note { font: 500 var(--fs-sm)/1.2 var(--font); color: #0a1e31; background: #fff; border: 0; border-radius: 6px; padding: 8px; width: 100%; min-width: 0; }
.bench input.note::placeholder { color: #6b7a88; }
@media (max-width: 560px) {
  .pc { width: 68px; }
  .pc-img, .pc-img .face { width: 46px; height: 46px; }
  .pc-img .badge { width: 20px; height: 20px; right: -6px; }
  .pc-name { font-size: 11px; padding: 2px 4px; }
  .pc-fx { font-size: 9px; padding: 2px 3px; }
  .rows { min-height: 320px; }
  .sub-row { grid-template-columns: 26px minmax(0, 1fr); }
  .sub-row .note { grid-column: 2; }
}
[hidden] { display: none !important; }
.trade-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 0 16px 12px; }
.trade-side { display: grid; gap: 8px; align-content: start; }
.trade-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 10px; max-height: 420px; overflow: auto; }
.trade-list li { border-bottom: 1px solid var(--rule); }
.trade-list li:last-child { border-bottom: 0; }
.trade-list label { display: flex; gap: 8px; align-items: center; padding: 6px 10px; cursor: pointer; }
.trade-list input { width: 18px; height: 18px; accent-color: var(--band); }
.trade-list .chip { min-width: 30px; height: 20px; font-size: 11px; }
@media (max-width: 640px) { .trade-grid { grid-template-columns: minmax(0, 1fr); } }
/* Admin scores */
.checks li { align-items: flex-start; }
.check-who { flex: 1 1 320px; min-width: 0; }
.check-kind { background: #fff1cc; color: #6b4a00; }
.check-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.check-form .btn { padding: 8px 12px; }
details.mgr-score { border-bottom: 1px solid var(--rule); }
details.mgr-score:last-child { border-bottom: 0; }
details.mgr-score summary { display: flex; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; }
details.mgr-score summary::-webkit-details-marker { display: none; }
details.mgr-score summary::before { content: "▸"; color: var(--muted); }
details.mgr-score[open] summary::before { content: "▾"; }
details.mgr-score table td { height: 34px; }
tr.flagged td { background: #fff8e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .check-kind { background: #3a2f12; color: #ffd98a; }
  :root:not([data-theme="light"]) tr.flagged td { background: #2c2614; } }
.check-what { font-weight: 600; margin-left: 4px; }
ul.explain { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.card .late { background: #fff4e5; color: #6b3d00; font-size: 12px; padding: 6px 12px; line-height: 1.35; }

/* Player headshots in tables: cut-outs that fill the row, no circle, sat on the row's bottom edge
   (as on the v1 site's team sheets) */
td:has(> .pl), td:has(> label.pl) { padding-block: 0; }
td .pl { height: 42px; align-items: center; }
td .pl .face { width: 42px; height: 42px; margin: 0 8px 0 0; border-radius: 0; background: none; box-shadow: none;
  object-fit: cover; object-position: top; align-self: flex-end; }
td .pl span.face { visibility: hidden; }
@media (max-width: 560px) { td .pl .face { width: 38px; height: 38px; margin-right: 6px; } td .pl { height: 38px; } }
/* Transfers feed: the player's cut-out headshot just before his name, filling the row height */
.feed li.tx { padding-block: 0; min-height: 44px; flex-wrap: nowrap; align-items: stretch; }
.feed li.tx > span { padding-block: 8px; line-height: 28px; align-self: center; }
.feed li.tx .cost { margin-left: auto; padding-left: 12px; align-self: center; }
.tx-face { display: inline-block; width: 44px; height: 44px; object-fit: cover; object-position: top;
  vertical-align: bottom; margin: -8px 4px -8px 6px; }
.tx-p { white-space: nowrap; }
.feed li.tx .cost { white-space: nowrap; }
@media (max-width: 560px) { .tx-face { width: 38px; height: 38px; margin-left: 4px; } }
/* Full names where there's room; the short form in tables on phones */
.nm-short { display: none; }
@media (max-width: 640px) { td .nm-full { display: none; } td .nm-short { display: inline; } }
.badge.mini { width: 20px; height: 20px; padding: 0; margin-left: 6px; vertical-align: -4px; border-radius: 4px; }
nav.tabs { display: inline-flex; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 3px; gap: 2px; }
nav.tabs a { padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
nav.tabs a[aria-current] { background: var(--band); color: var(--band-ink); }
.progress { margin: -6px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.progress b { color: var(--ink); }
/* Match editor */
.match-grid td, .match-grid th { padding-inline: 3px; }
.match-grid input.num { width: 40px; text-align: center; font: 500 var(--fs-sm)/1 var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 2px; }
.match-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--band); }
.match-grid td.fixed input.num, .fixed-key { background: #fff1cc; border-color: #e0b84a; }
.fixed-key { padding: 1px 5px; border-radius: 4px; border: 1px solid #e0b84a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .match-grid td.fixed input.num,
  :root:not([data-theme="light"]) .fixed-key { background: #3a2f12; border-color: #8a6a1a; } }
/* Assists, goal by goal */
.assist-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--rule); font-size: 16px; }
.assist-form table td { height: 46px; vertical-align: middle; }
.assist-form select { font: 500 var(--fs-sm)/1.2 var(--font); color: var(--ink); background: var(--paper); border: 1px solid var(--rule);
  border-radius: 6px; padding: 6px; max-width: 230px; }
.assist-form select.second { display: none; }
.assist-form input.num { width: 44px; text-align: center; font: 500 var(--fs-sm)/1 var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 2px; }
.link-btn { all: unset; cursor: pointer; color: var(--focus); font-size: 13px; font-weight: 600; }
.assist-block { scroll-margin-top: 12px; }
.keeper-form { display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--rule); background: var(--block); }
.keeper { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 8px; border-radius: 8px; }
.keeper.fixed { background: #fff1cc; }
.keeper label { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.keeper-form input.num { width: 44px; text-align: center; font: 500 var(--fs-sm)/1 var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .keeper.fixed { background: #3a2f12; } }
/* Admin subs */
.subs-table tr.group-h td { background: var(--block); color: var(--muted); height: 30px; }
.subs-table tr.off td:not(:last-child) { opacity: .45; }
.subs-table tr.on td { background: color-mix(in srgb, #b8dcab 35%, var(--paper)); }
.seg { display: inline-flex; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 10px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg input:checked + span { background: var(--band); color: var(--band-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.paste-box textarea { width: 100%; font: 400 13px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 10px; }
.msg-inline { font-size: var(--fs-sm); background: var(--block); }
.msg-inline.warn { background: #fff4e5; color: #6b3d00; }
/* Assists page as one form */
.assist-table td { height: 46px; vertical-align: middle; }
.assist-table select { font: 500 var(--fs-sm)/1.2 var(--font); color: var(--ink); background: var(--paper); border: 1px solid var(--rule);
  border-radius: 6px; padding: 6px; max-width: 230px; }
.assist-table select.second { display: none; }
.assist-table input.num { width: 44px; text-align: center; font: 500 var(--fs-sm)/1 var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 2px; }
/* Subs page: manager list down the left */
.subs-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.subs-main { display: grid; gap: 18px; min-width: 0; }
.subs-nav { position: sticky; top: 12px; display: grid; padding: 6px 0; }
.subs-nav-h { padding: 6px 14px 8px; }
.subs-nav a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 14px;
  text-decoration: none; font-weight: 600; font-size: 14px; border-left: 3px solid transparent; }
.subs-nav a:hover { background: var(--block); }
.subs-nav a[aria-current] { background: var(--block); border-left-color: var(--band); }
.subs-nav small { font-weight: 600; font-size: 11px; white-space: nowrap; }
.subs-nav small.ok { color: var(--good); }
@media (max-width: 760px) {
  .subs-layout { grid-template-columns: minmax(0, 1fr); }
  .subs-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subs-nav-h { grid-column: 1 / -1; }
}

/* All teams' subs (screenshot to share) */
.subs-readout td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.sr-p { display: flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1.9; }
.sr-p b { margin-left: 4px; font-weight: 700; }
.subs-readout .pos-n { color: var(--good); }
@media (max-width: 600px) {
  .subs-readout .sr-gain, .subs-readout .sr-p .badge, .subs-readout .sr-p .chip { display: none; }
  .subs-readout td:first-child { white-space: normal; }
  .subs-readout th, .subs-readout td { padding-left: 6px; padding-right: 6px; }
  .sr-p { gap: 4px; font-size: 14px; }
}

.inj-note blockquote { margin: 6px 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--rule); color: var(--muted); font-style: italic; }
