/* ===========================================================
   MLS Salary Cap -- design tokens ("Pitch Grid" system)
   Display: Rubik (headings, nav, section titles)
   Body:    Nunito Sans (copy, labels)
   Data:    Space Mono (every numeric/stat column -- tabular)
   Palette: a light chalk-and-turf ground, a muted amber accent for
            the "salary cap / money" theme, pitch-green for
            positive stat emphasis, and a cool blue reserved only
            for the playoff line -- never reused for anything else
            so it stays legible as a single, consistent signal.

   2026-11: re-tokenized from the original dark broadcast-ground
   system to Pitch Grid (light). Two things that assumed a DARK
   --bg were fixed at point of use rather than here -- see
   `.tab.active` and `.position-toggle-btn.active[data-pos]` below,
   which now read `color: var(--text)` instead of `var(--bg)`.
   --accent-2 changed hue (old #49c292 -> new #1f7a4d) to keep
   AA contrast as a light-surface foreground color; its one hardcoded
   rgba() tint (academy designation badge) was updated to match.
   --pos-gk/def/mid/fwd are left at their ORIGINAL hex values on
   purpose: they're a validated 4-step ordinal ramp checked against
   the old dark surface (#0b0e13) and re-validating a new ramp
   against the new light surface is out of scope for this pass. One
   side effect: --pos-def was intentionally equal to --accent so the
   Cap Hit bar's DEF segment read as "the same gold" as the rest of
   the site; now that --accent is amber (#f2b134) and --pos-def is
   still gold (#d7b65c), that visual echo is broken until the ramp
   itself gets re-validated for light mode. */

:root {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --surface-2: #edf2ea;
  --border: #dce5de;
  --text: #11261a;
  --text-dim: #4b6354;
  --text-faint: #5e7768;

  --accent: #f2b134;       /* amber -- salary cap / money */
  --accent-soft: #fbeacb;
  --accent-2: #1f7a4d;     /* pitch green -- goals / positive stats */
  --playoff: #2f6e8c;      /* reserved solely for the clinched-playoff line */
  --playoff-bg: rgba(47, 110, 140, 0.08);
  --playin: #8a5cb0;       /* reserved solely for the wild-card play-in line
                               (standings ranks 8-9) -- a distinct hue from
                               --playoff, not a tint of it, so "clinched"
                               and "still has to win a play-in game" read
                               as two different states at a glance rather
                               than two strengths of the same one */
  --playin-bg: rgba(138, 92, 176, 0.08);
  --status-urgent: #b03a2e; /* reserved status color -- player-hero "Free
                                Agent" marker only, never a categorical/
                                data hue (same reservation rule as --playoff) */

  /* Cap Hit bar (home page) -- one hue (the existing gold accent),
     stepped light-to-dark by position group, GK->FWD (roster.js's own
     GROUP_ORDER). Validated as a 4-step ordinal ramp against the
     ORIGINAL dark surface: monotonic lightness, >=0.06 steps apart,
     single hue (node scripts/validate_palette.js from Anthropic's
     dataviz skill, "#e9d49a,#d7b65c,#b89245,#8a6d2f" --mode dark
     --surface "#0b0e13" --ordinal -- all checks pass). Left
     unchanged in the Pitch Grid pass above -- see the file-header
     note on re-validating this against the new light surface. */
  --pos-gk: #e9d49a;
  --pos-def: #d7b65c;
  --pos-mid: #b89245;
  --pos-fwd: #8a6d2f;

  --font-display: 'Rubik', 'Oswald', sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;

  --radius: 8px;
  --wrap: 1180px;
}

/* Visually hides content while keeping it in the accessibility tree and
   available to search engines/crawlers -- used for the homepage's <h1>,
   which duplicates the wordmark's meaning for SEO without visually
   competing with the KPI bar as a second giant heading. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 32px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.wordmark-main { color: var(--text); }
.wordmark-accent { color: var(--accent); margin-left: 6px; }

.main-nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.main-nav a { color: var(--text-dim); padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Nine nav links (Highest Paid and Transfers were added): tighten the desktop
   header so the search box never pushes the page sideways. The content column
   tops out at 1180px, so the compact sizing applies at every desktop width; below
   ~1500px (where nine links plus the logo and search no longer fit on one line) the logo gets its
   own row, the way the phone layout does. */
@media (min-width: 761px) {
  .main-nav { gap: 14px; font-size: 13px; letter-spacing: 0.01em; }
  .main-nav a { white-space: nowrap; }
  .site-search-input { width: 150px; }
  .header-right { gap: 14px; }
}
@media (min-width: 761px) and (max-width: 1500px) {
  .header-row { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 10px; }
  .header-right { flex-wrap: wrap; width: 100%; justify-content: space-between; row-gap: 8px; }
  .main-nav { flex-wrap: wrap; row-gap: 6px; }
}

/* ---------- mobile nav toggle (hamburger + slide-out panel, nav.js) ----------
   .main-nav's own markup/links are shared with desktop -- only how it's
   POSITIONED changes at the 760px breakpoint below. Above that width the
   toggle/close button and backdrop stay display:none and .main-nav lays
   out exactly as the flex row above; nav.js's open()/close() just flip
   the .is-open class these rules key off. */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}
.nav-close { display: none; }

/* z-index: 5, NOT a bigger number -- this looked backwards until a real
   phone caught it (reported: menu opens, everything's dimmed, links
   don't tap). nav.js appends this straight to <body>, a SIBLING of
   .site-header, not a child of it. .site-header is `position: sticky`
   with its own z-index: 10, which makes it a stacking context -- so
   .main-nav's z-index: 200 below is only ever compared against OTHER
   THINGS INSIDE THE HEADER (the toggle button, the search dropdown,
   etc.), never against this backdrop directly. Whatever z-index this
   backdrop gets, the entire header -- including the slide-out panel
   nested inside it -- can only ever stack at the header's OWN z-index
   (10) once compared from outside that context. A backdrop at 190 (or
   any value >= 10) therefore painted over the open panel and ate every
   tap, even though the panel's own z-index: 200 looked like it should
   win. Keeping this below the header's z-index (10) instead of above
   it is what actually puts the backdrop UNDER the header + panel while
   still sitting above ordinary page content (which has no z-index of
   its own, i.e. stacks at 0) -- exactly the dim-the-rest-of-the-page
   effect this is for. */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 19, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}
.nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

body.nav-open { overflow: hidden; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    transform: translateX(100%);
    width: min(78vw, 320px);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 64px 24px 24px;
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a {
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-close {
    display: block;
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--text-dim);
    cursor: pointer;
  }
}

/* ---------- header search (search.js, every page) ---------- */

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-search { position: relative; }
.site-search-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  width: 190px;
  transition: width 0.15s ease;
}
.site-search-input::placeholder { color: var(--text-faint); }
.site-search-input:focus { outline: none; border-color: var(--accent); width: 240px; }
.site-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 32px rgba(17, 38, 26, 0.14);
  z-index: 30;
}
.site-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.site-search-result:last-child { border-bottom: none; }
.site-search-result:hover,
.site-search-result.active-result { background: var(--surface-2); }
.site-search-result img,
.site-search-result .search-result-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--surface-2);
}
.site-search-result-text { display: flex; flex-direction: column; min-width: 0; }
.site-search-result-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-search-result-meta {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-search-empty {
  padding: 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-faint);
}
@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 10px; }
  .header-right { flex-wrap: wrap; width: 100%; justify-content: space-between; gap: 12px; }
  .site-search-input { width: 100%; }
  .site-search-input:focus { width: 100%; }
  .site-search-results { width: 100%; }
}

/* ---------- Match Ticker (home page) ----------
   Upcoming kickoffs over the next week + results from the past week,
   synced once a day (not a live feed -- see sync/lib/fixtures.js and the
   panel-sub copy baked into index.html, which is why .match-ticker-sub
   says so right in the header rather than leaving it to be assumed).
   Self-scrolling, not auto-scrolling: the track used to be an infinite
   CSS-animated marquee (duplicated card list + translateX keyframe), but
   that moved on its own and could carry a match right past the reader
   before they'd read it. It's now a plain horizontally-scrollable row --
   native touch/trackpad swipe, mouse wheel with shift, or the two nav
   buttons (wired in app.js, each one card-width per click) -- with
   scroll-snap so it settles on a card edge instead of mid-card. */

.match-ticker {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.match-ticker-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 24px 0;
}
.match-ticker-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.match-ticker-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-faint);
}
.match-ticker-body {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
}
.match-ticker-nav {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.match-ticker-nav:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.match-ticker-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.match-ticker-track-wrap {
  flex: 1;
  min-width: 0; /* let a flex item actually shrink so overflow-x can kick in */
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 8px 8px 10px;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
}
.match-ticker-track-wrap::-webkit-scrollbar { display: none; }
.match-ticker-track {
  display: inline-flex;
  align-items: stretch;
}
.match-ticker-empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}
/* One of these precedes the first card of each calendar day in the
   ticker -- "Thursday, Nov 19th" -- so the date lives in one place per
   day instead of repeating on every card (see fmtMatchDayHeader() /
   renderMatchTickerHtml() in app.js). Shares .match-card's border-right
   + scroll-snap rhythm so it reads as part of the same row, not a
   separate element bolted on. */
.match-ticker-day {
  display: inline-flex;
  flex-direction: column; /* stacked weekday/date = narrower, a bit taller -- was one line */
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 0 14px;
  border-right: 1px solid var(--border);
  scroll-snap-align: start;
}
.match-ticker-day-weekday {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  line-height: 1.25;
}
.match-ticker-day-date {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  line-height: 1.25;
}
.match-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 28px;
  border-right: 1px solid var(--border);
  scroll-snap-align: start;
}
.match-card:last-child { border-right: none; }
.match-card-teams {
  display: flex;
  align-items: center;
  gap: 10px;
}
.match-card-team {
  display: flex;
  align-items: center;
  gap: 6px;
}
.match-card-logo { width: 30px; height: 30px; object-fit: contain; }
.match-card-logo-empty {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.match-card-abbr {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.match-card-score {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.match-card-score-pre {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  font-family: var(--font-body);
}
.match-card-status {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-faint);
}
/* --accent-2 (pitch green) marks "in progress" -- --playoff blue stays
   reserved solely for the standings playoff line, per this file's own
   top-of-file palette note. */
.match-card[data-state="in"] .match-card-status,
.match-card[data-state="in"] .match-card-score {
  color: var(--accent-2);
}
/* Tighter horizontal rhythm below 760px -- the ticker's own padding
   values above are sized for a desktop-width row; at phone width the
   same padding eats a disproportionate share of a much narrower track,
   so fewer matches are visible per screen. Nothing here changes what's
   IN a card, just how much air sits around it. */
@media (max-width: 760px) {
  .match-ticker-body { padding: 0 8px; }
  .match-ticker-track-wrap { padding: 8px 4px 10px; }
  .match-card { padding: 0 14px; }
  .match-card-teams { gap: 8px; }
  .match-card-team { gap: 4px; }
  .match-ticker-day { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .match-ticker-track-wrap { scroll-behavior: auto; }
}

/* ---------- layout ---------- */

main.wrap {
  padding-top: 32px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.panel-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 860px) {
  .panel-pair { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  font-size: 24px;
  color: var(--text);
}
.panel-sub {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}
.panel-sub a { color: var(--accent); text-decoration: none; }
.panel-sub a:hover { text-decoration: underline; }

.legend-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-left: 3px solid var(--playoff);
  background: var(--playoff-bg);
  vertical-align: middle;
  margin: 0 2px;
}
.legend-swatch.playin {
  border-left-color: var(--playin);
  background: var(--playin-bg);
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 14px 24px 0;
}

/* homepage-panel-scoped tabs (Free Agency Watch) -- same look as .tabs
   above, kept as its own class so wireStandingsTabs()'s ".tabs .tab"
   selector in app.js doesn't also pick these buttons up. */
.widget-tabs,
.po-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 24px 0;
}

/* page-level tabs (team.js: Starting XI / Salary Cap) -- same .tab button
   styling as the in-panel .tabs above, but sitting directly in main.wrap
   (which already supplies 24px side padding and a 28px gap above/below
   as a flex child) rather than inside a panel, so no side padding here
   and a full-width bottom border closes off the row instead of a panel
   border. */
.page-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.tab {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 8px 16px;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- table toolbar (search + count) ---------- */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 24px 0;
}
.search-input {
  flex: 0 1 280px;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { outline: none; border-color: var(--accent); }
.table-count {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ---------- toolbar filters (position / team / salary / minutes) ---------- */

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-group label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  white-space: nowrap;
}
.filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--accent); }
.minutes-filter {
  min-width: 220px;
}
.minutes-filter label {
  flex-shrink: 0;
}
.minutes-filter label span {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.minutes-filter input[type="range"] {
  flex: 1 1 120px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- position toggle pills (free agency) ---------- */

.position-toggle-group {
  display: flex;
  gap: 6px;
}
.position-toggle-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.position-toggle-btn:hover { color: var(--text); border-color: var(--text-dim); }
.position-toggle-btn.active[data-pos="GK"] { color: var(--text); background: var(--pos-gk); border-color: var(--pos-gk); }
.position-toggle-btn.active[data-pos="DEF"] { color: var(--text); background: var(--pos-def); border-color: var(--pos-def); }
.position-toggle-btn.active[data-pos="MID"] { color: var(--text); background: var(--pos-mid); border-color: var(--pos-mid); }
.position-toggle-btn.active[data-pos="FWD"] { color: var(--text); background: var(--pos-fwd); border-color: var(--pos-fwd); }

/* ---------- guaranteed-comp dual-range filter (free agency) ---------- */

.comp-range-filter {
  min-width: 240px;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}
.comp-range-filter label {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.comp-range-filter label span {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
}
.comp-range-inputs {
  position: relative;
  display: flex;
  align-items: center;
  height: 20px;
  width: 220px;
}
.comp-range-inputs input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  background: transparent;
  pointer-events: none;
}
.comp-range-inputs input[type="range"]::-webkit-slider-thumb { pointer-events: auto; }
.comp-range-inputs input[type="range"]::-moz-range-thumb { pointer-events: auto; }


/* ---------- load more ---------- */

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 24px 20px;
}
.load-more-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 20px;
  cursor: pointer;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- tables ---------- */

.article .table-scroll { overflow-x: auto; padding: 0; margin: 0; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}

.data-table thead th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text); }
.data-table th.sortable::after {
  content: '\2195';
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.35;
}
.data-table th.sortable.sort-active { color: var(--accent); }
.data-table th.sortable.sort-active::after { opacity: 1; }
.data-table th.sortable[data-sort-dir="asc"]::after { content: '\2191'; }
.data-table th.sortable[data-sort-dir="desc"]::after { content: '\2193'; }

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-2); }

.data-table th.num, .data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table td:first-child, .data-table th:first-child { padding-left: 24px; }
.data-table td:last-child, .data-table th:last-child { padding-right: 24px; }

/* ---------- sticky identity column (mobile) ----------
   Most of this site's tables are wider than a phone screen and already
   scroll horizontally inside .table-scroll (overflow-x: auto) without
   breaking the page -- see that rule above. What's rough on mobile is
   losing track of WHICH ROW you're looking at once "Player" has
   scrolled off to the left under your thumb. Pinning the identity
   column fixes that -- but on the ranked list tables (free agency, best
   value, production index, home page previews, golden boot, standings,
   salaries) that column isn't the first child, it's the second: the
   first is a bare "#" rank number that's low-value on a narrow screen
   (it just duplicates row order) and not worth the horizontal space a
   sticky copy of it would cost. Those tables carry an extra .has-rank
   class (see their <table> tags) specifically so this block can drop
   the "#" column and pin the real identity column in its place, while
   tables with no rank column (team roster, position breakdown, GAM/TAM
   log, salary rules dates) just pin their first column as-is. */
@media (max-width: 760px) {
  /* left: -24px, not 0 -- .table-scroll has its own 24px left padding
     (see its rule above), and position: sticky anchors "left" against
     the scrolling ancestor's PADDING box, not its visible/clipped edge.
     At left: 0 the sticky cell rested a full 24px short of that edge,
     leaving a gap the next (non-sticky, still-scrolling) column's text
     could show through underneath as the table scrolled -- caught by
     loading this live after shipping it and watching a stray letter
     from the Pos column bleed out from under the pinned Player name.
     Offsetting by the container's own padding pulls the sticky cell
     flush against the real edge and closes that gap. */
  .data-table:not(.has-rank) td:first-child,
  .data-table:not(.has-rank) th:first-child {
    position: sticky;
    left: -24px;
    z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }
  .data-table:not(.has-rank) thead th:first-child { z-index: 2; }

  .data-table.has-rank td:first-child,
  .data-table.has-rank th:first-child {
    display: none;
  }
  .data-table.has-rank td:nth-child(2),
  .data-table.has-rank th:nth-child(2) {
    position: sticky;
    left: -24px;
    z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }
  .data-table.has-rank thead th:nth-child(2) { z-index: 2; }

  /* The sticky cell's own background (above) otherwise outranks the
     row-hover rule earlier in this file on specificity, so the pinned
     column would stay put instead of highlighting with the rest of a
     hovered row -- this restores it. */
  .data-table:not(.has-rank) tbody tr:hover td:first-child,
  .data-table.has-rank tbody tr:hover td:nth-child(2) {
    background: var(--surface-2);
  }

  /* Same outranking problem for the standings table's playoff/play-in
     tint: its border-left + background live on tr.playoff-line /
     tr.playin-line td:first-child, but :first-child on this table is
     the now-hidden rank column (see .has-rank above), so without this
     the color marker would silently vanish on mobile. Re-applies both
     to the sticky Club column (nth-child(2)) instead, specific enough
     to beat the plain var(--surface) sticky background above. */
  .data-table.has-rank tr.playoff-line td:nth-child(2) {
    background: var(--playoff-bg);
    border-left: 3px solid var(--playoff);
  }
  .data-table.has-rank tr.playin-line td:nth-child(2) {
    background: var(--playin-bg);
    border-left: 3px solid var(--playin);
  }
}

.state-row td {
  font-family: var(--font-body);
  color: var(--text-dim);
  white-space: normal;
}

/* club cell: logo + abbreviation */
.club-cell { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 500; }
.club-cell img { width: 20px; height: 20px; object-fit: contain; }

/* club cell wrapped in a link to that team's page (home page Cap Room table) */
.club-cell-link { display: inline-flex; }
.club-cell-link:hover .club-cell { color: var(--accent); }

/* player name -> /players/:slug link, used in Best Value / Production
   Index tables and team roster chips */
.player-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}
.player-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- MLS roster designation badges (DP/TAM/U22/Homegrown/
   Generation Adidas) -- from the roster-data cap-mechanics import, used
   on player chips (team.js) and the player page's Roster Designation
   panel. Color encodes "where this player came from" the way the
   playoff-line blue encodes something specific elsewhere: gold for a
   Designated Player (the headline-cap-mechanic case), green for
   academy-produced talent (Homegrown Player / Generation Adidas),
   neutral border-only for everything else (TAM Player / U22
   Initiative / plain senior-minimum roster spot). */
.designation-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.designation-badge[data-tier="dp"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.designation-badge[data-tier="academy"] {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: rgba(31, 122, 77, 0.1);
}

/* playoff / play-in line highlighting on the standings table -- ranks
   1-7 (per conference) clinch outright, 8-9 play a wild-card game for
   the conference's last spot, so each gets its own color rather than
   lumping "clinched" and "still has to win a play-in game" together
   under one swatch (see --playoff / --playin in the token block). */
.data-table tr.playoff-line td {
  background: var(--playoff-bg);
}
.data-table tr.playoff-line td:first-child {
  border-left: 3px solid var(--playoff);
  padding-left: 21px;
}
.data-table tr.playin-line td {
  background: var(--playin-bg);
}
.data-table tr.playin-line td:first-child {
  border-left: 3px solid var(--playin);
  padding-left: 21px;
}

/* ---------- stat cards (key-figures grids) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 20px 24px 24px;
}
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.stat-card-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat-card-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ---------- cap/contract panel (player page) ---------- */
.cap-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 0;
}
.cap-badge-row .designation-badge { font-size: 12px; padding: 4px 10px; }
.cap-badge-row .cap-badge-empty {
  color: var(--text-faint);
  font-size: 13px;
}
.table-scroll {
  overflow-x: auto;
  padding: 4px 24px 20px;
}
.table-scroll .data-table { min-width: 420px; }
.panel-note {
  margin: 0 24px 20px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Cap Hit bar chart (home page "Cap Hit Leaders" panel) ----------
   Replaces a plain ranked table: each club is one row -- a segmented bar
   (Est. Cap Hit, split into GK/DEF/MID/FWD) plus a pin-style marker for
   Guaranteed Comp, so the DP/U22 discount (the gap between the marker and
   where the bar ends) reads at a glance instead of living in a second
   column. See public/js/app.js's renderCapRoom() for the render logic and
   sync/lib/teamPayrolls.js for where capHitByPosition is computed. */
.caphit-wrap {
  padding: 4px 24px 20px;
  overflow-x: auto;
}
.caphit-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 560px;
}
.caphit-legend-item { display: flex; align-items: center; gap: 6px; }
.caphit-legend-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.caphit-legend-tick {
  width: 3px; height: 14px; border-radius: 1.5px; background: var(--text);
  flex-shrink: 0; position: relative; margin: 0 3px;
}
.caphit-legend-tick::before {
  content: '';
  position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--text);
}

.caphit-row {
  display: grid;
  grid-template-columns: 112px 1fr 72px;
  align-items: center;
  gap: 14px;
  padding: 5px 0;
  min-width: 560px;
}
.caphit-track {
  position: relative;
  height: 24px;
  background: var(--surface-2);
  border-radius: 4px;
  cursor: pointer;
}
.caphit-row:hover .caphit-track,
.caphit-row:focus-within .caphit-track { outline: 1px solid var(--border); }
.caphit-seg { position: absolute; top: 0; height: 24px; transition: filter 0.1s; }
.caphit-seg.seg-first { border-radius: 4px 0 0 4px; }
.caphit-seg.seg-last { border-radius: 0 4px 4px 0; }
.caphit-seg.seg-only { border-radius: 4px; }
.caphit-row:hover .caphit-seg,
.caphit-row:focus-within .caphit-seg { filter: brightness(1.12); }

.caphit-tick {
  position: absolute;
  top: -5px;
  width: 3px;
  height: 34px;
  background: var(--text);
  border-radius: 1.5px;
  box-shadow: 0 0 0 2px var(--surface);
  transform: translateX(-1.5px);
}
.caphit-tick::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 2px var(--surface);
}
.caphit-overflow-label {
  /* A solid chip, not bare text -- this label sits ON TOP of whichever
     --pos-* segment color happens to be at the bar's right edge (GK
     through FWD, light tan to dark brown). var(--text-dim) alone read
     fine against those segments when it was a light color (old dark
     theme); now that it's dark green it goes illegible over the
     darker segments (MID/FWD). A surface-colored chip makes it legible
     over every segment color, not just the lighter ones. */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--surface);
  border-radius: 3px;
  padding: 1px 5px;
  box-shadow: 0 0 0 1px var(--border);
  white-space: nowrap;
}

.caphit-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.caphit-tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.1s;
  box-shadow: 0 8px 24px rgba(17, 38, 26, 0.16);
  min-width: 160px;
}
.caphit-tooltip.visible { opacity: 1; }
.caphit-tooltip .tt-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.caphit-tooltip .tt-title img { width: 18px; height: 18px; }
.caphit-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 3px;
  color: var(--text-dim);
}
.caphit-tooltip .tt-key { display: flex; align-items: center; gap: 6px; }
.caphit-tooltip .tt-swatch { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.caphit-tooltip .tt-swatch.tick { width: 3px; height: 10px; border-radius: 1.5px; background: var(--text); }
.caphit-tooltip .tt-val { font-family: var(--font-mono); font-weight: 600; color: var(--text); }
.caphit-tooltip .tt-divider { border-top: 1px solid var(--border); margin: 6px 0; }

@media (max-width: 760px) {
  .caphit-row { grid-template-columns: 92px 1fr 60px; gap: 10px; }
}

/* ---------- prose panels (rules / reference copy) ---------- */

.panel-body {
  padding: 4px 24px 24px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
}
.panel-body p { margin: 0 0 12px; }
.panel-body p:last-child { margin-bottom: 0; }
.panel-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.panel-body li { margin-bottom: 6px; }
.panel-body li:last-child { margin-bottom: 0; }
.panel-body strong { color: var(--text); font-weight: 600; }
.panel-body .figure { font-family: var(--font-mono); color: var(--accent); }
.panel-body .note {
  margin-top: 4px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
}
.panel-body a { color: var(--accent); text-decoration: none; }
.panel-body a:hover { text-decoration: underline; }
.panel-body h3 {
  font-size: 15px;
  color: var(--text);
  margin: 20px 0 10px;
}
.panel-body h3:first-child { margin-top: 0; }

.model-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 4px 0 16px;
}
.model-compare > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.model-compare h3 { margin: 0 0 8px; }
.model-compare ul { margin: 0; }

/* ---------- empty / placeholder states ---------- */

.empty-state {
  padding: 24px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- page intro (secondary pages) ---------- */

.page-intro {
  padding-top: 32px;
}
.page-intro h1 {
  font-size: 34px;
  color: var(--text);
}
.page-intro p {
  margin: 8px 0 0;
  max-width: 640px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.breadcrumb {
  padding-top: 24px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- depth charts hub (team grid) ---------- */

.conf-heading {
  margin: 36px 0 16px;
  font-size: 18px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.team-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.team-card img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.team-card-logo-fallback {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.team-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- team page hero ---------- */

.team-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 0 8px;
  border-bottom: 3px solid var(--team-color, var(--accent));
  margin-bottom: 8px;
}
.team-hero-logo img { width: 72px; height: 72px; object-fit: contain; }
.team-hero-eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--team-color, var(--accent));
}
.team-hero-info h1 {
  font-size: 36px;
  color: var(--text);
  margin: 2px 0;
}
/* Search-phrase suffix inside a hero H1 ("Roster & Salaries 2026"): same heading, quieter second line. */
.h1-suffix {
  display: block;
  margin-top: 4px;
  font-size: 0.45em;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-dim);
}
.team-hero-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Free Agency Watch card (team page, between the hero and
   the Starting XI/Salary Cap tabs) -- this team's pending free agents
   and option decisions, see team.js's renderFreeAgencyWatch(). Visible
   on both tabs since it sits above them; team.js hides the whole
   element (not just empties the lists) when neither pool has anyone. */
.fa-watch {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0 20px;
}
.fa-watch-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.fa-watch-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}
.fa-watch-sub {
  font-size: 12px;
  color: var(--text-faint);
}
.fa-watch-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 620px) {
  .fa-watch-cols { grid-template-columns: 1fr; }
}
.fa-watch-col-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.fa-watch-col-label.fa { color: var(--status-urgent); }
.fa-watch-col-label.opt { color: var(--accent-2); }
.fa-watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.fa-watch-row:first-of-type { border-top: none; }
.fa-watch-name {
  color: var(--text);
  font-weight: 600;
}
.fa-watch-pos {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: 6px;
}
.fa-watch-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.fa-watch-empty {
  font-size: 12px;
  color: var(--text-faint);
  padding: 7px 0;
}
/* Contract-status note appended to the hero bio line (player page only)
   -- "Free Agent" gets the one reserved status color + bold/uppercase so
   it reads as an alert among the plain bio facts; "Option ends YYYY" /
   "Signed to YYYY" just need to read as a little more definite than the
   surrounding --text-dim facts, not alarming, so they stay unstyled
   beyond a darker ink and medium weight. */
.contract-note.is-free-agent {
  color: var(--status-urgent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.contract-note.is-option,
.contract-note.is-signed {
  color: var(--text);
  font-weight: 600;
}
/* Retired -- deliberately NOT the urgent/red treatment free-agent gets
   (retiring isn't an alert to act on), just a clear, muted label. Reused
   as-is on the Salary Cap tab's full-roster table and the depth chart's
   bench chips (see .chip-retired below). */
.contract-note.is-retired {
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* Full-roster cap table row for a retired player -- dimmed so it reads
   as "not current" without hiding the row (their comp figure is still
   real historical data, just excluded from the team totals above it). */
tr.is-retired-row td {
  opacity: 0.6;
}

/* Full-roster cap table row highlight for a current-season free agent /
   option decision (team.js's rosterCapRowHtml()) -- same left-border +
   tinted-background mechanism as the standings page's playoff-line/
   playin-line rows (see that block below), just two different reserved
   hues: status-urgent red for "Free Agent" (the one color already
   reserved for that exact marker on the player page), accent-2 green
   for "Option" (not singly reserved -- already doubles as the academy
   designation-badge color, and an option decision isn't an alarm the
   way an expiring contract with no option is). */
.data-table tr.row-free-agent td {
  background: rgba(176, 58, 46, 0.06);
}
.data-table tr.row-free-agent td:first-child {
  border-left: 3px solid var(--status-urgent);
  padding-left: 13px;
}
.data-table tr.row-option td {
  background: rgba(31, 122, 77, 0.08);
}
.data-table tr.row-option td:first-child {
  border-left: 3px solid var(--accent-2);
  padding-left: 13px;
}

/* ---------- player page hero (headshot variant of team-hero) ---------- */

.player-headshot {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.player-headshot-fallback {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.player-headshot,
.player-headshot-fallback {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--team-color, var(--accent));
}
.player-hero-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  min-height: 20px;
}

/* ---------- quick stat strip (player hero) ---------- */
.player-quickstats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 16px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.quickstat { display: flex; flex-direction: column; gap: 2px; }
.quickstat-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.quickstat-value {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.quickstat-value.is-accent { color: var(--accent); }

/* ---------- production profile (pillar bars, player page) ---------- */
.pillar-summary {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 20px 24px 4px;
  flex-wrap: wrap;
}
.pillar-summary-score {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.pillar-summary-meta { font-size: 13px; color: var(--text-dim); }
.pillar-summary-meta a { color: var(--accent); text-decoration: none; }
.pillar-summary-meta a:hover { text-decoration: underline; }
.pillar-bars {
  padding: 14px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pillar-row {
  display: grid;
  grid-template-columns: 92px 1fr 44px;
  align-items: center;
  gap: 12px;
}
.pillar-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
}
.pillar-track {
  position: relative;
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
}
.pillar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 10px;
  border-radius: 5px;
  background: var(--accent);
}
.pillar-avg-tick {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 2px;
  height: 16px;
  background: var(--text-faint);
  opacity: 0.6;
}
.pillar-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pillar-support {
  grid-column: 2 / 4;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: -8px;
}
.pillar-panel-note {
  padding: 0 24px 20px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- similar players (player page) ---------- */
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  padding: 20px 24px 24px;
}
.similar-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.similar-card:hover { border-color: var(--accent); }
.similar-card-avatar,
.similar-card-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.similar-card-body { min-width: 0; flex: 1; }
.similar-card-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.similar-card-meta {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
}
.similar-card-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.similar-card-stat { color: var(--text-dim); white-space: nowrap; }
.similar-card-stat-label {
  color: var(--text-faint);
  margin-right: 3px;
  letter-spacing: 0.02em;
}

/* ---------- team switcher (team page header) ---------- */

.team-switcher {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
}
.team-switcher label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.team-switcher select,
.lineup-control select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.team-switcher select:focus,
.lineup-control select:focus { outline: none; border-color: var(--accent); }

/* ---------- lineup toolbar ---------- */

.lineup-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 24px 0;
}
.lineup-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.reset-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
.reset-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- pitch + bench ---------- */

.lineup-body {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: 20px;
  padding: 16px 24px 24px;
}
@media (max-width: 760px) {
  .lineup-body { grid-template-columns: 1fr; }
}

.pitch-wrap { position: relative; }
.pitch-formation-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  /* Fixed white, not var(--text) -- this badge is an overlay on the
     grass-green pitch graphic (always dark) regardless of whether the
     site theme itself is light or dark, same reasoning as .chip-name
     below. var(--text) tracked the page theme until the Pitch Grid
     pass flipped --text from light to dark, which made this label
     unreadable: dark text on its own dark translucent backing. */
  color: #fff;
  background: rgba(11, 14, 19, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 2px 8px;
}
.pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background:
    repeating-linear-gradient(
      to bottom,
      #1e5631 0, #1e5631 10%,
      #1a4c2b 10%, #1a4c2b 20%
    );
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  overflow: hidden;
}
.pitch::before {
  /* halfway line, drawn once as a background layer. pointer-events: none is
     load-bearing -- without it this absolutely-positioned full-pitch overlay
     sits above the CM/CAM pitch-slot chips near the center and silently
     swallows their pointerdown, breaking drag-and-drop for exactly the
     slots positioned near midfield. */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35));
  background-size: 100% 2px;
  background-position: center 50%;
  background-repeat: no-repeat;
}
.pitch::after {
  /* center circle -- same pointer-events note as .pitch::before above. */
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 72px;
  touch-action: none;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.chip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.chip-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chip-avatar-empty {
  color: var(--text-faint);
  border-style: dashed;
  background: rgba(255, 255, 255, 0.05);
}
.chip-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  max-width: 88px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.chip-empty .chip-name,
.chip-empty .chip-meta {
  color: var(--text-faint);
  text-shadow: none;
}

.chip-draggable { cursor: grab; touch-action: none; }
.chip-draggable:active { cursor: grabbing; }
.chip-dragging { opacity: 0.3; }

/* Retired player chip (Starting XI bench) -- greyed out and not a drag
   source or a valid drop target (see team.js's playerChipHtml()/
   renderBench()), but still a real link through to their own page. */
a.chip.chip-retired {
  opacity: 0.55;
  cursor: pointer;
  text-decoration: none;
}
.chip-retired .chip-avatar {
  filter: grayscale(1);
  border-style: dashed;
}
.chip-retired .chip-meta {
  font-style: italic;
}

/* Free agent / option ring on a lineup/bench chip avatar (team.js's
   playerChipHtml()) -- same two reserved hues as the Salary Cap table's
   row highlight above (status-urgent red / accent-2 green), just as a
   border + soft glow instead of a fill so it still reads at 44px. A
   retired player never carries faStatus (classifyFreeAgency() excludes
   them), so this never competes with .chip-retired's own avatar
   treatment. */
/* "FA" in a Club column once a free agent is released from his club
   (MLS Cup day -- see seasonCalendar.js): plain text, no logo. */
.club-cell-fa {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--status-urgent);
}

.chip-avatar.ring-fa {
  border-color: var(--status-urgent);
  box-shadow: 0 0 0 2px rgba(176, 58, 46, 0.25);
}
.chip-avatar.ring-opt {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(31, 122, 77, 0.2);
}

.drop-hover .chip-avatar,
.drop-hover.pitch-slot .chip-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chip-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.95;
}
.chip-ghost .chip-avatar { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }

.bench-title {
  font-size: 18px;
  color: var(--text);
  margin: 0 0 8px;
}
.bench-group { margin-bottom: 14px; }
.bench-group-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.depth-group-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 1px 8px;
}
.bench-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.bench-row .chip-name,
.bench-row .chip-meta {
  color: var(--text);
  text-shadow: none;
}
.bench-row .chip-meta { color: var(--text-faint); }
.bench-row [data-kind="bench-player"] {
  padding: 6px;
  border-radius: 8px;
  width: 92px;
}
.bench-row [data-kind="bench-player"].drop-hover {
  background: var(--accent-soft);
}


/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------- blog (index grid + article prose) ---------- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.blog-card:hover { border-color: var(--accent); background: var(--surface-2); }

.blog-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 18px 20px 20px;
}

.blog-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.18;
  color: var(--text);
}

.blog-card-excerpt {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.blog-card-meta {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* -- article page -- */

.article-hero { padding-top: 32px; }
.article-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.article-hero h1 {
  margin-top: 10px;
  max-width: 760px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 42px;
  line-height: 1.1;
  color: var(--text);
}
.article-dek {
  margin-top: 14px;
  max-width: 700px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-dim);
}
.article-meta {
  margin-top: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

.article-body {
  max-width: 700px;
  margin-top: 32px;
  padding-bottom: 8px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-dim);
}
.article-body p { margin: 0 0 20px; }
.article-body p:last-child { margin-bottom: 0; }
.article-body h2 {
  margin: 44px 0 14px;
  font-family: var(--font-display);
  font-size: 27px;
  color: var(--text);
}
.article-body h2:first-child { margin-top: 0; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body .figure-num { font-family: var(--font-mono); color: var(--accent); }
.article-body a { color: var(--accent); text-decoration: none; }
.article-body a:hover { text-decoration: underline; }
.article-body ul { margin: 0 0 20px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }

.article-figure { margin: 36px 0; }
.article-figure img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.article-figure figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.5;
}

.article-note {
  margin: 28px 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}
.article-note strong { color: var(--text); }

.article-share {
  max-width: 700px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.article-share-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.article-share a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.article-share a:hover { border-color: var(--accent); color: var(--accent); }


/* ---------- /news page (news.js) ---------- */

/* display:flex on these would otherwise override the [hidden] attribute. */
.filter-group[hidden],
.load-more-wrap[hidden] { display: none; }

.news-toolbar { padding-top: 14px; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  align-content: flex-start;
}
.news-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}
.news-type {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
/* Reuse the site's reserved hues only where they already mean the same thing:
   option decisions/free agency -> urgent red, confirmed signings -> pitch green. */
.news-type[data-type="option-declined"],
.news-type[data-type="out-of-contract"],
.news-type[data-type="roster-update"],
.news-type[data-type="departure"] { color: var(--status-urgent); border-color: var(--status-urgent); background: transparent; }
.news-type[data-type="extension"],
.news-type[data-type="option-exercised"],
.news-type[data-type="signing"],
.news-type[data-type="transfer"] { color: var(--accent-2); border-color: var(--accent-2); background: transparent; }
.news-club { font-size: 13px; }
.news-club img { width: 18px; height: 18px; }
.news-headline {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
  text-wrap: balance;
}
.news-headline a { color: inherit; text-decoration: none; }
.news-headline a:hover { color: var(--accent-2); text-decoration: underline; }
.news-detail { margin: 0 0 6px; color: var(--text-dim); font-size: 14px; }
.news-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.news-links a { color: var(--accent-2); text-decoration: none; }
.news-links a:hover { text-decoration: underline; }
.news-source { color: var(--text-faint); }
.news-empty { padding: 28px 24px; color: var(--text-faint); font-size: 14px; }

@media (max-width: 700px) {
  .news-item { grid-template-columns: 1fr; padding: 14px 16px; }
}

/* v2: source chip + outbound arrow on Headlines */
.news-source-chip {
  font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.news-source-chip[data-kind="official"] { color: var(--accent-2); border-color: var(--accent-2); background: transparent; }
.news-out { color: var(--text-faint); font-size: 0.85em; }
.news-headline a:hover .news-out { color: var(--accent-2); }

/* v3: optional thumbnail + snippet; club tags live in the source row */
.news-item.has-thumb { grid-template-columns: 140px 1fr 168px; }
.news-thumb { display: block; align-self: start; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-snippet {
  margin: 0 0 8px; color: var(--text-dim); font-size: 14px; line-height: 1.5; max-width: 62ch;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-links { align-items: center; gap: 6px 10px; }
.news-links .news-club { margin-left: 2px; }
.news-links .news-source + .news-club::before { content: "\00b7"; margin-right: 8px; color: var(--text-faint); }
@media (max-width: 700px) {
  .news-item.has-thumb { grid-template-columns: 1fr; }
  .news-item.has-thumb .news-thumb { order: -1; }
}
#list-headlines .news-item { grid-template-columns: 120px 1fr; }
#list-headlines .news-item.has-thumb { grid-template-columns: 120px 1fr 168px; }
.news-links .news-source + .news-club::before { content: none; }
.news-links .news-club { margin-left: 4px; }
@media (max-width: 700px) {
  #list-headlines .news-item, #list-headlines .news-item.has-thumb { grid-template-columns: 1fr; }
}

/* Headlines: date + time stacked in the left column */
.news-date-time { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.news-meta .news-date { display: block; }


/* ============================ Stories (news tab + /news/:slug pages) ============================ */
.page-tabs .tab[hidden], .news-toolbar[hidden] { display: none; }
.story-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.chip-btn { font: 700 12px var(--font-body); letter-spacing: 0.04em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); cursor: pointer; }
.chip-btn:hover { border-color: var(--text-dim); }
.chip-btn.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip-btn[hidden] { display: none; }
.story-feature, .story-card { color: inherit; text-decoration: none; }
.story-feature { display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.story-feature:hover, .story-card:hover { border-color: var(--accent); }
.story-feature .thumb { border-bottom: none; border-right: 1px solid var(--border); padding: 26px 30px; min-height: 0; }
.story-feature .thumb.img { padding: 0; }
.sf-body { padding: 28px 30px; display: flex; flex-direction: column; gap: 10px; }
.sf-body h2 { margin: 0; font: 700 28px/1.2 var(--font-display); color: var(--text); text-wrap: balance; }
.story-dek { color: var(--text-dim); font-size: 15px; line-height: 1.55; margin: 0; }
.story-meta { font: 12px var(--font-mono); color: var(--text-faint); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.kind { font: 700 11px var(--font-body); letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); }
.kind[data-k="roundup"] { color: var(--accent-2); border-color: var(--accent-2); background: transparent; }
.kind[data-k="data"] { color: #7a5200; border-color: var(--accent); background: var(--accent-soft); }
.kind[data-k="analysis"] { color: var(--playoff); border-color: var(--playoff); background: transparent; }
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.story-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.sc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sc-body h3 { margin: 0; font: 700 18px/1.3 var(--font-display); color: var(--text); text-wrap: balance; }
.sc-body .story-dek { font-size: 14px; }
.thumb { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; justify-content: center; }
.thumb.img { padding: 0; min-height: 0; overflow: hidden; aspect-ratio: 16 / 9; }
.thumb.img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.mini-bar { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: center; font: 11px var(--font-mono); color: var(--text-dim); }
.mini-bar i { display: block; height: 9px; border-radius: 2px; background: var(--accent); }
.auto-note { font: 12px var(--font-body); color: var(--text-faint); }
.story-foot { margin-top: 18px; }
/* a single story page */
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font: 700 34px/1.2 var(--font-display); margin: 8px 0 10px; text-wrap: balance; }
.article .lede { font-size: 18px; line-height: 1.55; color: var(--text-dim); margin: 0 0 14px; }
.article h2 { font: 700 21px var(--font-display); margin: 30px 0 10px; }
.article p { line-height: 1.65; margin: 0 0 14px; }
.article .breadcrumb { margin: 0 0 6px; }
.story-link { color: var(--accent-2); font-weight: 700; text-decoration: none; }
.story-link:hover { text-decoration: underline; }
.provenance { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 12px var(--font-mono); color: var(--text-faint); padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 14px 0 22px; }
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.chart h3 { margin: 0 0 2px; font: 700 15px var(--font-display); }
.chart .sub { font-size: 12px; color: var(--text-faint); margin: 0 0 12px; }
.hbar { display: grid; grid-template-columns: 44px 1fr 74px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.hbar .lab { font-weight: 700; }
.hbar .track { background: var(--surface-2); height: 16px; border-radius: 3px; }
.hbar .fill { height: 16px; border-radius: 3px; background: var(--accent); }
.hbar .val { font: 12px var(--font-mono); text-align: right; color: var(--text-dim); }
.article .table-scroll { overflow-x: auto; padding: 0; margin: 0; }
table.sd { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0 4px; }
table.sd th { font: 700 11px var(--font-body); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.sd td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.sd td.n, table.sd th.n { font-family: var(--font-mono); text-align: right; }
@media (max-width: 800px) {
  .story-feature { grid-template-columns: 1fr; }
  .story-feature .thumb { border-right: none; border-bottom: 1px solid var(--border); }
  .story-grid { grid-template-columns: 1fr; }
  .sf-body h2 { font-size: 23px; }
  .article h1 { font-size: 27px; }
}

/* ---------- home page: Latest Moves, Headlines, playoffs bracket ---------- */

/* display:grid on .panel-pair would otherwise override [hidden] (offseason hides Transfers + Golden Boot). */
.panel-pair[hidden],
.po-tabs[hidden] { display: none; }

/* In season the page keeps its original module order; in the offseason the
   DOM order is the order (Cap Hit, Free Agency, Moves + Headlines, Playoffs,
   Highest Salaries, Best Value + Production). main.wrap is a flex column. */
main.wrap[data-mode="inseason"] #panel-cap-room { order: 1; }
main.wrap[data-mode="inseason"] #panel-salaries { order: 2; }
main.wrap[data-mode="inseason"] #panel-free-agency-watch { order: 3; }
main.wrap[data-mode="inseason"] #panel-pair-season { order: 4; }
main.wrap[data-mode="inseason"] #panel-standings { order: 5; }
main.wrap[data-mode="inseason"] #panel-pair-news { order: 6; }
main.wrap[data-mode="inseason"] .panel-pair:not(#panel-pair-season):not(#panel-pair-news) { order: 7; }

/* Compact news list for half-width home panels: one column, no big date gutter. */
.news-list.compact .news-item {
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 12px 24px;
}
.news-list.compact .news-meta { gap: 6px 10px; }
.news-list.compact .news-headline { font-size: 16px; margin-bottom: 2px; }
.news-list.compact .news-detail { font-size: 13px; margin-bottom: 4px; }
.news-list.compact .news-date-time { margin-left: 6px; }
@media (max-width: 700px) {
  .news-list.compact .news-item { padding: 12px 16px; }
}

/* Playoffs bracket */
#po-bracket { padding: 16px 24px 20px; }
.po-confs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.po-conf { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.po-conf > h3 {
  margin: 0; padding: 10px 14px; background: var(--surface-2);
  font-family: var(--font-display); font-size: 15px; color: var(--text);
}
.po-round { padding: 8px 14px 2px; }
.po-round-h {
  display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 2px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint);
}
.po-tie {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  padding: 9px 0; border-top: 1px solid var(--border);
}
.po-round-h + .po-tie { border-top: none; }
.po-pair { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.po-club {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap;
}
.po-club img { width: 20px; height: 20px; object-fit: contain; }
a.po-club:hover span:last-child { text-decoration: underline; }
.po-club.po-pending { font-family: var(--font-body); font-weight: 600; color: var(--text-dim); }
.po-club.po-dim { opacity: 0.45; }
.po-club.po-win span:last-child { text-decoration: underline; text-decoration-color: var(--accent-2); text-underline-offset: 3px; }
.po-vs { font-size: 11px; color: var(--text-faint); }
.po-seed {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-dim);
}
.po-seed.top { background: var(--playoff); border-color: var(--playoff); color: #fff; }
.po-when { text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.po-when b { font-weight: 700; color: var(--text); display: block; }
.po-when small { display: block; color: var(--text-faint); font-size: 11px; max-width: 28ch; margin-left: auto; }
.po-laters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.po-laters .po-round { border: 1px solid var(--border); border-radius: 10px; padding-bottom: 6px; }
.po-later-empty { padding: 8px 0 6px; color: var(--text-faint); font-size: 12px; }
.po-note { padding: 14px 0 0; }
@media (max-width: 860px) {
  .po-confs, .po-laters { grid-template-columns: 1fr; }
  #po-bracket { padding: 14px 16px 18px; }
}
@media (max-width: 560px) {
  .po-tie { grid-template-columns: 1fr; }
  .po-when, .po-when small { text-align: left; margin-left: 0; max-width: none; }
}

/* ---------- Highest Paid MLS Players page (highest-paid.js): per-position sub-tables ---------- */
/* Links inside a panel-body are accent-colored; table links should read like every other table. */
.panel-body .data-table a.player-link,
.panel-body .data-table a.club-cell-link { color: inherit; }
.hp-sub {
  margin: 22px 0 8px;
  font-size: 16px;
}
.hp-sub:first-child { margin-top: 0; }

/* ---------- suggested salary (player page, free agents only) ----------
   See public/js/suggested-value-panel.js. One accent (the gold "money" hue)
   for the range, ink for the midpoint, and the reserved --playoff blue only
   as the dashed "current salary" reference mark. */
.sv-body { padding: 20px 24px 22px; }
.sv-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sv-value {
  margin: 2px 0 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.sv-meta { margin: 0; color: var(--text-dim); font-size: 15px; }
.sv-change { margin: 6px 0 0; color: var(--text-dim); font-size: 14px; }
.sv-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--accent-soft);
  margin-right: 6px;
}
.sv-chip-high { background: #dcefe3; color: #17603c; }
.sv-chip-low { background: #f6e1de; color: var(--status-urgent); }
.sv-bar { position: relative; height: 34px; margin: 18px 0 6px; }
.sv-track { position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--border); }
.sv-span { position: absolute; top: 11px; height: 12px; border-radius: 6px; background: var(--accent); }
.sv-mid { position: absolute; top: 5px; width: 4px; height: 24px; border-radius: 2px; background: var(--text); transform: translateX(-2px); }
.sv-cur { position: absolute; top: 6px; height: 22px; width: 0; border-left: 2px dashed var(--playoff); }
.sv-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.sv-scale-cur { color: var(--playoff); text-align: center; }
.sv-drivers { list-style: none; margin: 16px 0 0; padding: 0; }
.sv-driver {
  padding: 10px 0 10px 14px;
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.sv-driver-role { border-left-color: var(--accent-2); }
.sv-driver-injury { border-left-color: var(--playoff); }
.sv-driver-age, .sv-driver-prior { border-left-color: var(--accent); }
.sv-driver-warn { border-left-color: var(--status-urgent); }
.sv-foot { margin: 14px 0 0; font-size: 12px; color: var(--text-faint); }
@media (max-width: 760px) {
  .sv-body { padding: 16px 16px 18px; }
  .sv-value { font-size: 32px; }
  .sv-scale { font-size: 11px; }
}

/* Suggested value in lists (Free Agency table) + two-season table (player page) */
.sv-cell { white-space: nowrap; }
.sv-cell-change { display: inline-block; min-width: 44px; margin-left: 6px; font-size: 12px; color: var(--text-faint); }
.sv-cell-up { color: var(--accent-2); }
.sv-cell-down { color: var(--status-urgent); }
.season-history { padding: 0 24px 22px; }
.season-history-title { margin: 0 0 10px; font-size: 16px; }
.season-history .table-scroll { border: 1px solid var(--border); border-radius: 6px; }
.season-history-note { margin: 10px 0 0; font-size: 12px; color: var(--text-faint); }
@media (max-width: 760px) { .season-history { padding: 0 16px 18px; } }

/* Option value check (Free Agency Options tab, team Free Agency Watch) and
   suggested salaries in the watch card. Semantic tones only: green = good
   value for the club, neutral = close call, red = costly. */
.option-read {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.option-read-value { background: #dcefe3; color: #17603c; }
.option-read-close { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.option-read-costly { background: #f6e1de; color: var(--status-urgent); }
.fa-watch-cur { color: var(--text-faint); }
.fa-watch-sugg { color: var(--text); font-weight: 700; }
.fa-watch-note { margin: 10px 0 0; font-size: 12px; color: var(--text-faint); }
.fa-watch-note a { color: var(--accent); text-decoration: none; }
.fa-watch-note a:hover { text-decoration: underline; }

@media (max-width: 620px) {
  /* Name on one line, current -> suggested (and the value check) under it. */
  .fa-watch-row { flex-wrap: wrap; row-gap: 4px; }
  .fa-watch-meta { margin-left: auto; }
}

/* ---------- Answer paragraph (player, team and free agency pages) ----------
   The page's main facts as plain sentences, right under the hero, so a
   reader (and a search or AI answer engine) gets the answer first. */
.page-answer {
  margin: 14px 0 6px;
  max-width: 760px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
.page-answer[hidden] { display: none; }
.page-intro .page-answer { margin-top: 10px; font-size: 15px; color: var(--text); }
.sv-check { margin: 8px 0 0; font-size: 14px; color: var(--text-dim); }

/* ---------- About / Methodology ---------- */
.byline { margin: 6px 0 0; font-size: 13px; color: var(--text-faint); }
.byline a { color: var(--accent); text-decoration: none; }
.panel-body ol { margin: 0 0 12px; padding-left: 22px; }
.method-steps li { margin-bottom: 10px; }
.site-footer .footer-links { margin-top: 6px; }
.site-footer .footer-links a { color: var(--text-dim); text-decoration: none; }
.site-footer .footer-links a:hover { text-decoration: underline; }
