:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #d8dee8;
    --accent: #126a5a;
    --accent-2: #315a9f;
    --home: #126a5a;
    --draw: #c98926;
    --away: #315a9f;
}

html,
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

.topbar {
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.app-title {
    font-weight: 700;
    letter-spacing: 0;
}

.app-drawer {
    border-right: 1px solid var(--line);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1rem .75rem;
}

.app-nav {
    padding: 0 .5rem .75rem;
}

.main-content {
    background: var(--bg);
    min-height: 100vh;
}

.page-container {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
}

.page-head {
    max-width: 900px;
}

.surface-card,
.prediction-card,
.stat-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.surface-card,
.prediction-card {
    padding: 1rem;
}

.stat-card {
    padding: 1rem;
    min-height: 106px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.final-call {
    border-color: #b9c8dc;
}

.action-row,
.chip-wrap {
    flex-wrap: wrap;
}

.action-cell {
    display: flex;
    align-items: center;
}

.control-grid {
    align-items: center;
}

.busy-button-spinner {
    margin-right: .5rem;
}

.inline-progress {
    margin-top: .75rem;
}

.skeleton-row {
    margin-top: .6rem;
}

.mt-2 {
    margin-top: .75rem;
}

.clean-list {
    margin: .75rem 0 1rem;
    padding-left: 1.25rem;
    color: var(--ink);
}

.clean-list li {
    margin-bottom: .25rem;
}

.prob-wrap {
    margin: .75rem 0;
}

.prob {
    height: 30px;
    display: flex;
    overflow: hidden;
    border-radius: 6px;
    background: #e6ebf2;
}

.seg {
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .78rem;
    font-weight: 800;
    min-width: 0;
    white-space: nowrap;
}

.seg.home {
    background: var(--home);
}

.seg.draw {
    background: var(--draw);
}

.seg.away {
    background: var(--away);
}

.legend {
    display: flex;
    gap: .7rem;
    color: var(--muted);
    font-size: .84rem;
    margin-top: .35rem;
    flex-wrap: wrap;
}

.team-label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
    vertical-align: middle;
}

.team-label-compact {
    gap: .35rem;
}

.team-flag {
    width: 1.35rem;
    height: 1rem;
    flex: 0 0 auto;
    object-fit: cover;
    border: 1px solid rgba(23, 32, 51, .16);
    border-radius: 2px;
    background: #fff;
}

.team-label-compact .team-flag {
    width: 1.15rem;
    height: .86rem;
}

.matchup-label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
    flex-wrap: wrap;
}

.explain {
    color: #344054;
    line-height: 1.45;
}

.section-label {
    display: block;
    margin-top: .8rem;
}

.driver-list {
    margin: .35rem 0 0;
    padding-left: 1.1rem;
    color: var(--ink);
    font-size: .88rem;
}

.fixture-list {
    max-height: 75vh;
    overflow: auto;
}

.fixture-action-row {
    row-gap: .65rem;
}

.fixture-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: .85rem;
    align-items: start;
}

.fixture-group-card {
    min-width: 0;
}

.fixture-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.fixture-card-list {
    display: grid;
    gap: .55rem;
}

.fixture-match-card {
    display: grid;
    gap: .38rem;
    padding: .58rem .62rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfe;
    min-width: 0;
}

.fixture-match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    min-height: 22px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.fixture-match-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.8rem minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    min-height: 30px;
}

.fixture-team {
    min-width: 0;
    font-size: .88rem;
}

.fixture-team .team-label {
    max-width: 100%;
}

.fixture-team .team-label span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fixture-team-away {
    display: flex;
    justify-content: flex-end;
    text-align: right;
}

.fixture-score-slot {
    display: grid;
    place-items: center;
    width: 3.8rem;
    min-height: 30px;
    border-radius: 6px;
    background: #eef2f7;
    color: var(--ink);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.fixture-prob-mini {
    display: flex;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6ebf2;
}

.fixture-prob-segment {
    min-width: 0;
}

.fixture-prob-segment.home {
    background: var(--home);
}

.fixture-prob-segment.draw {
    background: var(--draw);
}

.fixture-prob-segment.away {
    background: var(--away);
}

.fixture-prob-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
    color: var(--muted);
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
}

.fixture-prob-labels span:nth-child(2) {
    text-align: center;
}

.fixture-prob-labels span:nth-child(3) {
    text-align: right;
}

.fixture-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: .3rem .4rem;
    border-bottom: 1px solid var(--line);
    border-radius: 6px;
}

.fixture-row.selected {
    background: #eef6f4;
    border-bottom-color: transparent;
}

.group-label {
    margin-top: .85rem;
}

.score-separator {
    display: flex;
    justify-content: center;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: #fff1d6;
    border-top: 1px solid var(--draw);
    padding: .75rem;
}

@media (max-width: 960px) {
    .page-container {
        padding: 1rem .75rem 1.5rem;
    }

    .fixture-list {
        max-height: none;
    }

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

    .action-cell {
        align-items: stretch;
    }
}
