/* ============================================================
   Baseline — app layer (rankings)
   Server-rendered translation of the design kit's window-attached
   primitives (ui_kits/_shared/baseline-kit.jsx) + Rankings.jsx into
   plain CSS classes. Dimensions/colors match the prototype exactly.
   Build with the semantic token aliases only — never raw values.
   ============================================================ */

/* ---- Top nav (green header) ---- */
.bl-header { background: var(--surface-header); color: #fff; }
.bl-header-inner {
  max-width: 1320px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; padding: 0 20px; height: 54px;
}
.bl-brand { display: flex; align-items: center; gap: 11px; flex: none; }
.bl-brand-text { display: flex; flex-direction: column; line-height: 1; }
.bl-brand-title {
  font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
}
.bl-brand-sub { font-size: 10.5px; font-weight: 500; opacity: 0.8; margin-top: 2px; }
.bl-nav { display: flex; align-items: center; gap: 2px; }
.bl-nav a {
  padding: 7px 12px; border-radius: 6px; font-size: 14px; font-weight: 600; color: #fff;
  background: transparent; transition: background var(--dur-fast);
}
.bl-nav a:hover { background: oklch(1 0 0 / 0.10); }
.bl-nav a.active { background: oklch(1 0 0 / 0.18); }
.bl-run {
  margin-left: 10px; height: 30px; padding: 0 11px; display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600; border-radius: 6px; cursor: pointer;
  background: oklch(1 0 0 / 0.14); color: #fff; border: 1px solid oklch(1 0 0 / 0.3);
}
.bl-run:hover { background: oklch(1 0 0 / 0.22); }

/* ---- Toolbars ---- */
.bl-toolbar { background: var(--surface-toolbar); border-bottom: 1px solid var(--border-subtle); }
.bl-toolbar--card { background: var(--surface-card); }
.bl-toolbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px 20px;
}
.bl-field { display: inline-flex; align-items: center; gap: 7px; }
.bl-field > .bl-field-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.bl-select-wrap { position: relative; display: inline-flex; }
.bl-select-wrap::after {
  content: '\25BE'; position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  pointer-events: none; font-size: 10px; color: var(--text-muted);
}
.bl-select {
  appearance: none; -webkit-appearance: none; height: 32px; padding: 0 28px 0 10px;
  font-family: var(--font-text); font-size: 13px; font-weight: 500; color: var(--text-primary);
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 6px; cursor: pointer;
}
.bl-input {
  height: 32px; padding: 0 10px; font-family: var(--font-text); font-size: 13px;
  color: var(--text-primary); background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: 6px;
}

/* ---- Sort pills ---- */
.bl-sortpills { display: inline-flex; align-items: center; gap: 7px; }
.bl-sortpills-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.bl-pills { display: inline-flex; gap: 5px; }
.bl-pill {
  height: 28px; padding: 0 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 6px;
  border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-secondary);
}
.bl-pill.active { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ---- Container helpers ---- */
.bl-container { max-width: 1320px; margin: 0 auto; padding: 0 20px; }

/* ---- Entries row ---- */
.bl-entries { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 12px; }
.bl-entries-left { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.bl-entries-right { font-size: 13px; color: var(--text-muted); }

/* ---- Table ---- */
.bl-tablescroll { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 8px; }
.bl-table { min-width: 920px; }
.bl-thead, .bl-row {
  display: grid; grid-template-columns: var(--bl-grid-cols); gap: 12px; align-items: center;
}
.bl-thead {
  padding: 9px 16px; background: var(--surface-th); border-bottom: 1px solid var(--border-default);
}
.bl-th {
  font-family: var(--font-text); font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.bl-th.num { justify-content: flex-end; text-align: right; }
.bl-th .caret { font-size: 8px; color: var(--text-faint); }

.bl-row {
  padding: 10px 16px; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle);
}
.bl-row:nth-child(even) { background: var(--surface-zebra); }
.bl-row.me { background: var(--green-50); box-shadow: inset 3px 0 0 var(--brand); }

.bl-cell-num { text-align: right; }

.bl-rank { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.bl-rank.gold { font-weight: 800; color: var(--rank-gold); }
.bl-rank.bronze { font-weight: 800; color: var(--rank-bronze); }

.bl-school { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; min-width: 0; }
.bl-row.me .bl-school { font-weight: 700; }

/* Team logos: small school marks rendered inline beside team names
   (rankings, standings, schedules). Scales with the surrounding text. */
.team-logo-img { flex: 0 0 auto; height: 1.4em; width: auto; object-fit: contain; vertical-align: -0.35em; }

.bl-badge {
  display: inline-flex; align-items: center; justify-content: center; height: 20px; padding: 0 9px;
  border-radius: var(--radius-pill); color: #fff; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.01em; white-space: nowrap;
}
.bl-badge.tier-P5 { background: var(--cat-6a); }
.bl-badge.tier-MID { background: var(--cat-5a); }
.bl-badge.tier-IVY { background: var(--cat-sm); }
.bl-badge.tier-D1 { background: var(--gray-500); }
.bl-badge.tier-D2 { background: var(--rank-bronze); }
.bl-badge.tier-D3 { background: var(--gray-600); }

.bl-confrk { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.bl-confrk.bronze { color: var(--rank-bronze); }
.bl-confrk.lead { font-weight: 700; color: var(--rank-bronze); }

.bl-conf { font-size: 13px; color: var(--text-secondary); }
.bl-rec { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--text-primary); }
.bl-crec { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--text-secondary); }

.bl-h2h {
  display: inline-flex; align-items: center; justify-content: center; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bl-h2h.win { background: var(--tint-win-bg); color: var(--tint-win-fg); }
.bl-h2h.loss { background: var(--tint-loss-bg); color: var(--tint-loss-fg); }
.bl-h2h.even { background: var(--tint-even-bg); color: var(--tint-even-fg); }

.bl-stat {
  font-family: var(--font-text); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
  font-weight: 600; font-size: 14px; color: var(--text-primary);
}
.bl-stat.power { font-weight: 700; color: var(--stat-power); }
.bl-stat.good { color: var(--stat-good); }
.bl-stat.muted { color: var(--stat-muted); }

/* ---- Pagination ---- */
.bl-pager {
  max-width: 1320px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.bl-pager-info { font-size: 12.5px; color: var(--text-muted); }
.bl-pagination { display: flex; align-items: center; gap: 6px; }
.bl-pgbtn {
  min-width: 34px; height: 32px; padding: 0 10px; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 6px; border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-secondary);
}
.bl-pgbtn.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.bl-pgbtn.disabled { opacity: 0.45; pointer-events: none; }

/* ---- Footnotes ---- */
.bl-notes { max-width: 1320px; margin: 0 auto; padding: 0 20px 50px; display: flex; flex-direction: column; gap: 12px; }
.bl-note {
  background: var(--surface-subtle); border: 1px solid var(--border-subtle); border-radius: 8px;
  padding: 13px 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.55;
}
.bl-note strong { color: var(--text-primary); }
.bl-note a { color: var(--text-link); font-weight: 600; }
.bl-note.new {
  background: var(--green-50); border-color: var(--green-200); border-left: 3px solid var(--brand);
  color: var(--green-800);
}
.bl-note.new strong { color: var(--green-800); }
.bl-note.new a { color: var(--brand-strong); font-weight: 700; }

/* ---- Methodology (prose) ---- */
.bl-prose { max-width: 820px; margin: 0 auto; padding: 28px 20px 64px; }
.bl-prose h1 { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.015em; color: var(--text-primary); }
.bl-prose .lede { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-top: 8px; }
.bl-prose h2 { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--text-primary); margin-top: 34px; padding-bottom: 8px; border-bottom: 1px solid var(--border-subtle); }
.bl-prose h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-top: 22px; }
.bl-prose p { font-size: 14px; color: var(--text-secondary); line-height: 1.62; margin-top: 10px; }
.bl-prose ul { font-size: 14px; color: var(--text-secondary); line-height: 1.62; padding-left: 20px; }
.bl-prose strong { color: var(--text-primary); }
.bl-formula {
  font-family: var(--font-mono); font-size: 13.5px; color: var(--text-primary);
  background: var(--surface-subtle); border: 1px solid var(--border-subtle); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 12px 14px; margin: 14px 0; overflow-x: auto; white-space: pre;
}
.bl-protable { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13.5px; }
.bl-protable th, .bl-protable td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); }
.bl-protable thead th { background: var(--surface-th); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--ls-eyebrow); color: var(--text-muted); font-weight: 600; }
.bl-protable td.w { font-variant-numeric: tabular-nums; color: var(--stat-good); font-weight: 700; }
.bl-protable tbody tr:nth-child(even) { background: var(--surface-zebra); }
.bl-toc { background: var(--surface-subtle); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 14px 16px; margin-top: 18px; }
.bl-toc-title { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--ls-eyebrow); color: var(--text-muted); font-weight: 600; }
.bl-toc ul { columns: 2; margin: 8px 0 0; }
.bl-toc a { color: var(--text-link); font-weight: 600; }

/* ---- Team crest ---- */
.bl-crest {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 6px; color: #fff; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em;
}
.bl-crest.xs { width: 20px; height: 20px; font-size: 7px; }
.bl-crest.sm { width: 24px; height: 24px; font-size: 8px; }
.bl-crest.md { width: 30px; height: 30px; font-size: 10px; }
.bl-crest.lg { width: 40px; height: 40px; font-size: 12px; }
/* Logo variant: white pad behind the transparent ESPN mark. */
.bl-crest.has-logo { background: #fff; padding: 2px; }
.bl-crest.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---- Sim setup ---- */
.bl-setup { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.bl-setup h1 { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.015em; color: var(--text-primary); }
.bl-setup .intro { font-size: 14.5px; color: var(--text-secondary); margin: 8px 0 22px; max-width: 560px; line-height: 1.5; }
.bl-slots { display: flex; align-items: flex-end; gap: 14px; }
.bl-slot { flex: 1; min-width: 0; }
.bl-slot-card {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: 8px;
}
.bl-slot select.bl-select { border: none; background: transparent; font-size: 17px; font-weight: 700; padding: 0 22px 0 0; height: auto; }
.bl-slot-meta { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 12.5px; color: var(--text-muted); }
.bl-vs {
  margin-bottom: 13px; display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-default); background: var(--surface-card);
  font-size: 12px; font-weight: 700; color: var(--text-muted);
}
.bl-config { margin-top: 22px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 4px 18px 16px; }
.bl-cfgrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border-subtle); }
.bl-cfgrow:last-child { border-bottom: none; }
.bl-cfgrow .lbl { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.bl-cfgrow .hint { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.bl-seg { display: inline-flex; gap: 5px; }
.bl-seg button {
  height: 30px; padding: 0 12px; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px;
  border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-secondary);
}
.bl-seg button.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.bl-run-big {
  margin-top: 20px; width: 100%; height: 44px; font-size: 15px; font-weight: 600; cursor: pointer;
  border-radius: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
}
.bl-engine-note { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.bl-engine-note code { font-family: var(--font-mono); }

/* ---- Scoreboard / dual result ---- */
.bl-board { max-width: 1180px; margin: 0 auto; padding: 22px 20px 50px; }
.bl-scorehdr {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 18px 22px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; margin-bottom: 18px;
}
.bl-scorehdr .team { display: flex; align-items: center; gap: 12px; }
.bl-scorehdr .team.away { justify-content: flex-end; }
.bl-scorehdr .tname { font-size: 18px; font-weight: 700; }
.bl-scorehdr .tsub { font-size: 12.5px; color: var(--text-muted); }
.bl-bigscore { display: flex; align-items: center; gap: 14px; justify-content: center; }
.bl-bigscore .n { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--text-primary); }
.bl-bigscore .n.win { color: var(--brand-strong); }
.bl-bigscore .dash { font-size: 22px; color: var(--text-faint); }
.bl-scorehdr .status { text-align: center; }

.bl-board-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 880px) { .bl-board-grid { grid-template-columns: 1fr; } }

.bl-panel { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 8px; }
.bl-panel-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.bl-panel-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.bl-panel-meta { font-size: 12px; color: var(--text-muted); }
.bl-panel-body { padding: 16px; }

.bl-matchrow {
  display: grid; grid-template-columns: 52px 1fr 86px; gap: 14px; align-items: center; padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.bl-matchrow:last-child { border-bottom: none; }
.bl-matchrow.clinch { background: var(--green-50); box-shadow: inset 3px 0 0 var(--brand); }
.bl-court { display: flex; flex-direction: column; }
.bl-court .kind { font-size: 9.5px; text-transform: uppercase; letter-spacing: var(--ls-eyebrow); color: var(--text-muted); font-weight: 600; }
.bl-court .num { font-size: 17px; font-weight: 800; color: var(--text-secondary); line-height: 1.1; }
.bl-match-sides { border-left: 1px solid var(--border-subtle); padding-left: 14px; }
.bl-side { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 4px 0; }
.bl-side .nm { font-size: 14px; color: var(--text-primary); white-space: nowrap; }
.bl-side.won .nm { font-weight: 700; }
.bl-side .nm .chk { color: var(--stat-good); font-size: 12px; font-weight: 800; margin-right: 6px; }
.bl-setnums { display: flex; align-items: center; gap: 5px; }
.bl-setnums .g { min-width: 15px; text-align: center; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 400; }
.bl-setnums .g.w { color: var(--text-primary); font-weight: 700; }
.bl-final { font-size: 11px; text-transform: uppercase; letter-spacing: var(--ls-eyebrow); color: var(--text-faint); font-weight: 600; text-align: right; }
.bl-final.unfinished { font-style: italic; }

.bl-winprob-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.bl-winprob-bar { height: 9px; border-radius: var(--radius-pill); overflow: hidden; display: flex; background: var(--gray-200); }
.bl-winprob-note { margin: 12px 0 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.bl-clinchrow { display: flex; align-items: center; justify-content: space-between; }
.bl-clinch-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.bl-pips { display: flex; gap: 5px; }
.bl-pip { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--border-default); }

/* ---- Bracket ---- */
.bl-champ {
  display: flex; align-items: center; gap: 18px; background: var(--green-50);
  border: 1px solid var(--green-200); border-left: 4px solid var(--brand); border-radius: 10px;
  padding: 20px 24px; margin-bottom: 18px;
}
.bl-champ .label { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--ls-eyebrow); color: var(--brand-strong); font-weight: 700; }
.bl-champ .name { font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--text-primary); letter-spacing: -0.015em; }
.bl-champ .sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.bl-rounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.bl-brk-match {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center;
  padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); font-size: 13px;
}
.bl-brk-match:last-child { border-bottom: none; }
.bl-brk-seed { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; text-align: right; }
.bl-brk-team { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bl-brk-team .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-brk-win .nm { font-weight: 700; color: var(--text-primary); }
.bl-brk-lose .nm { color: var(--text-muted); }
.bl-upset { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tint-loss-fg); background: var(--tint-loss-bg); border-radius: 4px; padding: 1px 4px; margin-left: 6px; }

/* ============================================================
   Box score — position ↔ player identity
   ============================================================ */
.bl-court-team { color: var(--text-muted); font-size: 12px; font-weight: 500; margin-left: 3px; }
.bl-side .nm .player-flag { margin-right: 2px; }

/* ============================================================
   Team page — results rail
   ============================================================ */
.bl-results { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; }
.bl-result {
  display: grid; grid-template-columns: 26px 20px 1fr auto auto; gap: 8px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--border-subtle);
}
.bl-result:last-child { border-bottom: none; }
.bl-result:hover { background: var(--surface-hover); }
.bl-result .ha { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.bl-result .opp { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-result .tag { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: var(--ls-eyebrow); }

/* ============================================================
   Schedule — real-sport row layout
   ============================================================ */
.bl-sched-head, .bl-sched-row {
  display: grid; grid-template-columns: 138px 30px 1fr 96px 104px; gap: 12px; align-items: center;
}
.bl-sched-head {
  padding: 10px 18px; background: var(--surface-th); border-bottom: 1px solid var(--border-default);
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
  color: var(--text-muted); font-weight: 600;
}
.bl-sched-row { padding: 11px 18px; border-bottom: 1px solid var(--border-subtle); color: inherit; }
.bl-sched-row:last-child { border-bottom: none; }
.bl-sched-row.is-final { cursor: pointer; }
.bl-sched-row.is-final:hover { background: var(--surface-hover); }
.bl-sched-row .c-date { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.bl-sched-row .c-date .wk { font-size: 10.5px; font-weight: 500; color: var(--text-faint); margin-top: 1px; }
.bl-sched-row .c-site { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.bl-sched-row .c-opp { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bl-sched-row .c-opp .nm { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-sched-row .c-res { display: flex; align-items: center; gap: 8px; }
.bl-sched-row .c-res .score { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; }
.bl-sched-row .c-res .upcoming { font-size: 12px; color: var(--text-faint); }

.bl-tag { display: inline-flex; height: 19px; align-items: center; padding: 0 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; white-space: nowrap; }
.bl-tag.conf { background: var(--green-100); color: var(--green-800); }
.bl-tag.nc { background: var(--gray-150); color: var(--text-muted); }

/* Win/loss chip — shared by the results rail and schedule */
.wl { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl.win { background: var(--tint-win-bg); color: var(--tint-win-fg); }
.wl.loss { background: var(--tint-loss-bg); color: var(--tint-loss-fg); }

/* ============================================================
   Explainer (details / summary) — "how it works" panels
   ============================================================ */
.bl-explainer { margin: 14px 0 4px; background: var(--surface-subtle); border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; }
.bl-explainer > summary { cursor: pointer; padding: 12px 16px; font-size: 13.5px; font-weight: 700; color: var(--text-primary); list-style: none; display: flex; align-items: center; gap: 8px; }
.bl-explainer > summary::before { content: '\25B8'; color: var(--text-muted); transition: transform var(--dur-fast) var(--ease-in-out); }
.bl-explainer[open] > summary::before { transform: rotate(90deg); }
.bl-explainer > summary::-webkit-details-marker { display: none; }
.bl-explainer-body { padding: 2px 16px 14px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.bl-explainer-body p { margin: 0 0 8px; }
.bl-explainer-body ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.bl-explainer-body strong { color: var(--text-primary); }

/* ============================================================
   Responsive
   Templates set many grids + control widths inline, so the rules
   below override with !important on narrow viewports. Goal: nothing
   overflows the viewport; controls are tappable full-width.
   ============================================================ */

/* Global safety nets — never let media/controls force horizontal overflow. */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, table { max-width: 100%; }
.bl-select, .bl-input { max-width: 100%; }

/* Player honors badges (All-American / All-Conference). */
.pl-honors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pl-honor {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill);
  color: var(--text-secondary); background: var(--surface-subtle); border: 1px solid var(--border-subtle);
}
.pl-honor.aa { color: #8a5a00; background: #fff6e0; border-color: #f0d28a; }

/* Career honors panel (player/coach cards). */
.pl-honyear { padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.pl-honyear:first-child { border-top: none; padding-top: 0; }
.pl-honyear-head { font-size: 12px; font-weight: 800; color: var(--text-primary); margin-bottom: 5px;
  display: flex; align-items: center; gap: 8px; }
.pl-honyear-school { font-weight: 600; color: var(--text-muted); font-size: 11px; }
.pl-live { font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-strong); background: var(--green-50); border-radius: var(--radius-pill); padding: 1px 6px; }
.pl-honitem { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary);
  padding: 3px 0; }
.pl-hondot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--border-strong); }
.pl-hondot.national_poty, .pl-hondot.national_champion { background: #d4a017; }
.pl-hondot.conf_poty, .pl-hondot.conf_champion { background: var(--brand); }
.pl-hondot.all_american { background: #c0852a; }
.pl-hondot.all_conference { background: #6b8cae; }

/* Season divider inside a match-by-match table (player career view). */
.bl-yeardiv {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; margin-top: 2px;
  background: var(--surface-subtle); border-top: 1px solid var(--border-subtle);
  font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--text-primary);
}
.bl-yeardiv:first-child { border-top: none; }
.bl-yeardiv-rec { font-weight: 700; color: var(--brand-strong); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- Pagination */
.bl-pager {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin: 16px 0 4px;
}
.bl-pager-meta { font-size: 13px; color: var(--text-muted); }
.bl-pager-meta strong { color: var(--text-primary); }
.bl-pager-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bl-pager-btn, .bl-pager-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--text-secondary); border: 1px solid var(--border-default);
  background: var(--surface-card); transition: border-color .12s, color .12s, background .12s;
}
.bl-pager-num { padding: 0; }
.bl-pager-btn:hover, .bl-pager-num:hover { border-color: var(--brand); color: var(--brand-strong); }
.bl-pager-num.active {
  background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); cursor: default;
}
.bl-pager-btn.disabled {
  opacity: .45; pointer-events: none; background: var(--surface-subtle);
}
.bl-pager-gap { padding: 0 4px; color: var(--text-faint); user-select: none; }
@media (max-width: 560px) {
  .bl-pager { justify-content: center; }
  .bl-pager-meta { width: 100%; text-align: center; }
}

/* Tablet / small laptop — collapse the two-column boards. */
@media (max-width: 880px) {
  .bl-board-grid { grid-template-columns: 1fr !important; }
  .bl-scorehdr { grid-template-columns: 1fr !important; gap: 12px !important; text-align: center; }
  .bl-scorehdr .team, .bl-scorehdr .team.away { justify-content: center; }
  .bl-rounds { grid-template-columns: 1fr; }
}

/* Large phone / phone landscape. */
@media (max-width: 720px) {
  .bl-header-inner { flex-wrap: wrap; height: auto; padding: 9px 12px; gap: 8px; }
  .bl-nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
            padding-bottom: 4px; scrollbar-width: none; }
  .bl-nav::-webkit-scrollbar { display: none; }
  .bl-nav a { white-space: nowrap; flex: none; padding: 7px 10px; }
  .bl-run { margin-left: auto; }

  /* Toolbars: each field stacks full-width; selects fill + stay tappable
     (override the inline min-width on the controls). */
  .bl-toolbar-inner { padding: 10px 12px; gap: 8px 12px; }
  .bl-field { width: 100%; justify-content: space-between; }
  .bl-field .bl-select-wrap { flex: 1 1 auto; }
  .bl-select-wrap { width: 100%; }
  .bl-select, .bl-input { min-width: 0 !important; width: 100%; }

  /* Tighter gutters across the main containers. */
  .bl-container, .bl-board, .bl-notes, .bl-pager, .bl-prose, .bl-setup {
    padding-left: 14px; padding-right: 14px;
  }

  /* Wide stat tables: keep the scroller but pack tighter + lower the floor. */
  .bl-table { min-width: 640px; }
  .bl-thead, .bl-row { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .bl-th { font-size: 10px; }
  .bl-school, .bl-conf, .bl-rec, .bl-crec, .bl-stat { font-size: 12.5px; }

  /* Schedule rows reflow: date + result on top, opponent below. */
  .bl-sched-head { display: none; }
  .bl-sched-row { grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 3px; padding: 11px 14px; }
  .bl-sched-row .c-date { grid-row: 1; grid-column: 1; }
  .bl-sched-row .c-res  { grid-row: 1; grid-column: 2; justify-content: flex-end; }
  .bl-sched-row .c-opp  { grid-row: 2; grid-column: 1 / -1; }
  .bl-sched-row .c-site, .bl-sched-row .c-type { display: none; }
}

/* Phone portrait — scale display type down, simplify match rows. */
@media (max-width: 600px) {
  .bl-bigscore .n { font-size: 30px; }
  .bl-scorehdr .tname { font-size: 16px; }
  .bl-prose h1 { font-size: 24px; }
  .bl-champ { padding: 16px; gap: 12px; }
  .bl-champ .name { font-size: 22px; }
  .bl-slots { flex-direction: column; align-items: stretch; }
  .bl-vs { align-self: center; margin: 4px 0; }
  .bl-entries { flex-wrap: wrap; gap: 4px; }
}

@media (max-width: 520px) {
  .bl-matchrow { grid-template-columns: 40px 1fr; column-gap: 10px; padding: 10px 14px; }
  .bl-matchrow .bl-final { display: none; }
  .bl-side .nm { white-space: normal; }
  .bl-court-team { display: block; margin-left: 0; }
}

/* ---- Standings: league table headers + projected auto-bid leader -------- */
.bl-stand-hdr {
  display: grid; gap: 8px; align-items: center; padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle); background: var(--surface-th);
  font-size: 10px; text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
  color: var(--text-muted); font-weight: 600;
}
.bl-stand-hdr span:nth-child(n+3) { text-align: right; }
.bl-stand-lead { background: var(--green-50); box-shadow: inset 3px 0 0 var(--brand); }
.bl-aq-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); vertical-align: middle;
}
.bl-aq-tag {
  flex: none; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--green-800); background: var(--green-50);
  border: 1px solid var(--green-200); border-radius: 4px; padding: 1px 5px;
}

/* ---- Bubble Watch: Last Four In / First Four Out split view ------------- */
.bl-bubble { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.bl-bubble-col:first-child { border-right: 1px solid var(--border-subtle); }
.bl-bubble-head {
  padding: 8px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow); border-bottom: 1px solid var(--border-subtle);
}
.bl-bubble-head--in  { color: var(--green-800); background: var(--green-50); }
.bl-bubble-head--out { color: var(--tint-loss-fg); background: var(--tint-loss-bg); }
.bl-bubble-row {
  display: grid; grid-template-columns: 34px 1fr 44px 56px 50px; gap: 8px;
  align-items: center; padding: 8px 16px; font-size: 13px; text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
}
.bl-bubble-row:last-child { border-bottom: none; }
.bl-bubble-row--in  { box-shadow: inset 3px 0 0 var(--brand); }
.bl-bubble-row--out { box-shadow: inset 3px 0 0 var(--tint-loss-fg); }
.bl-bubble-seed { font-size: 11px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bl-bubble-team { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--text-primary); }
.bl-bubble-team .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-bubble-conf { font-size: 11px; color: var(--text-muted); text-align: right; }
.bl-bubble-rec  { font-variant-numeric: tabular-nums; color: var(--text-secondary); text-align: right; }
.bl-bubble-pi   { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-primary); text-align: right; }

.bl-bubble-more {
  display: block; padding: 9px 16px; font-size: 12px; font-weight: 600;
  color: var(--brand-strong); text-decoration: none; border-top: 1px solid var(--border-subtle);
}
.bl-bubble-more:hover { background: var(--green-50); }

@media (max-width: 640px) {
  .bl-bubble { grid-template-columns: 1fr; }
  .bl-bubble-col:first-child { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .bl-bubble-row { grid-template-columns: 30px 1fr 50px 48px; }
  .bl-bubble-conf { display: none; }
}

/* ---- Bracket Projection page: at-large board + cut line ---------------- */
.bl-proj-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-proj-lastin  { box-shadow: inset 3px 0 0 var(--brand); background: var(--green-50); }
.bl-proj-out .nm { color: var(--text-muted); }
.bl-proj-firstout { box-shadow: inset 3px 0 0 var(--tint-loss-fg); background: var(--tint-loss-bg); }
.bl-proj-cut {
  padding: 6px 16px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow); color: var(--tint-loss-fg); text-align: center;
  background: repeating-linear-gradient(45deg, var(--surface-subtle), var(--surface-subtle) 8px, transparent 8px, transparent 16px);
  border-top: 1px dashed var(--border-default); border-bottom: 1px dashed var(--border-default);
}
