html{-webkit-text-size-adjust:100%}
body{margin:0}
img{max-width:100%}

/* Layout: team-colour hero band → one sticky team-colour top bar (count + actions / view tabs + search / per-position kept-of-total tabs) → compact photo-row grid. Team look: colours from theme.js deriveTheme(), skewed tabs, Rajdhani numerals. */
:root{
  /* colour tokens = deriveTheme(NEUTRAL) from theme.js (tests/frontend/theme.test.mjs keeps them in sync); applyTheme() overrides per team */
  --page:#DCDDE0; --paper:#FFFFFF; --ink:#111214; --text:#1D1E21; --muted:#57595F; --line:#C8C9CC;
  --tab:#ECECEC; --tab-ink:#111214; --acc:#4A4D52; --acc-hover:#3D3F43; --on-acc:#FFFFFF; --acc-ink:#4A4D52; --acc-ink-l:#4A4D52;
  --hi:#C4C7CC; --band:#111214; --on-band:#FFFFFF; --band-muted:#C9CACB; --tile:#DBDBDC; --soft:#EDEDEE;
  --pri-hover:#E9EAEA; --shade-rgb:12,13,14; --scrim:rgba(10,11,12,.6);
  --warn:#C2611B;
  /* on the team-colour band, which stays dark in both modes, so these are not redefined for dark mode */
  --band-over:#FF8A84; --band-warn:#FFB37A;
  --f-body:"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
  --f-num:"Rajdhani","Arial Narrow",sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --page:#1E1F23; --paper:#191A1C; --ink:#F4F4F5; --text:#CDCDD1; --muted:#909398; --line:#303133;
  --tab:#27282A; --tab-ink:#E4E4E5; --acc:#65686C; --acc-hover:#535559; --on-acc:#FFFFFF; --acc-ink:#C4C7CC; --acc-ink-l:#4A4D52;
  --hi:#C4C7CC; --band:#0D0E0F; --on-band:#FFFFFF; --band-muted:#C0C1C2; --tile:#2B2C2E; --soft:#202224;
  --pri-hover:#E9EAEA; --shade-rgb:0,0,0; --scrim:rgba(0,0,0,.7);
  --warn:#F09A5C; color-scheme:dark}}
:root[data-theme="dark"]{
  --page:#1E1F23; --paper:#191A1C; --ink:#F4F4F5; --text:#CDCDD1; --muted:#909398; --line:#303133;
  --tab:#27282A; --tab-ink:#E4E4E5; --acc:#65686C; --acc-hover:#535559; --on-acc:#FFFFFF; --acc-ink:#C4C7CC; --acc-ink-l:#4A4D52;
  --hi:#C4C7CC; --band:#0D0E0F; --on-band:#FFFFFF; --band-muted:#C0C1C2; --tile:#2B2C2E; --soft:#202224;
  --pri-hover:#E9EAEA; --shade-rgb:0,0,0; --scrim:rgba(0,0,0,.7);
  --warn:#F09A5C; color-scheme:dark}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--page);color:var(--text);font-family:var(--f-body);font-size:15px;line-height:1.55}
button{font:inherit;color:inherit}
button:focus-visible,input:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.in{max-width:1080px;margin:0 auto;padding-inline:16px}

/* hero */
/* D1 band (same as the player dialog header): fine diagonal lines over a band→accent gradient, accent rule below */
.hero{background:repeating-linear-gradient(135deg,rgba(255,255,255,.06) 0 2px,transparent 2px 9px),linear-gradient(160deg,var(--band),color-mix(in srgb,var(--band) 70%,var(--acc)));
  border-bottom:3px solid var(--acc);color:var(--on-band);padding-block:28px 26px;position:relative;overflow:hidden}
.kicker{font-family:var(--f-num);font-weight:600;letter-spacing:.22em;font-size:13px;color:var(--band-muted);text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:420px){.kicker{letter-spacing:.1em}}
.hero h1{font-weight:700;font-size:clamp(26px,4.6vw,38px);line-height:1.2;margin:4px 0 10px;text-wrap:balance}
.hero p{margin:0;max-width:62ch;font-size:14px;color:var(--band-muted);font-weight:400}
.hero p b{color:var(--on-band);font-weight:500}
.hero .ex{margin-top:12px;font-size:12.5px;display:flex;flex-direction:column;gap:2px}
.hero .ex span b{color:var(--on-band);font-weight:500;margin-right:6px}
.hero .ex summary{cursor:pointer;list-style:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--on-band)}
.hero .ex summary::-webkit-details-marker{display:none}
.hero .ex summary::before{content:"▸";margin-right:6px}
.hero .ex details[open] summary::before{content:"▾"}
.hero .ex details[open] summary{margin-bottom:2px}
.hero .ex details>span{display:block}

/* sticky top: count + actions, view tabs + search, position counts + filter */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:8;background:var(--band);color:var(--on-band);box-shadow:0 2px 10px rgba(var(--shade-rgb),.18)}
.top .in{display:flex;flex-direction:column;gap:8px;padding-block:10px 10px}
.row{display:flex;gap:8px 12px;align-items:center;min-width:0}
.row .sp{flex:1}
/* line 1: mode hint (pick tab only) + submit status; line 2 starts with the count, which is the mode switch button */
.mrow{display:flex;align-items:baseline;gap:12px;min-width:0;margin-bottom:-2px}
.mrow .st{margin-left:auto;font-size:12px;color:var(--band-muted);white-space:nowrap;flex:none}
.modehint{font:inherit;font-size:12.5px;min-width:0;background:none;border:0;padding:0;color:var(--on-band);cursor:pointer;display:inline-flex;align-items:center;gap:6px;text-align:left}
.modehint b{font-weight:700}
.modehint .t{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.modehint .sw{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.modehint:hover .t{text-decoration:underline;text-underline-offset:3px}
.modehint.arm{color:var(--band-over)}
/* the number sits on the baseline of the label's last line (mode name, or 移出 N 人 under it) */
.total{display:flex;align-items:last baseline;gap:10px;flex:none;margin-right:auto;font:inherit;color:inherit;text-align:left;cursor:pointer;background:transparent;border:1px solid rgba(255,255,255,.38);border-radius:8px;padding:6px 12px 6px 10px}
.total:hover{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.6)}
.total:focus-visible,.modehint:focus-visible{outline:2px solid var(--on-band);outline-offset:2px}
.total.arm{border-color:var(--band-over)}
.num{font-family:var(--f-num);font-weight:700;font-size:40px;line-height:1;font-variant-numeric:tabular-nums;color:#fff;white-space:nowrap}
.num small{font-size:20px;color:var(--band-muted);font-weight:600;margin-left:2px}
.total .lbl{display:flex;flex-direction:column;font-size:var(--mv-fs);line-height:1.3;color:var(--band-muted)}
.total .lbl>*{white-space:nowrap}
.total .lbl b{color:var(--on-band);font-weight:500;font-size:13px}
/* over 60 is the normal 刪減 working state, not an error: team highlight, not the warning red */
.total .lbl .mv{color:var(--hi)}
/* one size in every state (both modes, any count, 確定？): room for a two-digit count and for 移出 NN 人,
   which keeps its line (invisible) when there is nothing to move; the single label line is then nudged to the middle */
.total #selN{display:inline-block;min-width:2.1ch;text-align:right}
.total .lbl .mv{font-variant-numeric:tabular-nums;min-width:calc(3.7em + 2ch)}
.total .lbl .mv[hidden]{display:block!important;visibility:hidden}
.total .lbl:has(.mv[hidden]) b{transform:translateY(calc(1.3 * var(--mv-fs) / 2))}
.total .lbl{--mv-fs:12px} /* the label font size; also used to centre a one-line label */
.total.arm .lbl b{color:var(--band-over)}
.st .warn{color:var(--band-warn)}
.st .pend{color:var(--on-band)}
.acts{display:flex;gap:6px;flex:none}
.btn{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(255,255,255,.38);background:transparent;color:#fff;border-radius:6px;padding:7px 12px;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap;position:relative}
.btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.btn:hover:not(:disabled):not([aria-disabled="true"]){background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.6)}
.btn.pri{background:#fff;color:var(--band);border-color:#fff;font-weight:700;padding-inline:16px}
.btn.pri:hover:not(:disabled):not([aria-disabled="true"]){background:var(--pri-hover)}
.btn.pri.dirty::after{content:"";position:absolute;top:-4px;right:-4px;width:10px;height:10px;border-radius:50%;background:var(--hi);box-shadow:0 0 0 2px var(--band)}
.btn.arm{border-color:var(--band-over);color:var(--band-over)}
.btn.pri.arm,.btn.pri.arm:hover{background:transparent}
.btn:disabled,.btn[aria-disabled="true"]{opacity:.35;cursor:not-allowed}
.views{display:flex;flex:none}
.views button{background:none;border:0;padding:4px 12px 6px 0;margin-right:12px;font-weight:700;font-size:15px;color:var(--band-muted);cursor:pointer;position:relative}
.views button[aria-selected="true"]{color:#fff}
.views button[aria-selected="true"]::after{content:"";position:absolute;left:0;right:12px;bottom:0;height:3px;background:var(--hi)}
.views .cnt{font-family:var(--f-num);font-weight:600;margin-left:5px;opacity:.8}
.search{position:relative;flex:0 1 240px;min-width:0}
.search input{width:100%;font:inherit;font-size:14px;padding:6px 10px 6px 30px;border:1px solid rgba(255,255,255,.25);border-radius:6px;background:rgba(255,255,255,.08);color:#fff}
.search input::placeholder{color:var(--band-muted)}
.search svg{position:absolute;left:9px;top:50%;transform:translateY(-50%);width:15px;height:15px;stroke:var(--band-muted);fill:none;stroke-width:2}
.pos5{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.pc-tab{min-width:0;border:0;background:rgba(255,255,255,.08);color:var(--band-muted);padding:5px 4px;cursor:pointer;transform:skewX(-10deg);font-size:13px}
.pc-tab>span{display:flex;align-items:baseline;justify-content:center;gap:8px;transform:skewX(10deg);white-space:nowrap}
.pc-tab .n{display:inline-flex;align-items:baseline}
.pc-tab .k{font-family:var(--f-num);font-weight:700;font-size:21px;line-height:1;color:#fff;font-variant-numeric:tabular-nums}
.pc-tab .t{font-family:var(--f-num);font-weight:600;font-size:14px;opacity:.75}
.pc-tab[aria-pressed="true"]{background:#fff;color:var(--band)}
.pc-tab[aria-pressed="true"] .k{color:var(--acc-ink-l)}
/* stats tab: the same counts, read-only (the ranking always covers the whole team) */
.pc-tab.ro{cursor:default;position:relative}
.show{flex:none;position:relative}
.show select{font:inherit;font-size:13px;color:#fff;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.25);border-radius:6px;padding:6px 26px 6px 10px;appearance:none;-webkit-appearance:none;cursor:pointer}
/* the native option list follows the page colour scheme, so its text must come from page tokens, not the white band text */
.show option{color:var(--text);background:var(--paper)}
.show::after{content:"";position:absolute;right:10px;top:50%;width:6px;height:6px;border-right:1.5px solid var(--band-muted);border-bottom:1.5px solid var(--band-muted);transform:translateY(-70%) rotate(45deg);pointer-events:none}
.top .bar{height:3px;background:rgba(255,255,255,.12)}
.top .bar i{display:block;height:100%;background:var(--hi);transition:width .2s}
@media (prefers-reduced-motion:reduce){.top .bar i{transition:none}}
@media (max-width:640px){
  .total{padding:4px 5px;gap:4px} /* 360px: sized for 移出 NN 人, the row must still end at the 16px gutter */
  .num{font-size:28px}.num small{font-size:13px}
  .total .lbl{--mv-fs:11.5px}.total .lbl b{font-size:12.5px}
  .total .md{display:none}
  .modehint,.mrow .st{font-size:12px}
  .st .st-long{display:none}
  .row .sp{display:none}
  .acts{gap:4px}
  .acts .btn .lb{display:none}
  .acts .btn{padding:7px 8px}
  .acts .btn.pri .lb{display:inline}
  .acts .btn.pri svg{display:none}
  .acts .btn.pri{padding-inline:10px}
  .search{flex:1 1 auto}
  .views button{font-size:14px;margin-right:6px;padding-right:6px}
  .views button[aria-selected="true"]::after{right:6px}
  .show select{padding:6px 22px 6px 8px}
  .search input{padding-left:28px}
  .pc-tab{padding:4px 2px}
  .pc-tab>span{flex-direction:column;align-items:center;gap:0}
  .pc-tab .l{font-size:12px;line-height:1.3}
  .pc-tab .k{font-size:19px}
  .pc-tab .t{font-size:12.5px}
}

/* groups + compact tiles */
main{padding-block:18px 40px}
section.grp{margin-bottom:22px;scroll-margin-top:calc(var(--hh,150px) + 10px)}
.gh{display:flex;align-items:baseline;gap:12px;margin:0 0 8px;border-bottom:1px solid var(--line);padding-bottom:6px}
.gh h2{margin:0;font-size:18px;font-weight:700;color:var(--ink)}
.gh h2::before{content:"";display:inline-block;width:4px;height:.9em;margin-right:8px;vertical-align:-.08em;background:var(--acc)}
.gh h2 .en{font-family:var(--f-num);font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin-right:8px}
.gh .k{font-size:13px;color:var(--muted)}
.gh .bulk{margin-left:auto;align-self:center;border:1px solid var(--line);background:var(--paper);color:var(--acc-ink);border-radius:4px;padding:3px 10px;font-size:13px;white-space:nowrap;cursor:pointer;flex:none}
.gh .bulk:hover:not([aria-disabled="true"]){border-color:var(--acc-ink)}
.gh .bulk[aria-disabled="true"]{opacity:.45;cursor:not-allowed}
.gh .k b{font-family:var(--f-num);font-size:17px;color:var(--acc-ink);font-weight:700}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px}
.tile{border:1px solid var(--line);border-radius:4px;padding:0;background:var(--paper);cursor:pointer;text-align:left;display:flex;flex-direction:column;overflow:hidden;min-width:0}
.tile .pic{position:relative;width:100%;aspect-ratio:1/1;background:var(--tile);overflow:hidden;display:flex;align-items:center;justify-content:center}
.tile .pic img{width:100%;height:100%;object-fit:cover;object-position:50% 10%;display:block}
.tile .pic::after{content:"";position:absolute;left:0;right:0;bottom:0;height:42%;background:linear-gradient(to top,rgba(var(--shade-rgb),.62),rgba(var(--shade-rgb),0));pointer-events:none}
.tile .pic.nopic::after{display:none}
.ph-no{font-family:var(--f-num);font-weight:700;font-size:34px;color:var(--muted)}
.tile .no{position:absolute;left:6px;bottom:1px;z-index:1;font-family:var(--f-num);font-weight:700;font-size:22px;line-height:1.1;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:.03em}
.tile .pic.nopic .no{display:none}
.tile .mk-tag{position:absolute;top:5px;left:5px;z-index:2;display:inline-flex;align-items:center;height:16px;padding:0 6px;font-family:var(--f-body);font-size:10px;font-weight:700;line-height:1;border-radius:4px;background:var(--acc);color:var(--on-acc);letter-spacing:.04em;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.tile .mk-tag.fa{background:var(--paper);color:var(--ink)}
/* One font and weight for every badge, so digits and 選秀 share a baseline and height. */
.tile .mk-tag.dy{background:rgba(0,0,0,.42);color:#fff;letter-spacing:0;box-shadow:none}
.tile .mk-tag.dy small{font:inherit;margin-left:1px}
.tile .mk-age{position:absolute;right:6px;bottom:3px;z-index:1;color:#fff;text-align:right;line-height:1.05;text-shadow:0 1px 2px rgba(0,0,0,.5);font-variant-numeric:tabular-nums}
.tile .mk-age b{font-family:var(--f-num);font-weight:700;font-size:17px}
.tile .mk-age small{font-size:9px;font-weight:500;margin-left:1px}
.tile .pic.nopic .mk-age{color:var(--muted);text-shadow:none}
.tile .tx{display:flex;flex-direction:column;min-width:0;padding:4px 7px 5px}
.tile .nm{font-size:15px;font-weight:500;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.35}
.tile .nmr{display:flex;align-items:center;gap:5px;min-width:0}
.tile .nmr .nm{min-width:0}
.tile .sub{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile .sub .sep{margin:0 .3em}
.tile .stat{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
/* sample-size tiers (roadmap P2-7): low .7 keeps >=3:1 on --paper in light and dark */
.tile .stat.low{opacity:.7}
.tile .stat.core{color:var(--text);font-weight:500}
.tile[aria-pressed="true"]{border-color:var(--acc);box-shadow:0 0 0 1px var(--acc)}
.tile[aria-pressed="true"] .tx{background:var(--acc)}
.tile[aria-pressed="true"] .nm{color:var(--on-acc)}
.tile[aria-pressed="true"] .sub,.tile[aria-pressed="true"] .stat{color:var(--on-acc);opacity:.8}
.tile[aria-pressed="true"] .stat.low{opacity:.65}
.tile[aria-pressed="true"] .stat.core{opacity:1}
/* tile wrapper: a button cannot contain a button */
.tw{position:relative;min-width:0;display:flex}
.tw>.tile{flex:1;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.info{position:absolute;top:5px;right:5px;z-index:3;width:22px;height:22px;border-radius:50%;border:2px solid rgba(255,255,255,.9);
  background:rgba(var(--shade-rgb),.35);color:#fff;display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
.info svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round}
.info::before{content:"";position:absolute;inset:-8px -6px -8px -8px}
.tw .big{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;transform:translateY(6px)}
.tw .big svg{width:58%;max-width:72px;aspect-ratio:1;fill:#fff;stroke:none;filter:drop-shadow(0 1px 3px rgba(0,0,0,.5))}
.tw.on .big{opacity:.78}
.tile[aria-pressed="true"] .pic::before{content:"";position:absolute;inset:0;z-index:1;background:var(--acc);opacity:.28;pointer-events:none}
.tile:not([aria-pressed="true"]):not([aria-disabled="true"]):hover{border-color:var(--acc)}
/* full at 60: unselected tiles stay focusable (aria-disabled), dimmed; a click explains the limit */
.tile[aria-disabled="true"]{cursor:not-allowed;opacity:.38}
.tile[aria-disabled="true"]:focus-visible{opacity:.7}
.empty{background:var(--paper);border:1px dashed var(--line);padding:36px 20px;text-align:center;color:var(--muted)}
.empty b{display:block;color:var(--ink);font-size:18px;margin-bottom:6px;font-weight:500}
@media (max-width:640px){
  .grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .tile .no{font-size:18px;left:4px}
  .tile .mk-age b{font-size:15px}
  .tile .mk-tag{top:4px;left:4px;height:15px;padding:0 4px;font-size:9px;letter-spacing:-.02em}
  .tile .mk-tag.dy small{margin-left:0}
  /* Narrow tiles: 3px text padding (.tx below) and proportional digits so 「二軍 ERA 12.96」 fits from 360px up. */
  .tile .stat{font-size:10px;font-variant-numeric:normal;letter-spacing:-.02em}
  .info{width:19px;height:19px;top:4px;right:4px}.info svg{width:10px;height:10px}
  .tile .tx{padding:3px 3px 4px}
  .tile .nm{font-size:13px}
  .tile .sub{font-size:10px;letter-spacing:-.05em}
  .tile .sub .sep{margin:0}
}
/* Very narrow phones: drop 選秀 so the year badge clears the ⓘ button (full text stays in title/aria). */
@media (max-width:374px){.tile .mk-tag.dy small{display:none}.tile .stat{font-size:9.5px}}

/* stats */
.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);border:1px solid var(--line);margin-bottom:20px}
.kpi{background:var(--paper);padding:14px 16px}
.kpi .v{font-family:var(--f-num);font-weight:700;font-size:38px;line-height:1;color:var(--ink);font-variant-numeric:tabular-nums}
.kpi .k{font-size:12px;color:var(--muted);margin-top:6px}
/* --cw fits "N/N" in the count font; --name-col widens when club decision pills (.cd) sit in the name column */
.rank{background:var(--paper);border:1px solid var(--line);--cw:calc(var(--cd,2)*12px + 7px);--name-col:minmax(110px,230px)}
.rank.club{--name-col:minmax(220px,290px)}
.rk{display:grid;grid-template-columns:34px 36px var(--name-col) 1fr calc(46px + var(--cw));gap:10px;align-items:center;padding:7px 14px;border-top:1px solid var(--line);font-size:14px}
.rank>.rk:first-child,#rankMid>.rk:first-child{border-top:0}
.rk .r{font-family:var(--f-num);font-weight:600;color:var(--muted);text-align:right;font-size:16px}
.rk .av{width:36px;height:36px;border-radius:50%;overflow:hidden;background:var(--tile);display:flex;align-items:center;justify-content:center;font-family:var(--f-num);font-weight:700;font-size:14px;color:var(--muted)}
.rk .av .ph-no{font-size:14px}
.rk .av img{width:100%;height:auto;display:block;align-self:flex-start}
.rk .nm{font-weight:500;color:var(--ink);min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rk .n2{display:inline-block;min-width:1.7em;text-align:right;font-family:var(--f-num);font-weight:700;color:var(--acc-ink);margin-right:6px}
.rk .nm small{font-weight:400;color:var(--muted);margin-left:6px;font-size:12px}
.rk .track{height:10px;background:var(--soft);position:relative}
.rk .track i{position:absolute;left:0;top:0;bottom:0;background:var(--acc)}
.rk .track::after{content:"";position:absolute;left:50%;top:-3px;bottom:-3px;border-left:1px dashed var(--muted);opacity:.6}
.rk .pc{display:grid;grid-template-columns:1fr var(--cw);column-gap:4px;align-items:baseline;font-family:var(--f-num);font-weight:700;font-size:19px;text-align:right;color:var(--ink)}
.rk .pc small{font-weight:500;color:var(--muted);font-size:13px}
.rk .nm::before{content:"●";visibility:hidden;color:var(--acc-ink);margin-right:5px;font-size:10px;vertical-align:2px} /* always reserved so names line up */
.rk.mine .nm::before{visibility:visible}
.rk.split .pc{color:var(--warn)}
.cut{padding:8px 14px;background:var(--band);box-shadow:inset 0 -3px 0 var(--acc);color:var(--on-band);font-size:12px;letter-spacing:.1em;font-weight:700;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.cut span{font-weight:400;letter-spacing:0;color:var(--band-muted)}
/* toggle between rank 20 and 21, styled as a ranking row */
.rank-more{display:block;width:100%;margin:0;padding:12px 14px;background:var(--soft);border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);border-radius:0;color:var(--acc-ink);font-size:15px;font-weight:700;letter-spacing:.02em;cursor:pointer;text-align:center;box-shadow:inset 0 3px 0 var(--acc)}
.rank-more:focus-visible{outline-offset:-2px}
.rank-more::after{content:"";display:inline-block;width:7px;height:7px;margin-left:10px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-3px) rotate(45deg)}
.rank-more[aria-expanded="true"]::after{transform:translateY(1px) rotate(-135deg)}
.rank-more:hover{background:color-mix(in srgb,var(--acc) 14%,var(--soft))}
.note{font-size:12px;color:var(--muted);margin:10px 0 0;text-align:center;display:flex;flex-direction:column;gap:2px}
.src{font-size:12px;color:var(--muted);margin-top:28px;border-top:1px solid var(--line);padding-top:12px}
.src a{color:var(--acc-ink)}
@media (max-width:640px){
  .kpi{padding:12px 10px}
  .kpi .v{font-size:30px}
  .rank{--cw:calc(var(--cd,2)*11px + 6px)}
  .rk{grid-template-columns:24px 32px 1fr calc(40px + var(--cw));padding:7px 10px;gap:8px}
  .rk .nm{white-space:normal;line-height:1.7} /* long names wrap instead of ellipsis */
  .rk .pc{font-size:17px;column-gap:3px}
  .rk .pc small{font-size:12px}
  .rk .av{width:32px;height:32px}
  .rk .track{grid-column:2 / -1;grid-row:2}
}

/* toast: team-band rounded bar with a kind icon, above content and the top bar (z 8), below the sheet (z 30).
   Desktop: centred under the top bar (--tt = top bar bottom + 10px, set by placeToast()). Phones: bottom centre. */
.toast{position:fixed;z-index:20;left:50%;transform:translateX(-50%);top:var(--tt,16px);width:max-content;max-width:min(460px,calc(100% - 32px));
  display:flex;align-items:center;gap:10px;background:var(--band);color:#fff;font:500 15px/1.45 var(--f-body);
  padding:10px 18px 10px 13px;border-radius:8px;box-shadow:0 10px 28px rgba(0,0,0,.30),0 0 0 1px rgba(255,255,255,.10) inset;
  pointer-events:none;animation:toast-down .2s ease-out}
.toast svg{width:20px;height:20px;flex:none;color:var(--hi);fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
@keyframes toast-down{from{opacity:0;transform:translate(-50%,-6px)}}
@keyframes toast-up{from{opacity:0;transform:translate(-50%,6px)}}
@media (max-width:640px){.toast{top:auto;bottom:calc(20px + env(safe-area-inset-bottom,0px));animation-name:toast-up}}
@media (prefers-reduced-motion:reduce){.toast{animation:none}}

/* sheet */
.sheet{position:fixed;inset:0;background:var(--scrim);z-index:30;display:flex;align-items:center;justify-content:center;padding:16px}
.sheet-in{background:var(--paper);width:100%;max-width:640px;max-height:100%;overflow:auto;padding:0 18px 18px;display:flex;flex-direction:column;gap:12px;border-radius:8px;box-shadow:0 12px 36px rgba(0,0,0,.35)}
.sheet-h{position:sticky;top:0;z-index:1;background:var(--paper);display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0 4px}
.sheet-x{flex:none;margin-left:auto;width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:none;border:0;border-radius:50%;color:var(--muted);cursor:pointer;padding:0}
.sheet-x:hover{background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink)}
.sheet-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
#sheetBody{display:flex;flex-direction:column;gap:12px}
.shot{width:100%;height:auto;border:1px solid var(--line)}
.sheet-a{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.sheet-a .btn{background:var(--acc);color:var(--on-acc);border-color:var(--acc)}
/* beats the band .btn:hover (white wash): stays on the accent, fill shifts away from the text colour (--acc-hover) */
.sheet-a .btn:hover:not(:disabled):not([aria-disabled="true"]){background:var(--acc-hover);border-color:var(--acc);text-decoration:underline;text-underline-offset:3px}
.hint{font-size:12.5px;color:var(--muted);margin:0}
.ta{width:100%;min-height:260px;font:inherit;font-size:13px;line-height:1.6;padding:10px;border:1px solid var(--line);background:var(--page);color:var(--text);resize:vertical}

/* detail dialog */
.detail{position:fixed;inset:0;z-index:30;background:var(--scrim);display:flex;align-items:center;justify-content:center;padding:16px}
.detail-in{position:relative;background:var(--paper);width:min(300px,100%);max-height:100%;overflow:auto;border-radius:8px;
  padding:0 0 14px;display:flex;flex-direction:column;align-items:center;gap:8px;box-shadow:0 12px 36px rgba(0,0,0,.35)}
.detail .hd{position:relative;align-self:stretch;flex:none;overflow:hidden;display:flex;align-items:flex-end;gap:12px;padding:14px;
  background:repeating-linear-gradient(135deg,rgba(255,255,255,.06) 0 2px,transparent 2px 9px),linear-gradient(160deg,var(--band),color-mix(in srgb,var(--band) 70%,var(--acc)));
  border-bottom:3px solid var(--acc)}
.detail .wm{position:absolute;right:10px;bottom:-12px;font-family:var(--f-num);font-weight:700;font-size:64px;line-height:1;color:rgba(255,255,255,.13);letter-spacing:.02em}
.detail .av{position:relative;z-index:1;width:72px;height:72px;flex:none;border-radius:50%;overflow:hidden;background:var(--tile);display:flex;align-items:center;justify-content:center;
  border:2px solid rgba(255,255,255,.9);box-shadow:0 0 0 2px var(--acc)}
.detail .av img{width:100%;height:100%;object-fit:cover;object-position:50% 10%}
.detail .hc{position:relative;z-index:1;display:flex;flex-direction:column;gap:4px;min-width:0}
.detail .tm{font-family:var(--f-num);font-weight:700;font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--band-muted);padding-right:30px}
.detail h3{margin:0;font-size:18px;font-weight:700;color:#fff;line-height:1.3}
.detail h3 .n{font-family:var(--f-num);font-size:20px;color:var(--hi);margin-right:2px} /* + the space text node (for the accessible name) = the 6px gap */
.detail h3.long{font-size:15px}.detail h3.long .n{font-size:17px;margin-right:3px}
.detail .meta{display:flex;flex-wrap:wrap;gap:4px;font-size:11.5px;margin:0;padding:0;list-style:none}
.detail .meta li{border-radius:4px;white-space:nowrap;padding:1px 7px;background:rgba(255,255,255,.14);color:#fff}
.detail .meta li.k{background:var(--acc);color:var(--on-acc);font-weight:500}
.detail .meta li.tg{background:none;border:1px solid rgba(255,255,255,.7);color:#fff}
.detail-x{position:absolute;top:6px;right:6px;z-index:2;width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:none;border:0;border-radius:50%;color:rgba(255,255,255,.85);cursor:pointer;padding:0}
.detail-x:hover{background:rgba(255,255,255,.15);color:#fff}
.detail-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.detail .bd{align-self:stretch;padding:2px 18px 0;display:flex;flex-direction:column;align-items:center;gap:8px}
.detail .sec{align-self:stretch;display:flex;align-items:center;gap:8px;margin-top:2px;font-family:var(--f-num);font-weight:700;font-size:11px;letter-spacing:.16em;color:var(--muted)}
.detail .sec::before,.detail .sec::after{content:"";flex:1;height:1px;background:var(--line)}
.detail table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
.detail th,.detail td{padding:4px 8px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
.detail tbody tr:last-child>*{border-bottom:0}
.detail th:first-child{text-align:left;color:var(--muted);font-size:12.5px;font-weight:400;padding-left:2px}
.detail thead th{color:var(--muted);font-size:12px;font-weight:500;border-bottom:2px solid var(--acc)}
.detail td{font-family:var(--f-num);font-weight:600;font-size:15px;color:var(--text)}
.detail td.shown{background:color-mix(in srgb,var(--acc) 10%,transparent);color:var(--ink);font-weight:700}
.detail thead th.shown{background:color-mix(in srgb,var(--acc) 10%,transparent);color:var(--acc-ink);font-weight:700}
.detail .none{font-size:14px;color:var(--muted);margin:4px 0}
.detail .tier{font-size:11.5px;color:var(--muted);text-align:center;margin:0}
.detail .ext{align-self:stretch;display:flex;align-items:center;justify-content:center;gap:6px;margin-top:2px;padding:7px 12px;border:1px solid var(--acc-ink);border-radius:6px;
  color:var(--acc-ink);font-size:13px;font-weight:500;text-decoration:none}
.detail .ext:hover{background:var(--soft)}
.detail .ext svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.detail-x:focus:not(:focus-visible){outline:0}

/* team picker + team switch */
.herotools{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.teamsw{position:relative;display:inline-flex;align-items:center;gap:6px}
.themebtn{margin-left:auto;width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;padding:0;color:var(--on-band);background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.3);border-radius:6px;cursor:pointer}
.themebtn:hover{background:rgba(255,255,255,.2)}
.themebtn:focus-visible{outline:2px solid var(--on-band);outline-offset:2px}
.themebtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.teamsw button{font:inherit;font-size:13px;font-weight:500;line-height:1.55;color:var(--on-band);background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.3);border-radius:6px;padding:5px 28px 5px 10px;cursor:pointer;white-space:nowrap}
.teamsw button:hover{background:rgba(255,255,255,.2)}
.teamsw button:focus-visible{outline:2px solid var(--on-band);outline-offset:2px}
.teamsw::after{content:"";position:absolute;right:11px;top:50%;width:6px;height:6px;border-right:1.5px solid var(--band-muted);border-bottom:1.5px solid var(--band-muted);transform:translateY(-70%) rotate(45deg);pointer-events:none}
.teamsw.open::after{transform:translateY(-25%) rotate(-135deg)}
/* popup list: absolute in the document (scrolls with the hero), above the sticky top bar (8), below the toast (20) */
.teammenu{position:absolute;z-index:15;min-width:150px;padding:4px 0;background:var(--paper);border:1px solid var(--line);border-radius:6px;box-shadow:0 10px 28px rgba(var(--shade-rgb),.28)}
.teammenu a{display:flex;align-items:center;gap:8px;padding:7px 14px 7px 10px;color:var(--text);text-decoration:none;font-size:14px;white-space:nowrap}
.teammenu a::before{content:"✓";width:1em;flex:none;text-align:center;color:var(--acc-ink);font-weight:700;visibility:hidden}
.teammenu a[aria-checked="true"]{color:var(--ink);font-weight:700}
.teammenu a[aria-checked="true"]::before{visibility:visible}
.teammenu a:hover,.teammenu a:focus{background:var(--soft);outline:0}
.teammenu a:focus-visible{outline:2px solid var(--acc-ink);outline-offset:-2px}
.picker{padding-block:28px 60px}
/* D3 section rule, as .ans h2 */
.picker h2{margin:0 0 16px;display:flex;align-items:center;gap:12px;font-size:16px;font-weight:700;letter-spacing:.06em;color:var(--ink)}
.picker h2::before,.picker h2::after{content:"";flex:1;height:1px;background:var(--line)}
.tgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}
/* plain team colour + the nickname as a watermark sized to the card width (container query units) */
.tcard{position:relative;container-type:inline-size;display:flex;flex-direction:column;justify-content:center;gap:4px;padding:18px 18px 16px;color:#fff;text-decoration:none;border-radius:8px;overflow:hidden;min-height:96px}
.tcard>*{position:relative;z-index:1}
.tcard b{font-size:22px;font-weight:700}
.tcard span{font-family:var(--f-num);font-weight:600;letter-spacing:.12em;text-transform:uppercase;font-size:12px;opacity:.8}
.tcard .wm{position:absolute;z-index:0;right:10px;bottom:4px;line-height:.8;font-family:var(--f-num);font-weight:700;font-style:normal;font-size:clamp(40px,21cqi,76px);letter-spacing:.02em;opacity:.14;white-space:nowrap;pointer-events:none}
@media (max-width:640px){.tcard{min-height:78px;padding:14px 16px 13px;gap:2px}.tcard b{font-size:20px}.tcard .wm{font-size:clamp(40px,19cqi,68px)}}
.tcard:hover{filter:brightness(1.08)}
.tcard:focus-visible{outline:3px solid var(--text);outline-offset:2px}
a.btn{text-decoration:none}
/* official-list answer key (P1-3) */
.hero .hero-off{margin-top:10px;font-weight:500;color:var(--on-band);border-left:3px solid var(--hi);padding-left:10px}
.cd{flex:none;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;line-height:1;white-space:nowrap}
.cd.keep{background:var(--ink);color:var(--page)}
.cd.drop{background:var(--paper);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--ink)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.rk .cd{height:18px;padding:0 6px;border-radius:4px;margin-left:6px;vertical-align:1px;font-size:11px}
.ans{background:var(--paper);border:1px solid var(--line);padding:14px 16px 16px;margin-bottom:20px}
/* D3 section rule: ── title ── with the sub line centred below */
.ans-h{display:flex;flex-direction:column;gap:2px;text-align:center}
.ans h2{margin:0;display:flex;align-items:center;gap:12px;font-size:16px;font-weight:700;letter-spacing:.06em;color:var(--ink)}
.ans h2::before,.ans h2::after{content:"";flex:1;height:1px;background:var(--line)}
.ans-h span,.ans .hint{font-size:12.5px;color:var(--muted)}
.hit{display:flex;justify-content:center;gap:6px 28px;flex-wrap:wrap;margin:10px 0 4px}
.hit .big{font-size:15px;color:var(--text)}
.hit .big b{font-family:var(--f-num);font-weight:700;font-size:40px;line-height:1;color:var(--ink);font-variant-numeric:tabular-nums;vertical-align:-3px}
.hit .big small{font-family:var(--f-num);font-weight:600;font-size:20px;color:var(--muted)}
.ags,.dcs{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:12px}
.ag b,.dc h3{display:block;font-size:13px;font-weight:700;color:var(--ink);margin:0 0 4px}
.ag.none span{font-size:12.5px;color:var(--muted)}
.pl{display:flex;flex-wrap:wrap;gap:4px}
.pi{font-size:13px;background:var(--soft);padding:1px 7px 1px 5px;border-radius:4px;color:var(--ink);white-space:nowrap}
.pi b,.dc .n2{font-family:var(--f-num);font-weight:700;color:var(--acc-ink);margin-right:4px;display:inline;font-size:13px}
.dc .n2{display:inline-block;min-width:1.8em;text-align:right;margin-right:6px}
.pi small,.dc small{font-family:var(--f-num);font-weight:600;color:var(--muted);margin-left:5px;font-size:12px}
.dc ol{margin:0;padding:0;list-style:none;font-size:13.5px}
.dc li{display:flex;align-items:baseline;padding:2px 0;border-top:1px solid var(--line)}
.dc li:first-child{border-top:0}
.dc li small{margin-left:auto}
.dc li.hot{font-weight:500}
.dc li.hot small{color:var(--warn);font-weight:700} /* upsets: the most extreme 3 per column */
.dc .hint{margin:2px 0 0}
.ans>.hint{margin:10px 0 0}
@media (max-width:640px){.ags,.dcs{grid-template-columns:1fr}.hit .big b{font-size:34px}.ans{padding-inline:12px}.rank.club .rk .nm small{display:none}}
