/* =========================================================
   VLHS ANALYTICS — MASTER STYLESHEET
   Authoritative layout, typography and component styling.
   Colour tokens are defined in colours.css.
========================================================= */

/* =========================================================
   DESIGN TOKENS
========================================================= */

:root {
    --rail-width: 208px;
    --content-max-width: 1520px;
    --page-gutter: 24px;
    --header-height: 88px;

    --font-body: "Roboto", Arial, Helvetica, sans-serif;
    --font-heading: "Roboto", Arial, Helvetica, sans-serif;
    --font-data: "Roboto", Arial, Helvetica, sans-serif;
    --font-emphasis: "Roboto", Arial, Helvetica, sans-serif;

    --font-size-page-title: 30px;
    --font-size-section-title: 16px;
    --font-size-body: 13px;
    --font-size-small: 12px;
    --font-size-table-header: 11px;

    --font-weight-normal: 400;
    --font-weight-medium: 600;
    --font-weight-bold: 700;

    --table-row-height: 32px;
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --radius-sm: 4px;
    --radius-md: 7px;
}


/* =========================================================
   RESET AND BASE
========================================================= */

* {
    box-sizing: border-box;
}

html {
    background: var(--page);
}

body {
    margin: 0;
    min-width: 0;
    color: var(--text);
    background: var(--page);
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
    line-height: 1.45;
}

button,
input,
select,
textarea {
    font-family: var(--font-body);
}

table,
svg text {
    font-family: var(--font-body);
}

a {
    color: inherit;
}


/* =========================================================
   TYPOGRAPHY SYSTEM
========================================================= */

/* Body copy and ordinary interface text. */
body,
p,
li,
input,
select,
textarea,
button,
.nav-button,
.brand p,
.site-header-meta,
.note,
.empty-message {
    font-family: var(--font-body);
}

/* All hierarchy and headings use Roboto at stronger weights. */
h1,
h2,
h3,
h4,
h5,
h6,
th,
.site-header-copy h1,
.brand h1,
.section-title,
.division-title h2,
.form-card-header h2,
.expectation-card-header h2,
.card-heading h2 {
    font-family: var(--font-heading);
}

/* Data, labels, scores and graph annotations use tabular Roboto numerals. */
table,
td,
.position,
.rank-cell,
.number-cell,
.score-cell,
.rating-cell,
.status-cell,
.streak-value,
.probability-cell,
.expectation-axis-label,
.expectation-team-label,
.expectation-point-label,
.legend-dot {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
}

/*
Names and longer descriptive table text remain Roboto so they are easier
to read while all surrounding statistics stay aligned with tabular numerals.
*/
.team,
.team-heading,
.club-cell,
.match-team,
.division-cell,
.range,
.range-heading,
.empty-row {
    font-family: var(--font-body);
}

/* Inline emphasis is Roboto Bold. */
strong,
b,
.inline-emphasis,
.points,
.goal-difference,
.pi-cell,
.rating-cell,
.streak-value,
.probability-cell {
    font-family: var(--font-emphasis);
    font-weight: 700;
}


/* =========================================================
   LEFT NAVIGATION
========================================================= */

.left-rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--rail-width);
    height: 100vh;
    overflow-y: auto;
    padding: 0;
    border-right: 1px solid var(--line);
    background: var(--surface-strong);
}

.brand {
    min-height: var(--header-height);
    margin: 0;
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-bottom: 1px solid var(--line);
}

.brand h1 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.35px;
}

.brand p {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-size-small);
}

.left-rail nav {
    padding: 16px 12px 0;
}

.nav-group {
    margin-bottom: 14px;
}

.nav-group-label {
    margin: 0 10px 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-button {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    padding: 11px 13px;
    border: 0;
    border-left: 3px solid transparent;
    color: var(--text);
    background: transparent;
    text-align: left;
    text-decoration: none;
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
}

.nav-button:hover {
    background: var(--nav-hover);
}

.nav-button.active {
    border-left-color: var(--nav-active-line);
    background: var(--nav-active);
}


/* =========================================================
   SHARED PAGE SHELL
========================================================= */

.site-page {
    margin-left: var(--rail-width);
    min-width: 0;
    min-height: 100vh;
    background: var(--page);
}

.site-header {
    min-height: var(--header-height);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.site-header-inner,
.site-content-inner {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.sidebar-about {
    margin: 4px 12px 18px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: var(--font-size-small);
}

.sidebar-about summary {
    padding: 12px 10px 8px;
    color: var(--text);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.sidebar-about-content {
    margin: 0;
    padding: 0 10px 10px;
}

.sidebar-about-content h2 {
    margin: 12px 0 4px;
    color: var(--text);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: .35px;
}

.sidebar-about-content p {
    margin: 0 0 8px;
    line-height: 1.45;
}

.sidebar-about-content a {
    color: var(--blue-6);
    font-weight: var(--font-weight-medium);
}

.site-header-inner {
    min-height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    padding: 18px var(--page-gutter) 14px;
}

.site-header-copy h1 {
    margin: 0;
    color: var(--text);
    font-size: var(--font-size-page-title);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.7px;
}

.site-header-copy p,
.site-header-meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
}

.site-header-meta {
    flex: 0 0 auto;
    padding-bottom: 2px;
    text-align: right;
}

.site-content {
    padding: var(--space-lg) var(--page-gutter) 56px;
}

.site-content-inner {
    min-width: 0;
}

.page-shell,
.elo-page-shell,
.page {
    width: auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0;
    background: transparent;
}

.note {
    margin: 12px 2px 0;
    color: var(--muted);
    font-size: var(--font-size-body);
    line-height: 1.45;
}


/* =========================================================
   SHARED CARD HEADINGS
========================================================= */

.division-title,
.form-card-header,
.expectation-card-header,
.card-heading {
    border-bottom: 1px solid var(--line);
    background: var(--header);
}

.division-title h2,
.form-card-header h2,
.expectation-card-header h2,
.card-heading h2,
.section-title {
    margin: 0;
    font-size: var(--font-size-section-title);
    font-weight: var(--font-weight-bold);
}

.division-title span,
.form-card-header p,
.expectation-card-header p,
.card-heading p,
.expectation-legend {
    color: var(--muted);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
}


/* =========================================================
   SHARED TABLE STANDARD
========================================================= */

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    background: var(--surface-strong);
    font-size: var(--font-size-body);
    font-variant-numeric: tabular-nums;
}

th,
td {
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

th {
    padding: 7px 6px;
    color: #2e3438;
    background: var(--header);
    text-align: center;
    font-size: var(--font-size-table-header);
    font-weight: var(--font-weight-bold);
    line-height: 1.05;
}

td {
    height: var(--table-row-height);
    padding: 4px 6px;
    text-align: center;
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
    line-height: 1.1;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    filter: brightness(0.975);
}

.team,
.club-cell,
.match-team {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
}

.position,
.rank-cell {
    font-weight: var(--font-weight-bold);
}

.pi-cell.positive {
    color: var(--positive);
    font-weight: var(--font-weight-bold);
}

.pi-cell.negative {
    color: var(--negative);
    font-weight: var(--font-weight-bold);
}

.pi-cell.neutral {
    color: var(--neutral);
}


/* =========================================================
   STANDINGS
========================================================= */

.division-card {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.division-title {
    min-height: 42px;
    padding: 9px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.standings-table {
    min-width: 1080px;
}

.standings-table th,
.standings-table td {
    width: 6.6667%;
}

.standings-table .team-heading,
.standings-table .team {
    text-align: left;
}

.standings-table .points,
.standings-table .goal-difference {
    font-weight: var(--font-weight-bold);
}

.standings-table tr.finals-position td {
    background: var(--finals-row);
}

.standings-table tr.relegation-position td {
    background: var(--relegation-row);
}

.standings-table tr.finals-cutoff td {
    border-bottom: 2px solid var(--cutoff-line);
}


.tab-panel {
    display: none;
    padding: 0 0 24px;
}

.tab-panel.active {
    display: block;
}

.section-title {
    margin: 0;
    padding: 9px 12px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--header);
    text-align: left;
}

.ratings-table thead th,
.results-table thead th,
.upsets-table thead th,
.match-table thead th {
    background: var(--header);
}

.ratings-table td,
.results-table td,
.upsets-table td,
.match-table td {
    padding: 4px 6px;
}

.ratings-table .club-cell,
.match-table .match-team {
    text-align: left;
}

.ratings-table .division-cell,
.match-table .division-cell {
    text-align: left;
    color: var(--muted);
}

.number-cell,
.score-cell {
    text-align: center;
}

.rating-cell {
    font-weight: var(--font-weight-bold);
}

.status-cell {
    color: var(--muted);
    font-size: var(--font-size-small);
}

.match-first-row td {
    padding-top: 4px;
    padding-bottom: 2px;
}

.match-second-row td {
    padding-top: 2px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.match-table tr.match-highlight td {
    background: var(--blue-1);
}

.graph-frame {
    display: block;
    width: 100%;
    height: calc(100vh - 132px);
    min-height: 660px;
    border: 0;
    background: var(--surface-strong);
}

.empty-message {
    padding: 36px;
    color: var(--muted);
    text-align: center;
    font-size: var(--font-size-small);
}


/* =========================================================
   STANDINGS FINALS STATUS
========================================================= */

.finals-status {
    margin-left: 4px;
    font-family: var(--font-emphasis);
    font-weight: var(--font-weight-bold);
}

.eliminated-marker {
    color: var(--negative);
}

.secured-marker {
    color: var(--positive);
}

/* =========================================================
   FORM PAGE
========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
    align-items: start;
}

.form-card {
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.form-card-header {
    min-height: 54px;
    padding: 9px 10px;
}

.form-card-header p {
    margin: 3px 0 0;
}

.form-table {
    min-width: 560px;
    table-layout: fixed;
}

.form-table th,
.form-table td {
    padding-left: 4px;
    padding-right: 4px;
}

.form-table .team-heading,
.form-table .team {
    width: 38%;
    text-align: left;
}

.form-table .team {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.form-table .position {
    width: 7%;
}

.form-table .goal-difference {
    font-weight: var(--font-weight-bold);
}

.pi-table {
    min-width: 300px;
}

.pi-table .team-heading,
.pi-table .team {
    width: 48%;
}

.pi-table .position {
    width: 10%;
}


/* =========================================================
   PERFORMANCE VS EXPECTATION
========================================================= */

.expectation-card,
.expectation-table-card {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.expectation-card-header {
    padding: 9px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--header);
}

.expectation-card-header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--font-size-section-title);
    font-weight: var(--font-weight-bold);
}

.expectation-card-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: var(--font-size-small);
}

.expectation-legend {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: var(--font-size-small);
}

.expectation-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.legend-dot.expected,
.expectation-dot.expected {
    background: var(--expected);
    fill: var(--expected);
}

.legend-dot.actual,
.expectation-dot.actual {
    background: var(--actual);
    fill: var(--actual);
}

.expectation-chart-scroll {
    overflow-x: auto;
    padding: 0;
}

.expectation-chart {
    display: block;
    width: 100%;
    min-width: 1450px;
    height: auto;
    font-family: var(--font-data);
    background: var(--surface-strong);
}

.expectation-grid-line {
    stroke: var(--line-soft);
    stroke-width: 1;
}

.expectation-grid-line.minor {
    stroke: var(--line-soft);
    stroke-width: 0.7;
    stroke-dasharray: 2 2;
    opacity: 0.8;
}

.expectation-row-guide {
    stroke: var(--line-soft);
    stroke-width: 0.65;
    opacity: 0.75;
}

.expectation-position-label,
.expectation-point-label {
    fill: var(--text);
    font-family: var(--font-data);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
}

.expectation-team-label {
    fill: var(--text);
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
}

.expectation-axis-label {
    fill: var(--muted);
    font-family: var(--font-heading);
    font-size: var(--font-size-table-header);
    font-weight: var(--font-weight-normal);
}

.expectation-point-label.expected-value,
.expectation-point-label.actual-value {
    fill: #111111;
}

.expectation-connector {
    stroke-width: 1;
}

.expectation-connector.over {
    stroke: var(--positive);
}

.expectation-connector.under {
    stroke: var(--negative);
    stroke-dasharray: 3 3;
}

.expectation-connector.level {
    stroke: var(--neutral);
}

.expectation-table {
    min-width: 1450px;
    table-layout: fixed;
}

.expectation-table th,
.expectation-table td {
    height: var(--table-row-height);
    padding: 4px 6px;
}

.expectation-table th {
    padding-top: 7px;
    padding-bottom: 7px;
    font-family: var(--font-heading);
    font-size: var(--font-size-table-header);
}

.expectation-table td {
    font-family: var(--font-data);
    font-size: var(--font-size-body);
}

.expectation-table .team-heading,
.expectation-table .team {
    padding-left: 6px;
    padding-right: 6px;
    text-align: left;
    font-family: var(--font-body);
}

.expectation-table .team {
    font-weight: var(--font-weight-medium);
}


/* =========================================================
   STREAKS
========================================================= */

.streak-card {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.card-heading {
    min-height: 54px;
    padding: 9px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.card-heading p {
    margin: 3px 0 0;
}

.card-heading span {
    color: var(--muted);
    font-size: var(--font-size-small);
}

.streak-table {
    min-width: 640px;
}

.streak-table .team-heading,
.streak-table .team,
.streak-table .range-heading,
.streak-table .range {
    text-align: left;
}

.streak-value {
    font-weight: var(--font-weight-bold);
}

.empty-row {
    color: var(--muted);
}


/* =========================================================
   PROBABILITY CELLS
========================================================= */

.probability-0 {
    background: var(--surface-strong);
}

.probability-1 {
    background: var(--blue-1);
}

.probability-2 {
    background: var(--blue-2);
}

.probability-3 {
    background: var(--blue-3);
}

.probability-4 {
    background: var(--blue-4);
}

.probability-5 {
    color: var(--blue-text-dark);
    background: var(--blue-5);
}

.probability-6 {
    color: #ffffff;
    background: var(--blue-6);
}

.probability-cell {
    font-weight: var(--font-weight-bold);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1650px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-table {
        min-width: 620px;
    }
}

@media (max-width: 1280px) {
    :root {
        --rail-width: 190px;
    }

    .site-header-inner,
    .site-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }

    .elo-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 980px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   STANDINGS NORMAL / EXTENDED — AUTHORITATIVE SYSTEM
========================================================= */


.standings-tab-panel {
    display: none;
}

.standings-tab-panel.active {
    display: block;
}

.standings-tab-panel .division-card {
    margin-bottom: 18px;
}

.standings-tab-panel .division-title {
    min-height: 42px;
    padding: 9px 12px;
}

.normal-standings-table,
.extended-standings-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
    font-family: var(--font-data);
    font-size: var(--font-size-body);
}

.normal-standings-table th,
.extended-standings-table th {
    height: 27px;
    padding: 7px 6px;
    font-family: var(--font-heading);
    font-size: var(--font-size-table-header);
    font-weight: var(--font-weight-bold);
    line-height: 1.05;
    white-space: nowrap;
}

.normal-standings-table td,
.extended-standings-table td {
    height: var(--table-row-height);
    padding: 4px 6px;
    font-family: var(--font-data);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
    line-height: 1.1;
}

.normal-standings-table .team-heading,
.normal-standings-table .team,
.extended-standings-table .team-heading,
.extended-standings-table .team {
    padding-left: 6px;
    padding-right: 6px;
    text-align: left;
    font-family: var(--font-body);
    font-size: var(--font-size-body);
}

.normal-standings-table .team,
.extended-standings-table .team {
    font-weight: var(--font-weight-medium);
}

.normal-standings-table th:nth-child(1),
.normal-standings-table td:nth-child(1),
.extended-standings-table th:nth-child(1),
.extended-standings-table td:nth-child(1) {
    width: 54px;
}

.normal-standings-table th:nth-child(2),
.normal-standings-table td:nth-child(2),
.extended-standings-table th:nth-child(2),
.extended-standings-table td:nth-child(2) {
    width: 220px;
}

.normal-standings-table th:nth-child(3),
.normal-standings-table td:nth-child(3) {
    width: 56px;
}

.normal-standings-table th:nth-child(4),
.normal-standings-table td:nth-child(4) {
    width: 88px;
}

.normal-standings-table th:nth-child(10),
.normal-standings-table td:nth-child(10),
.normal-standings-table th:nth-child(11),
.normal-standings-table td:nth-child(11) {
    width: 82px;
}

.normal-standings-table th:nth-child(12),
.normal-standings-table td:nth-child(12) {
    width: 98px;
}

.extended-standings-table th:nth-child(3),
.extended-standings-table td:nth-child(3),
.extended-standings-table th:nth-child(4),
.extended-standings-table td:nth-child(4),
.extended-standings-table th:nth-child(5),
.extended-standings-table td:nth-child(5) {
    width: 64px;
}

.extended-standings-table th:nth-child(6),
.extended-standings-table td:nth-child(6),
.extended-standings-table th:nth-child(7),
.extended-standings-table td:nth-child(7),
.extended-standings-table th:nth-child(8),
.extended-standings-table td:nth-child(8),
.extended-standings-table th:nth-child(9),
.extended-standings-table td:nth-child(9) {
    width: 78px;
}

.extended-standings-table th:nth-child(n+10),
.extended-standings-table td:nth-child(n+10) {
    width: 56px;
}

.normal-standings-table tr.finals-position td,
.extended-standings-table tr.finals-position td {
    background: var(--finals-row);
}

.normal-standings-table tr.relegation-position td,
.extended-standings-table tr.relegation-position td {
    background: var(--relegation-row);
}

.normal-standings-table tr.finals-cutoff td,
.extended-standings-table tr.finals-cutoff td {
    border-bottom: 2px solid var(--cutoff-line);
}

.altius-standings-table .competition-average-row td {
    border-top: 2px solid var(--cutoff-line);
    background: var(--table-head-bg);
    font-weight: var(--font-weight-bold);
}


/* Performance graph/table shared Pos and Team alignment. */
.expectation-table col:nth-child(1),
.expectation-table th:nth-child(1),
.expectation-table td:nth-child(1) {
    width: 54px;
}

.expectation-table col:nth-child(2),
.expectation-table th:nth-child(2),
.expectation-table td:nth-child(2) {
    width: 220px;
}


/* =========================================================
   SHARED PAGE SUB-NAVIGATION
========================================================= */

.page-subnav,
.form-subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0 0 20px;
    padding: 0;
}

.page-subnav-button,
.form-subnav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    background: var(--surface-strong);
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-bold);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.page-subnav-button:hover,
.form-subnav-button:hover {
    border-color: var(--blue-4);
    background: var(--nav-hover);
}

.page-subnav-button.active,
.form-subnav-button.active {
    border-color: #24578a;
    color: #ffffff;
    background: #24578a;
}

.page-subnav-button:focus-visible,
.form-subnav-button:focus-visible {
    outline: 2px solid var(--blue-5);
    outline-offset: 2px;
}

.projection-table {
    min-width: 920px;
}

.projection-table .team-heading,
.projection-table .team,
.projection-heatmap .team-heading,
.projection-heatmap .team {
    text-align: left;
}

.projection-table .projection-win {
    color: var(--positive);
    font-weight: var(--font-weight-bold);
}

.projection-heatmap {
    min-width: 900px;
    table-layout: fixed;
}

.projection-heatmap .team-heading,
.projection-heatmap .team {
    width: 210px;
}

.projection-heatmap td:not(.team) {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
}

.projection-heatmap-card .division-title {
    align-items: flex-start;
}

/* =========================================================
   PROJECTIONS VIEW PANELS
========================================================= */

.projection-tab-panel {
    display: none;
}

.projection-tab-panel.active {
    display: block;
}

/* =========================================================
   PROJECTION POSITION CUTOFFS
========================================================= */

.projection-heatmap th.position-finals-cutoff,
.projection-heatmap td.position-finals-cutoff {
    border-right: 3px solid var(--cutoff-line);
}

.projection-heatmap th.position-relegation-cutoff,
.projection-heatmap td.position-relegation-cutoff {
    border-right: 3px solid var(--negative);
}


/* =========================================================
   FIXTURES PAGE
========================================================= */

.fixtures-division-panel {
    display: none;
}

.fixtures-division-panel.active {
    display: block;
}

.fixtures-tab-panel {
    display: none;
}

.fixtures-tab-panel.active {
    display: block;
}

.fixtures-table {
    min-width: 1180px;
    table-layout: fixed;
}

.fixtures-table .fixture-col-round {
    width: 8%;
}

.fixtures-table .fixture-col-match {
    width: 12%;
}

.fixtures-table .fixture-col-division {
    width: 12%;
}

.fixtures-table .fixture-col-current {
    width: 10%;
}

.fixtures-table .fixture-col-outcome {
    width: 9%;
}

.fixtures-table .fixture-col-exchange {
    width: 5%;
}

.fixtures-table .match-team,
.fixtures-table .team-heading,
.fixtures-table .division-cell {
    text-align: left;
}

/* Text labels consistently align left across match-list tables. */
.fixtures-table .match-team,
.fixtures-table .team-heading,
.dashboard-fixture-table .team,
.dashboard-fixture-table .team-heading,
.dashboard-fixture-table .division-cell,
.game-records-table .competition-cell {
    text-align: left;
}

.fixtures-table .match-team {
    font-family: var(--font-body);
    font-weight: var(--font-weight-medium);
}

.fixtures-table .division-cell {
    color: var(--muted);
    font-family: var(--font-body);
}

.fixtures-table .probability-cell {
    font-weight: var(--font-weight-bold);
}

.fixtures-table tbody tr.match-pair:not(.game-shaded) > td {
    background-color: var(--surface-strong);
}

.fixtures-table tbody tr.game-shaded > td {
    background-color: color-mix(
        in srgb,
        var(--header) 38%,
        var(--surface-strong)
    );
}

.fixtures-table .match-first-row td[rowspan="2"] {
    border-bottom: 1px solid var(--line);
}

.fixtures-table .match-first-row td:not([rowspan]) {
    border-bottom: 0;
}

.fixtures-table .current-start,
.fixtures-table .current-group {
    border-left: 1px solid var(--line);
}

.fixtures-table .current-end,
.fixtures-table .current-group {
    border-right: 1px solid var(--line);
}

.fixtures-table .outcome-end,
.fixtures-table .outcome-group {
    border-right: 1px solid var(--line);
}

.fixtures-table tbody tr:hover > td {
    filter: none;
}

/* =========================================================
   RECORDS AND MISCELLANEOUS
========================================================= */

.records-tab-panel {
    display: none;
}

.records-tab-panel.active {
    display: block;
}

.records-card,
.records-placeholder {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.records-table {
    min-width: 980px;
}

.records-table .team,
.records-table .team-heading {
    text-align: left;
}

.records-elo-table {
    min-width: 720px;
}

.venue-records-table,
.finals-records-table {
    min-width: 900px;
}

.records-placeholder {
    padding: 28px;
}

.records-placeholder h2 {
    margin: 0 0 8px;
    font-size: var(--font-size-section-title);
}

.records-placeholder p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}


/* Miscellaneous sub-pages */
.misc-tab-panel {
    display: none;
}

.misc-tab-panel.active {
    display: block;
}

.game-records-table {
    min-width: 1050px;
}

/* =========================================================
   STRENGTH OF SCHEDULE
========================================================= */

.sos-table {
    min-width: 760px;
}

.sos-table .team-heading,
.sos-table .team,
.sos-table .division-cell {
    text-align: left;
}

.sos-table .division-cell {
    color: var(--muted);
    font-family: var(--font-body);
}

.sos-table td,
.sos-table th {
    white-space: nowrap;
}

/* =========================================================
   CONTENT-SIZED TABLE SYSTEM
   Normal Standings and Form are the visual baseline.
========================================================= */

/*
Most tables should size columns from their content. This prevents wide
numeric columns from being spread evenly across the entire page.
*/
.ratings-table,
.results-table,
.upsets-table,
.match-table,
.fixtures-table,
.sos-table,
.projection-table,
.records-table,
.streak-table,
.venue-records-table,
.finals-records-table,
.game-records-table {
    table-layout: auto;
}

/*
These tables deliberately use controlled or equal-width columns.
*/
.normal-standings-table,
.extended-standings-table,
.form-table,
.expectation-table,
.projection-heatmap {
    table-layout: fixed;
}

/* Compact columns only use the width required by their content. */
.position,
.rank-cell,
.number-cell,
.score-cell,
.rating-cell,
.status-cell,
.probability-cell {
    width: 1%;
    white-space: nowrap;
}

/* Multi-row table headers should not double the vertical padding. */
thead tr:first-child:not(:last-child) th {
    padding-top: 6px;
    padding-bottom: 3px;
}

thead tr:last-child:not(:first-child) th {
    padding-top: 3px;
    padding-bottom: 6px;
}

/* ELO Rankings */
.ratings-table th:nth-child(1),
.ratings-table td:nth-child(1),
.ratings-table th:nth-child(2),
.ratings-table td:nth-child(2) {
    width: 1%;
    min-width: 72px;
    white-space: nowrap;
    text-align: center;
}

.ratings-table th:nth-child(3),
.ratings-table td:nth-child(3) {
    width: 1%;
    min-width: 160px;
    white-space: nowrap;
    text-align: center;
}

.ratings-table th:nth-child(4),
.ratings-table td:nth-child(4) {
    width: 1%;
    min-width: 190px;
    white-space: nowrap;
    text-align: center;
}

.ratings-table th:nth-child(n+5),
.ratings-table td:nth-child(n+5) {
    width: 1%;
    min-width: 74px;
    white-space: nowrap;
    text-align: center;
}

/* Fixtures */
.fixtures-table th:first-child,
.fixtures-table td:first-child {
    width: 1%;
    min-width: 110px;
    white-space: nowrap;
}

.fixtures-table th:nth-child(2),
.fixtures-table td:nth-child(2) {
    min-width: 170px;
}

.fixtures-table th:nth-child(3),
.fixtures-table td:nth-child(3) {
    width: 1%;
    min-width: 150px;
    white-space: nowrap;
}

.fixtures-table th:nth-child(n+4),
.fixtures-table td:nth-child(n+4) {
    width: 1%;
    min-width: 68px;
    white-space: nowrap;
}

/* Current-season Results */
.results-table th:first-child,
.results-table td:first-child {
    width: 1%;
    min-width: 105px;
    white-space: nowrap;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
    width: 1%;
    min-width: 160px;
    white-space: nowrap;
}

.results-table th:nth-child(3),
.results-table td:nth-child(3) {
    min-width: 180px;
    text-align: left;
}

.results-table th:nth-child(n+4),
.results-table td:nth-child(n+4) {
    width: 1%;
    min-width: 72px;
    white-space: nowrap;
}

/* Strength of Schedule */
.sos-table .division-cell {
    text-align: left;
}

.sos-table th:first-child,
.sos-table td:first-child {
    width: 1%;
    min-width: 54px;
    white-space: nowrap;
}

.sos-table th:nth-child(2),
.sos-table td:nth-child(2) {
    min-width: 190px;
}

.sos-table th:nth-child(3),
.sos-table td:nth-child(3) {
    min-width: 160px;
}

.sos-table th:nth-child(n+4),
.sos-table td:nth-child(n+4) {
    width: 1%;
    min-width: 145px;
    white-space: nowrap;
}

.sos-table .sos-metric strong,
.sos-table .sos-metric small {
    display: block;
}

.sos-table .sos-metric small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.sos-table {
    min-width: 1120px;
    table-layout: fixed;
}

.sos-table th,
.sos-table td,
.sos-table th:first-child,
.sos-table td:first-child,
.sos-table th:nth-child(2),
.sos-table td:nth-child(2),
.sos-table th:nth-child(3),
.sos-table td:nth-child(3),
.sos-table th:nth-child(n+4),
.sos-table td:nth-child(n+4) {
    width: 12.5%;
    min-width: 0;
}

/* Records and Miscellaneous */
.records-table th:first-child,
.records-table td:first-child {
    width: 1%;
    min-width: 54px;
    white-space: nowrap;
}

.records-table th,
.records-table td {
    white-space: nowrap;
}

.records-table .team,
.records-table .team-heading {
    min-width: 170px;
    white-space: normal;
}

.venue-records-table .team,
.venue-records-table .team-heading {
    min-width: 250px;
    white-space: normal;
}

.finals-records-table .team,
.finals-records-table .team-heading {
    min-width: 190px;
}

.game-records-table .team,
.game-records-table .team-heading {
    min-width: 180px;
    white-space: normal;
}

/* Projection summary uses content-sized columns. */
.projection-table th,
.projection-table td {
    white-space: nowrap;
}

.projection-table .team,
.projection-table .team-heading {
    min-width: 180px;
    white-space: normal;
}

/* Shared card headers stay attached directly to their table. */
.section-title,
.division-title,
.form-card-header,
.expectation-card-header,
.card-heading {
    margin-bottom: 0;
}


/* =========================================================
   DASHBOARD
========================================================= */

.dashboard-hero {
    margin-bottom: 18px;
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(480px, 1fr);
    gap: 26px;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.dashboard-kicker {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-hero h2 { margin: 0 0 8px; font-size: 24px; }
.dashboard-insight {
    max-width: 850px;
    margin: 0;
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 1.45;
}

.dashboard-snapshot {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-metric {
    min-width: 0;
    padding: 14px 8px;
    border: 1px solid var(--line-soft);
    background: var(--header);
    text-align: center;
}

.dashboard-metric strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-data);
    font-size: 19px;
}
.dashboard-metric span { color: var(--muted); font-size: var(--font-size-small); }
.dashboard-metric em { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.dashboard-card,
.dashboard-finals-card {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.dashboard-card-header {
    min-height: 42px;
    padding: 9px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--header);
}

.dashboard-card-header h2 { margin: 0; font-size: var(--font-size-section-title); }
.dashboard-card-header a {
    color: var(--muted);
    font-size: var(--font-size-small);
    text-decoration: none;
}
.dashboard-card-header a:hover { color: var(--text); text-decoration: underline; }

.dashboard-primary-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.72fr) minmax(680px, 1.28fr);
    gap: 18px;
}
.dashboard-three-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dashboard-two-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.dashboard-feature-team { padding: 22px; }
.dashboard-feature-team h3 { margin: 0 0 8px; font-size: 23px; }
.dashboard-feature-record { margin: 0 0 18px; font-family: var(--font-data); font-size: 16px; }
.dashboard-feature-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dashboard-feature-stats span {
    padding: 10px;
    border: 1px solid var(--line-soft);
    background: var(--header);
    text-align: center;
}
.dashboard-feature-stats strong {
    display: block;
    margin-top: 3px;
    font-family: var(--font-data);
    font-size: 16px;
}
.dashboard-feature-games { margin: 14px 0 0; padding: 0; list-style: none; }
.dashboard-feature-games li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 8px 2px;
    border-bottom: 1px solid var(--line-soft);
}
.dashboard-feature-games li:last-child { border-bottom: 0; }
.dashboard-feature-games span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-feature-games strong,
.dashboard-feature-games b { font-family: var(--font-data); white-space: nowrap; }
.dashboard-feature-games b { color: var(--positive); }
.dashboard-method-note { margin: 13px 0 0; color: var(--muted); font-size: var(--font-size-small); }

.dashboard-fixture-table { table-layout: auto; }
.dashboard-fixture-table th:first-child,
.dashboard-fixture-table td:first-child { width: 1%; min-width: 135px; white-space: nowrap; }
.dashboard-fixture-table .team { min-width: 150px; }
.dashboard-form-table .team-heading,
.dashboard-form-table .team { text-align: left; }
.dashboard-fixture-table .probability-cell,
.dashboard-versus { width: 1%; white-space: nowrap; }
.dashboard-importance { min-width: 155px; }
.dashboard-importance strong,
.dashboard-importance small { display: block; }
.dashboard-importance strong { color: var(--blue-6); font-size: 15px; }
.dashboard-importance strong::after { content: "%"; }
.dashboard-importance small { margin-top: 2px; color: var(--muted); font-size: 9px; white-space: normal; }
.dashboard-importance-note { padding: 0 14px 13px; }

.dashboard-league-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.dashboard-league-card {
    padding: 15px;
    display: block;
    border: 1px solid var(--line-soft);
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}
.dashboard-league-card:hover { border-color: var(--blue-4); background: var(--blue-1); }
.dashboard-league-card > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: var(--font-size-small); }
.dashboard-league-card > strong { display: block; margin-bottom: 14px; font-size: 17px; }
.dashboard-league-card > div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-data);
    font-size: var(--font-size-small);
}

.dashboard-list { margin: 0; padding: 0; list-style: none; }
.dashboard-list li {
    min-height: 40px;
    padding: 7px 12px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid var(--line-soft);
}
.dashboard-list li:last-child { border-bottom: 0; }
.dashboard-movers-card {
    display: flex;
    flex-direction: column;
}

.ratings-table th,
.ratings-table td {
    text-align: center;
}

.ratings-table {
    table-layout: fixed;
    min-width: 1320px;
}

.ratings-table col.rank { width: 4%; }
.ratings-table col.rating { width: 5%; }
.ratings-table col.club { width: 11%; }
.ratings-table col.division { width: 14%; }
.ratings-table col.change,
.ratings-table col.highest,
.ratings-table col.average { width: 7.25%; }
.ratings-table col.status { width: 8%; }

.ratings-table tbody td:nth-child(5),
.ratings-table tbody td:nth-child(7),
.ratings-table tbody td:nth-child(9),
.ratings-table tbody td:nth-child(11),
.ratings-table tbody td:nth-child(13),
.ratings-table .rating-group-divider {
    border-left: 1px solid var(--line);
}

.ratings-table .club-heading,
.ratings-table .division-heading,
.ratings-table td.club-cell,
.ratings-table td.division-cell,
.ratings-table td.club-cell.team-profile-link {
    text-align: left !important;
}

.rating-comparison {
    white-space: nowrap;
    font-size: var(--font-size-small);
}

.rating-comparison.comparison-positive { color: var(--positive); }
.rating-comparison.comparison-negative { color: var(--negative); }
.rating-comparison.comparison-neutral { color: var(--muted); }

.upsets-table .division-cell,
.upsets-table .team-heading,
.upsets-table .match-team {
    text-align: left;
}

.upsets-table {
    table-layout: fixed;
    min-width: 1080px;
}

.upsets-table col.position { width: 6%; }
.upsets-table col.round,
.upsets-table col.season { width: 7%; }
.upsets-table col.division { width: 18%; }
.upsets-table col.team { width: 22%; }
.upsets-table col.score { width: 7%; }
.upsets-table col.metric { width: 8.25%; }

.upsets-table .upsets-rating-divider,
.upsets-table .upsets-rank-divider {
    border-left: 1px solid var(--line);
}

.upsets-table .upsets-match-heading {
    padding-left: 6px;
    text-align: left;
}

.game-records-table .competition-cell {
    min-width: 190px;
    white-space: normal;
}
.dashboard-movers-card .dashboard-list {
    flex: 1;
    display: grid;
    grid-template-rows: repeat(7, 1fr);
}
.dashboard-movers-card .dashboard-list li {
    min-height: 0;
    padding: 7px 12px;
}
.dashboard-rank { color: var(--muted); font-family: var(--font-data); text-align: center; }
.dashboard-list-main { min-width: 0; }
.dashboard-list-main strong, .dashboard-list-main small { display: block; }
.dashboard-list-main small { margin-top: 2px; color: var(--muted); font-size: var(--font-size-small); }
.dashboard-list-inline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}
.dashboard-list-main .dashboard-inline-meta {
    display: inline;
    margin-top: 0;
}
.dashboard-value { font-family: var(--font-data); font-weight: var(--font-weight-bold); white-space: nowrap; }
.dashboard-value.positive { color: var(--positive); }
.dashboard-value.negative { color: var(--negative); }

.dashboard-streak-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.dashboard-streak {
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
    border: 1px solid var(--line-soft);
    background: var(--surface);
}
.dashboard-streak span { grid-column: 1 / -1; color: var(--muted); font-size: var(--font-size-small); }
.dashboard-streak strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-streak b { font-family: var(--font-data); font-size: 18px; }

.dashboard-section-heading { margin: 7px 0 12px; }
.dashboard-section-heading h2 { margin: 0; font-size: 21px; }
.dashboard-section-heading p { margin: 4px 0 0; color: var(--muted); }

.dashboard-finals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dashboard-finals-list { padding: 8px 12px 12px; }
.dashboard-finals-row {
    min-height: 31px;
    margin-top: 4px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--line);
    background: var(--surface);
}
.dashboard-finals-row strong { font-family: var(--font-data); }
.dashboard-finals-row.finals-certain { border-left-color: var(--positive); background: var(--finals-row); }
.dashboard-finals-row.finals-likely { border-left-color: var(--blue-5); background: var(--blue-1); }
.dashboard-finals-row.finals-live { border-left-color: #b38a28; }
.dashboard-finals-row.finals-unlikely { border-left-color: var(--negative); background: var(--relegation-row); }
.dashboard-empty { margin: 0; padding: 22px; color: var(--muted); }

@media (max-width: 1400px) {
    .dashboard-hero { grid-template-columns: 1fr; }
    .dashboard-primary-grid { grid-template-columns: 1fr; }
    .dashboard-three-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-league-grid,
    .dashboard-streak-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* =========================================================
   UNIFIED SITE COMPONENTS
   These rules are the final authority for shared presentation.
========================================================= */

body,
button,
input,
select,
textarea,
table,
th,
td,
svg text,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
    line-height: 1.2;
}

.left-rail,
.site-header,
.analytics-card,
.division-card,
.form-card,
.expectation-card,
.expectation-table-card,
.streak-card,
.dashboard-card,
.dashboard-finals-card,
.dashboard-hero {
    box-shadow: none;
}

.analytics-card,
.division-card,
.form-card,
.expectation-card,
.expectation-table-card,
.streak-card,
.dashboard-card,
.dashboard-finals-card,
.dashboard-hero,
.records-placeholder {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
}

.analytics-card,
.division-card,
.form-card,
.expectation-card,
.expectation-table-card,
.streak-card,
.dashboard-card,
.dashboard-finals-card,
.dashboard-hero {
    margin-bottom: var(--space-lg);
}

.division-title,
.form-card-header,
.expectation-card-header,
.card-heading,
.dashboard-card-header,
.section-title {
    min-height: 46px;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--line);
    background: var(--header);
}

.page-subnav,
.form-subnav {
    margin: 0 0 var(--space-lg);
    padding: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
}

.page-subnav-button,
.form-subnav-button {
    min-height: 36px;
    margin: 0;
    padding: 8px 13px;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--muted);
    background: transparent;
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.page-subnav-button:hover,
.form-subnav-button:hover {
    color: var(--text);
    background: var(--nav-hover);
}

.page-subnav-button.active,
.form-subnav-button.active {
    color: var(--text);
    background: var(--nav-active);
}

.nav-button,
.page-subnav-button,
.form-subnav-button,
.dashboard-league-card,
tbody tr td {
    transition: color 120ms ease, background-color 120ms ease,
        border-color 120ms ease;
}

.nav-button:focus-visible,
.page-subnav-button:focus-visible,
.form-subnav-button:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--blue-4);
    outline-offset: 2px;
}

.table-scroll,
.expectation-chart-scroll {
    width: 100%;
    overflow-x: auto;
    scrollbar-color: var(--muted-light) var(--header);
}

th {
    letter-spacing: 0.01em;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

tbody tr:nth-child(even) td {
    background-color: color-mix(in srgb, var(--header) 38%, transparent);
}

tbody tr:hover td {
    background-color: var(--nav-hover);
    filter: none;
}

tbody tr.current-season-row > td {
    background-color: #e3f1f8 !important;
}

tbody tr.current-season-row:hover > td {
    background-color: #cfe6f2 !important;
}

abbr.stat-term {
    border-bottom: 1px dotted var(--muted-light);
    text-decoration: none;
    cursor: help;
}

.table-intro {
    margin: 0 0 var(--space-md);
    color: var(--muted);
    font-size: var(--font-size-small);
}

@media (max-width: 900px) {
    :root {
        --page-gutter: 16px;
        --header-height: auto;
    }

    .left-rail {
        position: static;
        width: 100%;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand {
        min-height: 0;
        padding: 14px var(--page-gutter) 10px;
    }

    .left-rail nav {
        padding: 0 var(--page-gutter) 12px;
        display: flex;
        gap: 6px;
        overflow-x: auto;
    }

    .nav-group {
        margin: 0;
        display: contents;
    }

    .nav-group-label,
    .sidebar-about {
        display: none;
    }

    .nav-button {
        width: auto;
        min-width: max-content;
        margin: 0;
        padding: 8px 11px;
        border-left: 0;
        border-bottom: 3px solid transparent;
    }

    .nav-button.active {
        border-bottom-color: var(--nav-active-line);
    }

    .site-page {
        margin-left: 0;
    }

    .site-header-inner {
        padding: 18px var(--page-gutter);
        align-items: flex-start;
    }

    .site-header-meta {
        text-align: left;
    }

    .site-content {
        padding-top: var(--space-md);
    }

    .form-grid,
    .dashboard-hero,
    .dashboard-primary-grid,
    .dashboard-three-grid,
    .dashboard-two-grid,
    .dashboard-finals-grid,
    .dashboard-league-grid,
    .dashboard-streak-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-hero,
    .dashboard-hero > *,
    .dashboard-primary-grid,
    .dashboard-primary-grid > *,
    .dashboard-card,
    .dashboard-finals-card {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    :root {
        --page-gutter: 12px;
        --font-size-page-title: 26px;
    }

    .site-header-inner {
        gap: var(--space-sm);
    }

    .page-subnav,
    .form-subnav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .page-subnav-button,
    .form-subnav-button {
        flex: 0 0 auto;
    }

    .dashboard-hero,
    .dashboard-feature-team {
        padding: var(--space-md);
    }

    .dashboard-snapshot,
    .dashboard-feature-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-insight {
        overflow-wrap: anywhere;
    }
}

.api-history-trigger {
    color: var(--blue-6);
    font-weight: var(--font-weight-medium);
    cursor: help;
    text-decoration: underline dotted var(--muted-light);
    text-underline-offset: 3px;
}

.pi-history-trigger {
    cursor: help;
    text-decoration: underline dotted var(--muted-light);
    text-underline-offset: 3px;
}

.pi-history-popup {
    position: fixed;
    z-index: 1001;
    width: 430px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 12px 30px rgb(23 33 43 / 18%);
    pointer-events: none;
}
.pi-history-popup[hidden] { display: none; }
.pi-history-popup header small,
.pi-history-popup header strong,
.pi-history-popup header span { display: block; }
.pi-history-popup header small {
    color: var(--muted);
    font-size: 9px;
    font-weight: var(--font-weight-bold);
    letter-spacing: .07em;
    text-transform: uppercase;
}
.pi-history-popup header strong { margin-top: 2px; font-size: 16px; }
.pi-history-popup header span { color: var(--muted); font-size: 10px; }
.pi-history-chart { margin-top: 8px; }
.pi-history-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.pi-chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.pi-chart-zero { stroke: var(--muted-light); stroke-width: 1; stroke-dasharray: 4 4; }
.pi-chart-line { fill: none; stroke: var(--blue-6); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pi-chart-point { fill: var(--surface-strong); stroke: var(--blue-6); stroke-width: 2; }
.pi-chart-y-label,
.pi-chart-x-label,
.pi-chart-axis-title { fill: var(--muted); font-family: var(--font-data); font-size: 9px; }
.pi-chart-y-label { text-anchor: end; }
.pi-chart-x-label,
.pi-chart-axis-title { text-anchor: middle; }

.api-history-popup {
    position: fixed;
    z-index: 1001;
    width: 300px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 12px 30px rgb(23 33 43 / 18%);
    pointer-events: none;
}

.api-history-popup[hidden] { display: none; }

.api-history-popup header small,
.api-history-popup header strong,
.api-history-popup header span {
    display: block;
}

.api-history-popup header small {
    color: var(--muted);
    font-size: 9px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.api-history-popup header strong { margin-top: 2px; font-size: 16px; }
.api-history-popup header span { color: var(--muted); font-size: 10px; }

.api-history-scale {
    position: relative;
    height: 430px;
    margin-top: 12px;
}

.api-history-line {
    position: absolute;
    top: 29px;
    bottom: 29px;
    left: 50%;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(var(--blue-6), var(--line));
}

.api-history-current-tick {
    position: absolute;
    left: -7px;
    width: 17px;
    border-top: 3px solid var(--blue-6);
    transform: translateY(-1px);
}

.api-history-season {
    position: absolute;
    right: 0;
    width: 1px;
    transform: translateY(-50%);
}
.api-history-season span {
    position: absolute;
    top: 50%;
    right: 13px;
    color: var(--muted);
    font-family: var(--font-data);
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(calc(-50% + var(--label-offset, 0px)));
}
.api-history-season i {
    position: absolute;
    top: 50%;
    right: -5px;
    width: 9px;
    border-top: 1px solid var(--muted);
}

.api-history-end {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
}

.api-history-end b { max-width: 48%; }
.api-history-end span { color: var(--muted); text-align: right; }
.api-history-best { top: 0; }
.api-history-worst { bottom: 0; }

.api-history-current {
    position: absolute;
    left: calc(50% + 16px);
    padding: 4px 7px;
    border-radius: var(--radius-sm);
    background: var(--blue-1);
    transform: translateY(-50%);
    white-space: nowrap;
}

.api-history-current b,
.api-history-current span { display: block; }
.api-history-current b { color: var(--blue-text-dark); font-size: 12px; }
.api-history-current span { color: var(--muted); font-size: 9px; }

.tale-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr;
    align-items: end;
    gap: 14px;
    margin-bottom: 18px;
}

.tale-controls label {
    color: var(--muted);
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tale-controls select {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--surface-strong);
    font: inherit;
    font-size: 13px;
    text-transform: none;
}

.tale-controls > span {
    padding-bottom: 10px;
    color: var(--muted);
    font-weight: var(--font-weight-bold);
}

.tale-output {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    box-shadow: var(--shadow-sm);
}

.tale-team-headings {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    color: white;
    background: linear-gradient(120deg, var(--blue-text-dark), var(--blue-6));
}

.tale-team-headings div:last-child { text-align: right; }
.tale-team-headings small,
.tale-team-headings span { color: rgb(255 255 255 / 72%); font-size: 10px; }
.tale-team-headings h2 { margin: 3px 0; color: white; font-size: 22px; }
.tale-team-headings > strong { font-size: 13px; opacity: 0.72; }

.tale-metrics { padding: 18px 24px; }
.tale-metric + .tale-metric { margin-top: 13px; }

.tale-metric-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 12px;
    margin-bottom: 5px;
}

.tale-metric-heading b { font-size: 14px; }
.tale-metric-heading b:last-child { text-align: right; }
.tale-metric-heading b.winner { color: var(--blue-6); }
.tale-metric-heading span {
    color: var(--muted);
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

.tale-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    height: 15px;
}

.tale-bars i { display: block; height: 100%; }
.tale-bar-left {
    justify-self: end;
    border-radius: 3px 0 0 3px;
    background: var(--blue-5);
}
.tale-bar-right {
    justify-self: start;
    border-radius: 0 3px 3px 0;
    background: var(--blue-6);
}

.tale-head-to-head {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--line-soft);
    text-align: center;
}
.tale-head-to-head h2 { margin: 0 0 10px; font-size: 14px; }
.tale-head-to-head div {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
}
.tale-head-to-head strong { color: var(--blue-6); font-size: 26px; }
.tale-head-to-head span { color: var(--muted); font-size: 10px; }

@media (max-width: 700px) {
    .tale-controls { grid-template-columns: 1fr 1fr; }
    .tale-controls > span { display: none; }
    .tale-controls label:first-child { grid-column: 1 / -1; }
    .tale-team-headings { padding: 16px; gap: 10px; }
    .tale-team-headings h2 { font-size: 16px; }
    .tale-metrics { padding: 16px; }
}

.team-profile-link { cursor: pointer; }

.club-profile-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    color: white;
    background: linear-gradient(120deg, var(--blue-text-dark), var(--blue-6));
    box-shadow: var(--shadow-sm);
}
.club-profile-hero small,
.club-profile-hero span { color: rgb(255 255 255 / 72%); }
.club-profile-hero h1 { margin: 3px 0; color: white; font-size: 28px; }
.club-profile-hero > div:last-child { text-align: right; }
.club-profile-hero > div:last-child small,
.club-profile-hero > div:last-child strong { display: block; }
.club-profile-hero > div:last-child strong { font-size: 32px; }

.club-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
.club-profile-grid .records-card { margin: 0; }

.club-stat + .club-stat { margin-top: 13px; }
.club-stat > div { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.club-stat span { color: var(--muted); font-size: 11px; font-weight: var(--font-weight-medium); }
.club-stat b { font-size: 13px; }
.club-stat > i { display: block; height: 9px; border-radius: 5px; background: var(--header); overflow: hidden; }
.club-stat > i em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-4), var(--blue-6)); }

.club-career-card dl,
.club-finals-card dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; background: var(--line-soft); }
.club-career-card dl div,
.club-finals-card dl div { padding: 10px; background: var(--surface-strong); }
.club-career-card dt,
.club-finals-card dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.club-career-card dd,
.club-finals-card dd { margin: 3px 0 0; font-size: 17px; font-weight: var(--font-weight-bold); }

.club-elo-card { margin-bottom: 18px; }
.club-elo-card svg { width: 100%; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--surface); }
.club-elo-card svg line { stroke: var(--line-soft); }
.club-elo-card svg polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.club-elo-card svg .elo-main-line { stroke: var(--blue-6); stroke-width: 2.5; }
.club-elo-card svg .elo-rolling-line { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0.62; }
.club-elo-card svg .elo-axis-grid { stroke: var(--line-soft); stroke-width: 1; }
.club-elo-card svg .elo-year-tick { stroke: var(--muted); stroke-width: 1; }
.club-elo-card svg .elo-axis-label { fill: var(--muted); font-size: 9px; }
.club-elo-card svg .elo-axis-title { fill: var(--text); font-size: 9px; font-weight: var(--font-weight-bold); }
.club-elo-card svg .elo-milestone line { stroke: var(--positive); stroke-width: 1; stroke-dasharray: 3 2; }
.club-elo-card svg .elo-milestone circle { fill: var(--positive); stroke: white; stroke-width: 1.5; }
.club-elo-card svg .elo-milestone text { fill: var(--positive); font-size: 8px; font-weight: var(--font-weight-bold); }
.club-elo-card svg .elo-extreme circle { fill: var(--blue-6); stroke: white; stroke-width: 1.5; }
.club-elo-card svg .elo-extreme text { fill: var(--blue-text-dark); font-size: 8px; font-weight: var(--font-weight-bold); }
.club-elo-card svg .elo-hover-point { fill: transparent; stroke: transparent; stroke-width: 6; cursor: help; }
.club-elo-card svg .elo-hover-point:hover,
.club-elo-card svg .elo-hover-point:focus { fill: var(--blue-6); stroke: white; stroke-width: 2; outline: none; }
.club-chart-meta { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 10px; }
.club-chart-meta b { color: var(--text); }
.club-elo-legend { display: flex; justify-content: center; gap: 18px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.club-elo-legend span { display: inline-flex; align-items: center; gap: 5px; }
.club-elo-legend i { width: 18px; border-top: 2px solid var(--blue-6); }
.club-elo-legend i.rolling { border-color: var(--muted); border-top-style: dashed; opacity: 0.7; }

.club-ladder-card svg { width: 100%; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--surface); }
.club-ladder-card svg .ladder-axis-grid { stroke: var(--line-soft); stroke-width: 1; }
.club-ladder-card svg .ladder-axis-label { fill: var(--muted); font-size: 9px; }
.club-ladder-card svg .ladder-axis-title { fill: var(--text); font-size: 9px; font-weight: var(--font-weight-bold); }
.club-ladder-card svg .ladder-position-line { fill: none; stroke: var(--blue-6); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.club-ladder-card svg .ladder-position-point { fill: var(--blue-6); stroke: white; stroke-width: 1.5; }
.club-seasons-card { margin-bottom: 18px; }
.club-seasons-card .team { min-width: 130px; }
.club-seasons-card th:last-child,
.club-seasons-card td:last-child { min-width: 135px; text-align: left; }

.club-extremes > div:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.club-extremes article { padding: 10px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.club-extremes small,
.club-extremes strong,
.club-extremes span { display: block; }
.club-extremes small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.club-extremes strong { margin-top: 3px; font-size: 12px; }
.club-extremes span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.club-opponents .division-title label { color: var(--muted); font-size: 10px; }
.club-opponents select { margin-left: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; }
.club-opponents a { color: inherit; text-decoration: none; }
.club-opponents a:hover { color: var(--blue-6); text-decoration: underline; }

@media (max-width: 700px) {
    .club-profile-grid { grid-template-columns: 1fr; }
    .club-profile-hero { padding: 18px; }
    .club-profile-hero h1 { font-size: 22px; }
    .club-extremes > div:last-child { grid-template-columns: 1fr; }
}


/* =========================================================
   FORM MOMENTUM GRAPHS
========================================================= */

.momentum-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.momentum-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
}

.momentum-card-header {
    min-height: 58px;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    border-bottom: 1px solid var(--line);
    background: var(--header);
}

.momentum-card-header h2 {
    margin: 0;
    font-size: var(--font-size-section-title);
}

.momentum-card-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: var(--font-size-small);
}

.momentum-reset {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--surface-strong);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.momentum-reset:hover {
    background: var(--nav-hover);
}

.momentum-plot {
    width: 100%;
    min-height: 510px;
}

.momentum-note {
    margin-top: var(--space-md);
}


/* =========================================================
   TEAM ELO HOVER PROFILE
========================================================= */

.elo-profile-trigger {
    cursor: help;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--muted-light);
    text-underline-offset: 3px;
}

.team-elo-profile {
    position: fixed;
    z-index: 1000;
    width: 430px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 12px 30px rgb(23 33 43 / 18%);
    pointer-events: none;
}

.team-elo-profile[hidden] {
    display: none;
}

.team-elo-profile-header {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.team-elo-profile-header span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.team-elo-profile-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: var(--font-weight-bold);
}

.team-elo-current {
    font-size: 22px;
    line-height: 1;
}

.team-elo-profile svg {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.team-elo-profile .elo-grid {
    stroke: var(--line-soft);
    stroke-width: 1;
}

.team-elo-profile .elo-history-line {
    fill: none;
    stroke: var(--blue-6);
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.team-elo-profile .elo-history-comparison {
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.75;
    stroke-dasharray: 5 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.team-elo-profile .elo-history-current {
    fill: var(--blue-6);
    stroke: var(--surface-strong);
    stroke-width: 1.5;
}

.team-elo-profile-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}

.team-elo-profile-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.team-elo-profile-legend b {
    color: var(--text);
    font-weight: var(--font-weight-medium);
}

.team-elo-profile-legend i {
    width: 16px;
    border-top: 2px solid var(--blue-6);
}

.team-elo-profile-legend .elo-legend-comparison {
    border-color: var(--muted);
    border-top-style: dashed;
}

.team-elo-next-games {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--line-soft);
}

.team-elo-next-games > strong {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.team-elo-next-games div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    font-size: 12px;
}

.team-elo-next-games div + div {
    border-top: 1px solid var(--line-soft);
}

.team-elo-next-games span,
.team-elo-next-games small {
    display: block;
}

.team-elo-next-games span > small {
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 9px;
    font-weight: var(--font-weight-medium);
}

.team-elo-next-games b {
    color: var(--blue-6);
    font-size: 14px;
    white-space: nowrap;
}

.team-elo-next-games b small {
    color: var(--muted);
    font-size: 8px;
    font-weight: var(--font-weight-medium);
    text-align: right;
    text-transform: uppercase;
}

.team-elo-next-games p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.team-elo-next-games article {
    padding: 8px 0;
}

.team-elo-next-games article + article {
    border-top: 1px solid var(--line-soft);
}

.team-elo-next-games article > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0;
}

.team-elo-next-games article p {
    margin-top: 5px;
    font-size: 9px;
    line-height: 1.35;
}

.team-elo-profile-meta {
    margin-top: 7px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
}

.team-elo-profile-meta span:nth-child(2) {
    color: var(--text);
    font-weight: var(--font-weight-medium);
    text-align: center;
}

.team-elo-profile-meta span:last-child {
    text-align: right;
}

@media (max-width: 600px) {
    .team-elo-profile {
        width: min(430px, calc(100vw - 20px));
    }
}

/* Broadcast-style feature treatment shared by analysis pages. */
.sports-summary {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.sports-summary.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sports-summary.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sports-summary article {
    position: relative;
    overflow: hidden;
    min-height: 105px;
    padding: 17px 18px;
    border-radius: var(--radius-md);
    color: white;
    background: linear-gradient(125deg, var(--blue-text-dark), var(--blue-6));
    box-shadow: var(--shadow-sm);
}

.sports-summary article::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -38px;
    width: 110px;
    height: 110px;
    border: 18px solid rgb(255 255 255 / 7%);
    border-radius: 50%;
}

.sports-summary small,
.sports-summary strong,
.sports-summary span { position: relative; z-index: 1; display: block; }
.sports-summary small { color: rgb(255 255 255 / 67%); font-size: 9px; font-weight: var(--font-weight-bold); letter-spacing: .07em; text-transform: uppercase; }
.sports-summary strong { margin-top: 8px; font-size: 18px; }
.sports-summary span { margin-top: 5px; color: rgb(255 255 255 / 78%); font-size: 10px; }

.sports-matchup-banner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 18px;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 20px 22px 30px;
    border-radius: var(--radius-lg);
    color: white;
    background: linear-gradient(120deg, var(--blue-text-dark), var(--blue-6));
    box-shadow: var(--shadow-sm);
    position: relative;
}
.sports-matchup-banner > div:nth-child(3) { text-align: right; }
.sports-matchup-banner small,
.sports-matchup-banner strong,
.sports-matchup-banner b { display: block; }
.sports-matchup-banner small { color: rgb(255 255 255 / 65%); font-size: 9px; }
.sports-matchup-banner strong { margin: 5px 0 2px; font-size: 21px; }
.sports-matchup-banner b { font-size: 17px; }
.sports-head-to-head { align-self: center; min-width: 220px; text-align: center; }
.sports-head-to-head > b { color: rgb(255 255 255 / 72%); font-size: 9px; letter-spacing: .08em; }
.sports-head-to-head p { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 9px; margin: 5px 0 0; }
.sports-head-to-head p strong { margin: 0; font-size: 12px; }
.sports-head-to-head p span { min-width: 70px; color: rgb(255 255 255 / 62%); font-size: 8px; font-weight: var(--font-weight-bold); letter-spacing: .04em; }
.sports-matchup-bars { position: absolute; left: 22px; right: 22px; bottom: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; height: 9px; }
.sports-matchup-bars i { height: 100%; }
.sports-matchup-bars i:first-child { justify-self: end; background: var(--blue-4); }
.sports-matchup-bars i:last-child { justify-self: start; background: white; opacity: .72; }

.sports-matchup-history {
    margin: -10px 0 18px;
    border: 1px solid var(--line);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--surface-strong);
    box-shadow: var(--shadow-sm);
}

.sports-matchup-decision {
    margin: 10px 0;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--surface);
}

.sports-matchup-decision summary {
    padding: 11px 14px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.sports-decision-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 14px 10px;
}

.sports-decision-grid div {
    padding: 9px;
    border-radius: 6px;
    background: var(--header);
    text-align: center;
}

.sports-decision-grid strong,
.sports-decision-grid span {
    display: block;
}

.sports-decision-grid strong { color: var(--blue-6); font-size: 17px; }
.sports-decision-grid span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.sports-decision-reasons { margin: 0; padding: 0 28px 8px; font-size: 11px; }
.sports-matchup-decision .note { margin: 0; padding: 0 14px 11px; }

.sports-matchup-story { padding: 12px 14px; }
.sports-matchup-story h3 { margin: 0 0 7px; font-size: 13px; }
.sports-matchup-story p { margin: 5px 0; color: var(--text); font-size: 11px; }
.sports-matchup-story small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.sports-matchup-history summary {
    padding: 11px 14px;
    color: var(--blue-text-dark);
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: .05em;
    cursor: pointer;
    text-transform: uppercase;
}
.sports-matchup-history table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sports-matchup-history th,
.sports-matchup-history td { padding: 7px 10px; border-top: 1px solid var(--line-soft); text-align: center; }
.sports-matchup-history .team,
.sports-matchup-history .team-heading { text-align: left; }
.sports-matchup-history th:nth-child(4),
.sports-matchup-history td:nth-child(4),
.sports-matchup-history th:nth-child(6),
.sports-matchup-history td:nth-child(6) { width: 25%; }
.sports-matchup-history th:nth-child(5),
.sports-matchup-history td:nth-child(5) { width: 10%; text-align: center; }
.sports-matchup-history p { margin: 0; padding: 12px 14px; color: var(--muted); font-size: 11px; }

.expectation-card-header,
.form-card-header,
.projection-card > .division-title,
.records-card > .division-title,
.dashboard-card-header {
    padding: 13px 16px;
    color: white;
    background: linear-gradient(115deg, var(--blue-text-dark), var(--blue-6));
}
.expectation-card-header h2,
.expectation-card-header p,
.form-card-header h2,
.form-card-header p,
.projection-card > .division-title h2,
.projection-card > .division-title span,
.records-card > .division-title h2,
.records-card > .division-title span,
.dashboard-card-header h2,
.dashboard-card-header a { color: white; }
.expectation-card-header p,
.form-card-header p,
.projection-card > .division-title span,
.records-card > .division-title span { opacity: .72; }

.fixtures-tab-panel > .section-title,
#ratings > .section-title,
#graph > .section-title,
#upsets > .section-title {
    margin-bottom: 0;
    padding: 14px 16px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: white;
    background: linear-gradient(115deg, var(--blue-text-dark), var(--blue-6));
    font-weight: var(--font-weight-bold);
}

.fixtures-table tbody tr:hover,
.projection-table tbody tr:hover,
.records-table tbody tr:hover,
.form-table tbody tr:hover,
.ratings-table tbody tr:hover { background: var(--blue-1); }

.sports-probability {
    background-image: linear-gradient(90deg, var(--blue-2) var(--probability), transparent var(--probability));
    background-repeat: no-repeat;
    font-weight: var(--font-weight-bold);
}

@media (max-width: 900px) {
    .sports-summary.four-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .sports-summary.two-up,
    .sports-summary.four-up { grid-template-columns: 1fr; }
    .sports-matchup-banner { grid-template-columns: 1fr auto 1fr; padding-inline: 15px; gap: 8px; }
    .sports-matchup-banner strong { font-size: 15px; }
    .sports-head-to-head { min-width: 150px; }
    .sports-head-to-head p { gap: 4px; }
    .sports-head-to-head p span { min-width: 54px; font-size: 7px; }
}
