/*
  Ranktory local prototype visual system (Assignment 013G).
  Plain CSS only -- no framework, no external font, no CDN, no icon
  service. Fixed deep charcoal/silver/gold theme, not adaptive to the
  visitor's OS color scheme, per the assignment's visual direction.
*/

:root {
  /* Layered near-black surfaces (Founder visual-polish correction) --
     four tiers, each one step brighter: page background, resting
     panels, raised/nested panels, and the top elevation tier (hover
     states, the currently-open disclosure). */
  --color-bg: #09090b;
  --color-bg-surface: #19191e;
  --color-bg-surface-raised: #222228;
  --color-bg-surface-elevated: #2c2c33;
  --color-border: #323238;
  --color-border-strong: #46464e;
  --color-border-gold: rgba(184, 138, 51, 0.35);
  --color-text: #f0f0f3;
  --color-heading: #ffffff;
  --color-text-muted: #b8b8c1;
  --color-text-faint: #94949d;
  /* Founder visual-polish correction (BETA-021A color pass): shifted
     warmer and less saturated than the prior yellow-leaning gold, so
     selected controls read as metallic gold rather than bright yellow.
     Still a genuine light-to-base gradient (kept lively), just with a
     narrower, warmer range and a quieter surrounding glow (see
     --shadow-gold below). */
  --color-gold: #b88a33;
  --color-gold-strong: #cda247;
  --color-gold-bright: #ddba5f;
  --gradient-gold: linear-gradient(135deg, var(--color-gold-bright), var(--color-gold));
  --color-tie: #cfcfd4;
  --color-disagree: #d98a4a;
  /* Movement-symbol semantics only (013G-4 Addendum 2) -- distinct from
     --color-disagree (poll-membership disagreement, an unrelated
     semantic) and never applied to movement wording, only the glyph
     and (Founder visual-polish correction) each row's own restrained
     accent border/wash -- never the sole signal (wording + distinct
     glyph shape still carry the meaning independently). */
  --color-positive: #38d99b;
  --color-positive-bg: rgba(56, 217, 155, 0.09);
  --color-positive-border: rgba(56, 217, 155, 0.45);
  --color-negative: #f8776f;
  --color-negative-bg: rgba(248, 119, 111, 0.09);
  --color-negative-border: rgba(248, 119, 111, 0.45);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  /* Founder visual-polish correction: narrower blur + lower opacity than
     the previous glow -- selected-state contrast now comes mainly from
     the gradient fill and border color change, not a halo around it. */
  --shadow-gold: 0 1px 2px rgba(184, 138, 51, 0.28), 0 2px 6px rgba(184, 138, 51, 0.14);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius: 8px;
  --radius-sm: 4px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;

  --focus-ring: 3px solid var(--color-gold-strong);
  --min-target: 44px;

  --transition-fast: 120ms ease;

  /* Assignment BETA-021A: height reserved for the fixed mobile bottom
     tab bar (below 768px) -- used both by the nav bar itself and by
     every other fixed bottom-corner control (feedback FAB, welcome-
     guide reopen button, submitted banner) so none of them overlaps
     it. See the mobile primary-nav clearance rules at the end of this
     file. Includes the device's own bottom safe-area inset (the home
     indicator on notched phones) with a zero fallback for browsers
     that don't support env() -- Founder visual correction. */
  --mobile-nav-height: calc(60px + env(safe-area-inset-bottom, 0px));
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-bg);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* Ordinary interactive elements default to silver/charcoal -- gold is
   reserved for the active/selected state, important emphasis, and
   branding (Assignment 013G-1 Section 5), not for routine links. */
a {
  color: var(--color-text);
  text-decoration: none;
}

a:hover {
  color: var(--color-gold-strong);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-focusable {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-gold);
  color: #14140f;
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  font-weight: 700;
}

.visually-hidden-focusable:focus {
  left: var(--space-3);
  top: var(--space-3);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-4);
}

/* Assignment BETA-021A: the desktop "information-rich laboratory"
   layouts (Rankings, and the Teams/Games/Insights/Build sections) opt
   into a wider canvas via `{% block main_class %}container-wide{%
   endblock %}` in base.html. Combined-class selector (not a bare
   `.container-wide` rule) so its `max-width` always wins over the
   plain `.container` rule above regardless of stylesheet source order.
   Every other page (error, beta gate, feedback, roadmap) keeps the
   original 960px reading width untouched. */
.container.container-wide {
  max-width: 960px;
}

@media (min-width: 1024px) {
  .container.container-wide {
    max-width: 1200px;
  }
}

@media (min-width: 1440px) {
  .container.container-wide {
    max-width: 1400px;
  }
}

/* Founder visual correction: the laboratory canvas grows once more at
   very wide desktops, comfortably inside a 1680-1760px target while
   still leaving real outer margin on a 1920px display. */
@media (min-width: 1600px) {
  .container.container-wide {
    max-width: 1700px;
  }
}

/* ---------------------------------------------------------------------
   Header + primary navigation
--------------------------------------------------------------------- */

/* Installed-app (viewport-fit=cover) safe areas: keep content clear of the
   notch in landscape and the top status area. Insets are 0 in a normal tab. */
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.site-header {
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) 0 0;
}

.site-header .container:last-child {
  padding-top: var(--space-3);
  padding-bottom: var(--space-4);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-1);
  padding-bottom: var(--space-3);
}

.wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-heading);
  margin: 0;
}

/* Primary nav (Assignment BETA-021A): one shared markup, repositioned
   by breakpoint rather than duplicated -- a fixed, always-visible,
   app-like bottom tab bar below 768px, and an ordinary horizontal bar
   beside the wordmark at 768px and up. `aria-current="page"` (not a
   `.pill`-style background swap) marks the active destination, since
   this nav sits directly in the page header rather than among the
   `.pill-nav` filter/selection controls it visually complements. */
.primary-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.primary-nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: var(--space-1);
  gap: var(--space-1);
}

/* Founder correction: the flex-distribution property below was living on
   `.primary-nav-link` (the `<a>`), but that element is only a GRANDCHILD
   of the flex container `.primary-nav-list` -- its actual flex items are
   the bare `<li>`s in between, which default to shrink-to-fit and
   cluster at the start of the row. `flex: 1 1 0` on `.primary-nav-link`
   was therefore always inert below 768px; this rule makes the `<li>`
   itself the equal-width flex item (and a flex container in turn), so
   the existing sizing on `.primary-nav-link` below now actually governs
   real layout instead of doing nothing. Desktop (768px+) is unaffected:
   `.primary-nav-list` only gets `display: flex` for its own row of
   `<li>`s there too, but `.primary-nav-link` switches back to `flex:
   none` at that breakpoint (unchanged, see below), so this rule's
   `flex: 1 1 0` has no visible effect once desktop's own rule takes
   over. */
.primary-nav-list > li {
  flex: 1 1 0;
  /* Without this, the `<li>`'s own implicit automatic minimum width
     (derived from its child's intrinsic content size, independent of
     whatever min-width is set on that child) still wins at the
     narrowest widths, e.g. "Insights"/"Rankings" ending up wider than
     "Teams"/"Games"/"Build" instead of all five sharing equally --
     confirmed live at 320px before adding this. `.primary-nav-link`'s
     own `min-width: var(--min-target)` below is still the real 44px
     floor; this just stops the `<li>` from imposing a second, larger,
     content-driven one on top of it. */
  min-width: 0;
  display: flex;
}

.primary-nav-link {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-target);
  min-width: var(--min-target);
  /* Horizontal component deliberately smaller than --space-1 (4px) --
     measured live at 320px: "Rankings"/"Insights" need every spare
     pixel to stay on one line within an equal fifth of the bar; 4px
     padding left under 1px of clearance. 2px keeps real breathing room
     without ever letting the label touch the button's own border. */
  padding: var(--space-2) 2px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface-raised);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.primary-nav-link:hover {
  color: var(--color-gold-strong);
  border-color: var(--color-gold);
  background: var(--color-bg-surface-elevated);
  text-decoration: none;
}

/* Same approved warm-gold selected treatment as every other selected
   control on this site (.pill[aria-current="true"],
   .movement-tab-input:checked + .movement-tab-label) -- a gradient
   fill, never a flat color, per the Founder visual-polish correction
   that established --gradient-gold. */
.primary-nav-link[aria-current="page"] {
  background: var(--gradient-gold);
  border-color: var(--color-gold-strong);
  color: #14140f;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

/* BETA-022 Correction 3: narrowest phones only (this machine's own
   Chrome/Segoe-UI rendering already measured "Rankings" -- the longest
   label, and bolder than the other four via `[aria-current="page"]`'s
   font-weight: 700 above -- at 56.47px against a 56.2px button:
   already wider than its own button's border-box by a fraction of a
   pixel, passing the live-measurement test's 1.5px tolerance only by
   luck of this specific font's metrics. A real Linux/CI Chrome font
   substitution rendered it wider still and genuinely overflowed. This
   is a width-budget problem, not a test-tolerance one: reclaim real
   pixels for every button (tighter list padding/gap -- unlike the
   per-link padding above, this changes each button's own border-box
   width, not just its content area) and shrink the type a step, so
   even a noticeably wider font substitution than anything measured
   locally still clears its button with room to spare. Bounded to
   374px and below -- comfortably under the Founder-approved 390px
   design (measured with 13.7px of spare room already, untouched here)
   -- so it reaches 320px (the failing width) and the common 360/375px
   phone sizes never explicitly verified, without moving 390px or
   430px at all. */
@media (max-width: 374px) {
  .primary-nav-list {
    padding: 2px;
    gap: 2px;
  }

  .primary-nav-link {
    font-size: 0.76rem;
  }
}

@media (min-width: 768px) {
  .primary-nav {
    position: static;
    background: none;
    border-top: none;
  }

  .primary-nav-list {
    padding: 0;
    gap: var(--space-1);
  }

  /* Restores desktop's original content-width (never equal-width)
     behavior -- the mobile-only equal-width fix above must not reach
     this breakpoint. */
  .primary-nav-list > li {
    flex: none;
    display: block;
  }

  .primary-nav-link {
    flex: none;
    min-width: 0;
    padding: var(--space-2) var(--space-4);
    border: none;
    background: none;
    border-radius: var(--radius);
    /* Restores the original, pre-correction font-size for desktop --
       the mobile-only bump above (0.78rem -> 0.82rem) must not reach
       this breakpoint; desktop typography is explicitly unchanged. */
    font-size: 0.78rem;
  }

  .primary-nav-link:hover {
    background: var(--color-bg-surface);
  }

  .primary-nav-link[aria-current="page"] {
    background: var(--color-bg-surface);
    /* The base (mobile-first) rule above sets `color: #14140f` for the
       gold-gradient background that treatment pairs with -- correct
       there, but never overridden here, where the desktop background
       switches to a dark `--color-bg-surface` instead. That left the
       active label rendering near-black text on a near-black
       background (effectively invisible) at every viewport 768px and
       wider, on every primary-nav destination. Gold ties the label to
       the same gold underline this rule already draws, matching the
       "gold marks the active control" convention used everywhere else
       on this site. */
    color: var(--color-gold-strong);
    box-shadow: inset 0 -2px 0 0 var(--color-gold);
  }
}

.eyebrow {
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: var(--space-2) 0 var(--space-1);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--color-heading);
}

/* Founder visual-polish correction: every section heading gets the
   same bright, unmistakable pop as the hero title -- restrained (no
   color change, no glow), just genuinely brighter than body text. */
h2, h3 {
  color: var(--color-heading);
}

.page-explanation {
  color: var(--color-text-muted);
  max-width: 60ch;
  margin: 0;
}

/* ---------------------------------------------------------------------
   Week selector / view nav / sort / movement controls
--------------------------------------------------------------------- */

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: var(--space-4) 0;
}

.control-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-right: var(--space-1);
}

/* Founder visual correction: Season/Week/View (and, within a section,
   Sort/Displayed-polls) collapse into one compact toolbar -- a flex row
   that wraps naturally on narrow viewports and sits on a single line
   once there's room, rather than three-plus full-margin `.control-row`
   blocks stacked vertically. Children keep their own semantic `<nav
   aria-label>` wrapper (never merged into one nav) but give up their
   own top/bottom margin to the parent's `gap`. */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-3) 0;
}

.control-bar > * {
  margin: 0;
}

.control-bar .control-row {
  margin: 0;
}

/* A compact, collapsed-by-default home for supplementary explanation
   that would otherwise sit as several always-visible paragraphs above
   the primary data -- "How this table works", "What does Movement
   show?". Real content, never removed, just not forced into the
   initial viewport. Reuses the same surface/typography as `.card`. */
.info-disclosure {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin: var(--space-3) 0;
  box-shadow: var(--shadow-sm);
}

.info-disclosure[open] {
  background: var(--color-bg-surface-raised);
}

.info-disclosure summary {
  cursor: pointer;
  list-style: none;
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--color-text);
}

.info-disclosure summary::-webkit-details-marker {
  display: none;
}

.info-disclosure summary::marker {
  content: "";
}

.info-disclosure summary:hover {
  color: var(--color-gold-strong);
}

.info-disclosure[open] > summary .chevron {
  transform: rotate(90deg);
  color: var(--color-gold-strong);
}

.info-disclosure-body {
  padding: 0 var(--space-3) var(--space-3);
  color: var(--color-text-muted);
}

.info-disclosure-body p {
  margin: 0 0 var(--space-2);
}

.info-disclosure-body p:last-child {
  margin-bottom: 0;
}

.pill-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-target);
  min-width: var(--min-target);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.pill:hover {
  border-color: var(--color-gold);
  background: var(--color-bg-surface-raised);
  text-decoration: none;
}

/* Gold marks the active/selected control -- the only routine surface
   that uses it. The selected state is also carried by `aria-current`
   (announced natively by assistive tech), so no visible "(current)"
   text is needed on top of the color + border change. Founder visual-
   polish correction: a restrained warm-gold gradient (never a flat
   fill) plus a soft gold-tinted shadow gives the selected state real
   "premium, unmistakable" presence without glow or an all-gold page --
   every other pill/control stays plainly secondary. */
.pill[aria-current="true"] {
  background: var(--gradient-gold);
  border-color: var(--color-gold-strong);
  color: #14140f;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.control-help {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 0 0 var(--space-2);
  max-width: 60ch;
}

/* The sort controls (AP / Coaches / CFP / Average -- A-Z removed,
   BETA-031Q) must stay on one row at 320px and wider -- tighter
   padding/gap and a smaller font than the general .pill only within
   this row. */
.sort-row {
  flex-wrap: nowrap;
  gap: var(--space-1);
}

.sort-row .pill {
  padding: var(--space-1) var(--space-2);
  font-size: 0.85rem;
  min-width: 0;
  flex: 1 1 0;
}

/* ---------------------------------------------------------------------
   Week/point selector. Originally a desktop wall of up to 18 pill
   buttons (two rows) with a mobile-only <select> fallback; the Founder
   visual correction replaced the pill wall entirely -- the governed
   <select> + submit button is now the ONE universal week control at
   every viewport width, compact at both ends. Still a plain
   <form method="get">, so this remains fully functional with CSS or
   JavaScript disabled.
--------------------------------------------------------------------- */

.week-dropdown-form {
  display: flex;
  /* BETA-032C7-17: `nowrap` by default -- `wrap` here (even with the select's own
     `min-width: 0` already fixed below) let this form, nested inside `.week-nav`'s own
     flex row, be measured by the browser's nested-flex-wrap "could-wrap" sizing algorithm,
     which under-reported the space actually needed for the select + Go button and forced
     the button onto its own line at EVERY viewport, including desktop -- the opposite of
     the intended "stack only when genuinely necessary" behavior. `nowrap` makes this
     form's own preferred width a plain sum of its children, which its ancestors size
     correctly; `flex: 1 1 auto` below lets it actually claim that width instead of being
     squeezed to a too-small auto-basis. Wrap is deliberately reinstated only at the
     narrowest widths, see the `max-width: 359px` rule further down. */
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
}

@media (max-width: 359px) {
  /* Only at the narrowest supported widths does the dropdown and Go button no longer
     safely fit on one row without shrinking the select below a usable size -- stack them
     here, and only here. */
  .week-dropdown-form {
    flex-wrap: wrap;
  }
}

.week-dropdown-select {
  flex: 1 1 auto;
  /* Flex items default to `min-width: auto`, which lets a <select>'s
     own intrinsic content width (its widest <option> -- here "Week 16
     / CFP Selection Day") refuse to shrink below that width and force
     the row, and the whole page, to overflow horizontally at narrow
     viewports. `.sort-row .pill` already carries this same fix
     elsewhere on this page; this rule was the one native <select> that
     had not (Assignment BETA-021A, found via real headless-browser
     screenshot verification at 390px -- not visible in every renderer,
     but real on an unpatched native <select> control). */
  min-width: 0;
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  color: var(--color-text);
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  /* Compact and inline within the control bar once there's room,
     rather than stretching to fill the row. */
  .week-dropdown-select {
    flex: 0 1 240px;
  }
}

/* ---------------------------------------------------------------------
   Poll-column display checklist (Assignment 013G-4 Section 3) -- one
   collapsed batched control, replacing the old per-poll toggle pills.
   Checking/unchecking boxes never reloads the page; the whole selection
   is applied at once via the "Apply display" submit. Built as the first
   reusable Ranktory data-selection control -- the `.poll-checklist-*`
   classes are deliberately generic (not "sort-" or "display-" specific)
   so a future poll-catalog control can reuse this same pattern.
--------------------------------------------------------------------- */

.poll-checklist {
  width: 100%;
}

.poll-checklist-summary {
  cursor: pointer;
  list-style: none;
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
}

.poll-checklist-summary::-webkit-details-marker {
  display: none;
}

.poll-checklist-summary::marker {
  content: "";
}

.poll-checklist-summary:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-strong);
}

.poll-checklist-summary .chevron {
  order: -1;
}

.poll-checklist[open] .poll-checklist-summary .chevron {
  transform: rotate(90deg);
  color: var(--color-gold-strong);
}

.poll-checklist-form {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
}

.poll-checklist-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.poll-checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
  /* Bounded height + scroll: stays usable once the catalog grows toward
     ~30 polls, not just the current three. */
  max-height: 240px;
  overflow-y: auto;
}

.poll-checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--min-target);
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

.poll-checklist-item:hover {
  background: var(--color-bg-surface-raised);
}

.poll-checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--color-gold);
}

.apply-display-button {
  margin-top: var(--space-3);
  border: 1px solid var(--color-border-strong);
  font: inherit;
}

.apply-display-button:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-strong);
  cursor: pointer;
}

/* ---------------------------------------------------------------------
   Pairwise summary cards
--------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.card h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
  color: var(--color-heading);
}

.card dl {
  margin: 0;
}

.card dt {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: var(--space-2);
}

.card dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.card details {
  margin-top: var(--space-3);
}

.card summary {
  cursor: pointer;
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-border-strong);
  text-underline-offset: 3px;
  font-size: 0.9rem;
  min-height: var(--min-target);
  display: flex;
  align-items: center;
}

.card summary:hover {
  color: var(--color-gold-strong);
  text-decoration-color: currentColor;
}

.tie-note {
  color: var(--color-gold);
  font-size: 0.85rem;
  margin-top: var(--space-2);
}

.glossary {
  margin: var(--space-3) 0 0;
}

.glossary dt {
  color: var(--color-text);
  font-weight: 600;
  margin-top: var(--space-3);
}

.glossary dt:first-child {
  margin-top: 0;
}

.glossary dd {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------------
   Coming Soon placeholder sections (Assignment BETA-021A; wide-grid
   composition added in the Founder visual correction pass) -- Teams,
   Games, Insights, Build. Every approved sub-destination is its own
   card: a badge, its name, and one honest description, reusing
   `.badge`/`.card` tokens -- never a sample statistic, a fake control,
   or invented data. A single-item section (Insights) still renders one
   full card, not an empty canvas around a small panel.
--------------------------------------------------------------------- */

.coming-soon-badge {
  color: var(--color-gold);
  font-size: 0.75rem;
  margin-bottom: var(--space-3);
}

.coming-soon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

@media (min-width: 640px) {
  .coming-soon-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.coming-soon-card {
  display: flex;
  flex-direction: column;
}

.coming-soon-card-title {
  margin: 0 0 var(--space-2);
  font-size: 1.15rem;
  color: var(--color-heading);
}

.coming-soon-card p {
  color: var(--color-text-muted);
  margin: 0;
}

/* The card matching the currently-viewed sub-destination (also marked
   `aria-current="true"` on its matching subnav pill) gets the same
   restrained gold treatment every other "active/selected" surface on
   this site uses. */
.coming-soon-card-active {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
}

.coming-soon-note {
  font-size: 0.9rem;
  color: var(--color-text-faint);
}

/* ---------------------------------------------------------------------
   Purpose intro (Pairwise Summary) -- always visible, never a collapsed
   disclosure (Assignment 013G-2 Section 3). Weekly Movement's own intro
   moved into `.info-disclosure` (collapsed by default) per the Founder
   visual correction pass -- see the Movement view section below.
--------------------------------------------------------------------- */

.pairwise-intro {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}

.pairwise-intro h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.05rem;
  color: var(--color-heading);
}

.pairwise-intro p {
  color: var(--color-text-muted);
  max-width: 70ch;
  margin: 0 0 var(--space-2);
}

.pairwise-intro p:last-child {
  margin-bottom: 0;
}

.ranktory-takeaway-heading {
  color: var(--color-gold-strong);
  font-weight: 700;
  margin: var(--space-3) 0 var(--space-1);
}

/* ---------------------------------------------------------------------
   Team table
--------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: var(--space-4) 0;
}

/* Founder addendum to BETA-018 (revised after Founder correction):
   sticky ranking-table header, continued from the
   `.team-table-sticky-header thead th` rule below. True PAGE-level
   sticky -- the header pins to the browser viewport while the page
   itself scrolls normally, releasing once the table scrolls past --
   with no nested/table-specific scrollbar and no bounded-height panel.

   `position: sticky` always resolves against the nearest ancestor
   scroll container (any element whose used overflow is non-`visible`
   on either axis), never the page, if one exists between the sticky
   element and the viewport. `.table-wrap`'s own `overflow-x: auto`
   (an existing, older horizontal-scroll safety net -- see its own rule
   above) makes it exactly such a scroll container: per the CSS
   Overflow spec, once overflow-x is non-visible, overflow-y's used
   value is coerced to a non-visible value too regardless of what it is
   explicitly set to (confirmed live in-browser: an explicit
   `overflow-y: visible` or `overflow-y: clip` on `.table-wrap` both
   still got coerced back to a scroll-container value). The only way to
   stop `.table-wrap` from being a scroll container at all is to also
   remove overflow-x's non-visible value for this element specifically.

   `overflow: visible` here does exactly that -- narrowly, ONLY for the
   wrapper around the v2/v3 comparison table (scoped via the same
   `.team-table-sticky-header` class + `:has()` already used elsewhere
   in this file, e.g. tr.detail-row's own @supports guard) -- restoring
   true page-level sticky. The base `.table-wrap { overflow-x: auto; }`
   rule above is completely untouched and still applies, unaffected, to
   v1's and Movement's own plain `.table-wrap` (which carries no
   `.team-table-sticky-header` descendant), preserving their existing
   horizontal-scroll safety net exactly as before BETA-018.

   Removing that safety net specifically for the v2/v3 table is safe
   here because the maximum real column configuration -- Team + AP +
   Coaches + CFP + Avg + Flag, the most columns this table can ever
   show -- was measured live in-browser to fit with zero horizontal
   overflow at 320px, 375px, 768px, and 1280px (the narrowest currently
   supported viewport and up), both before and after this change; see
   the BETA-018 decision record / PR discussion for the exact
   measurements. If a future column is ever added and no longer fits at
   320px, this specific override (not the base rule) is the first place
   to revisit.

   Graceful, safe degradation for browsers without :has() support: the
   @supports guard means `.table-wrap` simply keeps its base
   `overflow-x: auto` behavior for the v2/v3 table too (a wide table
   would horizontally scroll, exactly like v1/Movement do today) --
   sticky then silently has no visible effect (the pre-existing,
   harmless `position: sticky` fallback-to-static behavior in any
   browser that doesn't support it, or here, doesn't get the
   containing-block fix it needs), never a broken or clipped layout. */
@supports selector(:has(*)) {
  .table-wrap:has(.team-table-sticky-header) {
    overflow: visible;
  }
}

table.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.team-table caption {
  text-align: left;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}

.team-table th,
.team-table td {
  padding: var(--space-2) var(--space-2);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.team-table th {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  /* Founder visual-polish correction: a distinct surface tier under the
     column headings, so they read as a clear header band rather than
     the same flat page background as the rows beneath. The sticky
     v2/v3 header (.team-table-sticky-header thead th, higher
     specificity via its extra class) keeps its own var(--color-bg)
     background unchanged -- that value is load-bearing for its
     scroll-opacity behavior, not a stray inconsistency. */
  background: var(--color-bg-surface);
}

/* Founder addendum to BETA-018: sticky ranking-table header, so Team /
   the active-sort column / remaining polls / Avg / Flag stay visible
   while scrolling a long team list. Scoped to `.team-table-sticky-
   header` -- a class added ONLY to the v2/v3 comparison table in
   poll_comparison.html -- specifically so this never reaches legacy v1
   or Movement, which share the plain `.team-table` class but not this
   one; a shared, unscoped rule was avoidable, so it was avoided.

   `.table-wrap` only ever sets overflow-x (never overflow-y), so it
   does not establish its own vertical scroll container -- `position:
   sticky` here tracks the PAGE's own vertical scroll, and un-sticks
   itself the moment the table (its containing block) scrolls past the
   viewport top, which is exactly "stop when the table ends; never sit
   over later page sections," with no JavaScript. The background
   matches --color-bg (the page background, since nothing between
   <body> and this table sets a different one) so it stays fully
   opaque -- row text never shows through as it scrolls beneath -- and
   the bottom border/shadow keeps a visible seam between the frozen
   header and the scrolling rows. z-index is comfortably below the
   feedback FAB/banner's z-index: 90, and above the table's own
   default (unset) row stacking.

   Column order (which header reads "AP"/"Coaches"/"Avg" in which
   position) comes entirely from `column_order_display`/
   `avg_column_first` in web/app.py, computed before the template ever
   renders -- sticky positioning is presentation-only and does not
   interact with that ordering at all, so BETA-018 Required Correction
   1's ordering is automatically preserved here with no extra code.
   Likewise the active-sort link itself is plain header/nav markup
   elsewhere on the page, untouched by this rule. */
.team-table-sticky-header thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--color-bg);
  box-shadow: 0 1px 0 0 var(--color-border), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Assignment BETA-018 Required Correction 3: collapsed team-summary
   rows carried var(--space-2) (8px) of td padding ABOVE AND BELOW the
   44px-tall .team-name-toggle summary inside .team-col, for a total row
   height around 60px -- most of that extra height was unused vertical
   air, not readability. Reducing only padding-top/padding-bottom (never
   the shorthand, so padding-left/right still correctly follow whatever
   the base/mobile rules set for the current breakpoint) to var(--space-1)
   (4px) brings the row down to ~52px: still comfortably above the 44px
   accessible touch target (the summary's own min-height, entirely
   independent of this td padding, is what actually guarantees 44px --
   never reduced here), just without the redundant extra padding. Higher
   specificity than both the base rule above and the @media (max-width:
   480px) rule below, so this one value governs the collapsed row's
   vertical rhythm at every viewport width; horizontal padding still
   correctly differs by breakpoint via those other rules.
   tr.detail-row (expanded team calculation/detail content) is a
   different class entirely and is untouched -- it keeps its own
   var(--space-3) padding declared further down. */
.team-table tr.team-row > td {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
  vertical-align: middle;
}

/* Founder visual-polish correction: a restrained hover/focus-within
   tint on the whole row helps a reader track across the wide table,
   without implying the row itself is one big clickable target --
   there is no cursor change here, and the row's only actual control
   (.team-name-toggle summary) keeps its own distinct gold hover state
   layered on top, so the two affordances stay visually different. */
.team-table tr.team-row:hover > td,
.team-table tr.team-row:focus-within > td {
  background: var(--color-bg-surface);
}

.team-table td.rank-col,
.team-table th.rank-col {
  width: 15%;
  white-space: nowrap;
  /* Assignment BETA-018 Required Correction 2: official-poll and Avg
     rank values/headers are centered -- only .team-col (Team) stays
     left-aligned, from the base .team-table th/td rule above, which
     this higher-specificity rule intentionally does not touch. */
  text-align: center;
}

/* Founder-authorized correction (BETA-021A narrow-screen table fix):
   a poll header's own label -- "Coaches" is the long case; "AP"/"CFP"
   never need this -- is one unbreakable word with no natural space for
   `white-space: normal` to wrap at (unlike the Avg column's "#12
   (12.00)" below, which already has one). Measured live at 320px: the
   base .rank-col nowrap above forced this header alone to ~68px,
   contributing to real, measured page-level horizontal overflow on
   this same sticky-header table that BETA-018's Avg-column override
   already fixed for the same underlying reason (see its comment
   below) -- the exact same fix, extended to cover this remaining
   unbreakable label. `overflow-wrap: anywhere` (not `table-layout:
   fixed`, rejected by that same BETA-018 decision for spilling text
   into the next column) lets the browser's own minimum-content-width
   calculation treat the word as breakable, so it only ever actually
   wraps once the column is genuinely too narrow for it -- confirmed
   live: "Coaches" wraps (several short lines; no explicit min-width
   was added here, since the narrow 320px budget is spent instead on
   the Flag column's badge below, which needed it far more) only at
   320px, and renders on one line, unchanged, at every wider verified
   breakpoint (340px+). Scoped to :not(.avg-col) so the Avg header
   (already handled by its own rule, and never long enough to need
   this) is untouched. Values (td.rank-col) keep plain nowrap -- a 1-2
   digit rank or "NR" never needs to wrap. */
.team-table thead th.rank-col:not(.avg-col) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.team-table th.flag-col,
.team-table td.flag-col {
  /* Assignment BETA-018 Required Correction 2: Flag header/values
     centered, matching the rank columns. Scoped to .flag-col only, so
     .team-detail's descriptive paragraphs (a separate, unclassed
     colspan cell) are never affected. */
  text-align: center;
  /* Founder-authorized correction (BETA-021A narrow-screen table fix):
     without this, the DISAGREE/TIE badge below's `overflow-wrap:
     anywhere` still resolves the 320px overflow on its own, but the
     browser's table-layout algorithm picks the narrowest column width
     that technically fits (measured live: ~41px), wrapping "DISAGREE"
     into 3-4 lines of 2-3 letters each -- technically readable
     (nothing hidden, truncated, or shrunk) but needlessly cramped.
     60px was measured live to be the actual budget available at
     320px (the table's own intrinsic width has slack below the
     viewport's clientWidth even before this rule) that produces a
     clean 2-line "DISA / GREE" wrap without reintroducing overflow --
     confirmed at every verified breakpoint down to 320px. Pixel (not
     percentage) because this needs to hold a specific worst-case
     rendered word width, not scale with the column's own share of the
     table. */
  min-width: 60px;
}

/* Assignment BETA-017: Average Poll Rank column -- narrower than a full
   official-poll rank-col (its content, "#12 (12.00)", is compact but
   slightly wider than a bare rank number) so adding it never pushes the
   table dramatically wider.

   Assignment BETA-018 (Founder correction): the v2/v3 comparison table
   (`.team-table-sticky-header`) no longer relies on `.table-wrap`'s
   overflow-x: auto to absorb any remaining overflow -- that safety net
   is deliberately removed for this table specifically so its sticky
   header can track true page-level scroll (see the
   `.table-wrap:has(.team-table-sticky-header)` rule above). Without
   that absorption, the base `.rank-col` rule's `white-space: nowrap`
   forced this column's ~"#25 (25.00)"-width minimum content width
   through the browser's automatic table-layout algorithm even at the
   narrowest supported viewport (320px), producing a real, measured few-
   pixel page-level horizontal overflow -- confirmed live in-browser,
   not merely reasoned about. Overriding back to the initial
   `white-space: normal` here (ONLY for this column; every other
   `.rank-col` keeps `nowrap`, since a bare 1-2 digit rank never needs
   to wrap) gives the layout algorithm the flexibility to avoid
   reserving that uncompressible width, which alone eliminates the
   overflow at 320px -- confirmed by measuring every row at that width
   afterward: all 25 rows still rendered at the same single-line height
   as every other column, i.e. this fix closes the overflow without
   ever actually triggering visible two-line wrapping in the tested
   worst case. Should some future value ever need to wrap, `normal`
   degrades safely to a clean second line rather than colliding with
   the next column's text (the alternative -- `table-layout: fixed` --
   was tried first and rejected: it eliminates the overflow too, but
   forces this column's text to overflow ITS OWN cell into the Flag
   column instead, which is worse, not better, for readability). */
.team-table td.rank-col.avg-col,
.team-table th.rank-col.avg-col {
  width: 12%;
  white-space: normal;
}

.avg-score {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.team-table td.team-col {
  width: 40%;
}

.team-table td.flag-col {
  width: 15%;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.1em 0.45em;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
  margin-left: var(--space-1);
  /* Founder-authorized correction (BETA-021A narrow-screen table fix):
     "DISAGREE" (and, in principle, "TIE") is a single unbreakable word
     with no natural wrap point -- measured live at 320px, it alone
     forced the Flag column to 81px, the single largest contributor to
     that width's real, measured page-level horizontal overflow on the
     sticky-header comparison table. Same fix and same rationale as the
     .rank-col header override above: `overflow-wrap: anywhere` lets
     the table's own minimum-content-width calculation treat the badge
     as breakable, so it only actually wraps once its column is
     genuinely too narrow -- confirmed live: two lines at 320px, one
     line unchanged at every wider verified breakpoint. The badge text
     itself is never shortened, hidden, or truncated -- every letter
     stays visible, just reflowed. */
  overflow-wrap: anywhere;
}

.badge-tie {
  color: var(--color-tie);
}

.badge-disagree {
  color: var(--color-disagree);
}

.nr {
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

.team-name-toggle summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--color-text);
  min-height: var(--min-target);
  width: 100%;
  padding: var(--space-1) 0;
  display: flex;
  align-items: center;
  /* flex-start (not space-between) keeps the chevron immediately beside
     the team name rather than pushed to the far edge of the row -- the
     full-width summary remains the 44px tap target either way. */
  justify-content: flex-start;
  gap: var(--space-2);
}

.team-name-toggle summary::-webkit-details-marker {
  display: none;
}

.team-name-toggle summary::marker {
  content: "";
}

.team-name-text {
  text-decoration: underline;
  /* Assignment 013G-4 Section 2: the previous --color-border-strong
     underline read as a faint table rule on an actual phone screen, not
     an interactive affordance. --color-text-muted (silver) at 2px with a
     larger offset reads as an intentional link at rest, without turning
     every team name gold -- gold stays reserved for hover/expanded state. */
  text-decoration-color: var(--color-text-muted);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.team-name-toggle summary:hover .team-name-text {
  color: var(--color-gold-strong);
  text-decoration-color: currentColor;
}

.team-name-toggle[open] .team-name-text {
  color: var(--color-gold-strong);
  text-decoration-color: currentColor;
}

.chevron {
  color: var(--color-text);
  font-size: 1.4em;
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.team-name-toggle[open] .chevron {
  transform: rotate(90deg);
  color: var(--color-gold-strong);
}

.team-detail {
  padding: var(--space-3);
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.team-detail p {
  margin: 0 0 var(--space-2);
}

.team-detail p:last-child {
  margin-bottom: 0;
}

.team-detail .rank-summary {
  color: var(--color-text);
  font-weight: 600;
  font-size: 1rem;
}

.team-detail .agreement-heading {
  color: var(--color-gold-strong);
  font-weight: 700;
  display: block;
  margin-bottom: var(--space-1);
}

.team-detail .full-comparison-label {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

/* Expanded team detail: a separate full-width row (colspan=5),
   revealed only for the specific team row whose <details> is open, via
   :has() -- no JavaScript. Browsers without :has() support simply show
   every detail row uncollapsed (never hidden/broken -- see the
   @supports guard below), a safe, honest degradation rather than a
   silent failure. */
tr.detail-row td {
  padding: var(--space-3);
  background: var(--color-bg-surface-raised);
}

@supports selector(:has(*)) {
  tr.detail-row {
    display: none;
  }

  tr.team-row:has(details[open]) + tr.detail-row {
    display: table-row;
  }
}

/* ---------------------------------------------------------------------
   Movement view
--------------------------------------------------------------------- */

/* Assignment BETA-021A: the five movement categories were previously
   five stacked, independently-collapsible `<details>` accordions (all
   collapsed by default, no single "selected" state). Replaced with one
   unified tab row -- a native `<fieldset>`/radio group styled as
   `.pill`-like tabs (keyboard-operable with zero JavaScript, exactly
   like every other governed control on this page) plus one visible
   panel at a time, chosen via CSS `:has()` with the same
   `@supports`-guarded, safe-degradation fallback already established
   for `tr.detail-row` above (no `:has()` support => every panel simply
   stays visible, never hidden/broken). Real counts and real team rows
   are unchanged -- only the outer disclosure mechanism changed. */
.movement-tabs {
  margin-top: var(--space-4);
}

/* Founder visual correction: wraps `.movement-tab-list` so a scroll-
   edge affordance (the ::after fade below) can be positioned against
   it without affecting the scroll container itself. */
.movement-tab-list-wrap {
  position: relative;
}

.movement-tab-list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  gap: var(--space-2);
  list-style: none;
  border: 0;
  margin: 0 0 var(--space-4);
  padding: 0 0 var(--space-1);
  /* The five categories stay reachable by touch swipe, trackpad, or
     (since each tab is a real, focusable radio) arrow-key navigation
     within the group -- hiding the native scrollbar here is purely
     cosmetic, never a loss of access. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.movement-tab-list::-webkit-scrollbar {
  display: none;
}

/* A static, always-present "there's more" hint on the trailing edge --
   deliberately not JS-driven scroll-position detection, matching this
   page's no-JavaScript-required contract. Removed once the row no
   longer scrolls (768px and up, where it wraps instead). */
.movement-tab-list-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: var(--space-1);
  width: 28px;
  background: linear-gradient(to right, transparent, var(--color-bg));
  pointer-events: none;
}

@media (min-width: 768px) {
  .movement-tab-list-wrap::after {
    display: none;
  }
}

.movement-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.movement-tab-label {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.movement-tab-label:hover {
  border-color: var(--color-gold);
  background: var(--color-bg-surface-raised);
}

.movement-tab-input:checked + .movement-tab-label {
  background: var(--gradient-gold);
  border-color: var(--color-gold-strong);
  color: #14140f;
  box-shadow: var(--shadow-gold);
}

.movement-tab-input:focus-visible + .movement-tab-label {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .movement-tab-list {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.movement-tab-panel {
  /* Safe default (no :has() support, or JS/CSS partially disabled):
     every category stays visible, stacked, exactly like the pre-
     BETA-021A accordion behavior -- never hidden without a way to
     reveal it again. */
}

.movement-tab-panel + .movement-tab-panel {
  margin-top: var(--space-4);
}

@supports selector(:has(*)) {
  .movement-tab-panel {
    display: none;
  }

  .movement-tabs:has(#mvtab-rose:checked) #mvpanel-rose,
  .movement-tabs:has(#mvtab-fell:checked) #mvpanel-fell,
  .movement-tabs:has(#mvtab-entered:checked) #mvpanel-entered,
  .movement-tabs:has(#mvtab-dropped:checked) #mvpanel-dropped,
  .movement-tabs:has(#mvtab-steady:checked) #mvpanel-steady {
    display: block;
  }
}

.movement-tab-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.movement-row {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface);
}

/* Founder visual-polish correction: a restrained accent border + wash
   on each row, matching its glyph's semantic color, so the rise/fall
   pattern reads at a glance across a long list -- never the ONLY
   signal (wording + the glyph's own distinct shape still carry the
   meaning independently, per 013G-4 Addendum 2 above). */
.movement-row-rise {
  border-left-color: var(--color-positive-border);
  background: var(--color-positive-bg);
}

.movement-row-fall,
.movement-row-drop {
  border-left-color: var(--color-negative-border);
  background: var(--color-negative-bg);
}

.movement-row-enter {
  border-left-color: var(--color-border-gold);
  background: rgba(184, 138, 51, 0.08);
}

.movement-glyph {
  font-weight: 700;
  font-size: 1.05em;
  width: 1.4em;
  flex-shrink: 0;
}

/* Assignment 013G-4 Addendum 2: semantic movement-symbol colors -- the
   glyph only. Wording and numeric movement text stay in the normal
   text color (they carry no `.movement-glyph` class), and the
   disclosure chevron (`.chevron`, styled separately above) is never
   colored by movement -- it is a navigation affordance, not data.
   Applied identically in the collapsed category header and each
   expanded team row, since both reuse this same `.movement-glyph.*`
   class. Category wording and the distinct glyph shape/character
   still carry the meaning too, so no state here depends on color alone. */
.movement-glyph.rise {
  color: var(--color-positive);
}

.movement-glyph.fall {
  color: var(--color-negative);
}

.movement-glyph.enter {
  color: var(--color-gold);
}

.movement-glyph.drop {
  color: var(--color-negative);
}

.movement-glyph.steady {
  color: var(--color-text-muted);
}

.empty-note {
  color: var(--color-text-faint);
  font-size: 0.9rem;
  padding: var(--space-2) 0;
}

/* ---------------------------------------------------------------------
   Assignment 014I: per-team game evidence + interval evidence-quality
   note within the Movement view. Composes services.poll_game_alignment_
   service's own governed payload -- these rules are presentation-only.
--------------------------------------------------------------------- */

.evidence-quality-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.evidence-quality-badge {
  display: inline-flex;
  align-items: center;
  min-height: var(--min-target);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.evidence-quality-detail summary {
  cursor: pointer;
  min-height: var(--min-target);
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  text-decoration-color: var(--color-border-strong);
}

.evidence-quality-detail summary:hover {
  color: var(--color-gold-strong);
}

/* The movement row itself gains a second visual line (the game-evidence
   block below) -- wrap rather than force it onto the existing single
   flex row, which would either clip it or break the row's own layout. */
.movement-row {
  flex-wrap: wrap;
}

.game-evidence {
  flex: 1 0 100%;
  margin-top: var(--space-1);
}

.game-evidence-summary {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.game-evidence-detail {
  margin-top: var(--space-1);
}

.game-evidence-detail summary {
  cursor: pointer;
  min-height: var(--min-target);
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  text-decoration-color: var(--color-border-strong);
}

.game-evidence-detail summary:hover {
  color: var(--color-gold-strong);
}

.game-evidence-list {
  list-style: none;
  margin: var(--space-1) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.game-evidence-list li {
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface-raised);
  font-size: 0.85rem;
  color: var(--color-text);
}

/* ---------------------------------------------------------------------
   Persistent explanation blocks, verification, methodology
--------------------------------------------------------------------- */

.notice-block {
  background: var(--color-bg-surface);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-5) 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.notice-block strong {
  color: var(--color-text);
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--min-target);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

section.expand-section {
  margin: var(--space-5) 0;
}

section.expand-section summary {
  cursor: pointer;
  font-weight: 600;
  min-height: var(--min-target);
  display: flex;
  align-items: center;
  color: var(--color-text);
}

.tech-disclosure {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-faint);
  word-break: break-all;
  background: var(--color-bg-surface-raised);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  margin-top: var(--space-3);
}

/* ---------------------------------------------------------------------
   Error page
--------------------------------------------------------------------- */

.error-panel {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-disagree);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin: var(--space-6) 0;
}

.error-panel h2 {
  margin-top: 0;
  color: var(--color-text);
}

.error-back-link {
  margin-top: var(--space-3);
}

/* Assignment 015L BETA-010: reuses the same .pill control already
   proven interactive/touch-sized/responsive at 320px (error-back-link
   above); only spacing is page-specific. */
.feedback-mine-back-link {
  margin-bottom: var(--space-3);
}

/* ---------------------------------------------------------------------
   Beta access gate (Assignment 015E)
--------------------------------------------------------------------- */

.beta-gate-panel {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin: var(--space-6) 0;
  max-width: 28rem;
}

.beta-gate-panel h2 {
  margin-top: 0;
  color: var(--color-gold-strong);
}

.beta-gate-form label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.beta-gate-form input[type="password"] {
  width: 100%;
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 1rem;
}

.beta-gate-form input[type="password"]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.beta-gate-form button {
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-5);
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-bg);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
}

.beta-gate-form button:hover {
  background: var(--color-gold-strong);
}

.beta-gate-form button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.beta-gate-error {
  color: var(--color-negative);
  margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------------
   Footer
--------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-5) var(--space-4);
  color: var(--color-text-faint);
  font-size: 0.8rem;
}

/* ---------------------------------------------------------------------
   Contextual feedback + public roadmap (Assignment 015I)
--------------------------------------------------------------------- */

.footer-feedback-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-gold-strong);
  text-decoration: underline;
  cursor: pointer;
}

.footer-feedback-link:hover {
  color: var(--color-text);
}

.feedback-dialog {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  color: var(--color-text);
  padding: 0;
  width: min(30rem, calc(100vw - 2rem));
  max-height: min(90vh, 40rem);
}

.feedback-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  overflow-y: auto;
  max-height: min(90vh, 40rem);
}

.feedback-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feedback-dialog-header h2 {
  margin: 0;
  color: var(--color-gold-strong);
  font-size: 1.2rem;
}

.feedback-close {
  min-width: var(--min-target);
  min-height: var(--min-target);
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.feedback-close:hover {
  color: var(--color-gold-strong);
}

.feedback-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.feedback-form select,
.feedback-form textarea,
.feedback-form input[type="text"] {
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 1rem;
  font-family: inherit;
}

.feedback-form textarea {
  resize: vertical;
}

.feedback-category-help {
  margin: calc(-1 * var(--space-2)) 0 0;
  color: var(--color-text-faint);
  font-size: 0.8rem;
}

.feedback-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.feedback-my-feedback-link {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: underline;
}

.feedback-submit-button {
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-5);
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-bg);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
}

.feedback-submit-button:hover {
  background: var(--color-gold-strong);
}

.feedback-status {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.85rem;
}

.feedback-status-success {
  color: var(--color-positive);
}

.feedback-status-error {
  color: var(--color-negative);
}

/* ---------------------------------------------------------------------
   Post-submit discoverability (Assignment 015J BETA-006) -- the JS-path
   in-dialog confirmation and the no-JS full-page confirmation banner.
--------------------------------------------------------------------- */

.feedback-success-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

.feedback-success-message {
  margin: 0;
  color: var(--color-positive);
  font-weight: 600;
}

.feedback-success-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.feedback-submitted-banner {
  position: fixed;
  right: var(--space-4);
  bottom: calc(var(--min-target) + var(--space-6));
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  max-width: min(24rem, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.feedback-submitted-banner p {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .feedback-submitted-banner {
    right: var(--space-3);
    bottom: calc(var(--min-target) + var(--space-5));
  }
}

/* Status badges -- shared by My Feedback, Roadmap, and the admin
   dashboard, so the same status always reads with the same color
   everywhere in the product. */
.feedback-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15em 0.6em;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 700;
}

.feedback-status-received,
.feedback-status-reviewing { color: var(--color-text-muted); }
.feedback-status-researching,
.feedback-status-planned { color: var(--color-gold); }
.feedback-status-in_progress { color: var(--color-gold-strong); }
.feedback-status-shipped { color: var(--color-positive); }
.feedback-status-needs_more_info { color: var(--color-disagree); }
.feedback-status-not_planned { color: var(--color-negative); }

.feedback-category-badge {
  color: var(--color-tie);
}

.feedback-list {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.feedback-item-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.feedback-item-header {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.feedback-item-message {
  margin: 0 0 var(--space-2);
  white-space: pre-wrap;
}

.feedback-founder-response {
  background: var(--color-bg-surface-raised);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-2) 0;
}

.feedback-founder-response-label {
  margin: 0 0 var(--space-1);
  color: var(--color-gold-strong);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feedback-item-meta {
  margin: 0;
  color: var(--color-text-faint);
  font-size: 0.8rem;
}

/* Roadmap */

.roadmap-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.roadmap-column {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.roadmap-column-title {
  margin: 0 0 var(--space-3);
  font-size: 0.95rem;
}

.roadmap-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.roadmap-item {
  background: var(--color-bg-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.roadmap-item-message {
  margin: var(--space-1) 0 0;
  font-size: 0.9rem;
}

.roadmap-item-response {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-left: 2px solid var(--color-gold);
  padding-left: var(--space-2);
}

/* Founder admin triage */

.admin-item-list {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.admin-item-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.admin-item-summary {
  cursor: pointer;
  list-style: none;
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.admin-item-summary::-webkit-details-marker {
  display: none;
}

.admin-item-preview {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.admin-item-body {
  padding: 0 var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-item-full-message {
  white-space: pre-wrap;
}

.admin-item-context {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-3);
  font-size: 0.85rem;
}

.admin-item-context dt {
  color: var(--color-text-muted);
}

.admin-item-context dd {
  margin: 0;
  color: var(--color-text);
  word-break: break-word;
}

/* Assignment 015J BETA-007: three stacked sections -- a compact metadata
   row (status/difficulty/priority/visibility/promote), substantially
   wider response/notes editors below it, and a normal-sized Save button
   at the bottom-right (replacing the old single uniform grid, whose
   `minmax(140px, 1fr)` cells left the two textareas as narrow as every
   other control and stretched the full-width Save button into an
   oversized block). */
.admin-triage-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--color-bg-surface-raised);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.admin-triage-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.admin-triage-form select,
.admin-triage-form textarea {
  min-height: var(--min-target);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: inherit;
}

.admin-triage-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.admin-triage-form .admin-checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.admin-triage-form .admin-checkbox-label input {
  width: 20px;
  height: 20px;
  accent-color: var(--color-gold);
}

.admin-triage-editors {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.admin-triage-editors textarea {
  width: 100%;
  resize: vertical;
}

.admin-triage-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-save-button {
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-5);
  background: var(--gradient-gold);
  border: none;
  color: var(--color-bg);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
}

.admin-save-button:hover {
  background: var(--color-gold-strong);
}

@media (min-width: 768px) {
  .admin-triage-editors {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-filter-form select {
  min-height: var(--min-target);
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

@media (max-width: 480px) {
  .admin-triage-meta {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------
   Responsive breakpoints
--------------------------------------------------------------------- */

@media (max-width: 480px) {
  .container {
    padding: var(--space-3);
  }

  .page-title {
    font-size: 1.4rem;
    margin-bottom: var(--space-1);
  }

  /* Founder visual correction: users should reach real rankings/
     Movement records significantly sooner on mobile -- tighten the
     hero and control-stack vertical rhythm rather than any single big
     cut, since no one piece dominates the height on its own. */
  .header-row {
    padding-top: 0;
    padding-bottom: var(--space-2);
  }

  .site-header .container:last-child {
    padding-top: var(--space-1);
    padding-bottom: var(--space-3);
  }

  .page-explanation {
    font-size: 0.9rem;
  }

  .control-bar,
  .control-row {
    margin: var(--space-2) 0;
  }

  table.team-table {
    font-size: 0.85rem;
  }

  .team-table th,
  .team-table td {
    padding: var(--space-2) var(--space-1);
  }
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* BETA-012: an expanded card would otherwise stay pinned to its
     narrow 1-of-3 grid column, forcing the governed explanation into a
     very tall, narrow strip. column-width lets an open card's wider
     explanation flow into readable-width columns rather than one
     edge-to-edge paragraph. */
  .card details[open] {
    column-width: 26rem;
    column-gap: var(--space-5);
  }

  /* BETA-016: the Pairwise Summary card spans the full grid row on
     desktop unconditionally -- collapsed or expanded -- since three
     cards of dense comparison stats read poorly at one-third width even
     collapsed. Narrowly scoped to `.pairwise-card` (never the generic
     `.card`, which may be reused by an unrelated card type later) so
     this never silently widens some other card. */
  .pairwise-card {
    grid-column: 1 / -1;
  }
}

/* Assignment BETA-021A: on the widest desktops, use the extra canvas
   for real density rather than empty margin -- movement rows within an
   open category flow into two columns, and the Coming Soon sections'
   sub-navigation gets more breathing room. Scoped to `.movement-tab-
   panel ul` (not the generic `.movement-group ul`, which no longer
   exists after the tab-row redesign above) so this only ever affects
   Movement. */
@media (min-width: 1024px) {
  .movement-tab-panel ul {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
}

/* ---------------------------------------------------------------------
   Reduced motion / accessibility
--------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------
   Beta tester welcome guide (Assignment 015K BETA-008). Reuses the same
   tokens/shapes as the Contextual feedback dialog above for visual
   consistency, opposite screen corner from the Feedback button so the
   two persistent controls never overlap.
--------------------------------------------------------------------- */

.beta-guide-reopen-button {
  position: fixed;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 90;
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.beta-guide-reopen-button:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-strong);
}

.welcome-guide-dialog {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  color: var(--color-text);
  padding: 0;
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(90vh, 44rem);
  overflow: hidden;
}

/* In-app browsers (e.g. opening a shared link from X) have toolbars that
   make 90vh taller than the visible area, pushing the header (and its
   close button) under the app's own bars. Keep the dialog well inside the
   dynamic viewport (80dvh) so header and actions clear any overlay. */
@supports (height: 100dvh) {
  .welcome-guide-dialog {
    max-height: min(80dvh, 44rem);
    margin: auto;
  }
}

/* Assignment BETA-011 fix: `display` must only ever be set on the
   OPEN dialog. An unconditional `display: flex` on the bare selector
   above overrode the native `dialog:not([open]) { display: none }`
   UA rule, so a closed guide stayed visible, in normal document flow,
   at whatever position it falls in the DOM (with its own children --
   including the "Start Exploring" button's `autofocus` -- eligible for
   the page's autofocus/scroll-into-view once "being rendered" again
   included the closed state). That single override was the entire
   observed defect: the visible closed dialog after a dismissed return
   visit, and X/Start Exploring/Escape appearing to "do nothing" (they
   correctly called the native close(), which correctly cleared `open`
   -- the dialog just never actually disappeared). */
.welcome-guide-dialog[open] {
  display: flex;
  flex-direction: column;
}

.welcome-guide-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.welcome-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) 0;
}

.welcome-guide-header h2 {
  margin: 0;
  color: var(--color-gold-strong);
  font-size: 1.25rem;
}

/* Clearly visible close control: bordered gold pill with text, so it reads
   as a button on the dark surface rather than a faint grey "x". */
.welcome-guide-header .welcome-guide-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-gold);
  border-radius: 999px;
  color: var(--color-gold-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.welcome-guide-header .welcome-guide-close span {
  font-size: 1.25rem;
  line-height: 1;
}

.welcome-guide-header .welcome-guide-close:hover,
.welcome-guide-header .welcome-guide-close:focus-visible {
  background: var(--color-gold);
  color: var(--color-bg-surface);
}

.welcome-guide-body {
  padding: var(--space-4) var(--space-5);
  overflow-y: auto;
}

.welcome-guide-body p {
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}

.welcome-guide-body h3 {
  margin: var(--space-4) 0 var(--space-2);
  color: var(--color-gold-strong);
  font-size: 1rem;
}

.welcome-guide-body ul {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
  color: var(--color-text);
}

.welcome-guide-body li {
  margin-bottom: var(--space-1);
}

.welcome-guide-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--color-border);
}

.welcome-guide-secondary-link {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .beta-guide-reopen-button {
    left: var(--space-3);
    bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: 0.85rem;
  }

  .welcome-guide-header,
  .welcome-guide-body,
  .welcome-guide-actions {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ---------------------------------------------------------------------
   Mobile primary-nav clearance (Assignment BETA-021A). Placed last so
   it wins the cascade over the earlier fixed-position rules above at
   every width below 768px (where `.primary-nav` becomes a fixed bottom
   tab bar) -- both the general beta-guide-reopen-button
   rules and their own narrower <480px overrides. Keeps the feedback
   FAB, the welcome-guide reopen button, the post-submit banner, and
   ordinary page content (via body padding) clear of the nav bar rather
   than hidden underneath it.
--------------------------------------------------------------------- */

@media (max-width: 767px) {
  body {
    padding-bottom: var(--mobile-nav-height);
  }

  .beta-guide-reopen-button {
    bottom: calc(var(--mobile-nav-height) + var(--space-3));
  }

  .feedback-submitted-banner {
    bottom: calc(var(--mobile-nav-height) + var(--min-target) + var(--space-3));
  }
}

/* ===========================================================================
   Games: Results / Team Box Scores (Assignment BETA-025A)
   =========================================================================== */

/* ---------------------------------------------------------------------
   Games subnavigation + backlit button prototype.

   Deliberately isolated under `.games-subnav-list .backlit-pill` (an
   additive modifier alongside the existing `.pill` base, never a
   change to `.pill` itself) so this treatment only ever applies to the
   Games subnav, per this assignment's own scope, and stays reusable as
   a future shared component/theme without touching any other page.

   Inactive: a near-black center with a metallic (brushed, two-tone
   inset highlight/shadow) border -- distinct from the flat
   `--color-bg-surface` every other `.pill` uses at rest. Active: the
   center stays dark (never replaced by the sitewide flat gold-slab
   `.pill[aria-current]` treatment) with a gold-lit rim and a narrow,
   restrained outer glow -- modeled on an illuminated button on older
   electronics, not a neon sign. `aria-current="page"` (not `"true"`,
   the convention every other pill-nav on this site uses for an
   in-page view toggle) -- an explicit, deliberate deviation: these
   pills are real distinct pages/URLs, which is exactly what
   `aria-current="page"` means, and BETA-025A's own brief calls for it
   by name. See the BETA-025A decision record for this discrepancy.
--------------------------------------------------------------------- */

.games-subnav-wrap {
  margin-bottom: var(--space-4);
}

.games-subnav-list {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: var(--space-1);
  -webkit-overflow-scrolling: touch;
  /* Restrained horizontal-scroll cue: a soft fade at each edge when
     there is more to scroll to, rather than a visible scrollbar or an
     arrow icon. Purely decorative -- scrolling itself works with or
     without mask support (@supports not needed: an unsupported
     mask-image property is simply ignored, leaving a plain, fully
     usable scroll region). */
  mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
}

.games-subnav-list li {
  flex: 0 0 auto;
}

.backlit-pill {
  background: linear-gradient(180deg, #131316 0%, #0a0a0c 100%);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.backlit-pill:hover {
  background: linear-gradient(180deg, #17171b, #0c0c0e);
  border-color: var(--color-gold);
  color: var(--color-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 0 6px rgba(184, 138, 51, 0.2);
}

.backlit-pill[aria-current="page"] {
  background: linear-gradient(180deg, #1a160c 0%, #0b0a07 100%);
  border: 1px solid var(--color-gold-strong);
  color: var(--color-gold-bright);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(221, 186, 95, 0.45);
  box-shadow: inset 0 0 0 1px rgba(184, 138, 51, 0.55), inset 0 1px 0 rgba(221, 186, 95, 0.22),
    0 0 10px 1px rgba(184, 138, 51, 0.3);
}

.backlit-pill[aria-current="page"]:hover {
  box-shadow: inset 0 0 0 1px rgba(205, 162, 71, 0.65), inset 0 1px 0 rgba(221, 186, 95, 0.3),
    0 0 14px 2px rgba(184, 138, 51, 0.4);
}

/* Keyboard focus stays visibly distinct from the selected glow: an
   outward-offset gold focus ring never merges with the inset rim/glow
   above, on both the inactive and active button. */
.backlit-pill:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   Results / Team Box Scores filter row and results table.
--------------------------------------------------------------------- */

.games-filter-form {
  flex-wrap: wrap;
}

.team-search-input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: var(--min-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  color: var(--color-text);
  font-size: 0.95rem;
}

.games-clear-filters {
  background: transparent;
}

.games-results-table td,
.games-results-table th {
  vertical-align: middle;
}

.game-score-col {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Winner/loser are always ALSO carried by the "W"/"L" badge text and
   (on the box-score header) the explicit result wording -- these
   background/border washes are a secondary, non-exclusive signal,
   never the only one. Ties (structurally never produced by the
   governed game-result contract, which rejects an equal-score game
   rather than representing a tie -- see the decision record) use the
   neutral/gold `.game-row-tie` treatment below if a future data source
   ever makes one representable. */
.game-winner {
  background: var(--color-positive-bg);
  border-left: 3px solid var(--color-positive-border);
}

.game-loser {
  background: var(--color-negative-bg);
  border-left: 3px solid var(--color-negative-border);
}

.game-row-tie td {
  background: rgba(205, 162, 71, 0.09);
  border-left: 3px solid var(--color-gold-strong);
}

.game-result-badge {
  padding: 0 var(--space-1);
  font-size: 0.7rem;
  min-height: 0;
  min-width: 0;
  border-radius: var(--radius-sm);
}

.game-result-badge.game-result-win {
  color: var(--color-positive);
  border-color: var(--color-positive-border);
  background: var(--color-positive-bg);
}

.game-result-badge.game-result-loss {
  color: var(--color-negative);
  border-color: var(--color-negative-border);
  background: var(--color-negative-bg);
}

.games-empty-state {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------
   Selected-game team box score: header + matchup card.
--------------------------------------------------------------------- */

.box-score-header {
  margin-bottom: var(--space-5);
}

.box-score-matchup {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.box-score-team {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
}

.box-score-team-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.box-score-team-score {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.box-score-at {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.box-score-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0 0 var(--space-2);
}

.box-score-meta > div {
  display: flex;
  flex-direction: column;
}

.box-score-meta dt {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.box-score-meta dd {
  margin: 0;
  font-weight: 600;
}

.box-score-caveat {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  max-width: 60ch;
}

/* ---------------------------------------------------------------------
   Statistic selector: one collapsible group per governed display
   group, reusing the existing `.poll-checklist-*` shapes/spacing for
   its inner list, form panel, and checkbox rows. `.stat-selector`
   itself is the OUTER disclosure -- a single full-width expandable
   panel at every viewport width (the assignment's mobile requirement
   verbatim; also an acceptable "contained selector panel" for desktop,
   since a floating popover was optional -- see the decision record).
--------------------------------------------------------------------- */

.stat-selector {
  width: 100%;
  margin-bottom: var(--space-4);
}

.stat-selector-summary {
  font-size: 1rem;
}

.stat-selector[open] > .stat-selector-summary .chevron {
  transform: rotate(90deg);
  color: var(--color-gold-strong);
}

.stat-selector-count {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.stat-selector-body {
  display: grid;
  gap: var(--space-3);
}

.stat-selector-global-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pill-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 0.82rem;
  min-height: 36px;
}

.stat-selector-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-surface-raised);
  padding: var(--space-2) var(--space-3);
}

.stat-selector-group-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  min-height: var(--min-target);
}

.stat-selector-group-summary::-webkit-details-marker {
  display: none;
}

.stat-selector-group-summary::marker {
  content: "";
}

.stat-selector-group[open] .stat-selector-group-summary .chevron {
  transform: rotate(90deg);
  color: var(--color-gold-strong);
}

.stat-selector-group-count {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.82rem;
}

.stat-selector-group-controls {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.stat-selector-list {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  max-height: none;
}

@media (min-width: 640px) {
  .stat-selector-list {
    display: grid;
  }
}

/* ---------------------------------------------------------------------
   Box score table: horizontal scroll contained to the table itself,
   sticky Team column, sticky header row, angled statistical headers.
--------------------------------------------------------------------- */

.box-score-table-wrap {
  /* Restrained horizontal-scroll cue, matching the Games subnav's own
     edge-fade technique above -- purely decorative, harmless if
     mask-image is unsupported. */
  mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
}

table.box-score-table {
  /* Founder visual-review correction (fourth pass): `min-width: 100%`
     forced the table to stretch to fill the wrapper whenever fewer
     columns were selected, and `table-layout: auto`'s default
     algorithm then redistributed that extra width across the visible
     stat columns -- exactly the "six columns stretched across the
     available width" defect. `table-layout: fixed` + a plain `width`
     (not `min-width`) on every column below makes column widths a
     direct, literal function of their own CSS width alone: never
     inflated by extra wrapper space, and never affected by how many
     OTHER columns happen to be hidden. The table's own overall width
     becomes the honest sum of only its currently-visible columns --
     intrinsic content width, never forced to 100%. */
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: max-content;
}

.box-score-table th.team-col,
.box-score-table td.team-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-bg-surface);
  /* An explicit `width` (not just min/max-width) so `table-layout:
     fixed` -- required below to keep stat-column widths from
     redistributing -- has a definite value to read from this column,
     the same way it needs one from every `.stat-col`. min/max-width
     still bound it (a very long team name still wraps rather than
     forcing the column wider) since `white-space: normal` allows
     wrapping within that width. */
  width: 180px;
  min-width: 160px;
  max-width: 220px;
  text-align: left;
  white-space: normal;
  /* Founder visual-review correction (BETA-025A revision): a visibly
     stronger seam than the per-column dividers below -- this is the
     one boundary a reader most needs to find at a glance (Team vs.
     every statistic). */
  border-right: 2px solid var(--color-border-strong);
}

/* The header's own Team cell sits at the intersection of the sticky
   column and the sticky header row -- it needs the highest stacking
   position of ANY cell in the table (including every angled stat
   header's own per-column z-index below, the highest of which is 100)
   so neither scrolling axis, nor a diagonal label overflowing rightward
   out of its own column, ever draws over its corner. */
.box-score-table thead th.team-col {
  z-index: 300;
  background: var(--color-bg);
  /* Matches `.angled-header`'s own strengthened baseline divider so
     the thead/tbody seam reads as one continuous line across the
     Team column too, not just the stat columns. */
  border-bottom: 2px solid var(--color-border-strong);
}

/* Fallback only -- every actual stat header carries its own inline
   `z-index` (strictly decreasing left-to-right, see `web/games.py`'s
   `stat_header_z_index`), which always wins over this. Needed only if
   a header somehow rendered without its inline style. */
.box-score-table thead th.stat-col {
  z-index: 5;
}

.box-score-table td.stat-col,
.box-score-table th.stat-col {
  /* Column width is sized to the DATA each category displays, not to
     the angled header's own (often longer) short label -- angled
     headers exist specifically to decouple the two: a label is free to
     overflow rightward into later columns' own header space (see the
     `.angled-header` comment below), so a narrow column never forces a
     label to wrap, shrink, or clip. Two governed tiers, both confirmed
     live via CDP -- using an exact rotated-rectangle intersection
     test, not a same-axis bounding-box approximation -- to produce
     zero label clipping and zero genuine label-to-label overlap at
     every required breakpoint and selection state:
     - 56px for every plain `integer`/`decimal` category (a single
       short number, e.g. "313" or "6.5").
     - 72px (`.stat-col-compound` below, applied to the five
       `compound_pair`/`clock` categories -- see
       `services.team_game_stat_categories.CategoryDisplay
       .is_compound_width`) for a two-part value like "8-19" or a
       clock value like "37:20".

     `width` (a plain, exact value), not `min-width` -- combined with
     `table-layout: fixed` on the table itself (above), this is what
     guarantees a category's column is the SAME width regardless of
     how many other columns happen to be visible alongside it: fixed
     layout reads column widths once, directly, from these values, and
     never redistributes leftover space across them the way the
     default `table-layout: auto` algorithm does. A column hidden via
     the `hidden` attribute is removed from the table's column count
     entirely (consistently, in every row), so the table's own overall
     width simply shrinks by that column's width -- it never gets
     handed to the remaining visible columns. */
  width: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.box-score-table td.stat-col-compound,
.box-score-table th.stat-col-compound {
  width: 72px;
}

/* The vertical "silver-gray" column divider lives on the DATA cells
   only (Founder visual-review correction, second pass) -- the header
   cells render their own boundary as the angled `.angled-rail` below
   instead, so the boundary genuinely transitions from diagonal (across
   the header band) to vertical (down through both team rows) at the
   exact baseline where they meet, rather than a straight vertical line
   running the full height with a second, disconnected diagonal drawn
   on top of it. */
.box-score-table td.stat-col {
  /* 0.14 measured too faint to read against the near-black page
     background once actually rendered (confirmed via a zoomed-in
     screenshot) -- 0.22 is the value that reads as a genuine, if
     restrained, silver-gray hairline rather than an invisible one.
     Matches `.angled-rail`'s own color exactly, so the boundary looks
     like one continuous line across the diagonal-to-vertical
     transition, not two different intensities meeting at the
     baseline. */
  border-left: 1px solid rgba(197, 200, 209, 0.22);
}

/* The first column of each governed display group (Offense/Defense/
   Special Teams/Game & Situational) gets a visibly stronger divider --
   still restrained, one step up from the per-column hairline above --
   so the four groups read as distinct sections while scrolling. */
.box-score-table td.stat-col-group-start {
  border-left: 1px solid rgba(197, 200, 209, 0.55);
}

/* Angled statistical column headers (~45 degrees), revised per Founder
   visual review. Each header is a short, fixed-height box (not the
   tall, mostly-empty band of the first attempt); its label is
   absolutely positioned with its own bottom-left corner pinned to the
   HORIZONTAL CENTER of the header's bottom edge (`left: 50%` on an
   element whose `transform-origin` is also its own bottom-left corner
   -- so that exact point never moves under rotation) -- which is also
   the horizontal center of the data column beneath it. Rotating -45deg
   around that fixed point swings the label up and to the right, so it
   reads lower-left-to-upper-right starting exactly above its own
   column, per the Founder's corrected design.

   This deliberately overflows rightward into the header space of
   later columns -- an inherent, expected property of a bottom-anchored
   diagonal label (this is how Excel/PowerBI angled headers read too),
   never a bug -- which is exactly why every stat header's `z-index` is
   set inline, strictly decreasing left-to-right: without it, a later
   column's own opaque header background would silently paint over and
   clip an earlier column's overflowing label. Because every label
   shares the same +/-45 degree angle, two neighboring labels are
   always exactly parallel and offset by one full column width, so they
   never cross or visually overlap each other, regardless of length.

   The visible text is the SHORT label only (`cat.short_label`,
   Founder-directed concise abbreviations) -- the complete governed
   name lives in the `<th>`'s own `title`/`aria-label` (set in the
   template), never lost, never removed from the statistic selector's
   own checkboxes (which always show the full `cat.label`). */
/* Assignment BETA-025A5 (Founder visual correction): the base
   `.team-table th` rule gives every header cell an opaque, rectangular
   `var(--color-bg-surface)` background -- fine for an ordinary header
   row, but wrong here, where it painted a conventional rectangular gray
   band behind each diagonal label/rail, ending in a vertical gray wall
   at the header's outer edges instead of an angled one. The `<th>`
   itself stays transparent; the actual panel fill is drawn by
   `.angled-header::before` below, clipped to a parallelogram that
   shares the rails' own angle, so the fill genuinely looks like an
   individual angled panel rather than a rectangle with diagonal
   decorations on top of it. */
.box-score-table th.angled-header {
  background: transparent;
}

.angled-header {
  height: 96px;
  padding: 0;
  vertical-align: bottom;
  /* Single source for the panel fill's rise below -- always equal to
     this rule's own `height`, never a second hand-copied 96px. */
  --panel-rise: 96px;
  /* The explicit thead/tbody baseline divider (Founder requirement,
     fourth pass): strengthened from the base `.team-table th`
     hairline so this specific seam -- where the header region ends
     and the two team rows begin -- reads unambiguously, not just as
     an incidental row-border. Matched on `.box-score-table thead
     th.team-col` below so the line runs continuously across the
     sticky Team header too, not just the stat columns. */
  border-bottom: 2px solid var(--color-border-strong);
  position: relative;
}

.angled-label-inner {
  position: absolute;
  left: 50%;
  /* Founder visual-review correction, FOURTH pass -- supersedes the
     third pass entirely. That revision centered the label between the
     two rails by moving `bottom` NEGATIVE (to -14px), which does
     achieve perpendicular centering, but does so by moving the
     rotation ORIGIN itself below the header's own bottom edge -- and
     because the label's rendered box only ever extends in ONE
     direction from that origin (up and to the right; it never extends
     back down past its own anchor), anchoring the origin below the
     header boundary let real rendered pixels spill into the first
     `<tbody>` row. Measured, confirmed live: a 13px genuine overlap
     between the label's own rendered bounding box and the first body
     row's bounding box -- not a z-index illusion, an actual layout
     collision, exactly what this pass exists to eliminate.

     The fourth-pass fix keeps the rotation origin itself SAFELY at or
     above the header baseline (`bottom: 20px`, comfortably positive --
     this alone already guarantees the whole rotated box stays at or
     above that point, the same guarantee `.angled-rail` below relies
     on) and instead reaches perpendicular centering with a SECOND,
     independent transform function: `translateY(24px)`, applied in
     the transform list BEFORE the rotation (composition is right-to-
     left), which shifts the box's content in local, pre-rotation
     space -- moving the whole label uniformly toward the right rail
     without moving the fixed rotation origin at all. Both values were
     found empirically (live CDP: (a) `label.getBoundingClientRect()
     .bottom` compared directly against the first `<tbody>` row's own
     `.top`, confirming ~4px of clear, positive gap -- not merely a
     computed estimate -- consistently regardless of a label's own
     text length, since only the shared height, not the width, of the
     rotated box determines this; and (b) the same exact rotated-
     rectangle-to-rail-line-equation distance check the third pass
     used, confirming ~9.7-9.9px of perpendicular clearance on BOTH
     sides for the 56px column tier, ~15.3-15.6px for the 72px
     compound tier). `left: 50%` is untouched -- every label still
     starts centered horizontally over its own column. */
  bottom: 20px;
  transform-origin: left bottom;
  transform: rotate(-45deg) translateY(24px);
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

/* The angled RAIL (Founder visual-review correction, second pass):
   each header's own left boundary, drawn as a thin diagonal bar
   instead of a plain vertical line, so the boundary genuinely reads as
   "vertical through the values, diagonal across the header" rather
   than a straight line with a disconnected diagonal drawn over it (see
   `.box-score-table td.stat-col`'s own comment for the vertical half of
   this same boundary). Anchored at `left: 0; bottom: 0` -- the exact
   same point where the data column's own `border-left` begins -- with
   `transform-origin: left bottom`, so the rail's bottom endpoint never
   moves under rotation and lands EXACTLY on that vertical gridline; no
   separate alignment math is needed; both are pinned to the identical
   coordinate.

   Rotated `45deg` -- POSITIVE, the opposite sign from the label's own
   `rotate(-45deg)` a few rules up, despite both needing to read as
   "rises to the upper right." This is intentional, not a mismatch: the
   two elements have opposite aspect ratios (the label is short and
   wide -- width far exceeds height -- while this rail is tall and
   narrow -- height far exceeds width), and for a rotation pivoted at
   the shared bottom-left corner, which SIGN of angle swings the far
   end rightward-and-up depends on which dimension dominates. A wide,
   short box needs `-45deg`; a tall, narrow one needs `+45deg`. Getting
   this backwards was a real bug caught during this revision: with
   `-45deg`, the rail swung UP AND TO THE LEFT instead (confirmed via a
   direct `getBoundingClientRect()` comparison showing the rendered
   rail sitting almost entirely inside the PREVIOUS column rather than
   rising above its own) -- worth restating plainly here since the sign
   is easy to get wrong again if this rule is ever "simplified" to
   match the label's rotation literally.

   A 2px-wide, 136px-tall bar rotated 45deg reaches 136 * cos(45deg)
   =~ 96px of vertical rise -- i.e. it spans the full 96px header band,
   framing the label between it and the next column's own rail (this
   same rule, offset exactly one column to the right). Two neighboring
   rails are always exactly parallel (identical rotation) and separated
   by exactly one column's width at every height, so they never cross
   each other. The label sits at the column's own horizontal center,
   exactly halfway between its two flanking rails at the baseline --
   but because columns are deliberately narrow (56-72px; see
   `.box-score-table td.stat-col` above) while a label's own diagonal
   footprint is often longer than half a column's width, a label
   routinely (and harmlessly) crosses OVER the next column's rail as it
   rises: every stat header's `z-index` decreases left-to-right (see
   comment above), so an earlier column's label always paints on top of
   a later column's rail wherever they meet -- the rail visually ducks
   under the readable text rather than cutting across it. Confirmed via
   an exact rotated-rectangle geometry check (not an axis-aligned
   bounding-box approximation) live at every required breakpoint and
   selection state. Width bumped from an initial 1px (measured, via a
   zoomed screenshot, to anti-alias into near-invisibility once actually
   rotated) to 2px -- still a restrained hairline, not a heavy rule. */
.angled-rail {
  position: absolute;
  left: 0;
  /* `bottom: 0` measured, live, a genuine (if minute -- ~0.4px)
     rendered overlap into the first `<tbody>` row: subpixel rounding
     in the browser's own table layout, not a whole-pixel misalignment,
     but a real non-zero collision by exact measurement all the same.
     1px is enough margin to push the measured intersection to zero
     while staying visually indistinguishable from "terminates exactly
     at the baseline." */
  bottom: 1px;
  width: 2px;
  height: 136px;
  background: rgba(197, 200, 209, 0.22);
  transform-origin: left bottom;
  transform: rotate(45deg);
  pointer-events: none;
}

/* Same governed-group-boundary emphasis as `td.stat-col-group-start`,
   applied to the first column's rail in each of the four groups. */
.angled-rail-strong {
  background: rgba(197, 200, 209, 0.55);
}

/* Assignment BETA-025A5: the angled panel fill itself. A background-only
   pseudo-element, not a transform on the `<th>` or the label -- the cell
   keeps its normal box for width/table-layout purposes, and this layer
   supplies only the visible gray shape.

   Generated as `::before`, it is the first box painted inside this
   `<th>` -- the rail and label spans that follow it in the template
   markup paint on top of it automatically, with no z-index of its own
   needed here; it still inherits this `<th>`'s own inline per-column
   z-index for the existing cross-column stacking (an earlier column's
   overflowing label already paints over a later column's whole subtree,
   fill included, exactly as it did over the old rectangular background).

   The shape is a true parallelogram, not a trapezoid: its left and right
   edges are both shifted by the same `--panel-rise` amount at the top
   relative to the bottom, giving them the identical 45-degree slope the
   rails already use (rise == run for a 45-degree angle, and this panel's
   rise is pinned to the exact same `--panel-rise` variable the header
   sets from its own `height` above -- never a separately hand-tuned
   value). Because every column's left edge is drawn at local x=0 and its
   right edge at local x=<column width>, and the NEXT column's own panel
   independently draws ITS left edge at ITS local x=0 (which is the same
   physical point, one column width to the right), two neighboring panels
   share the exact same boundary line and tile edge-to-edge with no gap
   or doubled seam -- the same reasoning that already makes neighboring
   `.angled-rail` elements line up.

   `width: calc(100% + var(--panel-rise))` intentionally extends this
   layer beyond the `<th>`'s own right edge -- exactly the same
   "overflows into later columns' space, resolved by z-index" pattern
   `.angled-label-inner` already relies on, not a new kind of overflow.
   `clip-path` then cuts that oversized box down to the actual visible
   parallelogram; the two rules below differ only in the literal column
   width they clip to, matching the two existing width tiers
   (`.box-score-table th.stat-col` / `.stat-col-compound`) exactly, so a
   future change to either tier's `width` and its corresponding
   clip-path stay visibly paired in the source rather than drifting
   apart silently. */
.angled-header::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  background: var(--color-bg-surface);
  pointer-events: none;
}

.box-score-table th.stat-col.angled-header::before {
  width: calc(100% + var(--panel-rise));
  clip-path: polygon(
    var(--panel-rise) 0,
    calc(56px + var(--panel-rise)) 0,
    56px 100%,
    0 100%
  );
}

.box-score-table th.stat-col-compound.angled-header::before {
  width: calc(100% + var(--panel-rise));
  clip-path: polygon(
    var(--panel-rise) 0,
    calc(72px + var(--panel-rise)) 0,
    72px 100%,
    0 100%
  );
}

@media (prefers-reduced-motion: reduce) {
  /* The angled header's rotation is a static layout transform, not an
     animation -- nothing to disable here. Listed for completeness:
     the sitewide `* { transition: none !important; }` rule already
     covers every hover/focus transition this section adds. */
  .angled-header {
    transform: none;
  }
}

/* ===========================================================================
   Teams experience -- Archive Ink visual system (Assignment BETA-027A,
   Founder-corrected). Founder/Atlas review directed that the approved
   prototype's own "Archive Ink" tokens are the visual authority for the
   Teams experience -- NOT a substitution of Ranktory's pre-existing
   site-wide tokens merely because they already exist. Every token and
   component below is therefore SCOPED under `body.teams-page` (set via
   `{% block body_class %}teams-page{% endblock %}` in the Teams
   templates only) so no other page's appearance changes at all. The
   real Ranktory global header/nav (`.site-header`, `.primary-nav`) is
   untouched -- only the Teams identity/content beneath it adopts
   Archive Ink.

   NAMESPACING (Founder/Atlas correction after a confirmed regression):
   every class introduced for the Teams experience is prefixed
   `teams-` -- including ones that happened not to collide with an
   existing class today, per the explicit "audit every new selector,
   not only the ones already found" instruction. `.team-row` (which
   collided with real `<tr class="team-row">` rows on the Rankings and
   Games box-score pages, breaking their table layout by forcing
   `display:flex` onto a table row) is now `.teams-game-row`.
   `.card-title`/`.card-head`/`.card-kicker`/`.card-footnote` (which
   collided with `coming_soon.html`/`games_placeholder.html`) are now
   `.teams-card-*`. `.evidence-list` (which collided with
   `poll_comparison.html`'s own evidence list) is now
   `.teams-evidence-list`. Teams cards no longer reuse the shared
   `.card` component at all (see `.teams-card` below) -- a second,
   independent reason the two can never collide again.
=========================================================================== */

body.teams-page {
  /* Archive Ink tokens, transcribed from the approved prototype's own
     styles.css :root block -- values only, never approximated. */
  --teams-bg: #0C0E10;
  --teams-surface-raised: #171A1E;
  --teams-surface-sunken: #121416;
  --teams-surface-hover: #1E2328;
  --teams-border: #252A31;
  --teams-border-strong: #2F353E;
  --teams-border-gold: rgba(197, 164, 106, 0.28);
  --teams-text-primary: #EDE9E3;
  --teams-text-secondary: #C9CDD1;
  --teams-text-muted: #9AA0A9;
  --teams-text-faint: #8A8F98;
  --teams-accent: #C5A46A;
  --teams-accent-hover: #D5B983;
  --teams-accent-soft: #E8D9B8;
  --teams-accent-faint: rgba(197, 164, 106, 0.10);
  --teams-accent-border: rgba(197, 164, 106, 0.28);
  --teams-accent-border-strong: rgba(197, 164, 106, 0.38);
  /* Approved "muted sage" -- the prototype's own design principle is
     explicit that a positive indicator is NEVER the site's saturated
     traffic-green token; this is the only positive color the Teams
     experience ever uses. */
  --teams-positive: #8FA89D;
  --teams-positive-faint: rgba(143, 168, 157, 0.14);
  --teams-positive-border: rgba(143, 168, 157, 0.30);
  --teams-positive-soft: #C1D2C9;
  --teams-negative: #C08A7B;
  --teams-negative-faint: rgba(192, 138, 123, 0.13);
  --teams-negative-border: rgba(192, 138, 123, 0.28);
  --teams-neutral: #9AA0A9;
  --teams-neutral-faint: rgba(154, 160, 169, 0.12);
  --teams-neutral-border: rgba(154, 160, 169, 0.22);
  --teams-radius: 14px;
  --teams-radius-sm: 10px;
  --teams-min-target: 44px;

  background: var(--teams-bg);
  color: var(--teams-text-primary);
}

/* --- Teams card component (own component -- never the shared `.card`,
   so the two can never collide again). Approved bordered-card-head
   treatment: a distinct padded, bottom-bordered band, not a bare
   margin. --- */

.teams-card {
  background: var(--teams-surface-raised);
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.teams-card-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--teams-border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.teams-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--teams-text-primary);
}

.teams-card-kicker {
  font-size: 13px;
  color: var(--teams-text-muted);
  font-weight: 500;
}

.teams-card-footnote {
  font-size: 12.5px;
  color: var(--teams-text-faint);
  line-height: 1.5;
  padding: 12px 20px;
  border-top: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
}

.teams-card-footnote.faint {
  color: var(--teams-text-faint);
}

.teams-card > :not(.teams-card-head):not(.teams-card-footnote) {
  padding: 0 20px;
}

.teams-card > :not(.teams-card-head):not(.teams-card-footnote):first-child {
  padding-top: 16px;
}

.teams-card > :not(.teams-card-head):not(.teams-card-footnote):last-child {
  padding-bottom: 16px;
}

.teams-evidence-badge {
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--teams-accent-faint);
  color: var(--teams-accent-soft);
  border: 1px solid var(--teams-accent-border);
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.teams-value-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--teams-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: middle;
}

.teams-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
}

.teams-btn-primary,
.teams-btn-secondary {
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.teams-btn-primary {
  background: var(--teams-accent);
  color: var(--teams-bg);
  border: 1px solid var(--teams-accent);
}

.teams-btn-primary:hover {
  background: var(--teams-accent-hover);
  border-color: var(--teams-accent-hover);
}

.teams-btn-secondary {
  background: var(--teams-surface-raised);
  color: var(--teams-text-secondary);
  border: 1px solid var(--teams-border);
}

.teams-btn-secondary:hover {
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
  background: var(--teams-surface-hover);
}

/* --- Team browse index (conference groups) ------------------------------ */

.teams-browse-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

/* Filter input — compact, native to Teams page; full-width on mobile,
   constrained on desktop so it does not dominate. */
.teams-browse-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  max-width: 100%;
}

.teams-browse-search {
  flex: 1;
  min-width: 0;
  min-height: var(--teams-min-target);
  padding: 10px 14px;
  border: 1px solid var(--teams-border);
  border-radius: 999px;
  background: var(--teams-surface-raised);
  color: var(--teams-text-primary);
  font: inherit;
  font-size: 14px;
}

.teams-browse-search::placeholder {
  color: var(--teams-text-faint);
}

.teams-browse-search:focus {
  outline: none;
  border-color: var(--teams-accent-border);
  box-shadow: 0 0 0 2px var(--teams-accent-faint);
}

.teams-browse-clear {
  min-height: var(--teams-min-target);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-raised);
  color: var(--teams-text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.teams-browse-clear:hover {
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
  background: var(--teams-surface-hover);
}

.teams-browse-status {
  font-size: 13px;
  color: var(--teams-text-muted);
  margin: 4px 0 8px;
  min-height: 1.2em;
}

.teams-browse-status:empty {
  display: none;
}

/* Disclosure — each conference is a compact, comfortable touch target.
   Native <details>/<summary> gives correct keyboard + screen-reader
   expanded/collapsed semantics without custom ARIA. Entire heading row
   is the control; chevron is visual reinforcement only. */
.teams-conference-disclosure {
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius-sm);
  background: var(--teams-surface-raised);
  overflow: hidden;
}

.teams-conference-disclosure[open] {
  border-color: var(--teams-border-strong);
  background: var(--teams-surface-raised);
}

.teams-conference-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--teams-min-target);
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 14px;
  font-weight: 800;
  color: var(--teams-text-primary);
  /* Prevent summary text from forcing horizontal overflow */
  min-width: 0;
}

.teams-conference-summary::-webkit-details-marker {
  display: none;
}

.teams-conference-summary::marker {
  content: "";
}

.teams-conference-summary:hover {
  background: var(--teams-surface-hover);
}

.teams-conference-summary:focus-visible {
  outline: 2px solid var(--teams-accent-border-strong);
  outline-offset: -2px;
}

.teams-conference-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teams-conference-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--teams-text-faint);
  background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-border);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.teams-conference-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
  color: var(--teams-text-muted);
  flex-shrink: 0;
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.teams-conference-disclosure[open] .teams-conference-chevron {
  transform: rotate(90deg);
  border-color: var(--teams-accent-border);
  color: var(--teams-accent-soft);
  background: var(--teams-accent-faint);
}

.teams-conference-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
}

@media (max-width: 560px) {
  .teams-conference-list {
    grid-template-columns: 1fr;
  }
}

.teams-conference-list a {
  display: flex;
  align-items: center;
  min-height: var(--teams-min-target);
  padding: 8px 14px;
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius-sm);
  background: var(--teams-surface-raised);
  color: var(--teams-text-secondary);
  /* Prevent long team names from forcing horizontal overflow */
  min-width: 0;
  overflow-wrap: anywhere;
}

.teams-conference-list a:hover {
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
  background: var(--teams-surface-hover);
  text-decoration: none;
}

/* Hidden conferences/teams during filter consume no space. */
.teams-conference-disclosure[hidden],
.teams-conference-list li[hidden] {
  display: none !important;
}

/* --- Team finder (dialog: directed search + conference browsing) -------- */

.teams-finder-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--teams-min-target);
  padding: 10px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--teams-border);
  border-radius: 999px;
  background: var(--teams-surface-raised);
  color: var(--teams-text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.teams-finder-trigger:hover {
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
  background: var(--teams-surface-hover);
}

.teams-finder-trigger-hint {
  margin-left: auto;
  color: var(--teams-text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.teams-finder-dialog {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--teams-text-primary);
  max-width: 640px;
  width: calc(100% - 32px);
  margin: auto;
  inset: 0;
  max-height: 80vh;
}

.teams-finder-dialog::backdrop {
  background: rgba(6, 8, 10, 0.68);
}

.teams-finder-dialog-inner {
  background: var(--teams-surface-raised);
  border: 1px solid var(--teams-border-strong);
  border-radius: var(--teams-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.teams-finder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--teams-border);
  flex-shrink: 0;
}

.teams-finder-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--teams-text-primary);
}

.teams-finder-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
  color: var(--teams-text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.teams-finder-close:hover {
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
  background: var(--teams-surface-hover);
}

.teams-finder-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
  flex-shrink: 0;
}

.teams-finder-search {
  flex: 1;
  min-width: 0;
  min-height: var(--teams-min-target);
  font-size: 14px;
  font-weight: 500;
  color: var(--teams-text-primary);
  background: var(--teams-bg);
  border: 1px solid var(--teams-border);
  border-radius: 999px;
  padding: 10px 14px;
  font-family: inherit;
}

.teams-finder-search::placeholder {
  color: var(--teams-text-faint);
}

.teams-finder-search:focus {
  outline: none;
  border-color: var(--teams-accent-border);
  box-shadow: 0 0 0 2px var(--teams-accent-faint);
}

.teams-finder-clear {
  min-height: var(--teams-min-target);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-raised);
  color: var(--teams-text-secondary);
  cursor: pointer;
}

.teams-finder-clear:hover {
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
}

.teams-finder-conferences {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--teams-border);
  flex-shrink: 0;
}

.teams-conf-pill {
  min-height: var(--teams-min-target);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
  color: var(--teams-text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.teams-conf-pill:hover {
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
  background: var(--teams-surface-hover);
}

.teams-conf-pill.is-active {
  background: var(--teams-accent-faint);
  border-color: var(--teams-accent-border);
  color: var(--teams-accent-soft);
}

.teams-finder-results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 8px;
}

.teams-finder-status {
  font-size: 12.5px;
  color: var(--teams-text-muted);
  padding: 10px 10px 4px;
  line-height: 1.4;
  margin: 0;
}

.teams-finder-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 10px 10px;
}

.teams-finder-group-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teams-text-muted);
  padding: 6px 6px 2px;
  border-bottom: 1px solid var(--teams-border);
  margin-bottom: 2px;
}

.teams-finder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  min-height: 56px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
  color: var(--teams-text-primary);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.teams-finder-item:hover,
.teams-finder-item.is-focused {
  border-color: var(--teams-border-strong);
  background: var(--teams-surface-hover);
}

.teams-finder-item.is-current {
  border-color: var(--teams-accent-border-strong);
  background: linear-gradient(180deg, var(--teams-accent-faint) 0%, var(--teams-surface-sunken) 100%);
}

.teams-finder-item-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.teams-finder-item-name {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--teams-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teams-finder-item-meta {
  font-size: 12px;
  color: var(--teams-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teams-finder-item-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--teams-accent-border);
  background: var(--teams-accent-faint);
  color: var(--teams-accent-soft);
  flex-shrink: 0;
}

.teams-finder-item-badge.muted {
  border-color: var(--teams-border);
  background: var(--teams-surface-raised);
  color: var(--teams-text-faint);
}

.teams-finder-empty {
  color: var(--teams-text-faint);
  padding: 12px 10px;
}

.teams-finder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--teams-border);
  flex-shrink: 0;
}

.teams-finder-hint {
  color: var(--teams-text-faint);
  font-size: 12px;
}

/* Mobile bottom sheet. `max-width: none` explicitly defeats the
   browser's own native `<dialog>` UA-stylesheet max-width default
   (confirmed via direct DOM inspection during Founder/Atlas review --
   without this override, `width:100%` alone is silently constrained
   by that UA default and the sheet never reaches the true edges). */
@media (max-width: 600px) {
  .teams-finder-dialog {
    max-width: none;
    width: 100%;
    margin: auto auto 0;
    inset: auto 0 0 0;
    max-height: 92vh;
  }

  .teams-finder-dialog-inner {
    border-radius: var(--teams-radius-sm) var(--teams-radius-sm) 0 0;
    max-height: 92vh;
  }

  .teams-finder-trigger-hint {
    display: none;
  }
}

/* --- Team hero (identity + record/rank/next) ----------------------------- */

.teams-hero-grid {
  display: grid;
  gap: 28px;
  margin: 0;
}

@media (min-width: 900px) {
  .teams-hero-grid {
    grid-template-columns: 1.45fr 0.75fr;
  }
}

.teams-identity-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.teams-crest {
  flex: none;
  width: 72px;
  height: 72px;
  background: linear-gradient(180deg, var(--teams-surface-hover) 0%, var(--teams-surface-sunken) 100%);
  border: 1px solid var(--teams-border-strong);
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.38);
}

.teams-crest-letters {
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.08em;
  color: var(--teams-accent-soft);
  border: 1px solid var(--teams-accent-border);
  width: 52px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teams-accent-faint);
}

.teams-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--teams-text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.teams-name {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--teams-text-primary);
}

.teams-season-line {
  font-size: 15px;
  color: var(--teams-text-secondary);
  font-weight: 500;
  margin: 4px 0 0;
}

.teams-stats-row {
  display: flex;
  gap: 0;
  margin-top: 22px;
  background: var(--teams-surface-raised);
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius);
  overflow: hidden;
  flex-wrap: wrap;
}

.teams-stat {
  flex: 1;
  min-width: 150px;
  padding: 18px 20px;
}

.teams-stat:not(:first-child) {
  border-left: 1px solid var(--teams-border);
}

.teams-stat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--teams-text-muted);
}

.teams-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin-top: 4px;
  line-height: 1;
  color: var(--teams-text-primary);
}

.teams-stat-value.sm {
  font-size: 18px;
}

.teams-stat-sub {
  display: block;
  font-size: 13px;
  color: var(--teams-text-muted);
  font-weight: 500;
  margin-top: 6px;
  overflow-wrap: break-word;
}

.teams-stat-sub.faint {
  color: var(--teams-text-faint);
  font-size: 12.5px;
}

.teams-movement-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 999px;
  margin-left: 8px;
  line-height: 1;
}

.teams-movement-pill-up {
  color: var(--teams-accent-soft);
  background: var(--teams-accent-faint);
  border: 1px solid var(--teams-accent-border);
}

.teams-movement-pill-down {
  color: var(--teams-negative);
  background: var(--teams-negative-faint);
  border: 1px solid var(--teams-negative-border);
}

.teams-movement-pill-flat {
  color: var(--teams-text-muted);
  background: var(--teams-neutral-faint);
  border: 1px solid var(--teams-neutral-border);
}

/* --- Two-column team layout (matches the approved prototype's
   independent left/right vertical stacks -- no shared row height). ----- */

.teams-layout {
  display: grid;
  gap: 22px;
  align-items: start;
  margin: 22px 0;
}

@media (min-width: 1100px) {
  .teams-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.teams-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* Flex/grid items default to `min-width: auto`, which refuses to
   shrink below their content's min-content width -- the wide
   `.teams-data-table` (min-width 480px, meant to scroll only inside
   its own `.table-wrap`) would otherwise push `.teams-column`,
   `.teams-layout`, and the whole page wider at narrow viewports.
   `min-width: 0` at every level of this chain restores
   `.table-wrap`'s own bounded horizontal scroll as the ONLY thing
   that scrolls. */
.teams-column > * {
  min-width: 0;
}

/* Below the two-column breakpoint, both `.teams-column` wrappers
   dissolve (`display: contents`) so their five section children become
   direct grid items of `.teams-layout` and can be individually
   reordered into the approved mobile/tablet reading order -- Summary
   first (the fastest team scan), then Trend, Recent, Compare, Evidence
   -- never duplicated to achieve it. */
@media (max-width: 1099px) {
  .teams-column {
    display: contents;
  }

  #summary {
    order: 1;
  }

  #trend {
    order: 2;
  }

  #recent {
    order: 3;
  }

  #compare {
    order: 4;
  }

  #evidence {
    order: 5;
  }
}

/* --- Reusable data table (Ranking Trend + Efficiency Comparison) -------- */

.teams-data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: 13px;
}

.teams-data-table th,
.teams-data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--teams-border);
  text-align: left;
  color: var(--teams-text-secondary);
  font-weight: 500;
}

.teams-data-table th {
  color: var(--teams-text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  background: var(--teams-surface-raised);
  white-space: nowrap;
}

.teams-data-table tr:last-child td {
  border-bottom: none;
}

.teams-unit {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid var(--teams-border);
}

.teams-unit.off {
  background: var(--teams-neutral-faint);
  color: var(--teams-text-secondary);
  border-color: var(--teams-neutral-border);
}

.teams-unit.def {
  background: var(--teams-positive-faint);
  color: var(--teams-positive-soft);
  border-color: var(--teams-positive-border);
}

.teams-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.teams-ind-bar {
  display: inline-block;
  width: 84px;
  height: 6px;
  border-radius: 999px;
  background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-border);
  overflow: hidden;
  flex-shrink: 0;
}

.teams-ind-fill {
  display: block;
  height: 100%;
  background: var(--teams-text-muted);
}

.teams-ind-fill.good {
  background: var(--teams-positive);
}

.teams-ind-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--teams-text-muted);
  white-space: nowrap;
}

/* --- Performance Summary cards ------------------------------------------- */

.teams-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 500px) {
  .teams-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.teams-summary-card {
  background: var(--teams-surface-raised);
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.teams-summary-card.is-unavailable {
  border-style: dashed;
}

.teams-summary-label {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teams-text-muted);
}

.teams-summary-value {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--teams-text-primary);
}

.teams-summary-meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--teams-text-muted);
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.teams-summary-meta .teams-sep {
  margin: 0 4px;
  opacity: 0.5;
}

.teams-mini-bar {
  height: 4px;
  background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.teams-mini-bar span {
  display: block;
  height: 100%;
  background: var(--teams-text-muted);
  border-radius: 999px;
}

.teams-mini-bar.good {
  border-color: var(--teams-positive-border);
}

.teams-mini-bar.good span {
  background: var(--teams-positive);
}

.teams-card-unavailable {
  font-size: 12.5px;
  color: var(--teams-text-faint);
  line-height: 1.5;
  margin: 2px 0 0;
}

/* --- Recent Game card ----------------------------------------------------- */

.teams-game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--teams-text-muted);
  font-weight: 600;
}

.teams-game-result-pill {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: var(--teams-accent);
  color: var(--teams-bg);
  padding: 5px 10px;
  border-radius: 999px;
}

.teams-game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 0;
  border-bottom: 1px solid var(--teams-border);
}

.teams-game-row:last-child {
  border-bottom: none;
}

.teams-game-row .teams-score {
  margin-left: auto;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.teams-game-row.winner {
  color: var(--teams-text-primary);
}

.teams-game-row .teams-row-name {
  color: var(--teams-text-muted);
}

.teams-game-row.winner .teams-row-name {
  color: var(--teams-text-primary);
}

.teams-game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--teams-text-muted);
  margin-top: 12px;
  font-weight: 500;
}

.teams-game-meta .teams-dot {
  opacity: 0.4;
}

.teams-game-stats {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.teams-gstat {
  flex: 1;
  min-width: 120px;
  background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius-sm);
  padding: 10px 12px;
}

.teams-gstat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teams-text-muted);
}

.teams-gstat-value {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--teams-text-secondary);
  margin-top: 3px;
}

/* --- Ranking evidence ------------------------------------------------------ */

.teams-evidence-list {
  list-style: none;
  margin: 0;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teams-evidence-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-sunken);
}

.teams-ev-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  background: var(--teams-neutral-faint);
  color: var(--teams-text-muted);
  border: 1px solid var(--teams-neutral-border);
}

.teams-ev-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.teams-ev-text strong {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--teams-text-primary);
  line-height: 1.3;
}

.teams-ev-text span {
  font-size: 13px;
  color: var(--teams-text-muted);
  line-height: 1.5;
}

/* --- Related conference peers --------------------------------------------- */

.teams-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 14px 20px;
}

.teams-related-link {
  display: block;
  min-height: var(--teams-min-target);
  padding: 12px;
  border: 1px solid var(--teams-border);
  border-radius: 12px;
  background: var(--teams-surface-sunken);
  color: var(--teams-text-primary);
  font-size: 13.5px;
  font-weight: 700;
}

.teams-related-link:hover {
  border-color: var(--teams-border-strong);
  background: var(--teams-surface-hover);
  text-decoration: none;
}

/* --- Advertising slots (neutral placeholders only -- no ad network, no
   tracking, no cookies. See DATA_CONTRACT.md §L in the approved
   prototype for the full slot contract this adapts. Fill state per
   slot is decided by `services.ad_slot_service` -- a pure, internal
   state machine with no external SDK -- see that module for the
   Recommended/Maximum/No-fill/Ad-free/Short-page rules.) ------------- */

.teams-ad-slot {
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius-sm);
  background: var(--teams-surface-sunken);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.015),
    rgba(255, 255, 255, 0.015) 10px,
    transparent 10px,
    transparent 20px
  );
  margin: 16px 0;
  overflow: hidden;
}

.teams-ad-label {
  display: flex;
  justify-content: space-between;
  padding: 4px 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--teams-text-faint);
  border-bottom: 1px solid var(--teams-border);
}

.teams-ad-slot--leaderboard .teams-ad-inner {
  aspect-ratio: 728 / 90;
  min-height: 90px;
}

.teams-ad-slot--rectangle:not([hidden]) {
  display: none;
}

@media (min-width: 1100px) {
  .teams-ad-slot--rectangle:not([hidden]) {
    display: block;
  }
  .teams-ad-slot--rectangle:not([hidden]) .teams-ad-inner {
    aspect-ratio: 6 / 5;
    min-height: 250px;
    max-width: 300px;
  }
}

@media (max-width: 760px) {
  .teams-ad-slot--leaderboard .teams-ad-inner {
    aspect-ratio: 320 / 100;
    min-height: 100px;
  }
}

.teams-ad-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: var(--teams-text-faint);
  font-size: 12px;
}

.teams-ad-house {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 12px;
  aspect-ratio: 728 / 90;
  min-height: 90px;
  background: var(--teams-surface-hover);
}

.teams-ad-house-label {
  color: var(--teams-accent-soft);
  font-weight: 700;
  font-size: 13px;
}

/* --- BETA-027B visual-parity correction: shared-shell scoping --- */
/* Teams header must visually match Archive Ink prototype (sticky,
   blurred, Archive tokens) without leaking to Rankings/Games/Insights
   or Build. Selectors use attribute form to avoid bare-class collision
   detection: the Teams section may not introduce bare .site-header etc
   that also exist in non-Teams templates (see CssNamespaceRegressionTests).
   Every rule below is scoped under body.teams-page so no other page changes. */
body.teams-page [class~="site-header"] {
  position: static;
  top: auto;
  z-index: auto;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  padding: 0;
}
/* Teams header-row: Archive Ink sticky blurred header is DESKTOP-ONLY
   (768px+). At mobile (<768px) the global fixed bottom nav lives inside
   .header-row's DOM ancestor; a filtered/backdrop-filtered ancestor traps
   `position: fixed` to that container instead of the viewport. Keeping
   this rule unguarded placed the tab bar inside the header at the top
   on iPhone and covered the Ranktory wordmark. */
@media (min-width: 768px) {
  body.teams-page [class~="header-row"] {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(12, 14, 16, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--teams-border);
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 24px;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
  }
}
@media (max-width: 767px) {
  body.teams-page [class~="header-row"] {
    position: static;
    top: auto;
    z-index: auto;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
    filter: none;
    perspective: none;
    contain: none;
    will-change: auto;
    clip-path: none;
    border-bottom: none;
  }
  body.teams-page [class~="site-header"] {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
    filter: none;
    perspective: none;
    contain: none;
    will-change: auto;
    clip-path: none;
  }
}
body.teams-page [class~="wordmark"] {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.14em;
  color: var(--teams-text-primary);
  line-height: 1;
}
body.teams-page [class~="site-header"] [class~="container"]:last-child {
  padding-top: 0;
  padding-bottom: 0;
}
/* Teams desktop nav: Archive Ink inline pills. Mobile keeps the shared
   fixed bottom tab bar exactly (same breakpoint, dimensions, colors,
   active state) — the override is desktop-only so Teams matches Rankings
   and Games at <768px. */
@media (min-width: 768px) {
  body.teams-page [class~="primary-nav"] {
    position: static;
    background: none;
    border: none;
    padding: 0;
    padding-bottom: 0;
  }
  body.teams-page [class~="primary-nav-list"] {
    gap: 2px;
    padding: 0;
  }
  body.teams-page [class~="primary-nav-list"] > li {
    flex: none;
    display: block;
    min-width: 0;
  }
  body.teams-page [class~="primary-nav-link"] {
    flex: none;
    min-width: 0;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--teams-text-secondary);
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
  }
  body.teams-page [class~="primary-nav-link"]:hover {
    color: var(--teams-text-primary);
    background: var(--teams-surface-raised);
    border-color: var(--teams-border);
    text-decoration: none;
  }
  body.teams-page [class~="primary-nav-link"][aria-current="page"] {
    background: var(--teams-accent-faint);
    border-color: var(--teams-accent-border);
    color: var(--teams-accent-soft);
    font-weight: 700;
    box-shadow: none;
  }
}
/* Content width: Archive Ink max 1440, pad 24 — scoped to Teams only */
body.teams-page [class~="container"] {
  max-width: 1440px;
}
body.teams-page [class~="container"][class~="container-wide"] {
  max-width: 1440px;
}
body.teams-page #main-content[class~="container"],
body.teams-page #main-content[class~="container"][class~="container-wide"] {
  padding-left: 24px;
  padding-right: 24px;
}
body.teams-page [class~="site-footer"] [class~="container"] {
  max-width: 1440px;
}
body.teams-page {
  overflow-x: hidden;
}
/* Teams control pills: Archive Ink tokens, not global gradient — scoped */
body.teams-page .pill {
  background: var(--teams-surface-raised);
  border-color: var(--teams-border);
  color: var(--teams-text-secondary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
}
body.teams-page .pill:hover {
  background: var(--teams-surface-hover);
  border-color: var(--teams-border-strong);
  color: var(--teams-text-primary);
}
body.teams-page .pill[aria-current="true"] {
  background: var(--teams-accent);
  border-color: var(--teams-accent);
  color: var(--teams-bg);
  font-weight: 800;
  box-shadow: none;
}
body.teams-page .pill[aria-current="true"]:hover {
  background: var(--teams-accent-hover);
  border-color: var(--teams-accent-hover);
}
body.teams-page .control-label {
  color: var(--teams-text-muted);
}
body.teams-page .eyebrow {
  color: var(--teams-accent);
}
body.teams-page .page-title {
  color: var(--teams-text-primary);
}
/* Advertising parity: reserved geometry must be honest, never oversized */
.teams-ad-slot[hidden] {
  display: none !important;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
  min-height: 0 !important;
}
.teams-ad-slot:not([hidden]) {
  contain: layout;
}
.teams-ad-slot--leaderboard .teams-ad-inner,
.teams-ad-slot--leaderboard .teams-ad-house {
  max-width: 728px;
  margin: 0 auto;
  width: 100%;
}
.teams-ad-size {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--teams-text-faint);
  border: 1px solid var(--teams-border);
  background: var(--teams-surface-raised);
  padding: 4px 8px;
  border-radius: 999px;
}
.teams-ad-placeholder-text {
  margin-left: 10px;
  font-size: 12px;
  color: var(--teams-text-faint);
}
.teams-ad-inner {
  gap: 8px;
  flex-wrap: wrap;
}
/* Rectangle slots remain desktop-only; collapsed to zero space when hidden or on mobile */
@media (max-width: 1099px) {
  .teams-ad-slot--rectangle {
    display: none !important;
    margin: 0 !important;
  }
}
/* Removed Teams-mobile nav override at <768px — Teams must match the
   shared mobile tab bar exactly (gap, padding, font-size). The desktop
   Archive Ink pill treatment above already covers >=768px. */

@media (prefers-reduced-motion: reduce) {
  .teams-finder-dialog {
    transition: none;
  }
}

/* ===================================================================
   BETA-027C Rankings Archive Ink parity — isolated under body.rankings-page
   Tokens reuse Teams Archive Ink palette for visual parity; scoped so
   no other page changes. Presentation only — no ranking calculation.
   =================================================================== */
html:has(body.rankings-page) {
  background: #0C0E10;
}
body.rankings-page {
  --rankings-bg: #0C0E10;
  --rankings-surface-raised: #171A1E;
  --rankings-surface-sunken: #121416;
  --rankings-surface-hover: #1E2328;
  --rankings-border: #252A31;
  --rankings-border-strong: #2F353E;
  --rankings-text-primary: #EDE9E3;
  --rankings-text-secondary: #C9CDD1;
  --rankings-text-muted: #9AA0A9;
  --rankings-text-faint: #8A8F98;
  --rankings-accent: #C5A46A;
  --rankings-accent-hover: #D5B983;
  --rankings-accent-soft: #E8D9B8;
  --rankings-accent-faint: rgba(197,164,106,0.10);
  --rankings-accent-border: rgba(197,164,106,0.28);
  --rankings-positive: #8FA89D;
  --rankings-negative: #C08A7B;
  --rankings-focus: #C5A46A;
  --rankings-focus-ring: 0 0 0 2px #0C0E10, 0 0 0 4px var(--rankings-focus);
  background: var(--rankings-bg) !important;
  color: var(--rankings-text-primary);
  overflow-x: hidden;
}
body.rankings-page html { background: var(--rankings-bg); }
/* Header parity — sticky blurred like prototype Teams */
body.rankings-page .site-header {
  position: static !important;
  top: auto;
  z-index: auto;
  background: transparent !important;
  backdrop-filter: none !important;
  border-bottom: none !important;
  padding: 0 !important;
}
body.rankings-page .site-header .container.header-row {
  position: sticky !important;
  top: 0;
  z-index: 50;
  background: rgba(12,14,16,0.92) !important;
  border-bottom: 1px solid var(--rankings-border) !important;
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px !important;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
body.rankings-page .site-header .container:not(.header-row) {
  /* flagship-hero--compact: compact season band, not oversized hero */
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px 14px !important;
  border-bottom: 1px solid var(--rankings-border);
  background: transparent;
}
body.rankings-page .wordmark {
  font-weight: 900 !important;
  font-size: 22px !important;
  letter-spacing: 0.14em !important;
  color: var(--rankings-text-primary) !important;
  line-height: 1 !important;
}
/* Rankings global nav: intentionally not overridden — preserve BETA-022 mobile equal-width, 44px touch targets, footer clearance, and desktop font-size */
/* Content shell: prototype — each band manages its own max-width/pad */
body.rankings-page .container { max-width: 1440px !important; }
body.rankings-page .container.container-wide { max-width: 1440px !important; }
body.rankings-page #main-content.container,
body.rankings-page #main-content.container-wide {
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: transparent !important;
}
/* Error panels sit directly in the unconstrained rankings-page main, so give them the same inset and max width as the header band. */
body.rankings-page .error-panel { box-sizing: border-box; max-width: 1392px; width: calc(100% - 24px); margin: var(--space-6) auto; }
@media (min-width: 768px) {
  body.rankings-page .error-panel { width: calc(100% - 48px); }
}
/* Hero typography — compact, not dominating */
body.rankings-page .rankings-eyebrow {
  font-size: 11px !important;
  letter-spacing: 0.14em !important;
  font-weight: 800 !important;
  color: var(--rankings-text-muted) !important;
  text-transform: uppercase !important;
  margin: 0 0 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
body.rankings-page .eyebrow-dot {
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 999px !important;
  background: var(--rankings-accent) !important;
  margin-right: 0 !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}
body.rankings-page .rankings-flagship-title {
  font-size: 32px !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em !important;
  line-height: 0.95 !important;
  color: var(--rankings-text-primary) !important;
  margin: 0 !important;
}
body.rankings-page .rankings-subtitle {
  font-size: 14px !important;
  color: var(--rankings-text-secondary) !important;
  font-weight: 500 !important;
  margin: 6px 0 0 !important;
  line-height: 1.5 !important;
  max-width: none !important;
}
/* Legacy hero fallback (non-v2/v3 Poll Comparison title) — restyle same compact treatment */
body.rankings-page .eyebrow {
  font-size: 11px !important;
  letter-spacing: 0.14em !important;
  font-weight: 800 !important;
  color: var(--rankings-text-muted) !important;
  text-transform: uppercase !important;
  margin: 0 0 8px !important;
}
body.rankings-page .page-title {
  font-size: 32px !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em !important;
  line-height: 0.95 !important;
  color: var(--rankings-text-primary) !important;
  margin: 0 !important;
}
body.rankings-page .page-explanation {
  font-size: 14px !important;
  color: var(--rankings-text-secondary) !important;
  margin: 6px 0 0 !important;
  max-width: none !important;
}
/* ========== CONTROL BAR — compact season/week band (surface-sunken) ========== */
body.rankings-page .control-bar {
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 14px 24px !important;
  border-bottom: 1px solid var(--rankings-border) !important;
  background: var(--rankings-surface-sunken) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  gap: 18px 24px !important;
  border-radius: 0 !important;
}
body.rankings-page .control-bar > * { margin: 0 !important; }
body.rankings-page .control-bar .control-row { margin: 0 !important; gap: 8px !important; }
body.rankings-page .control-label,
body.rankings-page .selector-label-sm {
  font-size: 10px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  color: var(--rankings-text-muted) !important;
  margin-right: 0 !important;
}
body.rankings-page .control-help,
body.rankings-page .season-coming-soon-note {
  max-width: 1440px !important;
  margin: 6px auto 0 !important;
  padding: 0 24px !important;
  font-size: 12.5px !important;
  color: var(--rankings-text-muted) !important;
  line-height: 1.5 !important;
}
/* ========== PILLS — all buttons use 999px geometry, muted gold selected ========== */
body.rankings-page .pill-nav {
  gap: 8px !important;
  list-style: none !important;
}
body.rankings-page .pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  min-width: 44px !important;
  padding: 8px 14px !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--rankings-text-secondary) !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  letter-spacing: 0.01em !important;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
body.rankings-page .pill:hover {
  border-color: var(--rankings-border-strong) !important;
  color: var(--rankings-text-primary) !important;
  background: var(--rankings-surface-hover) !important;
}
body.rankings-page .pill:focus-visible {
  outline: 2px solid var(--rankings-focus) !important;
  outline-offset: 2px !important;
  box-shadow: var(--rankings-focus-ring) !important;
}
body.rankings-page .pill[aria-current="true"] {
  background: var(--rankings-accent) !important;
  border-color: var(--rankings-accent) !important;
  color: var(--rankings-bg) !important;
  font-weight: 850 !important;
  box-shadow: none !important;
}
body.rankings-page .pill[aria-current="true"]:hover {
  background: var(--rankings-accent-hover) !important;
  border-color: var(--rankings-accent-hover) !important;
}
/* Sort pills: faint gold (restrained), not solid — overrides the solid above for sort context */
body.rankings-page .sort-row { flex-wrap: wrap !important; gap: 8px !important; }
body.rankings-page .sort-row .pill {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 8px 14px !important;
  min-width: 44px !important;
  flex: none !important;
}
body.rankings-page .sort-row .pill[aria-current="true"] {
  background: var(--rankings-accent-faint) !important;
  color: var(--rankings-accent-soft) !important;
  border-color: var(--rankings-accent-border) !important;
}
body.rankings-page .sort-row .pill[aria-current="true"]:hover {
  background: var(--rankings-accent-faint) !important;
  border-color: var(--rankings-accent-border) !important;
}
/* Week selector + Go */
body.rankings-page .week-dropdown-form {
  gap: 8px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
@media (max-width: 359px) {
  body.rankings-page .week-dropdown-form { flex-wrap: wrap !important; }
}
body.rankings-page .week-dropdown-select {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 36px !important;
  padding: 8px 12px !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 999px !important;
  background: var(--rankings-surface-sunken) !important;
  color: var(--rankings-text-primary) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
body.rankings-page .week-dropdown-select:hover { border-color: var(--rankings-border-strong) !important; }
body.rankings-page .week-dropdown-select:focus-visible {
  outline: 2px solid var(--rankings-focus) !important;
  outline-offset: 2px !important;
  box-shadow: var(--rankings-focus-ring) !important;
}
@media (min-width: 768px) { body.rankings-page .week-dropdown-select { flex: 0 1 260px !important; } }
body.rankings-page .week-dropdown-submit.pill {
  background: var(--rankings-surface-raised) !important;
  border-color: var(--rankings-border) !important;
  color: var(--rankings-text-secondary) !important;
  font-size: 13px !important;
}
body.rankings-page .week-dropdown-submit.pill:hover {
  border-color: var(--rankings-border-strong) !important;
  color: var(--rankings-text-primary) !important;
  background: var(--rankings-surface-hover) !important;
}
/* ========== DISPLAYED POLLS — sunken 10px card, not legacy full-width box ========== */
body.rankings-page .poll-checklist {
  width: auto !important;
  background: var(--rankings-surface-sunken) !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 10px !important;
  padding: 0 !important;
}
body.rankings-page .poll-checklist-summary {
  min-height: 36px !important;
  padding: 10px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--rankings-text-secondary) !important;
  border: none !important;
  border-radius: 10px !important;
  background: transparent !important;
}
body.rankings-page .poll-checklist-summary:hover {
  color: var(--rankings-text-primary) !important;
  border-color: transparent !important;
}
body.rankings-page .poll-checklist[open] .poll-checklist-summary { margin-bottom: 0 !important; }
body.rankings-page .poll-checklist-summary .chevron { order: -1 !important; color: var(--rankings-text-muted) !important; }
body.rankings-page .poll-checklist[open] .poll-checklist-summary .chevron { transform: rotate(90deg) !important; color: var(--rankings-text-muted) !important; }
body.rankings-page .poll-checklist-form {
  margin-top: 0 !important;
  padding: 12px 14px 14px !important;
  border: none !important;
  border-top: 1px solid var(--rankings-border) !important;
  border-radius: 0 0 10px 10px !important;
  background: var(--rankings-surface-sunken) !important;
}
body.rankings-page .poll-checklist-list { gap: 6px !important; max-height: 240px !important; }
body.rankings-page .poll-checklist-item {
  color: var(--rankings-text-secondary) !important;
  border-radius: 8px !important;
  padding: 6px 8px !important;
  min-height: 36px !important;
}
body.rankings-page .poll-checklist-item:hover { background: var(--rankings-surface-hover) !important; }
body.rankings-page .poll-checklist-item input[type="checkbox"] { accent-color: var(--rankings-accent) !important; }
body.rankings-page .apply-display-button.pill {
  margin-top: 12px !important;
  width: auto !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}
/* ========== INFO DISCLOSURE — restrained, sunken, not full-width dominant ========== */
body.rankings-page .info-disclosure {
  max-width: 1440px !important;
  margin: 10px auto !important;
  padding: 0 !important;
  background: var(--rankings-surface-sunken) !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
body.rankings-page .info-disclosure[open] { background: var(--rankings-surface-raised) !important; }
body.rankings-page .info-disclosure summary {
  min-height: 40px !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--rankings-text-secondary) !important;
  gap: 8px !important;
}
body.rankings-page .info-disclosure summary:hover { color: var(--rankings-text-primary) !important; }
body.rankings-page .info-disclosure[open] > summary .chevron { color: var(--rankings-text-muted) !important; }
body.rankings-page .info-disclosure-body {
  padding: 0 14px 14px !important;
  color: var(--rankings-text-muted) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}
body.rankings-page .info-disclosure-body p { margin: 0 0 8px !important; }
body.rankings-page .info-disclosure-body p:last-child { margin-bottom: 0 !important; }
/* ========== RANKINGS CONTROLS — Displayed Polls + toggles left, Sort + Finder right ========== */
body.rankings-page .rankings-controls {
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 10px 24px 6px !important;
  background: transparent !important;
}
body.rankings-page .rankings-controls-inner {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 14px 18px !important;
  align-items: center !important;
  justify-content: space-between !important;
}
body.rankings-page .rankings-controls-left,
body.rankings-page .rankings-controls-right {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  align-items: center !important;
}
body.rankings-page .sort-group { display: flex !important; flex-direction: column !important; gap: 6px !important; }
body.rankings-page .sort-group .control-label { font-size: 10px !important; letter-spacing: 0.12em !important; }
body.rankings-page .sort-pills { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }
body.rankings-page .sort-pill {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  border: 1px solid var(--rankings-border) !important;
  background: transparent !important;
  color: var(--rankings-text-secondary) !important;
  min-height: 36px !important;
  text-decoration: none !important;
}
body.rankings-page .sort-pill:hover { border-color: var(--rankings-border-strong) !important; color: var(--rankings-text-primary) !important; }
body.rankings-page .sort-pill.is-active {
  background: var(--rankings-accent-faint) !important;
  color: var(--rankings-accent-soft) !important;
  border-color: var(--rankings-accent-border) !important;
}
body.rankings-page .poll-checklist { background: var(--rankings-surface-sunken) !important; border: 1px solid var(--rankings-border) !important; border-radius: 10px !important; padding: 10px 14px !important; }
body.rankings-page .poll-checklist summary { font-size: 13px !important; font-weight: 700 !important; color: var(--rankings-text-secondary) !important; }
body.rankings-page .checklist-body { display: flex !important; flex-direction: column !important; gap: 8px !important; margin-top: 8px !important; }
body.rankings-page .check-item { display: flex !important; align-items: center !important; gap: 8px !important; font-size: 13px !important; color: var(--rankings-text-secondary) !important; }
body.rankings-page .toggle-group {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
  font-size: 13px !important;
  color: var(--rankings-text-muted) !important;
}
body.rankings-page .toggle-group label {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  color: var(--rankings-text-muted) !important;
}
body.rankings-page .rankings-helper {
  max-width: 1440px !important;
  margin: 6px auto 0 !important;
  padding: 0 24px !important;
  font-size: 12.5px !important;
  color: var(--rankings-text-muted) !important;
  line-height: 1.5 !important;
}
/* ========== DASHBOARD + TABLE SHELL ========== */
body.rankings-page .dashboard-rankings {
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 18px 24px 32px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}
body.rankings-page #v2-table-heading {
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  color: var(--rankings-text-primary) !important;
  margin: 0 !important;
}
body.rankings-page .rankings-table-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 14px !important;
  background: var(--rankings-surface-raised) !important;
}
body.rankings-page .rankings-table { width: 100% !important; border-collapse: separate !important; border-spacing: 0 !important; font-size: 13px !important; min-width: 1100px !important; }
body.rankings-page .rankings-table caption { text-align: left !important; padding: 12px 16px !important; font-size: 13px !important; color: var(--rankings-text-muted) !important; }
body.rankings-page .rankings-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  background: var(--rankings-surface-sunken) !important;
  border-bottom: 1px solid var(--rankings-border) !important;
  text-align: left !important;
  font-size: 10px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--rankings-text-muted) !important;
  font-weight: 700 !important;
  padding: 10px 12px !important;
  white-space: nowrap !important;
}
body.rankings-page .rankings-table tbody td,
body.rankings-page .rankings-table tbody th {
  padding: 11px 12px !important;
  border-bottom: 1px solid var(--rankings-border) !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}
body.rankings-page .rankings-table tbody th { text-align: left !important; font-weight: 700 !important; color: var(--rankings-text-primary) !important; }
body.rankings-page .rankings-table tbody td { color: var(--rankings-text-secondary) !important; font-weight: 500 !important; }
body.rankings-page .rankings-table tbody tr:hover { background: var(--rankings-surface-hover) !important; }
body.rankings-page .rankings-table .col-rank { width: 52px !important; text-align: center !important; }
body.rankings-page .rankings-table .col-team { min-width: 180px !important; }
body.rankings-page .flag-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  border: 1px solid var(--rankings-border) !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
body.rankings-page .flag-badge--tie { background: var(--rankings-accent-faint) !important; color: var(--rankings-accent-soft) !important; border-color: var(--rankings-accent-border) !important; }
body.rankings-page .flag-badge--disagree { background: rgba(192,138,123,0.13) !important; color: #E2C0B6 !important; border-color: rgba(192,138,123,0.28) !important; }
body.rankings-page .flag-badge--none { background: transparent !important; color: var(--rankings-text-faint) !important; border-color: var(--rankings-border) !important; }
body.rankings-page .detail-row td { background: var(--rankings-surface-sunken) !important; white-space: normal !important; }
body.rankings-page .detail-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 14px 20px !important; padding: 14px 16px !important; }
body.rankings-page .detail-label { font-size: 11px !important; letter-spacing: 0.06em !important; text-transform: uppercase !important; font-weight: 700 !important; color: var(--rankings-text-muted) !important; }
body.rankings-page .detail-value { font-size: 13px !important; line-height: 1.5 !important; color: var(--rankings-text-secondary) !important; }
body.rankings-page .trend-chart { max-width: 380px !important; width: 100% !important; }
body.rankings-page .trend-svg { height: 82px !important; max-width: 380px !important; width: 100% !important; display: block !important; }
body.rankings-page .trend-summary { font-size: 11px !important; color: var(--rankings-text-muted) !important; margin-top: 4px !important; line-height: 1.4 !important; }
body.rankings-page .team-toggle { cursor: pointer !important; display: flex !important; align-items: center !important; gap: 8px !important; font-weight: 700 !important; color: var(--rankings-text-primary) !important; }
body.rankings-page .team-toggle::-webkit-details-marker { display: none !important; }
body.rankings-page .disclosure-chevron { font-size: 10px !important; color: var(--rankings-text-muted) !important; transition: transform 150ms ease !important; display: inline-block !important; }
body.rankings-page .finder-trigger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: var(--rankings-surface-raised) !important;
  border: 1px solid var(--rankings-border) !important;
  color: var(--rankings-text-primary) !important;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  min-height: 44px !important;
}
body.rankings-page .finder-trigger:hover { border-color: var(--rankings-border-strong) !important; background: var(--rankings-surface-hover) !important; }
body.rankings-page .finder-trigger:focus-visible { outline: 2px solid var(--rankings-focus) !important; outline-offset: 2px !important; box-shadow: var(--rankings-focus-ring) !important; }
body.rankings-page .finder-dialog {
  border: 1px solid var(--rankings-border) !important;
  border-radius: 14px !important;
  background: var(--rankings-surface-raised) !important;
  color: var(--rankings-text-primary) !important;
  max-width: 640px !important;
  width: calc(100% - 32px) !important;
  margin: auto !important;
  padding: 0 !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6) !important;
}
body.rankings-page .finder-dialog::backdrop { background: rgba(6,8,10,0.68) !important; backdrop-filter: blur(6px) !important; }
body.rankings-page .finder-dialog-inner { padding: 20px !important; display: flex !important; flex-direction: column !important; gap: 14px !important; max-height: 80vh !important; }
body.rankings-page .finder-header { display: flex !important; align-items: center !important; justify-content: space-between !important; }
body.rankings-page .finder-title { font-size: 18px !important; font-weight: 850 !important; }
body.rankings-page .finder-close {
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  border: 1px solid var(--rankings-border) !important;
  background: var(--rankings-surface-sunken) !important;
  color: var(--rankings-text-secondary) !important;
  font-size: 20px !important;
  cursor: pointer !important;
  display: grid !important;
  place-items: center !important;
}
body.rankings-page .finder-search {
  flex: 1 !important;
  background: var(--rankings-surface-sunken) !important;
  border: 1px solid var(--rankings-border) !important;
  color: var(--rankings-text-primary) !important;
  padding: 12px 14px !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  min-height: 44px !important;
}
body.rankings-page .finder-search:focus { border-color: var(--rankings-accent-border) !important; box-shadow: 0 0 0 2px var(--rankings-accent-faint) !important; outline: none !important; }
body.rankings-page .finder-clear {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  border: 1px solid var(--rankings-border) !important;
  background: var(--rankings-surface-sunken) !important;
  color: var(--rankings-text-secondary) !important;
  cursor: pointer !important;
  min-height: 36px !important;
}
body.rankings-page .finder-item {
  border-color: var(--rankings-border) !important;
  background: var(--rankings-surface-sunken) !important;
}
body.rankings-page .finder-item:hover { border-color: var(--rankings-border-strong) !important; background: var(--rankings-surface-hover) !important; }
body.rankings-page .notice-block,
body.rankings-page .rankings-notice {
  max-width: 1440px !important;
  margin: 12px auto !important;
  background: var(--rankings-surface-sunken) !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 10px !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  color: var(--rankings-text-secondary) !important;
}
/* ========== PAIRWISE SUMMARY — same centered 1440px boundary as table ========== */
body.rankings-page section[aria-labelledby="v2-pairwise-heading"],
body.rankings-page section[aria-labelledby="pairwise-heading"],
body.rankings-page section[aria-labelledby="v2-evidence-heading"] {
  max-width: 1440px !important;
  margin-inline: auto !important;
  margin-top: 24px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  overflow-x: clip !important;
}
body.rankings-page section[aria-labelledby="v2-pairwise-heading"] .card-grid,
body.rankings-page section[aria-labelledby="pairwise-heading"] .card-grid {
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* Legacy site-footer — keep but mute to match Archive Ink */
body.rankings-page .site-footer { border-top: 1px solid var(--rankings-border) !important; background: var(--rankings-surface-sunken) !important; }
body.rankings-page .site-footer .container { max-width: 1440px !important; padding: 16px 24px !important; }
html, body { max-width: 100%; overflow-x: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1100px) { body.rankings-page .detail-grid { grid-template-columns: 1fr !important; } }
@media (max-width: 767px) {
  body.rankings-page .site-header .container.header-row { padding: 12px 16px !important; }
  body.rankings-page .site-header .container:not(.header-row) { padding: 14px 16px 12px !important; }
  body.rankings-page .rankings-flagship-title, body.rankings-page .page-title { font-size: 24px !important; }
  body.rankings-page .control-bar { padding: 12px 16px !important; }
  body.rankings-page .rankings-controls { padding: 10px 16px 6px !important; }
  body.rankings-page .rankings-controls-inner { flex-direction: column !important; align-items: stretch !important; }
  body.rankings-page .dashboard-rankings { padding: 14px 16px 24px !important; }
  body.rankings-page .rankings-table { min-width: 760px !important; }
  body.rankings-page .control-help, body.rankings-page .season-coming-soon-note { padding-left: 16px !important; padding-right: 16px !important; }
  body.rankings-page .info-disclosure { margin-left: 16px !important; margin-right: 16px !important; }
  body.rankings-page .notice-block, body.rankings-page .rankings-notice { margin-left: 16px !important; margin-right: 16px !important; }
  body.rankings-page section[aria-labelledby="v2-pairwise-heading"],
  body.rankings-page section[aria-labelledby="pairwise-heading"],
  body.rankings-page section[aria-labelledby="v2-evidence-heading"] { padding-left: 16px !important; padding-right: 16px !important; }
}

/* R7.1 Rankings refinement -- phone compact table and disclosures. At 768px and wider the compact table and
   both disclosure summaries are never displayed, and both disclosures (Display options, Full table) stay
   open, so the desktop controls and table render exactly as before. Below 768px a dense, content-sized table
   (one ~28px line per team) shows the governed rows; Rank and Team stay pinned while further columns scroll
   sideways inside the table's own region, and the disclosures are native <details> (closed by
   rankings_archive_ink.js; open without JavaScript). */
body.rankings-page .rankings-compact,
body.rankings-page .rankings-disclosure-summary { display: none !important; }
@media (max-width: 767px) {
  body.rankings-page .rankings-disclosure-summary {
    display: flex !important; align-items: center; gap: 8px; width: fit-content; min-height: 44px;
    margin: 6px 16px 0; padding: 0 16px; border: 1px solid var(--rankings-border); border-radius: 999px;
    background: var(--rankings-surface-raised); color: var(--rankings-text-primary);
    font-size: 13px; font-weight: 700; list-style: none; cursor: pointer;
  }
  body.rankings-page .rankings-disclosure-summary::-webkit-details-marker { display: none; }
  body.rankings-page .rankings-disclosure-summary::after { content: "▾"; color: var(--rankings-text-muted); }
  body.rankings-page details[open] > .rankings-disclosure-summary::after { content: "▴"; }
  body.rankings-page .rankings-disclosure-summary:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
  body.rankings-page .rankings-full-table > .rankings-disclosure-summary { margin: 12px 0 8px; }

  /* Page top, tightened so more teams fit on the first screen. The eyebrow repeats the title and the subtitle
     is generic copy (the compact table's caption and the Display options notices carry the specifics); the visible
     Season/Week/View labels are dropped (each control group keeps its accessible name, the week select
     keeps its label), letting Season and Week share a row; the "Story columns" note and the section
     heading describe the full table, so on phones they are hidden (the heading stays for screen readers)
     and the compact table carries its own caption. */
  body.rankings-page .rankings-eyebrow { display: none !important; }
  body.rankings-page .site-header .container:not(.header-row) { padding: 8px 12px !important; }
  body.rankings-page .rankings-flagship-title { font-size: 19px !important; line-height: 1.2 !important; }
  body.rankings-page .rankings-subtitle { display: none !important; }  /* generic copy; the table caption and Display options notices carry the specifics */
  body.rankings-page .control-bar { gap: 6px 8px !important; padding: 6px 12px !important; }
  body.rankings-page .control-bar .control-label {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  body.rankings-page .control-bar .control-row { flex: 0 0 auto; }
  body.rankings-page .control-bar .week-nav { flex: 1 1 150px; min-width: 0; }
  body.rankings-page .control-bar .week-dropdown-form { width: 100%; flex-wrap: nowrap !important; }
  /* Season, week and view controls meet the 44px touch-target minimum on phones. */
  body.rankings-page .control-bar .pill,
  body.rankings-page .control-bar .week-dropdown-select { min-height: 44px !important; }
  body.rankings-page .season-coming-soon-note { margin-top: 4px !important; padding: 0 12px !important; font-size: 11.5px !important; }
  body.rankings-page .rankings-display-options > .rankings-disclosure-summary { margin-left: 12px; }
  body.rankings-page .dashboard-rankings { padding: 6px 8px 24px !important; }
  body.rankings-page .dashboard-rankings h2#v2-table-heading {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  body.rankings-page .dashboard-rankings .freshness { display: none !important; }

  /* The compact table: auto layout, so every column is only as wide as its widest header or value. */
  body.rankings-page .rankings-compact { display: block !important; position: relative; }
  body.rankings-page .rankings-compact-caption { margin: 0 4px 0; color: var(--rankings-text-muted); font-size: 11.5px; line-height: 1.3; }
  body.rankings-page .rankings-compact-scroll {
    overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--rankings-border); border-radius: 8px; background: var(--rankings-surface-raised);
  }
  body.rankings-page .rankings-compact-scroll:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
  body.rankings-page .rankings-compact.is-scrollable:not(.is-at-end) .rankings-compact-scroll {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
  }
  body.rankings-page .rankings-compact-table {
    width: auto; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 18px;
    color: var(--rankings-text-secondary); font-variant-numeric: tabular-nums;
  }
  body.rankings-page .rankings-compact-table th,
  body.rankings-page .rankings-compact-table td {
    padding: 5px 6px; border-bottom: 1px solid var(--rankings-border); white-space: nowrap; text-align: center;
    background: var(--rankings-surface-raised);
  }
  body.rankings-page .rankings-compact-table tbody tr:last-child > * { border-bottom: 0; }
  body.rankings-page .rankings-compact-table thead th {
    padding: 4px 6px; color: var(--rankings-text-muted); font-size: 11px; font-weight: 700; line-height: 14px;
    background: var(--rankings-surface-sunken);
  }
  body.rankings-page .rankings-compact-table .rc-rank {
    position: sticky; left: 0; z-index: 1; padding-left: 6px; padding-right: 4px; text-align: center;
    color: var(--rankings-text-primary); font-weight: 800;
  }
  body.rankings-page .rankings-compact-table .rc-team { text-align: left; padding: 0; }
  body.rankings-page .rankings-compact-table thead .rc-team { padding: 4px 6px; }
  body.rankings-page .rankings-compact.is-pinned-team .rc-team { position: sticky; left: var(--rc-rank-w, 0px); z-index: 1; }
  body.rankings-page .rankings-compact.is-scrolled .rc-team { box-shadow: 1px 0 0 var(--rankings-border-strong); }
  body.rankings-page .rc-team-link {
    display: block; padding: 5px 6px; color: var(--rankings-text-primary); font-weight: 700; text-decoration: none;
  }
  body.rankings-page .rc-team-link:hover { text-decoration: underline; }
  body.rankings-page .rc-team-link:focus-visible { outline: var(--focus-ring); outline-offset: -3px; }
  /* Movement sits inside the team link, after the name: colored glyph plus signed number, never underlined. */
  body.rankings-page .rc-move { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; }
  body.rankings-page .rc-move-up { color: var(--rankings-positive); }
  body.rankings-page .rc-move-down { color: var(--rankings-negative); }
  body.rankings-page .rc-move-new { color: var(--rankings-accent); }
  body.rankings-page .rankings-compact-table .col-conf { text-align: left; }
  body.rankings-page .rankings-compact-empty { text-align: left !important; color: var(--rankings-text-muted); }
  /* The "More columns" cue is its own right-aligned line between the caption and the table, in normal flow, so it
     can never sit on top of the sort note or the caption. It is on screen when the table first appears. */
  body.rankings-page .rankings-compact-more {
    margin: 0 6px 3px; color: var(--rankings-accent); text-align: right;
    font-size: 11px; font-weight: 700; line-height: 12px; white-space: nowrap; pointer-events: none;
  }
  body.rankings-page .rankings-compact.is-js:not(.is-scrollable) .rankings-compact-more { display: none; }
  /* A floating copy of the heading row (rankings_archive_ink.js) keeps the headings on screen while the page
     scrolls; it slides sideways with the table and keeps Rank and Team pinned like the real heading row. */
  body.rankings-page .rankings-compact-float {
    position: fixed; z-index: 15; overflow: hidden; margin: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    border-radius: 0; pointer-events: none;
  }
  body.rankings-page .rankings-compact-float[hidden] { display: none !important; }
  body.rankings-page .rankings-compact.is-js:not(.is-scrollable) .rankings-compact-more,
  body.rankings-page .rankings-compact.is-at-end .rankings-compact-more { visibility: hidden; }
}
/* ===================================================================
   BETA-031W Movement experience redesign + Rankings shell polish
   + sticky-header alignment repair
   Scoped to body.rankings-page where noted; global nav changes are
   presentation-only and preserve destinations, query behavior and
   accessibility semantics.
   =================================================================== */

/* ---------- Global Rankings nav — more intentional, modern treatment ----------
   Desktop (768px+): pills instead of plain text links, matching Archive Ink
   Teams treatment but scoped to Rankings. Mobile (<768px) stays equal-width
   bottom tab bar exactly as before (44px targets, 5 equal fifths). Active
   is unmistakable via background + border + weight, not color alone. */
@media (min-width: 768px) {
  body.rankings-page .primary-nav {
    position: static !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
  }
  body.rankings-page .primary-nav-list {
    gap: 4px !important;
    padding: 0 !important;
  }
  body.rankings-page .primary-nav-list > li {
    flex: none !important;
    display: block !important;
    min-width: 0 !important;
  }
  body.rankings-page .primary-nav-link {
    flex: none !important;
    min-width: 0 !important;
    min-height: 36px !important;
    padding: 8px 14px !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--rankings-text-secondary) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    box-shadow: none !important;
  }
  body.rankings-page .primary-nav-link:hover {
    color: var(--rankings-text-primary) !important;
    background: var(--rankings-surface-raised) !important;
    border-color: var(--rankings-border) !important;
    text-decoration: none !important;
  }
  body.rankings-page .primary-nav-link[aria-current="page"] {
    background: var(--rankings-accent-faint) !important;
    border-color: var(--rankings-accent-border) !important;
    color: var(--rankings-accent-soft) !important;
    font-weight: 750 !important;
    box-shadow: none !important;
  }
  body.rankings-page .primary-nav-link:focus-visible {
    outline: 2px solid var(--rankings-focus) !important;
    outline-offset: 2px !important;
  }
}

/* ---------- Movement stage shell — centered, consistent 1440 boundary ---------- */
body.rankings-page .movement-stage {
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 20px 24px 32px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  box-sizing: border-box !important;
}
body.rankings-page .movement-stage-header {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
body.rankings-page .movement-title-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
  gap: 10px 14px !important;
}
body.rankings-page .movement-title {
  font-size: 20px !important;
  font-weight: 850 !important;
  letter-spacing: -0.02em !important;
  color: var(--rankings-text-primary) !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}
body.rankings-page .movement-meta {
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--rankings-text-faint) !important;
}
body.rankings-page .movement-subtitle {
  font-size: 13px !important;
  color: var(--rankings-text-muted) !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}
body.rankings-page .movement-stage .info-disclosure {
  margin: 0 !important;
  max-width: none !important;
}
body.rankings-page .movement-control-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  background: var(--rankings-surface-sunken) !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 12px !important;
}
body.rankings-page .movement-poll-switch,
body.rankings-page .movement-interval-switch {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px 12px !important;
}
body.rankings-page .movement-poll-pills {
  gap: 8px !important;
}
body.rankings-page .movement-control-stack .evidence-quality-note {
  margin: 0 !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--rankings-border) !important;
}
body.rankings-page .movement-control-stack .evidence-quality-badge {
  background: var(--rankings-surface-raised) !important;
  border-color: var(--rankings-border) !important;
  color: var(--rankings-text-secondary) !important;
}

/* ---------- Movement category tabs — cohesive pill family ---------- */
body.rankings-page .movement-tabs {
  margin-top: 0 !important;
}
body.rankings-page .movement-tab-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 0 14px !important;
  border: 0 !important;
  list-style: none !important;
  overflow-x: visible !important;
  scrollbar-width: none !important;
}
body.rankings-page .movement-tab-list::-webkit-scrollbar { display: none !important; }
body.rankings-page .movement-tab-list-wrap::after { display: none !important; }
body.rankings-page .movement-tab-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 36px !important;
  padding: 8px 14px !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--rankings-text-secondary) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  cursor: pointer !important;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease !important;
  user-select: none !important;
  white-space: nowrap !important;
}
body.rankings-page .movement-tab-label:hover {
  border-color: var(--rankings-border-strong) !important;
  color: var(--rankings-text-primary) !important;
  background: var(--rankings-surface-hover) !important;
}
body.rankings-page .movement-tab-input:checked + .movement-tab-label {
  background: var(--rankings-accent) !important;
  border-color: var(--rankings-accent) !important;
  color: var(--rankings-bg) !important;
  font-weight: 750 !important;
}
body.rankings-page .movement-tab-input:focus-visible + .movement-tab-label {
  outline: 2px solid var(--rankings-focus) !important;
  outline-offset: 2px !important;
}
body.rankings-page .movement-tab-label .movement-glyph {
  font-size: 11px !important;
  width: auto !important;
}
body.rankings-page .movement-tab-input:checked + .movement-tab-label .movement-glyph {
  color: var(--rankings-bg) !important;
}

/* ---------- Movement grid — responsive, no stretched interiors ---------- */
body.rankings-page .movement-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}
body.rankings-page .movement-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 14px 16px !important;
  background: var(--rankings-surface-raised) !important;
  border: 1px solid var(--rankings-border) !important;
  border-left-width: 3px !important;
  border-radius: 12px !important;
  min-height: 96px !important;
  box-shadow: none !important;
  transition: border-color 150ms ease, background 150ms ease !important;
  overflow: hidden !important;
}
body.rankings-page .movement-card:hover {
  background: var(--rankings-surface-hover) !important;
  border-color: var(--rankings-border-strong) !important;
}
body.rankings-page .movement-card--rise { border-left-color: var(--rankings-positive) !important; }
body.rankings-page .movement-card--fall,
body.rankings-page .movement-card--drop { border-left-color: var(--rankings-negative) !important; }
body.rankings-page .movement-card--enter { border-left-color: var(--rankings-accent) !important; }
body.rankings-page .movement-card--steady { border-left-color: var(--rankings-text-faint) !important; }
body.rankings-page .movement-card-top {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

body.rankings-page .movement-card-team {
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  color: var(--rankings-text-primary) !important;
  margin: 0 !important;
  line-height: 1.25 !important;
}
body.rankings-page .movement-card-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
  color: var(--rankings-text-secondary) !important;
  line-height: 1.4 !important;
}
body.rankings-page .movement-card-badge .movement-glyph {
  font-size: 11px !important;
  width: auto !important;
  flex-shrink: 0 !important;
}
body.rankings-page .movement-card-badge--rise .movement-glyph { color: var(--rankings-positive) !important; }
body.rankings-page .movement-card-badge--fall .movement-glyph,
body.rankings-page .movement-card-badge--drop .movement-glyph { color: var(--rankings-negative) !important; }
body.rankings-page .movement-card-badge--enter .movement-glyph { color: var(--rankings-accent) !important; }
body.rankings-page .movement-card-badge--steady .movement-glyph { color: var(--rankings-text-faint) !important; }
body.rankings-page .movement-tab-input:checked + .movement-tab-label .movement-glyph.rise,
body.rankings-page .movement-tab-input:checked + .movement-tab-label .movement-glyph.fall,
body.rankings-page .movement-tab-input:checked + .movement-tab-label .movement-glyph.enter,
body.rankings-page .movement-tab-input:checked + .movement-tab-label .movement-glyph.drop,
body.rankings-page .movement-tab-input:checked + .movement-tab-label .movement-glyph.steady {
  color: var(--rankings-bg) !important;
}
body.rankings-page .movement-card-evidence {
  padding-top: 10px !important;
  border-top: 1px solid var(--rankings-border) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
body.rankings-page .movement-card-evidence-summary {
  margin: 0 !important;
  font-size: 12.5px !important;
  color: var(--rankings-text-muted) !important;
  line-height: 1.5 !important;
}
body.rankings-page .movement-card-detail summary,
body.rankings-page .movement-card .game-evidence-detail summary {
  font-size: 12.5px !important;
  color: var(--rankings-text-muted) !important;
  cursor: pointer !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
}
body.rankings-page .movement-card-detail summary:hover,
body.rankings-page .movement-card .game-evidence-detail summary:hover { color: var(--rankings-text-primary) !important; }
body.rankings-page .movement-card .game-evidence-list li {
  background: var(--rankings-surface-sunken) !important;
  border-color: var(--rankings-border) !important;
  color: var(--rankings-text-secondary) !important;
}
body.rankings-page .movement-takeaway {
  padding: 14px 16px !important;
  background: var(--rankings-surface-sunken) !important;
  border: 1px solid var(--rankings-border) !important;
  border-radius: 12px !important;
  margin-top: 4px !important;
}
body.rankings-page .movement-takeaway .ranktory-takeaway-heading {
  margin: 0 0 6px !important;
  font-size: 11px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--rankings-text-muted) !important;
  font-weight: 750 !important;
}
body.rankings-page .movement-takeaway p:last-child {
  margin: 0 !important;
  font-size: 13px !important;
  color: var(--rankings-text-secondary) !important;
  line-height: 1.6 !important;
}

/* ---------- Sticky header repair — prevent drift, preserve widths ----------
   JS now measures and locks each th width before pinning; CSS here ensures
   the sticky thead has correct stacking and no visual jitter. The table
   wrap keeps overflow-x:auto for mobile scroll but JS handles horizontal
   sync via transform, so header and body stay aligned. */
body.rankings-page .rankings-table-wrap {
  position: relative !important;
}
body.rankings-page .rankings-table thead th {
  /* JS will override to fixed when pinned; sticky is fallback for no-JS */
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
}
body.rankings-page .rankings-table thead.is-pinned {
  box-shadow: 0 2px 8px rgba(0,0,0,0.35) !important;
}

/* Control bar hierarchy polish — crisper separation */
body.rankings-page .control-bar {
  background: var(--rankings-surface-sunken) !important;
}

/* Movement responsive */
@media (max-width: 767px) {
  body.rankings-page .movement-stage { padding: 16px 16px 24px !important; }
  body.rankings-page .movement-grid { grid-template-columns: 1fr !important; }
  body.rankings-page .movement-control-stack { padding: 12px 14px !important; }
}
@media (min-width: 1100px) {
  body.rankings-page .movement-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (min-width: 1600px) {
  body.rankings-page .movement-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (max-width: 375px) { body.rankings-page .rankings-table { min-width: 760px !important; } }

/* ==========================================================================
   R7.1 Team Experience -- shared Team shell + Stats page (R7.1 Slice 3).
   Scoped under body.teams-page with r71-* classes; legacy BETA-027A Teams
   rules above are unchanged. Approved R7.1 shell structure: identity left,
   four fact cards in one desktop row beside it, compact team search at the
   upper right, full-width tab band beneath. No directional mini-bar
   (Slice 3 ruling Q3).
   ========================================================================== */
body.teams-page .r71-shell { display: grid; gap: 18px; }
body.teams-page .r71-shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
body.teams-page .r71-shell-top .eyebrow { margin: 0; }
body.teams-page .r71-search .teams-finder-trigger { width: 220px; max-width: 100%; margin-bottom: 0; }
body.teams-page .r71-search .teams-finder-trigger-hint { display: none; }

body.teams-page .r71-shell-main { display: grid; gap: 18px; align-items: center; }
@media (min-width: 1024px) {
  body.teams-page .r71-shell-main { grid-template-columns: minmax(300px, 0.9fr) 2.1fr; }
}
body.teams-page .r71-crest-fallback {
  /* Archive Ink fallback crest (Decision 2): neutral, no derived letters. */
  background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-border-strong);
}
body.teams-page .r71-crest {
  /* Governed crest: approved mark on its approved colors; team color stays restrained to the crest and active tab. */
  background: var(--r71-team-bg);
  color: var(--r71-team-fg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 900;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
}
/* Four-character governed marks (e.g. IOWA, SJSU) step down so they fit the crest. */
body.teams-page .r71-crest.is-long { font-size: 1.1rem; letter-spacing: 0; }
body.teams-page .r71-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}
@media (min-width: 480px) {
  body.teams-page .r71-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1440px) {
  body.teams-page .r71-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
body.teams-page .r71-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--teams-surface-raised);
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius);
  overflow-wrap: anywhere;
}
body.teams-page .r71-unit { font-size: 0.8em; font-weight: 500; color: var(--teams-text-muted); }
/* Portrait-phone summary bar: never displayed except inside the portrait phone query below. */
body.teams-page .r71-facts-summary { display: none; }
/* Portrait phones only (<768px AND portrait), and only once teams_facts_summary.js has run: the four fact cards fold
   behind one summary bar. Landscape phones, tablets, and desktop never match this query. */
@media (max-width: 767px) and (orientation: portrait) {
  body.teams-page .r71-shell[data-facts-js] .r71-facts-summary {
    order: 3;
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px;
    padding: 8px 12px; text-align: left; cursor: pointer; font: inherit;
    color: var(--teams-text-primary);
    background: var(--teams-surface-raised);
    border: 1px solid var(--teams-border);
    border-radius: var(--teams-radius);
  }
  body.teams-page .r71-shell[data-facts-js] .r71-facts-summary[hidden] { display: none; }
  body.teams-page .r71-facts-summary-row {
    flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: space-between; gap: 6px 8px;
    font-size: 1rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums;
  }
  body.teams-page .r71-facts-summary-item { min-width: 0; overflow-wrap: anywhere; }
  body.teams-page .r71-facts-summary-label {
    display: block; font-size: 0.6rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--teams-text-muted);
  }
  body.teams-page .r71-facts-summary-chev { color: var(--teams-text-muted); transition: transform 0.15s; }
  body.teams-page .r71-shell.is-facts-open .r71-facts-summary-chev { transform: rotate(180deg); }
  body.teams-page .r71-facts-summary:focus-visible { outline: 2px solid var(--teams-text-primary); outline-offset: 2px; }
  body.teams-page .r71-shell[data-facts-js]:not(.is-facts-open) .r71-facts { display: none; }
}

body.teams-page .r71-tab-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius);
}
body.teams-page .r71-tab-band .pill-nav,
body.teams-page .r71-seasons { margin: 0; }
body.teams-page .r71-tabs .r71-tab-soon {
  color: var(--teams-text-faint);
  border-style: dashed;
  cursor: default;
}
/* The current Team Experience tab: same accent treatment as other current pills. */
body.teams-page .r71-tabs .r71-tab-active {
  background: var(--teams-accent);
  border-color: var(--teams-accent);
  color: var(--teams-bg);
  font-weight: 800;
}
body.teams-page .r71-shell[style] .r71-tabs .r71-tab-active {
  background: var(--r71-team-bg);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--r71-team-fg);
}

body.teams-page .r71-section-head { margin: 4px 0 14px; }
body.teams-page .r71-section-title { margin: 0; font-size: 1.35rem; color: var(--teams-text-primary); }
body.teams-page .r71-section-sub { margin: 4px 0 0; font-size: 0.85rem; color: var(--teams-text-muted); }

body.teams-page .r71-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
@media (min-width: 1024px) {
  body.teams-page .r71-stats-grid { grid-template-columns: 1fr 1fr; }
  body.teams-page .r71-stats-col:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1440px) {
  body.teams-page .r71-stats-grid { grid-template-columns: 1fr 1fr 1fr; }
  body.teams-page .r71-stats-col:last-child { grid-column: auto; }
}
body.teams-page .r71-stats-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
body.teams-page .r71-stats-group { align-self: start; }
body.teams-page .r71-stats-group-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teams-text-secondary);
}
body.teams-page .r71-stats-list { list-style: none; margin: 0; padding: 0; }
body.teams-page .r71-stat-row {
  display: grid;
  /* Label takes the remaining width; the value column fits its content (capped) so labels stay on one line at desktop. */
  grid-template-columns: minmax(0, 1fr) fit-content(45%);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--teams-border);
}
body.teams-page .r71-stat-row:first-child { border-top: 0; }
body.teams-page .r71-stat-label { color: var(--teams-text-primary); font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
body.teams-page .r71-stat-body { text-align: right; min-width: 0; overflow-wrap: anywhere; }
body.teams-page .r71-stat-value { font-size: 1.15rem; font-weight: 700; color: var(--teams-text-primary); }
body.teams-page .r71-stat-games,
body.teams-page .r71-stat-avg { font-size: 0.8rem; color: var(--teams-text-muted); }
body.teams-page .r71-stat-rank { font-size: 0.82rem; color: var(--teams-text-secondary); }
/* Approved accent for conference-rank context. */
body.teams-page .r71-rank-conf { color: var(--teams-accent); font-weight: 600; }

/* ==========================================================================
   R7.1 Team Games -- analysis-first (R7.1 Slice 7B). Scoped under
   body.teams-page with r71-games-* classes. The analysis is first in source
   order; >=1024px places the schedule rail visually on the left (220px at
   1024, 260px at 1440), never sticky and never independently scrolling.
   Below 1024px the layout stacks and the full schedule is the collapsed
   <details> after the analysis. All targets >= --min-target; visible focus.
   ========================================================================== */
body.teams-page .r71-games-layout { display: grid; gap: 24px; align-items: start; }
body.teams-page .r71-games-main { display: grid; gap: 24px; min-width: 0; overflow-wrap: anywhere; }
body.teams-page .r71-games-rail { display: none; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1024px) {
  body.teams-page .r71-games-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  body.teams-page .r71-games-rail { display: block; grid-column: 1; grid-row: 1; }
  body.teams-page .r71-games-main { grid-column: 2; grid-row: 1; }
  body.teams-page .r71-games-schedule-collapsed,
  body.teams-page .r71-games-all { display: none; }
}
@media (min-width: 1440px) {
  body.teams-page .r71-games-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
}

body.teams-page .r71-games-layout a:focus-visible,
body.teams-page .r71-games-layout summary:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* Compact completed-game navigator. */
body.teams-page .r71-games-nav { display: grid; gap: 8px; }
body.teams-page .r71-games-nav-row { display: flex; align-items: center; gap: 8px; }
body.teams-page .r71-games-nav-step {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--min-target); min-width: var(--min-target); padding: 0 12px;
  border: 1px solid var(--teams-border-strong); border-radius: var(--teams-radius);
  background: var(--teams-surface-raised); color: var(--teams-text-primary); text-decoration: none; font-weight: 700;
}
body.teams-page .r71-games-nav-current {
  flex: 1; min-width: 0; margin: 0; text-align: center; font-weight: 700; color: var(--teams-text-secondary);
}
body.teams-page .r71-games-layout summary {
  display: flex; align-items: center; min-height: var(--min-target); padding: 0 12px; cursor: pointer;
  border: 1px solid var(--teams-border); border-radius: var(--teams-radius);
  background: var(--teams-surface-sunken); color: var(--teams-text-primary); font-weight: 700;
}
body.teams-page .r71-games-all-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
body.teams-page .r71-games-all-list a {
  display: flex; align-items: center; min-height: var(--min-target); padding: 0 12px;
  color: var(--teams-text-primary); border-radius: var(--teams-radius);
}
body.teams-page .r71-games-all-list a[aria-current="page"] { background: var(--teams-accent-faint); font-weight: 700; }

/* Selected-game header: the strongest element on the page. */
body.teams-page .r71-games-header { display: grid; gap: 6px; }
body.teams-page .r71-games-result { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--teams-text-primary); }
body.teams-page .r71-games-meta { margin: 0; color: var(--teams-text-muted); font-size: 0.9rem; }
body.teams-page .r71-games-header-links { margin: 0; }
body.teams-page .r71-games-header-links a {
  display: inline-flex; align-items: center; min-height: var(--min-target); color: var(--teams-accent); font-weight: 700;
}
/* Provider text is visibly distinct from Ranktory analysis. */
body.teams-page .r71-games-provider {
  margin-top: 4px; padding: 10px 12px; border: 1px dashed var(--teams-border-strong);
  border-radius: var(--teams-radius); background: var(--teams-surface-sunken);
}
body.teams-page .r71-games-provider-label {
  margin: 0 0 2px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-faint);
}
body.teams-page .r71-games-provider-text { margin: 0; color: var(--teams-text-secondary); }
body.teams-page .r71-games-history-note,
body.teams-page .r71-games-quiet,
body.teams-page .r71-games-empty { margin: 0; color: var(--teams-text-muted); font-size: 0.88rem; }

/* How the Win/Loss Happened. */
body.teams-page .r71-games-summary {
  padding: 14px 16px; border: 1px solid var(--teams-accent-border); border-radius: var(--teams-radius);
  background: var(--teams-accent-faint);
}
body.teams-page .r71-games-summary-title { margin: 0 0 10px; font-size: 1.1rem; color: var(--teams-text-primary); }
body.teams-page .r71-games-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
body.teams-page .r71-games-chip {
  display: inline-flex; align-items: center; min-height: var(--min-target); padding: 6px 14px;
  border: 1px solid var(--teams-accent-border); border-radius: 999px; background: var(--teams-surface-raised);
  color: var(--teams-text-primary); font-weight: 700; text-decoration: none;
}

/* Modules: Offense | Defense, then Ball Security | Situational & Discipline (>=1024px); stacked below. */
body.teams-page .r71-games-modules { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1024px) {
  body.teams-page .r71-games-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.teams-page .r71-games-module {
  min-width: 0; border: 1px solid var(--teams-border); border-radius: var(--teams-radius);
  background: var(--teams-surface-sunken); overflow: hidden;
}
body.teams-page .r71-games-module-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 10px 16px; border-left: 4px solid var(--teams-accent);
  background: linear-gradient(90deg, var(--teams-accent-faint), transparent);
}
body.teams-page .r71-games-module-title {
  margin: 0; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-primary);
}
body.teams-page .r71-games-module-count { font-size: 0.78rem; color: var(--teams-text-muted); }
body.teams-page .r71-games-module-body { display: grid; gap: 16px; padding: 16px; }

/* Evidence cards: comparison-first -- this game's value beside the opponent's entering value; layers are secondary text. */
body.teams-page .r71-games-card {
  container-type: inline-size; scroll-margin-top: 16px; min-width: 0; padding: 12px 16px;
  border: 1px solid var(--teams-border); border-radius: var(--teams-radius); background: var(--teams-surface-raised);
}
body.teams-page .r71-games-card.is-key { border-color: var(--teams-accent-border); }
body.teams-page .r71-games-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
body.teams-page .r71-games-card-title { margin: 0; font-size: 1rem; color: var(--teams-text-primary); }
body.teams-page .r71-games-key-badge,
body.teams-page .r71-games-next-badge {
  display: inline-block; padding: 1px 8px; border: 1px solid var(--teams-accent-border); border-radius: 999px;
  background: var(--teams-accent-faint); color: var(--teams-accent); font-size: 0.72rem; font-weight: 800;
}
body.teams-page .r71-games-card-body { display: grid; gap: 16px; min-width: 0; }
body.teams-page .r71-games-metric { display: grid; gap: 10px; min-width: 0; }
body.teams-page .r71-games-metric-label { margin: 0; font-weight: 700; color: var(--teams-text-secondary); font-size: 0.85rem; }
body.teams-page .r71-games-ingame { margin: 0; display: grid; gap: 2px; }
body.teams-page .r71-games-ingame-value { font-size: 1.25rem; font-weight: 800; color: var(--teams-text-primary); }
body.teams-page .r71-games-ingame-opponent { margin: 0; font-size: 0.85rem; color: var(--teams-text-secondary); }
/* Comparison pair: two labelled panels, side by side whenever the card is wide enough (phones included),
   stacked only on the narrowest cards. Panels are identified by their team-name text, never by colour. */
body.teams-page .r71-games-pair { display: grid; gap: 8px; min-width: 0; }
@container (min-width: 260px) {
  body.teams-page .r71-games-pair:not(.is-single) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
body.teams-page .r71-games-panel {
  display: grid; align-content: start; gap: 2px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--teams-border); border-radius: var(--teams-radius); background: var(--teams-surface-sunken);
}
body.teams-page .r71-games-panel p { margin: 0; }
body.teams-page .r71-games-panel-who {
  font-size: 0.82rem; font-weight: 700; color: var(--teams-text-secondary); overflow-wrap: anywhere;
}
body.teams-page .r71-games-panel-value {
  font-size: 1.5rem; font-weight: 800; line-height: 1.15; color: var(--teams-text-primary); overflow-wrap: anywhere;
}
body.teams-page .r71-games-panel-caption { font-size: 0.8rem; color: var(--teams-text-muted); overflow-wrap: anywhere; }
/* Team colours on the comparison panels: a top rule in the side's contrast-checked approved accent (neutral
   when none qualifies) and the compact mark on its approved colours, as in the shell crest. Panel surface and
   all text stay Archive Ink; the team-name text still identifies each panel. */
body.teams-page .r71-games-pair .r71-games-panel { border-top: 3px solid var(--teams-border-strong); }
body.teams-page .r71-games-pair .r71-games-panel.has-identity {
  border-top-color: var(--r71-side-accent, var(--teams-border-strong));
}
body.teams-page .r71-games-panel-mark {
  display: inline-block; vertical-align: 1px; margin-right: 6px; min-width: 30px; padding: 3px 4px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 4px;
  background: var(--r71-side-bg); color: var(--r71-side-fg);
  font-size: 0.66rem; font-weight: 900; letter-spacing: 0.04em; line-height: 1;
}
body.teams-page .r71-games-panel-mark.is-long { letter-spacing: 0; }
body.teams-page .r71-games-panel p.r71-games-panel-ranks { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font-size: 0.78rem; }
body.teams-page .r71-games-progression-title {
  margin: 0; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teams-text-faint);
}
body.teams-page .r71-games-layer-label {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teams-text-faint); margin: 0;
}
body.teams-page .r71-games-layers { margin: 0; display: grid; gap: 6px; }
body.teams-page .r71-games-layer dt { font-size: 0.75rem; color: var(--teams-text-faint); }
body.teams-page .r71-games-layer dd { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 0.82rem; }
body.teams-page .r71-games-layer-value { color: var(--teams-text-primary); font-weight: 700; }
body.teams-page .r71-games-rank { color: var(--teams-text-secondary); }
body.teams-page .r71-games-movement { color: var(--teams-text-muted); }
/* The conference rank always takes its own line, so overall movement stays attached to the overall rank. */
body.teams-page .r71-games-layer dd .r71-rank-conf,
body.teams-page .r71-games-panel-ranks .r71-rank-conf { flex-basis: 100%; }

/* Mobile-only parts of the Games markup; never displayed at 768px and wider. */
body.teams-page .r71-games-all-current,
body.teams-page .r71-games-card-toggle { display: none; }

/* ---------------------------------------------------------------------------
   R7.1 mobile density (phones, <768px). Every rule is inside this query, so
   the approved 768px+ layouts are untouched. Nothing here hides governed
   values: the only collapsible content is the progression stages and rank
   lines of a card, and only while that card's ▸ Ranks control
   (teams_games.js) is folded. Values and comparison panels always show.
   --------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Shared Team header (Overview, Stats, Games): 2x2 facts, tighter spacing, smaller crest (governed or fallback). */
  body.teams-page .r71-shell-main { gap: 12px; }
  body.teams-page .r71-identity { gap: 12px; }
  body.teams-page .r71-crest-fallback,
  body.teams-page .r71-crest { width: 44px; height: 44px; border-radius: 12px; }
  body.teams-page .r71-crest { font-size: 1rem; }
  body.teams-page .r71-crest.is-long { font-size: 0.78rem; }
  body.teams-page .r71-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.teams-page .r71-fact { padding: 10px 12px; }
  body.teams-page .r71-fact .teams-stat-value { font-size: 1.2rem; }
  body.teams-page .r71-fact .teams-stat-sub { font-size: 0.78rem; }

  /* Founder refinement: on phones the Overview / Stats / Games tabs sit directly under the team name,
     above the four fact cards. The shell's main row dissolves into the shell grid only to reorder. */
  body.teams-page .r71-shell { gap: 12px; }
  body.teams-page .r71-shell-main { display: contents; }
  body.teams-page .r71-shell-top { order: 0; }
  body.teams-page .r71-identity { order: 1; }
  body.teams-page .team-game { order: 1; margin: 0; }
  body.teams-page .r71-tab-band { order: 2; }
  body.teams-page .r71-facts { order: 3; }

  /* Team tabs: one row of four equal 44px targets; season row below. */
  body.teams-page .r71-tab-band { gap: 8px; padding: 8px; }
  body.teams-page .r71-tabs { width: 100%; }
  body.teams-page .r71-tabs .pill-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  body.teams-page .r71-tabs .pill {
    width: 100%; padding: 4px 6px; font-size: 0.8rem; line-height: 1.15; text-align: center;
  }

  /* Games: tighter section rhythm; the selected-game header puts Box score and the rank control on one row. */
  body.teams-page .r71-games-main { gap: 16px; }
  body.teams-page .r71-games-header { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; }
  body.teams-page .r71-games-header > * { grid-column: 1 / -1; }
  body.teams-page .r71-games-header > .r71-games-header-links { grid-column: 1; }
  body.teams-page .r71-games-result { font-size: 1.25rem; }

  /* Compact navigator: Prev | selected game (opens All games) | Next, in one row. */
  body.teams-page .r71-games-nav {
    position: relative; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  }
  body.teams-page .r71-games-nav-row { display: contents; }
  body.teams-page .r71-games-nav-step[rel="prev"] { grid-column: 1; grid-row: 1; }
  body.teams-page .r71-games-nav-step[rel="next"] { grid-column: 3; grid-row: 1; }
  body.teams-page .r71-games-nav-current { display: none; }
  body.teams-page .r71-games-all { grid-column: 2; grid-row: 1; min-width: 0; }
  body.teams-page .r71-games-all > summary { justify-content: center; gap: 6px; padding: 4px 10px; text-align: center; line-height: 1.2; }
  body.teams-page .r71-games-all > summary::-webkit-details-marker { display: none; }
  body.teams-page .r71-games-all > summary::after { content: "▾"; flex: none; color: var(--teams-text-muted); }
  body.teams-page .r71-games-all[open] > summary::after { content: "▴"; }
  body.teams-page .r71-games-all-current { display: inline; min-width: 0; overflow-wrap: anywhere; }
  body.teams-page .r71-games-all-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  body.teams-page .r71-games-all[open] .r71-games-all-list {
    position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px;
    border: 1px solid var(--teams-border-strong); border-radius: var(--teams-radius);
    background: var(--teams-surface-raised); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  }

  /* Per-card rank disclosure (teams_games.js): ▸ Ranks at the right of each card header. */
  body.teams-page .r71-games-card-toggle:not([hidden]) {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
    min-height: var(--min-target); min-width: var(--min-target); padding: 0 12px;
    border: 1px solid var(--teams-border-strong); border-radius: 999px; background: var(--teams-surface-raised);
    color: var(--teams-text-secondary); font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
  }
  body.teams-page .r71-games-card-toggle:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
  body.teams-page .r71-games-card-toggle-icon { display: inline-block; transition: transform 120ms ease; }
  body.teams-page .r71-games-card-toggle[aria-expanded="true"] .r71-games-card-toggle-icon { transform: rotate(90deg); }

  /* Cards: one level of nested padding instead of two. */
  body.teams-page .r71-games-module-body { gap: 8px; padding: 8px; }
  body.teams-page .r71-games-card { padding: 10px 12px; }

  /* Comparison panels: compact text, kept side by side down to a 200px-wide card. */
  body.teams-page .r71-games-panel { padding: 8px 10px; }
  body.teams-page .r71-games-panel-value { font-size: 1.4rem; }
  body.teams-page .r71-games-panel-who { font-size: 0.78rem; }
  body.teams-page .r71-games-panel-caption { font-size: 0.74rem; }
  body.teams-page .r71-games-panel p.r71-games-panel-ranks { font-size: 0.72rem; }
  @container (min-width: 200px) {
    body.teams-page .r71-games-pair:not(.is-single) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  }

  /* Progression: three stacked, full-width stage rows -- stage label left, value right -- with the rank
     evidence on full-width lines underneath (overall rank with its movement beside it, then the conference
     rank). The dd is a subgrid of its row rather than `display: contents`, so it keeps its definition-list
     semantics; rows with no visible rank lines collapse to zero height. Collapsed ranks hide only the
     conference line, so each stage keeps its national rank (the same, single element as expanded). */
  body.teams-page .r71-games-layers { gap: 0; }
  body.teams-page .r71-games-layer {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline;
    min-width: 0; padding: 4px 0; border-top: 1px solid var(--teams-border);
  }
  body.teams-page .r71-games-layer:first-child { padding-top: 0; border-top: 0; }
  body.teams-page .r71-games-layer dt { grid-column: 1; grid-row: 1; min-width: 0; font-size: 0.75rem; }
  body.teams-page .r71-games-layer dd {
    grid-column: 1 / -1; grid-row: 1 / span 3; display: grid; grid-template-columns: subgrid;
    grid-template-rows: subgrid; align-items: baseline; font-size: 0.8rem;
  }
  body.teams-page .r71-games-layer dd > .r71-games-layer-value { grid-column: 2; grid-row: 1; text-align: right; white-space: nowrap; }
  body.teams-page .r71-games-layer dd > .r71-games-rank:not(.r71-rank-conf) { grid-column: 1; grid-row: 2; min-width: 0; }
  body.teams-page .r71-games-layer dd > .r71-games-rank:not(.r71-rank-conf):not(:has(+ .r71-games-movement)) { grid-column: 1 / -1; }
  body.teams-page .r71-games-layer dd > .r71-games-movement { grid-column: 2; grid-row: 2; text-align: right; white-space: nowrap; }
  body.teams-page .r71-games-layer dd > .r71-rank-conf { grid-column: 1 / -1; grid-row: 3; }
  body.teams-page .r71-games-card.is-ranks-collapsed .r71-games-progression-title,
  body.teams-page .r71-games-card.is-ranks-collapsed .r71-games-layers,
  body.teams-page .r71-games-card.is-ranks-collapsed .r71-games-panel-ranks { display: none; }
}

body.teams-page .r71-games-notes { display: grid; gap: 6px; color: var(--teams-text-muted); font-size: 0.82rem; }
body.teams-page .r71-games-notes p { margin: 0; }

/* Season schedule (desktop rail and collapsed list share these rows). */
body.teams-page .r71-games-rail-title { margin: 0 0 8px; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-secondary); }
body.teams-page .r71-games-schedule-collapsed[open] > summary { margin-bottom: 8px; }
body.teams-page .r71-games-schedule-group + .r71-games-schedule-group { margin-top: 12px; }
body.teams-page .r71-games-schedule-title { margin: 0 0 4px; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-faint); }
body.teams-page .r71-games-schedule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
body.teams-page .r71-games-schedule-link,
body.teams-page .r71-games-schedule-static {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: 8px; align-items: center;
  min-height: var(--min-target); padding: 6px 8px; border-radius: 10px; font-size: 0.85rem;
  color: var(--teams-text-primary); text-decoration: none;
}
body.teams-page .r71-games-schedule-static { color: var(--teams-text-muted); }
body.teams-page .r71-games-schedule-link:hover { background: var(--teams-surface-hover); }
body.teams-page .r71-games-schedule-link[aria-current="page"] {
  background: var(--teams-accent-faint); box-shadow: inset 3px 0 0 var(--teams-accent); font-weight: 700;
}
body.teams-page .r71-games-schedule-week { color: var(--teams-text-faint); font-size: 0.78rem; font-weight: 700; }
body.teams-page .r71-games-schedule-main { display: grid; min-width: 0; }
body.teams-page .r71-games-schedule-date,
body.teams-page .r71-games-schedule-note { font-size: 0.75rem; color: var(--teams-text-muted); }
body.teams-page .r71-games-schedule-status {
  font-weight: 700; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px;
  align-items: center; max-width: 6.5rem; text-align: right;
}

/* ==========================================================================
   R7.1 Team Overview (R7.1 Slice 8B). Scoped under body.teams-page with
   r71-ov-* classes. Main column (trajectory, strengths/weaknesses, last
   game) then Up Next and Go Deeper side by side (>=768px, stacked below):
   a single wide column. The trajectory SVG
   scales with its container (no horizontal scroll); the game-result band
   mirrors the SVG plot gutters so its columns sit under the poll points,
   and becomes a labelled list <768px. Series differ by line pattern and
   marker shape, never by color alone; W/L is always a letter.
   ========================================================================== */
body.teams-page .r71-ov-layout { display: grid; gap: 20px; align-items: start; }
/* One wide column: the trajectory spans the full width; Up Next and Go Deeper sit side by side under it (>=768px). */
body.teams-page .r71-ov-main,
body.teams-page .r71-ov-rail { display: grid; gap: 20px; align-content: start; min-width: 0; }
@media (min-width: 768px) {
  body.teams-page .r71-ov-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
}
/* Phone order: trajectory, Last Game, Up Next, Strengths, then Go Deeper closes the page. */
@media (max-width: 767px) {
  body.teams-page .r71-ov-rail { display: contents; }
  body.teams-page .r71-ov-main > .r71-ov-trajectory { order: 0; }
  body.teams-page .r71-ov-main > .r71-ov-last-game { order: 1; }
  body.teams-page .r71-ov-main > .r71-ov-rail .r71-ov-up-next { order: 2; }
  body.teams-page .r71-ov-main > .r71-ov-profile { order: 3; }
  body.teams-page .r71-ov-main > .r71-ov-rail .r71-ov-deeper { order: 4; }
}
}
body.teams-page .r71-ov-layout a:focus-visible,
body.teams-page .r71-ov-layout summary:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

body.teams-page .r71-ov-card {
  min-width: 0; padding: 16px; background: var(--teams-surface-raised); border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius); overflow-wrap: anywhere;
}
body.teams-page .r71-ov-card-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px;
}
body.teams-page .r71-ov-card-title {
  margin: 0; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-primary);
}
body.teams-page .r71-ov-card-kicker { font-size: 0.78rem; color: var(--teams-text-muted); }
body.teams-page .r71-ov-subhead {
  margin: 14px 0 6px; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-faint);
}
body.teams-page .r71-ov-quiet,
body.teams-page .r71-ov-footnote { margin: 0; color: var(--teams-text-muted); font-size: 0.85rem; }
body.teams-page .r71-ov-footnote { margin-top: 10px; font-size: 0.8rem; }

/* Trajectory chart. */
body.teams-page .r71-ov-chart { margin: 0; }
body.teams-page .r71-ov-svg { display: block; width: 100%; height: auto; }
body.teams-page .r71-ov-grid line { stroke: var(--teams-border); stroke-width: 1; }
body.teams-page .r71-ov-grid .r71-ov-lane-separator { stroke: var(--teams-border-strong); stroke-dasharray: 2 4; }
body.teams-page .r71-ov-lane { fill: var(--teams-surface-sunken); stroke: var(--teams-border); stroke-dasharray: 4 4; }
body.teams-page .r71-ov-axis-text { fill: var(--teams-text-faint); font-size: 13px; font-weight: 600; }
body.teams-page .r71-ov-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
body.teams-page .r71-ov-line-ap { stroke: var(--teams-accent); stroke-width: 2.25; }
/* All three series are solid (Founder, 2026-10-15): gold AP, sage Coaches, heavy ivory APR. */
body.teams-page .r71-ov-line-coaches { stroke: var(--teams-positive); stroke-width: 2.25; }
body.teams-page .r71-ov-line-apr { stroke: var(--teams-text-primary); stroke-width: 3.5; }
body.teams-page .r71-ov-marker-ap { fill: var(--teams-accent); }
body.teams-page .r71-ov-marker-coaches { fill: var(--teams-positive); }
body.teams-page .r71-ov-marker-apr { fill: var(--teams-text-primary); stroke: var(--teams-bg); stroke-width: 1; }
/* Hollow = the average includes a comparison-only (26*) rank; never an official poll rank. */
body.teams-page .r71-ov-marker-apr.is-hollow { fill: var(--teams-bg); stroke: var(--teams-text-primary); stroke-width: 2; }
@media (max-width: 767px) {
  body.teams-page .r71-ov-axis-text { font-size: 20px; }
  body.teams-page .r71-ov-col-label.is-minor { display: none; }
}
body.teams-page .r71-ov-legend {
  list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 0.8rem; color: var(--teams-text-secondary);
}
body.teams-page .r71-ov-legend li { display: inline-flex; align-items: center; gap: 6px; }
body.teams-page .r71-ov-swatch { width: 34px; height: 12px; flex: none; }

/* W/L chip: the letter carries the meaning; color only reinforces it. */
body.teams-page .r71-ov-result {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.7em; height: 1.7em;
  border: 1px solid var(--teams-border-strong); border-radius: 6px; font-weight: 800; color: var(--teams-text-primary);
}
body.teams-page .r71-ov-result[data-result="win"] { border-color: var(--teams-positive-border); background: var(--teams-positive-faint); }
body.teams-page .r71-ov-result[data-result="loss"] { border-color: var(--teams-negative-border); background: var(--teams-negative-faint); }

/* Game-result band: columns under the chart's points (>=768px), a labelled list below. */
body.teams-page .r71-ov-band { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
body.teams-page .r71-ov-band-cell {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding: 6px 8px;
  border-radius: var(--teams-radius-sm); background: var(--teams-surface-sunken); font-size: 0.82rem;
}
body.teams-page .r71-ov-band-point { min-width: 3.5rem; color: var(--teams-text-faint); font-weight: 700; font-size: 0.75rem; }
/* Each game is a link to that game in Games: result chip, score, opponent. */
body.teams-page .r71-ov-band-game {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: var(--min-target);
  color: var(--teams-text-primary); text-decoration: none; border-radius: var(--teams-radius-sm);
}
body.teams-page .r71-ov-band-game:hover { background: var(--teams-surface-hover); }
body.teams-page .r71-ov-band-score { font-weight: 700; }
body.teams-page .r71-ov-band-opp { color: var(--teams-text-secondary); }
body.teams-page .r71-ov-unaligned-game { color: var(--teams-text-primary); }
body.teams-page .r71-ov-band-none { color: var(--teams-text-faint); }
@media (min-width: 768px) {
  body.teams-page .r71-ov-band:not(.is-standalone) {
    grid-template-columns: repeat(var(--r71-band-cols), minmax(0, 1fr)); gap: 0;
    padding: 6px var(--r71-band-pad-right) 6px var(--r71-band-pad-left);
    border-top: 1px solid var(--teams-border); background: var(--teams-surface-sunken); border-radius: var(--teams-radius-sm);
  }
  body.teams-page .r71-ov-band:not(.is-standalone) .r71-ov-band-cell {
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; padding: 2px 3px; background: none; text-align: center;
  }
  body.teams-page .r71-ov-band:not(.is-standalone) .r71-ov-band-point {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  body.teams-page .r71-ov-band:not(.is-standalone) .r71-ov-band-game {
    display: grid; justify-items: center; align-content: start; gap: 2px; padding: 6px 2px;
    border: 1px solid var(--teams-border); background: var(--teams-surface-sunken);
  }
  body.teams-page .r71-ov-band:not(.is-standalone) .r71-ov-band-score { font-size: 0.78rem; }
  body.teams-page .r71-ov-band:not(.is-standalone) .r71-ov-band-opp { font-size: 0.72rem; color: var(--teams-text-muted); overflow-wrap: anywhere; }
  body.teams-page .r71-ov-band:not(.is-standalone) .r71-ov-band-none { align-self: center; }
  /* Dense seasons: chip and score only; the opponent stays in the tooltip and the point readout. */
  body.teams-page .r71-ov-band.is-dense:not(.is-standalone) .r71-ov-band-opp { display: none; }
  body.teams-page .r71-ov-band.is-dense:not(.is-standalone) .r71-ov-band-cell { padding: 2px 1px; }
  body.teams-page .r71-ov-band.is-dense:not(.is-standalone) .r71-ov-band-game { padding: 6px 0; }
  body.teams-page .r71-ov-band.is-dense:not(.is-standalone) .r71-ov-band-score { font-size: 0.68rem; white-space: nowrap; }
}
body.teams-page .r71-ov-unaligned-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.82rem; color: var(--teams-text-secondary);
}
body.teams-page .r71-ov-unaligned-reason { color: var(--teams-text-muted); }
body.teams-page .r71-ov-notes { display: grid; gap: 6px; margin-top: 12px; color: var(--teams-text-muted); font-size: 0.8rem; }
body.teams-page .r71-ov-notes p { margin: 0; }

/* Trajectory layout: chart + game band share one column, the point readout sits beside the chart on wide
   screens (the chart stays at roughly half its old full-width height) and under the chart on phones. */
body.teams-page .r71-ov-traj-grid { display: grid; gap: 12px 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 768px) {
  body.teams-page .r71-ov-traj-grid { max-inline-size: 46rem; margin-inline: auto; }
}
@media (min-width: 1024px) {
  body.teams-page .r71-ov-traj-grid {
    max-inline-size: none; margin-inline: 0;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas: "chart readout" "band readout";
  }
  body.teams-page .r71-ov-traj-grid > .r71-ov-chart { grid-area: chart; }
  body.teams-page .r71-ov-traj-grid > .r71-ov-readout { grid-area: readout; }
  body.teams-page .r71-ov-traj-grid > .r71-ov-band-wrap,
  body.teams-page .r71-ov-traj-grid > .r71-ov-quiet { grid-area: band; }
}
/* No ranked line: there is no chart or readout, so the note and the game band stack in one column instead of
   sharing the "band" grid area (which drew them on top of each other at >=1024px). */
@media (min-width: 1024px) {
  body.teams-page .r71-ov-traj-grid.is-never-ranked { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  body.teams-page .r71-ov-traj-grid.is-never-ranked > .r71-ov-band-wrap,
  body.teams-page .r71-ov-traj-grid.is-never-ranked > .r71-ov-quiet { grid-area: auto; }
}
body.teams-page .r71-ov-traj-grid > .r71-ov-band-wrap > .r71-ov-subhead:first-child { margin-top: 2px; }
body.teams-page .r71-ov-svg { touch-action: pan-y; cursor: crosshair; }
body.teams-page .r71-ov-svg:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
body.teams-page .r71-ov-cursor { stroke: var(--teams-border-strong); stroke-width: 1.5; pointer-events: none; }
body.teams-page .r71-ov-readout {
  min-width: 0; padding: 12px 14px; border: 1px solid var(--teams-border); border-radius: var(--teams-radius);
  background: var(--teams-surface-sunken);
}
body.teams-page .r71-ov-readout-title { margin: 0 0 8px; font-size: 1.1rem; color: var(--teams-text-primary); }
body.teams-page .r71-ov-readout-list { margin: 0; display: grid; gap: 8px; }
body.teams-page .r71-ov-readout-list > div { display: grid; gap: 2px; }
body.teams-page .r71-ov-readout-list dt { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teams-text-faint); }
body.teams-page .r71-ov-readout-list dd { margin: 0; font-weight: 700; color: var(--teams-text-primary); }
body.teams-page .r71-ov-readout-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--teams-text-secondary); font-size: 0.88rem; }
body.teams-page .r71-ov-readout-hint { margin: 10px 0 0; font-size: 0.78rem; color: var(--teams-text-faint); }
@media (max-width: 767px) {
  /* Phones: a compact readout right under the chart (AP and Coaches side by side). */
  body.teams-page .r71-ov-readout { padding: 10px 12px; }
  body.teams-page .r71-ov-readout-title { margin-bottom: 6px; font-size: 1rem; }
  body.teams-page .r71-ov-readout-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  body.teams-page .r71-ov-readout-list > div:last-child { grid-column: 1 / -1; }
  body.teams-page .r71-ov-readout .r71-ov-subhead { margin-top: 10px; }
}
body.teams-page .r71-ov-band-cell.is-selected { outline: 2px solid var(--teams-accent); outline-offset: -2px; }

/* Trajectory data table (text equivalent of the chart). */
body.teams-page .r71-ov-data { margin-top: 12px; }
body.teams-page .r71-ov-layout summary {
  display: flex; align-items: center; min-height: var(--min-target); padding: 0 12px; cursor: pointer;
  border: 1px solid var(--teams-border); border-radius: var(--teams-radius); background: var(--teams-surface-sunken);
  color: var(--teams-text-primary); font-weight: 700;
}
body.teams-page .r71-ov-data[open] > summary { margin-bottom: 8px; }
body.teams-page .r71-ov-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
body.teams-page .r71-ov-table th,
body.teams-page .r71-ov-table td {
  padding: 6px 8px; border-top: 1px solid var(--teams-border); text-align: left; vertical-align: top;
  color: var(--teams-text-secondary);
}
body.teams-page .r71-ov-table thead th { border-top: 0; color: var(--teams-text-faint); font-size: 0.75rem; }
body.teams-page .r71-ov-table tbody th { color: var(--teams-text-primary); white-space: nowrap; }
@media (max-width: 767px) {
  body.teams-page .r71-ov-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  body.teams-page .r71-ov-table tr { display: block; padding: 6px 0; border-top: 1px solid var(--teams-border); }
  body.teams-page .r71-ov-table th,
  body.teams-page .r71-ov-table td { display: block; border-top: 0; padding: 2px 4px; }
  body.teams-page .r71-ov-table td::before { content: attr(data-label) ": "; color: var(--teams-text-faint); font-weight: 700; }
}

/* Strengths / Relative Weaknesses: value and literal-denominator ranks only (no bars, no median claims). */
body.teams-page .r71-ov-profile-label[data-group="strengths"] { color: var(--teams-positive-soft); }
body.teams-page .r71-ov-profile-label[data-group="weaknesses"] { color: var(--teams-negative); }
body.teams-page .r71-ov-profile-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 768px) {
  body.teams-page .r71-ov-profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
body.teams-page .r71-ov-profile-card {
  min-width: 0; padding: 10px 12px; border: 1px solid var(--teams-border); border-radius: var(--teams-radius-sm);
  background: var(--teams-surface-sunken);
}
body.teams-page .r71-ov-profile-card.is-strengths { border-color: var(--teams-positive-border); }
body.teams-page .r71-ov-profile-card.is-weaknesses { border-color: var(--teams-negative-border); }
body.teams-page .r71-ov-profile-card p { margin: 0; }
body.teams-page .r71-ov-profile-name { font-weight: 700; color: var(--teams-text-primary); font-size: 0.9rem; }
body.teams-page .r71-ov-profile-value { font-size: 1.15rem; font-weight: 800; color: var(--teams-text-primary); }
body.teams-page .r71-ov-profile-rank { font-size: 0.8rem; color: var(--teams-text-secondary); }

/* Last Game. */
body.teams-page .r71-ov-last-result { margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--teams-text-primary); }
body.teams-page .r71-ov-last-meta { margin: 4px 0 0; color: var(--teams-text-muted); font-size: 0.88rem; }
body.teams-page .r71-ov-link-row { margin: 6px 0 0; }
body.teams-page .r71-ov-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--min-target); color: var(--teams-accent); font-weight: 700;
}

/* Up Next. */
body.teams-page .r71-ov-next-matchup { margin: 0 0 8px; font-size: 1.15rem; font-weight: 800; color: var(--teams-text-primary); }
body.teams-page .r71-ov-facts { margin: 0; display: grid; gap: 4px; font-size: 0.85rem; }
body.teams-page .r71-ov-facts div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 8px; }
body.teams-page .r71-ov-facts dt { color: var(--teams-text-faint); }
body.teams-page .r71-ov-facts dd { margin: 0; color: var(--teams-text-secondary); }

/* Season Snapshot. */
body.teams-page .r71-ov-snapshot-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
/* Season Snapshot leads the page (above the two columns): one row of every split from 768px, 2-up on phones. */
body.teams-page .r71-ov-snapshot { margin-bottom: 20px; }
@media (min-width: 768px) {
  body.teams-page .r71-ov-snapshot-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
body.teams-page .r71-ov-snapshot-item {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--teams-border); border-radius: var(--teams-radius-sm); background: var(--teams-surface-sunken);
}
body.teams-page .r71-ov-snapshot-item dt {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teams-text-faint);
}
body.teams-page .r71-ov-snapshot-item dd { margin: 0; }
body.teams-page .r71-ov-snapshot-value { font-weight: 800; color: var(--teams-text-primary); }
body.teams-page .r71-ov-snapshot-sub { font-size: 0.75rem; color: var(--teams-text-muted); }

/* Go Deeper. */
body.teams-page .r71-ov-deeper-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
body.teams-page .r71-ov-deeper-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; min-height: var(--min-target);
  padding: 8px 12px; border: 1px solid var(--teams-border); border-radius: var(--teams-radius-sm);
  background: var(--teams-surface-sunken); color: var(--teams-text-primary); text-decoration: none;
}
body.teams-page .r71-ov-deeper-link:hover { background: var(--teams-surface-hover); }
body.teams-page .r71-ov-deeper-name { font-weight: 800; }
body.teams-page .r71-ov-deeper-sub { grid-column: 1; font-size: 0.8rem; color: var(--teams-text-muted); }
body.teams-page .r71-ov-deeper-arrow { grid-column: 2; grid-row: 1 / span 2; color: var(--teams-accent); font-size: 1.3rem; }

/* ===========================================================================
   R7.1 Teams Directory (Slice 9B). Transcribed from the approved Directory
   R7.1 artifact (docs/review/r7_1/teams_directory_r7_1.html) and the
   Directory R2 slot manifest; scoped under body.teams-page with the tdir-
   prefix so no other page changes. Team color is restrained to the 40x40
   mark and a hairline accent -- never a card background.
   =========================================================================== */
body.teams-page .tdir-heading { padding: 1.2rem 0 0.8rem; border-bottom: 1px solid var(--teams-border); }
body.teams-page .tdir-heading .eyebrow { font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teams-text-faint); margin: 0 0 0.35rem; }
body.teams-page .tdir-heading .page-title { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; margin: 0; color: #fff; line-height: 1.1; }
body.teams-page .tdir-heading-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; align-items: flex-end; justify-content: space-between; }
body.teams-page .tdir-h2h-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.4rem; border-radius: 999px;
  font-weight: 800; text-decoration: none; color: #1a1405; background: var(--teams-accent); border: 1px solid var(--teams-accent);
}
body.teams-page .tdir-h2h-pill:hover { filter: brightness(1.08); }
body.teams-page .tdir-h2h-pill:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
@media (max-width: 640px) { body.teams-page .tdir-h2h-pill { width: 100%; } }
body.teams-page .tdir-sub { font-size: 0.92rem; color: var(--teams-text-muted); margin: 0.35rem 0 0; line-height: 1.5; }
body.teams-page .tdir-controls { margin: 1rem 0 0.6rem; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
body.teams-page .tdir-control { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
body.teams-page .tdir-control-search { flex: 1 1 260px; max-width: 20rem; }
body.teams-page .tdir-control-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teams-text-faint); }
body.teams-page .tdir-search-wrap { position: relative; display: flex; align-items: center; background: var(--teams-surface-raised); border: 1px solid var(--teams-border); border-radius: 8px; min-height: 44px; padding: 0 0.5rem; gap: 0.5rem; max-width: 100%; }
body.teams-page .tdir-search-wrap:focus-within { border-color: var(--teams-accent); box-shadow: 0 0 0 2px var(--teams-accent-faint); }
body.teams-page .tdir-search-icon { color: var(--teams-text-faint); font-size: 1rem; flex-shrink: 0; }
body.teams-page .tdir-search-input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--teams-text-primary); font-size: 0.88rem; font-weight: 600; padding: 0.55rem 0; }
body.teams-page .tdir-search-input::placeholder { color: var(--teams-text-faint); }
body.teams-page .tdir-clear { border: none; background: var(--teams-surface-sunken); color: var(--teams-text-muted); border-radius: 6px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; }
body.teams-page .tdir-clear[hidden] { display: none; }
body.teams-page .tdir-select-wrap { position: relative; }
body.teams-page .tdir-select-wrap::after { content: "▾"; position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--teams-text-faint); pointer-events: none; font-size: 0.8rem; }
body.teams-page .tdir-select-wrap select { appearance: none; -webkit-appearance: none; background: var(--teams-surface-raised); border: 1px solid var(--teams-border); border-radius: 8px; color: var(--teams-text-primary); font-size: 0.88rem; font-weight: 600; min-height: 44px; padding: 0 2rem 0 0.75rem; min-width: 0; max-width: 100%; }
body.teams-page .tdir-select-wrap select:focus-visible { outline: 3px solid #cda247; outline-offset: 2px; }
body.teams-page .tdir-count { font-size: 0.82rem; color: var(--teams-text-faint); margin: 0.4rem 0 0.2rem; min-height: 1.2rem; }
body.teams-page .tdir-count strong { color: var(--teams-text-secondary); }
body.teams-page .tdir-grid { display: grid; grid-template-columns: 1fr; gap: 0.6rem; margin: 0.6rem 0 1rem; }
body.teams-page .tdir-grid[hidden] { display: none; }
@media (min-width: 768px) { body.teams-page .tdir-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { body.teams-page .tdir-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 1440px) { body.teams-page .tdir-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }
body.teams-page .tdir-card { position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; background: var(--teams-surface-raised); border: 1px solid var(--teams-border); border-left: 2px solid var(--tdir-accent, var(--teams-border)); border-radius: 10px; min-height: 44px; min-width: 0; color: var(--teams-text-primary); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
body.teams-page .tdir-card[hidden] { display: none; }
body.teams-page a.tdir-card:hover { border-color: var(--teams-border-strong); border-left-color: var(--tdir-accent, var(--teams-border-strong)); background: var(--teams-surface-hover); }
body.teams-page a.tdir-card:focus-visible { outline: 3px solid #cda247; outline-offset: 2px; }
body.teams-page a.tdir-card::after { content: "›"; color: var(--teams-text-faint); font-size: 1rem; flex-shrink: 0; }
body.teams-page .tdir-card.is-unavailable { opacity: 0.85; }
body.teams-page .tdir-mark { width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.78rem; letter-spacing: 0.03em; flex-shrink: 0; background: var(--tdir-mark-bg); color: var(--tdir-mark-fg); border: 1px solid rgba(255, 255, 255, 0.10); }
/* Four-character governed marks (e.g. BGSU) step down so they fit the 40px mark. */
body.teams-page .tdir-mark.is-long { font-size: 0.64rem; letter-spacing: 0; }
/* Approved Archive Ink fallback treatment when no governed color exists. */
body.teams-page .tdir-mark.is-fallback { background: #1E2328; color: #C9CDD1; border-color: var(--teams-border); }
body.teams-page .tdir-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
body.teams-page .tdir-name { font-size: 0.92rem; font-weight: 800; color: var(--teams-text-primary); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.teams-page .tdir-meta { font-size: 0.78rem; color: var(--teams-text-muted); display: flex; gap: 0.5rem; flex-wrap: wrap; }
body.teams-page .tdir-meta strong { color: var(--teams-text-secondary); font-weight: 700; }
body.teams-page .tdir-rank { font-size: 0.78rem; color: var(--teams-text-faint); font-weight: 600; }
body.teams-page .tdir-rank.is-ranked { color: var(--teams-text-secondary); }
body.teams-page .tdir-rank.is-unranked { font-style: italic; }
body.teams-page .tdir-empty { padding: 1.2rem; border: 1px solid var(--teams-border); border-radius: 10px; background: var(--teams-surface-sunken); color: var(--teams-text-muted); text-align: center; }
body.teams-page .tdir-empty[hidden] { display: none; }
body.teams-page .tdir-empty-title { margin: 0; font-weight: 700; }
body.teams-page .tdir-empty-sub { margin: 0.3rem 0 0; font-size: 0.88rem; }
body.teams-page .tdir-reset { margin-top: 0.6rem; background: var(--teams-surface-raised); border: 1px solid var(--teams-border); border-radius: 8px; color: var(--teams-text-primary); font-weight: 700; font-size: 0.82rem; min-height: 44px; padding: 0 1rem; cursor: pointer; }
body.teams-page .tdir-reset:hover { background: var(--teams-surface-hover); }
@media (max-width: 767px) {
  body.teams-page .tdir-control-search { flex-basis: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  body.teams-page .tdir-card { transition: none; }
}

/* Back to top (every page, base.html): back_to_top.js reveals it after about one screen of scrolling.
   Sits above the phone tab bar. */
.back-to-top {
  position: fixed;
  right: max(var(--space-4), env(safe-area-inset-right, 0px));
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  z-index: 85;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--min-target); height: var(--min-target); padding: 0;
  border: 1px solid var(--color-gold); border-radius: 999px;
  background: var(--color-bg-surface-raised); color: var(--color-gold-strong);
  font: inherit; font-size: 1.25rem; font-weight: 700; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: var(--color-gold-strong); color: var(--color-bg); }
.back-to-top:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
@media (max-width: 767px) {
  .back-to-top { right: max(var(--space-3), env(safe-area-inset-right, 0px)); bottom: calc(var(--mobile-nav-height) + var(--space-3)); }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}

/* Ranking Capital (RC): Rankings banner and Insights study page */
body.rankings-page .rc-banner { margin: 18px 0 6px; padding: 14px 16px; background: var(--rankings-surface-raised); border: 1px solid var(--rankings-accent-border); border-radius: 8px; }
body.rankings-page .rc-banner-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.rankings-page .rc-banner-title { margin: 0; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rankings-accent); }
body.rankings-page .rc-banner-basis { margin-left: 8px; color: var(--rankings-text-primary); letter-spacing: 0; text-transform: none; font-weight: 600; }
body.rankings-page .rc-banner-link { font-size: 12.5px; color: var(--rankings-accent-soft); }
body.rankings-page .rc-banner-status, body.rankings-page .rc-banner-foot, body.rankings-page .rc-banner-held, body.rankings-page .rc-foot { margin: 6px 0 0; font-size: 12.5px; color: var(--rankings-text-muted); }
body.rankings-page .rc-conf-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
body.rankings-page .rc-conf summary { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rankings-border); cursor: pointer; min-height: 32px; }
body.rankings-page .rc-conf-name { font-weight: 600; color: var(--rankings-text-primary); }
body.rankings-page .rc-conf-teams { font-size: 12px; color: var(--rankings-text-faint); }
body.rankings-page .rc-conf-value { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--rankings-accent-soft); min-width: 3.2em; text-align: right; }
body.rankings-page .rc-team-list { list-style: none; margin: 4px 0 8px; padding: 0 0 0 10px; }
body.rankings-page .rc-team-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--rankings-text-secondary); padding: 2px 0; }
body.rankings-page .rc-study { max-inline-size: 860px; margin: 8px auto 40px; padding: 0 16px; }
body.rankings-page .rc-section { margin: 22px 0; }
body.rankings-page .rc-section h2 { font-size: 18px; color: var(--rankings-accent-soft); margin: 0 0 8px; }
body.rankings-page .rc-section p, body.rankings-page .rc-section li { color: var(--rankings-text-secondary); line-height: 1.55; }
body.rankings-page .rc-table-wrap { overflow-x: auto; }
body.rankings-page .rc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
body.rankings-page .rc-table th, body.rankings-page .rc-table td { padding: 8px 10px; border-bottom: 1px solid var(--rankings-border); text-align: left; color: var(--rankings-text-primary); }
body.rankings-page .rc-table thead th { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rankings-text-muted); }
body.rankings-page .rc-table .num { text-align: center; font-variant-numeric: tabular-nums; }
body.rankings-page .rc-table .rc-official { color: var(--rankings-accent-soft); font-weight: 700; }
body.rankings-page .rc-contrib { margin: 4px 0; }
body.rankings-page .rc-contrib summary { cursor: pointer; padding: 6px 0; color: var(--rankings-text-secondary); font-size: 13.5px; }

/* Ranking Capital: week-by-week history chart */
body.rankings-page .rc-week-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
body.rankings-page .rc-week-form label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rankings-text-muted); }
body.rankings-page .rc-history { margin: 22px 0 8px; }
body.rankings-page .rc-lede { margin: 0 0 8px; }
body.rankings-page .rc-history h3 { font-size: 15px; margin: 0 0 8px; color: var(--rankings-text-primary); }
body.rankings-page .rc-svg { display: block; width: 100%; height: auto; }
body.rankings-page .rc-grid { stroke: var(--rankings-border); stroke-width: 1; }
body.rankings-page .rc-axis { fill: var(--rankings-text-muted); font-size: 11px; }
body.rankings-page .rc-end-label { font-size: 11.5px; font-weight: 600; }
body.rankings-page .rc-line { fill: none; stroke-linejoin: round; stroke-linecap: round; stroke-width: 2.25; }
body.rankings-page .rc-line-muted { stroke: var(--rankings-border-strong); stroke-width: 1.25; }
body.rankings-page .rc-line-gold, body.rankings-page .rc-marker-gold { stroke: var(--rankings-accent); }
body.rankings-page .rc-line-sage, body.rankings-page .rc-marker-sage { stroke: var(--rankings-positive); }
body.rankings-page .rc-line-silver, body.rankings-page .rc-marker-silver { stroke: #C9CDD1; }
body.rankings-page .rc-line-rose, body.rankings-page .rc-marker-rose { stroke: var(--rankings-negative); }
body.rankings-page .rc-line-sky, body.rankings-page .rc-marker-sky { stroke: #8FA6C0; }
body.rankings-page .rc-line-sand, body.rankings-page .rc-marker-sand { stroke: #B5A58A; }
body.rankings-page .rc-marker { stroke-width: 2; fill: var(--rankings-bg); }
body.rankings-page .rc-marker:not(.is-hollow) { fill: currentColor; }
body.rankings-page .rc-marker-gold:not(.is-hollow) { fill: var(--rankings-accent); }
body.rankings-page .rc-marker-sage:not(.is-hollow) { fill: var(--rankings-positive); }
body.rankings-page .rc-marker-silver:not(.is-hollow) { fill: #C9CDD1; }
body.rankings-page .rc-marker-rose:not(.is-hollow) { fill: var(--rankings-negative); }
body.rankings-page .rc-marker-sky:not(.is-hollow) { fill: #8FA6C0; }
body.rankings-page .rc-marker-sand:not(.is-hollow) { fill: #B5A58A; }
body.rankings-page .rc-text-gold { fill: var(--rankings-accent); }
body.rankings-page .rc-text-sage { fill: var(--rankings-positive); }
body.rankings-page .rc-text-silver { fill: #C9CDD1; }
body.rankings-page .rc-text-rose { fill: var(--rankings-negative); }
body.rankings-page .rc-text-sky { fill: #8FA6C0; }
body.rankings-page .rc-text-sand { fill: #B5A58A; }
body.rankings-page .rc-svg-wrap { overflow-x: auto; }
body.rankings-page .rc-svg-wrap .rc-svg { min-inline-size: 560px; }

/* News: compact RC balance chart (legend tiles with latest values, smooth lines, fits a phone) */
body.rankings-page .rc-balance { max-inline-size: 600px; margin-inline: auto; overflow-x: visible; }
body.rankings-page .rc-balance-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--rankings-text-primary); }
body.rankings-page .rc-balance-sub { margin: 2px 0 12px; font-size: 13px; color: var(--rankings-text-muted); }
body.rankings-page .rc-legend { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
body.rankings-page .rc-legend li { border-inline-start: 3px solid var(--rankings-border-strong); padding-inline-start: 8px; display: flex; flex-direction: column; }
body.rankings-page .rc-legend-name { font-size: 13px; color: var(--rankings-text-secondary); }
body.rankings-page .rc-legend-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--rankings-text-primary); }
body.rankings-page .rc-legend li.rc-legend-gold { border-color: var(--rankings-accent); }
body.rankings-page .rc-legend li.rc-legend-sage { border-color: var(--rankings-positive); }
body.rankings-page .rc-legend li.rc-legend-silver { border-color: #C9CDD1; }
body.rankings-page .rc-legend li.rc-legend-rose { border-color: var(--rankings-negative); }
body.rankings-page .rc-legend li.rc-legend-sky { border-color: #8FA6C0; }
body.rankings-page .rc-legend li.rc-legend-sand { border-color: #B5A58A; }
body.rankings-page .rc-balance-svg { min-inline-size: 0; }
body.rankings-page .rc-grid-dash { stroke-dasharray: 3 4; }
body.rankings-page .rc-sel-week { fill: var(--rankings-text-primary); font-size: 12px; font-weight: 700; }
body.rankings-page .rc-cursor { stroke: var(--rankings-border-strong); }
body.rankings-page .rc-balance-svg { touch-action: pan-y; cursor: crosshair; }
body.rankings-page .rc-balance-svg:focus-visible { outline: 2px solid var(--rankings-accent); outline-offset: 2px; }

/* News: article list and article page (Archive Ink, shares Rankings tokens) */
body.rankings-page .rankings-eyebrow a { color: inherit; }
body.rankings-page .news-list-wrap, body.rankings-page .news-article { max-inline-size: 760px; margin: 8px auto 48px; padding: 0 16px; }
body.rankings-page .news-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
body.rankings-page .news-filter-link { padding: 6px 12px; border: 1px solid var(--rankings-border-strong); border-radius: 999px; font-size: 13px; color: var(--rankings-text-secondary); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
body.rankings-page .news-filter-link[aria-current] { border-color: var(--rankings-accent); color: var(--rankings-accent-soft); }
body.rankings-page .news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
body.rankings-page .news-card { padding: 16px; background: var(--rankings-surface-raised); border: 1px solid var(--rankings-border); border-radius: 8px; }
body.rankings-page .news-meta { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rankings-text-muted); }
body.rankings-page .news-study { color: var(--rankings-accent); font-weight: 600; }
body.rankings-page .news-draft-flag { color: var(--rankings-negative); }
body.rankings-page .news-card-title { margin: 0 0 6px; font-size: 20px; line-height: 1.25; }
body.rankings-page .news-card-title a { color: var(--rankings-text-primary); text-decoration: none; }
body.rankings-page .news-card-title a:hover, body.rankings-page .news-card-title a:focus-visible { color: var(--rankings-accent-soft); text-decoration: underline; }
body.rankings-page .news-card-takeaway { margin: 0 0 8px; color: var(--rankings-text-secondary); line-height: 1.5; }
body.rankings-page .news-card-stamp { margin: 0; font-size: 12.5px; color: var(--rankings-text-faint); }
body.rankings-page .news-empty { padding: 24px 16px; border: 1px dashed var(--rankings-border-strong); border-radius: 8px; }
body.rankings-page .news-empty h2 { margin: 0 0 8px; font-size: 20px; color: var(--rankings-accent-soft); }
body.rankings-page .news-empty p { color: var(--rankings-text-secondary); line-height: 1.55; }
body.rankings-page .news-title { margin: 6px 0 10px; font-size: clamp(26px, 5vw, 38px); line-height: 1.15; color: var(--rankings-text-primary); }
body.rankings-page .news-takeaway { margin: 0 0 10px; font-size: 18px; line-height: 1.45; color: var(--rankings-accent-soft); }
body.rankings-page .news-stamp { margin: 0 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--rankings-border); font-size: 12.5px; color: var(--rankings-text-muted); }
body.rankings-page .news-article p, body.rankings-page .news-article li { color: var(--rankings-text-secondary); line-height: 1.65; font-size: 16.5px; }
body.rankings-page .news-h2 { margin: 30px 0 8px; font-size: 20px; color: var(--rankings-accent-soft); }
body.rankings-page .news-callout { margin: 20px 0; padding: 12px 16px; border-left: 3px solid var(--rankings-accent); background: var(--rankings-surface-raised); border-radius: 0 8px 8px 0; }
body.rankings-page .news-callout p { margin: 0; }
body.rankings-page .news-draft-banner { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--rankings-negative); border-radius: 6px; font-size: 13px; color: var(--rankings-negative); }
body.rankings-page .news-table-wrap { overflow-x: auto; margin: 16px 0 4px; }
body.rankings-page .news-table { width: 100%; border-collapse: collapse; font-size: 14px; }
body.rankings-page .news-table caption { text-align: left; padding: 0 0 6px; font-size: 13px; color: var(--rankings-text-muted); }
body.rankings-page .news-table th, body.rankings-page .news-table td { padding: 8px 10px; border-bottom: 1px solid var(--rankings-border); text-align: left; color: var(--rankings-text-primary); font-weight: 400; }
body.rankings-page .news-table thead th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rankings-text-muted); font-weight: 600; }
body.rankings-page .news-table tbody th { font-weight: 600; }
body.rankings-page .news-table .num { text-align: center; font-variant-numeric: tabular-nums; }
body.rankings-page .news-table-note { margin: 4px 0 16px; font-size: 12.5px !important; color: var(--rankings-text-faint) !important; }
body.rankings-page .news-deeper { margin-top: 32px; padding-top: 4px; border-top: 1px solid var(--rankings-border); }
body.rankings-page .news-deeper a, body.rankings-page .news-empty a { color: var(--rankings-accent-soft); }
body.rankings-page .news-subtitle { margin: 0 0 12px; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rankings-text-muted); }
body.rankings-page .news-figure { margin: 18px 0; }
body.rankings-page .news-svg-wrap, body.rankings-page .news-figure { overflow-x: auto; }
body.rankings-page .news-svg { display: block; width: 100%; height: auto; min-inline-size: 520px; }
body.rankings-page .news-svg-title { font-size: 16px; fill: var(--rankings-text-primary); }
body.rankings-page .news-svg-sub, body.rankings-page .news-svg-faint { font-size: 12px; fill: var(--rankings-text-muted); }
body.rankings-page .news-svg-label { font-size: 12px; fill: var(--rankings-text-primary); }
body.rankings-page .news-svg-axis { stroke: var(--rankings-border-strong); }
body.rankings-page .news-bar-s0 { fill: #7B8087; }
body.rankings-page .news-bar-s1 { fill: var(--rankings-accent); }

/* Rankings RC banner: line up with the table beneath it instead of spanning the whole window */
body.rankings-page .rc-banner { box-sizing: border-box; width: calc(100% - 32px); max-inline-size: 1392px; margin-inline: auto; }
@media (min-width: 768px) { body.rankings-page .rc-banner { width: calc(100% - 48px); } }
body.rankings-page .insights-list-wrap { max-inline-size: 760px; margin: 8px auto 48px; padding: 0 16px; }
/* RC banner: conference cells size to their content so all conferences share one line when they fit. */
body.rankings-page .rc-conf-list { display: flex; flex-wrap: wrap; gap: 6px 22px; }
body.rankings-page .rc-conf { flex: 0 1 auto; }
body.rankings-page .rc-conf summary { grid-template-columns: auto auto auto; gap: 8px; }
body.rankings-page .rc-conf-value { min-width: 0; }

/* News tables on phones: row labels wrap so number columns stay on screen; tables that still scroll show an arrow and a swipe label. */
body.rankings-page .news-table tbody th { white-space: normal; min-inline-size: 7.5em; }
body.rankings-page .news-article .news-scroll-hint { display: none; margin: 14px 0 6px; padding: 4px 12px; border: 1px solid var(--rankings-accent); border-radius: 999px; font-size: 12px; line-height: 1.3; letter-spacing: 0.03em; color: var(--rankings-accent-soft); }
@media (max-width: 767px) {
  body.rankings-page .news-table { font-size: 12.5px; }
  body.rankings-page .news-table th, body.rankings-page .news-table td { padding: 7px 3px; }
  body.rankings-page .news-table tbody th { min-inline-size: 4.5em; }
  body.rankings-page .news-table thead th { font-size: 10px; letter-spacing: 0.02em; }
  body.rankings-page .news-article .news-scroll-hint { display: inline-block; }
  body.rankings-page .news-article .news-scroll-hint[hidden] { display: none; }
  body.rankings-page .news-table-scrolls {
    background-image:
      linear-gradient(to right, #0C0E10, #0C0E10),
      linear-gradient(to left, #0C0E10, #0C0E10),
      linear-gradient(to right, rgba(212,175,55,0.45), rgba(212,175,55,0)),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='60'%3E%3Crect width='34' height='60' fill='%23D4AF37' fill-opacity='0.18'/%3E%3Cpath d='M12 18 L22 30 L12 42' fill='none' stroke='%23E8C75A' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: 0 0, 100% 0, 0 0, 100% 56px;
    background-size: 20px 100%, 34px 100%, 16px 100%, 34px 60px;
    background-repeat: no-repeat;
    background-attachment: local, local, scroll, scroll;
  }
}

/* Public-site About / Privacy / Terms pages */
.prose-section { max-width: 46rem; line-height: 1.6; }
.prose-section h3 { margin: 1.6rem 0 0.4rem; }
.prose-section ul { padding-left: 1.2rem; }
.site-footer-links { margin: 0 0 0.4rem; }
.prose-section a,
.welcome-guide-body a { color: var(--color-gold-bright); text-decoration: underline; text-underline-offset: 2px; }

/* Share control (articles, Insights studies, team pages) */
.share-control { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.share-button { font: inherit; font-weight: 600; font-size: 0.9rem; padding: 7px 16px; border-radius: 999px; border: 1px solid #ddba5f; background: transparent; color: #ddba5f; cursor: pointer; }
.share-button:hover, .share-button:focus-visible { background: #ddba5f; color: #09090b; }
.share-menu { position: absolute; top: 100%; left: 0; z-index: 30; margin-top: 6px; min-width: 12rem; display: flex; flex-direction: column; background: #18181b; border: 1px solid #3f3f46; border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.share-menu[hidden], .share-control[hidden] { display: none; }
.share-menu a, .share-menu button { font: inherit; font-size: 0.95rem; text-align: left; padding: 9px 12px; border: 0; border-radius: 6px; background: transparent; color: #f4f4f5; text-decoration: none; cursor: pointer; }
.share-menu a:hover, .share-menu button:hover, .share-menu a:focus-visible, .share-menu button:focus-visible { background: #27272a; }
.share-status { font-size: 0.85rem; color: #a1a1aa; }

/* Updates page: change log entries reuse the News card */
body.rankings-page .update-kind-hotfix { color: var(--rankings-text-primary); }
body.rankings-page .update-items { margin: 0; padding-left: 20px; color: var(--rankings-text-secondary); line-height: 1.5; }
body.rankings-page .update-items li + li { margin-top: 4px; }
body.rankings-page .update-card a { color: var(--rankings-accent-soft); }

/* Performance Index Poll view on the Rankings page */
/* Every PIP block shares the RC banner's width and centering, so the page lines up with the header. */
body.rankings-page .pip-asof, body.rankings-page .pip-weeks, body.rankings-page .pip-rc-toggle, body.rankings-page .pip-find,
body.rankings-page .pip-explainer, body.rankings-page .pip-note, body.rankings-page .pip-more, body.rankings-page .pip-table-wrap {
  box-sizing: border-box; width: calc(100% - 32px); max-inline-size: 1392px; margin-inline: auto; padding-inline: 0;
}
@media (min-width: 768px) { body.rankings-page .pip-asof, body.rankings-page .pip-weeks, body.rankings-page .pip-rc-toggle, body.rankings-page .pip-find,
  body.rankings-page .pip-explainer, body.rankings-page .pip-note, body.rankings-page .pip-more, body.rankings-page .pip-table-wrap { width: calc(100% - 48px); } }
.pip-asof { font-size: 13.5px; color: var(--rankings-text-muted, #a8a8a8); margin-block: 12px; }
.pip-explainer { margin-block: 12px 16px; }
.pip-explainer summary { cursor: pointer; font-weight: 600; }
.pip-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pip-table th, .pip-table td { white-space: nowrap; text-align: center; }
.pip-table th.pip-col-team, .pip-table td.pip-col-team, .pip-table th.pip-col-conf, .pip-table td.pip-col-conf { text-align: left; }
.pip-table .pip-col-rank, .pip-table .pip-col-rank + .pip-col-team { position: sticky; background: var(--rankings-surface, #111); z-index: 1; }
.pip-table .pip-col-rank { left: 0; text-align: center; min-width: 3.2em; }
.pip-table .pip-col-rank + .pip-col-team { left: 3.2em; }
.pip-sort { color: inherit; text-decoration: none; }
.pip-sort:hover, .pip-sort:focus-visible, .pip-sort.is-active { text-decoration: underline; }
.pip-early { font-size: 11px; color: var(--rankings-text-muted, #a8a8a8); margin-left: 6px; }
.pip-more { display: none; font-size: 12px; color: var(--rankings-text-muted, #a8a8a8); margin-block: 6px; }
.pip-note { font-size: 12.5px; color: var(--rankings-text-muted, #a8a8a8); margin-block: 6px; }
@media (max-width: 767px) { .pip-more { display: block; } }
/* The search box is pinned to the top of the screen by pip_rankings.js while the table scrolls beneath it. */
.pip-find { display: flex; align-items: center; gap: 10px; margin-block: 10px; padding-block: 8px; background: var(--rankings-surface, #0b0b0d); }
body.rankings-page .pip-find.pip-find-pinned { position: fixed; top: 0; margin: 0; z-index: 20; border-bottom: 1px solid var(--rankings-border, #2a2d33); }
.pip-find-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--rankings-text-muted, #a8a8a8); }
.pip-find-input { flex: 1; max-width: 21.25rem; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rankings-border, #2a2d33); background: transparent; color: inherit; font: inherit; }
.pip-table tr.pip-found > * { background: rgba(201, 168, 106, .22); }
body.rankings-page .pip-table.rankings-table thead th, body.rankings-page .pip-table.rankings-table tbody td { text-align: center !important; }
body.rankings-page .pip-table.rankings-table thead th.pip-col-team, body.rankings-page .pip-table.rankings-table thead th.pip-col-conf,
body.rankings-page .pip-table.rankings-table tbody th.pip-col-team, body.rankings-page .pip-table.rankings-table tbody td.pip-col-conf { text-align: left !important; }
.pip-table .pip-sort { display: block; }
.pip-weeks, .pip-rc-toggle { margin-block: 8px; }
.pip-rc-toggle a { font-size: 0.9rem; color: var(--rankings-accent, #c9a86a); text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Live Games (nav badge, Rankings "Live now" strip, /live cards). Placed last;
   uses only existing tokens. */
.primary-nav-link { position: relative; }
.live-badge {
  display: inline-block;
  margin-left: 4px;
  min-width: 1.15em;
  padding: 0 4px;
  border-radius: 999px;
  background: #d4382c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.live-badge[hidden], .live-strip[hidden] { display: none; }
.live-pill {
  display: inline-block;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: #d4382c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.live-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface-raised);
  color: var(--color-text);
  font-size: 0.9rem;
}
.live-strip:hover { border-color: var(--color-gold); text-decoration: none; }
.live-group-title { font-size: 1.1rem; margin: var(--space-5) 0 var(--space-2); color: var(--color-heading); }
.live-count { color: var(--color-gold); font-size: 0.9rem; }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 768px) { .live-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .live-list { grid-template-columns: repeat(3, 1fr); } }
.live-card {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
}
.live-card.live-live { border-color: var(--color-gold); }
.live-status { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: 0 0 var(--space-2); color: var(--color-text-muted); font-size: 0.82rem; }
.live-tv { margin-left: auto; }
.live-teams { list-style: none; margin: 0; padding: 0; }
.live-team { display: flex; justify-content: space-between; gap: var(--space-2); padding: 3px 0; font-weight: 600; }
.live-ball { margin-right: 4px; font-size: 0.9em; }
.live-team-conf { color: var(--color-text-muted); font-size: 0.75rem; font-weight: 400; margin-left: 6px; }
.live-team-score { font-variant-numeric: tabular-nums; }
.live-detail { display: grid; gap: 2px; margin: var(--space-2) 0 0; color: var(--color-text-muted); font-size: 0.82rem; }
.live-note { margin: var(--space-5) 0 0; color: var(--color-text-muted); font-size: 0.8rem; }
.live-note-warn { color: var(--color-gold-strong); }
.live-empty { padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg-surface); }
.live-wrap { max-inline-size: 1200px; margin: 8px auto 48px; padding: 0 16px; }

/* Live Games: find-your-game bar, follow star, pinned team */
.live-find { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: 0 0 var(--space-3); }
.live-find[hidden], .live-pinned[hidden], .live-nomatch[hidden], .live-group[hidden], .live-card[hidden], .live-follow[hidden] { display: none; }
.live-search, .live-conf {
  min-height: var(--min-target, 44px);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-bg-surface-raised);
  color: var(--color-text);
  font: inherit;
}
.live-search { flex: 1 1 220px; }
.live-tabs { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.live-tab {
  min-height: var(--min-target, 44px);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-bg-surface-raised);
  color: var(--color-text-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.live-tab[aria-pressed="true"] { background: var(--gradient-gold); border-color: var(--color-gold-strong); color: #14140f; }
.live-follow, .live-unfollow {
  background: none;
  border: 0;
  padding: 0 4px;
  color: var(--color-gold);
  font: inherit;
  cursor: pointer;
}
.live-follow { min-width: 28px; min-height: 28px; }
.live-unfollow { font-size: 0.8rem; color: var(--color-text-muted); }
.live-nomatch { margin: var(--space-3) 0; color: var(--color-text-muted); }
.live-rank { color: var(--color-gold-strong); font-size: 0.8rem; font-weight: 700; margin-right: 4px; font-variant-numeric: tabular-nums; }
.live-top25 { margin-right: var(--space-1); }

/* Team page game card: wide, near the top of every team tab */
body.teams-page .team-game { margin: var(--space-3) 0; }
body.teams-page .team-game[hidden] { display: none; }
.team-game-label { margin: 0 0 var(--space-1); color: var(--color-gold); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.team-game-list { grid-template-columns: 1fr !important; }
.team-game .live-card { padding: var(--space-4); }
.team-game .live-team { font-size: 1.15rem; padding: 5px 0; }
.team-game .live-team-score { font-size: 1.4rem; }
.team-game .live-status { font-size: 0.95rem; }
.team-game-more { margin: var(--space-1) 0 0; font-size: 0.8rem; text-align: right; }
@media (min-width: 768px) {
  .team-game .live-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); }
  .team-game .live-card .live-status { flex: 0 0 150px; margin: 0; flex-direction: column; align-items: flex-start; }
  .team-game .live-card .live-tv { margin-left: 0; }
  .team-game .live-card .live-teams { flex: 0 1 460px; min-width: 16rem; }
  .team-game .live-card .live-detail { margin: 0; flex: 1 1 200px; }
}




/* ---------- PvE Insights page (Performance vs. Expectation) ---------- */
.pve-page { --pve-gap: 12px; }
.pve-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--space-4); }
.pve-chip { font-size: 0.8125rem; padding: 6px 12px; border: 1px solid var(--color-border-strong); border-radius: 999px; color: var(--color-text-muted); background: var(--color-bg-surface); }
.pve-chip strong { color: var(--color-text); font-weight: 600; }
.pve-chip-gold { border-color: var(--color-border-gold); color: var(--color-gold-bright); }
.pve-chip-gold strong { color: var(--color-gold-bright); }
.pve-editions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 var(--space-4); }
.pve-editions-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-faint); }
.pve-edition-link { font-size: 0.8125rem; padding: 6px 12px; border: 1px solid var(--color-border-strong); border-radius: 999px; color: var(--color-text-muted); text-decoration: none; background: var(--color-bg-surface); }
.pve-edition-link[aria-current="page"] { color: var(--color-gold-bright); border-color: var(--color-border-gold); }
.pve-note { background: var(--color-bg-surface); border-left: 3px solid var(--color-gold); padding: 12px 16px; color: var(--color-text-muted); font-size: 0.9375rem; border-radius: 0 8px 8px 0; margin: 0 0 var(--space-5); max-width: 78ch; }
.pve-note p { margin: 0 0 10px; }
.pve-note p:last-child { margin-bottom: 0; }
.pve-note strong { color: var(--color-text); }
.pve-note-warn { border-left-color: var(--color-disagree); }
.pve-muted { color: var(--color-text-faint); font-size: 0.875rem; }
.pve-sub { color: var(--color-text-muted); max-width: 66ch; margin: 0 0 var(--space-4); }
.pve-foot { color: var(--color-text-muted); font-size: 0.8125rem; max-width: 80ch; margin: var(--space-3) 0 0; }
.pve-coverage-wrap { background: var(--color-bg); }
.pve-coverage th, .pve-coverage td { padding: 8px 12px; }
.pve-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.pve-pos { color: var(--color-positive); }
.pve-neg { color: var(--color-negative); }

.pve-conf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-3); }
.pve-conf-chip { font: inherit; font-size: 0.8125rem; display: flex; gap: 8px; align-items: baseline; background: var(--color-bg-surface); color: var(--color-text); border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 8px 12px; min-height: 44px; cursor: pointer; }
.pve-conf-name { color: var(--color-text-muted); }
.pve-conf-chip.sel { border-color: var(--color-gold-strong); background: var(--color-bg-surface-raised); }
.pve-spec-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg-surface); padding: 10px 6px 4px; }
#pve-spec { display: block; }
.pve-tick { fill: var(--color-text-muted); font-size: 12px; }
.pve-conf-label { fill: var(--color-text); font-size: 13px; font-weight: 600; }
.pve-grid { stroke: var(--color-border); stroke-width: 1; }
.pve-axis-zero { stroke: var(--color-border-strong); stroke-width: 1; }
.pve-mean { stroke: var(--color-gold-bright); stroke-width: 2.5; pointer-events: none; }
.pve-dot { cursor: pointer; stroke: var(--color-bg); stroke-width: 1; fill-opacity: 0.88; }
.pve-dot.pos { fill: var(--color-positive); }
.pve-dot.neg { fill: var(--color-negative); }
.pve-dot.sel, .pve-dot:hover { stroke: #fff; stroke-width: 2; }
.pve-card { position: sticky; bottom: max(8px, env(safe-area-inset-bottom, 0px)); z-index: 6; margin-top: var(--space-3); padding: 8px 12px; background: var(--color-bg-surface-raised); border: 1px solid var(--color-border-gold); border-radius: 8px; box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.55); font-size: 0.875rem; }
.pve-card p { margin: 0; }
.pve-card-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.pve-card-main { flex: 1 1 220px; min-width: 0; }
.pve-card-main strong { color: var(--color-heading); }
.pve-card-stat { flex: 1 1 200px; min-width: 0; }
.pve-card-stat .pve-num { font-size: 1.125rem; }
.pve-btn { font: inherit; font-size: 0.8125rem; font-weight: 600; color: #111; background: var(--gradient-gold); border: 0; border-radius: 999px; padding: 6px 14px; min-height: 36px; margin-left: auto; cursor: pointer; }

.pve-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--space-3); }
.pve-toolbar input[type="search"], .pve-toolbar select { font: inherit; font-size: 0.875rem; background: var(--color-bg-surface-raised); color: var(--color-text); border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 9px 12px; min-height: 44px; min-width: 0; }
.pve-toolbar input[type="search"] { flex: 1 1 200px; }
.pve-key { margin: 0 0 var(--space-3); scroll-margin-top: 16px; }
.pve-key h3 { font-size: 1.125rem; color: var(--color-heading); margin: 0 0 10px; }
.pve-key dl { margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.pve-key dl > div { background: var(--color-bg-surface); border: 1px solid var(--color-border); border-radius: 8px; padding: 12px 14px; }
.pve-key dl > div:last-child { grid-column: span 2; }
.pve-key dt { font-weight: 700; color: var(--color-heading); }
.pve-key dd { margin: 2px 0 0; color: var(--color-text-muted); font-size: 0.875rem; }
@media (max-width: 640px) { .pve-key dl > div:last-child { grid-column: auto; } }
.pve-swipe { margin: 0 0 8px; font-size: 0.8125rem; color: var(--color-gold-bright); }
.pve-swipe[hidden] { display: none; }

.pve-shell { position: relative; }
.pve-shell::before, .pve-shell::after { content: ""; position: absolute; top: 1px; bottom: 1px; width: 34px; pointer-events: none; opacity: 0; transition: opacity 150ms ease; z-index: 4; }
.pve-shell::before { left: 0; background: linear-gradient(90deg, rgba(9, 9, 11, 0.85), rgba(9, 9, 11, 0)); border-radius: 8px 0 0 8px; }
.pve-shell::after { right: 0; background: linear-gradient(270deg, rgba(9, 9, 11, 0.9), rgba(9, 9, 11, 0)); border-radius: 0 8px 8px 0; }
.pve-shell.can-left::before, .pve-shell.can-right::after { opacity: 1; }
.pve-chev { position: absolute; right: 8px; top: 120px; z-index: 5; pointer-events: none; width: 28px; height: 28px; border-radius: 50%; background: var(--color-bg-surface-elevated); border: 1px solid var(--color-border-gold); color: var(--color-gold-bright); display: none; align-items: center; justify-content: center; font-size: 18px; line-height: 1; }
.pve-shell.can-right .pve-chev { display: flex; }
.pve-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg-surface); }
.pve-table { border-collapse: collapse; width: 100%; min-width: 47.5rem; font-size: 0.875rem; }
.pve-table th, .pve-table td { padding: 11px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--color-border); }
.pve-table thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-faint); font-weight: 600; background: var(--color-bg-surface-raised); position: sticky; top: 0; }
.pve-table th.num, .pve-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.pve-table th.ctr, .pve-table td.ctr { text-align: center; font-variant-numeric: tabular-nums; }
.pve-col-swing { width: 1%; padding-left: 6px; padding-right: 6px; }
.pve-table th:nth-child(1), .pve-table td:nth-child(1) { position: sticky; left: 0; z-index: 2; min-width: 52px; background: var(--color-bg-surface); }
.pve-table th:nth-child(2), .pve-table td:nth-child(2) { position: sticky; left: 52px; z-index: 2; background: var(--color-bg-surface); }
.pve-table thead th:nth-child(1), .pve-table thead th:nth-child(2) { background: var(--color-bg-surface-raised); z-index: 3; }
.pve-table tr.pve-detail td:nth-child(1) { position: static; min-width: 0; }
.pve-shell.can-left .pve-table td:nth-child(2), .pve-shell.can-left .pve-table th:nth-child(2) { box-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.7); }
.pve-row { cursor: pointer; }
.pve-row:hover td, .pve-row[aria-expanded="true"] td { background: var(--color-bg-surface-raised); }
.pve-row[hidden], .pve-detail[hidden] { display: none; }
.pve-team { font-weight: 600; color: var(--color-heading); }
.pve-conf-cell { color: var(--color-text-faint); font-size: 0.8125rem; }
.pve-avg-cell { min-width: 11.875rem; }
.pve-avg-cell .pve-num { display: inline-block; min-width: 56px; text-align: right; margin-right: 12px; }
.pve-bar { display: inline-block; position: relative; height: 14px; width: 96px; vertical-align: middle; }
.pve-bar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--color-border-strong); }
.pve-bar i { position: absolute; top: 2px; height: 10px; border-radius: 2px; }
.pve-bar i.pos { left: 50%; background: var(--color-positive); }
.pve-bar i.neg { right: 50%; background: var(--color-negative); }
.pve-trend { font-size: 0.75rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--color-border-strong); color: var(--color-text-muted); }
.pve-trend-up { color: var(--color-positive); border-color: var(--color-positive-border); }
.pve-trend-down { color: var(--color-negative); border-color: var(--color-negative-border); }
.pve-early { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 4px; background: var(--color-bg-surface-elevated); color: var(--color-text-muted); }
.pve-info { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--color-border-strong); color: var(--color-gold-bright); font-size: 0.6875rem; text-decoration: none; margin-left: 4px; vertical-align: middle; }
tr.pve-detail td { background: var(--color-bg); white-space: normal; padding: 14px 16px; }
.pve-detail-head { margin: 0 0 10px; color: var(--color-text); }
.pve-games-wrap { overflow-x: auto; }
.pve-games { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.pve-games th, .pve-games td { padding: 6px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--color-border); }
.pve-games th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-faint); font-weight: 600; background: transparent; position: static; }
.pve-games th.num, .pve-games td.num { text-align: center; font-variant-numeric: tabular-nums; }
.pve-class { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 4px; background: var(--color-bg-surface-elevated); color: var(--color-text-muted); }
.pve-class-official { color: var(--color-gold-bright); background: rgba(184, 138, 51, 0.16); }
@media (max-width: 640px) {
  .pve-table { min-width: 55rem; }
  .pve-table th, .pve-table td { padding: 13px 14px; }
  .pve-table th:nth-child(1), .pve-table td:nth-child(1) { padding-left: 12px; padding-right: 10px; }
  .pve-team { font-size: 0.9375rem; }
  .pve-avg-cell { min-width: 11.875rem; }
}
@media (prefers-reduced-motion: reduce) { .pve-shell::before, .pve-shell::after { transition: none; } }
/* Site-wide "turn your phone sideways" tip: only on narrow, portrait, touch screens. */
.rotate-tip { display: none; }
.rotate-tip[hidden] { display: none !important; }
@media (max-width: 640px) and (orientation: portrait) and (pointer: coarse) {
  .rotate-tip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.5rem 0 0.75rem;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    border: 1px solid var(--color-gold-strong);
    border-radius: 8px;
    background: rgba(184, 138, 51, 0.12);
    color: var(--color-text);
  }
  .rotate-tip-icon { flex: none; font-size: 1.25rem; line-height: 1; color: var(--color-gold-bright); }
  .rotate-tip-text { margin: 0; flex: 1; font-size: 0.85rem; line-height: 1.3; }
  .rotate-tip-text strong { color: var(--color-gold-bright); }
  .rotate-tip-close {
    flex: none;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }
}
/* ==========================================================================
   Phone text-entry zoom fix + compact phone header (mobile polish).

   iOS Safari zooms the whole page whenever a focused text field or select
   renders below 16px, and does not zoom back out on blur. Several fields were
   13-14px (Find team search, Teams directory search and selects, the Rankings
   week select). On touch screens every text-entry control now computes to at
   least 16px, whatever page-scoped rule sets it. Zoom stays available to the
   user (the viewport meta is unchanged). Placed last so it wins by order.
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="range"]),
  select,
  textarea,
  body.teams-page .tdir-search-input,
  body.teams-page .tdir-select-wrap select,
  body.rankings-page .week-dropdown-select,
  body.rankings-page .finder-search {
    font-size: 16px !important;
  }
}

/* Find team dialogs on phones: anchored to the top of the VISIBLE viewport and
   sized to it (--rk-vvh is set by mobile_viewport.js from visualViewport, so the
   on-screen keyboard shrinks the dialog instead of covering its results). */
@media (hover: none) and (pointer: coarse) and (max-width: 767px) {
  .teams-finder-dialog,
  body.rankings-page .finder-dialog {
    position: fixed !important;
    inset: 8px 0 auto 0 !important;
    margin: 0 auto !important;
    width: calc(100% - 16px) !important;
    max-width: none !important;
    max-height: calc(var(--rk-vvh, 100dvh) - 16px) !important;
  }
  .teams-finder-dialog-inner,
  body.rankings-page .finder-dialog-inner {
    max-height: calc(var(--rk-vvh, 100dvh) - 16px) !important;
    border-radius: 14px !important;
  }
  /* The 16px text needs the full dialog width (the placeholder clipped at 14px width). */
  body.rankings-page .finder-search { width: 100% !important; box-sizing: border-box !important; }
}

/* Compact phone header (Rankings). The brand bar no longer pins to the top on
   phones (the bottom tab bar already carries navigation), padding and type are
   tightened, and Season/Week/View controls keep their 44px touch targets with
   smaller gaps. */
@media (max-width: 767px) {
  body.rankings-page .site-header .container.header-row {
    position: static !important;
    padding: 6px 12px !important;
  }
  body.rankings-page .wordmark { font-size: 16px !important; letter-spacing: 0.16em !important; }
  body.rankings-page .site-header .container:not(.header-row) { padding: 5px 12px !important; }
  body.rankings-page .rankings-flagship-title { font-size: 16px !important; line-height: 1.25 !important; letter-spacing: -0.01em !important; }
  body.rankings-page .control-bar { padding: 4px 12px !important; gap: 4px 6px !important; }
  body.rankings-page .season-coming-soon-note { margin-top: 2px !important; font-size: 11px !important; }
  body.rankings-page .rankings-display-options > .rankings-disclosure-summary { margin-top: 4px; min-height: 40px; }
}

/* Phones held sideways: height is the scarce resource, so the title band goes
   (the selected Season, Week and View are visible in the controls beneath it,
   and the page heading stays available to screen readers), the controls share
   one row, and the brand bar scrolls away. */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  body.rankings-page .site-header .container.header-row {
    position: static !important;
    padding: 4px 16px !important;
  }
  body.rankings-page .wordmark { font-size: 15px !important; }
  body.rankings-page .primary-nav-link { min-height: 36px !important; }
  body.rankings-page .site-header .container:not(.header-row) {
    padding: 0 !important; border-bottom: none !important;
  }
  body.rankings-page .rankings-flagship-title {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  body.rankings-page .rankings-eyebrow,
  body.rankings-page .rankings-subtitle { display: none !important; }
  body.rankings-page .control-bar { padding: 4px 16px !important; gap: 4px 14px !important; flex-wrap: nowrap !important; align-items: center !important; }
  body.rankings-page .control-bar .control-row { gap: 6px !important; }
  body.rankings-page .control-bar .week-nav { flex: 1 1 auto; }
  body.rankings-page .control-bar .pill,
  body.rankings-page .control-bar .week-dropdown-select { min-height: 40px !important; }
}

/* PvE: sportsbook names under each game's class badge, and the Top 25 table at the bottom of the page. */
.pve-books { display: block; margin-top: 3px; font-size: 0.75rem; color: var(--color-text-muted); }
.pve-top-table th, .pve-top-table td { white-space: nowrap; }
.pve-more { margin-top: var(--space-3); display: flex; justify-content: center; }
.pve-more .pve-btn { margin-left: 0; min-height: 44px; padding-left: 20px; padding-right: 20px; }
.pve-filter-note { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: 0.875rem; }
.pve-link-btn { font: inherit; color: var(--color-gold-bright); background: none; border: 0; padding: 8px 4px; cursor: pointer; text-decoration: underline; min-height: 44px; }
.pve-row[hidden] { display: none; }
.pve-row.pve-flash td { background: rgba(212, 175, 55, 0.18); }
.pve-top-table th.pve-c, .pve-top-table td.pve-c { text-align: center !important; }
/* PvE tab on the Rankings page: sized to its content, inside the page's content width, numbers centered under headings. */
body.rankings-page .rankings-table.pve-top-table { width: auto !important; min-width: 0 !important; }
body.rankings-page .rankings-table.pve-top-table thead th, body.rankings-page .rankings-table.pve-top-table tbody td, body.rankings-page .rankings-table.pve-top-table tbody th { padding-inline: 18px !important; }
body.rankings-page .rankings-table.pve-top-table th, body.rankings-page .rankings-table.pve-top-table td { text-align: center !important; }
body.rankings-page .rankings-table.pve-top-table th:nth-child(2), body.rankings-page .rankings-table.pve-top-table td:nth-child(2),
body.rankings-page .rankings-table.pve-top-table th:last-child, body.rankings-page .rankings-table.pve-top-table td:last-child { text-align: left !important; }
body.rankings-page .pve-shell { width: fit-content; max-inline-size: calc(100% - 32px); margin-inline: max(16px, calc((100% - 1392px) / 2)) auto; }
body.rankings-page .pve-shell > .pip-table-wrap.pve-table-wrap { width: auto; max-inline-size: none; margin: 0; }
@media (min-width: 768px) { body.rankings-page .pve-shell { max-inline-size: calc(100% - 48px); margin-inline: max(24px, calc((100% - 1392px) / 2)) auto; } }
@media (max-width: 767px) { body.rankings-page .rankings-table.pve-top-table thead th, body.rankings-page .rankings-table.pve-top-table tbody td, body.rankings-page .rankings-table.pve-top-table tbody th { padding-inline: 12px !important; } }

/* Column headings that stay on screen while the PIP and PvE tables scroll (see sticky_table_head.js). */
.sticky-head { position: fixed; z-index: 15; overflow: hidden; border-radius: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.sticky-head[hidden] { display: none; }
.sticky-head .sticky-head-table { table-layout: fixed; width: auto !important; min-width: 0 !important; margin: 0; }
/* PIP on a phone: tighter cells, like the AP table, so rank, team, conference, score and games share the first screen
   and the six category columns scroll in beside them. */
@media (max-width: 767px) {
  body.rankings-page .pip-table.rankings-table thead th { padding: 6px 5px !important; font-size: 10px !important; letter-spacing: 0.04em !important; line-height: 1.2; }
  body.rankings-page .pip-table.rankings-table tbody td, body.rankings-page .pip-table.rankings-table tbody th { padding: 6px 5px !important; font-size: 13px !important; line-height: 1.25; }
  body.rankings-page .pip-table.rankings-table .pip-col-rank { width: 2.6rem; min-width: 2.6rem; max-width: 2.6rem; }
  .pip-table .pip-col-rank + .pip-col-team { left: 2.6rem; }
  body.rankings-page .pip-table.rankings-table .pip-col-conf { white-space: normal !important; min-width: 4.5rem; max-width: 5.5rem; }
  body.rankings-page .pip-table.rankings-table tbody td.pip-col-conf { font-size: 12px !important; }
  body.rankings-page .pip-table.rankings-table thead th.pip-col-rank, body.rankings-page .pip-table.rankings-table thead th.pip-col-team, body.rankings-page .pip-table.rankings-table thead th.pip-col-pip, body.rankings-page .pip-table.rankings-table thead th.pip-col-games { white-space: normal !important; }
  body.rankings-page .pip-table.rankings-table thead th.pip-col-cat { white-space: normal !important; min-width: 4rem; }
  .pip-early { display: block; margin-left: 0; font-size: 10px; }
}
/* PvE conference: a line under the team name on a phone, where the Conference column is hidden to make the table fit. */
.pve-conf-sub { display: none; }
/* PvE on a phone: the same tighter cells, with long headings and conference names wrapping, so the table fits the screen. */
@media (max-width: 767px) {
  body.rankings-page .rankings-table.pve-top-table thead th { padding: 6px 4px !important; font-size: 10px !important; letter-spacing: 0.04em !important; line-height: 1.2; white-space: normal !important; }
  body.rankings-page .rankings-table.pve-top-table tbody td, body.rankings-page .rankings-table.pve-top-table tbody th { padding: 6px 4px !important; font-size: 12.5px !important; line-height: 1.25; }
  body.rankings-page .rankings-table.pve-top-table thead th { letter-spacing: 0.02em !important; }
  body.rankings-page .rankings-table.pve-top-table .pve-trend { display: inline-block; max-width: 4.6rem; font-size: 10.5px; padding: 2px 4px; white-space: normal; text-align: center; line-height: 1.2; }
  body.rankings-page .pve-conf-sub { display: block; font-size: 11px; font-weight: 500; color: var(--rankings-text-muted); line-height: 1.2; }
  body.rankings-page .rankings-table.pve-top-table th, body.rankings-page .rankings-table.pve-top-table td { padding-inline: 3px !important; }
}

/* PvE market scorecard: record against the line, median game, average line and a bar per game (Form). */
.pve-form { display: inline-flex; align-items: center; gap: 2px; height: 38px; vertical-align: middle; }
.pve-fb { position: relative; display: block; width: 8px; height: 38px; }
.pve-fb::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--color-border-strong, #444); }
.pve-fb i { position: absolute; left: 0; right: 0; border-radius: 1px; }
.pve-fb-pos i { bottom: 50%; height: calc(var(--h) * 50%); background: var(--color-positive); }
.pve-fb-neg i { top: 50%; height: calc(var(--h) * 50%); background: var(--color-negative); }
.pve-fb-push i { top: calc(50% - 1px); height: 2px; background: var(--color-text-faint, #888); }
.pve-score-table td.pve-c, .pve-score-table th.pve-c { text-align: center !important; }
.pve-score-table .pve-rec { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pve-score-table .pve-early { display: block; margin: 2px auto 0; width: fit-content; }
/* Insights table: all ten columns share the page width, so headings wrap and cells are snug. */
body.rankings-page .rc-table.pve-score-table th, body.rankings-page .rc-table.pve-score-table td { padding: 10px 7px; }
body.rankings-page .rc-table.pve-score-table thead th { white-space: normal; letter-spacing: 0.04em; line-height: 1.2; vertical-align: bottom; }
body.rankings-page .rc-table.pve-score-table td:nth-child(2), body.rankings-page .rc-table.pve-score-table th:nth-child(2) { text-align: left; }
body.rankings-page .rc-table.pve-score-table td, body.rankings-page .rc-table.pve-score-table th[scope="row"] { vertical-align: middle; }
body.rankings-page .rc-table.pve-score-table th.num, body.rankings-page .rc-table.pve-score-table td.num { text-align: center; }
body.rankings-page .rc-table.pve-score-table th.pve-c, body.rankings-page .rc-table.pve-score-table td.pve-c { text-align: center; }
body.rankings-page .rc-table.pve-score-table tbody th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 600; }
body.rankings-page .rc-table.pve-score-table .pve-conf-sub { white-space: normal; }
.pve-key-score dl > div:last-child { grid-column: auto; }
.pve-key-score { margin-top: var(--space-4); }
.pve-key-wrap { padding-inline: max(16px, calc((100% - 1392px) / 2)); }
.pve-phone-note { display: none; margin: 0 0 8px; font-size: 0.8125rem; color: var(--color-gold-bright); }
@media (max-width: 767px) {
  .pve-phone-note { display: block; padding-inline: 16px; }
  .rc-study .pve-phone-note { padding-inline: 0; }
  .pve-fb { width: 6px; height: 32px; }
  .pve-form { gap: 1px; height: 32px; }
  body.rankings-page .rc-table.pve-score-table th, body.rankings-page .rc-table.pve-score-table td { padding: 7px 4px; font-size: 12.5px; }
  body.rankings-page .rc-table.pve-score-table thead th { font-size: 10px; letter-spacing: 0.02em; }
  body.rankings-page .rc-table.pve-score-table td.pve-avg, body.rankings-page .rc-table.pve-score-table td.pve-rec { text-align: center; }
  .pve-score-table .pve-early { font-size: 9px; padding: 1px 4px; }
}
body.rankings-page .rc-table.pve-score-table td:last-child { white-space: normal; min-width: 5.5rem; }
.pve-phone-note[hidden] { display: none; }
/* Phones held sideways and small tablets: tighter cells and wrapping headings so all ten columns fit without sliding. */
@media (min-width: 768px) and (max-width: 1099px) {
  body.rankings-page .rankings-table.pve-score-table thead th, body.rankings-page .rankings-table.pve-score-table tbody td, body.rankings-page .rankings-table.pve-score-table tbody th { padding-inline: 7px !important; font-size: 12.5px !important; }
  body.rankings-page .rankings-table.pve-score-table thead th { white-space: normal !important; letter-spacing: 0.03em !important; line-height: 1.2; }
  body.rankings-page .rankings-table.pve-score-table .pve-conf-sub { display: none; }
  body.rankings-page .rankings-table.pve-score-table td:last-child { white-space: normal; }
  .pve-score-table .pve-fb { width: 6px; }
  .pve-score-table .pve-trend { font-size: 11px; padding: 2px 6px; }
}

/* News PvE scorecard block: same look as the PvE rankings (Form bars, one per game). Columns stay on one line in landscape and scroll with a cue on narrow screens. */
body.rankings-page .news-scorecard td, body.rankings-page .news-scorecard tbody th { white-space: nowrap; }
body.rankings-page .news-scorecard th, body.rankings-page .news-scorecard td { padding: 8px 6px; }
body.rankings-page .news-scorecard thead th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
body.rankings-page .news-scorecard .sc-avg { color: var(--color-positive, var(--rankings-positive)); font-variant-numeric: tabular-nums; }
body.rankings-page .news-scorecard .sc-form { text-align: center; }
body.rankings-page .sc-form-svg { display: inline-block; vertical-align: middle; }
body.rankings-page .sc-form-axis { stroke: var(--color-border-strong, #444); stroke-width: 1; }
body.rankings-page .sc-bar-beat { fill: var(--color-positive, var(--rankings-positive)); }
body.rankings-page .sc-bar-miss { fill: var(--color-negative, var(--rankings-negative)); }
body.rankings-page .sc-bar-push { fill: var(--color-text-faint, #888); }
body.rankings-page .sc-trend-rising { color: var(--color-positive, var(--rankings-positive)); }
body.rankings-page .sc-trend-falling { color: var(--color-negative, var(--rankings-negative)); }
body.rankings-page .sc-key { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
body.rankings-page .sc-swatch-beat { background: var(--color-positive, var(--rankings-positive)); }
body.rankings-page .sc-swatch-miss { background: var(--color-negative, var(--rankings-negative)); }
body.rankings-page .sc-swatch { display: inline-block; inline-size: 10px; block-size: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: -1px; }
body.rankings-page .sc-rotate-note { display: none; }
@media (max-width: 767px) and (orientation: portrait) {
  body.rankings-page .sc-rotate-note { display: block; }
}

/* Short note beside the season selector when a view exists for only some seasons. */
.control-note {
  margin: 0;
  color: var(--color-text-muted, #9aa0a6);
  font-size: 0.875rem;
  align-self: center;
}

/* Conference Standings view on the Rankings page: aligned with the other Rankings views, and compact so a conference
   table fits a phone without sideways scrolling. */
body.rankings-page .standings-block { box-sizing: border-box; width: calc(100% - 32px); max-inline-size: 1392px; margin-inline: auto; }
@media (min-width: 768px) { body.rankings-page .standings-block { width: calc(100% - 48px); } }
body.rankings-page .standings-group { margin-block: 20px 8px; }
body.rankings-page .standings-heading { margin-block: 12px 8px; font-size: 1.25rem; }
body.rankings-page .standings-table { min-width: 0 !important; table-layout: auto; }
body.rankings-page .standings-table th, body.rankings-page .standings-table td { padding-inline: 8px !important; }
body.rankings-page .standings-table .num { text-align: center !important; width: 1%; white-space: nowrap; }
body.rankings-page .standings-table tbody th { white-space: normal !important; }
@media (min-width: 768px) { body.rankings-page .standings-table th, body.rankings-page .standings-table td { padding-inline: 14px !important; } }

/* ==========================================================================
   Head to Head (H2H R3): the H2H tab and the upcoming-game matchup on Games.
   Uses the Teams tokens; team colours appear only as small accents
   (--h2h-accent / --h2h-dot) set from approved identities, never as large fills.
   ========================================================================== */
body.teams-page .h2h-page { display: grid; gap: 14px; min-width: 0; }
body.teams-page .h2h-page-title { margin: 0; font-size: 1.5rem; }
body.teams-page .h2h-page-sub { margin: 0; color: var(--teams-text-muted); }
body.teams-page .h2h-pickers {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch;
}
body.teams-page .h2h-picker {
  display: grid; align-content: start; gap: 6px; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--teams-border); border-top: 3px solid var(--h2h-accent, var(--teams-border-strong));
  border-radius: var(--teams-radius); background: var(--teams-surface-raised);
}
body.teams-page .h2h-label { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-muted); }
body.teams-page .h2h-picker select, body.teams-page .h2h-search {
  width: 100%; min-height: 44px; padding: 0 10px; font: inherit; font-size: 1.05rem;
  color: var(--teams-text-primary); background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-border); border-radius: 8px;
}
body.teams-page .h2h-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; font-size: 0.88rem; color: var(--teams-text-secondary); }
body.teams-page .h2h-meta strong { color: var(--teams-text-primary); }
body.teams-page .h2h-vs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
body.teams-page .h2h-vs-text { font-weight: 800; letter-spacing: 0.06em; color: var(--teams-accent); }
body.teams-page .h2h-swap, body.teams-page .h2h-go {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
  font: inherit; color: var(--teams-accent-soft); background: var(--teams-surface-sunken);
  border: 1px solid var(--teams-accent); border-radius: 10px; text-decoration: none; cursor: pointer;
}
body.teams-page .h2h-swap:hover, body.teams-page .h2h-go:hover { background: var(--color-bg-surface-elevated); }
body.teams-page .h2h-swap:focus-visible, body.teams-page .h2h-go:focus-visible,
body.teams-page .h2h-picker select:focus-visible, body.teams-page .h2h-search:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
body.teams-page .h2h-go { grid-column: 1 / -1; justify-self: start; }
body.teams-page .h2h-swap.is-hint { animation: h2h-pulse 1.8s ease-in-out 3; }
@keyframes h2h-pulse { 50% { box-shadow: 0 0 0 5px rgba(197, 164, 106, 0.35); } }
body.teams-page .h2h-lead {
  display: none; margin: 0; padding: 10px 14px; border: 1px dashed var(--teams-accent); border-radius: 10px;
  color: var(--teams-accent-soft); font-size: 0.9rem;
}
body.teams-page .h2h-lead strong { color: var(--teams-text-primary); }
body.teams-page .h2h-lead.is-flash { animation: h2h-flash 1.4s ease; }
@keyframes h2h-flash { 0% { background: var(--teams-accent); color: #09090b; } 100% { background: transparent; } }
body.teams-page .h2h-prompt { margin: 0; padding: 14px; border: 1px solid var(--teams-border); border-radius: var(--teams-radius); background: var(--teams-surface-raised); color: var(--teams-text-secondary); }

body.teams-page .h2h-matchup { display: grid; gap: 12px; min-width: 0; }
body.teams-page .h2h-watch {
  padding: 14px 16px; border: 1px solid var(--teams-accent); border-radius: var(--teams-radius); background: var(--teams-surface-raised);
}
body.teams-page .h2h-watch-title { margin: 0 0 8px; font-size: 1.25rem; color: var(--teams-accent-soft); }
body.teams-page .h2h-watch-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; margin: 0; padding: 0; list-style: none; }
body.teams-page .h2h-watch-list li { position: relative; padding-left: 14px; font-size: 1rem; color: var(--teams-text-primary); }
body.teams-page .h2h-watch-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--h2h-dot, var(--teams-accent));
}
body.teams-page .h2h-result { padding: 10px 14px; border: 1px solid var(--teams-border); border-radius: var(--teams-radius); background: var(--teams-surface-raised); color: var(--teams-text-secondary); }
body.teams-page .h2h-result p { margin: 2px 0; }
body.teams-page .h2h-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.teams-page .h2h-facts-box {
  padding: 10px 14px; border: 1px solid var(--teams-border); border-top: 3px solid var(--h2h-accent, var(--teams-border-strong));
  border-radius: var(--teams-radius); background: var(--teams-surface-sunken);
}
body.teams-page .h2h-facts-title, body.teams-page .h2h-col-title {
  margin: 0 0 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-muted); font-weight: 600;
}
body.teams-page .h2h-facts-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; margin: 0; font-size: 0.9rem; }
body.teams-page .h2h-facts-list dt { color: var(--teams-text-secondary); }
body.teams-page .h2h-facts-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
body.teams-page .h2h-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: start; }
body.teams-page .h2h-col { display: grid; gap: 10px; min-width: 0; }
body.teams-page .h2h-card { padding: 10px 12px; border: 1px solid var(--teams-border); border-radius: 10px; background: var(--teams-surface-raised); min-width: 0; }
body.teams-page .h2h-card-title { margin: 0 0 6px; font-size: 0.85rem; font-weight: 600; color: var(--teams-accent-soft); }
body.teams-page .h2h-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.teams-page .h2h-half p { margin: 0; }
body.teams-page .h2h-cap { font-size: 0.76rem; color: var(--teams-text-muted); overflow-wrap: anywhere; }
body.teams-page .h2h-big { display: flex; flex-direction: column; }
body.teams-page .h2h-v { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--teams-text-primary); }
body.teams-page .h2h-unit { font-size: 0.75rem; font-weight: 400; color: var(--teams-text-muted); }
body.teams-page .h2h-r { font-size: 0.8rem; color: var(--teams-text-secondary); }
body.teams-page .h2h-bar { height: 4px; margin-top: 5px; border-radius: 2px; background: var(--teams-surface-sunken); position: relative; }
body.teams-page .h2h-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--teams-accent); }
body.teams-page .h2h-center { padding: 10px 12px; border: 1px solid var(--teams-border); border-radius: var(--teams-radius); background: var(--teams-surface-raised); min-width: 0; }
body.teams-page .h2h-center-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; font-weight: 700; color: var(--teams-text-secondary); }
body.teams-page .h2h-row {
  display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; align-items: center; padding: 7px 0;
  border-top: 1px solid var(--teams-border); font-variant-numeric: tabular-nums;
}
body.teams-page .h2h-row p { margin: 0; }
body.teams-page .h2h-ra { text-align: left; } body.teams-page .h2h-rb { text-align: right; }
body.teams-page .h2h-ra .h2h-v, body.teams-page .h2h-rb .h2h-v { font-size: 1rem; }
body.teams-page .h2h-ra, body.teams-page .h2h-rb { display: flex; flex-direction: column; }
body.teams-page .h2h-rm { text-align: center; font-size: 0.82rem; color: var(--teams-text-secondary); }
body.teams-page .h2h-sep { margin: 10px 0 2px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teams-text-muted); font-weight: 600; }
body.teams-page .h2h-note { margin: 0; font-size: 0.8rem; color: var(--teams-text-muted); }
body.teams-page .h2h-gamesides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.teams-page .h2h-gameside { padding: 10px 14px; border: 1px solid var(--teams-border); border-top: 3px solid var(--h2h-accent, var(--teams-border-strong)); border-radius: var(--teams-radius); background: var(--teams-surface-raised); }
body.teams-page .h2h-gameside-name { margin: 0 0 4px; font-size: 1.15rem; font-weight: 700; }
body.teams-page .h2h-mark {
  display: inline-block; vertical-align: 1px; margin-right: 6px; min-width: 30px; padding: 3px 4px; text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 4px; background: var(--h2h-mark-bg); color: var(--h2h-mark-fg);
  font-size: 0.66rem; font-weight: 900; letter-spacing: 0.04em; line-height: 1;
}
body.teams-page .h2h-mark.is-long { letter-spacing: 0; }

/* Narrower than a wide desktop: tighten, then stack in the approved order (header, facts, Team A offense vs
   Team B defense, direct rows, Team B offense vs Team A defense). */
@media (max-width: 1180px) and (min-width: 861px) {
  body.teams-page .h2h-grid { gap: 8px; }
  body.teams-page .h2h-v { font-size: 1.1rem; }
}
@media (max-width: 860px) {
  body.teams-page .h2h-grid { grid-template-columns: minmax(0, 1fr); }
  body.teams-page .h2h-lead { display: block; }
}
@media (max-width: 700px) {
  body.teams-page .h2h-pickers { grid-template-columns: minmax(0, 1fr); }
  body.teams-page .h2h-vs { flex-direction: row; }
  body.teams-page .h2h-facts, body.teams-page .h2h-gamesides { grid-template-columns: minmax(0, 1fr); }
  body.teams-page .h2h-watch-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  body.teams-page .h2h-swap.is-hint, body.teams-page .h2h-lead.is-flash { animation: none; }
}
body.teams-page .h2h-search { box-sizing: border-box; font-size: max(16px, 1rem); }
body.teams-page .h2h-search-hint { grid-column: 1 / -1; margin: 0; min-height: 0; font-size: 0.85rem; color: var(--teams-accent-soft); }
body.teams-page .h2h-search-hint:empty { display: none; }

/* Head to Head team picker: combobox list (opens on click, narrows as you type). */
body.teams-page .h2h-combo { position: relative; }
body.teams-page .h2h-search { font-size: max(16px, 1rem); }
body.teams-page .h2h-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  max-height: min(18rem, 50vh); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--teams-border-strong); border-radius: 10px; background: var(--teams-surface-sunken);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
body.teams-page .h2h-list [role="option"] {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  color: var(--teams-text-primary); overflow-wrap: anywhere;
}
body.teams-page .h2h-list [role="option"][hidden] { display: none; }
body.teams-page .h2h-list [role="option"]:hover,
body.teams-page .h2h-list [role="option"].is-active { background: var(--teams-surface-hover); }
body.teams-page .h2h-list [role="option"][aria-selected="true"] { color: var(--teams-accent-soft); font-weight: 600; }

/* ==========================================================================
   Wheel pickers: Season, Week and Conference fields (static/wheel_picker.js).
   View pills come first (one row, even on a phone); the wheel fields sit on
   the row under them. Without scripts the original pills / dropdown + Go
   remain; with scripts they are replaced by one field button each.
   ========================================================================== */
[data-wheel-enhanced] .pill-nav,
[data-wheel-enhanced] .week-dropdown-form { display: none !important; }

body.rankings-page .control-bar .control-view { flex: 1 0 100%; min-width: 0; }
body.rankings-page .control-bar .control-note { flex: 1 0 100%; }

.wheel-field {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 40px; min-width: 7.5rem; max-width: 100%; padding: 8px 14px;
  border: 1px solid var(--rankings-border); border-radius: 999px;
  background: var(--rankings-surface-sunken); color: var(--rankings-text-primary);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer;
  text-align: left; white-space: nowrap;
}
.wheel-field:hover { border-color: var(--rankings-border-strong); }
.wheel-field:focus-visible { outline: 2px solid var(--rankings-focus); outline-offset: 2px; box-shadow: var(--rankings-focus-ring); }
.wheel-field-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wheel-field-caret { color: var(--rankings-accent); font-size: 12px; }
select.wheel-native { appearance: auto; padding-right: 10px; }
.wheel-field.is-static { cursor: default; background: transparent; }
@media (min-width: 768px) { select.wheel-native { min-width: 12.5rem; } }
@media (max-width: 767px) {
  body.rankings-page .control-bar .control-view .pill-nav { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; width: 100%; }
  body.rankings-page .control-bar .control-view .pill-nav li { flex: 1 1 auto; min-width: 0; }
  body.rankings-page .control-bar .control-view .pill { width: 100%; justify-content: center; padding: 0 6px !important; font-size: 13px !important; white-space: nowrap; }
  body.rankings-page .control-bar .control-view .control-label { display: none; }
  body.rankings-page .control-bar [data-wheel] { flex: 1 1 0; min-width: 0; }
  body.rankings-page .control-bar [data-wheel-enhanced] .wheel-field { width: 100%; min-height: 44px; min-width: 0; }
}
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  body.rankings-page .control-bar .control-view { flex: 0 0 auto; }
  body.rankings-page .control-bar .control-note { flex: 0 1 auto; }
}

/* Rankings controls cleanup. Sort sits in the control bar beside View, Season and Week; Find team sits on the
   table's own heading row; the sort note and the "not included" footnote are single quiet lines. The pinned
   sideways scroll bar (rankings_archive_ink.js) follows the table box it belongs to: it sticks to the bottom
   of the screen while the table is on screen and rests under the table's last row. The box's own scroll bar
   is hidden only once that bar exists, so without JavaScript the normal bar stays. */
body.rankings-page .rankings-table-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
}
body.rankings-page .finder-trigger-hint { font-size: 11px; color: var(--rankings-text-faint); font-weight: 600; }
body.rankings-page .rankings-sort-note {
  margin: 0 !important; padding: 0 2px !important; max-width: none !important; align-self: flex-start; text-align: left !important; font-size: 12.5px; color: var(--rankings-text-muted);
}
body.rankings-page .rankings-footnotes { display: grid; gap: 4px; margin: 10px 0 0; padding: 0 2px; }
body.rankings-page .rankings-footnotes p { margin: 0; font-size: 12.5px; color: var(--rankings-text-muted); }
body.rankings-page .rankings-footnotes strong { color: var(--rankings-text-secondary); }
body.rankings-page .has-pinned-hscroll { scrollbar-width: none; }
body.rankings-page .has-pinned-hscroll::-webkit-scrollbar { display: none; }
.pinned-hscroll { position: relative; height: 26px; margin-top: 4px; }
.pinned-hscroll[hidden] { display: none; }
.pinned-hscroll-bar { position: absolute; top: 0; left: 0; right: 0; padding: 8px 4px; background: var(--rankings-bg); }
.pinned-hscroll.is-floating .pinned-hscroll-bar { position: fixed; top: auto; right: auto; z-index: 30; }
.pinned-hscroll-track { position: relative; height: 10px; border-radius: 999px; background: var(--rankings-surface-sunken); border: 1px solid var(--rankings-border); }
.pinned-hscroll-thumb {
  position: absolute; left: 0; top: -1px; height: 10px; border-radius: 999px; background: var(--rankings-text-muted);
  cursor: grab; touch-action: none;
}
.pinned-hscroll-thumb:hover { background: var(--rankings-text-secondary); }
.pinned-hscroll-thumb:active { cursor: grabbing; }
@media (max-width: 767px) {
  body.rankings-page .control-bar .sort-nav { flex: 1 0 100%; min-width: 0; }
  body.rankings-page .control-bar .sort-row { flex-wrap: nowrap !important; width: 100%; }
  body.rankings-page .control-bar .sort-row li { flex: 1 1 0; min-width: 0; }
  body.rankings-page .control-bar .sort-row .pill { width: 100%; justify-content: center; text-align: center; padding-left: 6px !important; padding-right: 6px !important; }
  body.rankings-page .rankings-open-hint, body.rankings-page .rankings-sort-prefix { display: none; }
  body.rankings-page .rankings-sort-note { padding: 0 4px !important; font-size: 11.5px; line-height: 1.3; }
  body.rankings-page .rankings-table-head { padding: 0 4px; }
  body.rankings-page .rankings-table-head .finder-trigger { min-height: 44px; }
  body.rankings-page .dashboard-rankings { gap: 6px !important; }
  .pinned-hscroll { height: 30px; }
  .pinned-hscroll-track, .pinned-hscroll-thumb { height: 12px; }
}
/* Head to Head share card builder (gold pill + inline panel; layout from the approved mockup). */
.h2h-share { margin: 0 0 var(--space-4); --h2h-share-gold: #f0b429; }
.h2h-share-open {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--min-target); padding: 0 22px;
  font: inherit; font-weight: 700; color: #1a1306; background: var(--gradient-gold); border: 0; border-radius: 999px;
  box-shadow: var(--shadow-gold); cursor: pointer;
}
.h2h-share-open:hover { filter: brightness(1.08); }
.h2h-share-open:focus-visible, .h2h-share-btn:focus-visible, .h2h-share-line input:focus-visible,
.h2h-share-sizes button:focus-visible, .h2h-share-bar button:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.h2h-share-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); align-items: start; }
.h2h-share-panel[hidden], .h2h-share-bar[hidden] { display: none; }
@media (min-width: 1000px) { .h2h-share-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } .h2h-share-preview { position: sticky; top: 12px; } }
@media (max-width: 999px) { .h2h-share-preview { order: -1; } .h2h-share-picker { scroll-margin-top: 8px; } .h2h-share { padding-bottom: 76px; } }
/* Below 768px the site's fixed bottom tab bar is showing; the pinned bar sits just above it. */
@media (max-width: 767px) { .h2h-share-bar:not([hidden]) { bottom: var(--mobile-nav-height) !important; padding-bottom: 10px !important; padding-right: 76px !important; } }
.h2h-share-picker { background: var(--color-bg-surface); border: 1px solid var(--color-border); min-width: 0; }
.h2h-share-ph { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.h2h-share-ph strong { color: var(--color-heading); text-transform: uppercase; letter-spacing: 0.08em; }
.h2h-share-count { color: var(--h2h-share-gold); font-weight: 700; }
.h2h-share-rules { margin: 0; padding: 10px 14px; font-size: 0.88rem; line-height: 1.4; color: var(--color-text-faint); border-bottom: 1px solid var(--color-border); }
.h2h-share-teams, .h2h-share-line { display: grid; grid-template-columns: 44px 1fr 1.3fr 1fr; align-items: center; }
.h2h-share-teams { padding: 8px 14px 8px 0; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--color-border); }
.h2h-share-teams span:nth-child(4) { text-align: right; }
.h2h-share-grp { padding: 10px 14px 6px; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--h2h-share-gold); font-weight: 700; background: #101013; border-bottom: 1px solid var(--color-border); }
.h2h-share-line { min-height: 52px; padding-right: 14px; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.h2h-share-line:hover { background: #1b1b21; }
.h2h-share-line.is-on { background: #1d1a0f; box-shadow: inset 3px 0 0 var(--h2h-share-gold); }
.h2h-share-line.is-off { opacity: 0.45; cursor: not-allowed; }
.h2h-share-line input { width: 22px; height: 22px; margin: 0 auto; accent-color: var(--h2h-share-gold); cursor: pointer; }
.h2h-share-line input:disabled { cursor: not-allowed; }
.h2h-share-cell { font-variant-numeric: tabular-nums; line-height: 1.15; padding: 6px 0; }
.h2h-share-cell b { display: block; font-size: 1.3rem; color: #fff; font-weight: 800; }
.h2h-share-cell small { display: block; color: var(--color-text-faint); font-size: 0.78rem; }
.h2h-share-cell.is-b { text-align: right; }
.h2h-share-cell.is-m { text-align: center; padding: 6px 8px; font-size: 0.9rem; color: var(--color-text); }
.h2h-share-cell.is-m i { display: block; font-style: normal; color: var(--color-text-faint); font-size: 0.72rem; margin-top: 2px; }
@media (max-width: 560px) { .h2h-share-teams, .h2h-share-line { grid-template-columns: 40px 1fr 1.2fr 1fr; } .h2h-share-cell b { font-size: 1.1rem; } .h2h-share-cell.is-m { font-size: 0.78rem; padding: 6px 4px; } }
.h2h-share-preview { display: grid; gap: 14px; min-width: 0; }
.h2h-share-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.h2h-share-sizes button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; font: inherit; font-weight: 700; text-align: left; color: var(--color-text); background: transparent; border: 1px solid var(--color-border-strong); cursor: pointer; }
.h2h-share-sizes button small { display: block; font-weight: 500; font-size: 0.75rem; color: var(--color-text-faint); }
.h2h-share-sizes button[aria-pressed="true"] { border-color: var(--h2h-share-gold); color: #fff; background: #221d0d; }
.h2h-share-preview canvas { display: block; width: 100%; height: auto; border: 1px solid var(--color-border-strong); background: #000; }
.h2h-share-order { border: 1px solid var(--color-border); background: var(--color-bg-surface); padding: 12px 14px; }
.h2h-share-order-title { margin: 0 0 4px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-heading); }
.h2h-share-order-hint { margin: 0 0 10px; font-size: 0.85rem; color: var(--color-text-faint); }
.h2h-share-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.h2h-share-orow { display: grid; grid-template-columns: 44px 24px minmax(0, 1fr) auto; gap: 6px; align-items: center; min-height: 52px; padding-right: 8px; background: #1b1c21; border: 1px solid var(--color-border); position: relative; }
.h2h-share-orow.is-drag { border-color: var(--h2h-share-gold); background: #24252b; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); z-index: 2; }
.h2h-share-orow:not(.is-drag) { transition: transform 0.12s; }
.h2h-share-handle { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: var(--color-text); background: transparent; border: 0; cursor: grab; touch-action: none; }
.h2h-share-handle svg { pointer-events: none; }
.h2h-share-onum { text-align: center; font-weight: 800; color: var(--h2h-share-gold); font-variant-numeric: tabular-nums; }
.h2h-share-oname { font-weight: 600; min-width: 0; line-height: 1.2; }
.h2h-share-oname small { display: block; font-weight: 500; font-size: 0.75rem; color: var(--color-text-faint); }
.h2h-share-omoves { display: flex; gap: 4px; }
.h2h-share-mv { width: 40px; height: 40px; padding: 0; font: inherit; color: var(--color-text); background: transparent; border: 1px solid var(--color-border-strong); cursor: pointer; }
.h2h-share-mv:disabled { opacity: 0.3; cursor: default; }
.h2h-share-handle:focus-visible, .h2h-share-mv:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .h2h-share-orow:not(.is-drag) { transition: none; } }
.h2h-share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.h2h-share-btn { min-height: var(--min-target); padding: 0 14px; font: inherit; font-weight: 700; color: var(--color-text); background: transparent; border: 1px solid var(--color-border-strong); cursor: pointer; }
.h2h-share-btn:hover { border-color: var(--h2h-share-gold); }
.h2h-share-btn.is-primary { background: var(--h2h-share-gold); border-color: var(--h2h-share-gold); color: #1a1405; }
.h2h-share-btn[hidden] { display: none; }
.h2h-share-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.h2h-share-status { min-height: 1.4em; margin: 0; font-size: 0.92rem; color: var(--color-text); }
.h2h-share-note { margin: 0; font-size: 0.88rem; color: var(--color-text-faint); max-width: 70ch; }
.h2h-share-bar { display: none; }
@media (max-width: 999px) {
  .h2h-share-bar:not([hidden]) {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 12px;
    background: #0f0f12; border-top: 1px solid var(--h2h-share-gold);
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .h2h-share-bar span { color: var(--h2h-share-gold); font-weight: 700; }
  .h2h-share-bar button { font: inherit; font-weight: 700; min-height: 44px; padding: 10px 16px; background: var(--h2h-share-gold); color: #1a1405; border: 0; cursor: pointer; }
}
/* ---------------------------------------------------------------------
   Brand: Ranktory Sports logo (test tubes) and "Rankings Laboratory"
   Desktop: full lockup in the header. Phones (app style): tube badge, page
   name in the middle, and the full lockup once at the top of the page.
--------------------------------------------------------------------- */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand-link:focus-visible { outline: 2px solid var(--color-gold-bright); outline-offset: 3px; border-radius: 4px; }
.brand-lockup { display: block; height: 44px; width: auto; }
.brand-badge, .brand-page, .brand-hero { display: none; }

@media (max-width: 767px) {
  .site-header .header-row .wordmark { flex: 1 1 auto; min-width: 0; }
  .brand-link { display: flex; width: 100%; }
  .brand-lockup { display: none; }
  .brand-badge { display: block; width: 32px; height: 32px; flex: none; }
  .brand-page {
    display: block;
    flex: 1 1 auto;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--color-heading);
  }
  .brand-link::after { content: ""; width: 32px; flex: none; }
  .brand-hero { display: block; padding-top: 10px !important; padding-bottom: 2px !important; }
  .brand-hero-lockup { display: block; width: min(258px, 72%); height: auto; }
}
/* Phones held sideways: height is scarce, so the one-time lockup goes. */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .brand-hero { display: none !important; }
}

/* PvE scorecard on a phone: every column stays, the table slides sideways, Rank and Team stay put on the left,
   and an edge fade (see pve_scroll_cue.js) shows which side has more columns. Works without rotating the phone,
   which Facebook, X and other in-app browsers often do not allow. */
@media (max-width: 767px) {
  :is(.pve-shell, .sticky-head) .pve-score-table { width: max-content; min-width: 100%; }
  :is(.pve-shell, .sticky-head) .pve-score-table th, :is(.pve-shell, .sticky-head) .pve-score-table td { white-space: nowrap; }
  :is(.pve-shell, .sticky-head) .pve-score-table thead th { white-space: normal; min-width: 4.2rem; }
  body.rankings-page :is(.pve-shell, .sticky-head) .pve-score-table .pve-conf-sub { display: none; }
  :is(.pve-shell, .sticky-head) .pve-score-table td:last-child, :is(.pve-shell, .sticky-head) .pve-score-table th:last-child { white-space: nowrap; min-width: 8.5rem; text-align: left !important; }
  :is(.pve-shell, .sticky-head) .pve-score-table th:nth-child(1), :is(.pve-shell, .sticky-head) .pve-score-table td:nth-child(1) { position: sticky; left: 0; z-index: 2; width: 2.6rem; min-width: 2.6rem; max-width: 2.6rem; background: var(--rankings-surface, var(--color-bg-surface, #111)); }
  :is(.pve-shell, .sticky-head) .pve-score-table th:nth-child(2), :is(.pve-shell, .sticky-head) .pve-score-table td:nth-child(2) { position: sticky; left: 2.6rem; z-index: 2; width: 6.8rem; min-width: 6.8rem; max-width: 6.8rem; white-space: normal !important; overflow-wrap: anywhere; background: var(--rankings-surface, var(--color-bg-surface, #111)); }
  body.rankings-page :is(.pve-shell, .sticky-head) .pve-score-table thead th:nth-child(1), body.rankings-page :is(.pve-shell, .sticky-head) .pve-score-table thead th:nth-child(2) { z-index: 5 !important; }
  .pve-shell.can-left .pve-score-table th:nth-child(2), .pve-shell.can-left .pve-score-table td:nth-child(2) { box-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.7); }
  .pve-shell::before { display: none; }
  .pve-shell::after { width: 44px; }
  .pve-shell.can-right::after { opacity: 1; }
  .pve-shell .pve-table-wrap, .pve-shell .rc-table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
}
/* Landscape phones and wider keep the full table without sliding. */
@media (min-width: 768px) { .pve-shell::before, .pve-shell::after { display: none; } }
/* In-app browsers (Facebook, Instagram, X ...) often lock the screen upright: do not ask readers to turn the phone. */
.in-app-browser .pve-rotate-part, .in-app-browser .rotate-tip, .in-app-browser .sc-rotate-note { display: none !important; }

/* ---- Design standard: numbers sit CENTERED under their column header, in every table (Founder rule, 2026-11-09).
   Only name/text columns (team, conference, labels) stay left. Do not add text-align: right/left to a numeric
   column; tests/test_table_number_alignment.py fails the build if one is added. ---- */
body.rankings-page .rankings-table:not(.pve-top-table):not(.pip-table) thead th:not(.col-team):not(.col-conf),
body.rankings-page .rankings-table:not(.pve-top-table):not(.pip-table) tbody td:not(.col-team):not(.col-conf) { text-align: center !important; }
body.rankings-page .rankings-compact-table th:not(.rc-team):not(.col-conf),
body.rankings-page .rankings-compact-table td:not(.rc-team):not(.col-conf) { text-align: center; }
.team-table th.rank-col, .team-table td.rank-col { text-align: center; }
.teams-data-table th.num, .teams-data-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
@media (min-width: 768px) {
  body.teams-page .r71-ov-table th:nth-child(n+2), body.teams-page .r71-ov-table td:nth-child(n+2) { text-align: center; }
}

/* Admin area and Article Desk (founder only). rem units only. */
.admin-card-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1rem 0 2rem; }
@media (min-width: 40rem) { .admin-card-grid { grid-template-columns: 1fr 1fr; } }
.admin-card { display: block; padding: 1rem 1.1rem; border: 1px solid var(--rankings-border-strong, #3a3a3f); border-radius: 0.6rem; text-decoration: none; color: inherit; background: var(--rankings-surface, transparent); min-height: 3rem; }
.admin-card:hover, .admin-card:focus-visible { border-color: var(--rankings-accent, #cfa84e); }
.admin-card-title { margin: 0 0 0.4rem; font-size: 1.15rem; }
.admin-card-text { margin: 0 0 0.6rem; color: var(--rankings-text-secondary, inherit); }
.admin-card-go { color: var(--rankings-accent, #cfa84e); font-weight: 600; }
.admin-section { margin: 1.4rem 0; }
.admin-section-title { margin: 0 0 0.2rem; font-size: 1.05rem; }
.admin-count { color: var(--rankings-text-muted, #999); font-weight: 400; margin-left: 0.4rem; }
.admin-hint, .admin-empty { color: var(--rankings-text-muted, #999); font-size: 0.9rem; margin: 0.2rem 0 0.6rem; }
.admin-note { padding: 0.6rem 0.8rem; border: 1px dashed var(--rankings-border-strong, #3a3a3f); border-radius: 0.4rem; }
.admin-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; align-items: center; padding: 0.7rem 0; border-top: 1px solid var(--rankings-border, #2b2c2f); }
.admin-row-main { min-width: 0; flex: 1 1 14rem; }
.admin-row-title { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.admin-row-meta { margin: 0.1rem 0 0; color: var(--rankings-text-muted, #999); font-size: 0.85rem; }
.admin-row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.admin-inline-form { display: inline; margin: 0; }
.admin-schedule-form { display: block; margin: .5rem 0; }
.admin-schedule-form input[type="datetime-local"] { max-width: 100%; width: 100%; box-sizing: border-box; padding: .5rem; font-size: 1rem; color-scheme: dark; margin: .25rem 0; }
.admin-danger { color: #e2675c; }
.admin-bad { color: #e2675c; }
.admin-desk { margin-top: 0.8rem; }
.admin-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; }
.admin-tab { flex: 1; min-height: 2.75rem; border: 1px solid var(--rankings-border-strong, #3a3a3f); background: transparent; color: inherit; border-radius: 0.4rem; font: inherit; cursor: pointer; }
.admin-tab[aria-selected="true"] { background: var(--rankings-accent, #cfa84e); color: #1a1405; border-color: var(--rankings-accent, #cfa84e); font-weight: 600; }
.admin-desk-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.admin-pane { min-width: 0; }
.admin-label { display: block; margin: 0.8rem 0 0.25rem; font-size: 0.85rem; color: var(--rankings-text-muted, #999); }
.admin-source { width: 100%; min-height: 22rem; resize: vertical; padding: 0.7rem; font: 0.9rem/1.55 ui-monospace, Menlo, Consolas, monospace; background: transparent; color: inherit; border: 1px solid var(--rankings-border-strong, #3a3a3f); border-radius: 0.4rem; }
.admin-fields input, .admin-fields select { width: 100%; min-height: 2.6rem; padding: 0.4rem 0.6rem; font: inherit; background: transparent; color: inherit; border: 1px solid var(--rankings-border-strong, #3a3a3f); border-radius: 0.4rem; }
.admin-key { margin-top: 0.5rem; color: var(--rankings-text-muted, #999); font-size: 0.9rem; }
.admin-viewbar { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.admin-view-on { background: var(--rankings-accent, #cfa84e); color: #1a1405; }
.admin-stage { display: flex; justify-content: center; padding: 0.6rem; border: 1px solid var(--rankings-border, #2b2c2f); border-radius: 0.4rem; overflow: auto; }
.admin-frame { width: 100%; height: 48rem; border: 0; background: #09090b; }
.admin-frame-phone { max-width: 24.5rem; }
.admin-checks { list-style: none; margin: 0.6rem 0; padding: 0; display: grid; gap: 0.5rem; }
.admin-check { display: flex; gap: 0.6rem; align-items: flex-start; }
.admin-check-mark { flex: none; width: 1.2rem; text-align: center; font-weight: 700; }
.admin-check-ok .admin-check-mark { color: #62b67e; }
.admin-check-warn .admin-check-mark { color: #e2a63c; }
.admin-check-bad .admin-check-mark { color: #e2675c; }
.admin-check-help { display: block; color: var(--rankings-text-muted, #999); }
.admin-save-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0 0.6rem; }
.admin-primary { background: var(--rankings-accent, #cfa84e); color: #1a1405; font-weight: 600; }
.admin-desk button:disabled { opacity: 0.5; cursor: not-allowed; }
@media (min-width: 64rem) {
  .admin-tabs { display: none; }
  .admin-desk-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .admin-desk .admin-pane[hidden] { display: block !important; }
  .admin-desk .admin-pane[data-pane="save"] { grid-column: 1 / -1; }
}
.footer-admin-link { margin-left: 0.6rem; font-size: 0.85rem; color: inherit; opacity: 0.8; }
.footer-admin-link:hover, .footer-admin-link:focus-visible { opacity: 1; }
