/* ============================================================
   TRANSFER PERFORMANCE — one shell, two URL states (`.cp.tp`, with
   `.tp--pair` on a comparison). Restyled on the SB2 design (Claude
   Design bundle): the shared `.cp` vocabulary from _competitions.css
   plus this page's `tp-` family.
   Controller contracts (transfer-performance_controller.js): the shared
   `.hidden` / `.is-loading` state primitives, plus `.is-dimmed` (excluded
   player), `.is-checked` (included checkbox), `.is-active` (keyboard-active
   picker option), `.is-off` / `.is-on` (position pill), `.is-open`
   (expanded players chevron), and the JS-rendered `tf-*` / `tp-pick-item-n`
   / `tp-pick-hint` rows.
   ============================================================ */

/* ── State primitives ──────────────────────────────────────── */
/* The template links this file after app.css, so the `.tp-*` rules below win
   ties against the shared `.cp-*` vocabulary — and would win the same tie
   against `.hidden` (app.css › _states.css): the selected-player chip, the
   chart's loading/error blocks and the collapsed players list stayed on
   screen. The state primitives keep priority inside the tool. */
.tp .hidden, .tp [hidden] { display: none !important; }

/* ── Page scaffolding ──────────────────────────────────────── */
/* `.cp` brings paper background, ink palette, nav offset and the
   Inter body font; here we only diverge from it. */
.tp-filters { position: static; top: auto; z-index: auto; }
/* Wide screens only: the bar is one compact row there. Narrower, it would
   eat a third of the viewport. */
@media (min-width: 1200px) {
  .tp--pair .tp-filters { position: sticky; top: var(--cp-nav-h); z-index: 40; }
}
.tp-filters-inner {
  grid-template-columns: 1fr;
  gap: 22px 32px;
}
@media (min-width: 980px) {
  .tp-filters-inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; }
}

.tp-body {
  max-width: 1160px; margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 48px) 80px;
}
.tp-results { display: flex; flex-direction: column; gap: 26px; }

/* ── Pairing row ───────────────────────────────────────────── */
.tp-pair {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end;
}
@media (max-width: 560px) {
  .tp-pair { grid-template-columns: 1fr; }
  .tp-medal { justify-self: center; }
}
.tp-f-comp { min-width: 0; }

/* Label above each picker: key + subline. */
.tp-comp-lbl { flex-direction: column; align-items: flex-start; text-align: left; gap: 5px; white-space: normal; margin-bottom: 0; }
.tp-comp-lbl-row { display: inline-flex; align-items: center; gap: 9px; }
.tp-lbl-key { color: var(--ink); font-weight: 700; }
.tp-comp-lbl-sub { color: var(--ink-3); font-weight: 500; letter-spacing: 0.1em; }

/* Decorative origin→destination medallion between the two pickers. */
.tp-medal {
  width: 44px; height: 44px; margin-bottom: 6px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-family: var(--font-condensed); font-weight: 800; font-size: 14px;
  letter-spacing: 0.02em; position: relative;
}

/* ── Competition picker ───────────────────────────────────── */
.tp-pick { position: relative; z-index: 10; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-pick-field { position: relative; }
.tp-pick-input {
  width: 100%; min-height: 58px; padding: 12px 40px 12px 13px;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 9px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Dashed while no competition is picked (the controller stamps the
   pick on the card as data-value). */
.tp-pick[data-value=""] .tp-pick-input { border-style: dashed; font-weight: 400; }
.tp-pick-input::placeholder { color: var(--ink-3); }
.tp-pick-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.tp-pick-search-ic {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-3); pointer-events: none;
}
.tp-pick-dd {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto; scrollbar-width: thin;
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}
.tp-pick-group {
  position: sticky; top: 0;
  padding: 6px 12px; background: var(--bg-3);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.tp-pick-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  font-size: 13.5px; color: var(--ink-2);
  transition: background-color 0.12s, color 0.12s;
}
.tp-pick-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-pick-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.tp-pick-item[aria-selected="true"] { color: var(--accent); font-weight: 600; }
/* Keyboard-active option — wins over hover/selected. */
.tp-pick-item.is-active { background: var(--bg-3); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--ink); }
.tp-pick-item--group { padding-left: 30px; font-size: 12.5px; color: var(--ink-3); }
.tp-pick-item-type {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
/* "254 transfers": the data-aware ranking's count. */
.tp-pick-item-n {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.02em; color: var(--accent-strong); white-space: nowrap;
}
.tp-pick-hint {
  padding: 9px 14px; font-size: 12px; line-height: 1.5; color: var(--ink-3);
}

/* ── Knobs: min games / seasons / normalize / positions ────── */
.tp-knobs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 18px; }
.tp-f-knob { gap: 6px; }
.tp-knob-note {
  font-family: var(--font-body); font-size: 11px; font-weight: 400;
  color: var(--ink-3); letter-spacing: 0; line-height: 1.5;
}
/* On a comparison the notes move into the inputs' tooltips (title
   attributes), so the bar stays a single row. */
.tp--pair .tp-knob-note { display: none; }
.tp-input {
  width: 96px; padding: 10px 12px;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 8px;
  font-family: inherit; font-size: 14px;
  transition: border-color 0.15s;
}
.tp-input:focus { outline: none; border-color: var(--accent); }

/* ── Facts strip: what is being measured ───────────────────── */
.tp-facts {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-3);
}
.tp-fact b { color: var(--ink); font-size: 14px; margin-right: 3px; }

/* ── Section headers ───────────────────────────────────────── */
.tp-section { display: flex; flex-direction: column; gap: 14px; }
.tp-section-h {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-condensed); font-weight: 800; font-size: 19px;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink);
  padding-bottom: 4px; margin: 0;
}
.tp-section-aside {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; text-align: right;
}
/* The answer receives focus after a picker-driven visit. */
.tp-section--stats:focus { outline: none; }
.tp-section--stats { scroll-margin-top: calc(var(--cp-nav-h) + 16px); }

/* Conference line under each side's competition name in the table heads
   (uppercase + letter-spaced there: reset so it reads normally). */
.tp-group-label--muted {
  display: block;
  font-size: 10px; font-weight: 700;
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: normal;
}

/* ── Stats comparison table ────────────────────────────────── */
/* padding-bottom: Safari/macOS overlay scrollbar draws ON TOP of the content
   and would cover the table's last row. */
.tp-stats-wrap { overflow-x: auto; padding-bottom: 10px; }
.tp-stats { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-stats th {
  padding: 12px 16px; text-align: left;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 2px solid var(--rule);
  white-space: nowrap;
}
.tp-stats td { padding: 10px 16px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.tp-stats tbody tr { border-bottom: 1px solid var(--rule-2); }
.tp-stats tbody tr:hover { background: color-mix(in srgb, var(--bg-3) 60%, transparent); }
.tp-stats th:nth-child(n+2), .tp-stats td:nth-child(n+2) { text-align: center; }
.tp-stats .tp-stats-min { background: color-mix(in srgb, var(--bg-3) 55%, transparent); }
.tp-stats-stat { font-weight: 500; color: var(--ink-2); }
.tp-stats-val { font-weight: 600; color: var(--ink); }
.tp-stats-col--origin { color: var(--ink-2); }
.tp-stats-col--dest { color: var(--accent-hover); }

/* Change cell: pill + directional consistency subline ("19/22 ↓"). */
.tp-chg-cell {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
}
.tp-cons {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  color: var(--ink-3); letter-spacing: 0.01em; white-space: nowrap;
}

/* Change pill: soft success/danger tint behind a signed percentage. One
   arrow path — the down state flips it. */
.tp-chg {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
}
.tp-chg svg { width: 12px; height: 12px; transition: transform 0.15s; }
.tp-chg--up { background: var(--success-soft); color: var(--success); }
.tp-chg--down { background: var(--danger-soft); color: var(--danger); }
.tp-chg--down svg { transform: rotate(180deg); }
.tp-chg--flat { background: var(--bg-3); color: var(--ink-3); }

.tp-select {
  padding: 10px 10px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg-2); color: var(--ink); font-family: inherit; font-size: 13px;
  cursor: pointer;
}
.tp-select:focus { outline: none; border-color: var(--accent); }
.tp-select--normalize {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-2));
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent-strong); font-weight: 700; font-size: 12px;
}

/* Per-player projection column: header hosts the player search. */
.tp-stats-proj-th { white-space: normal; min-width: 200px; }
[data-transfer-performance-target~="projectionHeader"] { position: relative; }
.tp-search-dd {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 192px; overflow-y: auto; scrollbar-width: thin;
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: normal;
}
.tp-search-input {
  width: 100%; padding: 5px 8px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 6px;
  font-family: var(--font-body); font-size: 12px; font-weight: 400;
  text-transform: none; letter-spacing: normal; color: var(--ink);
}
.tp-search-input::placeholder { color: var(--ink-3); }
.tp-search-input:focus { outline: none; border-color: var(--accent); }
.tp-selected-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-selected-clear { flex-shrink: 0; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-3); transition: color 0.12s; }
.tp-selected-clear:hover { color: var(--danger); }
.tp-selected-clear svg { width: 14px; height: 14px; display: block; }

/* ── Upgrade CTA (guests & free users) ─────────────────────── */
.tp-cta {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-radius: 12px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 5%, var(--bg-2)), color-mix(in srgb, var(--accent-2) 5%, var(--bg-2)));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
@media (min-width: 640px) { .tp-cta { flex-direction: row; } }
.tp-cta > .sb-btn { flex-shrink: 0; }
.tp-cta-body { display: flex; align-items: center; gap: 12px; }
.tp-cta-ic {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent);
}
.tp-cta-ic svg { width: 20px; height: 20px; }
.tp-cta-t { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.tp-cta-s { margin: 0; font-size: 12px; color: var(--ink-2); }

/* ── Chart cards ───────────────────────────────────────────── */
.tp-chart-card { background: var(--bg-2); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; }
.tp-chart-frame { position: relative; height: 448px; }
.tp-chart-meta { display: flex; justify-content: center; align-items: center; height: 100%; margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.tp-chart-meta--error { color: var(--danger); }

/* ── What translates: horizontal dot-and-interval plot ─────── */
/* Head, background grid, rows and bottom ticks all share --tl-cols / --tl-gap
   so column 2 (the rail) stays pixel-aligned at every viewport width. */
.tp-tl-card { padding: 18px 20px 14px; }
.tp-tl {
  --tl-cols: 92px minmax(0, 1fr) 64px 132px;
  --tl-gap: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.tp-tl-head, .tp-tl-grid, .tp-tl-row, .tp-tl-axis {
  display: grid; grid-template-columns: var(--tl-cols); column-gap: var(--tl-gap); align-items: center;
}
.tp-tl-head { padding-bottom: 4px; }
.tp-tl-zero-track { position: relative; height: 16px; }
.tp-tl-zero-lbl {
  position: absolute; bottom: 0;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--ink-3); white-space: nowrap;
}
.tp-tl-zero-lbl[data-align="center"] { transform: translateX(-50%); }
.tp-tl-zero-lbl[data-align="right"] { transform: translateX(-100%); padding-right: 4px; }
.tp-tl-zero-lbl[data-align="left"] { transform: translateX(0); padding-left: 4px; }
.tp-tl-col-h {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
  text-align: right; white-space: nowrap;
}
.tp-tl-plot { position: relative; }
.tp-tl-grid { position: absolute; inset: 0; pointer-events: none; }
.tp-tl-grid-rail { grid-column: 2; position: relative; height: 100%; }
.tp-tl-gridline {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--rule-2);
}
.tp-tl-gridline--zero {
  width: 0; background: none;
  border-left: 1.5px dashed color-mix(in srgb, var(--ink) 38%, transparent);
}
.tp-tl-rows { position: relative; z-index: 1; display: flex; flex-direction: column; }
.tp-tl-row {
  padding: 6px 0; border-bottom: 1px solid var(--rule-2);
  font-variant-numeric: tabular-nums;
  transition: background-color 0.12s;
}
.tp-tl-row:last-child { border-bottom: 0; }
.tp-tl-row:hover { background: color-mix(in srgb, var(--bg-3) 55%, transparent); border-radius: 4px; }
.tp-tl-stat { font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-tl-track { position: relative; height: 18px; }
.tp-tl-bar {
  position: absolute; top: 50%; height: 6px; transform: translateY(-50%);
  border-radius: 999px;
}
.tp-tl-bar--up { background: color-mix(in srgb, var(--success) 26%, transparent); }
.tp-tl-bar--down { background: color-mix(in srgb, var(--danger) 24%, transparent); }
.tp-tl-dot {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--bg-2);
}
.tp-tl-dot--up { background: var(--success); }
.tp-tl-dot--down { background: var(--danger); }
/* Cut off at an axis limit: the dot becomes an arrow, the bar gets a hard end. */
.tp-tl-dot--over-low, .tp-tl-dot--over-high { width: 10px; height: 11px; border-radius: 0; box-shadow: none; }
.tp-tl-dot--over-high { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.tp-tl-dot--over-low { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.tp-tl-bar--clipped-low { border-left: 2px solid var(--ink-3); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tp-tl-bar--clipped-high { border-right: 2px solid var(--ink-3); border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tp-tl-pct {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  text-align: right; white-space: nowrap;
}
.tp-tl-pct--up { color: var(--success); }
.tp-tl-pct--down { color: var(--danger); }
.tp-tl-range {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  text-align: right; white-space: nowrap;
}
.tp-tl-axis { padding-top: 6px; }
.tp-tl-ticks { position: relative; height: 16px; }
.tp-tl-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tp-tl-tick--first { transform: translateX(0); }
.tp-tl-tick--last { transform: translateX(-100%); }
.tp-tl-tick--zero { color: var(--ink); font-weight: 700; }
.tp-tl-note {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule-2);
  font-size: 11.5px; line-height: 1.5; color: var(--ink-3);
}
@media (max-width: 639px) {
  .tp-tl-card { padding: 14px 14px 12px; }
  .tp-tl { --tl-cols: 62px minmax(0, 1fr) 84px; --tl-gap: 8px; }
  .tp-tl-col-h--range { display: none; }
  .tp-tl-row { row-gap: 1px; padding: 6px 0; }
  .tp-tl-stat { grid-column: 1; grid-row: 1 / span 2; font-size: 12px; }
  .tp-tl-track { grid-column: 2; grid-row: 1 / span 2; }
  .tp-tl-pct { grid-column: 3; grid-row: 1; line-height: 1.15; }
  .tp-tl-range { grid-column: 3; grid-row: 2; font-size: 9.5px; line-height: 1.15; }
  /* Narrow tracks cannot fit 6 tick labels without collisions: keep outer bounds
     and 0%, dropping whichever outer tick sits right beside an edge-hugging 0%. */
  .tp-tl-tick { font-size: 9.5px; }
  .tp-tl-tick:not(.tp-tl-tick--first):not(.tp-tl-tick--last):not(.tp-tl-tick--zero) { display: none; }
  .tp-tl[data-zero-align="right"] .tp-tl-tick--last { display: none; }
  .tp-tl[data-zero-align="left"] .tp-tl-tick--first { display: none; }
}

/* ── Players (collapsed by default: the detail, not the answer) ── */
.tp-players-toggle { margin-left: auto; text-transform: none; letter-spacing: normal; font-family: var(--font-body); font-size: 12px; }
.tp-players-toggle svg { width: 14px; height: 14px; transition: transform 0.2s; }
.tp-players-toggle svg.is-open { transform: rotate(180deg); }
.tp-players-body { display: flex; flex-direction: column; gap: 12px; }
.tp-players-search { width: min(320px, 100%); }
.tp-list-wrap { max-height: 560px; overflow-y: auto; padding-right: 4px; }

.tp-posfilter { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tp-posfilter-lbl {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px;
}
.tp-pos-btn {
  min-width: 40px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; cursor: pointer; transition: all 0.12s;
}
.tp-pos-btn:hover { border-color: var(--ink); color: var(--ink); }
.tp-pos-btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tp-pos-btn.is-off { border-color: var(--rule); background: var(--bg-2); color: var(--ink-3); }

/* Checkbox (player row + season toggle-all): accent fill when included. */
.tp-check {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--rule); background-color: var(--bg-2);
  padding: 0; cursor: pointer; font: inherit; appearance: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.tp-check svg { width: 12px; height: 12px; color: var(--on-accent); }
.tp-check.is-checked { background-color: var(--accent); border-color: var(--accent); }

/* Season group header: toggle-all checkbox + season label + count. */
.tp-group { margin-top: 24px; }
.tp-group:first-child { margin-top: 0; }
.tp-group-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tp-group-lbl {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.tp-group-count { font-family: var(--font-mono); font-size: 10px; color: color-mix(in srgb, var(--ink-3) 60%, transparent); }

/* Player row (click or Space toggles inclusion). */
.tp-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; margin: 0 -4px; border-radius: 6px; cursor: pointer;
  transition: background-color 0.15s, opacity 0.2s;
}
.tp-row:hover { background: var(--bg-3); }
.tp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Player excluded from the averages (by hand or through the position filter). */
.tp-row.is-dimmed { opacity: 0.4; }
.tp-flag { display: inline-flex; margin-right: 4px; }
.tp-pl-name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  transition: color 0.12s;
}
a.tp-pl-name:hover { color: var(--accent); }
.tp-pl-meta { font-size: 12px; color: var(--ink-3); }
.tp-pos-pills { display: inline-flex; gap: 4px; }
.tp-pos-pill {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 5px; padding: 2px 7px; letter-spacing: 0.04em;
}
/* From-team → to-team at the right edge of each player row. */
.tp-player-route {
  margin-left: auto; font-size: 11px; color: var(--ink-3);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 767px) { .tp-player-route { display: none; } }

.tp-collapse {
  margin-top: 16px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 0; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 500; color: var(--ink-3);
  transition: color 0.15s;
}
.tp-collapse:hover { color: var(--ink-2); }
.tp-panel-empty { text-align: center; padding: 32px 0; color: var(--ink-3); margin: 0; }

/* Selected-player chip: display is owned here so the JS only toggles
   .hidden (the markup keeps its layout to this rule). */
[data-transfer-performance-target~="selectedPlayer"] {
  display: flex; align-items: center; gap: 6px;
}

/* ── Popular comparisons (pair-less state) ─────────────────── */
.tp-pop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
@media (max-width: 480px) { .tp-pop-grid { grid-template-columns: 1fr; } }
.tp-pop {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px; background: var(--bg-2);
  border: 1px solid var(--rule); border-radius: 14px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tp-pop:hover {
  transform: translateY(-2px); border-color: var(--ink);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}
.tp-pop-names {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center;
}
.tp-pop .tp-medal { width: 34px; height: 34px; margin: 0; font-size: 12px; }
.tp-route-name {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-condensed); font-weight: 900;
  font-size: clamp(20px, 2.4vw, 27px); line-height: 1;
  text-transform: uppercase; letter-spacing: 0.005em; color: var(--ink);
  transition: color 0.12s;
}
.tp-pop .tp-route-name { font-size: 16px; }
.tp-pop-names .tp-route-name:last-child { text-align: right; }
.tp-pop:hover .tp-route-name { color: var(--accent); }
.tp-pop-n {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3);
}
.tp-pop-lede { margin: 4px 0 0; max-width: 62ch; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* ── Related comparisons ───────────────────────────────────── */
.tp-related { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.tp-related-h { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tp-related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tp-related-n { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--ink-3); }
.cp-empty .tp-related-list { justify-content: center; }

/* ============================================================
   JS-rendered rows
   ============================================================ */

/* Player search dropdown rows. */
.tf-dropdown-item {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.tf-dropdown-item:hover {
  background-color: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
}
.tf-dropdown-empty {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--ink-3);
}

/* Projection cells: current value → projected value + 80% range subline. */
.tf-stat-empty { color: var(--ink-3); opacity: 0.5; }
.tf-stat-main { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.tf-stat-base { font-size: 12px; color: var(--ink-3); }
.tf-stat-up { color: var(--success); font-weight: 600; }
.tf-stat-down { color: var(--danger); font-weight: 600; }
.tf-stat-range {
  display: block; margin-top: 2px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  color: var(--ink-3); white-space: nowrap;
}
