/* Screen-specific styles. */

/* ---------- This week: dashboard strip ---------- */
.dash { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dash-tile { background: var(--surface); padding: 16px 18px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.dash-lbl, .dash-tile h3 { margin: 0; font-size: var(--fs-label); font-weight: 600; color: var(--faint); letter-spacing: var(--ls-label); text-transform: uppercase; }
.dash-big { display: flex; align-items: baseline; gap: 6px; }
.dash-big b { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.dash-big span { color: var(--muted); font-size: var(--fs-sm); }
.dash-sub { font-size: var(--fs-xs); color: var(--muted); }
.dash-rank { display: grid; gap: 8px; }
.dash-caps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dash-cap {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(40px, 1fr) 42px; gap: 10px; align-items: center;
  padding: 6px 8px; border-radius: var(--r-sm); box-shadow: inset 3px 0 0 var(--club, var(--line-strong)); transition: background var(--t-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) { .dash-cap:hover { background: var(--raised); } }
.dash-cap:focus-visible { outline: 2px solid var(--focus); }
.dc-name { display: flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-fx { display: inline-flex; gap: 2px; }
.dc-bar { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.dc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.is-cap .dc-bar i { background: var(--hi); }
.dash-cap > b { text-align: right; font-family: var(--display); font-size: 22px; font-weight: 700; }
.badge.inline { position: static; width: 18px; height: 18px; font-size: 11px; box-shadow: none; flex: none; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-caps { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .dash-tile { padding: 14px; }
  .dash-big b { font-size: 36px; }
  .dash-cap { grid-template-columns: minmax(0, 1fr) auto 38px; }
  .dc-bar { display: none; }
}

/* ---------- player detail ---------- */
#dlg:has(.phead) { width: min(680px, calc(100vw - 32px)); }

/* At 640px and below every dialog becomes a full-width bottom sheet (components.css). This ID rule outranks that one, so
   without this the player sheet stayed 32px narrow and, with margin auto 0 0, sat against the left edge. */
@media (max-width: 640px) { #dlg:has(.phead) { width: 100vw; } }
.phead { padding-right: 36px; }
.ph-main { display: grid; gap: 4px; min-width: 0; }
.ph-club { font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.phead h2 { font-size: var(--fs-2xl); letter-spacing: -.025em; }
.ph-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.ph-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ph-stats .stat { background: var(--sunk); padding: 10px 12px; }
.ph-stats .stat-sub { white-space: normal; }
.ph-sec { display: grid; gap: 8px; }
.ph-sec h3 { font-size: var(--fs-md); }
.ph-sec h3.ph-sub { margin-top: 14px; }
.ptsbars { position: relative; display: flex; gap: 4px; align-items: stretch; height: 132px; }
.ptsbars > div { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.ptsbars b { font-size: var(--fs-xs); font-weight: 650; }
.ptsbars i { display: block; width: min(100%, 40px); background: var(--accent); border-radius: 3px 3px 0 0; }
.ptsbars i.haul { background: var(--good); }
.ptsbars i.blank { background: var(--line-strong); }
.ptsbars > div > span { font-size: 11px; color: var(--muted); height: 14px; }
.pb-avg { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--faint); pointer-events: none; }
.pb-avg span { position: absolute; left: 0; top: -8px; font-size: 11px; line-height: 16px; color: var(--muted); background: var(--surface); padding-right: 6px; }

/* the next gameweek at a glance (player-sheet.js outlook): likely range band with the xP marked, then three chances */
.orange { position: relative; height: 54px; margin: 22px 6px 2px; }
.orange::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--line-strong); border-radius: 2px; }
.or-band { position: absolute; top: 8px; height: 14px; border-radius: 7px; background: var(--accent-soft); border: 1px solid var(--accent-text); }
.or-xp { position: absolute; top: 2px; width: 2px; height: 26px; margin-left: -1px; background: var(--fg); border-radius: 1px; }
.or-xp b { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: var(--fs-xs); }
.or-tick { position: absolute; top: 34px; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.ocs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.oc { position: relative; display: grid; gap: 2px; padding: 8px 10px 12px; overflow: hidden; background: var(--sunk); border-radius: var(--r-sm); font-size: var(--fs-xs); color: var(--muted); }
.oc b { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; color: var(--fg); }
.oc i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--w); background: var(--accent); }
.upnext { list-style: none; margin: 0; padding: 0; display: grid; }
.upnext li { display: grid; grid-template-columns: 46px auto minmax(0, 1fr) minmax(40px, 90px) 34px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.upnext li:last-child { border-bottom: 0; }
.un-gw { color: var(--muted); }
.un-fx { display: inline-flex; gap: 3px; }
.un-opp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.un-bar { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.un-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.upnext b { text-align: right; }
.price-move { display: grid; gap: 6px; }
.pm-top { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.pm-track { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.pm-track i { display: block; height: 100%; background: var(--good); border-radius: 4px; }
.pm-track.neg i { background: var(--bad); }
.brk div > span { display: block; }
.ph-acts { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--line); padding-block-start: 14px; }

@media (max-width: 560px) {
  .ph-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upnext li { grid-template-columns: 44px auto minmax(0, 1fr) 30px; }
  .un-bar { display: none; }
  .phead h2 { font-size: var(--fs-xl); }
  .photo { width: 56px; height: 72px; }
}

/* ---------- player explorer ---------- */
.explorer .filters { margin-bottom: 10px; }
.explorer .tablebox { margin-top: 4px; }
.sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); }
th.sticky-col { z-index: 3; background: var(--raised); }

@media (hover: hover) and (pointer: fine) { tbody tr:hover .sticky-col { background: var(--raised); } }
tr.mine td.sticky-col { box-shadow: inset 3px 0 0 var(--hi-text); }
.pcell { display: flex; align-items: center; gap: 8px; }
.pcell input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* FL-197: the compare checkbox's <label> is a 24 x 24px click area (WCAG 2.5.8). The negative margins give back the
   extra 9px across and 3.5px down, so the name column and the row height are the same as with the bare 15px box.
   On touch screens the FL-124 rule below makes it 40 x 40px. */
.cmp-hit { display: grid; flex: none; place-items: center; width: 24px; height: 24px; margin: -1.75px -4.5px; cursor: pointer; }
.linkish { all: unset; cursor: pointer; }

@media (hover: hover) and (pointer: fine) { .linkish:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; } }
.linkish:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.colpick { position: relative; margin: 0 0 0 auto; }
.colpick summary { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); }
.colpick-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 270px;
  display: grid; gap: 2px; padding: 10px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow);
}
.colpick-body label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; font-size: var(--fs-sm); cursor: pointer; }

@media (hover: hover) and (pointer: fine) { .colpick-body label:hover { background: var(--sunk); } }
.colpick-body input { accent-color: var(--accent); }
.colpick-body .btn { justify-self: start; margin-top: 6px; }

/* FL-156: column order (move buttons beside each shown column), saved views and table density */
.cp-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cp-row label { flex: 1; min-width: 0; }
.cp-mv { display: inline-flex; gap: 2px; }
.cp-mv .btn { margin: 0; padding: 2px 8px; min-width: 30px; }
.pv-bar { align-items: center; }
.pv-lbl { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.pv-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pv-form input { width: 180px; max-width: 100%; }
.pv-dens { margin-left: auto; display: none; }
.pv-msg { margin: 0 0 6px; }

/* presets: buttons from 641px, one menu on phones (inside the Filters panel) */
.preset-sel { display: none; }
.preset-ask { margin: 0 0 8px; }

@media (max-width: 640px) {
  .preset-btn { display: none; }
  .preset-sel { display: inline-flex; flex: 1 1 160px; }
}

/* the one toolbar row, the Filters panel, and the chips that show filters while the panel is shut */
.pl-tools { gap: 6px; }
.pl-tools input[type="search"] { flex: 1 1 110px; max-width: 170px; }
.pl-tact-mob { display: none; }
.nailed-pill.good { background: var(--sunk); color: var(--muted); border: 1px solid var(--line); }

@media (max-width: 1440px) and (min-width: 641px) {
  .pl-tools { gap: 4px; }
  .pl-tools input[type="search"] { flex: 1 1 96px; max-width: 120px; padding: 5px 7px; font-size: var(--fs-xs); }
  .pl-tools .btn, .pl-tools .seg button, .pl-tools .colpick summary { padding: 5px 7px; font-size: var(--fs-xs); }
  .explorer .pcell .ptags > :nth-child(n+2) { display: none; }
}
.pl-fbtn { display: inline-flex; align-items: center; gap: 6px; }
.pl-fbtn .ic { width: 16px; height: 16px; }
.pl-fbtn[aria-expanded="true"] { border-color: var(--accent-text); color: var(--accent-text); }
.pl-fpanel { margin: 0 0 10px; padding: 12px 12px 2px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); }
.pl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 10px; }
.pl-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border: 1px solid var(--accent-text); border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.pl-chip span { font-size: 15px; line-height: 1; }
.pl-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* xP over the period: one square per gameweek before the total, the xP table's heat scale */
.xrun { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.xrun-sq { display: inline-flex; gap: 2px; }
.xrun-sq i { width: 7px; height: 14px; border-radius: 2px; border: 1px solid var(--line-strong); }
.xrun-sq .h0 { background: var(--heat-0); }
.xrun-sq .h1 { background: var(--heat-1); }
.xrun-sq .h2 { background: var(--heat-2); }
.xrun-sq .h3 { background: var(--heat-3); }
.xrun-sq .h4 { background: var(--heat-4); }
.xrun-sq .h5 { background: var(--heat-5); }
.xrun-sq .hb { background: none; }
.xrun-sq .hn { background: none; border-style: dashed; }

/* FL-156: player details beside the table, from 1280px wide (players.js SIDE_MIN) */
.pl-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pl-side { position: sticky; top: 108px; max-height: calc(100vh - 124px); overflow: auto; padding: 16px; }
.pl-side .bar { margin-bottom: 4px; }
.pl-side h3 { font-size: var(--fs-lg); }
.pls-stats { grid-template-columns: 1fr 1fr; }
.pls-h { margin: 14px 0 6px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.pls-fx { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pls-fx li { display: flex; align-items: center; gap: 8px; }
.pls-fx li b { margin-left: auto; }
.pls-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 0; }
.pls-kv div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 3px 0; }
.pls-kv dt { color: var(--muted); font-size: var(--fs-sm); }
.pls-kv dd { margin: 0; font-weight: 600; }
.pls-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
tr.sel td { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
tr.sel td.sticky-col { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

@media (max-width: 1279px) {
  .pl-split { display: block; }
  .pl-side { display: none; }
}

.pv-manage { position: relative; }
.pv-manage summary { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); cursor: pointer; }
.pv-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 10; display: grid; gap: 6px; padding: 10px; min-width: 180px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow);
}

@media (min-width: 768px) {
  .pv-dens { display: inline-flex; }
  .explorer.dens-comfy th, .explorer.dens-comfy td { padding-top: 13px; padding-bottom: 13px; }
  .explorer.dens-comfy table { font-size: var(--fs-md); }
}

@media (max-width: 640px) {
  .explorer .filters select { flex: 1 1 140px; }
  .explorer .pv-bar { display: none; }
  .pl-tools > .pl-tact { display: none; }
  .pl-tact-mob { display: flex; }
  .pl-tools input[type="search"] { max-width: none; flex: 1 1 100%; }

  /* Phones: the Columns button can sit anywhere along a wrapped filter row, so a 220px popover hung off the button ran
     off the right edge and made the whole page scroll sideways. Hang it off the filter row instead, full width. */
  .explorer .filters { position: relative; }
  .colpick { position: static; margin-left: 0; }
  .colpick-body { left: 0; right: 0; top: calc(100% + 6px); width: auto; grid-template-columns: 1fr; }   /* one column: room for the move buttons (FL-156) */
  .colpick-body .btn { grid-column: 1 / -1; }
  .explorer { padding: 14px; }

  /* The fixed Player column must leave room for the stats beside it. Its tags (Pens, Hot, a flag) used to widen it to
     the whole table box at 320px (257px in a 256px box), so scrolling sideways showed no stat at all and the column
     couldn't stay pinned. Cap it at about half the screen and let the tags wrap under the name. */
  .explorer td.sticky-col { white-space: normal; }
  .explorer .pcell { flex-wrap: wrap; row-gap: 4px; max-width: min(200px, 52vw); }
  .explorer .pcell .ptags { margin-left: 0; }
  .explorer .pcell .cmp-hit { position: relative; z-index: 1; }   /* its 40px touch area overhangs the wrapped tags (not tappable) */
}

/* ---------- fixtures ---------- */
.fx-controls { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.fx-help { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fx-help .note { flex: 1 1 360px; }
.fixtures .tablebox { max-height: none; }

/* .linkish (all: unset) is later in the cascade than components.css's .fx-club, so the club button fell back to inline
   and its badge sat above the name's baseline; two classes win it back */
.linkish.fx-club { display: inline-flex; align-items: center; gap: 8px; }
.fx-short { display: none; }

/* phones: the two option groups wrap into equal tiles instead of scrolling sideways with labels cut in half */
@media (max-width: 640px) {
  .fx-controls { width: 100%; }
  .fx-controls .seg { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); width: 100%; overflow: visible; }
  .fx-controls .seg:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* the four views: an even 2 x 2 */
  .fx-controls .seg button { white-space: nowrap; }
}
.fdr.cellchip { display: flex; width: 100%; min-width: 62px; padding: 6px 4px; font-size: var(--fs-sm); }
.fdr.cellchip + .fdr.cellchip { margin-top: 2px; }
.fdr.blank.cellchip, .fxc > .fdr.blank { display: flex; padding: 6px 4px; min-width: 62px; }

/* FL-193: below 640px show crest + 3-letter short name in the sticky column so ~4 GW columns fit on phones; 640px+ unchanged */
@media (max-width: 639px) {
  .fx-full { display: none; }
  .fx-short { display: inline; font-weight: 600; letter-spacing: .02em; }
  .linkish.fx-club { gap: 5px; }
  .fixtures td.sticky-col, .fixtures th.sticky-col { padding-left: 6px; padding-right: 6px; }
  .fixtures .fdr.cellchip, .fixtures .fdr.blank.cellchip, .fixtures .fxc > .fdr.blank { min-width: 56px; }
}

/* ---------- mini-league ---------- */
.league td { vertical-align: middle; }
.lg-rank { display: inline-grid; grid-template-columns: auto 30px; gap: 6px; place-items: baseline end; }
.mv { font-size: var(--fs-xs); font-weight: 600; justify-self: start; }
.mv.same { color: var(--faint); }
.lg-team { font-size: var(--fs-xs); }
td.lg-best { color: var(--good); font-weight: 700; }
tr.is-rival td { background: var(--accent-soft); }

/* ---------- AFG suggestion ---------- */
.afg-hero p { max-width: 75ch; }
.afg-open { margin: 10px 0 0; }
.afg-why { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.afg-why li { display: grid; gap: 1px; font-size: var(--fs-sm); padding-left: 10px; border-left: 2px solid var(--line); }
.afg-k { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.afg-k b.up { color: var(--good); }
.afg-k b.down { color: var(--bad); }
.afg-t { color: var(--fg); }
.afg-why.compact li { font-size: var(--fs-xs); }
.afg-row { border-top: 1px solid var(--line); }
.afg-row:first-of-type { border-top: 0; }
.afg-row > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px;
  align-items: center; padding: 9px 2px;
  width: auto; color: var(--fg); font-size: var(--fs-md); font-weight: 400; border-radius: var(--r-sm);
}
.afg-row > summary::before { display: none; }

@media (hover: hover) and (pointer: fine) { .afg-row > summary:hover { background: var(--raised); } }
.afg-row > summary::-webkit-details-marker { display: none; }
.afg-row > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.afg-row[open] { padding-bottom: 10px; }
.afg-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.afg-name .pname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afg-fx { display: inline-flex; gap: 2px; flex: none; }
.afg-nums { white-space: nowrap; font-variant-numeric: tabular-nums; }
.afg-d.up { color: var(--good); }
.afg-d.down { color: var(--bad); }
.afg-sub { grid-column: 1 / 3; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afg-row[open] .afg-sub { display: none; }
.afg-v { font-size: var(--fs-lg); font-weight: 500; }
.sg-gain.up { color: var(--good); }

/* ---------- This week: hero (a pitch panel; the turf is dark green in both themes) ---------- */
.hero {
  --focus: var(--armband); /* These turf surfaces stay dark in both themes. */

  position: relative; display: grid; gap: 12px; justify-items: start; overflow: hidden; isolation: isolate;
  padding: 26px 20px 20px; border-radius: 16px; color: var(--on-turf);
  background:
    radial-gradient(120% 90% at 85% -10%, var(--hero-glow), transparent 55%),
    repeating-linear-gradient(90deg, var(--turf) 0 56px, var(--turf-2) 56px 112px);
}
.hero::before, .hero::after { content: ""; position: absolute; pointer-events: none; z-index: -1; }
.hero::before { width: 220px; height: 220px; right: -90px; top: 50%; margin-top: -110px; border: 1.5px solid var(--on-turf-line); border-radius: 50%; }
.hero::after { top: 0; bottom: 0; right: 20px; width: 0; border-left: 1.5px solid var(--on-turf-line); }
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--on-turf-muted); }
.eyebrow em { font-style: normal; color: var(--armband); }
.hero h1 { font-family: var(--display); font-size: 60px; font-weight: 700; line-height: .98; letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; max-width: 20ch; color: var(--on-turf); }
.hero h1 .cap { color: var(--armband); }
.hero-why { margin: 0; max-width: 60ch; font-size: 15px; color: var(--on-turf-muted); }
.hero-why b { color: var(--on-turf); }
.hero-verdicts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 4px; }
.hero-verdicts > span { display: inline-flex; align-items: center; gap: 8px; }
.hv-l { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--on-turf-muted); }
.hero .pill { background: var(--on-turf-glass); color: var(--on-turf); gap: 6px; }
.hero .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--on-turf-muted); }
.hero .pill.good::before { background: var(--on-turf-good); }
.hero .pill.warn::before { background: var(--on-turf-warn); }
.hero .pill.bad::before { background: var(--on-turf-bad); }

@media (max-width: 520px) {
  .hero { padding: 22px 16px 16px; }
  .hero h1 { font-size: 44px; }
}

/* ---------- club colour accents (thin edges and dots, never a fill) ---------- */
.club-dot { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; background: var(--club, var(--line-strong)); box-shadow: 0 0 0 1px var(--line-strong); vertical-align: -0.5px; }

/* ---------- motion: entrance, once per page load (transform and opacity only; all off for reduced motion) ---------- */
@keyframes rise-intro { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@keyframes nudge { 0% { transform: translateY(0); } 40% { transform: translateY(-4px); } 100% { transform: translateY(0); } }

@keyframes pulse-fade { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .hero.intro > * { animation: rise-intro 320ms var(--ease) both; }
  .hero.intro > :nth-child(2) { animation-delay: 50ms; }
  .hero.intro > :nth-child(3) { animation-delay: 100ms; }
  .hero.intro > :nth-child(4) { animation-delay: 150ms; }
  .dash.intro .dc-bar i { transform-origin: left; animation: grow 500ms var(--ease) 200ms both; }
  .stat-sub .nudge { display: inline-block; animation: nudge 500ms var(--ease) 300ms 1; }
  .stat.deadline.soon #cd { animation: pulse-fade 2.4s ease-in-out infinite; }
  .move.flash { position: relative; }
  .move.flash::after { content: ""; position: absolute; inset: -3px -6px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--accent) 30%, transparent); pointer-events: none; animation: flash 900ms ease-out both; }
}

/* ---------- xP table (views/xptable.js) ---------- */
.xptable th small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.xptable th.xnext { color: var(--accent-text); }
.xptable th .btn.xs { margin-left: 6px; padding: 1px 6px; font-size: 11px; min-height: 0; }

@media (pointer: coarse) {
  .xptable th .btn.xs { min-width: 40px; min-height: 40px; padding: 0 8px; margin-left: 2px; }
}
.xptable .xplayer { display: flex; align-items: center; gap: 8px; }
.xptable .xplayer .shirt { width: 26px; height: auto; flex: none; }
.xptable .xwho { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.xptable .xname { display: flex; align-items: center; gap: 6px; }
.xptable .xmeta { font-size: var(--fs-xs); }
.xptable .xpos { border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; font-size: 11px; font-weight: 600; }
.xptable .xstar { background: none; border: 0; padding: 0 2px; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.xptable .xstar[aria-pressed="true"] { color: var(--hi-text); }
.xptable td.xc { padding: 5px 8px; text-align: center; min-width: 66px; }
.xptable td.xc .xfx { display: flex; gap: 2px; justify-content: center; align-items: center; }
.xptable td.xc .xv { display: block; font-size: var(--fs-md); font-variant-numeric: tabular-nums; margin-top: 3px; color: var(--fg); }
.xptable td.xc .xv.asm { color: var(--fg); font-style: italic; text-decoration: underline dotted; text-underline-offset: 3px; } /* muted grey fails AA on the darker heat steps */
.xptable .xdgw { font-size: 11px; font-weight: 700; color: var(--info); }
.xptable td.h0 { background: var(--heat-0); }
.xptable td.h1 { background: var(--heat-1); }
.xptable td.h2 { background: var(--heat-2); }
.xptable td.h3 { background: var(--heat-3); }
.xptable td.h4 { background: var(--heat-4); }
.xptable td.h5 { background: var(--heat-5); }
.xptable td.xnext { box-shadow: inset 0 0 0 1px var(--accent); }

/* outside the counted horizon: a faint hatch over the cell and an italic header. Was opacity .7, which took the
   fixture chips and the header to 2.3-3.7:1 (FL-123). */
.xptable th.xout { font-style: italic; }
.xptable td.xout { background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--hatch) 6px 7px); }
.xptable td.xlive { color: var(--muted); background: var(--sunk); text-align: center; }
.xptable td.xlive .xlive-pts { display: block; color: var(--fg); font-weight: 600; }
.xptable th.xlive-off, .xptable td.xlive-off { padding: 0 4px; background: var(--sunk); }
.xptable td.xsum { white-space: nowrap; }
.xptable .xprice { display: none; }
.xptable .xbar { display: inline-block; height: 4px; border-radius: 2px; background: var(--accent); vertical-align: middle; margin-right: 8px; }

@media (max-width: 639px) {
  /* FL-193: keep the sticky Player column compact below 640px so ~4 GW columns fit on phones; 640px+ unchanged */
  .xptable td.sticky-col, .xptable th.sticky-col { padding-left: 8px; padding-right: 6px; }
  .xptable .xwho { max-width: 108px; }
  .xptable .xname { gap: 2px; flex-wrap: wrap; }
  .xptable .xname .pname { white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 560px) {
  /* phones: price moves under the name; £ and xP/£m columns hidden so the gameweeks get the width */
  .xptable .xplayer .shirt, .xptable .xpos, .xptable .xwide { display: none; }
  .xptable .xprice { display: inline; }
  .xptable th.xlive-off, .xptable td.xlive-off { padding: 0 2px; }
  .xptable td.xc { min-width: 54px; padding: 4px 5px; }
  .xptable td.xc .xv { font-size: var(--fs-sm); }
  .xptable .xbar { display: none; }
}

/* ---------- Planner view tabs (views/planner-views.js) ---------- */
.pvhead { display: grid; gap: 10px; margin-bottom: 14px; }

/* the Planner's tab panel (FL-124) lays out its contents as the view did before it existed */
#pvpanel { display: grid; gap: 20px; min-width: 0; }
.pviews { display: flex; width: 100%; padding: 3px; }
.pviews button { flex: 1 0 auto; display: grid; justify-items: center; gap: 1px; padding: 7px 12px; font-size: var(--fs-md); }
.pviews button small { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }
.pviews button small.up { color: var(--good); }
.pviews button small.down { color: var(--bad); }
.pviews button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent-text), 0 0 0 1px var(--line-strong); }
.pvtl > summary { font-size: var(--fs-md); color: var(--fg); font-weight: 600; }
.pvcmp td.pvcell { display: table-cell; min-width: 150px; white-space: normal; font-size: var(--fs-sm); vertical-align: top; }
.pvcmp td.pvcell > span { display: block; }
.pvcmp td.pvcell .out { color: var(--bad); }
.pvcmp td.pvcell .in { color: var(--good); }
.pvcmp th .btn { white-space: nowrap; }
.pvcmp tr.pvsep td { padding-top: 14px; font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }

/* FL-186: below 640px the tabs sit in an even grid (now three across: Plan, Edit, Compare), so all of them are always
   in view. As one sideways-scrolling row the last was cut off at 390px with no sign it was there. */
@media (max-width: 640px) {
  .pviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0 -2px; width: calc(100% + 4px); }
  .pviews button { min-width: 0; padding: 6px 10px; white-space: normal; text-align: center; }
}
.pvcmpbox { max-height: none; }
.pvcmp th:first-child, .pvcmp td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }

@media (max-width: 640px) {
  .pvcmp th:first-child, .pvcmp td:first-child { min-width: 0; max-width: 104px; white-space: normal; font-size: var(--fs-xs); }
  .pvcmp td.pvcell { min-width: 132px; }
}
.pvstrat { padding: 12px 14px; }
.pvstratseg button { display: inline-grid; justify-items: center; gap: 1px; }
.pvstratseg button small { font-size: var(--fs-xs); font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.pvstratseg button small.up { color: var(--good); }
.pvstratseg button small.down { color: var(--bad); }

/* ---------- Stats: Goals & assists bars (actual bar, expected tick) ---------- */
.gabars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 760px; }
.gabars li { display: grid; grid-template-columns: minmax(96px, 168px) minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 3px 6px; border-radius: var(--r-sm); }

@media (hover: hover) and (pointer: fine) { .gabars li:hover { background: var(--raised); } }
.gabars li.mine { box-shadow: inset 3px 0 0 var(--hi-text); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ga-name { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ga-track { position: relative; height: 14px; }
.ga-act { position: absolute; inset: 2px auto 2px 0; background: var(--accent); border-radius: 0 4px 4px 0; }
.ga-exp { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--fg); border-radius: 1px; box-shadow: 0 0 0 2px var(--surface); }
.ga-val { text-align: right; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ga-legend { margin-bottom: 8px; }
.ga-legend .ga-key-act { background: var(--accent); height: 8px; }
.ga-legend .ga-key-exp { background: var(--fg); width: 2px; height: 12px; }

/* ---------- Stats: Points leaders (matchday ranking) ---------- */
.leaders td { padding-top: 9px; padding-bottom: 9px; vertical-align: middle; }
.ld-player { display: grid; grid-template-columns: 30px 4px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 190px; }
.ld-rank { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.ld-rank.first { color: var(--gold-fg); }
.ld-edge { align-self: stretch; min-height: 34px; background: var(--club); border-radius: 0; }
.ld-nm { display: grid; gap: 2px; line-height: 1.25; min-width: 0; }
.ld-nm > * { overflow: hidden; text-overflow: ellipsis; }
.ld-nm .pill { padding: 0 6px; font-size: 11px; margin-left: 2px; }
.leaders td.ld-pts { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; color: var(--fg); }
.ld-val { display: inline-grid; justify-items: end; gap: 4px; min-width: 40px; font-variant-numeric: tabular-nums; }
.ld-val i { display: block; height: 3px; border-radius: 2px; background: var(--accent); justify-self: end; }
.leaders td.on { color: var(--fg); font-weight: 600; }
.leaders td:not(.on) .ld-val i { opacity: .55; }

/* FL-122: any option strip on Fixtures or Stats that is wider than its box fades at the edge that has more to swipe
   to (classes set by scrollStrips, components/ui.js). The Planner's strips are not included (FL-090). */
:is(.view-fixtures, .view-stats) .seg { overscroll-behavior-x: contain; }
:is(.view-fixtures, .view-stats) .seg.more-r { mask-image: linear-gradient(90deg, #000 80%, transparent); }
:is(.view-fixtures, .view-stats) .seg.more-l { mask-image: linear-gradient(90deg, transparent, #000 20%); }
:is(.view-fixtures, .view-stats) .seg.more-l.more-r { mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }

@media (max-width: 720px) {
  /* Stats tabs: one row to swipe instead of three wrapped rows; the faded edge shows there's more */
  .stats-nav .ptabs { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  .stats-nav .ptabs button { scroll-snap-align: center; }

  /* phones: smaller rank and points so the first stat columns fit beside the player */
  .leaders th, .leaders td { padding-left: 7px; padding-right: 7px; }
  .ld-player { grid-template-columns: 20px 3px minmax(0, 1fr); gap: 7px; min-width: 112px; }
  .ld-extra { display: none; }
  .ld-rank, .leaders td.ld-pts { font-size: 21px; }
  .gabars li { grid-template-columns: minmax(84px, 120px) minmax(0, 1fr) 54px; gap: 8px; }
}

/* ---------- Home: Next deadline / Current GW ---------- */
.homeswitch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.hometabs button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: var(--fs-md); }
.hometabs button[aria-selected="true"] { background: var(--raised); color: var(--fg); box-shadow: 0 0 0 1px var(--accent-text); }
.hometabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ht-gw { font-size: var(--fs-xs); font-weight: 650; color: var(--faint); }
.hometabs button[aria-selected="true"] .ht-gw { color: var(--accent-text); }
.home-hint { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.home { display: grid; gap: 16px; min-width: 0; }

/* the hero, shorter, with its actions in reach */
.hero.compact { gap: 8px; padding: 18px 20px 16px; }
.hero.compact h1 { font-size: 44px; max-width: none; }
.hero.compact::before { width: 160px; height: 160px; right: -70px; margin-top: -80px; }
.hero-kind { color: var(--on-turf); }
.eyebrow .live-dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.hero-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hero-main { display: grid; gap: 8px; min-width: 0; }

/* Next deadline: the verdict and its two Planner buttons on one band on wide screens, so the team starts higher */
@media (min-width: 1101px) {
  .home-next .hero.compact { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 24px; padding: 18px 24px; }
  .home-next .hero.compact h1 { font-size: 38px; }
  .home-next .hero-acts { margin: 0; flex-wrap: nowrap; }
}
.hero-acts .btn:not(.primary) { background: var(--on-turf-glass); border-color: var(--on-turf-line); color: var(--on-turf); }

@media (hover: hover) and (pointer: fine) { .hero-acts .btn:not(.primary):hover { border-color: var(--on-turf); } }

/* the three calls */

/* the decision board: the three calls as rows of one panel, each with its key number on the right */
.dboard { display: grid; padding: 14px 16px 4px; }
.dboard > .side-h { padding-bottom: 4px; }
.dcard { display: grid; gap: 10px; min-width: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.dboard > .side-h + .dcard { border-top: 0; padding-top: 8px; }
.dcard h3 .pill { text-transform: none; letter-spacing: 0; }
.dcard h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }
.dc-key { display: inline-flex; align-items: baseline; gap: 5px; margin-left: auto; text-transform: none; letter-spacing: 0; }
.dc-key b { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; color: var(--fg); }
.dc-key small { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }

.dc-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.dc-do { margin: 0; font-size: 17px; font-weight: 650; }
.dc-sub { margin: 0; font-size: var(--fs-xs); color: var(--muted); }

/* FL-164: what differs between the captain options when the call is a Coin flip */
.dc-diff { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: var(--fs-sm); }
.dc-moves { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.dc-moves li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 16px; font-weight: 650; }
.dc-moves .out { color: var(--bad); }
.dc-moves .in { color: var(--good); }
.dc-moves .arr { color: var(--muted); }
.dc-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.dc-nums div { min-width: 0; }
.dc-nums dt { font-size: 11px; color: var(--faint); }
.dc-nums dd { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; }
.dc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-caps { display: grid; gap: 4px; }
.dcc { display: grid; grid-template-columns: minmax(195px, 1.8fr) minmax(36px, 1fr) auto; align-items: center; gap: 8px; padding: 4px 6px; margin: 0 -6px; background: none; border: 0; border-radius: var(--r-sm); color: inherit; text-align: left; }

@media (hover: hover) and (pointer: fine) { .dcc:hover { background: var(--raised); } }
.dcc-n { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 650; white-space: nowrap; }
.dcc-fx { flex-shrink: 0; font-size: var(--fs-xs); font-weight: 500; }
.dcc-alt { flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 5px; }
.dcc-bar { height: 7px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.dcc-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.dcc.top .dcc-bar i { background: var(--hi); }
.dcc > b { font-family: var(--display); font-size: 22px; font-weight: 700; }

/* pitch on the left (capped so large monitors don't over-stretch it), research and checks on the right */
.home-main { display: grid; grid-template-columns: minmax(0, 760px) minmax(320px, 1fr); gap: 16px; align-items: start; }

/* Planner's lineup column fits five cards side by side without stretching past 740px on large monitors */
.grid2.lu-cols { grid-template-columns: minmax(0, 740px) minmax(340px, 1fr); margin-bottom: 16px; }
.grid2.lu-cols .pvrec { margin: 0; }
.home-pitch { display: grid; gap: 10px; min-width: 0; }
.home-pitch .bar { margin: 0; }
.home-side { display: grid; gap: 12px; align-content: start; min-width: 0; }

/* Next deadline desktop grid: pitch + Before the deadline on the left, GW12 decisions spanning the right column
   so neither column leaves a tall empty void underneath */
@media (min-width: 1101px) {
  .home-next-grid { grid-template-columns: minmax(0, 760px) minmax(340px, 1fr); grid-template-rows: auto 1fr; }
  .home-next-grid > .home-pitch { grid-column: 1; grid-row: 1; }
  .home-next-grid > .dboard { grid-column: 2; grid-row: 1 / span 2; }
  .home-next-grid > .side { grid-column: 1; grid-row: 2; }
}

.side { padding: 14px 16px; display: grid; gap: 10px; }
.side-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-h h3 { font-size: var(--fs-lg); }
.side-act { display: flex; flex-wrap: wrap; gap: 6px; }
.side-empty { margin: 0; font-size: var(--fs-sm); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.side-alerts { font-size: var(--fs-sm); }
.home-side > .panel { align-self: start; align-content: start; }   /* side by side on tablets: each panel keeps its own height */

/* team value, bank and xP: one row above the pitch (Current GW) */
.mrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.mr { display: grid; gap: 2px; align-content: start; min-width: 0; padding: 10px 14px; }
.mr + .mr { border-left: 1px solid var(--line); }
.mr dt { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }
.mr-v { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.05; }
.mr-v small { font-size: 16px; color: var(--muted); }
.mr-s { margin: 0; font-size: 11.5px; color: var(--muted); }
.mr-na { font-family: var(--sans, inherit); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.dash-big b.mr-na { font-size: var(--fs-md); }

/* Home: team value, bank and xP in one labelled line above the pitch (Current GW keeps the .mrow tiles) */
.mrow.hp-money { display: flex; flex-wrap: wrap; gap: 4px 18px; background: none; border: 0; border-radius: 0; font-size: var(--fs-sm); color: var(--muted); }
.hp-money .mr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; padding: 0; }
.hp-money .mr + .mr { border-left: 0; }
.hp-money .mr dt { font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.hp-money .mr-v { font-family: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }
.hp-money .mr-s { font-size: var(--fs-xs); }

/* the pitch key behind a "Key" toggle (Home) */
.pitch-keyfold { border-top: 1px solid var(--line); }
.pitch-keyfold > summary { padding: 8px 12px; font-size: var(--fs-xs); }
.pitch-keyfold .pitch-key { border-top: 0; padding-top: 0; }

/* Squad rating in one line, with a small score ring (the full panel is on Planner → Plan) */
.sqr-ring { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; vertical-align: middle; border-radius: 50%; font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--fg); background: radial-gradient(closest-side, var(--surface) 76%, transparent 78%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.home .sqr-line { margin-top: 0; }

/* last gameweek, one line */
.prevgw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; padding: 10px 14px; font-size: var(--fs-sm); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.prevgw b { color: var(--fg); }
.prevgw-go { display: inline-flex; gap: 16px; margin-left: auto; }
.prevgw .linkish, .side .linkish:not(.pname) { color: var(--accent-text); font-weight: 600; }

/* Current GW */
.gwtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gwtiles .dash-big b { font-size: 36px; }
.gwtiles .dash-big { flex-wrap: wrap; }
.lm { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-sm); }
.lm li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 0 8px; }
.lm-st { grid-row: span 2; font-size: var(--fs-xs); font-weight: 650; color: var(--muted); }
.lm-sc { font-weight: 650; }
.lm-mine { font-size: var(--fs-xs); color: var(--muted); }
.gwscores { display: grid; gap: 16px; min-width: 0; }
.gwscores:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* actual-points cards: match state under the number. Bench and subbed-off players: a dashed border, the muted number
   and the "Not counted" / "Subbed off" line mark them. No opacity: dimming the card took its text below AA (FL-123). */
.lu .lvc-playing .lu-sub { color: var(--good); }
.lu .lvc-dnp .lu-sub { color: var(--bad); }
.lu .pc.lvc-nocount { border-style: dashed; border-color: var(--line-strong); }
.lu .lvc-nocount .xp { color: var(--muted); }
.bench-note { margin: 0; padding: 8px 12px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1000px) {
  .grid2.lu-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  .home-main { grid-template-columns: minmax(0, 1fr); }
  .home-side { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

@media (max-width: 640px) {
  .hometabs { width: 100%; }
  .hometabs button { flex: 1 1 0; justify-content: center; }
  .hero.compact h1 { font-size: 34px; }
  .gwtiles { grid-template-columns: minmax(0, 1fr); }
  .mr { padding: 9px 10px; }
  .mr-v { font-size: 22px; }
  .mr-s { font-size: 11px; }
  .dc-nums dd { font-size: 18px; }
  .home-side { grid-template-columns: minmax(0, 1fr); }
  .prevgw-go { margin-left: 0; }
}

/* ---------- Planner → Transfer paths ---------- */
.tp-wrap { display: grid; gap: 10px; padding: 14px 16px; }
.tp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tp-bar h2 { margin-right: 6px; }
.tp-bar-r { display: inline-flex; gap: 6px; margin-left: auto; }
.tp-lead, .tp-msg { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.tp-msg:empty { display: none; }
.tp-msg .linkish { color: var(--accent-text); font-weight: 600; }
.tp-panel { display: grid; gap: 8px; padding: 12px 14px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); }
.tp-panel .note { margin: 0; }
.tp-form { grid-template-columns: repeat(auto-fit, minmax(160px, auto)); align-items: end; justify-content: start; }
.tp-form label { display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--muted); }
.tp-form .note { grid-column: 1 / -1; }
.tpbox { border: 1px solid var(--line); border-radius: var(--r-sm); }
.tp { border-collapse: separate; border-spacing: 0; }
.tp th, .tp td { padding: 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tp thead th { padding: 7px 10px; }
.tp tbody tr:last-child > * { border-bottom: 0; }
.tp-n { min-width: 170px; max-width: 220px; overflow: hidden; background: var(--surface); text-align: left; white-space: normal; }
.tp-n small, .tp-nm { overflow-wrap: anywhere; }
.tp-n button { all: unset; box-sizing: border-box; display: grid; gap: 1px; width: 100%; padding: 7px 10px; cursor: pointer; }
.tp-n button:focus-visible, .tp-c button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tp-nm { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
.tp-nm .pill { font-family: var(--sans, inherit); vertical-align: 2px; }
.tp-n small { font-size: 11.5px; color: var(--muted); }
.tp-mob { display: none; }
.tp-c { min-width: 82px; text-align: center; }
.tp-c button { all: unset; box-sizing: border-box; display: grid; width: 100%; padding: 6px; cursor: pointer; text-align: center; }
.tp-c b { font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.1; }
.tp-c small { font-size: 11px; color: var(--fg); white-space: nowrap; }   /* muted grey fails AA on the darker heat steps (3.2:1, FL-123) */
.tp-c.h1 { background: var(--heat-0); }
.tp-c.h2 { background: var(--heat-1); }
.tp-c.h3 { background: var(--heat-2); }
.tp-c.h4 { background: var(--heat-3); }
.tp-c.h5 { background: var(--heat-4); }

@media (hover: hover) and (pointer: fine) { .tp-c:hover { box-shadow: inset 0 0 0 1px var(--accent-text); } }
.tp-c.tp-on { box-shadow: inset 0 0 0 2px var(--hi); }
.tp-net, .tp-gain { padding: 6px 12px !important; font-family: var(--display); font-size: 21px; font-weight: 700; white-space: nowrap; }
.tp-act { padding: 6px 10px !important; text-align: right; white-space: nowrap; }
.tp-actv { font-size: var(--fs-xs); font-weight: 650; color: var(--accent-text); }
.tp-why { padding: 8px 12px !important; font-size: var(--fs-sm); color: var(--muted); }

/* the path being inspected: mint, with a bar on the left; the active plan has its own label */
.tp-row.tp-sel > th, .tp-row.tp-sel > td:not(.tp-c) { background: var(--accent-soft); }
.tp-row.tp-sel > th.sticky-col { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* a mint outline round the whole row, so the selection still shows over the heat shading */
.tp-row.tp-sel > * { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.tp-row.tp-sel > th { box-shadow: inset 4px 0 0 var(--accent), inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.tp-row.tp-sel > td:last-child { box-shadow: inset -2px 0 0 var(--accent), inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.tp-row.tp-sel > .tp-c.tp-on, .tp-c.tp-on { box-shadow: inset 0 0 0 2px var(--hi); }
.tp-arm { border-color: var(--warn); color: var(--warn); }
.tp-editbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r); font-size: var(--fs-sm); }
.tp-editbar > span { margin-right: auto; }
.warn-t { color: var(--warn); font-weight: 600; }
.tp-strip { display: grid; gap: 8px; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); }
.tp-strip-h { display: flex; align-items: center; gap: 8px; }
.tp-strip-h h3 { font-family: var(--display); font-size: 19px; letter-spacing: .02em; text-transform: uppercase; }
.tp-x { all: unset; cursor: pointer; padding: 0 4px; color: var(--muted); border-radius: 3px; }
.tp-x:focus-visible { outline: 2px solid var(--focus); }
.tp-edit { margin-left: auto; color: var(--accent-text); font-weight: 650; }
.tp-moves { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.tp-moves li { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-weight: 650; }
.tp-moves .out { color: var(--bad); }
.tp-moves .in { color: var(--good); }
.tp-none-mv { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.tp-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.tp-facts div { display: flex; gap: 6px; align-items: baseline; }
.tp-facts dt { color: var(--muted); }
.tp-facts dd { margin: 0; font-weight: 650; }
.tp-strip .note { margin: 0; font-size: var(--fs-xs); }
.tp-bad { border-color: var(--bad); margin: 0; }
.tp-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tp-ren { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.tp-ren input { width: 150px; }
.tp-del { margin-left: auto; color: var(--bad); }
.tp-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 16px; }
.tp-foot .note { margin: 0; }
.tp-calc { flex: 0 1 auto; }
.tp-calc[open] { flex-basis: 100%; }
.tp-calc > summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: var(--fs-sm); width: fit-content; margin-left: auto; }
.tp-calc[open] > summary { margin-bottom: 8px; }
.tp-more > summary { cursor: pointer; font-weight: 600; }
.tp-more > .panel { border: 0; padding: 12px 0 0; background: none; }

@media (max-width: 640px) {
  .tp-wrap { padding: 12px; }
  .tp-bar-r { margin-left: 0; }
  .tp-n { min-width: 130px; max-width: 150px; }
  .tp-nm { font-size: 15px; }
  .tp-mob { display: block; color: var(--fg) !important; font-weight: 600; }
  .tp-n small:not(.tp-mob) { display: none; }
  .tp-c { min-width: 74px; }
  .tp-c b { font-size: 18px; }
  .tp-del { margin-left: 0; }
}

/* ---------- lineup: Cards | Kits (components/pitch.js). Each has its own markup; Review's own pitch is untouched ----------
   The rules below written for .lu-kits are the earlier card rules, unchanged, now scoped to Kits (its pitch and its
   bench strip). Cards has its own block after them. */
.lu-head { display: inline-flex; align-items: center; gap: 8px; }
.lu-bar { margin: 0; }
.lu-bar h3 { font-size: var(--fs-lg); }
.lu-toggle button { padding: 4px 10px; font-size: var(--fs-xs); }
.lu-toggle button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.lu .pitch { gap: 8px; padding: 14px 8px 12px; container: lupitch / inline-size; }
.lu .row { gap: 6px; }
.lu-kits .lu-pc { flex: 0 1 156px; width: auto; min-width: 0; padding: 0; text-align: left; container-type: inline-size; border-radius: 8px;
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--club, transparent) 75%, transparent), 0 2px 6px rgb(0 0 0 / 25%); }
.lu-kits .pc.newin { box-shadow: inset 0 2px 0 color-mix(in srgb, var(--club, transparent) 75%, transparent), inset 0 -2px 0 var(--good), 0 2px 6px rgb(0 0 0 / 25%); }
.lu-kits .lu-box { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 7px; box-sizing: border-box; min-height: 62px; padding: 8px 9px; }
.lu-kits .lu-kit { position: relative; width: 28px; height: 28px; }
.lu-kits .shirt { display: block; width: 100%; height: 100%; margin: 0; object-fit: contain; }
.lu-kits .flag { top: -7px; left: -9px; }
.lu-role { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; font-weight: 800; line-height: 1; background: var(--hi); color: var(--hi-fg); box-shadow: 0 0 0 2px var(--surface); }
.lu-role.v { background: var(--fg); color: var(--bg); }
.lu-kits .lu-txt { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm nm" "sub xp" "ex ex"; align-items: center; column-gap: 6px; min-width: 0; }
.lu-kits .lu-line { display: contents; }
.lu-kits .nm { grid-area: nm; min-width: 0; overflow: hidden; font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: .01em; line-height: 1.1; white-space: nowrap; text-overflow: ellipsis; }
.lu-kits .nm, .lu-kits .lu-sub { display: block; }
.lu-kits .nm .lu-in { display: inline-block; margin-left: 4px; vertical-align: 2px; }
.lu-kits .xp { grid-area: xp; font-size: 21px; line-height: 1; }
.lu-kits .lu-sub { grid-area: sub; overflow: hidden; font-size: 11px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.lu-kits .lu-sub:has(.fdr) { display: flex; flex-wrap: wrap; gap: 2px; text-overflow: clip; }
.lu-kits .lu-sub .fdr { font-size: 11px; padding: 1px 3px; }
.lu-kits .lu-sub .fdr .eudot { display: none; }
.lu-x { margin-left: 2px; font-family: var(--sans, inherit); font-size: 11px; font-weight: 700; color: var(--muted); }
.lu-kits .lu-ex { grid-area: ex; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1px 4px; min-width: 0; margin-top: 3px; font-size: 11px; color: var(--muted); }
.lu-price { white-space: nowrap; font-weight: 600; }
.lu-run { display: inline-flex; gap: 3px; }
.lu-dot { display: inline-flex; overflow: hidden; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px rgb(0 0 0 / 25%); }
.lu-dot b { flex: 1 1 0; }
.lu-dot.blank { background: none; box-shadow: inset 0 0 0 1.5px var(--faint); }
.lu-in { flex: none; padding: 0 3px; border-radius: 3px; font-size: 11px; font-weight: 800; letter-spacing: .04em; line-height: 13px; background: var(--good); color: var(--accent-fg); }

/* the bench strip: each chip on its own width (all four are the same) */
@container (max-width: 134px) {
  .lu-kits .lu-bn .lu-box { grid-template-columns: auto auto 1fr; grid-template-areas: "slot kit xp" "nm nm nm" "sub sub sub" "ex ex ex"; gap: 2px 4px; min-height: 0; padding: 6px 7px; }
  .lu-kits .lu-bn .lu-slot { grid-area: slot; }
  .lu-kits .lu-bn .lu-kit { grid-area: kit; width: 22px; height: 22px; }
  .lu-kits .lu-bn .lu-txt { display: contents; }
  .lu-kits .lu-bn .xp { justify-self: end; font-size: 17px; }
}

/* Kits: a kit above a dark nameplate; the plate stays dark on the turf in both themes */
.lu-kits .pitch .lu-pc, .lu-kits .pitch .pc.newin { flex: 0 1 112px; background: none; border-color: transparent; box-shadow: none; }
.lu-kits .pitch .lu-box { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; padding: 2px 0; }
.lu-kits .pitch .lu-kit { width: 36px; height: 36px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 45%)); }
.lu-kits .pitch .lu-role { box-shadow: 0 0 0 2px var(--turf); }
.lu-kits .pitch .lu-txt { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; justify-items: center; box-sizing: border-box; max-width: 100%; padding: 3px 8px 4px; border-radius: 6px; background: color-mix(in srgb, #000 72%, var(--turf)); color: var(--on-turf); text-align: center; }
.lu-kits .pitch .nm { grid-area: auto; max-width: 100%; overflow: hidden; font-size: 15px; color: var(--on-turf); text-overflow: ellipsis; }
.lu-kits .pitch .lu-line { display: flex; gap: 4px; align-items: baseline; max-width: 100%; min-width: 0; }
.lu-kits .pitch .xp { grid-area: auto; font-family: inherit; font-size: 11.5px; font-weight: 700; color: var(--on-turf); }
.lu-kits .pitch .xp.asm { color: var(--on-turf-muted); }
.lu-kits .pitch .lu-sub { grid-area: auto; font-size: 11px; color: var(--on-turf-muted); }
.lu-kits .pitch .lu-ex { grid-area: auto; flex-wrap: wrap; justify-content: center; gap: 1px 5px; max-width: 100%; margin-top: 1px; color: var(--on-turf-muted); }
.lu-kits .pitch .lvc-playing .lu-sub { color: var(--on-turf-good); }
.lu-kits .pitch .lvc-dnp .lu-sub { color: var(--on-turf-bad); }
.lu-kits .pitch .pc.sel { outline-offset: 2px; }
.lu-kits .pitch .lu-x { color: var(--on-turf-muted); }

@container (max-width: 84px) {
  .lu-kits .pitch .lu-txt { padding: 2px 4px 3px; }
  .lu-kits .pitch .nm { display: -webkit-box; font-size: 13.5px; white-space: normal; overflow-wrap: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .lu-kits .pitch .lu-line { flex-direction: column; align-items: center; gap: 0; }
}

/* bench: a compact strip in both styles, keeper first, then subs 1, 2, 3 in order */
.lu-kits .lu-bench { gap: 6px; padding: 8px; }
.lu-kits .lu-bn { flex: 0 1 172px; }
.lu-kits .lu-bn .lu-box { grid-template-columns: auto 24px minmax(0, 1fr); min-height: 48px; padding: 6px 8px; gap: 6px; }
.lu-kits .lu-bn .lu-kit { width: 24px; height: 24px; }
.lu-kits .lu-bn .xp { font-size: 18px; }
.lu-slot { display: grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 4px; box-sizing: border-box; font-size: 11px; font-weight: 750; background: var(--accent-soft); color: var(--accent-text); }


/* Cards: centred cards in three parts (components/pitch.js luCardC).
   1 identity: shirt, then the name (up to two lines, never broken mid-word); badges sit in the top corners, clear of both
   2 the number with its unit (and ×2 / C ×2), "Assumed" in words when it applies, then fixtures or the match state
   3 a footer under a hairline for what the screen adds: the next-3 run and Sell/Buy price, or Current GW's notes
   Cards in a row share one height and their footers line up; a card with more lines (a double, a note) is just taller. */
.lu-cards .pitch { gap: 10px; padding: 16px 10px 14px;
  background: radial-gradient(120% 60% at 50% -10%, var(--floodlight), transparent 60%),
    repeating-linear-gradient(180deg, var(--turf) 0 56px, color-mix(in srgb, var(--turf-2) 55%, var(--turf)) 56px 112px); }
.lu-cards .pitch::before, .lu-cards .pitch::after { opacity: .55; }
.lu-cards { --lu-gap: 8px; }
.lu-cards .row { gap: var(--lu-gap); align-items: stretch; }
.lu-cards .luc { flex: 0 1 var(--lu-w, 120px); width: auto; min-width: 0; padding: 0; text-align: center; container-type: inline-size; border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, var(--turf)); border: 1px solid color-mix(in srgb, var(--line-strong) 80%, transparent);
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--club, transparent) 70%, transparent), 0 2px 6px rgb(0 0 0 / 22%); }
.lu-cards .luc.newin { box-shadow: inset 0 2px 0 color-mix(in srgb, var(--club, transparent) 70%, transparent), inset 0 -2px 0 var(--good), 0 2px 6px rgb(0 0 0 / 22%); }

@media (hover: hover) and (pointer: fine) { .lu-cards .luc:hover { border-color: var(--accent-text); } }
.lu-cards .luc:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lu-cards .luc.sel { outline: 2px solid var(--hi); outline-offset: 1px; border-color: var(--hi); }
.lu-cards .lu-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; box-sizing: border-box; height: 100%; padding: 6px 6px 5px; }

/* badges: in the columns either side of the shirt, stacked when there are two, so they never sit on the shirt or name */
.lu-cards .lu-bdg { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lu-cards .lu-bdg.l { grid-area: l; justify-self: start; align-items: flex-start; }
.lu-cards .lu-bdg.r { grid-area: r; justify-self: end; align-items: flex-end; }
.lu-cards .lu-role, .lu-cards .flag { position: static; box-shadow: none; }
.lu-cards .lu-role { width: 17px; height: 17px; font-size: 11px; }
.lu-cards .flag { min-width: 0; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 11px; line-height: 16px; }
.lu-cards .lu-in { line-height: 15px; padding: 0 4px; font-size: 11px; }
.lu-cards .lu-slot { height: 17px; }

/* 1 identity: the shirt leaves room for the corner badges either side */
.lu-cards .lu-id { display: grid; grid-template: "l k r" auto "n n n" auto / minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 2px 3px; width: 100%; min-width: 0; }
.lu-cards .lu-kit { grid-area: k; width: 28px; height: 28px; }
.lu-cards .lu-id .nm { grid-area: n; justify-self: center; }
.lu-cards .shirt { display: block; width: 100%; height: 100%; margin: 0; object-fit: contain; }
.lu-cards .nm { display: -webkit-box; max-width: 100%; overflow: hidden; font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: .01em; line-height: 1.05;
  white-space: normal; overflow-wrap: normal; word-break: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lu-cards .lu-long .nm { font-size: 15px; }
.lu-cards .lu-xlong .nm { font-size: 14px; letter-spacing: 0; }

/* 2 the number, then fixtures or the match state */
.lu-cards .lu-pts { display: inline-flex; align-items: baseline; justify-content: center; gap: 3px; margin-top: 1px; line-height: 1; }
.lu-cards .xp { font-family: var(--display); font-size: 25px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.lu-cards .xp.asm { color: var(--fg); text-decoration: underline dotted var(--muted) 1.5px; text-underline-offset: 3px; }
.lu-cards .lu-unit { font-size: 11px; font-weight: 600; color: var(--muted); }
.lu-cards .lu-mult { font-size: 11px; font-weight: 800; color: var(--hi-text); }
.lu-cards .lu-asm { font-size: 11px; font-style: italic; color: var(--muted); line-height: 1.2; }
.lu-cards .lu-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 100%; margin: 2px 0; font-size: 11px; line-height: 1.25; color: var(--muted); }
.lu-cards .lu-sub .fdr { font-size: 11px; padding: 1px 4px; }
.lu-cards .lu-sub .fdr .eudot { display: none; }

/* 3 footer: pushed to the bottom so footers line up across a row */
.lu-cards .lu-foot { display: grid; gap: 2px; justify-items: center; width: 100%; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.25; color: var(--muted); }
.lu-cards .lu-fl { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 5px; max-width: 100%; }
.lu-cards .lu-fk { white-space: nowrap; }
.lu-cards .lu-price { font-weight: 650; color: var(--fg); }
.lu-cards .lu-price.buy { color: var(--accent-text); }
.lu-cards .lu-dot { width: 10px; height: 10px; }

/* Current GW */
.lu-cards .lvc-playing .lu-sub { color: var(--good); }
.lu-cards .lvc-dnp .lu-sub { color: var(--bad); }
.lu-cards .luc.lvc-nocount { border-style: dashed; border-color: var(--line-strong); }
.lu-cards .lvc-nocount .xp { color: var(--muted); }

/* every card in a lineup takes the width its busiest row allows (up to 120px), so a three-card row matches the rest */
.lu-cards.lu-r4 .pitch .luc { --lu-w: min(120px, calc((100cqw - 3 * var(--lu-gap)) / 4)); }
.lu-cards.lu-r5 .pitch .luc { --lu-w: min(120px, calc((100cqw - 4 * var(--lu-gap)) / 5)); }

/* bench: the same cards, keeper then subs 1, 2, 3, the slot in the top-left corner */
.lu-cards .lu-bench { align-items: stretch; gap: 8px; padding: 10px; }
.lu-cards .lu-bn { flex: 0 1 120px; }

/* narrow cards (busy rows on smaller screens): smaller faces, the run without its words (the key and label say it) */
@container (max-width: 100px) {
  .lu-cards .lu-box { padding: 5px 4px; }

  /* too narrow for badges beside the shirt: they get their own row above it */

  /* the badge row keeps its height on every card, so shirts and names still line up across a row */
  .lu-cards .lu-id { grid-template: "l r" minmax(17px, auto) "k k" auto "n n" auto / minmax(0, 1fr) minmax(0, 1fr); row-gap: 1px; }
  .lu-cards .lu-bdg { flex-flow: row wrap; gap: 2px; }
  .lu-cards .lu-bdg.r { justify-content: flex-end; }
  .lu-cards .lu-kit { justify-self: center; width: 24px; height: 24px; }
  .lu-cards .nm { font-size: 14px; }
  .lu-cards .lu-long .nm { font-size: 13px; }
  .lu-cards .lu-xlong .nm { font-size: 12px; }
  .lu-cards .xp { font-size: 21px; }
  .lu-cards .lu-unit, .lu-cards .lu-mult { font-size: 11px; }
  .lu-cards .lu-fk { display: none; }
  .lu-cards .lu-foot { font-size: 11px; padding-top: 4px; }
}

@container (max-width: 74px) {
  .lu-cards .lu-role { width: 15px; height: 15px; font-size: 11px; }
  .lu-cards .flag { height: 14px; padding: 0 3px; font-size: 11px; line-height: 14px; }
  .lu-cards .lu-in, .lu-cards .lu-slot { font-size: 11px; }
  .lu-cards .lu-box { padding: 5px 2px 4px; }
  .lu-cards .lu-kit { width: 22px; height: 22px; }
  .lu-cards .nm { font-size: 13px; letter-spacing: 0; }
  .lu-cards .lu-long .nm { font-size: 11.5px; }
  .lu-cards .lu-xlong .nm { font-size: 11px; }
  .lu-cards .xp { font-size: 19px; }
  .lu-cards .lu-unit { display: none; }
  .lu-cards .lu-sub .fdr { padding: 1px 2px; font-size: 11px; }
  .lu-cards .lu-sub, .lu-cards .lu-foot { font-size: 11px; }
}

@media (max-width: 640px) {
  .lu .pitch { padding: 12px 4px 10px; gap: 6px; }
  .lu-kits .row, .lu-kits .lu-bench { gap: 4px; }
  .lu-kits .lu-bench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px 4px; }
  .lu-kits .lu-bn { max-width: none; }
  .lu-kits .lu-bench .lbl { display: none; }
  .lu-cards { --lu-gap: 4px; }
  .lu-cards .pitch { padding: 12px 4px 10px; gap: 8px; }
  .lu-cards .lu-bench { gap: 4px; padding: 6px 4px; }
  .lu-cards .lu-bench .lbl { display: none; }
  .lu-head .tag { display: none; }
}

/* Home Transfers card: one-line reason per move (U2) */
.dc-moves .dc-why { flex-basis: 100%; display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-xs); margin-top: 2px; }

/* Transfer paths: plan expiry (D4) */
.tp-review-box { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.tp-review-box .alerts { margin: 6px 0 8px; }

/* Fixtures: longer horizon (C5) */
.fixtures .fx-est { opacity: .62; font-style: italic; }
.fixtures .th-sort { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }

/* ---------- You vs the model (F1d) ---------- */
.vm-intro .seg { flex-wrap: wrap; margin: 4px 0 10px; }
.vm-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; margin: 14px 0 4px; }
.vm-side { display: grid; gap: 2px; min-width: 0; }
.vm-side:last-child { text-align: right; }
.vm-side .lbl { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }
.vm-side b { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; }
.vm-res { font-size: var(--fs-sm); padding: 4px 12px; }
.vm-assumed { border-left: 3px solid var(--warn); background: var(--sunk); padding: 10px 12px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: var(--fs-sm); margin: 12px 0 0; }
.grid2.vm-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.vm-moves { list-style: none; padding: 0; margin: 10px 0 4px; display: grid; gap: 4px; }
.vm-moves .out { color: var(--bad); }
.vm-moves .in { color: var(--good); }

@media (max-width: 1000px) {
  .grid2.vm-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .vm-side b { font-size: 34px; }
}

@media (max-width: 380px) {
  /* FL-202: the 18px panel padding left 4-across pitch cards 57px wide at 320px, clipping long names; trim it around the pitch only */
  .view-vsmodel .panel:has(.lu) { padding-inline: 4px; }
  .view-vsmodel .panel:has(.lu) > :not(.lu) { padding-inline: 10px; }
}

/* ---------- You vs the model: streak card (F1e) ---------- */
.vm-run { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 20px; }
.vm-run > div:first-child { display: grid; gap: 2px; }
.vm-run .lbl { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }
.vm-run > div > b { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.05; }
.vm-rec { display: flex; gap: 18px; }
.vm-rec span { display: grid; text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.vm-rec b { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--fg); line-height: 1.1; }
.vm-dots { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.vm-dot { position: relative; display: grid; justify-items: center; gap: 3px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font: inherit; }
.vm-dot .vm-l { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 700; border: 2px solid transparent; }
.vm-dot .vm-g { font-size: var(--fs-xs); }
.vm-dot.rW .vm-l { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.vm-dot.rD .vm-l { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.vm-dot.rL .vm-l { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }   /* 16%: keeps the red L at AA on the dark tint (20% gave 4.44:1) */
.vm-dot.rN .vm-l { background: var(--sunk); color: var(--muted); border: 2px dashed var(--line-strong); }
.vm-dot.asm .vm-l { border: 2px dotted currentcolor; }
.vm-dot.saved .vm-l { box-shadow: 0 0 0 3px var(--accent-text); }
.vm-dot .vm-star { position: absolute; top: -4px; right: -4px; font-size: 13px; color: var(--accent-text); }
.vm-dot:focus-visible .vm-l { outline: 2px solid var(--focus); outline-offset: 2px; }
.vm-key { margin: 0 0 14px; }
.vm-cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.vm-cols2 h3 { margin: 0 0 8px; }
.vm-wcs { display: flex; align-items: center; gap: 8px; }
.vm-wc { width: 22px; height: 30px; border-radius: 4px; border: 2px dashed var(--line-strong); }
.vm-wc.on { border: 2px solid var(--accent-text); background: var(--accent-soft); }
.vm-mss { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.vm-ms { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font-size: var(--fs-xs); color: var(--muted); }
.vm-ms b { font-size: var(--fs-sm); color: var(--fg); }
.vm-ms.got { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.vm-ms.best { border-style: dashed; border-color: var(--good); }

/* locked (counts from next season): dashed border, sunk background and a muted title. No opacity: it took the text below AA (3.18:1 dark, 2.57:1 light) */
.vm-ms.locked { border-style: dashed; border-color: var(--line-strong); background: var(--sunk); }
.vm-ms.locked b { color: var(--muted); }
.vm-msn { font-weight: 600; }

@media (max-width: 700px) {
  .vm-cols2 { grid-template-columns: minmax(0, 1fr); }
  .vm-run > div > b { font-size: 32px; }
}

/* ---------- You vs the model: decision journal (D5a) ---------- */
.j-cap { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 4px 0 8px; }
.j-cap > span:first-child { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }
.j-grp { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.j-grp h4 { margin: 0 0 6px; font-size: var(--fs-sm); }
.j-grp ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.j-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 16px; align-items: start; }
.j-move { display: grid; gap: 2px; }
.j-move .out { color: var(--bad); }
.j-move .in { color: var(--good); }
.j-facts { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--muted); }
.tag.warn { color: var(--warn); }

@media (max-width: 600px) {
  .j-row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- decision journal reasons (D5b) ---------- */
.rs-btn { display: inline-block; margin-top: 4px; padding: 2px 8px; border: 1px dashed var(--line-strong); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; text-align: left; }

@media (hover: hover) and (pointer: fine) { .rs-btn:hover { color: var(--fg); border-color: var(--accent-text); } }
.rs-btn.set { border-style: solid; border-color: var(--accent-text); color: var(--fg); border-radius: var(--r-sm); }
.rs-btn .rs-k { font-weight: 650; color: var(--accent-text); }
.j-why { grid-column: 1 / -1; }
.vm-moves li .rs-btn { margin-left: 8px; }
.dc-moves li .rs-btn { flex-basis: auto; font-weight: 400; }
.rs-move { display: flex; gap: 10px; flex-wrap: wrap; }
.rs-move .out { color: var(--bad); }
.rs-move .in { color: var(--good); }
.rs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.rs-note { display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 12px; }
.rs-note textarea { font: inherit; color: var(--fg); background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; resize: vertical; }

/* ---------- decision journal results (D5c) ---------- */
.j-res { grid-column: 1 / -1; display: grid; gap: 2px; font-size: var(--fs-sm); background: var(--sunk); border-radius: var(--r-sm); padding: 6px 10px; }
.j-capres { font-size: var(--fs-sm); }

/* ---------- decision journal season summary (D5d) ---------- */
.j-sum h4 { margin: 14px 0 6px; font-size: var(--fs-sm); }
.j-tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.j-tbl th, .j-tbl td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: left; }
.j-tbl thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: var(--fs-xs); }
.j-tbl .n { text-align: right; white-space: nowrap; }
.j-miss { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--fs-sm); }
.j-tbl th small { display: block; font-weight: 400; font-size: var(--fs-xs); }

/* ---------- Data health: Sources table (FL-179) ----------
   Details and How often wrap so the table fits its box and the Status pills (2nd column) stay in view. The min-width
   keeps a wrapped cell from going one word per line on phones; there the table still scrolls inside its own box. */
.srctable td.wrap { white-space: normal; min-width: 14em; }

/* ---------- tap targets on touch screens (FL-124) ----------
   At least 40 x 40px for every control when the pointer is a finger. Boxed controls grow. Text-style buttons (player
   names in tables, glossary terms, link-style buttons) keep their look: they are at least 40px wide, and an invisible
   ::after gives them a 40px-tall hit area; table cells get 2px more padding so neighbouring rows' hit areas don't
   overlap. Inline links inside a sentence are exempt (WCAG 2.5.8). Last in the last stylesheet, because .linkish and
   .term reset everything (all: unset). Checked by scripts/tap_check.py. */
@media (pointer: coarse) {
  .btn, .seg button, .gwsel button, select, summary, .chipbtn, .pl-chip, .skip, .st-when, .mc-p, .mc-club,
  input:not([type="checkbox"], [type="radio"], [type="hidden"]) { min-height: 40px; }
  .theme-toggle, .icon-only, .vm-dot, .xptable .xstar { min-width: 40px; min-height: 40px; }
  .seg button { min-width: 40px; }
  .rs-btn { min-height: 40px; }
  .j-why { margin-bottom: 10px; }   /* clear of the hit area of the name on the next line */
  summary { display: flex; align-items: center; }
  .linkish, button.pname, .term, td > a:only-child { position: relative; display: inline-block; min-width: 40px; }
  .linkish::after, button.pname::after, .term::after, td > a:only-child::after {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, 40px); transform: translateY(-50%);
  }
  th, td { padding-top: 10px; padding-bottom: 10px; }
  .pcell { gap: 12px; }
  .cmp-hit { display: grid; flex: none; place-items: center; width: 40px; height: 40px; margin: -10px -2px -10px -10px; cursor: pointer; }
}

/* FPL School: pitch capped at 680px on the left, review and manager card on the right on desktop */
.sch-cols { display: grid; grid-template-columns: minmax(0, 680px) minmax(280px, 1fr); gap: 18px; align-items: start; margin-top: 10px; }
.sch-pitch { grid-column: 1; grid-row: 1 / span 2; display: grid; gap: 10px; min-width: 0; max-width: 680px; }
.sch-side { grid-column: 2; grid-row: 1; display: grid; gap: 10px; align-content: start; min-width: 0; }
.sch-side .kpis, .sch-side h3, .sch-side .verdict, .sch-side .note { margin: 0; }
.sch-side .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sch-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.sch-cols > .sch-card { grid-column: 2; grid-row: 2; margin: 0; }
.sch-card > div { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.sch-card dt { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }
.sch-card dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sch-out { font-weight: 700; color: var(--bad); }
.lu-kits .pitch .sch-out { color: var(--on-turf-bad); }
.lu-np .lu-kit { min-height: 30px; }

@media (max-width: 1000px) {
  .sch-cols { grid-template-columns: minmax(0, 680px); }
  .sch-pitch, .sch-side, .sch-cols > .sch-card { grid-column: 1; grid-row: auto; }
}

/* ---------- Planner: Your plan, Suggested, Captains, Replace, Drafts (planner redesign) ---------- */

/* which plan is active (and Undo), on every Planner tab that can change it */
.pe-active { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0; padding: 9px 12px; font-size: var(--fs-sm); color: var(--fg); background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); }
.pe-active .lbl, .pe-k dt, .capwk-alts .lbl { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--muted); }

/* the selected week in one compact block, then the settings fold */
.pe-head { display: grid; gap: 10px; padding: 12px 14px; }
.pe-sum { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: space-between; gap: 8px 16px; margin: 0; }
.pe-k { display: grid; gap: 1px; align-content: start; min-width: 0; }
.pe-k dd { margin: 0; }
.pe-k dd:not(.pe-s) { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pe-k dd.up { color: var(--good); }
.pe-k dd.down { color: var(--bad); }
.pe-s, .rp-g .pe-s { font-size: var(--fs-xs); color: var(--muted); }
.pe-set { margin: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.pe-set > summary, .pe-fold > summary { color: var(--fg); font-weight: 600; padding: 4px 0; }
.pe-cur { margin-left: 6px; font-weight: 500; color: var(--muted); }
.pe-set-body { display: grid; gap: 10px; padding-top: 10px; }
.pe-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font-size: var(--fs-sm); }
.pe-cap .linkish { margin-left: auto; color: var(--accent-text); font-weight: 600; }
.pe-fold { margin: 0; }

/* Edit → the tool folds (Transfer suggestions, Captains, Re-plan with my rules, Drafts): the summary is the heading */
.pe-tool > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; width: 100%; color: var(--fg); }
.pe-tool > summary h3 { display: inline; margin: 0; }
.pe-tool > summary .pe-cur { margin-left: 0; }
.pe-tool .pt-body { padding-top: 10px; min-width: 0; }
.pe-fold .note { margin: 6px 0 0; }
.pe-weeks { padding: 12px 14px; }
.pe-weeks .tablebox { margin-top: 10px; }

@media (max-width: 760px) {
  .pe-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
  .pe-gain { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding-top: 6px; border-top: 1px solid var(--line); }
  .pe-k dd:not(.pe-s) { font-size: 22px; }
  .pe-k:not(.pe-gain) .pe-s:not(.pe-ft) { display: none; }
}

/* replace a player: the list and the preview of the chosen candidate */
@media (min-width: 1001px) { .candlist { max-height: 560px; overflow: auto; overscroll-behavior: contain; } }
.cand.on { background: var(--accent-soft); }
.rp { display: grid; gap: 10px; margin: 6px 0 12px; padding: 12px; background: var(--surface); border: 1.5px solid var(--accent-text); border-radius: var(--r-sm); }
.rp-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; align-items: baseline; }
.rp-base, .rp-val { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.rp-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
.rp-g > div { display: grid; gap: 1px; min-width: 0; }
.rp-g dt { font-size: var(--fs-xs); font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.rp-g dd { margin: 0; }
.rp-g dd:not(.pe-s) { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.rp-g dd.up { color: var(--good); }
.rp-g dd.down { color: var(--bad); }

/* captain planner: one card a gameweek */
.capwks { display: grid; gap: 10px; }
.capwk { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.capwk.mine { border-color: var(--accent-text); }
.capwk-h, .capwk-c { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
.capwk-h h4 { margin: 0; font-size: var(--fs-lg); }
.capwk-m { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.capwk-alts { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.capwk .capalt { flex-wrap: wrap; font-size: var(--fs-sm); }
.capwk .capalt > span { min-width: 0; flex: 1 1 160px; }
.capwk > .btn { justify-self: start; }

/* Suggested: moves first on phones, squad back on the left from 1001px */
.pv-lead { margin: 0 0 4px; font-weight: 650; }
.pv-cons { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: var(--fs-sm); }
.pv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sg-whyd { margin: 0; }
.sg-whyd .sg-why { margin-top: 6px; }

@media (min-width: 1001px) {
  .pv-sugg > .pv-team { grid-column: 1; grid-row: 1; }
  .pv-sugg > .pv-side { grid-column: 2; grid-row: 1; }
}

/* drafts: which one is active, and its actions */
.dr-sub { font-weight: 400; text-transform: none; letter-spacing: 0; }
.dr-on { font-size: var(--fs-xs); font-weight: 650; color: var(--accent-text); }
.dr-acts { white-space: nowrap; }
.rp-warn { margin: 0; padding: 6px 10px; font-size: var(--fs-xs); color: var(--fg); background: var(--sunk); border-left: 3px solid var(--warn); border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* drafts: one card a plan (the active plan first) */
.drcards { display: grid; gap: 10px; }
.drcard { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.drcard.cur { background: var(--sunk); }
.drcard.on { border-color: var(--accent-text); }
.drcard-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
.drcard-h h4 { margin: 0; font-size: var(--fs-lg); overflow-wrap: anywhere; }
.drcard-s, .drcard-mv { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.drcard-mv b { color: var(--fg); font-weight: 600; margin-right: 4px; }
.drcard-m { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin: 4px 0; }
.drcard-m > div { display: grid; gap: 1px; min-width: 0; }
.drcard-m dt { font-size: var(--fs-xs); color: var(--muted); }
.drcard-m dd { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.drcard-m dd.up { color: var(--good); }

@media (max-width: 360px) { .drcard-m { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Rivals: My league and The field ---------- */
.rv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.rv-lsel { max-width: 100%; min-height: 40px; }
.view-rivals > .rv-tabs { display: flex; width: 100%; gap: 22px; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; overflow: visible; }
.view-rivals > .rv-tabs button { min-height: 44px; padding: 8px 2px; border-radius: 0; font-size: var(--fs-md); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.view-rivals > .rv-tabs button[aria-selected="true"] { background: none; box-shadow: none; color: var(--accent-text); border-bottom-color: var(--accent-text); }
.rv-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.rv-body > .seg { justify-self: start; }
.rv-body .seg button { min-height: 40px; }
.rv-h { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .01em; line-height: 1.1; }
h4.rv-h { font-size: 20px; }
.rv-sec { margin-top: 6px; }
.rv-flag { border-left: 3px solid var(--warn); padding-left: 10px; }
.rv-go, .rv-back { color: var(--accent-text); font-weight: 650; font-size: var(--fs-sm); padding: 8px 0; min-height: 24px; justify-self: start; }
.rv-anyteam { margin: -6px 0 0; }

/* status: phase, update time, polling, refresh */
.rv-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: var(--fs-sm); }
.rv-phase { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-weight: 700; }
.rv-upd { font-variant-numeric: tabular-nums; }
.rv-status .btn { margin-left: auto; min-height: 40px; }
.rv-stale { flex-basis: 100%; margin: 2px 0 0; color: var(--warn); font-weight: 550; }
.rv-status.is-stale { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }

/* rivalry moment and projection */
.rv-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }   /* FL-185: each card its own height, no empty lower half */
.rv-hero.one { grid-template-columns: minmax(0, 1fr); }
.rv-moment { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.rv-eyebrow { display: block; font-size: var(--fs-label); font-weight: 650; letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rv-headline { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 6vw, 52px); line-height: 1; letter-spacing: .005em; overflow-wrap: anywhere; }
.rv-moment p { margin: 8px 0 0; color: var(--muted); }
.rv-pair { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rv-pair span { display: block; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.rv-pair b { font-family: var(--display); font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rv-proj { display: flex; flex-direction: column; gap: 4px; }
.rv-proj .muted { margin: 0; font-size: var(--fs-sm); }
.rv-big { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.1; margin: 8px 0 0; }
.rv-lines { list-style: none; margin: 8px 0 0; padding: 0; }
.rv-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.rv-lines li > span { min-width: 0; overflow-wrap: anywhere; }
.rv-lines b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-proj .rv-go { margin-top: auto; }

/* standings */
.rv-table { max-height: none; }
.rv-table td.rv-mgr { min-width: 0; white-space: normal; }
.rv-table .lg-team { display: block; overflow-wrap: anywhere; }
.rv-table .pname { overflow-wrap: anywhere; }
.rv-table .rv-mgr .linkish { padding: 3px 0; }
.rv-table tr.is-rival td { background: var(--hi-soft); }
.rv-fb { color: var(--warn); font-weight: 700; margin-left: 1px; }
.rv-hit { white-space: nowrap; }

.rv-gap-sm { display: none; }

/* FL-223: title odds */
.rv-odds-cap { margin: 0 0 10px; line-height: 1.5; overflow-wrap: anywhere; }
.rv-odds-all { margin: 8px 0 4px; }
.rv-odds-all summary { padding: 6px 0; }
.rv-odds .pill { margin-right: 4px; }

@media (width < 768px) {
  .rv-c-gap, .rv-c-chips { display: none; }
  .rv-gap-sm { display: block; font-size: 11px; font-weight: 600; line-height: 1.2; }
  th .rv-gap-sm { font-weight: 500; text-transform: none; letter-spacing: 0; }
  .rv-hero { grid-template-columns: minmax(0, 1fr); }
  .rv-status .btn { margin-left: 0; }
}

@media (width < 1024px) { .rv-c-chips { display: none; } }

@media (width < 420px) {
  .rv-standings, .rv-odds { padding: 14px 10px; }
  .rv-table th, .rv-table td { padding-left: 5px; padding-right: 5px; }
  .rv-table .lg-rank { grid-template-columns: auto; gap: 0; place-items: end; }
  .rv-table .tag, .rv-c-live { display: none; }
}

/* weekly honours */
.rv-hon { display: grid; gap: 4px; }
.rv-hon > .bar { margin-bottom: 8px; }
.aw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.aw-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.aw-sub { margin: 4px 0 10px; font-size: var(--fs-sm); }
.podium { list-style: none; margin: 0 0 8px; padding: 0; }
.podium li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.podium li.mine .aw-who { color: var(--accent-text); }
.aw-who { font-weight: 650; overflow-wrap: anywhere; }
.aw-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.medal { justify-self: start; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; }
.m-gold { color: var(--gold-fg); background: var(--gold-bg); }
.m-silver { color: var(--silver-fg); background: var(--silver-bg); }
.m-bronze { color: var(--bronze-fg); background: var(--bronze-bg); }
.aw-card .note { margin: 6px 0 0; overflow-wrap: anywhere; }
.aw-cov { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--faint); }
.rv-hon-bar { align-items: flex-end; margin-bottom: 0; }
.rv-hon-bar p { margin: 4px 0 0; font-size: var(--fs-sm); }
.rv-gwsel { display: flex; gap: 6px; align-items: center; }
.rv-gwsel .btn { min-width: 40px; min-height: 40px; justify-content: center; }
.rv-gwsel .sel { min-height: 40px; }

/* head-to-head */
.rv-dl { margin: 8px 0 0; }
.rv-dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.rv-dl dt { color: var(--muted); }
.rv-dl dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.rv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rv-acts .btn { min-height: 40px; }
.rv-edges { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.rv-edges .muted { margin: 2px 0 0; font-size: var(--fs-sm); }

/* the field */
.rv-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rv-fsub { margin: -6px 0 0; font-size: var(--fs-sm); }
.rv-more { border-top: 1px solid var(--line); padding-top: 10px; }
.rv-more > summary { color: var(--accent-text); font-weight: 650; min-height: 32px; display: flex; align-items: center; }
.rv-more[open] > summary { margin-bottom: 10px; }
.rv-elite .rv-more { margin-top: 10px; }

/* 320px: the entry-ID hint's FPL address and the field's two-up tables must not widen the page */
.view-rivals .note, .view-rivals .verdict { overflow-wrap: anywhere; }
.view-rivals .statgrid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* FL-254: League History / Hall of Fame */
.hof-bar { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.hof-bar-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.hof-ctl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.hof-ctl .sel { min-height: 40px; }
.hof-seg { flex-wrap: wrap; }
.hof-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.hof-toggles .chipbtn { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.hof-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hof-share-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.hof-share-acts .btn { min-height: 36px; }
.hof-kpis { margin: 2px 0; }
.hof-bcard { border-left: 3px solid var(--accent); }
.hof-bcard.hof-b-gold { border-left-color: var(--gold-fg); }
.hof-bcard.hof-b-silver { border-left-color: var(--silver-fg); }
.hof-bcard.hof-b-bad { border-left-color: var(--bad); }
.hof-bcard.hof-b-good { border-left-color: var(--good); }
.pill.hof-b-gold { color: var(--gold-fg); background: var(--gold-bg); }
.pill.hof-b-silver { color: var(--silver-fg); background: var(--silver-bg); }
.pill.hof-b-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }
.pill.hof-b-good { color: var(--good); background: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.hof-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.hof-tablebox, .hof-matrixbox, .hof-chartbox { max-height: none; overflow-x: auto; }
.hof-table th.sortable { padding: 0; }
.hof-table .th-btn { background: none; border: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; padding: 9px 10px; width: 100%; text-align: inherit; cursor: pointer; white-space: nowrap; }
.hof-table th.n .th-btn { text-align: right; }
.hof-table td.rv-mgr, .hof-matrix th.rv-mgr { min-width: 150px; white-space: normal; }
.hof-table .lg-team { display: block; overflow-wrap: anywhere; }
.hof-rk { display: inline-block; min-width: 18px; font-variant-numeric: tabular-nums; }
.hof-or, .hof-h2h { white-space: nowrap; }
.hof-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.hof-leg-btn { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; transition: opacity var(--t-fast); }
.hof-leg-btn.is-spot { border-color: var(--focus); background: var(--hi-soft); }
.hof-leg-btn.is-dim { opacity: 0.45; }
.hof-swatch { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.hof-bump-svg { display: block; max-width: none; font-family: var(--font); }
.hof-grid-line { stroke: var(--line); stroke-dasharray: 2 3; stroke-width: 1; }
.hof-axis-lbl { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.hof-end-lbl { font-size: 12px; font-weight: 600; }
.hof-end-lbl.is-spot { font-weight: 750; }
.hof-line-g { cursor: pointer; transition: opacity var(--t-fast); }
.hof-line-g.is-dim { opacity: 0.16; }
.hof-matrix .hof-cell { min-width: 68px; text-align: center; vertical-align: middle; padding: 7px 8px; }
.hof-m-rk { display: block; font-size: var(--fs-sm); line-height: 1.15; }
.hof-m-pts { display: block; font-size: 11px; opacity: 0.88; font-variant-numeric: tabular-nums; }
.hof-c-gold { background: var(--gold-bg); color: var(--gold-fg); }
.hof-c-silver { background: var(--silver-bg); color: var(--silver-fg); }
.hof-c-bronze { background: var(--bronze-bg); color: var(--bronze-fg); }
.hof-c-last { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); color: var(--bad); }
.hof-c-ghost { background: var(--sunk); }
.hof-tag-last { display: inline-block; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--surface)); }
.hof-avg-row th, .hof-avg-row td { border-top: 2px solid var(--line-strong); background: var(--sunk); }
.hof-disclaimer { margin-top: -4px; }

/* ---------- Team tab (club picker, formations & minute share by slot) ---------- */
.tm-picker { margin-bottom: var(--gap); }
.tm-pick-mobile { display: none; align-items: center; gap: 10px; }
.tm-pick-lbl { font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--muted); }
.tm-chips { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }

@media (min-width: 1600px) { .tm-chips { grid-template-columns: repeat(20, minmax(0, 1fr)); } }
.tm-chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; padding: 5px 6px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; min-width: 0; }
.tm-chip:hover { border-color: var(--line-strong); }
.tm-chip.has-mine { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tm-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.tm-hero { margin-bottom: var(--gap); }
.tm-hero-id { display: flex; align-items: center; gap: 12px; }
.tm-hero-id h2 { margin: 0; font-size: var(--fs-xl); line-height: 1.15; }
.tm-forms { flex-wrap: wrap; }
.tm-forms button small { opacity: 0.78; margin-left: 3px; font-variant-numeric: tabular-nums; }
.tm-oneform { white-space: nowrap; }
.tm-slot-grid { display: grid; grid-template-columns: minmax(0, 620px) minmax(340px, 1fr); gap: var(--gap); align-items: start; margin-top: 12px; }
.tm-pitch { display: flex; flex-direction: column; gap: 12px; padding: 18px 12px; border-radius: var(--r); border: 1px solid var(--on-turf-line); background: repeating-linear-gradient(180deg, var(--turf) 0 42px, var(--turf-2) 42px 84px); }
.tm-prow { display: flex; justify-content: space-evenly; align-items: stretch; gap: 8px; flex-wrap: nowrap; }
.tm-slot { flex: 1 1 0; min-width: 0; max-width: 122px; min-height: 66px; padding: 7px 6px; border-radius: var(--r-sm); border: 1px solid var(--on-turf-line); background: var(--on-turf-glass); color: var(--on-turf); display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 2px; text-align: center; cursor: pointer; }
.tm-slot:hover { border-color: var(--on-turf); }
.tm-slot.sel { border-color: var(--hi); box-shadow: 0 0 0 2px var(--hi); }
.tm-slot.mine { border-top: 3px solid var(--accent); }
.tm-sl-pos { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--on-turf-muted); }
.tm-sl-more { font-size: 11px; font-weight: 600; opacity: 0.85; color: var(--on-turf); }
.tm-sl-name { font-size: var(--fs-xs); font-weight: 700; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-sl-pct { font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tm-slot.nailed .tm-sl-pct { color: var(--on-turf-good); }
.tm-slot.regular .tm-sl-pct { color: var(--on-turf-warn); }
.tm-slot.rotated .tm-sl-pct { color: var(--on-turf-bad); }
.tm-sl-avg { font-size: 11px; font-weight: 600; line-height: 1.1; color: var(--on-turf-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-sl-flag { font-size: 11px; font-weight: 700; line-height: 1.2; padding: 0 5px; border-radius: 999px; border: 1px solid currentcolor; white-space: nowrap; }
.tm-sl-flag.warn { color: var(--on-turf-warn); }
.tm-sl-flag.bad { color: var(--on-turf-bad); }
.tm-sl-split { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.2; padding: 0 5px; border-radius: 999px; border: 1px solid var(--on-turf-line); color: var(--on-turf-muted); }
.tm-sp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tm-spflag { padding: 0 5px; font-size: 11px; vertical-align: 1px; }

/* FL-284: these pills sit on a --sunk tile, where the usual see-through 15% tint fell to 4.35:1 (bad) and 4.51:1 (warn)
   in light mode; tinting over --surface keeps the normal pill colour and gives 5.0:1 light, 4.8:1 dark */
.tm-spflag.bad { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); }
.tm-spflag.warn { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); }
.tm-squad-tbl .pill.good { background: var(--sunk); color: var(--muted); border: 1px solid var(--line); }
.tm-sm-head { align-items: flex-start; }
.tm-win { flex: 0 0 auto; }
.tm-form-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tm-bsub { margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-bnews { color: var(--fg); }

/* solid, lighter tint: the usual 15% tint stacked on the raised drill panel and the "your player" row highlight (accent-soft) fell below AA */
.tm-bflag.warn { background: color-mix(in srgb, var(--warn) 10%, var(--raised)); }
.tm-bflag.bad { background: color-mix(in srgb, var(--bad) 10%, var(--raised)); }
.tm-util { padding: 1px 7px; margin-left: 4px; border: 1px solid var(--line-strong); }
.tm-utility { margin-top: var(--gap); padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raised); }
.tm-utility h4 { margin: 0 0 8px; font-size: var(--fs-md); }
.tm-usplit { text-align: right; font-size: var(--fs-xs); font-weight: 600; }
.tm-frec { margin-top: var(--gap); padding-top: 12px; border-top: 1px solid var(--line); }
.tm-frec h4 { margin: 0 0 8px; font-size: var(--fs-md); }
.tm-frec tr.tm-frec-on td { background: var(--accent-soft); }
.tm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 4px; vertical-align: middle; }
.tm-dot.nailed { background: var(--good); }
.tm-dot.regular { background: var(--warn); }
.tm-dot.rotated { background: var(--bad); }
.tm-drill { padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raised); }
.tm-drill h4 { margin: 0; font-size: var(--fs-md); }
.tm-bars { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tm-bars li.mine { padding: 6px 8px; margin: -6px -8px; border-radius: var(--r-sm); background: var(--accent-soft); }
.tm-bhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: var(--fs-sm); margin-bottom: 4px; }
.tm-bval { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-btrack { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.tm-bfill { display: block; height: 100%; border-radius: 999px; }
.tm-bfill.nailed { background: var(--good); }
.tm-bfill.regular { background: var(--warn); }
.tm-bfill.rotated { background: var(--bad); }
.tm-tactical { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.tm-tlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.tm-tlist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.tm-likely h4 { margin: 0; font-size: var(--fs-md); }

/* Style profiles (components/styles.js, Beta): neutral pills with an arrow, never a good/bad colour verdict */
.sty-grid { grid-template-columns: minmax(0, 560px) minmax(340px, 1fr); }
.sty-stats { grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); }
.sty-pill { border: 1px solid var(--line-strong); color: var(--fg); margin-left: 4px; }
.sty-pill.sty-weak { border-color: var(--accent); }
.sty-pill.rs-side { border-color: var(--info); }
.arch-link { cursor: pointer; background: var(--accent-soft); color: var(--accent-text); font: inherit; font-weight: 650; margin-left: 0; }
.pl-tact[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.sty-bars { margin-top: 8px; }
.sty-track { position: relative; overflow: visible; }
.sty-fill { background: var(--accent); }
.sty-avg { position: absolute; top: -3px; width: 2px; height: 14px; margin-left: -1px; border-radius: 1px; background: var(--fg); }
.sty-h { margin: 16px 0 6px; font-size: var(--fs-md); }
.sty-fx { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); }
.sty-fx ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.sty-dir { font-weight: 700; }
.sty-dir.sty-weak { color: var(--accent-text); }
.sty-map { display: block; width: 100%; height: auto; }
.sty-frame { fill: var(--sunk); stroke: var(--line); }
.sty-mid { stroke: var(--line-strong); stroke-dasharray: 4 4; }
.sty-pt circle { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.sty-pt.low circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.sty-pt.me circle { fill: var(--hi); stroke: var(--fg); stroke-width: 2; }
.sty-pt text { font-size: 15px; font-weight: 600; fill: var(--fg); }
.sty-pt.me text { font-size: 16px; font-weight: 800; }
.sty-q, .sty-ax { font-size: 14.5px; fill: var(--muted); }
.sty-table { margin-top: 8px; }

@media (max-width: 900px) {
  .tm-slot-grid, .sty-grid { grid-template-columns: 1fr; }
  .tm-sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* FL-130: one vertical page scroll on phones; retain horizontal table scrolling. */
@media (max-width: 600px) {
  .tm-pick-mobile { display: flex; }
  .tm-pick-mobile .sel { flex: 1 1 auto; }
  .tm-chips { display: none; }
  .tm-pitch { padding: 12px 6px; gap: 8px; }
  .tm-prow { gap: 4px; }
  .tm-slot { padding: 6px 3px; min-height: 62px; }
  .tm-sl-name { font-size: 11px; }
  .tm-sl-pct { font-size: 16px; }
  .explorer > .tablebox, .xptable > .tablebox { max-height: none; }
  .explorer > .tablebox th, .xptable > .tablebox th { transform: translateY(var(--phone-head-offset, 0)); }
}

/* Touch screens: iOS zooms the page into any field under 16px and doesn't zoom back, so fields are 16px there.
   Mouse screens keep their smaller size. Last in the last stylesheet so it wins over .filters and .search-box. */
@media (pointer: coarse) {
  .tm-likely .xi-lines { row-gap: 12px; }
  .tm-likely .xi-lines dd { padding: 8px 0; }
  .tm-tlist li { min-height: 40px; }
  .tm-bars { gap: 14px; }
  .filters select, .filters input, .sel, .search-box input, input:not([type="checkbox"], [type="radio"]), select, textarea { font-size: 16px; }
}

/* Press feedback: a control shrinks slightly while pressed, so a tap visibly lands. No transition, so it never lags a
   quick tap; off with reduced motion. (Hover lifts on .pc and .mcard give way to this while pressed.) */
@media (prefers-reduced-motion: no-preference) {
  .btn:active, .seg button:active, .chipbtn:active, .searchbtn:active, .theme-toggle:active, .pl-chip:active,
  .rs-btn:active, .pc:active, .mcard:active, .sheetbody button:active, .bottomnav button:active, #sidenav button:active { transform: scale(.97); }
}
