/* Shared beta palette. Week and availability colors retain their source values. */
:root {
  --beta-canvas: #fbf8ef;
  --beta-panel: #fffdf7;
  --beta-rail: #f1f0e5;
  --beta-ink: #193b2d;
  --beta-muted: #59685d;
  --beta-rule: #d6ddcf;
  --beta-edge: #7a8c79;
  --beta-accent: #176344;
  --beta-on-accent: #ffffff;
  --beta-soft: #e4f3df;
  --beta-hover: #f0f5e9;
  --beta-focus: #1268ba;
  --beta-green: #087b43;
  --beta-green-soft: #def5e5;
  --beta-red: #c4313b;
  --beta-red-soft: #ffe8e7;
  --beta-amber: #935b00;
  --beta-amber-soft: #fff0c5;
  --beta-unknown: #69746b;
  --beta-unknown-soft: #e7ebe5;
  --beta-font-body: var(--font);
  --beta-font-display: 'Space Grotesk', var(--font);
  --beta-text-body: 14px;
  --beta-text-small: 12px;
  --beta-text-label: 10px;
  --beta-space-1: 4px;
  --beta-space-2: 8px;
  --beta-space-3: 12px;
  --beta-space-4: 16px;
  --beta-space-5: 24px;
  --beta-space-6: 32px;
  --beta-radius-sm: 8px;
  --beta-radius-md: 14px;
  --beta-radius-lg: 20px;
  --beta-radius-pill: 999px;
  --beta-tap: 44px;
  --beta-shadow: none;
  --beta-focus-ring: 3px solid var(--beta-focus);
}

html[data-theme="dark"] {
  --beta-canvas: #17251f;
  --beta-panel: #22362c;
  --beta-rail: #1b2e24;
  --beta-ink: #f5f5e9;
  --beta-muted: #bdcfc2;
  --beta-rule: #435e4c;
  --beta-edge: #799781;
  --beta-accent: #8ce0ad;
  --beta-on-accent: #123220;
  --beta-soft: #2d4d38;
  --beta-hover: #294432;
  --beta-focus: #88c5ff;
  --beta-green: #71e5a3;
  --beta-green-soft: #254d35;
  --beta-red: #ff9ca2;
  --beta-red-soft: #522e33;
  --beta-amber: #ffd16c;
  --beta-amber-soft: #514323;
  --beta-unknown: #bbc8bf;
  --beta-unknown-soft: #3a483e;
}

:root,
html[data-theme="light"],
html[data-theme="dark"] {
  --surface: var(--beta-canvas);
  --panel: var(--beta-panel);
  --sidebar: var(--beta-rail);
  --line: var(--beta-rule);
  --ink: var(--beta-ink);
  --muted: var(--beta-muted);
  --accent: var(--beta-accent);
  --on-accent: var(--beta-on-accent);
  --soft: var(--beta-soft);
  --hover: var(--beta-hover);
  --edge: var(--beta-edge);
  --gold: var(--beta-amber);
  --shadow: var(--beta-shadow);
}

body { font-family: var(--beta-font-body); }
:focus-visible { outline: var(--beta-focus-ring); outline-offset: 3px; }
.header {
  min-height: 104px;
  padding: 22px 32px;
  gap: 24px;
}
.header h1 { font-size: 28px; letter-spacing: -1px; }
.header .brand { gap: 14px; }
.header .tagline { font-size: 13px; }
.header-actions { gap: 20px; }
.header .theme-button {
  min-height: var(--beta-tap);
  padding: 10px 16px;
  font-size: 12px;
  border-radius: var(--beta-radius-pill);
  background: var(--beta-panel);
}
.layout { grid-template-columns: 204px minmax(0, 1fr); }
.sidebar { padding: 28px 16px; }
.sidebar-section { margin-bottom: 24px; }
.sidebar .eyebrow { letter-spacing: 1.2px; margin-bottom: 8px; }
.view-tabs { gap: 6px; }
.view-tabs button { padding: 11px 12px; border-radius: var(--beta-radius-sm); }
.sidebar input,
.sidebar select { min-height: var(--beta-tap); font-size: 12px; }
.sidebar .text-button { min-height: var(--beta-tap); padding: 10px 0; font-size: 12px; }
.sidebar-note { padding-top: 24px; }
.sidebar-note a { min-height: var(--beta-tap); padding: 10px 0; margin-top: 6px; }
main { max-width: 1180px; padding: 32px 32px 0; }
.board-heading { gap: 16px; margin-bottom: 20px; }
.board-heading .eyebrow { font-size: 10px; letter-spacing: 1.4px; }
.board-heading h2 { font-size: 32px; line-height: 1.15; font-weight: 600; }
.board-heading p { font-size: 13px; line-height: 1.5; max-width: 620px; }
.board-heading .count { font-size: 12px; padding: 7px 10px; background: var(--beta-panel); }

/* Overall and unit ranking cards. All score layout rules stay inside these cards. */
.team-list { gap: 10px; }
.team-card {
  grid-template-columns: 28px 48px minmax(120px, 1fr) minmax(258px, 1.1fr) 44px;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--beta-radius-md);
}
.team-card > .rank { font-size: 21px; }
.team-card > .team-logo { width: 48px; height: 48px; }
.team-card .team-identity { min-width: 0; }
.team-card .team-name { font-size: 15px; overflow-wrap: anywhere; }
.team-card .team-meta { font-size: 11px; margin-top: 4px; }
.team-card > .scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.team-card .score-cell { padding: 7px 8px; border-radius: var(--beta-radius-sm); }
.team-card .score-cell.selected { background: var(--beta-soft); }
.team-card .score-label { font-size: 9px; letter-spacing: .7px; }
.team-card .score-value { font-size: 25px; line-height: 1.2; }
.team-card .score-meter { height: 3px; margin-top: 5px; }
.team-card > .details-button {
  width: var(--beta-tap);
  height: var(--beta-tap);
  display: grid;
  place-items: center;
  background: var(--beta-canvas);
}
.team-card-overall .team-dialog-trigger::after { border-radius: var(--beta-radius-md); }
.team-card-overall:focus-within { outline: var(--beta-focus-ring); }
.team-card-compact {
  grid-template-columns: 26px 36px minmax(0, 1fr) auto 44px;
  min-height: 68px;
  padding: 10px 14px;
}
.team-card-compact > .team-logo { width: 36px; height: 36px; }
.team-card-compact > .compact-score { font-size: 26px; }
.team-card-compact > .details-button { grid-column: 5; grid-row: 1; }
.team-card-compact .team-dialog-trigger { min-height: 32px; }

.tier-board { border-radius: var(--beta-radius-md); gap: 2px; }
.tier-board .tier-row { grid-template-columns: 100px minmax(0, 1fr); }
.tier-board .tier-label { font-size: 18px; }
.tier-board .tier-teams { gap: 8px; padding: 12px 16px; }
.tier-board .tier-team { border-radius: var(--beta-radius-sm); min-width: 44px; min-height: 72px; font-size: 10px; }

/* Quarterback list and profile use the same rating capsule. */
.qb-view .qb-context,
.qb-profile .qb-context { font-size: 13px; }
.qb-view .qb-list { gap: 10px; }
.qb-view .qb-card {
  grid-template-columns: 28px 64px minmax(0, 1fr) 104px;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--beta-radius-md);
}
.qb-view .qb-card > .qb-headshot { width: 64px; height: 64px; }
.qb-view .qb-name { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; }
.qb-view .qb-meta { margin-top: 0; font-size: 12px; }
.qb-view .qb-grade,
.qb-profile-header > .qb-grade {
  background: var(--beta-soft);
  border-radius: var(--beta-radius-sm);
  padding: 8px 10px;
  text-align: center;
  gap: 0;
}
.qb-view .qb-grade strong,
.qb-profile-header > .qb-grade strong { font-size: 30px; line-height: 1.2; }
.qb-view .qb-grade span,
.qb-profile-header > .qb-grade span { font-size: 10px; }
.qb-profile .qb-back { min-height: 44px; padding: 10px 0; margin-bottom: 12px; font-size: 13px; }
.qb-profile-header {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 108px;
  gap: 20px;
  padding: 24px;
  border-radius: var(--beta-radius-md);
}
.qb-profile-header > .qb-headshot { width: 104px; height: 104px; }
.qb-profile-header > div:not(.qb-headshot):not(.qb-grade) { min-width: 0; }
.qb-profile-header > .qb-grade { margin: 0; min-width: 0; }
.qb-profile-name { font-size: 30px; overflow-wrap: anywhere; }
.qb-profile-header .qb-meta { font-size: 12px; }
.qb-profile-header .qb-team-line { flex-wrap: wrap; }
.qb-profile .qb-totals { border-radius: var(--beta-radius-md); }
.qb-profile .qb-totals dt { font-size: 12px; }
.qb-profile .qb-totals dd { font-size: 25px; }
.qb-profile .qb-table-wrap { max-width: 100%; border-radius: var(--beta-radius-md); }
.qb-profile .qb-table { font-size: 12px; }
.qb-profile .qb-table caption { font-size: 13px; }
.qb-profile .qb-table thead { font-size: 11px; }
.qb-view .qb-method,
.qb-view .qb-sources { font-size: 13px; line-height: 1.75; }
.qb-view .qb-method > summary,
.qb-view .qb-sources > summary,
.qb-profile .qb-method > summary,
.qb-profile .qb-sources > summary { min-height: 44px; padding: 10px 0; }

.method { margin-top: 40px; padding-top: 28px; font-size: 13px; }
.method h2 { font-size: 28px; }
.method h3 { font-size: 15px; margin-bottom: 8px; }
.method p { line-height: 1.8; }
.method-grid { gap: 28px; margin: 28px 0; }
.method summary { min-height: 44px; padding: 10px 0; }
.method details { padding: 6px 0; }
.method details p { margin-top: 16px; }
.method .sources ul { font-size: 12px; gap: 12px 20px; }
.method .sources a { display: inline-block; padding: 6px 0; }
.method .fine-print { font-size: 11px; }
.method-version { font-size: 10px; border-radius: var(--beta-radius-sm); }

html[data-theme="dark"] :is(.team-card > .team-logo, .tier-board .tier-team > img[src^="logos/"], #team-dialog .detail-identity > img[src^="logos/"], .qb-team-logo) {
  background: #eeeee6;
  padding: 3px;
  border-radius: 6px;
}

/* Generic dialog base only. Game dialog content keeps its own geometry. */
dialog {
  background: var(--beta-panel);
  color: var(--beta-ink);
  border: 1px solid var(--beta-rule);
  border-radius: var(--beta-radius-lg);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
}
dialog::backdrop { background: rgb(10 25 16 / .62); }
#team-dialog .dialog-head { margin-bottom: 16px; gap: 12px; }
#team-dialog .close-button { width: 44px; height: 44px; flex-shrink: 0; }
#team-dialog .detail-identity { gap: 16px; margin-bottom: 20px; }
#team-dialog .detail-identity h2 { font-size: 28px; overflow-wrap: anywhere; }
#team-dialog .detail-identity img { width: 72px; height: 72px; flex-shrink: 0; }
#team-dialog .detail-identity p { font-size: 13px; }
#team-dialog .detail-scores { background: var(--beta-canvas); padding: 12px; border-radius: var(--beta-radius-md); }
#team-dialog .detail-scores .scores { gap: 8px; }
#team-dialog .score-cell { padding: 8px; border-radius: var(--beta-radius-sm); }
#team-dialog .score-cell.selected { background: var(--beta-soft); }
#team-dialog .score-label { font-size: 10px; }
#team-dialog .score-value { font-size: 28px; }
#team-dialog .stat-item { font-size: 12px; padding: 12px 0; }
#team-dialog .detail-note { font-size: 12px; line-height: 1.75; }

@media (min-width: 901px) and (max-width: 1180px) {
  .team-card-overall { grid-template-columns: 24px 40px minmax(0, 1fr) 44px; }
  .team-card-overall > .team-logo { width: 40px; height: 40px; }
  .team-card-overall > .scores { grid-column: 2 / 5; grid-row: 2; }
  .team-card-overall > .details-button { grid-column: 4; grid-row: 1; }
}

@media (max-width: 900px) {
  .layout { display: block; }
  .header { padding: 18px 24px; }
  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 16px;
    padding: 16px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--beta-rule);
  }
  .sidebar-section { margin: 0; min-width: 0; }
  .sidebar-section:first-child { grid-column: 1 / -1; }
  .sidebar-section:first-child > .eyebrow,
  .sidebar-note { display: none; }
  .view-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .view-tabs button {
    flex: 0 0 calc((100% - 12px) / 4);
    min-width: 0;
    min-height: 44px;
    padding: 8px 2px;
    justify-content: center;
    white-space: nowrap;
    font-size: 12px;
  }
  .view-tabs button:nth-child(n + 5) { flex-basis: calc((100% - 8px) / 3); }
  .view-tabs .tab-icon { display: none; }
  .sidebar .eyebrow { font-size: 10px; margin-bottom: 6px; }
  #conference-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: center; }
  #conference-filter > .eyebrow { grid-column: 1 / -1; }
  #conference-filter .text-button { white-space: nowrap; padding: 8px 0; }
  main { padding: 24px 24px 0; }
  .team-card-overall { grid-template-columns: 26px 44px minmax(0, 1fr) minmax(240px, 1fr) 44px; gap: 10px; }
  .team-card-overall > .scores { grid-column: auto; grid-row: auto; }
  .team-card-overall > .details-button { grid-column: 5; grid-row: 1; }
  .team-card-overall > .team-logo { width: 44px; height: 44px; }
}

@media (max-width: 600px) {
  .header { min-height: 90px; padding: 10px 16px; align-items: center; gap: 10px; }
  .header .brand { gap: 9px; }
  .header .brand-mark { width: 36px; height: 42px; }
  .header h1 { font-size: 23px; letter-spacing: -.8px; }
  .header .tagline { font-size: 10px; max-width: 205px; line-height: 1.5; margin-top: 4px; }
  .header-actions { flex-direction: column-reverse; gap: 5px; align-items: flex-end; }
  .header .theme-button { font-size: 11px; padding: 8px 10px; }
  .header .season-label { font-size: 10px; letter-spacing: 0; gap: 4px; }
  .header .season-label::before { width: 8px; }
  .sidebar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 12px 16px; }
  #search-filter { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 6px; }
  #search-filter > .eyebrow { margin: 0; letter-spacing: 1px; }
  #conference-filter { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  #conference-filter > .eyebrow { grid-column: 1 / -1; margin: 0; letter-spacing: 1px; }
  #conference-filter .text-button { font-size: 11px; }
  .sidebar input,
  .sidebar select { padding: 9px; }
  main { padding: 14px 16px 0; }
  .board { padding-top: 0; }
  .board-heading { margin-bottom: 12px; gap: 10px; }
  .board-heading h2 { font-size: 25px; }
  .board-heading p { font-size: 13px; line-height: 1.5; margin-top: 5px; }
  .board-heading .eyebrow { font-size: 9px; margin-bottom: 4px; }
  .board-heading .count { font-size: 11px; padding: 5px 8px; }
  .team-card-overall {
    grid-template-columns: 22px 40px minmax(0, 1fr) 44px;
    padding: 12px;
    gap: 8px 10px;
  }
  .team-card-overall > .team-logo { width: 40px; height: 40px; }
  .team-card-overall > .rank { font-size: 19px; }
  .team-card-overall > .details-button { grid-column: 4; grid-row: 1; }
  .team-card-overall > .scores { grid-column: 1 / -1; grid-row: 2; gap: 8px; }
  .team-card .team-name { font-size: 14px; }
  .team-card .team-meta { font-size: 11px; }
  .team-card .score-cell { padding: 6px 9px; }
  .team-card .score-label { font-size: 9px; }
  .team-card .score-value { font-size: 25px; }
  .team-card-compact { grid-template-columns: 21px 32px minmax(0, 1fr) auto 44px; padding: 10px; gap: 8px; }
  .team-card-compact > .team-logo { width: 32px; height: 32px; }
  .team-card-compact .team-name { font-size: 13px; }
  .team-card-compact .team-meta { font-size: 10px; }
  .team-card-compact > .compact-score { font-size: 24px; }
  .tier-board .tier-row { grid-template-columns: 72px minmax(0, 1fr); min-height: 88px; }
  .tier-board .tier-label { font-size: 15px; padding: 10px 6px; }
  .tier-board .tier-teams { gap: 6px; padding: 10px; }
  .tier-board .tier-team { width: 52px; min-height: 66px; }
  .tier-board .tier-team img { width: 44px; height: 42px; }
  .qb-view .qb-card { grid-template-columns: 22px 48px minmax(0, 1fr) 68px; gap: 8px; padding: 10px; }
  .qb-view .qb-card > .qb-headshot { width: 48px; height: 48px; }
  .qb-view .qb-name { font-size: 14px; }
  .qb-view .qb-meta { font-size: 11px; }
  .qb-view .qb-grade { grid-column: auto; display: grid; padding: 7px 6px; }
  .qb-view .qb-grade strong { font-size: 26px; }
  .qb-view .qb-grade span { font-size: 9px; }
  .qb-profile-header { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .qb-profile-header > .qb-headshot { width: 72px; height: 72px; grid-column: 1; grid-row: 1; }
  .qb-profile-header > div:not(.qb-headshot):not(.qb-grade) { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .qb-profile-header > .qb-grade { grid-column: 1; grid-row: 2; padding: 7px 4px; }
  .qb-profile-header > .qb-grade strong { font-size: 27px; }
  .qb-profile-header > .qb-grade span { font-size: 9px; }
  .qb-profile-name { font-size: 24px; }
  .qb-profile .qb-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0 24px; }
  .qb-profile .qb-totals > div { padding: 12px; }
  .qb-profile .qb-totals dd { font-size: 23px; }
  .method { margin-top: 32px; padding-top: 24px; }
  .method h2 { font-size: 25px; }
  .method-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .method-grid { grid-template-columns: 1fr; gap: 24px; margin: 24px 0; }
  dialog { padding: 16px; }
  #team-dialog .detail-identity { gap: 12px; }
  #team-dialog .detail-identity h2 { font-size: 25px; }
  #team-dialog .detail-identity img { width: 60px; height: 60px; }
  #team-dialog .detail-scores { padding: 8px; }
  #team-dialog .score-cell { padding: 6px; }
  #team-dialog .score-label { font-size: 9px; letter-spacing: .6px; }
  #team-dialog .score-value { font-size: 26px; }
  #team-dialog .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .header { padding-right: 12px; padding-left: 12px; gap: 8px; }
  .header .brand { gap: 7px; }
  .header .tagline { max-width: 145px; }
  .header h1 { font-size: 21px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); padding-right: 12px; padding-left: 12px; }
  #search-filter { grid-template-columns: 92px minmax(0, 1fr); }
  #conference-filter { grid-template-columns: 92px minmax(0, 1fr) auto; gap: 6px; }
  #conference-filter > .eyebrow { grid-column: auto; }
  .sidebar .eyebrow { font-size: 9px; }
  main { padding-right: 12px; padding-left: 12px; }
  .board-heading .count { padding: 5px 6px; }
  .team-card-overall { gap: 8px; padding: 10px; }
  .team-card-compact { grid-template-columns: 19px 28px minmax(0, 1fr) auto 44px; gap: 6px; padding: 8px; }
  .team-card-compact > .team-logo { width: 28px; height: 28px; }
  .team-card-compact > .compact-score { font-size: 22px; }
  .qb-view .qb-card { grid-template-columns: 18px 44px minmax(0, 1fr) 61px; gap: 6px; }
  .qb-view .qb-card > .qb-headshot { width: 44px; height: 44px; }
  .qb-view .qb-name { font-size: 13px; }
}
