/* ─── Knowballedge — Premium Design System ───────────────────────────────────
   Dark mode is the premium default. Light mode is clean & modern.
   All components inherit from CSS custom properties so both modes work
   everywhere automatically.
─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

/* ── Light mode tokens ──────────────────────────────────────────────────── */
:root {
  /* Brand */
  --bb-green:    #0f7a3c;
  --bb-green2:   #1a9e52;
  --bb-gold:     #D97706;
  --bb-gold2:    #B45309;
  --bb-red:      #DC2626;
  --bb-blue:     #2563EB;
  --bb-gray:     #475569;

  /* Surfaces */
  --surface-0:   #f0f4f8;
  --surface-1:   #ffffff;
  --surface-2:   #e8edf3;
  --surface-nav: #0c1e30;

  /* Text */
  --text-primary: #0f172a;
  --text-muted:   #64748B;
  --text-inverse: #ffffff;

  /* Borders & shadows */
  --border:      rgba(0,0,0,.09);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.11), 0 2px 8px rgba(0,0,0,.06);

  /* Gradients */
  --grad-gold:   linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --grad-green:  linear-gradient(135deg, #22C55E 0%, #15803D 100%);
  --grad-header: linear-gradient(135deg, #0c1e30 0%, #163554 100%);
  --grad-brand:  linear-gradient(135deg, #F59E0B 0%, #FCD34D 50%, #D97706 100%);

  /* Compat aliases */
  --bb-cream:    var(--surface-0);
  --bb-light:    var(--surface-2);
  --bb-dark:     var(--text-primary);
  --card-bg:     var(--surface-1);
  --bg-card:     var(--surface-1);
  --bg-primary:  var(--surface-0);
  --bg-secondary:var(--surface-2);
  --border-color:var(--border);
  --text-color:  var(--text-primary);

  --t: .18s ease;

  /* — Premium accent system — */
  --bb-accent:       #F59E0B;
  --bb-accent-hover: #FBBF24;
  --bb-accent-muted: rgba(245, 158, 11, 0.15);
  --bb-purple:       #8B5CF6;
  --bb-purple-muted: rgba(139, 92, 246, 0.15);
  --bb-cyan:         #06B6D4;

  /* — Text hierarchy — */
  --text-secondary: #94A3B8;
  --text-label:     #64748B;

  /* — Glassmorphism — */
  --glass-bg:     rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur:   blur(16px);

  /* — Glow system — */
  --glow-green:  0 0 12px rgba(34, 197, 94, 0.25);
  --glow-red:    0 0 12px rgba(239, 68, 68, 0.25);
  --glow-gold:   0 0 16px rgba(245, 158, 11, 0.2);
  --glow-purple: 0 0 12px rgba(139, 92, 246, 0.25);
  --glow-blue:   0 0 12px rgba(59, 130, 246, 0.25);

  /* — Stat typography sizes — */
  --stat-hero:   2.25rem;
  --stat-large:  1.5rem;
  --stat-medium: 1.125rem;
  --stat-small:  0.8125rem;

  /* — Spacing rhythm — */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;

  /* — Transitions — */
  --ease-out:        cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-normal: 250ms;
}

/* ── Dark mode tokens ───────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bb-green:    #22C55E;
  --bb-green2:   #16A34A;
  --bb-gold:     #F59E0B;
  --bb-gold2:    #D97706;
  --bb-red:      #EF4444;
  --bb-blue:     #3B82F6;
  --bb-gray:     #94A3B8;

  --surface-0:   #030912;
  --surface-1:   #080f1e;
  --surface-2:   #0d1828;
  --surface-nav: rgba(2,7,16,.97);

  --text-primary: #E2EAF4;
  --text-muted:   #6B8CAE;
  --text-inverse: #030912;

  --border:      rgba(255,255,255,.07);
  --border-gold: rgba(245,158,11,.22);
  --shadow-sm:   0 1px 4px rgba(0,0,0,.5);
  --shadow-md:   0 4px 24px rgba(0,0,0,.55), 0 1px 8px rgba(0,0,0,.35);
  --shadow-lg:   0 8px 48px rgba(0,0,0,.65), 0 2px 12px rgba(0,0,0,.45);
  --shadow-glow: 0 0 28px rgba(245,158,11,.12), 0 4px 24px rgba(0,0,0,.5);

  --grad-gold:   linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --grad-green:  linear-gradient(135deg, #22C55E 0%, #15803D 100%);
  --grad-header: linear-gradient(135deg, #070e1c 0%, #0d1a30 60%, #071224 100%);
  --grad-brand:  linear-gradient(135deg, #F59E0B 0%, #FCD34D 50%, #D97706 100%);
  --grad-card:   linear-gradient(145deg, rgba(255,255,255,.025) 0%, transparent 60%);

  --bb-cream:    var(--surface-0);
  --bb-light:    var(--surface-2);
  --bb-dark:     var(--text-primary);
  --card-bg:     var(--surface-1);
  --bg-card:     var(--surface-1);
  --bg-primary:  var(--surface-0);
  --bg-secondary:var(--surface-2);
  --border-color:var(--border);
  --text-color:  var(--text-primary);

  --glass-bg:      rgba(8, 15, 30, 0.72);
  --glass-border:  rgba(255, 255, 255, 0.06);
  --text-secondary: #7A8BA7;
  --text-label:    #4A5568;
}

/* ── Theme transition ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body, .bb-nav, .bb-card, .bb-stat-box, .game-card, .bb-table th, .bb-table td,
.bb-page-header, .status-badge, .bb-alert, input, select, textarea {
  transition: background-color var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.game-card, .bb-card, .bb-stat-box {
  transition: background-color var(--t), border-color var(--t), box-shadow var(--t),
              transform .18s ease, color var(--t);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--surface-0);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

.font-display { font-family: 'Instrument Serif', Georgia, serif; }
.font-mono    { font-family: 'Geist Mono', 'JetBrains Mono', 'SF Mono', monospace; }
.font-body    { font-family: 'DM Sans', system-ui, sans-serif; }

[data-theme="dark"] body {
  background: var(--surface-0);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(15,50,90,.45) 0%, transparent 70%);
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.bb-nav {
  display: none;
  background: var(--surface-nav);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 24px rgba(0,0,0,.45);
  border-bottom: 1px solid rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bb-nav-brand {
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -.3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: .4rem;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(245,158,11,.35));
  transition: filter .2s;
}
.bb-nav-brand:hover { filter: drop-shadow(0 0 14px rgba(245,158,11,.6)); }

.bb-nav a {
  color: rgba(255,255,255,.58);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  padding: .3rem .55rem;
  border-radius: 7px;
  transition: color .14s, background .14s, box-shadow .14s;
  white-space: nowrap;
}
.bb-nav a:hover {
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.08);
}
.bb-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--bb-gold);
}

/* Edge nav link — special treatment */
.bb-nav-edge {
  color: var(--bb-gold) !important;
  font-weight: 700 !important;
  background: rgba(245,158,11,.08) !important;
  border: 1px solid rgba(245,158,11,.2);
  transition: all .15s !important;
}
.bb-nav-edge:hover {
  background: rgba(245,158,11,.16) !important;
  border-color: rgba(245,158,11,.4) !important;
  box-shadow: 0 0 12px rgba(245,158,11,.18) !important;
}

/* ── Nav Dropdown ─────────────────────────────────────────────────────── */
.bb-nav-dropdown {
  position: relative;
  flex-shrink: 0;
}
.bb-nav-dropdown-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.58);
  font-size: .82rem; font-weight: 500;
  padding: .3rem .55rem;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color .14s, background .14s;
  display: flex; align-items: center; gap: .25rem;
}
.bb-nav-dropdown-btn:hover,
.bb-nav-dropdown.open .bb-nav-dropdown-btn {
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.08);
}
.bb-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgba(8,15,32,.97);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .35rem;
  min-width: 140px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
  backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none;
  transform: translateY(-6px) scale(.97);
  transform-origin: top left;
  transition: opacity .16s, transform .16s;
  z-index: 300;
}
.bb-nav-dropdown.open .bb-nav-dropdown-menu {
  opacity: 1; pointer-events: auto;
  transform: translateY(0) scale(1);
}
.bb-nav-dropdown-menu a {
  display: block;
  color: rgba(255,255,255,.7) !important;
  padding: .45rem .65rem !important;
  border-radius: 6px;
  font-size: .82rem; font-weight: 500;
  background: transparent !important;
  box-shadow: none !important;
}
.bb-nav-dropdown-menu a:hover {
  color: #fff !important;
  background: rgba(255,255,255,.09) !important;
}

.bb-nav-spacer { flex: 1; }

.bb-nav-ctrl {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
  padding: .25rem .65rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.4;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
  font-family: inherit;
}
.bb-nav-ctrl:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.24);
  color: #fff;
}
.bb-nav-ctrl:active { transform: scale(.94); }

.bb-nav-tag {
  font-size: .7rem;
  background: linear-gradient(135deg, rgba(245,158,11,.18) 0%, rgba(217,119,6,.12) 100%);
  color: var(--bb-gold);
  border: 1px solid rgba(245,158,11,.3);
  padding: .2rem .6rem;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
}

/* ── Micro-interactions ──────────────────────────────────────────────────── */

/* Cards lift on hover */
.bb-card {
  transition: background-color var(--t), border-color var(--t), box-shadow .2s, transform .2s, color var(--t);
}
.bb-card:has(a[href]):hover,
.bb-card.interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Game cards */
.game-card {
  transition: background-color var(--t), border-color .2s, box-shadow .2s, transform .2s, color var(--t);
  cursor: pointer;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245,158,11,.4) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.25), 0 0 0 1px rgba(245,158,11,.12);
}

/* Table rows — handled by .bb-table premium block above */

/* Stat boxes */
.bb-stat-box {
  transition: background-color var(--t), border-color .18s, box-shadow .18s, transform .18s, color var(--t);
  cursor: default;
}
.bb-stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(245,158,11,.35);
}

/* Toggle buttons */
.bb-toggle-group button, .toggle-btn, .bb-btn, button.bb-btn {
  transition: all .15s;
}
.bb-toggle-group button:hover, .toggle-btn:hover, .bb-btn:hover {
  transform: translateY(-1px);
}
.bb-toggle-group button:active, .toggle-btn:active, .bb-btn:active {
  transform: scale(.96);
}

/* Status badges pulse */
.status-badge.live, .gic-status-badge.live {
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}

/* Ripple on any element with data-ripple */
[data-ripple] { position: relative; overflow: hidden; }
.ripple-circle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.25);
  transform: scale(0); animation: rippleAnim .5s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* Smooth number count-up (applied via JS) */
.count-up { display: inline-block; }

/* Skeleton shimmer */
@keyframes shimmerSlide {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shimmer-row {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-1) 50%, var(--surface-2) 75%);
  background-size: 800px 100%;
  animation: shimmerSlide 1.4s infinite linear;
  border-radius: 6px;
  height: 2.2rem;
  margin-bottom: .5rem;
}

/* Prop / player cards */
.prop-player-card {
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.prop-player-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Smooth focus rings for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--bb-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.bb-container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

/* ── Hero (ballpark) — index page only ──────────────────────────────────── */
.bb-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  margin-bottom: 0;
  height: 260px;
}
.bb-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.bb-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(3,9,18,.2) 0%,
    rgba(3,9,18,.1) 40%,
    rgba(3,9,18,.7) 80%,
    var(--surface-0) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 1.75rem 2rem;
}
.bb-hero-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.5px;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
}
.bb-hero-title span {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(245,158,11,.4));
}
.bb-hero-sub {
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  margin-top: .2rem;
  font-weight: 400;
}

/* ── Page header — hidden; content migrated to topbar subtitle ─────────── */
.bb-page-header { display: none !important; }
.bb-page-header {
  background: var(--grad-header);
  color: #fff;
  padding: .65rem 1.6rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,.06);
  border-top: 1px solid rgba(255,255,255,.1);
  position: relative;
  overflow: hidden;
}
/* Subtle pinstripe texture on header */
.bb-page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 22px,
    rgba(255,255,255,.022) 22px,
    rgba(255,255,255,.022) 23px
  );
  pointer-events: none;
}
/* Gold accent bar at top */
.bb-page-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-gold);
}
.bb-page-header h1 {
  display: none;  /* title shown in topbar — avoid duplication */
}
.bb-page-header .subtitle {
  font-size: .83rem;
  opacity: .65;
  margin: .18rem 0 0;
  color: #fff;
}

/* === LINEUP PANEL (inside game cards) === */
.lu-panel {
  display: none;
  border-top: 1px solid var(--border-color, var(--border));
  padding: .45rem .7rem .5rem;
  background: var(--surface-2, rgba(0,0,0,.02));
}
.lu-panel.open { display: block; }
.lu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem 1rem;
}
.lu-col-head {
  font-size: .6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  margin-bottom: .25rem; padding-bottom: .2rem;
  border-bottom: 1px solid var(--border-color, var(--border));
}
.lu-row {
  display: flex; align-items: center; gap: .22rem;
  font-size: .71rem; padding: .06rem 0;
  color: var(--text-color, var(--text-primary));
}
.lu-ord {
  color: var(--text-muted); font-weight: 700;
  min-width: 1rem; text-align: right;
  font-family: 'Geist Mono', monospace; font-size: .65rem;
  flex-shrink: 0;
}
.lu-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lu-pos {
  font-size: .64rem; color: var(--text-muted);
  min-width: 2rem; text-align: right; flex-shrink: 0;
}
.lu-hand {
  font-size: .6rem; color: var(--text-muted);
  font-family: 'Geist Mono', monospace; flex-shrink: 0;
  min-width: .8rem;
}
/* Lineup toggle button (replaces static badge) */
.lineup-toggle {
  display: inline-flex; align-items: center; gap: .24rem;
  font-size: .66rem; font-weight: 700; padding: .1rem .4rem;
  border-radius: 20px;
  background: color-mix(in srgb, var(--bb-green, #22c55e) 14%, transparent);
  color: var(--bb-green, #22c55e);
  border: 1px solid color-mix(in srgb, var(--bb-green, #22c55e) 32%, transparent);
  cursor: pointer;
}
.lineup-toggle::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--bb-green, #22c55e); }
.lineup-toggle .lu-chevron { transition: transform .15s; font-style: normal; }
.lineup-toggle.open .lu-chevron { transform: rotate(180deg); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.bb-card {
  background: var(--surface-1);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.3rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .bb-card {
  background: linear-gradient(145deg, rgba(15,28,48,1) 0%, rgba(8,15,30,1) 100%);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,.06);
}
[data-theme="dark"] .bb-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  pointer-events: none;
  border-radius: inherit;
}
.bb-card:hover {
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .bb-card:hover {
  box-shadow: var(--shadow-glow);
  border-color: rgba(245,158,11,.14);
}

.bb-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
[data-theme="dark"] .bb-card-header {
  border-bottom-color: rgba(255,255,255,.06);
}

.bb-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -.15px;
}

.bb-card-badge {
  font-size: .68rem;
  background: linear-gradient(135deg, rgba(245,158,11,.18) 0%, rgba(217,119,6,.12) 100%);
  color: var(--bb-gold);
  border: 1px solid rgba(245,158,11,.28);
  padding: .2rem .55rem;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* === PREMIUM DATA TABLE === */
.bb-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
}

[data-theme="dark"] .bb-table-wrap {
  background: var(--surface-1);
  border-color: rgba(255, 255, 255, 0.06);
}

.bb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
}

.bb-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.625rem 0.75rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

[data-theme="dark"] .bb-table thead th {
  background: rgba(13, 24, 40, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bb-table thead th.sortable {
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.bb-table thead th.sortable:hover {
  color: var(--bb-gold);
}

.bb-table thead th.sort-asc::after {
  content: ' ↑';
  color: var(--bb-gold);
}

.bb-table thead th.sort-desc::after {
  content: ' ↓';
  color: var(--bb-gold);
}

.bb-table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

.bb-table tbody tr:last-child td {
  border-bottom: none;
}

.bb-table tbody tr:hover {
  background: rgba(245, 158, 11, 0.03);
}

[data-theme="dark"] .bb-table tbody tr:hover {
  background: rgba(245, 158, 11, 0.04);
}

.bb-table tbody td {
  padding: 0.625rem 0.75rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* Numeric cells — monospace, right-aligned */
.bb-table tbody td.col-stat {
  font-family: 'Geist Mono', monospace;
  font-weight: 500;
  font-size: 0.8125rem;
  text-align: right;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.bb-table thead th.col-stat {
  text-align: right;
}

/* Player name column */
.bb-table .col-player {
  font-weight: 600;
  white-space: nowrap;
  min-width: 140px;
}

.bb-table .col-player a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.bb-table .col-player a:hover {
  color: var(--bb-gold);
}

/* Team column */
.bb-table .col-team {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Rank column */
.bb-table .col-rank {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  width: 36px;
}

/* Stat value coloring in tables */
.bb-table .stat-elite { color: var(--bb-green); }
.bb-table .stat-good  { color: #6EE7B7; }
.bb-table .stat-avg   { color: var(--text-primary); }
.bb-table .stat-poor  { color: var(--bb-red); }

[data-theme="dark"] .bb-table .stat-elite {
  text-shadow: var(--glow-green);
}

/* Player row component */
.player-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.player-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.player-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Sparkline placeholder */
.sparkline-placeholder {
  width: 100%;
  height: 16px;
  background: linear-gradient(90deg, rgba(245,158,11,0.08), rgba(245,158,11,0.15), rgba(245,158,11,0.08));
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.sparkline-placeholder::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.1), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer { 100% { left: 100%; } }

/* Table filter / search bar */
.table-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-filter-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.table-filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--bb-gold);
}

.table-filter-btn.active {
  color: var(--bb-gold);
  border-color: var(--bb-gold);
  background: rgba(245, 158, 11, 0.08);
}

.table-search {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: var(--surface-0, var(--surface-1));
  border: 1px solid var(--border);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
  min-width: 180px;
}

.table-search:focus { border-color: var(--bb-gold); }
.table-search::placeholder { color: var(--text-muted); }

/* ── Grid helpers ───────────────────────────────────────────────────────── */
.bb-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
.bb-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.bb-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media (max-width: 900px) {
  .bb-grid-3, .bb-grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .bb-grid-2, .bb-grid-3, .bb-grid-4 { grid-template-columns: 1fr; }
}

/* ── Legacy table helpers (rank-cell / player-name kept for compat) ──────── */
.bb-table .rank-cell {
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 700;
  width: 32px;
  text-align: center;
}
.bb-table .player-name { font-weight: 700; }
.bb-table .team-badge {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: .12rem .42rem;
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 700;
  border: 1px solid var(--border);
  letter-spacing: .2px;
}
[data-theme="dark"] .bb-table .team-badge {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
}

/* ── Stat coloring ──────────────────────────────────────────────────────── */
.stat-hot  { color: #DC2626; font-weight: 700; }
.stat-warm { color: #EA580C; font-weight: 600; }
.stat-ok   { color: #16A34A; }
.stat-cold { color: var(--text-muted); }
[data-theme="dark"] .stat-hot  { color: #F87171; }
[data-theme="dark"] .stat-warm { color: #FB923C; }
[data-theme="dark"] .stat-ok   { color: #4ADE80; }

/* ── Summary stat boxes ─────────────────────────────────────────────────── */
.bb-stat-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.bb-stat-box {
  flex: 1;
  min-width: 130px;
  background: var(--surface-1);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: default;
}
/* Gradient top bar */
.bb-stat-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-gold);
}
.bb-stat-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,158,11,.04) 0%, transparent 55%);
  pointer-events: none;
}
[data-theme="dark"] .bb-stat-box {
  background: linear-gradient(145deg, #0d1828 0%, #080f1e 100%);
  border-color: rgba(255,255,255,.06);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .bb-stat-box::after {
  background: linear-gradient(135deg, rgba(245,158,11,.06) 0%, transparent 55%);
}
.bb-stat-box:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
[data-theme="dark"] .bb-stat-box:hover {
  border-color: rgba(245,158,11,.2);
  box-shadow: var(--shadow-glow);
}
.bb-stat-box .num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.5px;
}
.bb-stat-box .lbl {
  font-size: .74rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: .35rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.bb-stat-box .sub {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: .12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Game cards ─────────────────────────────────────────────────────────── */
.game-card {
  background: var(--surface-1);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1rem;
  border-left: 3px solid var(--bb-green);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .game-card {
  background: linear-gradient(145deg, #0d1828 0%, #08101e 100%);
  border-color: rgba(255,255,255,.06);
}
.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .game-card:hover {
  box-shadow: 0 6px 28px rgba(0,0,0,.5), 0 0 0 1px rgba(245,158,11,.12);
}
.game-card.live    { border-left-color: #EF4444; }
.game-card.final   { border-left-color: rgba(255,255,255,.15); }
.game-card.preview { border-left-color: var(--bb-green); }

/* ── Odds strip ─────────────────────────────────────────────────────────── */
.odds-strip {
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
  font-size: .64rem; color: var(--text-muted);
  margin-top: .25rem; padding-top: .25rem;
  border-top: 1px solid var(--border);
}
[data-theme="dark"] .odds-strip { border-top-color: rgba(255,255,255,.05); }
.odds-book {
  font-size: .6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--bb-gold);
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.22);
  padding: .06rem .3rem; border-radius: 4px; margin-right: .15rem;
}
.odds-strip strong { color: var(--text-primary); }
.odds-affiliate {
  margin-left: auto;
  font-size: .58rem;
  font-weight: 700;
  color: var(--bb-green);
  text-decoration: none;
  opacity: .7;
  white-space: nowrap;
  flex-shrink: 0;
}
.odds-affiliate:hover { opacity: 1; text-decoration: underline; }

.team-logo {
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
}

.game-matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  gap: .5rem;
}
.game-score {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--bb-green);
  min-width: 72px;
  text-align: center;
}
.game-team { flex: 1; }
.game-team.away { text-align: right; }
.game-meta {
  margin-top: .5rem;
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.game-pitchers {
  margin-top: .45rem;
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Status badges ──────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .35px;
}
.status-badge.live      { background: rgba(239,68,68,.12); color: #EF4444; border: 1px solid rgba(239,68,68,.25); }
.status-badge.final     { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.status-badge.preview   { background: rgba(34,197,94,.1); color: #16A34A; border: 1px solid rgba(34,197,94,.22); }
.status-badge.spring    { background: rgba(245,158,11,.1); color: var(--bb-gold); border: 1px solid rgba(245,158,11,.22); }
.status-badge.delayed   { background: rgba(249,115,22,.11); color: #f97316; border: 1px solid rgba(249,115,22,.28); }
.status-badge.suspended { background: rgba(217,119,6,.12); color: var(--bb-gold); border: 1px solid rgba(217,119,6,.28); }
.status-badge.postponed { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
[data-theme="dark"] .status-badge.live      { background: rgba(239,68,68,.15); color: #F87171; }
[data-theme="dark"] .status-badge.preview   { background: rgba(34,197,94,.12); color: #4ADE80; }
[data-theme="dark"] .status-badge.spring    { background: rgba(245,158,11,.12); color: #FCD34D; }
[data-theme="dark"] .status-badge.delayed   { background: rgba(249,115,22,.14); color: #fb923c; }
[data-theme="dark"] .status-badge.suspended { background: rgba(217,119,6,.15); color: #FCD34D; }

/* ── Period toggle ──────────────────────────────────────────────────────── */
.bb-toggle {
  display: flex;
  gap: .15rem;
  background: var(--surface-2);
  border-radius: 9px;
  padding: .18rem;
  border: 1px solid var(--border);
}
[data-theme="dark"] .bb-toggle {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.07);
}
.bb-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  padding: .28rem .65rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: .81rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}
.bb-toggle button.active {
  background: var(--bb-gold);
  color: #0a0500;
  box-shadow: 0 1px 5px rgba(245,158,11,.35);
  font-weight: 700;
}
[data-theme="dark"] .bb-toggle button.active {
  background: var(--bb-gold);
  color: #0a0500;
}

/* ── Stat pills ─────────────────────────────────────────────────────────── */
.stat-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .42rem .7rem;
  min-width: 56px;
}
[data-theme="dark"] .stat-pill {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.07);
}
.stat-pill .val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}
.stat-pill .lbl {
  font-size: .64rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .35px;
}

/* ── Loading / empty ────────────────────────────────────────────────────── */
.bb-loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.bb-loading .spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--bb-gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto .75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.bb-empty { text-align: center; padding: 2.5rem; color: var(--text-muted); }
.bb-empty .icon { font-size: 2rem; margin-bottom: .5rem; display: block; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-collect {
  background: var(--grad-gold);
  color: #0a0500;
  border: none;
  padding: .45rem 1.1rem;
  border-radius: 9px;
  font-weight: 700;
  font-size: .84rem;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
  font-family: inherit;
  letter-spacing: .1px;
}
.btn-collect:hover   { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,.4); }
.btn-collect:active  { transform: translateY(0); opacity: 1; }
.btn-collect:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Date picker row ────────────────────────────────────────────────────── */
.bb-date-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.bb-date-row input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .38rem .65rem;
  font-size: .85rem;
  color: var(--text-primary);
  background: var(--surface-1);
  font-family: inherit;
}
.bb-date-row label {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Bullpen coloring ───────────────────────────────────────────────────── */
.bullpen-great { color: #15803D; font-weight: 700; }
.bullpen-good  { color: #16A34A; }
.bullpen-avg   { color: #C2410C; }
.bullpen-bad   { color: #DC2626; font-weight: 700; }
[data-theme="dark"] .bullpen-great { color: #4ADE80; }
[data-theme="dark"] .bullpen-good  { color: #86EFAC; }
[data-theme="dark"] .bullpen-avg   { color: #FB923C; }
[data-theme="dark"] .bullpen-bad   { color: #F87171; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.bb-alert {
  padding: .7rem 1rem;
  border-radius: 10px;
  font-size: .85rem;
  margin-bottom: 1rem;
  border: 1px solid;
  border-left-width: 3px;
}
.bb-alert.info    { background: rgba(37,99,235,.08);  color: #2563EB; border-color: rgba(37,99,235,.25); }
.bb-alert.warning { background: rgba(234,88,12,.08);  color: #C2410C; border-color: rgba(234,88,12,.25); }
.bb-alert.success { background: rgba(22,163,74,.08);  color: #166534; border-color: rgba(22,163,74,.25); }
.bb-alert.error   { background: rgba(220,38,38,.08);  color: #DC2626; border-color: rgba(220,38,38,.25); }
[data-theme="dark"] .bb-alert.info    { background: rgba(59,130,246,.1);  color: #93C5FD; border-color: rgba(59,130,246,.3); }
[data-theme="dark"] .bb-alert.warning { background: rgba(249,115,22,.09); color: #FDBA74; border-color: rgba(249,115,22,.28); }
[data-theme="dark"] .bb-alert.success { background: rgba(34,197,94,.09);  color: #86EFAC; border-color: rgba(34,197,94,.28); }
[data-theme="dark"] .bb-alert.error   { background: rgba(239,68,68,.09);  color: #FCA5A5; border-color: rgba(239,68,68,.28); }

/* ── Inputs & selects ───────────────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .9rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--bb-gold);
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKINS
   "forest" = default (no data-skin attr).
   Applied via data-skin on <html>; data-theme still toggles light/dark.
══════════════════════════════════════════════════════════════════════════ */

/* ── Pinstripes — deep navy / white ──────────────────────────────────── */
[data-skin="pinstripes"] {
  --bb-green:    #1a4080;
  --bb-green2:   #2456aa;
  --bb-gold:     #b8950a;
  --bb-red:      #cc0c27;
  --surface-0:   #f0f4f9;
  --surface-1:   #ffffff;
  --surface-2:   #e4eaf5;
  --surface-nav: #001845;
  --border:      rgba(0,24,69,.1);
  --text-primary:#0b1726;
  --text-muted:  #526280;
  --bb-gray:     #3a5070;
  --bb-light:    var(--surface-2);
  --bb-dark:     var(--text-primary);
  --card-bg:     var(--surface-1);
  --bb-cream:    var(--surface-0);
  --shadow-sm:   0 1px 3px rgba(0,24,69,.07);
  --shadow-md:   0 4px 16px rgba(0,24,69,.12);
  --grad-header: linear-gradient(135deg, #001845 0%, #002a6a 100%);
}
[data-skin="pinstripes"][data-theme="dark"] {
  --bb-green:    #5b9ee0;
  --bb-green2:   #3e7ec4;
  --bb-gold:     #f0c040;
  --surface-0:   #040d1c;
  --surface-1:   #081528;
  --surface-2:   #0e2040;
  --surface-nav: rgba(2,5,14,.97);
  --border:      rgba(255,255,255,.07);
  --text-primary:#ccddf5;
  --text-muted:  #5880a8;
  --bb-gray:     #7aaace;
  --bb-light:    var(--surface-2);
  --bb-dark:     var(--text-primary);
  --card-bg:     var(--surface-1);
  --bb-cream:    var(--surface-0);
  --grad-header: linear-gradient(135deg, #030a1a 0%, #081528 100%);
}

/* ── Scoreboard — charcoal / amber ─────────────────────────────────────── */
[data-skin="scoreboard"] {
  --bb-green:    #8b4800;
  --bb-green2:   #a85c00;
  --bb-gold:     #c07a10;
  --bb-red:      #991111;
  --surface-0:   #edeada;
  --surface-1:   #fdfaf0;
  --surface-2:   #e5e0cc;
  --surface-nav: #111111;
  --border:      rgba(90,72,0,.12);
  --text-primary:#1a1208;
  --text-muted:  #7a6848;
  --bb-gray:     #5a4828;
  --bb-light:    var(--surface-2);
  --bb-dark:     var(--text-primary);
  --card-bg:     var(--surface-1);
  --bb-cream:    var(--surface-0);
  --grad-header: linear-gradient(135deg, #111111 0%, #1e1510 100%);
}
[data-skin="scoreboard"][data-theme="dark"] {
  --bb-green:    #ff9500;
  --bb-green2:   #ffb030;
  --bb-gold:     #ffb030;
  --bb-red:      #ff5050;
  --surface-0:   #090806;
  --surface-1:   #110e08;
  --surface-2:   #1c1810;
  --surface-nav: rgba(3,2,1,.97);
  --border:      rgba(255,255,255,.06);
  --text-primary:#f0e6cc;
  --text-muted:  #987850;
  --bb-gray:     #b09060;
  --bb-light:    var(--surface-2);
  --bb-dark:     var(--text-primary);
  --card-bg:     var(--surface-1);
  --bb-cream:    var(--surface-0);
  --grad-header: linear-gradient(135deg, #050402 0%, #100d08 100%);
}

/* ── ERA color classes ──────────────────────────────────────────────────── */
.era-great { color: #16A34A; font-weight: 700; }
.era-good  { color: #22C55E; }
.era-bad   { color: #EF4444; font-weight: 700; }
[data-theme="dark"] .era-great { color: #4ADE80; }
[data-theme="dark"] .era-good  { color: #86EFAC; }
[data-theme="dark"] .era-bad   { color: #F87171; }

/* ── Wind / HR impact pills ─────────────────────────────────────────────── */
.wind-hr-pill {
  font-size: .63rem; font-weight: 700;
  padding: .1rem .4rem; border-radius: 20px;
  display: inline-flex; align-items: center; gap: .2rem;
}
.wind-hr-out {
  background: rgba(239,68,68,.12); color: #EF4444;
  border: 1px solid rgba(239,68,68,.25);
}
.wind-hr-in {
  background: rgba(34,197,94,.1); color: #16A34A;
  border: 1px solid rgba(34,197,94,.22);
}
[data-theme="dark"] .wind-hr-out { color: #F87171; background: rgba(239,68,68,.15); }
[data-theme="dark"] .wind-hr-in  { color: #4ADE80; background: rgba(34,197,94,.12); }

/* ── Watchlist star ─────────────────────────────────────────────────────── */
.wl-btn {
  background: none; border: none; cursor: pointer;
  font-size: .95rem; color: var(--text-muted);
  padding: 0 .2rem; line-height: 1;
  transition: color .15s, transform .1s;
}
.wl-btn:hover { color: var(--bb-gold); transform: scale(1.2); }
.wl-btn.wl-active { color: var(--bb-gold); }

/* ── Match score grade badges ───────────────────────────────────────────── */
.ms-badge {
  display: inline-flex; align-items: center; gap: .15rem;
  font-size: .65rem; font-weight: 800; padding: .12rem .32rem; border-radius: 5px;
}
.ms-A { background: rgba(34,197,94,.15);  color: #22C55E; border: 1px solid rgba(34,197,94,.3); }
.ms-B { background: rgba(74,222,128,.12); color: #16A34A; border: 1px solid rgba(74,222,128,.28); }
.ms-C { background: rgba(245,158,11,.14); color: var(--bb-gold); border: 1px solid rgba(245,158,11,.3); }
.ms-D { background: rgba(239,68,68,.12);  color: #EF4444; border: 1px solid rgba(239,68,68,.28); }

/* ── Prop history tiles ─────────────────────────────────────────────────── */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: .65rem;
  margin-bottom: .75rem;
}
.ph-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem .75rem;
  text-align: center;
}
[data-theme="dark"] .ph-tile { background: rgba(255,255,255,.03); }
.ph-tile.ph-edge-pos { border-left: 3px solid var(--bb-green); }
.ph-tile.ph-edge-neg { border-left: 3px solid var(--bb-red); }
.ph-tile.ph-edge-neu { border-left: 3px solid var(--border); }
.ph-label {
  font-size: .63rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); margin-bottom: .3rem;
}
.ph-rate  { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.ph-rate.hot  { color: var(--bb-green); }
.ph-rate.cold { color: var(--bb-red); }
.ph-rate.mid  { color: var(--bb-gold); }
.ph-edge  { font-size: .7rem; font-weight: 800; margin-top: .15rem; }
.ph-meta  { font-size: .7rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Line movement coloring ─────────────────────────────────────────────── */
.lm-move-pos { color: var(--bb-green); font-weight: 700; }
.lm-move-neg { color: var(--bb-red);   font-weight: 700; }

/* ── Nav glassmorphism (dark mode) ─────────────────────────────────────── */
[data-theme="dark"] .bb-nav {
  background: rgba(3, 9, 18, 0.82);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Mono on numeric cells is now handled by td.col-stat in the premium table block */

/* ── Glass panel over bb-card (dark mode) ───────────────────────────────── */
[data-theme="dark"] .glass-panel.bb-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === SIDEBAR NAVIGATION === */
.bb-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 64px;
  background: var(--surface-nav);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--duration-normal) var(--ease-out);
  overflow: hidden;
}
.bb-sidebar:hover { width: 220px; }

[data-theme="dark"] .bb-sidebar {
  background: rgba(3, 9, 18, 0.95);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-right-color: rgba(255, 255, 255, 0.06);
}

.bb-sidebar-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 1.125rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
}
.bb-sidebar-brand-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.bb-sidebar-brand-text {
  margin-left: 0.75rem;
  font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 1rem;
  background: var(--grad-brand, linear-gradient(135deg, #F59E0B, #FCD34D, #D97706));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; white-space: nowrap;
  opacity: 0; transition: opacity var(--duration-normal) var(--ease-out);
}
.bb-sidebar:hover .bb-sidebar-brand-text { opacity: 1; }

.bb-sidebar-nav {
  flex: 1; display: flex; flex-direction: column;
  padding: 0.75rem 0; gap: 0.125rem;
  overflow-y: auto; overflow-x: hidden;
}

.bb-sidebar-link {
  display: flex; align-items: center;
  padding: 0.625rem 1.125rem;
  /* Sidebar bg is always dark — use white-based colors regardless of page theme */
  color: rgba(255,255,255,0.48); text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  position: relative; white-space: nowrap;
}
.bb-sidebar-link:hover { color: rgba(255,255,255,0.92); background: rgba(255,255,255,0.05); }
.bb-sidebar-link.active { color: var(--bb-gold); }
.bb-sidebar-link.active::before {
  content: ''; position: absolute;
  left: 0; top: 0.375rem; bottom: 0.375rem;
  width: 3px; background: var(--bb-gold);
  border-radius: 0 2px 2px 0;
}

.bb-sidebar-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.bb-sidebar-icon svg {
  width: 20px; height: 20px; flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.bb-sidebar-link:hover .bb-sidebar-icon svg {
  opacity: 1;
}
.bb-sidebar-link.active .bb-sidebar-icon svg {
  opacity: 1;
  stroke: var(--bb-gold);
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.3));
}
.bb-sidebar-text {
  margin-left: 0.75rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 500;
  opacity: 0; transition: opacity var(--duration-normal) var(--ease-out);
}
.bb-sidebar:hover .bb-sidebar-text { opacity: 1; }

.bb-sidebar-divider { height: 1px; background: var(--border); margin: 0.5rem 1rem; }

.bb-sidebar-section {
  padding: 0.6rem 1.125rem 0.1rem;
  overflow: hidden;
  pointer-events: none;
}
.bb-sidebar-section-label {
  display: block;
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.55);
  opacity: 0;
  white-space: nowrap;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.bb-sidebar:hover .bb-sidebar-section-label { opacity: 1; }

.bb-sidebar-footer {
  padding: 0.75rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.25rem; flex-shrink: 0;
}

.bb-sidebar-footer-extra {
  padding: 0.5rem 0.75rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.25rem; flex-shrink: 0;
}
.bb-sidebar-attribution {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .3rem .25rem .1rem;
  font-size: .58rem; color: var(--text-muted); opacity: .45;
  overflow: hidden;
  transition: opacity .2s;
}
.bb-sidebar-attribution span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bb-sidebar-attribution a {
  color: inherit; text-decoration: none;
}
.bb-sidebar-attribution:hover { opacity: .7; }
/* Hide when sidebar is collapsed */
.bb-sidebar:not(:hover) .bb-sidebar-attribution { opacity: 0; }
body.sidebar-pinned .bb-sidebar .bb-sidebar-attribution { opacity: .45; }
body.sidebar-pinned .bb-sidebar .bb-sidebar-attribution:hover { opacity: .7; }

/* === PINNED SIDEBAR === */
body.sidebar-pinned .bb-sidebar {
  width: 220px;
}
body.sidebar-pinned .bb-sidebar .bb-sidebar-text {
  opacity: 1;
}
body.sidebar-pinned .bb-sidebar .bb-sidebar-brand-text {
  opacity: 1;
}
body.sidebar-pinned .bb-topbar {
  left: 220px;
  width: calc(100% - 220px);
}
body.sidebar-pinned .bb-layout-main {
  margin-left: 220px;
}
/* Pin button active state when pinned */
body.sidebar-pinned #sidebar-pin-btn {
  color: var(--bb-gold);
}
body.sidebar-pinned #sidebar-pin-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0.375rem; bottom: 0.375rem;
  width: 3px; background: var(--bb-gold);
  border-radius: 0 2px 2px 0;
}

/* === SIDEBAR GROUPS === */
.bb-sidebar-group { display: flex; flex-direction: column; }

.bb-sidebar-group-header {
  display: flex; align-items: center;
  padding: 0.5rem 1.125rem 0.2rem;
  color: rgba(255,255,255,0.32);
  background: none; border: none; cursor: pointer;
  width: 100%; text-align: left; white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-out);
}
.bb-sidebar-group-header:hover { color: rgba(255,255,255,0.75); }
.bb-sidebar-group-header .bb-sidebar-icon { width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bb-sidebar-group-header .bb-sidebar-icon svg { width: 20px; height: 20px; opacity: 0.5; transition: opacity var(--duration-fast) var(--ease-out); }
.bb-sidebar-group-header:hover .bb-sidebar-icon svg { opacity: 1; }
.bb-sidebar-group-header .bb-sidebar-text {
  flex: 1; font-size: 0.58rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
}

.bb-sidebar-chevron {
  display: flex; align-items: center; flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.bb-sidebar:hover .bb-sidebar-chevron,
body.sidebar-pinned .bb-sidebar-chevron { opacity: 0.45; }
.bb-sidebar-group.open .bb-sidebar-chevron { transform: rotate(180deg); }

/* Group items: hidden by default, visible when expanded + open */
.bb-sidebar-group-items { display: none; flex-direction: column; }
.bb-sidebar:hover .bb-sidebar-group.open .bb-sidebar-group-items,
body.sidebar-pinned .bb-sidebar-group.open .bb-sidebar-group-items { display: flex; }

/* Indent group items to signal hierarchy */
.bb-group-item { padding-left: 1.75rem; }

/* === PIN BUTTON === */
.bb-pin-btn {
  display: flex; align-items: center; justify-content: center;
  margin-left: auto; flex-shrink: 0;
  width: 20px; height: 20px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-radius: 4px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}
.bb-sidebar-link:hover .bb-pin-btn { opacity: 0.55; }
.bb-pin-btn:hover { opacity: 1 !important; color: var(--text-primary); background: rgba(255,255,255,0.1); }
.bb-pin-btn.pinned { opacity: 1; color: var(--bb-gold); }
.bb-pin-btn.pinned:hover { color: var(--bb-gold); background: rgba(245,158,11,0.1); }

/* Mobile: flatten groups into the tab bar */
@media (max-width: 768px) {
  .bb-sidebar-group-header { display: none !important; }
  .bb-sidebar-group-items { display: flex !important; flex-direction: row !important; }
  .bb-group-item { padding-left: 0 !important; }
  .bb-pin-btn { display: none !important; }
  #bb-nav-pins { display: none !important; }
}

/* ── Mobile tabs (priority nav) ──────────────────────────────────────────── */
.bb-mobile-tabs {
  display: none;
  flex-direction: row; justify-content: space-around;
  align-items: stretch; width: 100%; height: 60px;
}
@media (min-width: 769px) {
  .bb-mobile-tabs { display: none !important; }
  .bb-desktop-nav { display: flex !important; }
}

/* ── Mobile more panel ───────────────────────────────────────────────────── */
.bb-mobile-more-panel {
  position: fixed; bottom: 60px; left: 0; right: 0; z-index: 200;
  background: var(--surface-1); border-top: 1px solid var(--border);
  padding: 1rem; display: none; max-height: 60vh; overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0,0,0,.18);
  border-radius: 16px 16px 0 0;
}
.bb-mobile-more-panel.open { display: block; }
.bb-mobile-more-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem;
}
.bb-mobile-more-item {
  display: flex; flex-direction: column; align-items: center;
  gap: .28rem; padding: .65rem .25rem; border-radius: 10px;
  text-decoration: none; color: var(--text-color);
  font-size: .7rem; font-weight: 600; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background .13s;
}
.bb-mobile-more-item:hover { background: var(--card-bg); }
.bb-mobile-more-item.active { color: var(--bb-green2); border-color: var(--bb-green2); }
.bb-mobile-more-item .bb-sidebar-icon { width: 22px; height: 22px; }
.bb-mobile-more-item .bb-sidebar-icon svg { width: 18px; height: 18px; }
.bb-mobile-more-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199; display: none;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.bb-mobile-more-overlay.open { display: block; }
.bb-mobile-more-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-color); font-family: inherit;
}

/* === TOP BAR === */
.bb-topbar {
  position: fixed; top: 0; left: 64px; right: 0; height: 56px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem; z-index: 90; gap: 1rem;
}
[data-theme="dark"] .bb-topbar {
  background: rgba(8, 15, 30, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.bb-topbar-brand {
  display: flex; flex-direction: column; gap: 1px; justify-content: center;
  min-width: 0;
}
.bb-topbar-title {
  font-family: 'DM Sans', sans-serif; font-size: 0.9375rem;
  font-weight: 600; color: var(--text-primary); line-height: 1.2;
}
.bb-topbar-sub {
  font-size: .64rem; color: var(--text-muted); font-weight: 400;
  line-height: 1; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 380px;
}
.bb-topbar-spacer { flex: 1; }
.bb-topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ── Topbar global controls (pin · favs · theme · auth) ──────────────────── */
.bb-topbar-ctrl-group {
  display: flex; align-items: center; gap: 2px;
  padding-left: .65rem; margin-left: .25rem;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.bb-topbar-ctrl {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: transparent; border: none;
  cursor: pointer; color: var(--text-muted);
  transition: background .12s ease, color .12s ease;
  flex-shrink: 0; text-decoration: none; padding: 0;
}
.bb-topbar-ctrl svg { width: 17px; height: 17px; flex-shrink: 0; }
.bb-topbar-ctrl:hover { background: var(--surface-2); color: var(--text-primary); }
.bb-topbar-ctrl.active { color: var(--bb-gold); }

/* === MAIN CONTENT OFFSET === */
.bb-layout-main { margin-left: 64px; margin-top: 56px; min-height: calc(100vh - 56px); }

/* === MOBILE: sidebar becomes bottom tab bar === */
@media (max-width: 768px) {
  .bb-sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0;
    width: 100% !important; height: 60px;
    flex-direction: row; border-right: none;
    border-top: 1px solid var(--border); overflow: visible;
    z-index: 100;
  }
  .bb-sidebar:hover { width: 100% !important; }
  .bb-sidebar-brand, .bb-sidebar-divider, .bb-sidebar-section, .bb-sidebar-footer,
  .bb-sidebar-footer-extra,
  .bb-sidebar-text, .bb-sidebar-brand-text { display: none !important; }
  body.sidebar-pinned .bb-topbar { left: 0; width: 100%; }
  body.sidebar-pinned .bb-layout-main { margin-left: 0; }
  body.sidebar-pinned .bb-sidebar { width: 100% !important; }
  /* Hide desktop nav, show mobile tabs */
  .bb-sidebar-nav.bb-desktop-nav { display: none !important; }
  .bb-mobile-tabs { display: flex !important; }
  .bb-mobile-tabs .bb-sidebar-link {
    flex-direction: column; padding: 0.5rem 0.6rem; gap: 0.1rem;
    align-items: center; flex: 1; justify-content: center;
  }
  .bb-mobile-tabs .bb-sidebar-link.active::before {
    top: 0; left: 0.4rem; right: 0.4rem; bottom: auto;
    height: 2px; width: auto; border-radius: 0 0 2px 2px;
  }
  .bb-mobile-tabs .bb-sidebar-link::after {
    content: attr(data-label);
    font-family: 'DM Sans', sans-serif; font-size: 0.5rem;
    font-weight: 600; opacity: 0.7;
  }
  .bb-mobile-tabs .bb-sidebar-icon { width: 22px; height: 22px; }
  .bb-mobile-tabs .bb-sidebar-icon svg { width: 18px; height: 18px; }
  .bb-topbar { left: 0; }
  .bb-layout-main { margin-left: 0; margin-bottom: 60px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM DESIGN SYSTEM UTILITIES
═══════════════════════════════════════════════════════════════════════════ */

/* === PREMIUM STAT TYPOGRAPHY === */
.stat-value {
  font-family: 'Geist Mono', monospace;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-value-hero { font-size: var(--stat-hero); }
.stat-value-lg   { font-size: var(--stat-large); }
.stat-value-md   { font-size: var(--stat-medium); }

.stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--stat-small);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* === GLOW STATES (for live/dynamic data) === */
.glow-positive { color: var(--bb-green);  text-shadow: var(--glow-green); }
.glow-negative { color: var(--bb-red);    text-shadow: var(--glow-red); }
.glow-gold     { color: var(--bb-gold);   text-shadow: var(--glow-gold); }
.glow-ai       { color: var(--bb-purple); text-shadow: var(--glow-purple); }

/* === STAT PILL COMPONENT === */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.stat-pill-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* === EDGE BADGE COMPONENT === */
.edge-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.edge-badge--strong  { background: rgba(34, 197, 94, 0.12);  color: #22C55E; border: 1px solid rgba(34, 197, 94, 0.2); }
.edge-badge--lean    { background: rgba(245, 158, 11, 0.12); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.2); }
.edge-badge--neutral { background: rgba(148, 163, 184, 0.08); color: #94A3B8; border: 1px solid rgba(148, 163, 184, 0.12); }

/* === GLASSMORPHIC PANEL === */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* === SECTION HEADING (editorial serif) === */
.section-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* === DATA PULSE ANIMATION (for live updating values) === */
@keyframes dataPulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}
.data-updating { animation: dataPulse 0.6s ease-in-out; }

/* === CARD HOVER UPGRADE === */
.bb-card {
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow   var(--duration-normal) var(--ease-out),
              transform    var(--duration-normal) var(--ease-out);
}
.bb-card:hover {
  border-color: var(--border-gold, rgba(245, 158, 11, 0.15));
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .bb-container { padding: .85rem .75rem; }
  .bb-nav { gap: .25rem; padding: 0 .75rem; overflow-x: auto; flex-wrap: nowrap; }
  .bb-nav a { font-size: .75rem; }
  .bb-nav-dropdown-btn { font-size: .75rem; }
  .bb-nav-dropdown-menu { left: auto; right: 0; transform-origin: top right; }
  .bb-card { padding: .85rem; }
  .bb-grid-2, .bb-grid-3, .bb-grid-4 { grid-template-columns: 1fr; }
  .bb-table .col-hide-mobile { display: none; }
  .bb-page-header .subtitle { font-size: .78rem; }
  .stat-pill { min-width: 60px; padding: .35rem .5rem; }
  .filter-bar { gap: .4rem; }
  .bb-toggle button { padding: .25rem .55rem; font-size: .78rem; }
  .bb-hero { height: 180px; }
  .bb-hero-title { font-size: 1.45rem; }
  .bb-stat-box .num { font-size: 1.65rem; }
}

@media (max-width: 480px) {
  .bb-nav a:not(.bb-nav-brand):not(.active):not(.bb-nav-edge) { display: none; }
  .bb-nav-dropdown { display: none; }
  .bb-nav-spacer, .bb-nav-ctrl, .bb-nav-tag { display: flex; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AI Analysis Panel
═══════════════════════════════════════════════════════════════════════════ */
.ai-gen-btn {
  font-size: .75rem; font-weight: 600; padding: .3rem .75rem;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff; border: none; border-radius: 6px; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.ai-gen-btn:hover  { opacity: .88; transform: translateY(-1px); }
.ai-gen-btn:active { transform: scale(.96); }
.ai-gen-btn:disabled { opacity: .5; cursor: default; transform: none; }

.ai-analysis-body { min-height: 56px; }
.ai-placeholder   { padding: .5rem 0; }

.ai-loading {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 0; color: var(--text-muted); font-size: .85rem;
}
.ai-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(124,58,237,.25);
  border-top-color: #7c3aed;
  animation: aiSpin .7s linear infinite; flex-shrink: 0;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }

.ai-error { padding: .5rem 0; font-size: .85rem; }

.ai-insight-text {
  font-size: .875rem; line-height: 1.65;
  color: var(--text-primary);
}
.ai-insight-text p {
  margin: 0 0 .75rem;
  padding-left: .75rem;
  border-left: 2px solid rgba(124,58,237,.4);
}
.ai-insight-text p:last-child { margin-bottom: 0; }

.ai-meta-row {
  display: flex; align-items: center; gap: .75rem;
  margin-top: .75rem; padding-top: .6rem;
  border-top: 1px solid var(--border);
  font-size: .72rem;
}
.ai-meta-cached { color: var(--text-muted); }
.ai-meta-fresh  {
  color: #7c3aed;
  background: rgba(124,58,237,.08);
  padding: 1px 6px; border-radius: 4px;
}
.ai-refresh-btn {
  margin-left: auto; font-size: .72rem; color: var(--text-muted);
  background: none; border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ai-refresh-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* ── Command Bar (Cmd+K) ────────────────────────────────────────────────────── */
#cmd-bar-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
#cmd-bar-overlay.open { display: flex; }

.cmd-bar-modal {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: 14px; width: 100%; max-width: 560px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  overflow: hidden;
}
.cmd-bar-input-wrap {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border-color);
}
.cmd-bar-search-icon { opacity: .4; flex-shrink: 0; }
#cmd-bar-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 1rem; font-family: inherit; color: var(--text-color);
}
.cmd-bar-esc {
  font-size: .65rem; font-family: inherit; font-weight: 700;
  padding: .15rem .4rem; border-radius: 4px;
  background: var(--surface-2, var(--bg-secondary));
  border: 1px solid var(--border-color); color: var(--text-muted);
  flex-shrink: 0;
}
#cmd-bar-results {
  max-height: 360px; overflow-y: auto;
  padding: .35rem 0;
}
.cmd-group-label {
  font-size: .6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); opacity: .6;
  padding: .5rem 1rem .2rem;
}
.cmd-result-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .52rem 1rem; cursor: pointer;
  transition: background .1s;
}
.cmd-result-item:hover, .cmd-result-item.selected {
  background: var(--surface-2, rgba(255,255,255,.05));
}
.cmd-result-icon { flex-shrink: 0; width: 20px; display: flex; align-items: center; }
.cmd-result-main { font-size: .88rem; font-weight: 600; flex: 1; }
.cmd-result-sub { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; }
.cmd-loading, .cmd-empty {
  padding: 1.2rem 1rem; font-size: .82rem; color: var(--text-muted); text-align: center;
}

/* ── Sidebar auth button ────────────────────────────────────────────────────── */
.bb-sidebar-auth {
  margin-top: .25rem;
}

/* ── Waiting / error states ─────────────────────────────────────────────────── */
.bb-waiting {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
}
.bb-waiting-icon { font-size: 2rem; margin-bottom: .6rem; opacity: .55; }
.bb-waiting-title { font-size: .9rem; font-weight: 600; margin-bottom: .35rem; color: var(--text-primary); }
.bb-waiting-sub   { font-size: .78rem; line-height: 1.5; }

.bb-error-state {
  text-align: center;
  padding: 1.5rem 1rem;
}
.bb-error-icon { font-size: 1.6rem; margin-bottom: .4rem; }
.bb-error-msg  { font-size: .82rem; font-weight: 600; color: var(--bb-red); }

/* ── Freshness tag ──────────────────────────────────────────────────────────── */
.freshness-tag {
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 20px;
  padding: .1rem .45rem;
  margin-left: .5rem;
  white-space: nowrap;
  letter-spacing: .01em;
  vertical-align: middle;
  cursor: default;
}

/* ── Favorite teams ─────────────────────────────────────────────────────────── */
.fav-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bb-gold);
  vertical-align: middle;
  margin-left: .3rem;
  flex-shrink: 0;
}

.fav-pick-div-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: .6rem .5rem .2rem;
}
.fav-pick-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: .83rem;
  transition: background .12s;
}
.fav-pick-row:hover { background: var(--surface-2); }
.fav-pick-row.selected { background: color-mix(in srgb, var(--bb-gold) 10%, transparent); }
.fav-pick-row input { display: none; }
.fav-pick-name { flex: 1; font-weight: 600; }
.fav-pick-abbr { font-size: .7rem; color: var(--text-muted); font-family: 'Geist Mono', monospace; }
.fav-pick-row input:disabled ~ .fav-pick-name,
.fav-pick-row input:disabled ~ .fav-pick-abbr { opacity: .4; }

.fav-game { border-color: color-mix(in srgb, var(--bb-gold) 40%, transparent) !important; }

/* ── Mobile linescore ───────────────────────────────────────────────────────── */
@media (min-width: 640px) { .ls-mobile-only { display: none !important; } }
@media (max-width: 639px) { .ls-desktop-only { display: none !important; } }

.ls-mob-card {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.ls-mob-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .25rem 0;
}
.ls-mob-row + .ls-mob-row { border-top: 1px solid var(--border); }
.ls-mob-team  { font-weight: 700; font-size: .85rem; flex: 1; }
.ls-mob-score { font-size: 1.15rem; font-weight: 900; font-family: 'Geist Mono', monospace; min-width: 1.6rem; text-align: right; }
.ls-mob-score.ls-win { color: var(--bb-green2); }
.ls-mob-rhe   { font-size: .7rem; color: var(--text-muted); font-family: 'Geist Mono', monospace; min-width: 3.5rem; text-align: right; }

@media (max-width: 639px) {
  /* Shrink live panel linescore on mobile */
  .glp-ls-tbl { font-size: .6rem; }
  .glp-ls-tbl th, .glp-ls-tbl td { padding: .1rem .18rem; min-width: 14px; }
  .glp-ls-tbl td.ls-team { min-width: 1.8rem; font-size: .65rem; padding-right: .25rem; }
  /* Ensure glp-right scrolls rather than overflows */
  .glp-right { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}

/* ── Sortable table column indicators ───────────────────────────────────────── */
thead th.sort-asc::after  { content: " ↑"; font-size: .7em; opacity: .7; }
thead th.sort-desc::after { content: " ↓"; font-size: .7em; opacity: .7; }

/* ── Yesterday's Recap card ─────────────────────────────────────────────────── */
.recap-scores {
  display: flex; flex-wrap: wrap; gap: .4rem;
  padding: .5rem 1rem .25rem;
}
.recap-score-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .28rem .6rem; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .75rem; white-space: nowrap;
  text-decoration: none; color: inherit;
  transition: background .12s;
}
.recap-score-chip:hover { background: var(--surface-0); }
.recap-score-chip.recap-walkoff { border-color: color-mix(in srgb, var(--bb-gold) 45%, transparent); }
.recap-score-chip.recap-extra   { border-color: color-mix(in srgb, var(--bb-blue) 45%, transparent); }
.recap-winner { font-weight: 800; color: var(--bb-green2); }
.recap-loser  { color: var(--text-muted); }
.recap-runs   { font-weight: 700; font-family: 'Geist Mono', monospace; }
.recap-flag   { font-size: .65rem; opacity: .75; }
.recap-performers {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .4rem 1rem .6rem;
}
.recap-perf-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .55rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600;
  background: color-mix(in srgb, var(--bb-green) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bb-green) 28%, transparent);
  color: var(--text-primary);
}
.recap-perf-chip.hr-chip {
  background: color-mix(in srgb, var(--bb-gold) 12%, transparent);
  border-color: color-mix(in srgb, var(--bb-gold) 30%, transparent);
}
.recap-section-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: .05em;
  padding: .3rem 1rem .15rem;
}

/* ── Best Plays Today card ──────────────────────────────────────────────────── */
.bp-list { display: flex; flex-direction: column; }
.bp-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border-left: 3px solid transparent;
  text-decoration: none; color: inherit;
  transition: background .12s;
}
.bp-row:hover { background: var(--surface-2); }
.bp-row + .bp-row { border-top: 1px solid var(--border-color, var(--border)); }
.bp-icon { font-size: 1.1rem; flex-shrink: 0; width: 1.5rem; text-align: center; }
.bp-body { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.bp-label { font-size: .85rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-sub   { font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
