:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e2ec;
  --ice: #f4f9fb;
  --panel: #ffffff;
  --navy: #18324a;
  --navy-deep: #0e1c2c;
  --teal: #0f8b8d;
  --teal-soft: #dff3f2;
  --red: #c33c54;
  --gold: #d99f2b;
  --green: #238b5a;
  --shadow: 0 24px 60px rgba(24, 50, 74, 0.13);
  --shadow-soft: 0 10px 28px rgba(24, 50, 74, 0.1);
}

/* Lineup Lab */
.lineup-lab-page { width: min(1500px, calc(100% - 32px)); }

.lineup-lab-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 38px 0 28px;
  border-bottom: 1px solid var(--line);
}

.lineup-lab-intro h2 {
  margin: 6px 0 10px;
  color: var(--navy-deep);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.lineup-lab-intro > div:first-child > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  padding: 4px;
  background: #dfeaed;
  border-radius: 9px;
}

.mode-switch button {
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-weight: 900;
  cursor: pointer;
}

.mode-switch button small { display: block; margin-top: 3px; font-size: 0.62rem; font-weight: 700; }
.mode-switch button.is-active { color: white; background: var(--navy); box-shadow: var(--shadow-soft); }

.lineup-lab-controls {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) 160px auto;
  align-items: end;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.lineup-lab-controls label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.lab-reset-button {
  min-height: 42px;
  padding: 9px 14px;
  color: white;
  background: var(--navy);
  border: 0;
  border-radius: 6px;
  font-weight: 850;
  cursor: pointer;
}

.lineup-lab-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.lineup-lab-metrics article {
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lineup-lab-metrics span,
.lineup-lab-metrics small { display: block; color: var(--muted); font-size: 0.66rem; font-weight: 850; text-transform: uppercase; }
.lineup-lab-metrics strong { display: block; margin: 8px 0 6px; color: var(--navy); font-size: 1.65rem; }

.lab-model-note {
  margin: -4px 0 18px;
  padding: 10px 14px;
  color: var(--muted);
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
  font-size: 0.72rem;
  line-height: 1.55;
}

.lab-model-note strong { color: var(--ink); }

.lineup-lab-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  align-items: start;
  gap: 18px;
}

.lineup-builder,
.player-market,
.lab-comparison-section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.lineup-builder { padding: 20px; }
.player-market { position: sticky; top: 18px; overflow: hidden; }

.lab-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.player-market .lab-section-heading { padding: 16px; }
.lab-section-heading h2 { margin: 5px 0 0; color: var(--navy); font-size: 1.2rem; }
.lab-section-heading > span { max-width: 400px; color: var(--muted); font-size: 0.72rem; text-align: right; }

.lab-units { display: grid; gap: 10px; margin-top: 14px; }
.lab-lower-units { display: grid; gap: 12px; }

#labDefensePairs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#labDefensePairs .lab-unit {
  grid-template-columns: 1fr;
}

#labDefensePairs .lab-unit > header {
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

#labGoalies {
  max-width: 760px;
  width: 100%;
  margin: 22px auto 0;
}

.lab-unit {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.lab-unit > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--ice);
  border-right: 1px solid var(--line);
}

.lab-unit > header span,
.lab-unit > header small { display: block; }
.lab-unit > header span { color: var(--ink); font-size: 0.78rem; font-weight: 900; }
.lab-unit > header small { margin-top: 4px; color: var(--muted); font-size: 0.58rem; line-height: 1.4; }
.lab-unit > header > strong { color: var(--teal); font-size: 1.15rem; }

.lab-unit-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 7px; }
#labDefensePairs .lab-unit-slots,
#labGoalies .lab-unit-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.lab-lineup-slot {
  min-width: 0;
  min-height: 70px;
  border: 1px dashed transparent;
  border-radius: 6px;
}

.lab-lineup-slot.is-empty { display: grid; place-items: center; color: var(--muted); border-color: var(--line); font-size: 0.7rem; }
.lab-lineup-slot.is-drag-over { background: var(--teal-soft); border-color: var(--teal); }

.lab-slot-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 6px;
  border-radius: 6px;
  cursor: grab;
}

.lab-slot-player:hover { background: #edf6f7; }
.lab-slot-player.is-selected { background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.lab-player-image { position: relative; display: grid; place-items: center; width: 42px; height: 52px; overflow: hidden; color: var(--navy); background: #e6edf2; border-radius: 5px; font-size: 0.62rem; font-weight: 900; }
.lab-player-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.lab-slot-copy { min-width: 0; }
.lab-slot-copy strong,
.lab-slot-copy small { display: block; }
.lab-slot-copy strong { overflow: hidden; color: var(--ink); font-size: 0.74rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.lab-slot-copy small { margin-top: 4px; color: var(--muted); font-size: 0.58rem; line-height: 1.35; }
.lab-player-score { color: var(--teal); font-size: 1.05rem; text-align: right; }

.market-description { margin: 0; padding: 12px 16px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 0.72rem; line-height: 1.5; }
.market-search { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.market-search > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.68rem; font-weight: 850; }
.player-market-list { display: grid; gap: 4px; max-height: 680px; overflow-y: auto; padding: 8px; }

.market-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  cursor: grab;
}

.market-player:hover,
.market-player.is-selected { background: var(--teal-soft); border-color: rgba(15, 139, 141, 0.4); }
.market-player > span:nth-child(2) { min-width: 0; }
.market-player strong,
.market-player small { display: block; }
.market-player strong { overflow: hidden; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.market-player small { margin-top: 3px; color: var(--muted); font-size: 0.6rem; }
.market-player > b { color: var(--teal); font-size: 1rem; text-align: right; }

.penalty-box {
  display: grid;
  grid-template-columns: minmax(210px, 0.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 112px;
  margin-top: 24px;
  padding: 16px;
  background: #fff8e8;
  border: 2px dashed #d5a43a;
  border-radius: 8px;
  transition: background 150ms ease, border-color 150ms ease;
}

.penalty-box.is-drag-over { background: #ffedbd; border-color: var(--gold); }
.penalty-box h3 { margin: 4px 0; color: var(--navy); font-size: 1rem; }
.penalty-box > div:first-child > span { display: block; color: var(--muted); font-size: 0.68rem; line-height: 1.4; }
.penalty-box-players { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }

.penalty-box-player {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 34px;
  min-width: 160px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
  border: 1px solid #dfc172;
  border-radius: 6px;
  text-align: left;
  cursor: grab;
}

.penalty-box-player span,
.penalty-box-player small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.penalty-box-player span { font-size: 0.72rem; font-weight: 850; }
.penalty-box-player small { grid-column: 1; margin-top: 3px; color: var(--muted); font-size: 0.58rem; }
.penalty-box-player b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--teal); font-size: 1rem; text-align: right; }
.penalty-box-player.is-selected { background: var(--teal-soft); border-color: var(--teal); }
.penalty-box-empty { width: 100%; padding: 18px; color: #8a6a22; font-size: 0.72rem; text-align: center; }

.lab-comparison-section { margin: 22px 0 8px; padding: 20px; }

html[data-theme="dark"] .lineup-lab-intro h2,
html[data-theme="dark"] .lineup-lab-metrics strong,
html[data-theme="dark"] .lab-section-heading h2 { color: var(--ink); }

html[data-theme="dark"] .lineup-lab-controls,
html[data-theme="dark"] .lineup-lab-metrics article,
html[data-theme="dark"] .lineup-builder,
html[data-theme="dark"] .player-market,
html[data-theme="dark"] .lab-comparison-section { background: var(--panel); }

html[data-theme="dark"] .mode-switch { background: #203a4c; }
html[data-theme="dark"] .mode-switch button.is-active { background: #236276; }
html[data-theme="dark"] .lab-slot-player:hover { background: #183b45; }
html[data-theme="dark"] .lab-player-image { background: #dce9ed; }
html[data-theme="dark"] .penalty-box { background: #3b3320; border-color: #9d7b32; }
html[data-theme="dark"] .penalty-box.is-drag-over { background: #52451f; border-color: var(--gold); }
html[data-theme="dark"] .penalty-box h3 { color: var(--ink); }
html[data-theme="dark"] .penalty-box-player { background: #213849; border-color: #806a39; }
html[data-theme="dark"] .penalty-box-empty { color: #e6c97e; }

@media (max-width: 1180px) {
  .lineup-lab-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lineup-lab-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lineup-lab-workspace { grid-template-columns: 1fr; }
  .player-market { position: static; }
  .player-market-list { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 480px; }
  #labDefensePairs { grid-template-columns: 1fr; }
  #labDefensePairs .lab-unit { grid-template-columns: 150px minmax(0, 1fr); }
  #labDefensePairs .lab-unit > header { border-right: 1px solid var(--line); border-bottom: 0; }
}

@media (max-width: 760px) {
  .lineup-lab-page { width: min(100% - 20px, 1500px); }
  .lineup-lab-intro { align-items: flex-start; flex-direction: column; }
  .mode-switch { width: 100%; }
  .lineup-lab-controls,
  .lineup-lab-metrics,
  .lab-lower-units { grid-template-columns: 1fr; }
  .lab-unit { grid-template-columns: 1fr; }
  .lab-unit > header { border-right: 0; border-bottom: 1px solid var(--line); }
  .lab-unit-slots,
  #labDefensePairs .lab-unit-slots,
  #labGoalies .lab-unit-slots { grid-template-columns: 1fr; }
  .player-market-list { grid-template-columns: 1fr; }
  #labDefensePairs .lab-unit { grid-template-columns: 1fr; }
  #labDefensePairs .lab-unit > header { border-right: 0; border-bottom: 1px solid var(--line); }
  .penalty-box { grid-template-columns: 1fr; }
  .lab-section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .lab-section-heading > span { text-align: left; }
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: #10273d;
  background: white;
  border: 2px solid var(--teal);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #f2b84b;
  outline-offset: 3px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(249, 252, 253, 0.98), rgba(236, 244, 247, 0.94)),
    repeating-linear-gradient(90deg, rgba(15, 139, 141, 0.055) 0 1px, transparent 1px 104px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 14px clamp(18px, 4vw, 56px);
  color: white;
  background: var(--navy-deep);
  border-bottom: 3px solid var(--teal);
}

.topbar h1 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.84rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  overflow-x: auto;
}

.header-link {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.header-link:hover,
.header-link:focus-visible {
  color: white;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.header-link.is-current {
  color: white;
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 13px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
}

.brand-mark img { display: block; width: 100%; height: 100%; }

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.back-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.eyebrow {
  margin: 0;
  color: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.season-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 5px 6px 5px 10px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.season-picker span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.season-picker select {
  width: auto;
  min-height: 30px;
  padding: 0 26px 0 8px;
  color: white;
  background-color: #18324a;
  border-color: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 800;
}

.theme-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  color: rgba(255, 255, 255, 0.88);
  background: #18324a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
}

.theme-toggle:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.55);
}

.theme-toggle span {
  font-size: 1.15rem;
  line-height: 1;
}

.source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  padding: 8px clamp(18px, 4vw, 56px);
  color: #425466;
  background: #e8f4f5;
  border-bottom: 1px solid #c9e1e3;
  font-size: 0.8rem;
  font-weight: 700;
}

.source-bar a,
.site-footer a {
  color: #076f72;
  text-underline-offset: 3px;
}

main {
  width: min(1500px, calc(100% - 32px));
  margin: 16px auto 36px;
}

.control-band,
.dashboard-grid,
.detail-layout,
.metric-strip,
.comparison-row,
.comparison-head {
  display: grid;
  gap: 16px;
}

.control-band {
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(110px, 0.7fr)) minmax(160px, 0.9fr);
  align-items: end;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.control-band label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.toggle-field {
  min-width: 0;
}

.checkbox-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-control input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--teal);
}

.checkbox-control span {
  min-width: 0;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.dashboard-grid {
  grid-template-columns: 390px minmax(0, 1fr);
  align-items: start;
  margin-top: 18px;
}

.dashboard-grid > * {
  min-width: 0;
}

.player-list,
.detail-panel,
.chart-panel,
.report-panel,
.comparison-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.player-list {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: hidden;
}

.section-heading,
.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  padding: 16px 18px 10px;
}

.section-heading > div,
.player-hero > div:last-child {
  min-width: 0;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.players {
  display: grid;
  gap: 9px;
  max-height: calc(100vh - 88px);
  padding: 8px 12px 14px;
  overflow: auto;
}

.player-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 88px;
  padding: 12px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff, #fbfdfe);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.player-card:hover {
  border-color: rgba(15, 139, 141, 0.45);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.player-card.active {
  border-color: var(--navy);
  box-shadow: 0 14px 32px rgba(24, 50, 74, 0.15);
}

.player-card strong {
  display: block;
  margin-bottom: 4px;
}

.player-card-copy {
  min-width: 0;
}

.player-card-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-headshot {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  color: var(--navy);
  background: linear-gradient(145deg, var(--teal-soft), #ffffff);
  border: 1px solid #c8dde5;
  border-radius: 50%;
  font-weight: 900;
}

.mini-headshot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: white;
}

.mini-headshot.image-missing img,
.mini-headshot img:not([src]) {
  display: none;
}

.score-badge {
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 54px;
  color: white;
  background: linear-gradient(145deg, var(--navy), var(--teal));
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.detail-panel {
  padding: 0;
  overflow: hidden;
}

.compare-header {
  align-items: center;
  padding: 22px;
  color: white;
  background:
    linear-gradient(135deg, rgba(14, 28, 44, 0.98), rgba(24, 50, 74, 0.95) 58%, rgba(15, 139, 141, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.compare-header h2 {
  margin: 5px 0 4px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.role-copy {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

.player-hero {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
}

.portrait-frame {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(104px, 13vw, 148px);
  aspect-ratio: 1;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(145deg, rgba(15, 139, 141, 0.7), rgba(14, 28, 44, 0.9)),
    #102235;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
}

.portrait-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: white;
}

.portrait-frame img:not([src]) {
  display: none;
}

#portraitFallback {
  font-size: 2.1rem;
  font-weight: 950;
}

#compareToggle {
  min-width: 116px;
  min-height: 44px;
  color: white;
  background: rgba(195, 60, 84, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#compareToggle:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

#compareToggle.is-added {
  background: var(--green);
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 18px;
  background: #f7fbfd;
}

.metric-strip article {
  min-height: 112px;
  padding: 17px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.metric-strip span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-strip strong {
  display: block;
  margin-top: 10px;
  font-size: 2.6rem;
  line-height: 1;
}

.score-trend-section {
  padding: 0 18px 22px;
  background: #f7fbfd;
}

.war-section {
  padding: 0 18px 22px;
  background: #f7fbfd;
}

.war-section .section-heading {
  padding: 16px 0 12px;
}

.war-section .section-heading a {
  color: #076f72;
  font-size: 0.78rem;
  font-weight: 800;
}

.war-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: white;
}

.war-overview > div {
  padding: 14px 16px;
}

.war-overview > div + div {
  border-left: 1px solid var(--line);
}

.war-overview span,
.war-row > span:first-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.war-overview strong {
  display: block;
  margin-top: 5px;
  color: var(--navy-deep);
  font-size: 1.45rem;
}

.war-breakdown {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: white;
}

.war-row {
  display: grid;
  grid-template-columns: 118px minmax(120px, 1fr) 52px;
  align-items: center;
  gap: 12px;
}

.war-row > strong {
  color: var(--navy);
  font-size: 0.82rem;
  text-align: right;
}

.war-track {
  position: relative;
  height: 9px;
  background: linear-gradient(to right, #f7d9dc 0 49.5%, #b9c7ce 49.5% 50.5%, #d4ece7 50.5% 100%);
}

.war-track i {
  position: absolute;
  top: 1px;
  height: 7px;
}

.war-track .positive { background: var(--green); }
.war-track .negative { background: var(--red); }

.score-trend-section .section-heading {
  padding: 16px 0 12px;
}

.score-trend-section .section-heading > div > span {
  display: block;
  margin-top: 4px;
}

.score-trend-chart {
  min-height: 220px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.score-trend-scroll {
  width: 100%;
  overflow-x: auto;
}

.score-trend-scroll svg {
  display: block;
  width: max(100%, 620px);
  height: auto;
  aspect-ratio: 760 / 220;
}

.trend-grid line {
  stroke: #dbe5ea;
  stroke-width: 1;
}

.trend-grid text,
.trend-season-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trend-line {
  fill: none;
  stroke: var(--navy);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.trend-point circle {
  fill: white;
  stroke: var(--teal);
  stroke-width: 3;
}

.trend-point text {
  fill: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.trend-point.is-current circle {
  fill: var(--gold);
  stroke: var(--navy);
}

.trend-point:focus {
  outline: none;
}

.trend-point:focus circle {
  stroke: var(--red);
  stroke-width: 5;
}

.score-explainer {
  padding: 22px 18px 24px;
  background: #f7fbfd;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.score-explainer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.score-explainer-heading h3 {
  margin: 0;
}

.score-explainer-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.score-explainer-heading a {
  color: #076f72;
  font-size: 0.82rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

.score-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.score-stages div {
  padding: 15px 16px 15px 0;
}

.score-stages div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.score-stages span,
.breakdown-labels {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-stages strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 1.35rem;
}

.breakdown-labels,
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 90px 70px 70px;
  align-items: center;
  gap: 14px;
}

.breakdown-labels {
  padding: 0 0 8px;
}

.breakdown-labels span:not(:first-child),
.breakdown-row > strong,
.breakdown-row > span:not(:first-child) {
  text-align: right;
}

.score-breakdown {
  border-top: 1px solid var(--line);
}

.breakdown-row {
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  color: #425466;
  font-size: 0.84rem;
}

.breakdown-component {
  display: grid;
  grid-template-columns: minmax(104px, auto) minmax(70px, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--navy);
}

.breakdown-component i {
  display: block;
  height: 5px;
  overflow: hidden;
  background: #dbe6ea;
  border-radius: 999px;
}

.breakdown-component i i {
  height: 100%;
  background: var(--teal);
}

.score-context {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.detail-layout {
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1.05fr);
  padding: 0 18px 18px;
  background: #f7fbfd;
}

.chart-panel,
.report-panel,
.comparison-panel {
  box-shadow: none;
}

.radar {
  display: grid;
  gap: 10px;
  padding: 10px 18px 20px;
}

.bar-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.bar-label,
.bar-value {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.bar-track {
  position: relative;
  display: flex;
  align-items: center;
  height: 11px;
  overflow: hidden;
  background: #e6edf2;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--red));
  border-radius: inherit;
}

.bar-track-value {
  position: absolute;
  right: 7px;
  z-index: 1;
  color: #10273d;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.95);
}

.report-panel p {
  margin: 0;
  padding: 10px 18px 12px;
  color: #344054;
  font-size: 1.02rem;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 18px;
}

.tag-list span {
  padding: 7px 9px;
  color: var(--navy);
  background: #edf6f7;
  border: 1px solid #cce5e6;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.comparison-panel {
  margin: 0 18px 18px;
}

.comparison-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#openComparison {
  min-height: 34px;
  padding: 0 11px;
  color: white;
  background: var(--navy);
  border: 0;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

#openComparison[hidden] {
  display: none;
}

.comparison-table {
  padding: 0 18px 18px;
  overflow-x: auto;
}

.comparison-head,
.comparison-row {
  grid-template-columns: minmax(190px, 1.4fr) repeat(5, minmax(90px, 1fr)) 40px;
  min-width: 800px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.comparison-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.comparison-row strong {
  display: block;
}

.comparison-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.comparison-row {
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.comparison-row:hover,
.comparison-row:focus-visible {
  background: var(--ice);
  box-shadow: inset 3px 0 0 var(--teal);
  outline: none;
}

.comparison-row.is-selected {
  background: #edf6f7;
}

.queue-remove {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.queue-remove:hover,
.queue-remove:focus-visible {
  color: var(--red);
  background: #fff;
  border-color: rgba(190, 53, 48, 0.28);
  outline: none;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: var(--ice);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.load-error,
.season-load-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: #7b2525;
  background: #fff4f3;
  border: 1px solid #e8bbb7;
  border-radius: 6px;
}

.load-error {
  align-items: flex-start;
  flex-direction: column;
}

.load-error span,
.season-load-error {
  font-size: 0.86rem;
  line-height: 1.5;
}

.load-error button,
.season-load-error button {
  min-height: 34px;
  padding: 0 12px;
  color: white;
  background: #7b2525;
  border: 0;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.season-load-error {
  justify-content: space-between;
  margin: 12px 0;
}

[aria-busy="true"] {
  cursor: progress;
}

input:disabled,
select:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.site-footer {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer strong {
  color: #425466;
}

.methodology-page {
  width: min(1080px, calc(100% - 32px));
  margin-top: 0;
}

.methodology-intro {
  padding: 42px 0 30px;
  border-bottom: 1px solid var(--line);
}

.methodology-intro h2,
.methodology-heading h2 {
  margin: 6px 0 10px;
  color: var(--navy-deep);
  letter-spacing: 0;
}

.methodology-intro h2 {
  max-width: 760px;
  font-size: 2.4rem;
  line-height: 1.08;
}

.methodology-intro > p:last-child,
.methodology-heading > p:last-child {
  max-width: 800px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.methodology-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.methodology-summary article {
  min-width: 0;
  padding: 24px 24px 26px 0;
}

.methodology-summary article + article {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.methodology-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.methodology-summary strong {
  color: var(--navy);
  font-size: 1.05rem;
}

.methodology-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.methodology-section {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.methodology-heading {
  margin-bottom: 20px;
}

.method-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.method-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

.method-table th,
.method-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.method-table th {
  color: #425466;
  background: #edf6f7;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.method-table td {
  color: #344054;
  font-size: 0.9rem;
  line-height: 1.5;
}

.method-table tbody tr:last-child td,
.method-table tfoot tr:last-child td {
  border-bottom: 0;
}

.method-table td:first-child,
.weight-table td:last-child,
.weight-table tfoot td {
  color: var(--navy);
  font-weight: 800;
}

.weight-table th:last-child,
.weight-table td:last-child {
  width: 100px;
  text-align: right;
}

.weight-table tfoot td {
  background: #f7fbfd;
}

.method-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding-left: 24px;
}

.method-steps li {
  padding: 12px 0 12px 8px;
  color: #344054;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
}

.method-steps li:last-child {
  border-bottom: 0;
}

.method-steps code,
.formula-block code {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.method-steps code {
  padding: 2px 5px;
  color: #076f72;
  background: #e8f4f5;
  border-radius: 4px;
}

.formula-block {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
  padding: 18px 20px;
  color: white;
  background: var(--navy-deep);
  border-left: 4px solid var(--teal);
  border-radius: 6px;
}

.formula-block span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.formula-block code {
  overflow-wrap: anywhere;
  color: white;
}

.model-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.hub-page {
  width: min(1240px, calc(100% - 32px));
  margin-top: 0;
}

.hub-intro {
  padding: 42px 0 28px;
  border-bottom: 1px solid var(--line);
}

.hub-intro h2 {
  max-width: 760px;
  margin: 6px 0 12px;
  color: var(--navy-deep);
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.hub-intro > p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hub-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.86rem;
}

.hub-facts strong {
  color: var(--navy);
}

.hub-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.about-page {
  width: min(1080px, calc(100% - 32px));
  margin-top: 0;
}

.about-intro {
  padding: 46px 0 32px;
  border-bottom: 1px solid var(--line);
}

.about-intro h2,
.about-heading h2,
.about-feedback h2 {
  margin: 6px 0 10px;
  color: var(--navy-deep);
  letter-spacing: 0;
}

.about-intro h2 {
  max-width: 780px;
  font-size: 2.4rem;
  line-height: 1.08;
}

.about-intro > p:last-child,
.about-feedback p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.about-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.about-status article {
  padding: 24px 24px 26px 0;
}

.about-status article + article {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.about-status span,
.about-roadmap li > span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.about-status strong,
.about-principles strong,
.about-roadmap strong {
  color: var(--navy);
}

.about-status p,
.about-principles p,
.about-roadmap p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.about-section {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.about-heading {
  margin-bottom: 18px;
}

.about-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.about-principles article {
  padding: 20px;
  background: white;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about-roadmap ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.about-roadmap li {
  padding: 20px 20px 20px 0;
}

.about-roadmap li + li {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.about-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 0 44px;
}

.about-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 14px;
}

.about-actions a {
  color: #076f72;
  font-size: 0.86rem;
  font-weight: 850;
  text-underline-offset: 3px;
}

.about-actions .primary-action {
  padding: 12px 15px;
  color: white;
  background: var(--navy-deep);
  border-radius: 6px;
  text-decoration: none;
}

.hub-module {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 14px;
  min-height: 180px;
  padding: 22px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.hub-module:hover,
.hub-module:focus-visible {
  border-color: rgba(15, 139, 141, 0.6);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  outline: none;
}

.module-index,
.hub-module p {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hub-module p {
  margin: 0 0 8px;
}

.hub-module h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.hub-module div > span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.hub-module > b {
  color: var(--teal);
  font-size: 1.15rem;
}

.hub-leaders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  padding: 32px 0 12px;
}

.hub-leader-section {
  min-width: 0;
}

.hub-section-heading,
.team-roster-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.hub-section-heading h2,
.team-roster-heading h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font-size: 1.2rem;
}

.hub-section-heading a {
  color: #076f72;
  font-size: 0.8rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

.hub-leader-list {
  border-top: 1px solid var(--line);
}

.hub-leader-row {
  display: grid;
  grid-template-columns: 24px 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.hub-leader-row:hover,
.hub-leader-row:focus-visible {
  background: #edf6f7;
  outline: none;
}

.leader-rank {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.leader-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
}

.leader-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-logo-small img {
  padding: 4px;
  object-fit: contain;
}

.leader-copy {
  min-width: 0;
}

.leader-copy strong,
.leader-copy small {
  display: block;
}

.leader-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  color: var(--navy);
  font-size: 1.2rem;
  text-align: center;
}

.teams-page {
  width: min(1400px, calc(100% - 32px));
}

.team-control-band {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.2fr) 150px 170px minmax(190px, 0.9fr);
  align-items: end;
  gap: 16px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.team-control-band label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.team-overview {
  margin-top: 18px;
  overflow: hidden;
  background: #f7fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.team-identity {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px;
  color: white;
  background: var(--navy-deep);
}

.team-identity h2 {
  margin: 5px 0 7px;
  font-size: 1.6rem;
}

.team-identity > div:last-child > p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
}

.team-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 100px;
  height: 100px;
  padding: 12px;
  background: white;
  border-radius: 8px;
}

.team-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.team-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding-bottom: 10px;
}

.team-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
  padding: 8px 18px 20px;
}

.team-profile-panel,
.team-formula-panel {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
}

.team-formula-panel .section-heading a {
  color: #076f72;
  font-size: 0.78rem;
  font-weight: 800;
}

.team-formula {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto auto minmax(100px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.team-formula strong {
  color: var(--teal);
  font-size: 1.45rem;
}

.team-formula span {
  color: #425466;
  font-size: 0.82rem;
  line-height: 1.35;
}

.team-formula-panel > p {
  margin: 0;
  padding: 16px 18px 20px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.team-roster-section {
  padding: 32px 0 8px;
}

.team-roster-heading > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.team-roster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.team-player-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.team-player-card:hover,
.team-player-card:focus-visible {
  border-color: rgba(15, 139, 141, 0.55);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
  outline: none;
}

.team-player-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  color: var(--navy);
  background: #edf6f7;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.74rem;
  font-weight: 900;
}

.team-player-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.team-player-copy,
.team-player-copy strong,
.team-player-copy small {
  display: block;
  min-width: 0;
}

.team-player-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-player-score {
  text-align: center;
}

.team-player-score small,
.team-player-score strong {
  display: block;
}

.team-player-score small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-player-score strong {
  margin-top: 2px;
  color: var(--navy);
  font-size: 1.35rem;
}

.team-lineup-section {
  padding: 34px 0 4px;
}

.team-comparison-section {
  margin-top: 30px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.team-comparison-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.team-comparison-heading h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font-size: 1.45rem;
}

.team-comparison-heading > p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
}

.team-comparison-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 0;
}

.team-comparison-summary article {
  padding: 14px;
  background: var(--ice);
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
}

.team-comparison-summary article > span,
.team-comparison-summary small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.team-comparison-summary article > div {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 7px;
  margin: 8px 0 5px;
}

.team-comparison-summary strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.team-comparison-summary strong.is-winner { color: var(--green); }

.team-comparison-summary i {
  color: var(--muted);
  font-size: 0.65rem;
  font-style: normal;
  text-transform: uppercase;
}

.lineup-comparison {
  display: grid;
  gap: 18px;
}

.lineup-comparison-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lineup-comparison-group > header {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  padding: 12px 14px;
  background: var(--ice);
  border-bottom: 1px solid var(--line);
}

.lineup-comparison-group h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.86rem;
}

.lineup-comparison-group header > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lineup-comparison-group header span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
}

.lineup-matchup-row {
  display: grid;
  grid-template-columns: 90px repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.lineup-matchup-row:last-child { border-bottom: 0; }

.lineup-matchup-row > strong {
  display: grid;
  place-items: center;
  padding: 12px 8px;
  color: var(--muted);
  background: var(--ice);
  font-size: 0.72rem;
  text-align: center;
}

.lineup-matchup-row > strong span {
  display: block;
  margin: 2px 0;
  color: var(--teal);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.lineup-matchup-side {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.lineup-matchup-side + .lineup-matchup-side { border-left: 1px solid var(--line); }

.lineup-matchup-side.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.76rem;
}

.lineup-matchup-score {
  text-align: center;
}

.lineup-matchup-score span,
.lineup-matchup-score strong {
  display: block;
}

.lineup-matchup-score span {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lineup-matchup-score strong {
  margin-top: 3px;
  color: var(--teal);
  font-size: 1.3rem;
}

.lineup-matchup-players {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lineup-matchup-players a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.76rem;
  text-decoration: none;
}

.lineup-matchup-players a:hover { text-decoration: underline; }

.lineup-matchup-players a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-matchup-players b { color: var(--teal); }

.lineup-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}

.lineup-group,
.other-contributors {
  min-width: 0;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.lineup-group:first-child {
  grid-row: span 2;
}

.lineup-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.lineup-group-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.96rem;
}

.lineup-group-heading span {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.lineup-rows {
  display: grid;
}

.lineup-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.lineup-row:last-child {
  border-bottom: 0;
}

.lineup-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}

.lineup-row-meta > div:first-child > strong,
.lineup-row-meta > div:first-child > span {
  display: block;
}

.lineup-row-meta > div:first-child > strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.lineup-row-meta > div:first-child > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.lineup-players,
.lineup-goalies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 9px;
}

.lineup-players-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lineup-players-2 .lineup-player strong {
  line-height: 1.15;
  white-space: normal;
}

.lineup-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 64px;
  padding: 7px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none;
}

.lineup-player:hover,
.lineup-player:focus-visible {
  background: #edf6f7;
  border-color: rgba(15, 139, 141, 0.35);
  outline: none;
}

.lineup-player-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 48px;
  overflow: hidden;
  color: var(--navy);
  background: #edf2f5;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 900;
}

.lineup-player-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.lineup-player > span:last-child,
.lineup-player strong,
.lineup-player small {
  display: block;
  min-width: 0;
}

.lineup-player-copy { overflow: hidden; }

.lineup-player-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.lineup-player strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-player small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.66rem;
}

.lineup-copilot-score {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 1.15rem;
  line-height: 1;
}

.lineup-composite {
  display: grid;
  justify-items: center;
  flex: 0 0 auto;
  min-width: 48px;
  padding: 6px 7px;
  color: var(--navy);
  background: var(--teal-soft);
  border: 1px solid rgba(15, 139, 141, 0.28);
  border-radius: 6px;
}

.lineup-composite span {
  margin: 0;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.lineup-composite strong {
  margin-top: 3px;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
}

.lineup-goalies {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lineup-goalies > .lineup-composite {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
}

.lineup-goalies > .lineup-composite strong { margin-top: 0; }

.lineup-goalies > .lineup-composite span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.lineup-goalies > .lineup-composite strong {
  font-size: 1.2rem;
}

.goalie-slot > span {
  display: block;
  padding: 10px 10px 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.other-contributors {
  margin-top: 16px;
}

.contributor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 9px;
}

.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.lineup-method-heading {
  margin-top: 34px;
}

.team-definition-list {
  margin-top: 24px;
}

.definition-list div {
  padding: 18px 24px 18px 0;
  border-bottom: 1px solid var(--line);
}

.definition-list div:nth-child(even) {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.definition-list dt {
  color: var(--navy);
  font-weight: 900;
}

.definition-list dd {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.limitations-section ul {
  margin: 0;
  padding-left: 20px;
  color: #344054;
}

.limitations-section li {
  margin: 9px 0;
  line-height: 1.55;
}

.comparison-dialog {
  width: min(1120px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.comparison-dialog::backdrop {
  background: rgba(7, 17, 28, 0.72);
  backdrop-filter: blur(5px);
}

.dialog-shell {
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: #f3f8fa;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
}

.dialog-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  color: white;
  background: var(--navy-deep);
}

.dialog-header h2 {
  margin: 3px 0 0;
  font-size: 1.45rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.comparison-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.matchup-card {
  min-width: 0;
  padding: 22px;
  background: white;
}

.matchup-player {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.matchup-player p,
.matchup-player h3 {
  margin: 0;
}

.matchup-player p {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.matchup-player h3 {
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  line-height: 1.05;
}

.matchup-player div > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.matchup-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, var(--teal), var(--navy));
  border-radius: 8px;
  font-weight: 950;
}

.matchup-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: white;
}

.matchup-score {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: white;
  background: linear-gradient(145deg, var(--navy), var(--teal));
  border-radius: 50%;
  font-size: 1.35rem;
}

.matchup-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 0;
}

.matchup-metric {
  min-height: 76px;
  padding: 12px;
  background: var(--ice);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.matchup-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.matchup-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 1.25rem;
}

.matchup-metric.metric-winner {
  background: #edf8f3;
  border-color: rgba(35, 139, 90, 0.38);
}

.matchup-metric.metric-winner strong {
  color: var(--green);
}

.matchup-profile {
  display: grid;
  gap: 11px;
}

.matchup-profile span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.matchup-profile b {
  font-weight: 800;
}

.matchup-profile > div > i {
  display: block;
  height: 8px;
  overflow: hidden;
  background: #e6edf2;
  border-radius: 999px;
}

.matchup-profile > div > i > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--red));
  border-radius: inherit;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f0f5;
  --muted: #a8bac8;
  --line: #334c60;
  --ice: #102536;
  --panel: #162b3d;
  --teal: #2db7b5;
  --teal-soft: #173d42;
  --red: #e16478;
  --gold: #e8b54a;
  --green: #48b97e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(10, 24, 36, 0.99), rgba(14, 34, 48, 0.98)),
    repeating-linear-gradient(90deg, rgba(45, 183, 181, 0.04) 0 1px, transparent 1px 104px);
}

html[data-theme="dark"] .skip-link {
  color: var(--ink);
  background: var(--panel);
}

html[data-theme="dark"] .source-bar {
  color: #bad0da;
  background: #122d3b;
  border-color: #275262;
}

html[data-theme="dark"] .source-bar a,
html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .war-section .section-heading a,
html[data-theme="dark"] .score-explainer-heading a,
html[data-theme="dark"] .about-actions a,
html[data-theme="dark"] .hub-section-heading a,
html[data-theme="dark"] .team-formula-panel .section-heading a {
  color: #55cfca;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] .checkbox-control {
  color: var(--ink);
  background: #11283a;
  border-color: var(--line);
}

html[data-theme="dark"] input::placeholder {
  color: #8195a5;
}

html[data-theme="dark"] .control-band,
html[data-theme="dark"] .player-list,
html[data-theme="dark"] .detail-panel,
html[data-theme="dark"] .chart-panel,
html[data-theme="dark"] .report-panel,
html[data-theme="dark"] .comparison-panel,
html[data-theme="dark"] .metric-strip article,
html[data-theme="dark"] .score-trend-chart,
html[data-theme="dark"] .war-overview,
html[data-theme="dark"] .war-breakdown,
html[data-theme="dark"] .method-table-wrap,
html[data-theme="dark"] .about-principles article,
html[data-theme="dark"] .hub-module,
html[data-theme="dark"] .team-control-band,
html[data-theme="dark"] .team-profile-panel,
html[data-theme="dark"] .team-formula-panel,
html[data-theme="dark"] .team-comparison-section,
html[data-theme="dark"] .team-player-card,
html[data-theme="dark"] .lineup-group,
html[data-theme="dark"] .other-contributors,
html[data-theme="dark"] .matchup-card {
  background: var(--panel);
}

html[data-theme="dark"] .player-card {
  background: linear-gradient(180deg, #1a3346, #152b3d);
}

html[data-theme="dark"] .player-card:hover,
html[data-theme="dark"] .player-card.active {
  border-color: var(--teal);
}

html[data-theme="dark"] .mini-headshot,
html[data-theme="dark"] .team-player-image,
html[data-theme="dark"] .lineup-player-image {
  background: #dce9ed;
  border-color: #69808d;
}

html[data-theme="dark"] .metric-strip,
html[data-theme="dark"] .score-trend-section,
html[data-theme="dark"] .war-section,
html[data-theme="dark"] .score-explainer,
html[data-theme="dark"] .detail-layout,
html[data-theme="dark"] .team-overview,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .matchup-metric {
  background: var(--ice);
}

html[data-theme="dark"] .breakdown-component i,
html[data-theme="dark"] .bar-track,
html[data-theme="dark"] .matchup-profile > div > i {
  background: #3a5264;
}

html[data-theme="dark"] .breakdown-component {
  color: #eaf4fa;
}

html[data-theme="dark"] .breakdown-component > i {
  height: 8px;
  background: #36566c;
  box-shadow: inset 0 0 0 1px #567389;
}

html[data-theme="dark"] .breakdown-component > i > i {
  background: #62d8d4;
}

html[data-theme="dark"] .trend-grid line {
  stroke: #557084;
}

html[data-theme="dark"] .trend-line {
  stroke: #72d8f0;
  stroke-width: 4;
}

html[data-theme="dark"] .trend-point circle {
  fill: #102536;
  stroke: #62d8d4;
}

html[data-theme="dark"] .trend-point text {
  fill: #f5fbff;
}

html[data-theme="dark"] .trend-point.is-current circle {
  fill: var(--gold);
  stroke: #d8e7ef;
}

html[data-theme="dark"] .war-track {
  background: linear-gradient(to right, #57313d 0 49.5%, #60717d 49.5% 50.5%, #28534c 50.5% 100%);
}

html[data-theme="dark"] .tag-list span,
html[data-theme="dark"] .comparison-row.is-selected,
html[data-theme="dark"] .hub-leader-row:focus-visible,
html[data-theme="dark"] .lineup-player:focus-visible {
  background: #183b45;
  border-color: #2a6266;
}

html[data-theme="dark"] .tag-list span {
  color: #dffcf9;
  background: #18505a;
  border: 1px solid #337983;
}

html[data-theme="dark"] .lineup-player:hover {
  background: #183b45;
  border-color: #337078;
}

html[data-theme="dark"] .lineup-goalies > .lineup-composite {
  color: #f5fbff;
  background: #205665;
  border-color: #4d8996;
}

html[data-theme="dark"] .lineup-goalies > .lineup-composite span {
  color: #d6edf2;
}

html[data-theme="dark"] .comparison-row:focus-visible {
  background: #173248;
}

html[data-theme="dark"] .queue-remove:focus-visible {
  background: #274257;
}

html[data-theme="dark"] .method-table th,
html[data-theme="dark"] .definition-list div:nth-child(even) {
  color: var(--ink);
  background: #183345;
}

html[data-theme="dark"] .method-table td,
html[data-theme="dark"] .method-steps li,
html[data-theme="dark"] .report-panel p,
html[data-theme="dark"] .limitations-section ul,
html[data-theme="dark"] .team-formula span,
html[data-theme="dark"] .breakdown-row,
html[data-theme="dark"] .site-footer strong {
  color: #c1d0da;
}

html[data-theme="dark"] .war-overview strong,
html[data-theme="dark"] .war-row > strong,
html[data-theme="dark"] .score-stages strong {
  color: #f5fbff;
}

html[data-theme="dark"] .hub-section-heading h2,
html[data-theme="dark"] .team-roster-heading h2,
html[data-theme="dark"] .team-comparison-heading h2,
html[data-theme="dark"] .lineup-comparison-group h3,
html[data-theme="dark"] .lineup-group-heading h3,
html[data-theme="dark"] .lineup-row-meta strong,
html[data-theme="dark"] .methodology-heading h2,
html[data-theme="dark"] .weight-table td:last-child,
html[data-theme="dark"] .weight-table tfoot td {
  color: #eaf4fa;
}

html[data-theme="dark"] .weight-table tfoot td {
  background: #1d3a4d;
  border-top: 2px solid #55758a;
}

html[data-theme="dark"] .hub-section-heading .eyebrow,
html[data-theme="dark"] .team-roster-heading .eyebrow,
html[data-theme="dark"] .lineup-group-heading span,
html[data-theme="dark"] .lineup-row-meta span,
html[data-theme="dark"] .team-roster-heading > span,
html[data-theme="dark"] .methodology-heading > p:last-child,
html[data-theme="dark"] .methodology-summary p,
html[data-theme="dark"] .model-note,
html[data-theme="dark"] .definition-list dd,
html[data-theme="dark"] .about-intro > p:last-child,
html[data-theme="dark"] .about-feedback p,
html[data-theme="dark"] .about-status p,
html[data-theme="dark"] .about-principles p,
html[data-theme="dark"] .about-roadmap p {
  color: #bfd0dc;
}

html[data-theme="dark"] .team-comparison-heading > p,
html[data-theme="dark"] .lineup-comparison-group header span,
html[data-theme="dark"] .lineup-matchup-row > strong {
  color: #bfd0dc;
}

html[data-theme="dark"] .method-steps code {
  color: #66d5d0;
  background: #173b45;
}

html[data-theme="dark"] .bar-label,
html[data-theme="dark"] .bar-value,
html[data-theme="dark"] .trend-grid text,
html[data-theme="dark"] .trend-season-label,
html[data-theme="dark"] .role-copy,
html[data-theme="dark"] .team-identity p,
html[data-theme="dark"] .hub-module div > span {
  color: #c6d6e1;
  fill: #c6d6e1;
}

html[data-theme="dark"] .bar-track {
  height: 18px;
  background: #294558;
  box-shadow: inset 0 0 0 1px #4e687b;
}

html[data-theme="dark"] .bar-fill {
  background: linear-gradient(90deg, #2db7b5, #72d8f0);
}

html[data-theme="dark"] .bar-track-value {
  color: white;
  text-shadow: 0 1px 3px #07131d;
}

html[data-theme="dark"] .hub-intro h2,
html[data-theme="dark"] .about-intro h2,
html[data-theme="dark"] .about-heading h2,
html[data-theme="dark"] .about-feedback h2,
html[data-theme="dark"] .methodology-intro h2,
html[data-theme="dark"] .methodology-summary strong,
html[data-theme="dark"] .about-status strong,
html[data-theme="dark"] .about-principles strong,
html[data-theme="dark"] .about-roadmap strong,
html[data-theme="dark"] .hub-facts strong,
html[data-theme="dark"] .leader-rank,
html[data-theme="dark"] .leader-copy strong,
html[data-theme="dark"] .leader-score,
html[data-theme="dark"] .team-player-copy strong,
html[data-theme="dark"] .team-player-score strong,
html[data-theme="dark"] .lineup-player strong,
html[data-theme="dark"] .definition-list dt {
  color: var(--ink);
}

html[data-theme="dark"] .dialog-shell {
  background: #102536;
}

html[data-theme="dark"] .matchup-metric.metric-winner {
  background: #173b32;
}

html[data-theme="dark"] .season-load-error {
  color: #ffc5c5;
  background: #44252a;
  border-color: #7a3d46;
}

html[data-theme="dark"] .season-load-error button {
  color: white;
  background: #a54450;
}

@media (max-width: 980px) {
  .control-band,
  .dashboard-grid,
  .detail-layout,
  .team-control-band,
  .team-analysis-grid {
    grid-template-columns: 1fr;
  }

  .hub-modules,
  .team-roster-grid,
  .contributor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lineup-board {
    grid-template-columns: 1fr;
  }

  .team-comparison-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lineup-group:first-child {
    grid-row: auto;
  }

  .hub-leaders {
    grid-template-columns: 1fr;
  }

  .player-list {
    position: static;
    max-height: none;
  }

  .players {
    max-height: 420px;
  }
}

@media (max-width: 680px) {
  .source-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px;
  }

  main {
    width: min(1500px, calc(100% - 20px));
    margin-top: 12px;
  }

  .topbar {
    flex-wrap: wrap;
    min-height: 70px;
    padding: 10px 12px;
    gap: 10px;
  }

  .topbar-actions {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .brand-lockup p {
    display: none;
  }

  .brand-lockup {
    gap: 8px;
  }

  .topbar h1 {
    font-size: 1rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .back-button span:last-child { display: none; }

  .season-picker {
    padding-left: 6px;
  }

  .season-picker span {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .header-link {
    font-size: 0.74rem;
  }

  .site-nav {
    gap: 9px;
  }

  .site-nav .header-link:last-child {
    display: none;
  }

  .hub-page,
  .teams-page,
  .about-page {
    width: min(1400px, calc(100% - 20px));
  }

  .hub-intro {
    padding-top: 30px;
  }

  .hub-intro h2 {
    font-size: 1.8rem;
  }

  .about-intro h2 {
    font-size: 1.8rem;
  }

  .about-status,
  .about-principles,
  .about-roadmap ol {
    grid-template-columns: 1fr;
  }

  .about-status article,
  .about-status article + article,
  .about-roadmap li,
  .about-roadmap li + li {
    padding: 18px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .about-feedback,
  .about-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hub-modules,
  .team-roster-grid,
  .contributor-grid {
    grid-template-columns: 1fr;
  }

  .lineup-row {
    grid-template-columns: 1fr;
  }

  .team-comparison-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .team-comparison-heading > p { text-align: left; }

  .team-comparison-summary { grid-template-columns: 1fr; }

  .lineup-comparison-group > header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lineup-comparison-group header > div { display: none; }

  .lineup-matchup-row {
    grid-template-columns: 1fr;
  }

  .lineup-matchup-row > strong { min-height: 36px; }

  .lineup-matchup-side + .lineup-matchup-side {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .lineup-row-meta {
    padding-bottom: 4px;
  }

  .lineup-players {
    grid-template-columns: 1fr;
  }

  .lineup-group-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .lineup-group-heading span {
    text-align: left;
  }

  .team-identity {
    align-items: flex-start;
    padding: 18px;
  }

  .team-logo {
    width: 76px;
    height: 76px;
  }

  .team-identity h2 {
    font-size: 1.3rem;
  }

  .team-formula {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .team-formula b {
    display: none;
  }

  .methodology-page {
    width: min(100% - 24px, 1080px);
  }

  .methodology-intro {
    padding-top: 30px;
  }

  .methodology-intro h2 {
    font-size: 1.8rem;
  }

  .methodology-summary,
  .definition-list {
    grid-template-columns: 1fr;
  }

  .methodology-summary article,
  .methodology-summary article + article,
  .definition-list div,
  .definition-list div:nth-child(even) {
    padding: 18px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .formula-block {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip strong {
    font-size: 2rem;
  }

  .war-overview {
    grid-template-columns: 1fr;
  }

  .war-overview > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .war-row {
    grid-template-columns: 92px minmax(90px, 1fr) 46px;
    gap: 8px;
  }

  .score-explainer-heading {
    display: grid;
  }

  .breakdown-labels,
  .breakdown-row {
    grid-template-columns: minmax(125px, 1fr) 58px 48px 54px;
    gap: 8px;
  }

  .breakdown-component {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .compare-header {
    display: grid;
    padding: 16px;
  }

  .player-hero {
    align-items: flex-start;
  }

  .portrait-frame {
    width: 84px;
  }

  .compare-header h2 {
    overflow-wrap: anywhere;
    font-size: 1.8rem;
    line-height: 1;
  }

  .war-section .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  #compareToggle {
    width: 100%;
  }

  .bar-row {
    grid-template-columns: 88px minmax(0, 1fr) 34px;
  }

  .comparison-cards {
    grid-template-columns: 1fr;
  }

  .matchup-player {
    grid-template-columns: 76px minmax(0, 1fr) 56px;
  }

  .matchup-portrait {
    width: 76px;
    height: 76px;
  }

  .matchup-score {
    width: 56px;
    height: 56px;
  }
}
