/**
 * Digital Tactician — taqtiQ
 * Design system tokens live in theme.css (loaded before this file).
 * This file bridges old token names → new theme.css tokens, and
 * provides all component, layout, and animation rules.
 *
 * Source of Truth: docs/desgins/DESIGN.md
 * Token File:      static/football/css/theme.css
 */

/* Reserve the vertical scrollbar slot at all times so toggling content height
   (e.g. Standings Official↔Live) never shifts the viewport's visible width. */
html {
  scrollbar-gutter: stable;
}

/* ========== BACKWARD-COMPAT BRIDGE (:root) ========== */
/* Maps legacy premium.css variable names to the new theme.css tokens.
   Existing page CSS referencing --bg-primary, --accent-primary, etc. continues
   to work unchanged. Only values are updated — names are preserved. */
:root {
  /* --- Color bridges (match main html.theme-light semantics) --- */
  --bg-primary:    var(--surface);              /* var(--surface-highest) page / canvas */
  --bg-secondary:  var(--surface-container);    /* #ffffff panels */
  --bg-tertiary:   var(--surface-highest);      /* var(--surface-highest) borders / chrome */
  --bg-elevated:   var(--surface-container);    /* #ffffff */
  --bg-hover:      color-mix(in srgb, var(--on-surface) 5%, transparent);

  --text-primary:   var(--on-surface);
  --text-secondary: var(--on-surface-variant);
  --text-muted:     var(--outline);

  --accent-primary: var(--primary-container);
  --accent-hover:   var(--primary-fixed);
  --accent-muted:   var(--te-accent-tint);

  --success:        var(--te-win);
  --success-bg:     var(--te-win-bg);
  --warning:        var(--te-draw);
  --warning-bg:     color-mix(in srgb, var(--warning) 12%, transparent);
  --danger:         var(--error);
  --danger-bg:      var(--te-error-tint);
  --info:           var(--secondary);
  --info-bg:        var(--te-secondary-tint);
  --prob-title:     var(--primary-container);

  /* Form badges → new tokens */
  --form-w: var(--te-win);
  --form-d: var(--te-draw);
  --form-l: var(--te-loss);

  /* --- Spacing (unchanged) --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;

  /* --- Radius → theme tokens --- */
  --radius-sm:   var(--te-radius-sm);
  --radius-md:   var(--te-radius-md);
  --radius-lg:   var(--te-radius-lg);
  --radius-xl:   var(--te-radius-xl);
  --radius-full: var(--te-radius-full);

  /* --- Shadows → theme tokens --- */
  --shadow-sm:        var(--te-shadow-sm);
  --shadow-md:        var(--te-shadow-md);
  --shadow-lg:        var(--te-shadow-lg);
  --shadow-card:      var(--te-shadow-sm);
  --shadow-card-hover: var(--te-shadow-md);

  /* --- Typography --- */
  --font-sans: var(--te-font);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;

  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-extrabold: 800;

  /* --- Transitions --- */
  --transition-fast: var(--te-transition-fast);
  --transition-base: var(--te-transition-base);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Borders → theme tokens --- */
  --border-default: var(--te-border);
  --border-subtle:  var(--te-border-subtle);

  /* --- Semantic typography scales --- */
  --text-stat:  2rem;
  --text-hero:  clamp(1.5rem, 2.5vw, 2.2rem);
  --text-title: clamp(1.35rem, 2.2vw, 1.875rem);
  --text-section: var(--text-lg);
  --text-body:    var(--text-base);

  /* --- Fixed design tokens (color-agnostic) --- */
  --color-gold:   var(--warning);
  --color-silver: var(--outline);
  --color-bronze: var(--warning);
  --color-terminal-bg:   var(--surface-lowest);
  --color-terminal-text: var(--te-win);
  --progress-height: 6px;

  /* --- Layout --- */
  --layout-max-wide:      1400px;
  --layout-max-narrow:    1200px;
  --layout-max-analytics: 1460px;
  --layout-max-content:   1320px;
  --layout-padding:       var(--space-4);
  --section-gap:          var(--space-5);
  /* Fixed `.premium-nav` occupies top of viewport; main must clear it (see main.premium-main — do not rely on a later .premium-main rule: lower specificity loses). Includes vertical padding on `.premium-nav`. */
  --premium-nav-offset:   calc(4.5rem + 2 * var(--space-3));

  /* --- Badge metrics --- */
  --badge-pad-y:    0.125rem;
  --badge-pad-x:    0.45rem;
  --badge-font-size: var(--text-xs);

  /* --- Glass / overlay --- */
  --bg-glass-light:  rgba(255, 255, 255, 0.65);
  --bg-glass-dark:   rgba(0, 0, 0, 0.08);
  --bg-glass-strong: var(--te-glass-bg);
  --on-accent: var(--on-primary);

  /* --- Semantic tints --- */
  --danger-tint:       var(--te-error-tint);
  --danger-tint-hover: color-mix(in srgb, var(--error) 18%, transparent);
  --accent-tint:       var(--te-accent-tint);
  --success-tint:      var(--te-win-bg);
}

/* Dark mode bridge overrides — keep legacy tokens in sync with theme-dark */
html.theme-dark {
  --bg-glass-light:  rgba(255, 255, 255, 0.06);
  --bg-glass-dark:   rgba(0, 0, 0, 0.20);
  --bg-glass-strong: rgba(15, 19, 28, 0.75);
  --warning:         var(--te-draw);
  --warning-bg:      color-mix(in srgb, var(--warning) 15%, transparent);

  /* Bootstrap 5.3 reads these when data-bs-theme=dark; mirror our tokens so utilities + reboot stay legible */
  --bs-body-color: var(--on-surface);
  --bs-body-bg: var(--surface);
  --bs-emphasis-color: var(--on-surface);
  --bs-secondary-color: var(--on-surface-variant);
  --bs-tertiary-color: color-mix(in srgb, var(--outline) 88%, transparent);
  --bs-heading-color: var(--on-surface);
  --bs-border-color: var(--te-border);
  --bs-link-color: var(--primary-fixed);
  --bs-link-hover-color: color-mix(in srgb, var(--primary-fixed) 85%, var(--on-surface));
}

/* ============================================
   ANIMATION SYSTEM — taqtiQ
   UNIFIED: 2026-04-10
   ============================================ */

/* @keyframes live-pulse moved to theme.css as @keyframes pulse-live —
   the single source of truth used by every live indicator. */

@keyframes score-flip {
  0% { transform: rotateX(0deg); opacity: 1; }
  50% { transform: rotateX(90deg); opacity: 0; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

@keyframes stat-bar-fill {
  from { width: 0%; }
  to { width: var(--bar-width, 100%); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes number-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.anim-live-pulse {
  animation: pulse-live 1.8s ease-in-out infinite;
}

.anim-fade-up {
  animation: fade-up 0.4s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .anim-fade-up,
  .anim-live-pulse {
    animation: none !important;
  }
  .gs-inline-wrap,
  .nav-links-hideable {
    transition: none !important;
  }
  .es-card,
  .tactical-nav__tab,
  .tactical-match-row {
    transition: none !important;
  }
  .premium-hero--fade {
    transform: none !important;
    animation: none !important;
  }
}

.gpu-transition {
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* UNIFIED: 2026-04-10 — terminal log + thin progress (no stat-bar-fill on generic bars) */
.terminal-log {
  background: var(--color-terminal-bg);
  color: var(--color-terminal-text);
  font-family: "Courier New", Courier, monospace;
  font-size: var(--text-sm);
}

.progress-thin {
  height: var(--progress-height) !important;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  overflow: hidden;
}

.progress-thin .progress-bar {
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* .match-status-badge family removed — markup migrated to the unified
   .status-badge primitive in components/_cards_badges.css. */

/* UNIFIED: 2026-04-10 — canonical W/D/L badges. Fixed square size so W/D/L
   render identically and columns align across rows in standings tables. */
.form-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: var(--badge-font-size);
  font-weight: var(--font-bold);
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Last-5 form row: fixed gap between badges so the 5 columns line up across
   every team row. flex + nowrap guarantees pills stay on one line inside the
   .data-cell--form grid cell (which uses max-content track sizing). */
.form-badge-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

a.form-badge {
  text-decoration: none;
  color: inherit;
}

.form-badge--w {
  background: color-mix(in srgb, var(--success) 22%, transparent);
  color: var(--success);
}

.form-badge--d {
  background: color-mix(in srgb, var(--warning) 22%, transparent);
  color: var(--warning);
}

.form-badge--l {
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  color: var(--danger);
}

/* Alias: existing templates */
.premium-form-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: var(--badge-font-size);
  font-weight: var(--font-bold);
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
}

.premium-form-badge.w {
  background: color-mix(in srgb, var(--success) 22%, transparent);
  color: var(--success);
}

.premium-form-badge.d {
  background: color-mix(in srgb, var(--warning) 22%, transparent);
  color: var(--warning);
}

.premium-form-badge.l {
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  color: var(--danger);
}

/* ========== BASE RESET ========== */
body {
  font-family: var(--te-font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--te-text);
  /* Match main branch light: page fill is bg-primary (var(--surface-highest)), not pure white */
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--te-transition-fast);
}
a:hover {
  color: var(--accent-hover);
  opacity: 0.85;
}

/* ========== UTILITY CLASSES (Tailwind-like) ========== */
.p-premium { padding: var(--space-4); }
.p-premium-sm { padding: var(--space-2); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.transition { transition: all var(--transition-base); }

/* ========== PREMIUM NAV — Tactical Edge Glassmorphic Header ========== */
.premium-nav {
  background: var(--nav-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: none;
  /* Symmetric vertical inset so controls (search, season/competition pills) never sit on the glass edge / shadow */
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  padding-left: 0;
  padding-right: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 1000;
  box-shadow: var(--nav-glass-shadow);
}

/* One horizontal strip on desktop: Bootstrap’s default `.navbar { flex-wrap: wrap }` was forcing the brand onto its own row. */
@media (min-width: 992px) {
  .premium-nav.navbar.navbar-expand-lg {
    flex-wrap: nowrap;
  }
}

.premium-nav .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  max-width: var(--layout-max-wide);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.premium-nav .nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.premium-nav .nav-center {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.premium-nav .nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Brand / Logo */
.premium-nav .logo,
.premium-nav .navbar-brand {
  font-size: 1.125rem !important;
  font-weight: 900 !important;
  font-style: italic;
  color: var(--accent-primary) !important;
  text-decoration: none;
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: opacity var(--transition-fast);
}
.premium-nav .logo:hover,
.premium-nav .navbar-brand:hover {
  color: var(--accent-primary) !important;
  opacity: 0.85;
}

/* .premium-nav .nav-link rules removed — .premium-nav itself was retired
   (see base.html comment about the sidebar replacing the legacy top nav). */

/* Visual separator between nav groups */
.nav-group-separator {
  width: 1px;
  height: 14px;
  background: var(--te-border);
  align-self: center;
  flex-shrink: 0;
}

/* Dropdown trigger buttons */
.premium-nav .nav-select {
  background: color-mix(in srgb, var(--surface-container) 60%, transparent);
  border: 1px solid var(--te-border);
  color: var(--text-primary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--te-label-size);
  font-weight: 700;
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--te-transition-fast), border-color var(--te-transition-fast);
}
.premium-nav .nav-select:hover,
.premium-nav .nav-select:focus {
  background: var(--surface-container);
  border-color: var(--accent-primary);
  outline: none;
}

/* Staff badge chip */
.nav-staff-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--space-2);
  background: var(--te-accent-tint);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: var(--space-1);
}

/* Bootstrap navbar toggler */
.premium-nav.navbar .navbar-toggler {
  border-color: var(--te-border);
  padding: var(--space-2);
}
.premium-nav.navbar .navbar-toggler-icon {
  opacity: 0.8;
}
html.theme-dark .premium-nav.navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* Mobile nav */
@media (max-width: 991px) {
  .premium-nav .nav-center,
  .premium-nav .nav-right {
    width: 100%;
    justify-content: flex-start;
  }
  .premium-nav .nav-container {
    flex-direction: column;
    align-items: stretch;
  }
  .premium-nav .dropdown-menu {
    background: var(--surface-container);
    border-color: var(--te-border-subtle);
  }
  .nav-group-separator {
    display: none;
  }
}

/* MATCH ROWS / FIXTURE CARDS / DAILY MATCHES sections removed.
   The unified linear match row lives in components/tactical-match-row.css
   (.tactical-match-row + .tactical-match-list). The .premium-match-row,
   .team-upcoming-card, and .daily-match-row families were orphaned by the
   _match_row.html consolidation and have been deleted. */
/* Standings, stats, and zone visuals migrated to data-list.css.
   Legacy classes preserved as JS-write hooks:
   .standings-row--live-provisional, .standings-rank-delta, .standings-rank-delta--up/--down,
   .standings-rank-delta.move-up/.move-down, .live-changed — all styled in data-list.css. */
.live-changed {
  color: var(--live-standings-changed-fg);
  font-weight: var(--live-standings-changed-weight);
  font-variant-numeric: tabular-nums;
}
.standings-rank-delta--up,
.standings-rank-delta.move-up   { color: var(--te-win); }
.standings-rank-delta--down,
.standings-rank-delta.move-down { color: var(--error); }

/* Champion trophy icon next to the team name (no row recolor — the row keeps
   its existing zone tint, typically zone-cl for top-flight league winners). */
.standings-champion-arrow {
  color: var(--te-win);
  margin-left: 0.25rem;
  font-weight: 900;
  font-size: 1.1em;
  vertical-align: top;
  line-height: 1;
}

/* Qualification zone tints migrated to data-list.css (.data-row--zone-*). */

/* Qualification legend (under table; swatches match row zone tokens) */
.standings-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1rem;
  margin: 0;
  background: var(--surface-container-low);
}
.standings-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  max-width: 100%;
}
.legend-color {
  display: inline-block;
  width: 0.8125rem;
  height: 0.8125rem;
  border-radius: 3px;
  flex-shrink: 0;
  border-left: 3px solid transparent;
  box-sizing: content-box;
  /* Small swatches need a crisper edge than table row tints alone */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-surface) 16%, transparent);
}
.legend-color.zone-cl {
  background: color-mix(in srgb, var(--standings-zone-cl-bar) 40%, var(--standings-zone-cl-bg));
  border-left-color: var(--standings-zone-cl-bar);
}
.legend-color.zone-cl-playoff {
  background: color-mix(
    in srgb,
    var(--standings-zone-cl-playoff-bar) 42%,
    var(--standings-zone-cl-playoff-bg)
  );
  border-left-color: var(--standings-zone-cl-playoff-bar);
}
.legend-color.zone-cl-eliminated {
  background: color-mix(
    in srgb,
    var(--standings-zone-cl-eliminated-bar) 48%,
    var(--standings-zone-cl-eliminated-bg)
  );
  border-left-color: var(--standings-zone-cl-eliminated-bar);
}
.legend-color.zone-el {
  background: color-mix(in srgb, var(--standings-zone-el-bar) 40%, var(--standings-zone-el-bg));
  border-left-color: var(--standings-zone-el-bar);
}
.legend-color.zone-ecl {
  background: color-mix(in srgb, var(--standings-zone-ecl-bar) 36%, var(--standings-zone-ecl-bg));
  border-left-color: var(--standings-zone-ecl-bar);
}
.legend-color.zone-relegation {
  background: color-mix(
    in srgb,
    var(--standings-zone-relegation-bar) 44%,
    var(--standings-zone-relegation-bg)
  );
  border-left-color: var(--standings-zone-relegation-bar);
}
.legend-color.zone-playoff {
  background: color-mix(
    in srgb,
    var(--standings-zone-playoff-bar) 45%,
    var(--standings-zone-playoff-bg)
  );
  border-left-color: var(--standings-zone-playoff-bar);
}
.legend-color.zone-promoted {
  background: color-mix(
    in srgb,
    var(--standings-zone-promoted-bar) 40%,
    var(--standings-zone-promoted-bg)
  );
  border-left-color: var(--standings-zone-promoted-bar);
}
.legend-color.zone-promoted-playoff {
  background: color-mix(
    in srgb,
    var(--standings-zone-promoted-playoff-bar) 42%,
    var(--standings-zone-promoted-playoff-bg)
  );
  border-left-color: var(--standings-zone-promoted-playoff-bar);
}

/* Rules panel — auto-derived qualification + relegation explanation below the legend */
.standings-rules {
  padding: 0.875rem 1rem 1rem;
  background: var(--surface-container);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.standings-rules__group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}
.standings-rules__group:last-of-type {
  margin-bottom: 0.5rem;
}
.standings-rules__heading {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--on-surface);
}
.standings-rules__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.standings-rules__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.standings-rules__item .legend-color {
  flex-shrink: 0;
}
.standings-rules__rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 2.5ch;
}
.standings-rules__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--on-surface);
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
}
.standings-rules__tiebreak {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--on-surface-variant);
}

/* Form badges: canonical .form-badge + .premium-form-badge alias — see ANIMATION SYSTEM block */

/* ========== LEAGUE PREDICTIONS ========== */
.league-prob-wrap {
  min-width: 120px;
}
.league-prob-label {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 4px;
}
.league-prob-bar {
  position: relative;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  overflow: hidden;
}
.league-prob-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  transition: width var(--transition-slow);
}
.league-prob-fill--title {
  background: linear-gradient(90deg, var(--prob-title) 0%, color-mix(in srgb, var(--warning) 35%, transparent) 100%);
}
.league-prob-fill--cl {
  background: linear-gradient(90deg, var(--accent-primary) 0%, rgba(66, 133, 244, 0.35) 100%);
}
.league-prob-fill--el {
  background: linear-gradient(90deg, var(--success) 0%, color-mix(in srgb, var(--success) 35%, transparent) 100%);
}
.league-prob-fill--relegation {
  background: linear-gradient(90deg, var(--danger) 0%, color-mix(in srgb, var(--danger) 35%, transparent) 100%);
}
.league-prob-text {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  z-index: 1;
}

/* Tournament knockout predictions: bracket strip + table */
.tournament-predictions-card .tournament-bracket-strip {
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--bg-tertiary);
  background: linear-gradient(180deg, rgba(66, 133, 244, 0.06) 0%, transparent 100%);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
}
.tournament-predictions-card .tournament-bracket-stage {
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.tournament-predictions-card .tournament-bracket-stage--title {
  background: linear-gradient(90deg, color-mix(in srgb, var(--warning) 25%, transparent), var(--bg-tertiary));
  color: var(--text-primary);
}
.tournament-predictions-card .tournament-bracket-chev {
  color: var(--text-muted);
  font-weight: 400;
  user-select: none;
}
.tournament-prob-mobile-label {
  width: 2.75rem;
  flex-shrink: 0;
}

.league-pred-card {
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

/* Prediction / model chips (league + match) */
.prediction-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--badge-pad-y) var(--badge-pad-x);
  border-radius: var(--radius-full);
  font-size: var(--badge-font-size);
  font-weight: var(--font-semibold);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: var(--badge-pad-y) var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--badge-font-size);
  font-weight: var(--font-bold);
  font-variant-numeric: tabular-nums;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

/* ========== HERO ========== */
.premium-hero {
  padding: var(--space-4) 0;
  margin-bottom: var(--section-gap);
}

.premium-hero-title {
  font-size: var(--text-title);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  line-height: 1.2;
}

.premium-hero--fade {
  animation: fade-up 0.45s ease forwards;
}

.type-hero {
  font-size: var(--text-hero);
  font-weight: var(--font-bold);
  line-height: 1.15;
  color: var(--text-primary);
}

.type-section {
  font-size: var(--text-section);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.type-stat {
  font-size: var(--text-stat);
  font-weight: var(--font-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text-primary);
}

/* ========== SECTION TITLE UTILITIES ========== */
/* Standard premium section heading used across all pages */
.premium-section-title {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--te-text-dim);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Page-level title (H1-equivalent, hero banners) */
.type-page-title {
  font-size: var(--text-title);
  font-weight: 800;
  color: var(--te-text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* KPI / stat value — large prominent number */
.type-stat-value {
  font-size: var(--text-2xl);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--te-text);
  line-height: 1.1;
}

/* KPI / stat supporting label — quieter */
.type-stat-label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  color: var(--te-text-dim);
  text-transform: uppercase;
  letter-spacing: var(--te-label-spacing);
}

/* Metadata / support text — secondary hierarchy */
.type-meta {
  font-size: var(--te-label-size);
  color: var(--te-text-dim);
  line-height: 1.4;
  font-weight: 500;
}

/* ========== MAIN CONTENT / LAYOUT SHELL ========== */
.layout-shell,
main.premium-main {
  min-height: calc(100vh - 120px);
  /* Explicit sides: a single `padding` shorthand overwrote the fixed-nav offset because
     `main.premium-main` beats `.premium-main { padding-top }` on specificity. */
  padding-left: var(--layout-padding);
  padding-right: var(--layout-padding);
  padding-bottom: var(--space-6);
  padding-top: calc(var(--premium-nav-offset) + var(--space-5));
  max-width: var(--layout-max-wide);
  margin: 0 auto;
  box-sizing: border-box;
  /* Clip any tab's intrinsic-wide content (heatmap, wide tables, etc.) so it
     can't expand the layout column and shrink the page when other tabs render. */
  overflow-x: clip;
}

/* Inner content width (use with or without Bootstrap .container) */
.layout-container {
  width: 100%;
  max-width: var(--layout-max-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--layout-padding);
  padding-right: var(--layout-padding);
  box-sizing: border-box;
}

.layout-container--narrow {
  max-width: var(--layout-max-narrow);
}

.layout-container--wide {
  max-width: var(--layout-max-analytics);
}

/* Nav / toolbar strip aligned to content column */
.layout-nav-inner {
  max-width: var(--layout-max-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--layout-padding);
  padding-right: var(--layout-padding);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

/* Desktop header: single row; competitions/season left, search + links share remaining width without wrapping or 100vw bleed. */
@media (min-width: 992px) {
  .premium-nav.navbar-expand-lg .navbar-collapse {
    flex: 1 1 0%;
    min-width: 0;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: nowrap;
    justify-content: space-between;
    overflow: visible;
  }
  .premium-nav.navbar-expand-lg .navbar-collapse > ul.navbar-nav {
    flex-shrink: 0;
  }
  .premium-nav.navbar-expand-lg .navbar-brand {
    flex-shrink: 0;
    white-space: nowrap;
    max-width: 100%;
  }
  .premium-nav .nav-toolbar-cluster {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    /* flex-start pins the search to the left of this cluster; nav links use margin-left:auto to sit on the right. */
    justify-content: flex-start;
    flex-wrap: nowrap;
    column-gap: var(--space-2);
    row-gap: 0;
  }
}

/* Tighten nav chrome between lg and xl so the bar fits one row without cropping the search field. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .premium-nav .nav-link {
    padding-left: var(--space-1);
    padding-right: var(--space-1);
  }
  .premium-nav .nav-select {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
  .premium-nav.navbar-expand-lg .navbar-collapse {
    gap: var(--space-1);
  }
  .premium-nav .nav-toolbar-cluster {
    column-gap: var(--space-1);
  }
  .premium-nav .gs-expanding {
    gap: var(--space-2);
  }
}

.premium-footer {
  background: var(--surface-container-low);
  border-top: 1px solid var(--te-border-subtle);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: var(--on-surface-variant);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: auto;
}
.premium-footer__sep {
  margin: 0 var(--space-2);
  color: var(--on-surface-variant);
  opacity: 0.5;
}
.premium-footer__link {
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: color var(--te-transition-base);
}
.premium-footer__link:hover,
.premium-footer__link:focus {
  color: var(--on-surface);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ========== MATCH HEADER ========== */
.premium-match-header {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-bottom: 1px solid var(--bg-elevated);
  padding: var(--space-6) 0;
  margin-bottom: var(--space-6);
}
.premium-match-header .match-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.premium-match-header .score-display {
  font-size: var(--text-stat);
  font-weight: var(--font-bold);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin: var(--space-4) 0;
}

/* Prediction labels / values */
.pred-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
}
.pred-value {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}
.xg-value {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}
.premium-pred-bar-row {
  margin-bottom: var(--space-3);
}
.premium-pred-bar-row:last-child { margin-bottom: 0; }

/* ========== PREDICTION BARS ========== */
.premium-pred-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  overflow: hidden;
}
.premium-pred-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ========== PREMIUM STAT BAR COMPONENT (single mode) ==========
   Canonical single-fill stat bar — used by football/components/_stat_bar_single.html.
   Layout: [ label | track | value ]. Colors come from existing tokens
   (--success, --warning, --danger, --primary-container, --outline-variant).
   No hardcoded colors here. */
.premium-stat-bar {
  display: grid;
  align-items: center;
}

.premium-stat-bar--single {
  grid-template-columns: 120px minmax(0, 1fr) 48px;
  gap: 0.625rem;
}

.premium-stat-bar__label {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--font-medium, 500);
  color: var(--on-surface-variant, var(--text-secondary));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.premium-stat-bar__track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-highest);
  overflow: hidden;
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--on-surface) 8%, transparent);
}

.premium-stat-bar__fill {
  height: 100%;
  border-radius: 999px;
  min-width: 3px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 20%, transparent);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-stat-bar__value {
  font-size: clamp(0.75rem, calc(0.65rem + var(--pct, 0) * 0.005rem), 1.05rem);
  font-weight: clamp(600, calc(600 + var(--pct, 0) * 3), 900);
  text-align: right;
  color: var(--on-surface, var(--text-primary));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .premium-stat-bar__fill { transition: none; }
}

.premium-theme .table {
  color: var(--text-primary);
}
.premium-theme .table-light {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.premium-main .table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--bg-elevated);
}
.premium-main .table td {
  border-color: var(--bg-tertiary);
}
.premium-main .card {
  background: var(--bg-secondary);
  border-color: var(--bg-tertiary);
  color: var(--text-primary);
}
.premium-main .card-header {
  background: var(--bg-tertiary);
  border-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ========== CONSISTENT NAVIGATION LINKS ========== */
/* Team links: wrap logo + name in single <a class="lu-link-team"> or span with role="link" */
.lu-link-team {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-base), text-decoration-color var(--transition-base);
}
.lu-link-team:hover {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lu-link-team:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Player links: entire badge/row clickable */
.lu-link-player {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition-fast), color var(--transition-base), text-decoration-color var(--transition-base);
}
.lu-link-player:hover {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lu-link-player:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Competitions nav: nested dropdown (country → competitions) opens to the right */
.premium-nav .dropdown-menu .dropend .dropdown-menu,
.app-sidebar .dropdown-menu .dropend .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: 0;
  margin-left: 0;
  /* Overlap parent edge slightly so the pointer never crosses an empty gap (avoids accidental close). */
  transform: translateX(calc(-1 * var(--space-1)));
  min-width: 12rem;
  z-index: 1085;
}
.premium-nav .dropdown .dropdown-menu,
.app-sidebar .dropdown .dropdown-menu {
  overflow: visible;
}

/* Country identity badge — domain primitive used by the competitions nav and the
   league hero. flagcdn flag for real countries; globe for International ("World",
   e.g. World Cup / Friendlies); neutral box for an unmapped land. No hex. */
.country-flag {
  display: inline-block;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--te-border-subtle);
}
.country-flag--missing {
  background: var(--surface-container-high);
}
.country-flag--world {
  background: var(--surface-container-high);
}
.country-flag--world::after {
  content: "\1F30D";
  display: block;
  font-size: 12px;
  line-height: 15px;
  text-align: center;
}
.country-flag--inline {
  width: 18px;
  height: 13px;
  margin-right: 6px;
  vertical-align: -2px;
}
.premium-nav .nav-country-label {
  min-width: 0;
}
.premium-nav .nav-country-trigger {
  width: 100%;
  box-sizing: border-box;
}
.premium-nav .nav-country-chevron {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--on-surface-variant);
  line-height: 1;
  user-select: none;
}

/* ========== GLOBAL SEARCH ========== */
/* Moved from inline base.html <style> block — 2026-04-10 */

/* Alpine cloak: hide x-cloak elements until Alpine initialises */
[x-cloak] { display: none !important; }

/* Mobile top row: search between brand and toggler (not full-width second row) */
.gs-mobile-header-slot {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  box-sizing: border-box;
}

.gs-wrap {
  position: relative;
  width: 100%;
}

/* .gs-input-wrap / .gs-input / .gs-input:focus / .gs-input::placeholder
   moved to components/tactical-controls.css (single source of truth). */

/* Search results panel — positioned against the input wrap. Chrome lives on .tactical-popover. */
.gs-dropdown {
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-elevated) transparent;
}

/* Section headers */
.gs-section-label {
  padding: 6px var(--space-3) 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Individual result rows */
.gs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.gs-row:last-child { border-bottom: none; }
.gs-row:hover,
.gs-row.is-active {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.gs-row.is-active { background: var(--accent-tint); }

/* Logo/avatar thumbnails */
.gs-thumb {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.gs-thumb-placeholder {
  width: 26px;
  height: 26px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}


/* Empty state */
.gs-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Mode header (live / h2h) */
.gs-mode-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px 6px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

/* ---- Search dropdown — uses theme tokens via bridge, no overrides needed ---- */
/* theme-light is now the default, so no html.theme-light overrides required.
   Dark mode overrides (html.theme-dark) are handled by the token bridge above. */
html.theme-dark .gs-mode-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-subtle);
  color: var(--text-secondary);
}

/* ============================================================
   TACTICAL EDGE — Utility & Component Classes
   Added: 2026-04-11 | Refactor: Tactical Edge Visual System
   ============================================================ */

/* ---- Section label — the editorial "Live Now", "Rankings" etc. ---- */
.section-label,
.te-section-label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.te-section-label--accent {
  color: var(--accent-primary);
}

/* ---- Tactical Edge generic card wrapper ---- */
.te-card {
  background: var(--te-card-bg);
  border-radius: var(--te-radius-lg);
  overflow: hidden;
  box-shadow: var(--te-shadow-sm);
  transition: background var(--te-transition-base), box-shadow var(--te-transition-base);
}
.te-card:hover {
  background: var(--te-card-bg-hover);
  box-shadow: var(--te-shadow-md);
}
.te-card h2,
.te-card h3,
.te-card h4 {
  font-weight: 700;
  color: var(--te-text);
  margin-bottom: 0;
}
.te-card .label,
.te-card .te-label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--te-text-dim);
}

/* ---- Status badge — replaces plain text status strings ---- */
.te-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--te-radius-full);
  font-size: var(--te-label-size);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.te-badge--live {
  background: var(--te-error-tint);
  color: var(--danger);
}
.te-badge--live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-live 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
.te-badge--ft {
  background: var(--te-card-bg-hover);
  color: var(--te-muted);
}
.te-badge--ht {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  color: var(--warning);
}
.te-badge--ns {
  background: var(--surface-container-low);
  color: var(--te-text-dim);
}
.te-badge--primary {
  background: var(--te-accent-tint);
  color: var(--accent-primary);
}

/* ---- Stat display — big number + label pair ---- */
.te-stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--te-text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.te-stat-value--lg {
  font-size: 2.5rem;
}
.te-stat-value--accent {
  color: var(--accent-primary);
}
.te-stat-label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--te-text-dim);
}

/* ---- Probability bar ---- */
.te-prob-bar {
  height: 6px;
  border-radius: var(--te-radius-full);
  background: var(--surface-container-high);
  overflow: hidden;
}
.te-prob-bar__fill {
  height: 100%;
  border-radius: var(--te-radius-full);
  background: var(--te-bar-gradient);
  transition: width 0.6s ease;
}

/* ---- Player rating chip ---- */
.te-rating-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: var(--te-radius-sm);
  font-size: var(--te-label-size);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: var(--te-accent-tint);
  color: var(--accent-primary);
}
.te-rating-chip--high { background: var(--te-win-bg); color: var(--te-win); }
.te-rating-chip--low  { background: var(--te-loss-bg); color: var(--te-loss); }

/* ---- Tab navigation ---- */
.te-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--te-border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.te-tabs::-webkit-scrollbar { display: none; }
.te-tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--te-text-dim);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--te-transition-fast), border-color var(--te-transition-fast);
  white-space: nowrap;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}
.te-tab:hover { color: var(--te-text); }
.te-tab.active,
.te-tab[aria-selected="true"] {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* ---- Inline position / league badge chip ---- */
.te-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--te-radius-full);
  font-size: var(--te-label-size);
  font-weight: 700;
  background: var(--surface-container-high);
  color: var(--te-text-dim);
}
.te-chip--accent {
  background: var(--te-accent-tint);
  color: var(--accent-primary);
}

/* ---- Empty state ---- */
.te-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-4);
  color: var(--te-text-dim);
  font-size: var(--text-sm);
  text-align: center;
}
.te-empty-state__icon {
  font-size: 2rem;
  opacity: 0.35;
}

.te-empty-state__headline {
  margin: 0;
  color: var(--te-text);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1.35;
}

.te-empty-state__hint {
  margin: 0;
  color: var(--te-text-dim);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.45;
  max-width: 36ch;
}

/* ---- Live dot pulse (standalone, e.g. in nav) ---- */
.te-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-live 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

.te-live-dot--md {
  width: 10px;
  height: 10px;
}

/* ---- Main content offset for fixed nav ---- */
/* Top inset is on `main.premium-main` above (higher specificity). */

/* ---- Expanding inline search wrapper ---- */
.gs-expanding {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  overflow: visible;
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 992px) {
  .premium-nav .gs-expanding {
    flex: 1 1 auto;
  }
}
.nav-links-hideable {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-1);
  transition: opacity var(--te-transition-expand), max-width var(--te-transition-expand);
  /* Must stay visible: Staff + other .dropdown-menu panels are clipped if hidden (Bootstrap positions them outside the row). */
  overflow: visible;
  max-width: none;
  min-width: 0;
  flex: 0 0 auto;
  justify-content: flex-start;
}
@media (min-width: 992px) {
  .premium-nav .nav-links-hideable {
    margin-left: auto;
  }
}
@media (min-width: 992px) {
  /* Only collapse nav text when the search field is focused — not when a nav link has focus (focus-within on .gs-expanding broke link clicks). */
  .gs-expanding:has(.gs-input:focus) .nav-links-hideable {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
  }
}

/* Inline search — left edge pinned; width animates rightward on focus (not flex-grow, which shifts the field). */
.gs-inline-wrap {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: clamp(200px, 22vw, 280px);
  max-width: 100%;
  min-width: 0;
  transition: width var(--te-transition-expand);
}
.gs-inline-wrap:has(.gs-input:focus) {
  z-index: 1080;
  width: min(720px, 100%);
  max-width: 100%;
}
.gs-inline-wrap .gs-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.gs-inline-wrap .gs-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.gs-inline-wrap .gs-dropdown {
  left: auto;
  right: 0;
  width: min(100%, 720px);
  max-width: min(92vw, 720px);
  min-width: min(100%, 320px);
}

/* Mobile: hide inline search; header-slot search uses d-lg-none in template */
@media (max-width: 991.98px) {
  .gs-inline-wrap { display: none !important; }
  .premium-nav.navbar-expand-lg .navbar-collapse {
    overflow: visible;
  }
  .gs-mobile-header-slot .gs-wrap:focus-within {
    position: relative;
    z-index: 1080;
  }
}

/* ---- Probability / prediction bars ---- */
.te-pred-bar-wrap {
  width: 100%;
  height: 6px;
  border-radius: var(--te-radius-full);
  background: var(--surface-container-high);
  overflow: hidden;
}
.te-pred-bar-fill {
  height: 100%;
  background: var(--te-bar-gradient);
  border-radius: var(--te-radius-full);
  transition: width 0.6s ease;
}

/* ========== QUICK PREDICTION WIDGET ========== */
.pred-widget {
  --pw-input-w: 2.5rem;
  background: var(--surface-container);
  border-radius: var(--te-radius-md);
  padding: 0.5rem;
  box-shadow: var(--te-shadow-ambient);
  display: grid;
  gap: 0.35rem;
  transition: transform var(--te-transition-fast), box-shadow var(--te-transition-fast), background var(--te-transition-fast);
}

.pred-widget--detail {
  padding: 0.9rem;
  gap: 0.7rem;
}

.pred-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pred-widget__title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--te-text);
}

.pred-widget__match-head {
  display: grid;
  gap: 0.18rem;
}

.pred-widget__teams {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.pred-widget__team-name {
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--te-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pred-widget__vs {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  text-transform: uppercase;
  letter-spacing: var(--te-label-spacing);
  color: var(--te-text-dim);
  flex: 0 0 auto;
}

.pred-widget__subhead {
  font-size: var(--te-label-size);
  font-weight: 700;
  color: var(--te-text-dim);
}

.pred-widget__form {
  display: grid;
  gap: 0.75rem;
}

.pred-widget__label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  text-transform: uppercase;
  letter-spacing: var(--te-label-spacing);
  color: var(--te-text-dim);
}

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

.pred-widget__feedback {
  border-radius: var(--te-radius-sm);
  padding: 0.28rem 0.45rem;
  font-size: var(--te-label-size);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pred-widget__feedback--error {
  background: var(--te-error-tint);
  color: var(--error);
}

.pred-widget__feedback--success {
  background: var(--te-win-bg);
  color: var(--te-win);
}

.pred-widget__vote-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.2rem;
}

.pred-widget__vote-btn {
  min-height: 1.55rem;
  border: 0;
  border-radius: var(--te-radius-sm);
  background: var(--surface-container-high);
  color: var(--te-text-dim);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform var(--te-transition-fast), background var(--te-transition-fast), color var(--te-transition-fast), box-shadow var(--te-transition-fast);
}

.pred-widget__vote-btn:hover {
  background: var(--surface-container-highest);
  color: var(--te-text);
  transform: translateY(-1px);
}

.pred-widget__vote-btn:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 1px;
}

.pred-widget__vote-btn.is-selected {
  color: var(--on-primary);
  background: var(--primary-container);
  box-shadow: var(--te-shadow-sm);
}

.pred-widget__vote-btn.is-selected.is-home {
  background: var(--te-win);
  color: var(--on-primary);
}

.pred-widget__vote-btn.is-selected.is-draw {
  background: var(--secondary);
  color: var(--on-primary);
}

.pred-widget__vote-btn.is-selected.is-away {
  background: var(--error);
  color: var(--on-primary);
}

.pred-widget__score-form {
  display: grid;
  grid-template-columns: var(--pw-input-w) auto var(--pw-input-w) auto;
  gap: 0.24rem;
  align-items: center;
}

.pred-widget__score-input {
  width: 100%;
  min-height: 1.55rem;
  border: 0;
  border-radius: var(--te-radius-sm);
  background: var(--surface-container-high);
  color: var(--te-text);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  padding: 0.14rem 0.2rem;
}

.pred-widget__score-input:focus {
  outline: 2px solid var(--primary-container);
  outline-offset: 1px;
}

.pred-widget__score-sep {
  font-weight: 900;
  color: var(--te-text-dim);
  font-size: 0.72rem;
}

.pred-widget__score-btn {
  min-height: 1.55rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-container-high);
  color: var(--te-text);
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background var(--te-transition-fast), transform var(--te-transition-fast), color var(--te-transition-fast), box-shadow var(--te-transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pred-widget__score-btn:hover {
  background: var(--primary-container);
  color: var(--on-primary);
  transform: translateY(-1px);
}

.pred-widget__save-icon {
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
}

.pred-widget__save-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.pred-widget__meta {
  font-size: var(--te-label-size);
  color: var(--te-text-dim);
  font-weight: 600;
  margin: 0;
}

.pred-widget__subhead--compact {
  margin: 0;
}

.pred-widget__meta--locked {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pred-widget__status {
  display: grid;
  gap: 0.3rem;
  background: var(--surface-container);
  border-radius: var(--te-radius-sm);
  padding: 0.5rem;
}

.pred-widget__status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.pred-widget__status-label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  text-transform: uppercase;
  letter-spacing: var(--te-label-spacing);
  color: var(--te-text-dim);
}

.pred-widget__status-value {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--te-text);
  font-variant-numeric: tabular-nums;
}

.pred-widget__state-chip,
.pred-widget__points-chip {
  display: inline-flex;
  align-items: center;
  border-radius: var(--te-radius-full);
  padding: 0.2rem 0.5rem;
  font-size: var(--te-label-size);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--surface-container);
  color: var(--te-text);
}

.pred-widget__state-chip.is-home {
  background: var(--te-win-bg);
  color: var(--te-win);
}

.pred-widget__state-chip.is-draw {
  background: var(--te-draw-bg);
  color: var(--te-draw);
}

.pred-widget__state-chip.is-away {
  background: var(--te-error-tint);
  color: var(--error);
}

.pred-widget__points-chip {
  background: var(--te-win-bg);
  color: var(--te-win);
}

.pred-widget__points-chip.is-zero {
  background: var(--surface-container);
  color: var(--te-text-dim);
}

.pred-widget__community {
  display: grid;
  gap: 0.25rem;
}

.pred-widget__community.is-empty {
  background: var(--surface-container);
  border-radius: var(--te-radius-sm);
  padding: 0.45rem;
}

.pred-widget__community-track {
  display: flex;
  height: 0.48rem;
  border-radius: var(--te-radius-full);
  overflow: hidden;
  background: var(--surface-container-high);
}

.pred-widget__community-segment.is-home {
  background: var(--te-win);
}

.pred-widget__community-segment.is-draw {
  background: var(--te-draw);
}

.pred-widget__community-segment.is-away {
  background: var(--error);
}

.pred-widget__community-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.pred-widget__community-item {
  font-size: var(--te-label-size);
  font-weight: 800;
  color: var(--te-text-dim);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pred-widget__community-item.is-home {
  color: var(--te-win);
}

.pred-widget__community-item.is-draw {
  color: var(--te-text-dim);
}

.pred-widget__community-item.is-away {
  color: var(--error);
}

.pred-widget__community-count {
  text-align: right;
  font-size: var(--te-label-size);
  color: var(--te-text-dim);
  font-weight: 600;
}

.pred-widget-mount {
  margin: 0;
}

.pred-widget-mount--tight {
  margin: 0;
}


.pred-widget:hover {
  transform: translateY(-1px);
  background: var(--surface-container-high);
  box-shadow: 0 22px 46px color-mix(in srgb, var(--shadow-color) 10%, transparent);
}

.pred-widget:focus-within {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-container) 30%, transparent), var(--te-shadow-ambient);
}

.pred-widget.is-saving .pred-widget__score-btn {
  opacity: 0.7;
}

.pred-widget.is-saved .pred-widget__score-btn {
  background: var(--te-win);
  color: var(--on-primary);
}

.pred-widget__locked-link {
  min-height: 4.75rem;
  border-radius: var(--te-radius-sm);
  background: var(--surface-container-high);
  color: var(--te-text);
  text-decoration: none;
  display: grid;
  place-items: center;
  gap: 0.1rem;
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  text-transform: uppercase;
  letter-spacing: var(--te-label-spacing);
}

.pred-widget__locked-icon {
  font-size: 0.68rem;
  color: var(--te-text-dim);
}

.pred-widget__locked-link:hover {
  color: var(--te-text);
  background: var(--surface-container-highest);
}

.pred-widget__locked-text {
  color: var(--primary-container);
}

.pred-widget__community-empty {
  font-size: var(--te-label-size);
  font-weight: 700;
  color: var(--te-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0.2rem 0;
}

@media (max-width: 767.98px) {
  .pred-widget__team-name {
    font-size: 0.73rem;
  }

  .pred-widget--detail .pred-widget__score-form {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 479.98px) {
  .pred-widget {
    --pw-input-w: 2rem;
    padding: 0.48rem;
  }

  .pred-widget__vote-group {
    grid-template-columns: 1fr;
    gap: 0.22rem;
  }

  .pred-widget__vote-btn {
    min-height: 1.9rem;
    font-size: 0.64rem;
    padding: 0.26rem 0.25rem;
  }

  .pred-widget__score-form {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    gap: 0.28rem;
  }

  .pred-widget__score-btn {
    width: 1.65rem;
  }

  .pred-widget__community-inline {
    gap: 0.15rem;
  }
}

.matches-page-title {
  margin-bottom: var(--space-3);
}

.daily-filters-form {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--surface-container-low);
  border-radius: var(--te-radius-lg);
  box-shadow: var(--te-shadow-ambient);
}

.daily-filters-form__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.daily-filters-form__item {
  min-width: 10rem;
}

.daily-filters-form .form-label {
  margin-bottom: 0.35rem;
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--te-text-dim);
}

.daily-filters-form .form-select,
.daily-filters-form .form-control {
  border: 0;
  background: var(--surface-container);
  color: var(--te-text);
}

.daily-filters-form .form-select:focus,
.daily-filters-form .form-control:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-container) 25%, transparent);
}

.daily-filters-form__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

@media (max-width: 767.98px) {
  .daily-filters-form__grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .daily-filters-form__item {
    min-width: 0;
  }

  .daily-filters-form__actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .daily-league-header {
    transition: none;
  }
}

/* ---- Form badges — updated to te-win/loss/draw tokens ---- */
.form-badge--w { background: var(--te-win-bg);  color: var(--te-win);  }
.form-badge--d { background: var(--te-draw-bg); color: var(--te-draw); }
.form-badge--l { background: var(--te-loss-bg); color: var(--te-loss); }
.premium-form-badge.w { background: var(--te-win-bg);  color: var(--te-win);  }
.premium-form-badge.d { background: var(--te-draw-bg); color: var(--te-draw); }
.premium-form-badge.l { background: var(--te-loss-bg); color: var(--te-loss); }

/* High-contrast fixture tips in standings form (W/D/L) */
.form-badge--fixture-tip.form-badge--w,
.form-badge--fixture-tip.form-badge--d,
.form-badge--fixture-tip.form-badge--l {
  color: var(--on-primary);
  font-weight: 800;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--on-surface) 10%, transparent);
}

.form-badge--fixture-tip.form-badge--w { background: var(--te-win); }
.form-badge--fixture-tip.form-badge--d { background: var(--te-draw); }
.form-badge--fixture-tip.form-badge--l { background: var(--te-loss); }

/* Legacy .match-status-badge overrides and .match-status-badge-dot removed —
   replaced by .status-badge + .status-badge__dot in _cards_badges.css. */

/* ---- Bare heading defaults inside page sections ---- */
.layout-shell h1,
.layout-shell h2,
.layout-shell h3,
.layout-shell h4,
.layout-shell h5 {
  color: var(--te-text);
}
.layout-shell p {
  color: var(--te-text-dim);
}
.layout-shell small,
.layout-shell .small {
  font-size: var(--text-xs);
  color: var(--te-muted);
}

/* ---- xG / advanced metric value ---- */
.te-xg-value {
  font-weight: 800;
  color: var(--te-text);
  font-variant-numeric: tabular-nums;
}
.te-xg-label {
  font-size: var(--te-label-size);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--te-text-dim);
  text-transform: uppercase;
}

/* ---- League Explorer (staff): inline search + status chips ---- */
.league-explorer-row--activated,
.data-list > .data-row.league-explorer-row--activated:nth-child(even),
.data-list > .data-row.league-explorer-row--activated:hover {
  background: var(--te-win-bg);
}

.league-explorer-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.45rem;
  border-radius: var(--te-radius-sm);
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
}

.league-explorer-status-pill--yes {
  color: var(--te-win);
  background: color-mix(in srgb, var(--te-win) 18%, transparent);
}

.league-explorer-status-pill--no {
  color: var(--on-surface-variant);
  background: var(--surface-container-high);
}

.league-explorer-msg {
  font-size: var(--text-xs);
}

.league-explorer-msg--error {
  color: var(--error);
}

.league-explorer-msg--success {
  color: var(--te-win);
}

/* ========== USER PROFILE PAGE ========== */

/* Hero card */
.profile-hero {
  position: relative;
  overflow: hidden;
}
.profile-hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 18%, transparent) 0%,
    transparent 60%
  );
  pointer-events: none;
}
.profile-hero__body {
  position: relative;
  z-index: 1;
}

/* Avatar */
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: var(--font-bold);
  flex-shrink: 0;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent);
}

/* Username */
.profile-username {
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* .profile-badge / .profile-points-pill removed — markup migrated to
   .status-badge--{you|gold|silver|bronze|muted} and .stat-card--centered. */

/* Accuracy progress bar */
.profile-progress {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--surface-container-high);
  overflow: hidden;
}
.profile-progress__winner {
  background: color-mix(in srgb, var(--primary) 55%, transparent);
}
.profile-progress__exact {
  background: var(--te-win);
}
.profile-legend {
  font-size: 0.7rem;
  font-weight: var(--font-semibold);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
}
.profile-legend::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.profile-legend--exact::before  { background: var(--te-win); }
.profile-legend--winner::before { background: color-mix(in srgb, var(--primary) 55%, transparent); }

/* .profile-stat-card removed — markup migrated to .stat-card--centered. */

/* Predictions table */
.profile-predictions-table thead th {
  font-size: 0.72rem;
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--te-border-subtle);
  background: transparent;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.profile-pred-row td {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid color-mix(in srgb, var(--te-border-subtle) 60%, transparent);
  vertical-align: middle;
}
.profile-pred-row:last-child td {
  border-bottom: none;
}
.profile-team-names {
  font-size: 0.87rem;
}
.profile-league-tag {
  font-size: 0.68rem;
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  background: var(--surface-container-high);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score chips */
.profile-score-chip {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-md);
  font-weight: var(--font-bold);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.profile-score-chip--pred {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
.profile-score-chip--vote {
  background: color-mix(in srgb, var(--secondary) 15%, transparent);
  color: var(--secondary);
}
.profile-score-chip--result {
  background: var(--surface-container-high);
  color: var(--text-primary);
}

/* .profile-pts-badge and .profile-status-badge removed —
   markup migrated to .status-badge--{success|info|muted|exact|correct|wrong|pending|open}. */

/* Profile inline vote buttons */
.profile-vote-form {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.profile-vote-group {
  display: flex;
  gap: 4px;
}
.profile-vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: 1px solid var(--te-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-container);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: background var(--te-transition-fast), color var(--te-transition-fast),
              border-color var(--te-transition-fast), transform var(--te-transition-fast);
  letter-spacing: 0.03em;
}
.profile-vote-btn:hover {
  background: var(--surface-container-high);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.profile-vote-btn.is-selected.is-home {
  background: color-mix(in srgb, var(--te-win) 18%, transparent);
  border-color: var(--te-win);
  color: var(--te-win);
}
.profile-vote-btn.is-selected.is-draw {
  background: color-mix(in srgb, var(--te-draw) 18%, transparent);
  border-color: var(--te-draw);
  color: var(--te-draw);
}
.profile-vote-btn.is-selected.is-away {
  background: color-mix(in srgb, var(--error) 14%, transparent);
  border-color: var(--error);
  color: var(--error);
}
.profile-vote-error {
  font-size: 0.68rem;
  color: var(--error);
}

/* Profile community mini bar */
.profile-community-mini {
  min-width: 100px;
}
.profile-community-track {
  display: flex;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--surface-container-high);
  gap: 1px;
}
.profile-community-seg {
  height: 100%;
  transition: width 0.3s ease;
  min-width: 3px;
}
.profile-community-seg.is-home { background: var(--te-win); }
.profile-community-seg.is-draw { background: var(--te-draw); }
.profile-community-seg.is-away { background: var(--error); }

.profile-community-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 0.65rem;
  font-weight: var(--font-semibold);
}
.profile-community-labels .pcc-home { color: var(--te-win); }
.profile-community-labels .pcc-draw { color: var(--te-draw); }
.profile-community-labels .pcc-away { color: var(--error); }

.profile-community-count {
  font-size: 0.62rem;
  color: var(--text-secondary);
  margin-top: 2px;
  text-align: center;
}

/* ============================================================
   PW2 — Redesigned Prediction Widget v2
   ============================================================ */

/* ── Card wrapper ── */
.pred-widget {
  container-type: inline-size;
}

/* ── Match header ── */
.pw2-header {
  display: grid;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
}

.pw2-competition {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--te-text-dim);
  text-align: center;
}

.pw2-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.pw2-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.pw2-team--away {
  align-items: center;
}

.pw2-team__name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--te-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.01em;
}

.pw2-vs-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.pw2-vs {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--te-text-dim);
  text-transform: uppercase;
}

.pw2-kickoff {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--te-text-dim);
  background: var(--surface-container-high);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Section divider ── */
.pw2-divider {
  height: 1px;
  background: var(--te-border-subtle, color-mix(in srgb, var(--te-text-dim) 15%, transparent));
  border: none;
  margin: 0;
}

/* ── Most-likely outcome highlight banner (DOMINANT) ── */
.pw2-highlight {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: var(--te-radius-md);
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  animation: pw2-fade-in 0.35s ease;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 10px color-mix(in srgb, currentColor 10%, transparent);
}

.pw2-highlight--home {
  background: color-mix(in srgb, var(--te-win) 14%, transparent);
  color: var(--te-win);
  border-color: color-mix(in srgb, var(--te-win) 30%, transparent);
}

.pw2-highlight--away {
  background: color-mix(in srgb, var(--error) 14%, transparent);
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 30%, transparent);
}

.pw2-highlight--draw {
  background: color-mix(in srgb, var(--secondary) 14%, transparent);
  color: var(--on-surface-variant);
  border-color: color-mix(in srgb, var(--secondary) 25%, transparent);
}

.pw2-highlight__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pw2-highlight__text {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
}

.pw2-highlight__text strong {
  font-weight: 900;
  font-size: 0.85rem;
}

.pw2-highlight__pct {
  font-size: 1.35rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

/* ── Step label above vote grid ── */
.pw2-step-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--te-text-dim);
}

/* ── 3 large vote cards ── */
.pw2-vote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.pw2-vote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border: 1.5px solid color-mix(in srgb, var(--te-text-dim) 15%, transparent);
  border-radius: var(--te-radius-md);
  background: var(--surface-container-high);
  color: var(--te-text-dim);
  padding: 0.65rem 0.3rem 0.55rem;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
  min-width: 0;
  overflow: hidden;
}

.pw2-vote-card:hover {
  transform: translateY(-2px);
  background: var(--surface-container-highest);
  color: var(--te-text);
  border-color: color-mix(in srgb, var(--te-text-dim) 30%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--on-surface) 10%, transparent);
}

.pw2-vote-card:active {
  transform: scale(0.97);
}

.pw2-vote-card:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 2px;
}

/* Leading card — visually prominent even before user picks */
.pw2-vote-card.is-leader {
  border-color: color-mix(in srgb, currentColor 35%, transparent);
  box-shadow: 0 2px 8px color-mix(in srgb, currentColor 12%, transparent);
  transform: translateY(-1px);
}

.pw2-vote-card--home.is-leader {
  color: var(--te-win);
  background: color-mix(in srgb, var(--te-win) 8%, var(--surface-container-high));
}

.pw2-vote-card--draw.is-leader {
  color: var(--on-surface-variant);
  background: color-mix(in srgb, var(--secondary) 8%, var(--surface-container-high));
}

.pw2-vote-card--away.is-leader {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 8%, var(--surface-container-high));
}

/* Selected states — strong, unmistakable */
.pw2-vote-card--home.is-selected {
  background: color-mix(in srgb, var(--te-win) 18%, transparent);
  border-color: var(--te-win);
  border-width: 2px;
  color: var(--te-win);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--te-win) 22%, transparent),
              0 4px 16px color-mix(in srgb, var(--te-win) 18%, transparent);
  transform: translateY(-1px);
}

.pw2-vote-card--draw.is-selected {
  background: color-mix(in srgb, var(--secondary) 18%, transparent);
  border-color: var(--secondary);
  border-width: 2px;
  color: var(--on-surface-variant);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 22%, transparent),
              0 4px 16px color-mix(in srgb, var(--secondary) 18%, transparent);
  transform: translateY(-1px);
}

.pw2-vote-card--away.is-selected {
  background: color-mix(in srgb, var(--error) 18%, transparent);
  border-color: var(--error);
  border-width: 2px;
  color: var(--error);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 22%, transparent),
              0 4px 16px color-mix(in srgb, var(--error) 18%, transparent);
  transform: translateY(-1px);
}

/* Selected check badge */
.pw2-vote-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
  font-size: 0.6rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.85;
}

.pw2-vote-card__draw-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.pw2-vote-card__label {
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.02em;
}

.pw2-vote-card__pct {
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Leading team dot indicator — larger, more visible */
.pw2-vote-card__leader-dot {
  position: absolute;
  top: 0.32rem;
  left: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  animation: pw2-pulse 2s infinite;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 25%, transparent);
}

/* ── Score section ── */
.pw2-score-section {
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-container-high);
  border-radius: var(--te-radius-md);
  border: 1px solid color-mix(in srgb, var(--te-text-dim) 12%, transparent);
}

.pw2-score-section__label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--te-text-dim);
}

.pw2-score-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.pw2-score-row__label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--te-text-dim);
  flex-shrink: 0;
}

.pw2-score-row__inputs {
  display: flex;
  align-items: center;
  gap: 0.24rem;
}

/* ── Login CTA ── */
.pw2-login-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--te-radius-md);
  padding: 0.75rem;
  background: var(--surface-container-high);
  color: var(--te-text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid color-mix(in srgb, var(--te-text-dim) 15%, transparent);
  transition: background 150ms ease, color 150ms ease, transform 120ms ease, border-color 150ms ease;
}

.pw2-login-cta:hover {
  background: color-mix(in srgb, var(--primary-container) 12%, var(--surface-container-high));
  color: var(--te-text);
  border-color: var(--primary-container);
  transform: translateY(-1px);
}

.pw2-login-cta__icon {
  font-size: 1.1rem;
}

/* ── Community bar (pw2) — stronger impact ── */
.pw2-community {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.1rem;
}

.pw2-community.is-empty {
  /* still render, just shows empty state */
}

.pw2-community__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--te-text-dim);
}

.pw2-community__track {
  display: flex;
  height: 0.6rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-container-high);
  gap: 2px;
}

.pw2-community__seg {
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.pw2-community__seg.is-home {
  background: var(--te-win);
}

.pw2-community__seg.is-draw {
  background: color-mix(in srgb, var(--secondary) 70%, var(--outline));
}

.pw2-community__seg.is-away {
  background: var(--error);
}

/* Leading segment gets a subtle shine */
.pw2-community__seg.is-leader {
  filter: brightness(1.08);
}

.pw2-community__labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pw2-community__lbl {
  font-size: 0.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}

.pw2-community__lbl-name {
  font-size: 0.55rem;
  font-weight: 600;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pw2-community__lbl.is-home { color: var(--te-win); }
.pw2-community__lbl.is-draw { color: var(--on-surface-variant); }
.pw2-community__lbl.is-away { color: var(--error); }

/* Leading percentage gets extra weight */
.pw2-community__lbl.is-leading {
  font-size: 0.8rem;
  transform: scale(1.05);
  transform-origin: center;
}

.pw2-community__count {
  flex-shrink: 0;
  font-size: 0.6rem;
  color: var(--te-text-dim);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Animations ── */
@keyframes pw2-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pw2-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* ── Responsive tweaks ── */
@container (max-width: 280px) {
  .pw2-matchup {
    grid-template-columns: 1fr auto 1fr;
  }
  .pw2-team__logo-wrap { width: 2rem; height: 2rem; }
  .pw2-vote-card__logo-wrap { width: 1.5rem; height: 1.5rem; }
  .pw2-vote-card__pct { font-size: 0.8rem; }
  .pw2-highlight__pct { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .pw2-vote-grid {
    gap: 0.25rem;
  }
  .pw2-vote-card {
    padding: 0.45rem 0.2rem 0.35rem;
  }
}

/* ============================================================
   GLOBAL NAVBAR RESTYLE — 2026-04-22
   Cleaner spacing, bolder brand, tighter controls, no blur (perf).
   ============================================================ */
.premium-nav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--surface-container) !important;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--on-surface) 6%, transparent) !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
.premium-nav .premium-nav-inner {
  gap: 16px;
  padding: 0 20px;
}

/* Brand — stronger, modern */
.premium-nav .logo,
.premium-nav .navbar-brand {
  font-size: 1.2rem !important;
  font-weight: 900 !important;
  font-style: normal !important;
  letter-spacing: -0.02em !important;
  color: var(--on-surface) !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}
.premium-nav .logo::before,
.premium-nav .navbar-brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary-container), color-mix(in srgb, var(--primary-container) 60%, var(--error) 40%));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-container) 40%, transparent);
  display: inline-block;
  flex-shrink: 0;
}
.premium-nav .logo:hover,
.premium-nav .navbar-brand:hover {
  color: var(--primary-container) !important;
  opacity: 1;
}

/* Nav links — cleaner, with rounded active state instead of underline */
.premium-nav .nav-link {
  color: var(--on-surface-variant) !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  border-bottom: 0 !important;
  transition: background 140ms ease, color 140ms ease !important;
}
.premium-nav .nav-link:hover {
  color: var(--on-surface) !important;
  background: color-mix(in srgb, var(--on-surface) 6%, transparent) !important;
  border-bottom: 0 !important;
}
.premium-nav .nav-link.active,
.premium-nav .nav-link[aria-current="page"] {
  color: var(--primary-container) !important;
  background: color-mix(in srgb, var(--primary-container) 12%, transparent) !important;
  border-bottom: 0 !important;
}

/* Dropdown trigger buttons (Competitions / Season 2025 / Staff / Admin) */
.premium-nav .nav-select {
  background: color-mix(in srgb, var(--on-surface) 5%, transparent) !important;
  border: 0 !important;
  color: var(--on-surface) !important;
  padding: 7px 12px !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  transition: background 140ms ease !important;
}
.premium-nav .nav-select:hover,
.premium-nav .nav-select:focus {
  background: color-mix(in srgb, var(--primary-container) 12%, transparent) !important;
  color: var(--on-surface) !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Nav group separator — subtle */
.premium-nav .nav-group-separator {
  width: 1px;
  height: 20px;
  background: color-mix(in srgb, var(--on-surface) 12%, transparent);
  margin: 0 6px;
}

/* Global search — wider, softer, rounded */
.premium-nav .gs-wrap {
  min-width: 240px;
  max-width: 340px;
}
.premium-nav .gs-input-wrap {
  position: relative;
}
.premium-nav .gs-input {
  background: color-mix(in srgb, var(--on-surface) 5%, transparent) !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 9px 16px 9px 38px !important;
  font-size: 0.8125rem !important;
  color: var(--on-surface) !important;
  width: 100%;
  transition: background 140ms ease, box-shadow 140ms ease !important;
}
.premium-nav .gs-input:focus {
  background: var(--surface-container) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-container) 50%, transparent) !important;
  outline: none !important;
}
.premium-nav .gs-input-wrap::before {
  content: "🔍";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.55;
  pointer-events: none;
}
.premium-nav .gs-input::placeholder {
  color: var(--on-surface-variant) !important;
  opacity: 0.7;
}

}
.gs-dropdown .gs-section-label {
  font-size: 0.625rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--on-surface-variant) !important;
  padding: 10px 12px 6px !important;
  background: transparent !important;
  border: 0 !important;
  margin-top: 2px;
}
.gs-dropdown .gs-section-label:first-child { margin-top: 0; }
.gs-dropdown .gs-mode-header {
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--error) !important;
  padding: 8px 12px !important;
  background: color-mix(in srgb, var(--error) 8%, transparent) !important;
  border-radius: 8px;
  margin-bottom: 6px;
}
.gs-dropdown .gs-mode-header .gs-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  margin-right: 4px;
  animation: pulse-live 1.8s ease-in-out infinite;
}
.gs-dropdown .gs-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--on-surface) !important;
  transition: background 120ms ease !important;
  margin: 2px 0;
}
.gs-dropdown .gs-row:hover,
.gs-dropdown .gs-row.is-active,
.gs-dropdown .gs-row:focus {
  background: color-mix(in srgb, var(--primary-container) 10%, transparent) !important;
}
.gs-dropdown .gs-thumb,
.gs-dropdown .gs-thumb-placeholder {
  width: 28px !important;
  height: 28px !important;
  background: transparent !important;
  border-radius: 6px !important;
  object-fit: contain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--on-surface);
  border: 0 !important;
}
.gs-dropdown .gs-thumb-placeholder {
  background: color-mix(in srgb, var(--on-surface) 8%, transparent) !important;
}
.gs-dropdown .gs-thumb--venue {
  border-radius: 8px !important;
  object-fit: cover;
}
.gs-dropdown .gs-entity-name {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--on-surface) !important;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-dropdown .gs-entity-meta {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: var(--on-surface-variant) !important;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--on-surface) 5%, transparent);
}

.gs-dropdown .gs-empty {
  padding: 24px 18px !important;
  text-align: center !important;
  font-size: 0.85rem !important;
  color: var(--on-surface-variant) !important;
  background: transparent !important;
}
.gs-dropdown .gs-empty strong { color: var(--on-surface); }


/* Theme toggle button in the far right (sun/moon) */
.premium-nav .theme-toggle,
.premium-nav .theme-toggle-btn,
.premium-nav [data-theme-toggle] {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--on-surface) 5%, transparent);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease;
}
.premium-nav .theme-toggle:hover,
.premium-nav .theme-toggle-btn:hover,
.premium-nav [data-theme-toggle]:hover {
  background: color-mix(in srgb, var(--primary-container) 12%, transparent);
}

/* ============================================================
   PREMIUM NAV v2 — Iconic top nav links
   Stroked SVG icon + uppercase label, inline in a row.
   ============================================================ */
.premium-nav .nav-links--iconic .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}
.premium-nav .nav-link__icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  flex-shrink: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}
.premium-nav .nav-links--iconic .nav-link:hover .nav-link__icon,
.premium-nav .nav-links--iconic .nav-link.active .nav-link__icon,
.premium-nav .nav-links--iconic .nav-link[aria-current="page"] .nav-link__icon {
  opacity: 1;
  transform: translateY(-1px);
}

/* Live count nav-link — red themed, red dot */
.premium-nav .nav-link--live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--error);
}
.premium-nav .nav-link--live:hover {
  color: var(--error);
  border-bottom-color: color-mix(in srgb, var(--error) 50%, transparent);
}
.premium-nav .nav-link--live .nav-link__live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--error);
  box-shadow: 0 0 8px color-mix(in srgb, var(--error) 55%, transparent);
  animation: pulse-live 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@media (max-width: 991px) {
  .premium-nav .nav-links--iconic .nav-link {
    padding: 8px 12px;
  }
}

/* ============================================================================
   APP SHELL (sidebar + slim topbar) — Phase 1 of new-design-and-side-bar
   All values reference tokens from theme.css; no hex literals, no 1px borders
   for containment (per PROJECT_MASTER.md design rules).
   ============================================================================ */

:root {
  --app-sidebar-width: 220px;
  --app-topbar-height: 56px;
  --app-sidebar-bg: var(--surface-container-low);
  --app-sidebar-fg: var(--on-surface);
  --app-sidebar-fg-dim: var(--on-surface-variant);
  --app-sidebar-hover-bg: var(--surface-container-high);
  --app-sidebar-active-bg: var(--primary-container);
  --app-sidebar-active-fg: var(--on-primary);
  --app-sidebar-active-hover-bg: var(--primary-fixed);
  --app-scrim-bg: color-mix(in srgb, var(--on-surface) 55%, transparent);
}

/* ---- Shell grid ---- */
/* `minmax(0, 1fr)` (not bare `1fr`) is critical: bare `1fr` defaults to
   `minmax(auto, 1fr)`, which lets the main column expand to fit a tab's
   intrinsic content width (e.g. Overview's wide cards), so switching to a
   tab with narrower content shrinks the whole page. The explicit `0` floor
   pins the column to the available track regardless of which tab is active. */
.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
}
@media (min-width: 992px) {
  .app-shell {
    grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  }
}

/* ---- Sidebar ---- */
.app-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--app-sidebar-bg);
  color: var(--app-sidebar-fg);
  padding: var(--space-4) var(--space-3);
  gap: var(--space-4);
  min-width: 0;
}
@media (min-width: 992px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    scrollbar-width: thin;
  }
}
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    z-index: 1080;
    transform: translateX(-100%);
    transition: transform var(--te-transition-base);
    box-shadow: var(--te-shadow-lg);
    overflow-y: auto;
  }
  .app-sidebar.is-open { transform: translateX(0); }
}

/* Brand row */
.app-sidebar__brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  color: var(--on-surface);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  flex: 1 1 auto;
  min-width: 0;
}
.app-sidebar__brand:hover { color: var(--on-surface); }
.app-sidebar__brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--te-radius-md);
  background: var(--app-sidebar-hover-bg);
  color: var(--on-surface);
  font-size: 18px;
  flex-shrink: 0;
}
.app-sidebar__brand-mark .brand-mark-svg {
  width: 24px; height: 24px;
  display: block;
}
.app-sidebar__brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sidebar__brand-text-q,
.app-topbar__brand-q { color: var(--brand-cyan); }
.app-sidebar__close {
  background: transparent;
  border: 0;
  color: var(--on-surface-variant);
  width: 36px; height: 36px;
  border-radius: var(--te-radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
}
.app-sidebar__close:hover {
  background: var(--app-sidebar-hover-bg);
  color: var(--on-surface);
}

/* Nav */
.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1 1 auto;
  min-height: 0;
}
.app-sidebar__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.app-sidebar__section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--on-surface-variant);
  padding: 0 var(--space-2);
  margin-top: var(--space-1);
}
.app-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-2);
  border-radius: var(--te-radius-md);
  color: var(--on-surface);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  transition: background var(--te-transition-fast), color var(--te-transition-fast);
  cursor: pointer;
}
.app-sidebar__link:hover,
.app-sidebar__link:focus-visible {
  background: var(--app-sidebar-hover-bg);
  color: var(--on-surface);
  outline: none;
}
.app-sidebar__link.is-active,
.app-sidebar__link[aria-current="page"] {
  background: var(--app-sidebar-active-bg);
  color: var(--app-sidebar-active-fg);
}
.app-sidebar__link.is-active:hover,
.app-sidebar__link.is-active:focus-visible,
.app-sidebar__link[aria-current="page"]:hover,
.app-sidebar__link[aria-current="page"]:focus-visible {
  background: var(--app-sidebar-active-hover-bg);
  color: var(--app-sidebar-active-fg);
}
.app-sidebar__link--button.dropdown-toggle::after {
  margin-left: auto;
  opacity: 0.6;
}
.app-sidebar__link--cta {
  background: var(--primary-container);
  color: var(--on-primary);
  font-weight: 600;
}
.app-sidebar__link--cta:hover,
.app-sidebar__link--cta:focus-visible {
  background: var(--primary-fixed);
  color: var(--on-primary);
}
.app-sidebar__icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* Live badge inside a sidebar link */
.app-sidebar__badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--te-radius-full);
  background: color-mix(in srgb, var(--tertiary) 14%, var(--surface-container));
  color: var(--tertiary);
}
.app-sidebar__badge--live .te-live-dot {
  width: 6px;
  height: 6px;
}

/* Dropdown menus rendered from within the sidebar — chrome lives on .tactical-popover--menu.
   Sidebar-specific override: wider minimum to fit longer competition/staff item labels. */
.app-sidebar__dropdown-menu {
  min-width: 240px;
}
.app-sidebar__dropdown-menu .dropdown-item {
  color: var(--on-surface);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--te-radius-sm);
  transition: background var(--te-transition-fast), color var(--te-transition-fast);
}
.app-sidebar__dropdown-menu .dropdown-item:hover,
.app-sidebar__dropdown-menu .dropdown-item:focus {
  background: var(--surface-container-high);
  color: var(--on-surface);
}
.app-sidebar__dropdown-menu .dropdown-item.active,
.app-sidebar__dropdown-menu .dropdown-item:active {
  background: var(--primary-container);
  color: var(--on-primary);
  font-weight: 800;
}
.app-sidebar__dropdown-menu .dropdown-item.active:hover,
.app-sidebar__dropdown-menu .dropdown-item.active:focus {
  background: var(--primary-container);
  color: var(--on-primary);
}
.app-sidebar__dropdown-menu .dropdown-item.active::after {
  content: "✓";
  margin-left: auto;
  padding-left: var(--space-2);
  font-weight: 800;
}
.app-sidebar__dropdown-menu .dropdown-item.active {
  display: flex;
  align-items: center;
}

/* Footer (login/register CTAs for anonymous users only) */
.app-sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
}

/* ---- Scrim (mobile only) ---- */
.app-scrim {
  position: fixed;
  inset: 0;
  background: var(--app-scrim-bg);
  z-index: 1070;
}
@media (min-width: 992px) {
  .app-scrim { display: none; }
}

/* ---- Main column ---- */
.app-main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
  /* Cross-axis lock: a wide intrinsic descendant (table / chart / canvas)
     can otherwise push <main> wider than this grid track and force the
     entire .es-shell (breadcrumb + hero + tabs + content) to reflow when
     switching tabs — the visible "Player tab width changes" bug. The
     overflow-x:clip + max-width:100% combo pins the column to its grid
     track regardless of descendant intrinsic width.
     Diagnostic precedent: match_center.css logs this on the match Stats
     tab at 1422px viewport — main measured 1422 while .app-main-col stayed
     at 1202. Promoting that fix here so every page (not just Match) is
     covered. */
  overflow-x: clip;
  max-width: 100%;
}
/* Neutralize legacy fixed-nav top padding when main lives in the new shell.
   width/max-width/align-self/overflow rules force-fit <main> to .app-main-col
   so flex items can never escape their cross-axis (see comment above). */
.app-main-col main.premium-main,
.app-main-col .layout-shell {
  padding-top: var(--space-5);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  overflow-x: clip;
  box-sizing: border-box;
}

/* ---- Top bar ----
   Outer .app-topbar is a full-width sticky banner (background + blur).
   Inner .app-topbar__inner carries the same max-width / padding / auto-margin
   as `.premium-main` / `.layout-shell` so the search bar's left edge and the
   user pill's right edge line up with the content below. Any page-level
   inner container (`.home-container`, `.layout-container`) must therefore
   defer horizontal padding to `.premium-main` — adding its own would push
   the content inward and break this alignment. */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1050;
  min-height: var(--app-topbar-height);
  /* Opaque surface (no backdrop-filter): a translucent blur here re-rasterises
     the whole backdrop on every scroll frame — the dominant scroll-paint cost. */
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-container));
}
.app-topbar__inner {
  max-width: var(--layout-max-wide);
  margin: 0 auto;
  padding: 0 var(--layout-padding);
  min-height: var(--app-topbar-height);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
}
@media (max-width: 640px) {
  .app-topbar__inner { padding: 0 var(--space-3); }
}
@media (min-width: 992px) {
  .app-topbar__inner {
    grid-template-columns: minmax(320px, 560px) 1fr auto;
    gap: var(--space-4);
  }
  .app-topbar__menu,
  .app-topbar__brand {
    display: none;
  }
}

.app-topbar__menu,
.app-topbar__icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--te-radius-md);
  color: var(--on-surface);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--te-transition-fast), color var(--te-transition-fast);
}
.app-topbar__menu:hover,
.app-topbar__icon-btn:hover,
.app-topbar__menu:focus-visible,
.app-topbar__icon-btn:focus-visible {
  background: var(--surface-container-high);
  outline: none;
}

/* ---- Minimalist theme toggle: inline stroke SVG, no border, no clipping.
   CSS swaps moon / sun based on the theme class applied to <html>. ---- */
.app-topbar__theme-toggle {
  padding: 0;
  overflow: visible;
  color: var(--on-surface-variant);
}
.app-topbar__theme-toggle:hover,
.app-topbar__theme-toggle:focus-visible {
  color: var(--on-surface);
  background: color-mix(in srgb, var(--surface-container-high) 60%, transparent);
}
.app-topbar__theme-toggle .theme-toggle-icon {
  display: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}
html.theme-light .app-topbar__theme-toggle .theme-toggle-icon--moon,
html:not(.theme-dark) .app-topbar__theme-toggle .theme-toggle-icon--moon {
  display: block;
}
html.theme-dark .app-topbar__theme-toggle .theme-toggle-icon--sun {
  display: block;
}

.app-topbar__brand {
  font-weight: 700;
  color: var(--on-surface);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: opacity var(--te-transition-fast), transform var(--te-transition-fast), max-width var(--te-transition-fast), margin var(--te-transition-fast);
}
@media (max-width: 991.98px) {
  .app-topbar__brand {
    /* Keep mobile brand optically centered between menu icon and search pill. */
    margin-inline: var(--space-2);
  }
}

/* ---- Search — outer pill wrapper; Alpine/HTMX internals untouched ---- */
.app-topbar__search {
  position: relative;
  width: 100%;
  min-width: 0;
  transition: transform var(--te-transition-fast);
}
@media (min-width: 992px) {
  .app-topbar__search {
    grid-column: 1;
    justify-self: stretch;
    max-width: 560px;
    margin: 0;
  }
}
/* .gs-input-wrap, .gs-input, .gs-input:focus, .app-topbar__search-icon, and the
   focus-within tonal lift live in components/tactical-controls.css. Only the
   dropdown-positioning rule below is layout-specific and stays here. */
.app-topbar__search .gs-dropdown {
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
}

/* Body scroll lock when mobile drawer is open */
@media (max-width: 991.98px) {
  body:has(.app-shell--mobile-open) { overflow: hidden; }
}

/* ---- Topbar right-side actions cluster ---- */
.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: end;
  transition: opacity var(--te-transition-fast), transform var(--te-transition-fast), max-width var(--te-transition-fast), margin var(--te-transition-fast);
}

@media (max-width: 991.98px) {
  .app-topbar__inner {
    transition: grid-template-columns var(--te-transition-fast), gap var(--te-transition-fast);
  }

  /* Mobile search-focus mode:
     keep menu icon visible, hide brand + actions, and give search maximum width. */
  .app-topbar__inner:has(.app-topbar__search:focus-within) {
    grid-template-columns: auto 0 1fr 0;
    gap: var(--space-1);
  }

  .app-topbar__inner:has(.app-topbar__search:focus-within) .app-topbar__brand,
  .app-topbar__inner:has(.app-topbar__search:focus-within) .app-topbar__actions {
    opacity: 0;
    transform: translateX(6px);
    pointer-events: none;
    max-width: 0;
    overflow: hidden;
    margin: 0;
  }

  .app-topbar__inner:has(.app-topbar__search:focus-within) .app-topbar__search {
    transform: translateX(0);
  }
}

/* ---- Sidebar API usage button (staff-only) ---- */
.app-sidebar__api-btn {
  /* Inherits .app-sidebar__link styles (row layout, hover, radius). */
  padding-right: var(--space-1);
}
.app-sidebar__api-btn .app-api-ring { margin-left: auto; }

/* Reusable donut ring rendered via conic-gradient (no JS). */
.app-api-ring {
  --api-ring-fg: var(--primary-container);
  --api-ring-bg: color-mix(in srgb, var(--primary-container) 15%, var(--surface-container-high));
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(
      var(--api-ring-fg) calc(var(--api-pct, 0) * 1%),
      var(--api-ring-bg) 0
    );
  flex-shrink: 0;
  transition: background var(--te-transition-base);
}
.app-api-ring::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--app-sidebar-bg);
}
.app-api-ring__label {
  position: relative;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--on-surface);
  line-height: 1;
}

/* Make the ring's inner hole match the hover background so the donut reads
   cleanly on the hovered row. */
.app-sidebar__api-btn:hover .app-api-ring::before,
.app-sidebar__api-btn:focus-visible .app-api-ring::before {
  background: var(--app-sidebar-hover-bg);
}

/* Warn + critical variants */
.app-sidebar__api-btn--warn .app-api-ring {
  --api-ring-fg: var(--te-draw);
  --api-ring-bg: color-mix(in srgb, var(--te-draw) 18%, var(--surface-container-high));
}
.app-sidebar__api-btn--warn .app-api-ring__label { color: var(--te-draw); }
.app-sidebar__api-btn--critical .app-api-ring {
  --api-ring-fg: var(--tertiary);
  --api-ring-bg: color-mix(in srgb, var(--tertiary) 20%, var(--surface-container-high));
}
.app-sidebar__api-btn--critical .app-api-ring__label { color: var(--tertiary); }

/* ---- Topbar user pill (moved from sidebar) ---- */
.app-topbar__user-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px var(--space-2) 4px 4px;
  background: var(--surface-container-high);
  color: var(--on-surface);
  border: 0;
  border-radius: var(--te-radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--te-transition-fast);
}
.app-topbar__user-btn::after {
  margin-left: var(--space-1);
  opacity: 0.6;
}
.app-topbar__user-btn:hover,
.app-topbar__user-btn:focus-visible {
  background: var(--surface-container);
  outline: none;
}
.app-topbar__user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary-container) 18%, var(--surface-container));
  color: var(--primary-container);
  font-size: 18px;
  flex-shrink: 0;
}
.app-topbar__user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
}
.app-topbar__user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.app-topbar__user-role {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
/* On narrow screens collapse to avatar only */
@media (max-width: 575.98px) {
  .app-topbar__user-meta { display: none; }
  .app-topbar__user-btn::after { display: none; }
  .app-topbar__user-btn { padding: 4px; }
}

/* ---- Modal (centered dialog, teleported to <body>) ----
   .app-modal-layer is an Alpine x-show wrapper; the backdrop + dialog both use
   position: fixed so they cover the viewport regardless of caller position. */
.app-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1090;
}
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--on-surface) 40%, transparent);
  z-index: 1090;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.app-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1091;
  width: min(560px, calc(100vw - var(--space-5)));
  max-height: calc(100dvh - var(--space-6));
  overflow-y: auto;
  background: var(--surface-container);
  border-radius: var(--te-radius-lg);
  box-shadow: var(--te-shadow-lg);
  padding: var(--space-5);
}
.app-modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--te-radius-md);
  color: var(--on-surface-variant);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--te-transition-fast), color var(--te-transition-fast);
}
.app-modal__close:hover,
.app-modal__close:focus-visible {
  background: var(--surface-container-high);
  color: var(--on-surface);
  outline: none;
}
.app-modal__body { margin-top: var(--space-1); }

.app-modal .home-api-usage { padding: 0; }

/* ============================================================================
   /APP SHELL
   ============================================================================ */

/* ────────────────────────────────────────────────────────────────────
   Side-by-side Standings + Official Live Prediction
   (league_detail/match_detail/team_detail/la_liga/league_live_standings).
   Lock both card headers and subheaders to the same height so row N of
   the Standings table and row N of the Prediction table align row-for-row.
   ──────────────────────────────────────────────────────────────────── */
.es-grid-standings-focus {
  --standings-prediction-header-height: 80px;
  --standings-prediction-subheader-height: 56px;
  --standings-prediction-row-height: 44px;
}

.es-grid-standings-focus > .es-card > header,
.es-grid-standings-focus .standings-prediction-card > header {
  height: var(--standings-prediction-header-height);
  min-height: var(--standings-prediction-header-height);
  max-height: var(--standings-prediction-header-height);
  align-items: center;
  box-sizing: border-box;
}

.es-grid-standings-focus .mc-standings-match-teams {
  height: var(--standings-prediction-subheader-height);
  min-height: var(--standings-prediction-subheader-height);
  max-height: var(--standings-prediction-subheader-height);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* Uniform body-row height for standings and prediction lists. Locks row
   min-height so the grid's stretch + .h-100 cards don't distribute leftover
   vertical space to bottom rows (rows visibly grow the further down you go);
   aligns row N of Standings with row N of Our Prediction across all leagues.
   .standings-mc-playing visuals live in data-list.css. */
.data-list--standings:not(.data-list--compact) .data-row[data-team-id] {
  min-height: var(--standings-prediction-row-height, 44px);
}

/* Standings-focus: guarantee a non-truncating Team column and tighten header
   tracking ("Dense Data") for maximum scannability in the widened table. */
.es-grid-standings-focus .data-list--standings:not(.data-list--compact) .data-cell--team {
  min-width: 180px;
  white-space: nowrap;
}
.es-grid-standings-focus .data-cell--head {
  letter-spacing: 0.02em;
}

/* Small "i" info badge in the Official Live Prediction header.
   Uses native title="" tooltip on hover/focus — no JS init needed. */
.standings-prediction-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  cursor: help;
  user-select: none;
  flex-shrink: 0;
}
.standings-prediction-info:hover,
.standings-prediction-info:focus-visible {
  background: var(--standings-focus-border);
  color: var(--on-primary);
  outline: none;
}

/* ===========================================================================
   Staff Operations Control Panel
   Token-driven layout for /staff/operations/.
   No 1px solid borders for containment; tonal hierarchy via surface tiers.
   =========================================================================== */

.staff-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.staff-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-container-low);
  border-radius: var(--te-radius-lg);
}
.staff-panel-toolbar__meta {
  margin-left: auto;
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.staff-panel-toolbar__season {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--te-radius-md);
  background: var(--primary-container);
  color: var(--on-primary);
}
.staff-panel-toolbar__season-label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  opacity: 0.85;
}
.staff-panel-toolbar__season-value {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.staff-panel-flag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--te-radius-md);
  background: var(--surface-container-low);
  font-size: 0.75rem;
}
.staff-panel-flag--on { background: var(--success-tint); color: var(--success); }
.staff-panel-flag--off { background: var(--warning-tint); color: var(--warning); }
.staff-panel-flag__hint {
  color: var(--on-surface-variant);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.staff-section {
  background: var(--surface-container);
  border-radius: var(--te-radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.staff-section__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.staff-section__eyebrow {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.staff-section__title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--on-surface);
  margin: 0;
  letter-spacing: -0.005em;
}
.staff-section__sub {
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
  margin: 0;
}

/* Numbered step block */
.staff-step {
  background: var(--surface-container-low);
  border-radius: var(--te-radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.staff-step__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.staff-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--te-radius-full);
  background: var(--primary-container);
  color: var(--on-primary);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  flex-shrink: 0;
}
.staff-step__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--on-surface);
  margin: 0;
}
.staff-step__hint {
  flex-basis: 100%;
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
  margin: 0;
}
.staff-step__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}
.staff-step__body > .staff-spacer {
  flex: 1 1 auto;
}
.staff-step__advanced {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* Form controls */
.staff-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.staff-field__label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.staff-input,
.staff-select {
  appearance: none;
  background: var(--surface-container);
  color: var(--on-surface);
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 0;
  border-radius: var(--te-radius-sm);
  box-shadow: inset 0 0 0 1px var(--te-border);
  min-height: 32px;
  transition: box-shadow var(--te-transition-fast);
}
.staff-input:focus,
.staff-select:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary-container);
}
.staff-select {
  background-image: linear-gradient(45deg, transparent 50%, var(--on-surface-variant) 50%),
                    linear-gradient(135deg, var(--on-surface-variant) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 24px;
}
.staff-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--on-surface);
  cursor: pointer;
  user-select: none;
}
.staff-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary-container);
}

/* Segmented control (for "Predict scope") */
.staff-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--te-radius-md);
  background: var(--surface-container-high);
}
.staff-segmented__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  padding: 6px 12px;
  border-radius: var(--te-radius-sm);
  font-size: var(--te-label-size);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--te-transition-fast), background var(--te-transition-fast);
}
.staff-segmented__btn[aria-pressed="true"] {
  background: var(--surface-container);
  color: var(--on-surface);
  box-shadow: var(--te-shadow-sm);
}

/* Hint line under non-obvious buttons */
.staff-hint {
  flex-basis: 100%;
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  margin: 0;
}

/* Action grouping inside maintenance/ratings panels */
.staff-group {
  background: var(--surface-container-low);
  border-radius: var(--te-radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.staff-group__title {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin: 0;
}
.staff-group__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}
.staff-group__row + .staff-group__row {
  padding-top: var(--space-3);
}

/* Active-job tray */
.staff-active-tray {
  display: none;
  background: var(--surface-container-high);
  border-radius: var(--te-radius-lg);
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-2);
}
.staff-active-tray.is-active {
  display: flex;
}
.staff-active-tray__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.staff-active-tray__label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.staff-active-tray__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--on-surface);
}
.staff-active-tray__metrics {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.staff-active-tray__log {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--on-surface);
  background: var(--surface-container);
  border-radius: var(--te-radius-sm);
}

/* Token-driven progress bar */
.staff-progress {
  height: 6px;
  background: var(--surface-container-low);
  border-radius: var(--te-radius-full);
  overflow: hidden;
}
.staff-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--primary-container);
  border-radius: inherit;
  transition: width 0.4s ease;
}
.staff-progress__fill--success { background: var(--success); }
.staff-progress__fill--warning { background: var(--warning); }
.staff-progress__fill--danger { background: var(--danger); }

/* Token-driven status badges (pill) */
.staff-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--te-radius-full);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.staff-badge--idle {
  background: var(--surface-highest);
  color: var(--on-surface-variant);
}
.staff-badge--running {
  background: var(--warning-tint);
  color: var(--warning);
}
.staff-badge--completed {
  background: var(--success-tint);
  color: var(--success);
}
.staff-badge--error {
  background: var(--danger-tint);
  color: var(--danger);
}

/* Job-status grid */
.staff-jobs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (max-width: 992px) {
  .staff-jobs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .staff-jobs-grid { grid-template-columns: 1fr; }
}

.staff-job-card {
  background: var(--surface-container-high);
  border-radius: var(--te-radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
}
.staff-job-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.staff-job-card__title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-surface);
  margin: 0;
}
.staff-job-card__meta {
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.staff-job-card__detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.staff-job-card__eta {
  font-size: 0.6875rem;
  color: var(--on-surface-variant);
}

/* Result block (after a job finishes) */
.staff-result {
  font-size: 0.8125rem;
  color: var(--on-surface);
  background: var(--surface-container-low);
  padding: var(--space-3);
  border-radius: var(--te-radius-md);
}

/* Walk-Forward report panel */
.staff-wf-report {
  background: var(--surface-container-low);
  border-radius: var(--te-radius-md);
  padding: var(--space-3);
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.75rem;
}

/* Disclosure toggle (used for advanced controls) */
.staff-disclosure {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
}
.staff-disclosure:hover { color: var(--on-surface); }
.staff-disclosure::before {
  content: "▸ ";
  display: inline-block;
  transition: transform var(--te-transition-fast);
}
.staff-disclosure[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

/* HTMX lazy-tab skeleton placeholders for match_detail tabs.
   Tonal-shift only (no borders), tokens only. */
.mc-skeleton {
  padding: var(--space-4, 16px);
  background: var(--surface-container-low, var(--bg-secondary));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
}
.mc-skeleton-row,
.mc-skeleton-block {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface-container, var(--bg-elevated)) 0%,
    var(--surface-container-high, var(--bg-secondary)) 50%,
    var(--surface-container, var(--bg-elevated)) 100%
  );
  background-size: 200% 100%;
  animation: tactical-shimmer 1.4s ease-in-out infinite;
}
.mc-skeleton-row {
  height: 14px;
}
.mc-skeleton-row:nth-child(2) { width: 92%; }
.mc-skeleton-row:nth-child(3) { width: 78%; }
.mc-skeleton-row:nth-child(4) { width: 64%; }

/* Lineup-shaped skeleton: header row (badges + names) + pitch grid of player dots.
   Tall enough to be unmistakable on mobile so users see something is loading. */
.mc-skeleton.mc-skeleton--lineup {
  gap: 16px;
  min-height: 460px;
}
.mc-skeleton__lineup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
}
.mc-skeleton__lineup-team {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  flex: 1;
  min-width: 0;
}
.mc-skeleton__lineup-team--away {
  justify-content: flex-end;
}
.mc-skeleton-block--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mc-skeleton-block--label {
  height: 14px;
  width: 64%;
  max-width: 140px;
  border-radius: 6px;
}
.mc-skeleton__pitch {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 8px;
  border-radius: 12px;
  background: var(--surface-container, var(--bg-elevated));
  min-height: 360px;
}
.mc-skeleton__pitch-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}
.mc-skeleton__pitch-row > span {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    var(--surface-container-high, var(--bg-secondary)) 0%,
    var(--surface-container-highest, var(--bg-tertiary)) 50%,
    var(--surface-container-high, var(--bg-secondary)) 100%
  );
  background-size: 200% 100%;
  animation: tactical-shimmer 1.4s ease-in-out infinite;
}

/* Stats-shaped skeleton: hero score row + horizontal stat bars. */
.mc-skeleton.mc-skeleton--stats {
  gap: 14px;
  min-height: 360px;
}
.mc-skeleton__stats-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 8px 0 16px;
}
.mc-skeleton-block--score {
  width: 56px;
  height: 32px;
  border-radius: 8px;
}
.mc-skeleton-block--vs {
  width: 24px;
  height: 16px;
  border-radius: 4px;
}
.mc-skeleton__stats-bar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 12px;
}
.mc-skeleton__stats-bar > .mc-skeleton-block {
  height: 14px;
}
.mc-skeleton__stats-bar > .mc-skeleton-block:first-child,
.mc-skeleton__stats-bar > .mc-skeleton-block:last-child {
  width: 40px;
  border-radius: 4px;
}
.mc-skeleton-block--bar {
  height: 10px !important;
  width: 100%;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .mc-skeleton-row,
  .mc-skeleton-block,
  .mc-skeleton__pitch-row > span {
    animation: none;
  }
}

/* Mobile: bump skeleton presence so users see clear loading feedback on small screens. */
@media (max-width: 575.98px) {
  .mc-skeleton {
    padding: 12px;
    min-height: 220px;
  }
  .mc-skeleton.mc-skeleton--lineup {
    min-height: 420px;
  }
  .mc-skeleton.mc-skeleton--stats {
    min-height: 320px;
  }
  .mc-skeleton__pitch {
    padding: 12px 6px;
    min-height: 320px;
    gap: 10px;
  }
  .mc-skeleton__pitch-row > span {
    width: 28px;
    height: 28px;
  }
  .mc-skeleton-block--avatar {
    width: 32px;
    height: 32px;
  }
  .mc-skeleton-block--score {
    width: 44px;
    height: 26px;
  }
  .mc-skeleton__stats-bar {
    grid-template-columns: 32px 1fr 32px;
    gap: 8px;
  }
  .mc-skeleton__stats-bar > .mc-skeleton-block:first-child,
  .mc-skeleton__stats-bar > .mc-skeleton-block:last-child {
    width: 32px;
  }
}

/* ========== Token-routed semantic helpers ==========
   Replace Bootstrap text-success / text-danger / bg-success / bg-danger
   (which compile to hardcoded greens/reds) with token-aware utilities
   that auto-flip in dark mode and stay tonal per DESIGN.md
   (no floodlight color fills). */
.status-ink--ok  { color: var(--success); }
.status-ink--err { color: var(--danger); }

.chip--ok,
.chip--err {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--te-radius-full);
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  text-transform: uppercase;
  letter-spacing: var(--te-label-spacing);
}
.chip--ok  { background: var(--success-tint); color: var(--success); }
.chip--err { background: var(--danger-tint);  color: var(--danger); }

/* Kick — prediction game platform */
.kick-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--space-4);
}
.kick-header { margin-bottom: var(--space-4); }
.kick-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.kick-header__title { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.kick-header__icon { font-size: 2rem; line-height: 1; }
.kick-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
}
.kick-card__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  min-height: 1.25rem;
}
/* Points earned — top-centre of the card, between the league and the status badge. */
.kick-card__points {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
/* League (logo + name), top-left of the head — same row as the status badge. */
.kick-card__comp {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  flex: 0 1 auto;
  text-decoration: none;
  color: var(--te-text-dim);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.kick-card__comp:hover { color: var(--te-text); }
.kick-card__head .status-badge { flex-shrink: 0; }

/* State tints — soft full-card wash + 4px inset accent bar (No-Line), keeping the
   .pred-widget ambient shadow. States are mutually exclusive in markup:
   live > topredict > result tier. */
.kick-card--topredict {
  background: color-mix(in srgb, var(--te-draw) 10%, var(--surface-container));
  box-shadow: var(--te-shadow-ambient), inset 4px 0 0 var(--te-draw);
}
.kick-card--predicted {
  background: color-mix(in srgb, var(--primary-container) 9%, var(--surface-container));
  box-shadow: var(--te-shadow-ambient), inset 4px 0 0 var(--primary-container);
}
.kick-card--live {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--error) 12%, var(--surface-container)) 0%,
    color-mix(in srgb, var(--error) 4%, var(--surface-container)) 70%,
    var(--surface-container) 100%
  );
  box-shadow: var(--te-shadow-ambient), inset 4px 0 0 var(--error);
}
.kick-card--exact {
  background: color-mix(in srgb, var(--te-win) 12%, var(--surface-container));
  box-shadow: var(--te-shadow-ambient), inset 4px 0 0 var(--te-win);
}
.kick-card--goal_diff {
  background: color-mix(in srgb, var(--te-caution) 12%, var(--surface-container));
  box-shadow: var(--te-shadow-ambient), inset 4px 0 0 var(--te-caution);
}
.kick-card--winner {
  background: color-mix(in srgb, var(--primary-container) 12%, var(--surface-container));
  box-shadow: var(--te-shadow-ambient), inset 4px 0 0 var(--primary-container);
}
.kick-card--wrong {
  background: color-mix(in srgb, var(--te-loss) 10%, var(--surface-container));
  box-shadow: var(--te-shadow-ambient), inset 4px 0 0 var(--te-loss);
}

/* Goal flash on a live card when its score changes — tertiary wash that fades
   once (JS strips the class on animationend). Mirrors the tactical-match-row
   goal flash; reduced-motion shows no animation. */
.kick-card--goal-flash { position: relative; }
.kick-card--goal-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--tertiary-container);
  animation: kick-card-goal-flash 1.4s ease-out forwards;
}
@keyframes kick-card-goal-flash {
  0% { opacity: 0; }
  14% { opacity: 0.85; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kick-card--goal-flash::after { animation: none; }
}

/* Clickable header → match detail. The form/community bar stay outside this link. */
.kick-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: transform var(--te-transition-fast);
}
.kick-card__link:hover { transform: translateY(-1px); }

/* Date + time stack on upcoming cards (replaces the clock-emoji pill). */
.pw2-kickoff--datetime {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-container-high);
  font-variant-numeric: tabular-nums;
}
.pw2-kickoff--datetime .tactical-match-row__date {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--te-text-dim);
}

/* Live score + minute inside the matchup. */
/* Live result — red and prominent. */
.kick-card__head .status-badge--live {
  background: var(--error);
  color: var(--on-error);
}
.kick-card__head .status-badge--live .status-badge__dot { background: var(--on-error); }
/* Two classes so this wins over the later base `.pw2-score` rule (equal-specificity
   source order would otherwise make a live score render black). */
.pw2-score.pw2-score--live {
  color: var(--error);
  font-size: 1.5rem;
  font-weight: 900;
}

/* Inline scoreboard — predictable Kick card. The matchup is the form: score
   inputs sit between the crests; date + time is the centered "view match" link. */
.kick-predict { display: grid; gap: 0.55rem; }

/* League crest + name (in the card head). */
.kick-card__league-crest {
  --tactical-media-sm: 0.95rem;
  flex-shrink: 0;
}
.kick-card__league-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Date + time — centered "view match" link. */
.kick-card__datetime-link {
  display: flex;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}
.kick-card__kickoff {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--te-text-dim);
}
.kick-card__kickoff .tactical-match-row__date { letter-spacing: 0.02em; }

.kick-predict__board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.kick-predict__score {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.kick-predict__input {
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: var(--te-radius-md);
  background: var(--surface-container-high);
  color: var(--te-text);
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  padding: 0;
  -moz-appearance: textfield;
  transition: background var(--te-transition-fast), box-shadow var(--te-transition-fast);
}
.kick-predict__input::-webkit-outer-spin-button,
.kick-predict__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kick-predict__input:hover { background: var(--surface-highest); }
.kick-predict__input:focus {
  outline: none;
  background: var(--surface-container);
  box-shadow: inset 0 0 0 2px var(--primary-container);
}
/* Faded "?" placeholder so an un-predicted card never reads as a 0–0 result. */
.kick-predict__input::placeholder {
  color: var(--te-text-dim);
  opacity: 0.5;
  font-weight: 700;
}
/* Empty (no prediction yet): mute the boxes + separator so they read as a prompt. */
.kick-predict__score.is-empty .kick-predict__input { background: var(--surface-container-high); }
.kick-predict__score.is-empty .kick-predict__sep { opacity: 0.4; }
/* Predicted (a pick exists, match not started): show the score in blue. */
.kick-predict__score:not(.is-empty) .kick-predict__input { color: var(--primary-container); }
.kick-predict__score:not(.is-empty) .kick-predict__input:focus { color: var(--te-text); }
/* Invalid empty box on a save attempt. */
.kick-predict__input.is-error {
  box-shadow: inset 0 0 0 2px var(--error);
  background: color-mix(in srgb, var(--error) 10%, var(--surface-container-high));
}
.kick-predict__sep {
  font-size: 1rem;
  font-weight: 900;
  color: var(--te-text-dim);
}
.kick-predict__save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: 1.15rem;
  margin: 0 auto;
  padding: 0 0.5rem;
  border: 0;
  border-radius: var(--te-radius-full);
  background: var(--primary-container);
  color: var(--on-primary);
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--te-transition-fast), transform var(--te-transition-fast);
}
.kick-predict__save:hover { transform: translateY(-1px); }
/* Show the "Save" label (the global rule hides it for the shared widget). */
.kick-predict__save .pred-widget__save-text {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
}

.kick-predict__hint {
  text-align: center;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--te-text-dim);
}
.kick-predict__hint.is-error { color: var(--error); font-weight: 700; }

/* Form locked client-side the moment kickoff passes (no reload). */
.kick-predict.is-locked .kick-predict__input { color: var(--te-text-dim); cursor: not-allowed; }
.kick-predict.is-locked .kick-predict__save { opacity: 0.45; pointer-events: none; }
.kick-predict.is-locked .kick-predict__hint { color: var(--error); font-weight: 700; }

/* Finished / live cards: result is the matchup score on top; the user's pick sits
   under it on one line, in a distinct (blue) color so it reads as "your guess". */
.kick-outcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
}
.kick-outcome__label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--te-text-dim);
}
/* The score is centred in the card; the points chip floats beside it without
   shifting the score off-centre (so "your pick" sits under the result above). */
.kick-outcome__pickrow {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.kick-outcome__score {
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.kick-outcome__score--pick { color: var(--primary-container); }
.kick-outcome__score--none {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--te-text-dim);
}
.kick-predict__hint.is-hidden { display: none; }

/* Saving / saved feedback on the check button (toggled by kick.js). */
.kick-card.is-saving .kick-predict__save { opacity: 0.6; pointer-events: none; }
.kick-card.is-saved .kick-predict__save { background: var(--te-win); color: var(--on-primary); }

/* Compact community block (Kick only) — codes + % on one row, small colored bar below. */
.kick-crowd {
  display: grid;
  gap: 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--te-text-dim);
  font-variant-numeric: tabular-nums;
}
/* Three labels aligned to the bar: home left, draw centre, away right. */
.kick-crowd__labels {
  display: flex;
  align-items: center;
}
.kick-crowd__seg { white-space: nowrap; flex: 1 1 0; min-width: 0; }
.kick-crowd__seg--home { text-align: left; }
.kick-crowd__seg--draw { text-align: center; }
.kick-crowd__seg--away { text-align: right; }
.kick-crowd__seg.is-leader { color: var(--te-text); }

.kick-crowd__barrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.kick-crowd__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: var(--te-radius-full);
  background: var(--surface-container-high);
  color: var(--te-text-dim);
  font-size: 0.56rem;
}
/* Slim bar variant inside the Kick crowd block. */
.kick-crowd .pw2-community__track { height: 0.4rem; flex: 1 1 auto; }

/* Tighter vertical rhythm for Kick cards (less than the generic detail widget). */
.kick-card.pred-widget--detail { gap: 0.5rem; padding: 0.85rem; }
.kick-predict { gap: 0.45rem; }

.kick-game-card { display: flex; flex-direction: column; gap: var(--space-2); border: 1px solid var(--te-border); box-shadow: var(--te-shadow-ambient); transition: transform var(--te-transition-fast), box-shadow var(--te-transition-fast), border-color var(--te-transition-fast); }
.kick-game-card:hover { transform: translateY(-2px); border-color: var(--primary-container); box-shadow: var(--te-shadow-lg); }
.kick-game-card__head { display: flex; align-items: center; justify-content: space-between; }
.kick-game-card__icon { font-size: 1.75rem; line-height: 1; }
.kick-game-card__name { font-weight: 800; color: var(--on-surface); }
.kick-game-card__desc { margin: 0; }
.kick-game-card__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: auto; }
.kick-game-card__join { color: var(--primary-container); font-weight: 700; }

.kick-empty { padding: var(--space-4); }
.kick-hub-head { display: flex; flex-direction: column; gap: var(--space-1); }

/* Kick — "How it works" tab (scoring tables) */
.kick-help { display: flex; flex-direction: column; gap: var(--space-3); }
.kick-help__block { padding: var(--space-3) var(--space-4) var(--space-4); }

.kick-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary-container) 12%, var(--surface-container-high));
}
.kick-result-banner__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--on-surface-variant);
}
.kick-result-banner__score {
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--primary-container);
  font-variant-numeric: tabular-nums;
}
.kick-result-banner__dash { color: var(--on-surface-variant); font-weight: 800; }

.kick-help__table { width: 100%; border-collapse: collapse; }
.kick-help__table th {
  text-align: left;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--on-surface-variant);
  padding: 0 var(--space-2) var(--space-1);
}
.kick-help__table td {
  padding: 0.3rem var(--space-2);
  color: var(--on-surface);
  vertical-align: middle;
}
.kick-help__table tbody tr + tr td { box-shadow: inset 0 1px 0 var(--surface-container-high); }
.kick-help__table--legend td:first-child { width: 1%; white-space: nowrap; }
.kick-help__num { text-align: right; width: 1%; white-space: nowrap; }
.kick-help__pick { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kick-help__note { margin: var(--space-2) 0 0; }

/* Tier chip — compact outcome label */
.kick-tier {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--on-surface);
}
.kick-tier--exact  { color: var(--te-win); }
.kick-tier--gd     { color: var(--te-caution); }
.kick-tier--winner { color: var(--primary-container); }
.kick-tier--wrong  { color: var(--on-surface-variant); }

/* Points chip — color-graded by tier */
.kick-pts {
  display: inline-block;
  min-width: 2.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8125rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.kick-pts--exact  { background: var(--te-win-bg);  color: var(--te-win); }
.kick-pts--gd     { background: var(--te-draw-bg); color: var(--te-caution); }
.kick-pts--winner { background: color-mix(in srgb, var(--primary-container) 16%, transparent); color: var(--primary-container); }
.kick-pts--wrong  { background: var(--surface-container-high); color: var(--on-surface-variant); }

.home-kick-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2) var(--space-4) var(--space-3); }
.home-kick-row { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--on-surface); }
.home-kick-row__icon { font-size: 1.1rem; }
.home-kick-row__name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-kick-row__rank { font-weight: 800; font-size: 0.75rem; color: var(--primary-container); white-space: nowrap; }

.kick-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.kick-admin-form { display: flex; flex-direction: column; gap: var(--space-2); }
.kick-admin-label { display: flex; flex-direction: column; gap: var(--space-1); font-size: 0.75rem; font-weight: 700; color: var(--on-surface-variant); }
.kick-admin-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0; }
.kick-admin-add { display: flex; align-items: center; gap: var(--space-2); }
.kick-admin-check { display: flex; align-items: center; gap: var(--space-2); font-size: 0.8125rem; }
.kick-admin-messages { display: flex; flex-direction: column; gap: var(--space-1); align-items: flex-start; }
.kick-admin-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.kick-league-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface-container-low);
  border-radius: var(--te-radius-md);
  padding: var(--space-2);
}
.kick-league-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 6px;
  border-radius: var(--te-radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
}
.kick-league-option:hover { background: var(--surface-container-high); }
.kick-admin-matchlist { display: flex; flex-direction: column; }
.kick-admin-matchrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: 0.8125rem;
}

/* Predict-tab filter chips */
.kick-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.kick-filter__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--te-radius-full);
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background var(--te-transition-fast), color var(--te-transition-fast);
}
.kick-filter__chip:hover { background: var(--surface-highest); }
.kick-filter__chip.is-active { background: var(--primary-container); color: var(--on-primary); }
.kick-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--te-radius-full);
  background: color-mix(in srgb, var(--on-surface) 10%, transparent);
  font-size: 0.625rem;
}
.kick-filter__chip.is-active .kick-filter__count { background: color-mix(in srgb, var(--on-primary) 22%, transparent); }
.kick-filter__chip--live { color: var(--error); }
.kick-filter__chip--live.is-active { background: var(--error); color: var(--on-error); }
.kick-filter__chip--live.is-active .status-badge__dot { background: var(--on-error); }
.kick-card.is-filtered-out,
.kick-pred-section.is-filtered-out { display: none !important; }

/* Final score in the prediction-widget header for finished matches */
.pw2-score {
  font-size: 1.375rem;
  font-weight: 900;
  color: var(--on-surface);
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
