/* ============================================================
   SLEEPER/WIRE — a distinct visual identity from Marquee.
   Concept: the waiver wire, the injury wire, a scouting-room
   dossier — but a friendly command-center read rather than a
   dark trading floor. Cream, purple and coral, generously
   rounded. Light by default now (a deliberate choice, not an
   omission); dark theme gets equal care, not an inversion.
   ============================================================ */

:root {
  /* Light (default) */
  --bg: #fbf6ef;
  --bg-glow-a: rgba(91, 75, 147, 0.05);
  --bg-glow-b: rgba(230, 127, 99, 0.05);
  --surface: #fffcf6;
  --surface-raised: #ffffff;
  --text: #211f3d;
  --muted: #8983a6;
  --border: rgba(33, 31, 61, 0.08);
  --border-strong: rgba(33, 31, 61, 0.16);

  --brand: #5b4b93;
  --brand-soft: rgba(91, 75, 147, 0.1);
  --accent: #e67f63;
  --accent-soft: rgba(230, 127, 99, 0.12);

  --alert: #c6432e;
  --alert-soft: rgba(198, 67, 46, 0.1);
  --positive: #3f9a5e;
  --positive-soft: rgba(63, 154, 94, 0.1);
  --gold: #d99a34;
  --gold-soft: rgba(217, 154, 52, 0.12);

  --display: 'Big Shoulders Display', sans-serif;
  --body: 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17152a;
    --bg-glow-a: rgba(146, 128, 209, 0.12);
    --bg-glow-b: rgba(240, 145, 111, 0.09);
    --surface: #201c36;
    --surface-raised: #282341;
    --text: #f1eef9;
    --muted: #a79fc4;
    --border: rgba(241, 238, 249, 0.1);
    --border-strong: rgba(241, 238, 249, 0.18);

    --brand: #9280d1;
    --brand-soft: rgba(146, 128, 209, 0.18);
    --accent: #f0916f;
    --accent-soft: rgba(240, 145, 111, 0.16);

    --alert: #e5715a;
    --alert-soft: rgba(229, 113, 90, 0.18);
    --positive: #5cbe7e;
    --positive-soft: rgba(92, 190, 126, 0.18);
    --gold: #e8b25a;
    --gold-soft: rgba(232, 178, 90, 0.16);
  }
}
:root[data-theme='dark'] {
  --bg: #17152a;
  --bg-glow-a: rgba(146, 128, 209, 0.12);
  --bg-glow-b: rgba(240, 145, 111, 0.09);
  --surface: #201c36;
  --surface-raised: #282341;
  --text: #f1eef9;
  --muted: #a79fc4;
  --border: rgba(241, 238, 249, 0.1);
  --border-strong: rgba(241, 238, 249, 0.18);
  --brand: #9280d1;
  --brand-soft: rgba(146, 128, 209, 0.18);
  --accent: #f0916f;
  --accent-soft: rgba(240, 145, 111, 0.16);
  --alert: #e5715a;
  --alert-soft: rgba(229, 113, 90, 0.18);
  --positive: #5cbe7e;
  --positive-soft: rgba(92, 190, 126, 0.18);
  --gold: #e8b25a;
  --gold-soft: rgba(232, 178, 90, 0.16);
}
:root[data-theme='light'] {
  --bg: #fbf6ef;
  --bg-glow-a: rgba(91, 75, 147, 0.05);
  --bg-glow-b: rgba(230, 127, 99, 0.05);
  --surface: #fffcf6;
  --surface-raised: #ffffff;
  --text: #211f3d;
  --muted: #8983a6;
  --border: rgba(33, 31, 61, 0.08);
  --border-strong: rgba(33, 31, 61, 0.16);
  --brand: #5b4b93;
  --brand-soft: rgba(91, 75, 147, 0.1);
  --accent: #e67f63;
  --accent-soft: rgba(230, 127, 99, 0.12);
  --alert: #c6432e;
  --alert-soft: rgba(198, 67, 46, 0.1);
  --positive: #3f9a5e;
  --positive-soft: rgba(63, 154, 94, 0.1);
  --gold: #d99a34;
  --gold-soft: rgba(217, 154, 52, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, var(--bg-glow-a), transparent 45%),
    radial-gradient(circle at 90% 30%, var(--bg-glow-b), transparent 40%),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.frame { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

@media (min-width: 600px) {
  .frame { padding: 1.75rem 2rem 4rem; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(155deg, var(--surface-raised) 0%, var(--surface) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 34px,
    transparent 34px 40px
  );
  opacity: 0.3;
  height: 3px;
  top: 0;
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; color: var(--text); }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: 0.01em; text-transform: uppercase; }
.logo-accent { color: var(--accent); }
.logo-tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.hero-icons { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.hero-mid { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1.5rem; gap: 1rem; }
.hero-headline { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.05; color: var(--text); text-transform: uppercase; }
.hero-sub { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin-top: 0.4rem; }
.date-pill { text-align: right; flex-shrink: 0; }
.date-num { font-family: var(--display); font-weight: 800; font-size: 2.1rem; color: var(--brand); line-height: 1; }
.date-txt { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 0.95rem; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--border-strong); }
.pwa-btn { border: 1px solid var(--border-strong); background: transparent; color: var(--text); font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; padding: 0.5rem 0.65rem; cursor: pointer; border-radius: 999px; }
.pwa-btn:hover, .pwa-btn.active { border-color: var(--gold); color: var(--gold); }
.icon-btn svg { display: block; }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-icon-btn { position: relative; }
.notification-status-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; top: 4px; right: 4px; background: var(--muted); border: 1px solid var(--surface); }
.notification-icon-btn.active { color: var(--gold); border-color: var(--gold); }
.notification-icon-btn.active .notification-status-dot { background: var(--positive); }

.alerts-icon-btn { position: relative; font-size: 1rem; }
.alerts-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 8px; background: var(--alert); color: #fff; font-family: var(--mono); font-size: 0.6rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1;
  border: 1px solid var(--surface-raised);
}

.league-pill {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.02em; padding: 0.4rem 0.75rem; border-radius: 999px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); color: var(--text);
  cursor: pointer; text-transform: uppercase;
}
.league-pill:hover { background: var(--brand-soft); }
.league-pill.active { background: linear-gradient(135deg, var(--brand), var(--accent)); border-color: transparent; color: #fff; font-weight: 600; }

/* ---------- Hash-mark divider (yard-line motif) ---------- */
.hash-rule {
  height: 10px; margin: 1.1rem 0;
  background-image: repeating-linear-gradient(90deg, var(--border-strong) 0 2px, transparent 2px 18px);
  background-position: center; background-repeat: repeat-x; background-size: auto 10px;
  opacity: 0.6;
}

/* ---------- Odds strip ---------- */
.odds-strip {
  display: flex; align-items: center; gap: 1.25rem; padding: 1rem 1.25rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.odds-number { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 1; min-width: 4.5rem; font-variant-numeric: tabular-nums; color: var(--brand); }
.odds-number.favored { color: var(--brand); }
.odds-number.underdog { color: var(--brand); }
.odds-mid { flex: 1; }
.odds-label { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.odds-bar { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.odds-bar-fill { height: 100%; background: linear-gradient(90deg, var(--alert), var(--gold), var(--positive)); }
.odds-points { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin-top: 0.5rem; }

.matchup-summary { color: var(--text); font-size: 0.9rem; line-height: 1.6; margin: 0 0.1rem 1.25rem; max-width: 78ch; }

/* ---------- Cards / bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.span2 { grid-column: span 2; }
.span4 { grid-column: span 4; }
@media (max-width: 700px) { .span2, .span4 { grid-column: span 4; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; display: flex; flex-direction: column;
}
#panel-live-matchup, #no-report-card { margin-bottom: 1rem; }
#panel-action-feed { margin-bottom: 1rem; }
#panel-start-sit { margin-bottom: 1rem; }
#panel-waiver-score { margin-bottom: 1rem; }
#panel-trade-machine { margin-bottom: 1rem; }
#panel-pending-trades { margin-bottom: 1rem; }
#panel-trades { margin-bottom: 1rem; }

.card-label {
  font-family: var(--mono); font-size: 0.7rem; color: var(--text); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.55rem; border-bottom: 1px solid var(--border); padding-bottom: 0.6rem;
}
.tag {
  font-family: var(--mono); font-size: 0.66rem; color: var(--brand); border: 1px solid var(--brand); background: var(--brand-soft);
  padding: 0.15rem 0.55rem; border-radius: 999px; font-weight: 600;
}
.tag-alt { color: var(--positive); border-color: var(--positive); background: var(--positive-soft); }
.empty-state { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0; }
.standings-note { font-size: 0.75rem; color: var(--muted); margin: -0.55rem 0 0.75rem; }

.notice-banner {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem;
  background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius);
  color: var(--text); font-size: 0.84rem; margin-bottom: 1rem;
}
.notice-banner-icon { color: var(--gold); flex-shrink: 0; }

/* ---------- Live Matchup ---------- */
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); display: inline-block; box-shadow: 0 0 0 0 var(--positive-soft); animation: live-pulse 2s infinite; margin-left: auto; }
.live-dot.live-dot-idle { background: var(--muted); animation: none; box-shadow: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 var(--positive-soft); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.live-score { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.live-score-side { text-align: center; flex: 1; }
.live-score-num { font-family: var(--display); font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; }
.live-score-team { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem; text-transform: uppercase; }
.live-score-sep {
  font-family: var(--mono); font-size: 0.68rem; color: var(--brand); font-weight: 700; text-transform: uppercase;
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--brand-soft);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.live-score-pending { display: flex; align-items: center; justify-content: center; gap: 0.75rem; font-family: var(--display); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; }
.live-score-pending-note { text-align: center; font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }

.ll-grid { display: grid; grid-template-columns: 76px 1fr 1fr; row-gap: 0.55rem; column-gap: 0.75rem; }
.ll-head { font-family: var(--mono); font-size: 0.62rem; color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.ll-slot { font-family: var(--mono); font-size: 0.64rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 0.2rem 0.3rem; text-align: center; align-self: center; }
.ll-player { font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; cursor: pointer; }
.ll-player:hover { color: var(--gold); }
.ll-badge { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; padding: 0.05rem 0.4rem; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); background: var(--gold-soft); }
.ll-badge.out { color: var(--alert); border-color: var(--alert); background: var(--alert-soft); }
.ll-pts { margin-left: auto; font-family: var(--mono); font-size: 0.74rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ll-pts-proj { color: var(--muted); font-weight: 600; }

/* ---------- Lineup ---------- */
.ss-row { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.ss-row:last-child { border-bottom: none; }
.ss-row.decision { background: var(--alert-soft); border-radius: var(--radius); padding: 0.7rem 0.65rem; margin: 0.15rem 0; border-bottom: none; border-left: 2px solid var(--alert); }
.ss-slot { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.3rem; }
.ss-line { font-size: 0.88rem; margin-bottom: 0.15rem; }
.ss-line strong { font-weight: 600; cursor: pointer; }
.ss-line strong:hover { color: var(--gold); }
.ss-sit { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; }
.ss-reasoning { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* ---------- Gameday panel (Sunday Command Center) ---------- */
.gameday-panel { background: var(--brand-soft); border: 1px solid var(--brand); border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 1.1rem; }
.gameday-label { font-family: var(--mono); font-size: 0.62rem; color: var(--brand); font-weight: 700; letter-spacing: 0.08em; margin-bottom: 0.7rem; }
.gameday-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 0.3rem; }
.gameday-stat-label { font-family: var(--mono); font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.2rem; }
.gameday-stat-value { font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--text); line-height: 1; }
.gameday-stat-trend { font-family: var(--mono); font-size: 0.68rem; margin-top: 0.2rem; min-height: 1em; }
.gameday-stat-trend.up { color: var(--positive); }
.gameday-stat-trend.down { color: var(--alert); }
.gameday-callout { font-size: 0.82rem; line-height: 1.5; padding: 0.55rem 0.7rem; border-radius: var(--radius); background: var(--surface-raised); margin-top: 0.55rem; }
.gameday-callout strong { font-weight: 700; }
.gameday-callout-danger { background: var(--alert-soft); color: var(--text); }

/* ---------- Waiver Score ---------- */
.wsc-row { display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.wsc-row:last-child { border-bottom: none; }
.wsc-score {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 1.05rem; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
}
.wsc-body { flex: 1; min-width: 0; }
.wsc-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.wsc-name { font-size: 0.9rem; font-weight: 700; cursor: pointer; color: var(--text); }
.wsc-name:hover { color: var(--gold); }
.wsc-meta { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); }
.wsc-breakdown { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); margin-top: 0.4rem; }
.wsc-breakdown strong { cursor: pointer; color: var(--text); }
.wsc-breakdown strong:hover { color: var(--gold); }
.wsc-faab { font-size: 0.8rem; color: var(--text); margin-top: 0.4rem; }
.wsc-faab strong { color: var(--positive); }

/* ---------- Start/Sit Decision Center ---------- */
.ssd-row { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.ssd-row:last-child { border-bottom: none; }
.ssd-slot { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.65rem; }
.ssd-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.75rem; align-items: start; margin-bottom: 0.75rem; }
.ssd-player-name { font-size: 0.92rem; font-weight: 700; cursor: pointer; color: var(--text); }
.ssd-player-name:hover { color: var(--gold); }
.ssd-player.winner .ssd-player-name { color: var(--positive); }
.ssd-player-stats { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.7; }
.ssd-vs { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); align-self: center; padding-top: 0.2rem; }
.ssd-verdict { font-family: var(--mono); font-size: 0.64rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.3rem; }
.ssd-reasoning { font-size: 0.82rem; color: var(--text); line-height: 1.5; }

.tm-label { display: block; font-family: var(--mono); font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.tm-select { margin-bottom: 1rem; cursor: pointer; }
.tm-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 700px) { .tm-columns { grid-template-columns: 1fr; } }
.tm-column-label { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.tm-roster-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.tm-roster-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.84rem; }
.tm-roster-row:last-child { border-bottom: none; }
.tm-roster-row:hover { background: var(--brand-soft); }
.tm-roster-row input[type="checkbox"] { flex-shrink: 0; accent-color: var(--brand); width: 1rem; height: 1rem; }
.tm-roster-name { font-weight: 600; color: var(--text); }
.tm-roster-meta { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); margin-left: auto; text-align: right; white-space: nowrap; }
.tm-evaluate-btn { margin-bottom: 0; }
.tm-result { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.tm-grade-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.85rem; }
.tm-grade {
  font-family: var(--display); font-weight: 800; font-size: 2.2rem; line-height: 1;
  min-width: 3.2rem; text-align: center; color: var(--positive);
}
.tm-grade-B { color: var(--gold); }
.tm-grade-C { color: var(--muted); }
.tm-grade-D, .tm-grade-F { color: var(--alert); }
.tm-grade-values { font-size: 0.84rem; color: var(--text); line-height: 1.7; }
.tm-grade-values strong { font-family: var(--mono); }
.tm-fit-head { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0.75rem 0 0.4rem; }
.tm-fit-list { list-style: none; margin: 0; padding: 0; font-size: 0.82rem; color: var(--text); line-height: 1.7; }
.tm-fit-list strong, .tm-fit-list span[data-player] { cursor: pointer; }
.tm-fit-list strong:hover, .tm-fit-list span[data-player]:hover { color: var(--gold); }

/* ---------- Action Feed ---------- */
.af-row { padding: 0.85rem 0; border-bottom: 1px solid var(--border); display: flex; gap: 0.75rem; align-items: flex-start; }
.af-row:last-child { border-bottom: none; }
.af-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.af-icon.type-alert { background: var(--alert-soft); color: var(--alert); }
.af-icon.type-decision { background: var(--brand-soft); color: var(--brand); }
.af-icon.type-waiver { background: var(--positive-soft); color: var(--positive); }
.af-body { flex: 1; min-width: 0; }
.af-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.af-meta { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); margin-top: 0.15rem; text-transform: uppercase; letter-spacing: 0.02em; }
.af-why-btn {
  font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--muted); background: none; border: none; cursor: pointer; padding: 0.35rem 0 0;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px;
}
.af-why-btn:hover { color: var(--brand); }
.af-detail { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin-top: 0.4rem; display: none; }
.af-detail.visible { display: block; }

/* ---------- Alerts ---------- */
.al-row { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.al-row:last-child { border-bottom: none; }
.al-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.al-badge { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.15rem 0.5rem; border-radius: 999px; flex-shrink: 0; font-weight: 600; }
.al-badge.critical { color: var(--alert); background: var(--alert-soft); border: 1px solid var(--alert); }
.al-badge.medium { color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold); }
.al-player { font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.al-player:hover { color: var(--gold); }
.al-meta { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }
.al-detail { font-size: 0.84rem; color: var(--text); line-height: 1.55; white-space: pre-line; margin-bottom: 0.5rem; }
.al-time { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); margin-bottom: 0.55rem; }
.al-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.al-btn {
  font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 0.4rem 0.75rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-raised); color: var(--text); cursor: pointer;
}
.al-btn:hover { border-color: var(--brand); color: var(--brand); }
.al-btn:disabled { opacity: 0.55; cursor: default; }
.al-btn.dismiss:hover { border-color: var(--alert); color: var(--alert); }
.al-suggestion {
  margin-top: 0.6rem; padding: 0.65rem 0.75rem; background: var(--gold-soft);
  border-left: 2px solid var(--gold); border-radius: var(--radius); font-size: 0.82rem; line-height: 1.55;
}
.al-suggestion-label { font-family: var(--mono); font-size: 0.6rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.al-suggestion-item { margin-top: 0.4rem; }
.al-suggestion-item strong { cursor: pointer; }
.al-suggestion-item strong:hover { color: var(--gold); }

/* ---------- Waiver Wire ---------- */

/* ---------- Pending Trades ---------- */
.pending-verdict { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.15rem 0.5rem; border-radius: 999px; margin-left: 0.5rem; vertical-align: middle; }
.pending-verdict.verdict-accept { color: var(--positive); background: var(--positive-soft); border: 1px solid var(--positive); }
.pending-verdict.verdict-lean_accept { color: var(--positive); background: var(--positive-soft); border: 1px solid var(--positive); }
.pending-verdict.verdict-decline { color: var(--alert); background: var(--alert-soft); border: 1px solid var(--alert); }
.pending-verdict.verdict-lean_decline { color: var(--alert); background: var(--alert-soft); border: 1px solid var(--alert); }

.trade-grade-badge {
  font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem; border-radius: 999px; margin-left: 0.5rem; vertical-align: middle;
  color: var(--positive); background: var(--positive-soft); border: 1px solid var(--positive);
}
.trade-grade-badge.tsg-grade-B { color: var(--gold); background: var(--gold-soft); border-color: var(--gold); }
.trade-grade-badge.tsg-grade-C { color: var(--muted); background: rgba(137, 131, 166, 0.1); border-color: var(--border-strong); }
.trade-grade-badge.tsg-grade-D, .trade-grade-badge.tsg-grade-F { color: var(--alert); background: var(--alert-soft); border-color: var(--alert); }

/* ---------- Trade Suggestions ---------- */
.trade-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
@media (max-width: 720px) { .trade-grid { grid-template-columns: 1fr; } }
.trade-card { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; }
.trade-head { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.6rem; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.trade-cols { display: flex; gap: 1.5rem; margin-bottom: 0.6rem; }
.trade-col-label { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.trade-col ul { margin: 0; padding-left: 1.1rem; font-size: 0.84rem; }
.trade-col li { cursor: pointer; }
.trade-col li:hover { color: var(--gold); }
.trade-reasoning { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* ---------- Standings (with merged power rankings) ---------- */
.st-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.st-table th { text-align: left; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.st-table td { padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.st-table tr:last-child td { border-bottom: none; }
.st-table tr.me td { font-weight: 700; color: var(--gold); }
.st-table td:first-child, .st-table th:first-child { width: 1.6rem; color: var(--muted); font-family: var(--mono); }
.empty-state-inline { color: var(--muted); }

.st-power { display: flex; align-items: center; gap: 0.4rem; }
.st-rank-badge { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.pr-move { font-family: var(--mono); font-size: 0.66rem; }
.pr-move.up { color: var(--positive); }
.pr-move.down { color: var(--alert); }
.pr-move.flat { color: var(--muted); }
.pr-blurb { font-size: 0.78rem; color: var(--muted); line-height: 1.45; }

.st-table tr.st-expandable { cursor: pointer; }
.st-table tr.st-expandable:hover td { color: var(--gold); }
.st-table tr.st-expandable.me:hover td { color: var(--gold); }
.st-chevron { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-left: auto; display: inline-block; transition: transform 0.15s ease; }
.st-chevron.expanded { transform: rotate(90deg); }
.st-blurb-row td { padding: 0 0.5rem 0.65rem 0; border-bottom: 1px solid var(--border); }
.st-blurb-row:last-child td { border-bottom: none; }

/* ---------- Clickable team names ---------- */
.st-table td[data-team] { cursor: pointer; text-decoration-line: underline; text-decoration-style: dotted; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.st-table td[data-team]:hover { color: var(--gold); }

/* ---------- Team popup ---------- */
.team-schedule-row { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.82rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.team-schedule-row:last-child { border-bottom: none; }
.team-schedule-week { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); flex-shrink: 0; }
.team-schedule-result { font-family: var(--mono); font-weight: 700; padding: 0 0.3rem; border-radius: 2px; }
.team-schedule-w { color: var(--positive); }
.team-schedule-l { color: var(--alert); }
.team-schedule-t { color: var(--muted); }
.team-schedule-playoffs { color: var(--muted); font-style: italic; }
.team-roster-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.82rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.team-roster-row:last-child { border-bottom: none; }
.team-roster-row:hover { color: var(--gold); }
.team-roster-pos { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }

/* ---------- Player popup ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 8, 6, 0.55); }
@media (min-width: 600px) { .modal { align-items: center; } }
/* Player popups can be opened from inside an open team popup (clicking a roster
   row), but never the reverse — so player-modal must always win the stack, not
   just whichever happens to come later in the DOM. */
#player-modal { z-index: 1001; }
.modal-card {
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: var(--radius);
  width: min(480px, 100%); max-height: 85vh; overflow-y: auto; padding: 1.5rem; position: relative;
  border-top: 3px solid var(--brand);
}
.modal-close {
  position: absolute; top: 0.9rem; right: 0.9rem; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 0.85rem;
}
.player-modal-head { margin-bottom: 1.1rem; padding-right: 2rem; }
.player-modal-name { font-family: var(--display); font-weight: 800; font-size: 1.6rem; text-transform: uppercase; line-height: 1.05; }
.player-modal-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.3rem; }
.player-modal-section { margin-bottom: 1rem; }
.player-modal-section:last-child { margin-bottom: 0; }
.player-modal-label { font-family: var(--mono); font-size: 0.62rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.player-modal-text { font-size: 0.87rem; line-height: 1.55; color: var(--text); white-space: pre-line; }
.player-sources { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.player-source { font-family: var(--mono); font-size: 0.68rem; color: var(--gold); border: 1px solid var(--border-strong); padding: 0.35rem 0.5rem; text-decoration: none; border-radius: 999px; }
.player-source:hover { border-color: var(--gold); }

/* ---------- System settings modal ---------- */
.system-settings-card { width: min(720px, 100%); border-top-color: var(--gold); }
.system-settings-head { padding-right: 2.25rem; margin-bottom: 1rem; }
.system-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; margin-bottom: 1.1rem; }
.system-tab { min-height: 42px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; cursor: pointer; border-radius: var(--radius); }
.system-tab:hover { border-color: var(--border-strong); color: var(--text); }
.system-tab.active { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.system-settings-status { min-height: 1.2rem; margin-bottom: 0.6rem; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.system-settings-status.success { color: var(--positive); }
.system-settings-status.error { color: var(--alert); }
.system-config-group { background: var(--surface); border: 1px solid var(--border); padding: 1rem; margin-bottom: 0.75rem; border-radius: var(--radius); }
.system-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.system-field { min-width: 0; }
.system-field > span { display: block; margin-bottom: 0.3rem; font-size: 0.78rem; font-weight: 600; }
.system-field .text-input { width: 100%; margin: 0; }
.system-field small { display: block; margin-top: 0.25rem; color: var(--muted); font-family: var(--mono); font-size: 0.58rem; overflow-wrap: anywhere; }
.system-actions { display: flex; justify-content: flex-end; gap: 0.55rem; margin-top: 1rem; }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 0.65rem 1rem; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; cursor: pointer; border-radius: 999px; }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.system-health-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 0.75rem; }
.system-health-card { background: var(--surface); border: 1px solid var(--border); padding: 0.85rem; min-height: 88px; border-radius: var(--radius); }
.system-health-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; }
.health-state { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; }
.health-state i, .health-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.health-state.ok { color: var(--positive); }
.health-state.ok i, .health-dot.ok { background: var(--positive); }
.health-state.warn { color: var(--gold); }
.health-state.warn i { background: var(--gold); }
.system-health-detail { color: var(--muted); font-family: var(--mono); font-size: 0.68rem; margin-top: 0.75rem; }
.provider-status-row, .notification-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: 0.78rem; }
.provider-status-row:last-child { border-bottom: 0; }
.report-run-log { margin-top: 0.75rem; max-height: 220px; overflow-y: auto; overflow-x: auto; background: var(--bg); border: 1px solid var(--border); padding: 0.65rem; font-family: var(--mono); font-size: 0.65rem; line-height: 1.5; color: var(--muted); white-space: pre; border-radius: var(--radius); }
.provider-status-row strong { font-family: var(--mono); font-size: 0.68rem; color: var(--positive); text-transform: uppercase; }
.notification-settings-row > span { display: flex; align-items: center; gap: 0.4rem; }
.system-auth-message { padding: 0.75rem 0; }
@media (max-width: 600px) {
  .frame { padding: 1rem 0.75rem 3rem; }
  .hero { padding: 1.25rem 1rem 1.4rem; }
  .hero-top { display: block; }
  .hero-icons {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
  }
  #league-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    grid-column: 1 / -1;
    width: 100%;
  }
  .league-pill { width: 100%; min-height: 38px; padding: 0.45rem 0.35rem; line-height: 1.15; }
  .hero-icons .pwa-btn { grid-column: 1; justify-self: start; }
  .hero-icons .icon-btn { position: absolute; top: 1rem; width: 36px; height: 36px; }
  #notifications-btn { right: 3.65rem; }
  #system-settings-btn { right: 1rem; }
  #logout-btn { right: 6.3rem; }
  #alerts-btn { right: 8.95rem; }
  .hero-mid { margin-top: 1.35rem; align-items: flex-end; }
  .hero-headline { overflow-wrap: anywhere; font-size: 1.05rem; }
  .modal { padding-top: env(safe-area-inset-top); }
  .system-settings-card {
    max-height: calc(100dvh - env(safe-area-inset-top));
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.15rem;
    padding-bottom: max(1.15rem, env(safe-area-inset-bottom));
  }
  .system-settings-head { margin-bottom: 0.75rem; }
  .system-settings-head .player-modal-name { font-size: 1.35rem; }
  .system-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.3rem; margin-bottom: 0.75rem; }
  .system-tab { min-height: 38px; padding: 0.35rem 0.2rem; font-size: 0.57rem; line-height: 1.15; }
  .system-field-grid, .system-health-summary { grid-template-columns: 1fr; }
  .system-actions { flex-direction: column; }
  .system-actions > * { width: 100%; }
  .system-auth-message .settings-dashboard-link { width: 100%; }
}

/* ---------- Pull to refresh (standalone PWA only — see pull-to-refresh.js) ---------- */
#ptr-indicator {
  position: fixed; top: 0; left: 50%; width: 36px; height: 36px;
  margin-left: -18px; margin-top: -44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-raised); border: 1px solid var(--border-strong); color: var(--muted);
  z-index: 999; pointer-events: none; opacity: 0;
  transition: margin-top 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}
#ptr-indicator.ptr-ready { color: var(--positive); border-color: var(--positive); }
#ptr-indicator.ptr-spinning { transition: opacity 0.2s ease, color 0.2s ease; }
#ptr-indicator.ptr-spinning svg { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #ptr-indicator.ptr-spinning svg { animation: none; } }

/* ---------- Footer ---------- */
.app-footer { text-align: center; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); padding: 1.75rem 0 2rem; letter-spacing: 0.03em; }
.footer-version { font: inherit; letter-spacing: inherit; color: var(--brand); background: none; border: 0; padding: 0.15rem 0.2rem; cursor: pointer; border-radius: 4px; }
.footer-version:hover { color: var(--accent); }
.footer-version:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#whatsnew-body { display: grid; gap: 1.1rem; margin-top: 0.75rem; max-height: 65vh; overflow-y: auto; }
.whatsnew-version { border-top: 1px solid var(--border); padding-top: 0.8rem; }
.whatsnew-version:first-child { border-top: 0; padding-top: 0; }
.whatsnew-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.whatsnew-v { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.whatsnew-version.current .whatsnew-v { color: var(--positive); font-weight: 700; }
.whatsnew-title { font-weight: 700; font-size: 0.95rem; }
.whatsnew-version ul { margin: 0.4rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.whatsnew-version li { font-size: 0.84rem; line-height: 1.45; }

/* ---------- Settings / auth (settings.html) ---------- */
#auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.signin-card {
  width: min(380px, 90vw); padding: 2.5rem 2rem; border-radius: var(--radius); text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong); border-top: 3px solid var(--brand);
}
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.8rem; text-transform: uppercase; }
.tagline { color: var(--muted); margin: 0.4rem 0 1.75rem; font-size: 0.88rem; }
.tagline a { color: var(--gold); }
.text-input {
  display: block; width: 100%; padding: 0.75rem 0.9rem; background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text);
  font-family: var(--body); font-size: 0.9rem; margin-bottom: 0.85rem;
}
.text-input:focus { outline: none; border-color: var(--brand); }
.btn-primary {
  width: 100%; padding: 0.85rem 1rem; border: none; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em;
}
.btn-primary:hover { filter: brightness(1.1); }
.signin-status { color: var(--muted); font-family: var(--mono); font-size: 0.76rem; min-height: 1.2em; margin-top: 1rem; }
.settings-note { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.85rem; line-height: 1.5; }
.league-checklist { margin-bottom: 1rem; }
.league-check-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.league-check-row:last-child { border-bottom: none; }
.connected-leagues-list { margin: 0 0 1.25rem; padding-left: 1.2rem; font-size: 0.88rem; }
#panel-connect { margin-bottom: 1rem; }
.settings-dashboard-link { display: inline-flex; width: auto; padding: 0.7rem 1.4rem; text-decoration: none; border-radius: 999px; }
.hero-admin { padding: 1.25rem 1.5rem; }

.daily-report-health { display: inline-flex; align-items: center; gap: 0.4rem; }
.daily-report-health::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #c58b18; flex-shrink: 0; }
.daily-report-health.ready::before { background: var(--positive); }
.daily-report-health.stale::before { background: var(--negative, #c94040); }

.health-state.warn i { background: #c58b18; }
.health-state.stale i { background: var(--negative, #c94040); }
