:root {
    /* Fallbacks match config/edition.yaml. Pages override from Edition config. */
    --primary: #670E36;
    --primary-ink: #4a0a27;
    --accent: #94BEE5;
    --primary-rgb: 103, 14, 54;
    --ink: #0f172a;
    --muted: #475569;
    --line: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --radius: 12px;
    --brand-primary: var(--primary);
    --brand-dark: var(--ink);
    --brand-muted: var(--muted);
    --bg-main: var(--bg);
    --card-bg: var(--card);
    /* G1b (#183): fixed tracks. Centre is never 1fr. */
    --centre: 650px;
    --rail: 300px;
    --gap: 1rem;
    --desk: calc(var(--rail) + var(--gap) + var(--centre) + var(--gap) + var(--rail));
}

/* 1. Reset & Global Box Sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    overflow-x: hidden;
    padding: 1rem;
}

/* 2. Responsive Container */
.container {
    max-width: var(--centre);
    margin: 0 auto;
    width: 100%;
}

/* Homepage G1b: masthead above the desk. One match strip.
   Mobile = stacked flex order. Desktop (≥84rem) = 300|650|300;
   left track is reserved and empty (Fans see no placeholder copy). */
.home-shell {
    width: 100%;
    max-width: 650px;
    max-width: var(--centre, 650px);
    margin: 0 auto;
}

.desk {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rail-match {
    display: contents;
}

.desk .match-snapshot {
    order: 1;
}

.desk > .centre {
    order: 2;
}

.desk .league-snapshot {
    order: 3;
}

.masthead {
    margin: 1.5rem 0 1.75rem;
}

.masthead h1,
.archive-list + .site-footer,
h1 {
    font-weight: 800;
    color: var(--ink);
}

.masthead h1 {
    text-align: left;
    margin: 0;
    font-size: 2rem;
}

.crumb-header {
    margin: 1.25rem 0 1.5rem;
}

.crumb {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.crumb:hover,
.crumb:focus-visible {
    text-decoration: underline;
}

.tagline {
    color: var(--muted);
    margin: 0.35rem 0 0;
    font-size: 1rem;
}

.container > h1 {
    text-align: left;
    margin: 0 0 0.35rem;
    font-size: 1.85rem;
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.85rem;
    letter-spacing: 0.05em;
}

/* 3. Today's Briefing tease */
article.briefing {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(var(--primary-rgb), 0.1);
    position: relative;
    z-index: 0;
    margin-bottom: 1.75rem;
}

article.briefing::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius) 0 0 var(--radius);
    background: linear-gradient(180deg, var(--primary) 0%, transparent 100%);
}

article.briefing h2 {
    font-size: 1.35rem;
    line-height: 1.3;
    font-weight: 800;
    margin: 0 0 0.4rem;
}

article.briefing h2 a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 0.18em;
}

/* Stretch the headline hit over the card. z-index is contained by
   article.briefing so this overlay cannot cover footer "Past briefings".
   Empty ::after does not hit-test; paint a transparent layer so taps on
   the lede and chrome open the dated page. */
article.briefing h2 a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0);
    cursor: pointer;
}

article.briefing h2 a:hover {
    color: var(--primary-ink);
}

article.briefing time,
.article-page time {
    display: block;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.lede {
    color: var(--ink);
    margin: 0;
}

/* Homepage tease only: one visual line of the existing lede. */
article.briefing .lede {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    hyphens: none;
}

/* Copy, not a second link. Overlay still covers this line. */
article.briefing .tease-cue {
    color: var(--primary);
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
}

/* 4. Feed */
.feed-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 0.85rem;
}

.feed-empty {
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    margin: 0 0 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#article-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.source-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.source-name {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.source-time {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0 0 0.5rem;
}

.source-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.snippet {
    color: var(--ink);
    margin-bottom: 0.75rem;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.source-out {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

.source-out:hover {
    color: var(--primary-ink);
}

/* 5. Dated Briefing */
.article-page {
    margin-bottom: 2rem;
}

.article-page h1 {
    text-align: left;
    margin: 0 0 0.5rem;
    font-size: 1.85rem;
    line-height: 1.25;
    font-weight: 800;
}

.article-page .lede {
    margin-bottom: 1.1rem;
}

.bullet-points {
    list-style: none;
    margin: 0;
}

.bullet-points li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.55rem;
    font-size: 1rem;
    color: var(--ink);
}

.bullet-points li::before {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.55rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--primary);
}

.briefing-sources {
    margin: 0 0 2rem;
}

.briefing-sources h2 {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.briefing-sources ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.briefing-sources li {
    margin-bottom: 0.45rem;
}

.briefing-sources a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    display: inline-block;
    padding: 0.25rem 0;
    min-height: 2rem;
    line-height: 1.5;
}

.briefing-sources a:hover,
.briefing-sources a:focus-visible {
    color: var(--primary-ink);
}

/* 6. Archive */
.archive-list {
    margin: 1.5rem 0 2rem;
}

.archive-list a {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
}

.archive-list a:last-child {
    border-bottom: 1px solid var(--line);
}

.archive-list time {
    flex: 0 0 6.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.archive-list a {
    font-weight: 700;
    color: var(--ink);
}

/* 7. Pagination — in document flow above the footer, never sticky/fixed.
   overflow-anchor: none so a width refit cannot shift scroll and paint
   the pager over Feed cards during mobile fling. */
.pagination {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
    overflow: hidden;
    overflow-anchor: none;
}

.pagination-page-hidden {
    display: none !important;
}

.pagination-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-right: 0.5rem;
}

.pagination-link,
.pagination-current,
.pagination-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pagination-link:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.12);
}

.pagination-link:focus-visible,
.pagination-next:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.pagination-current {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    cursor: default;
    box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.25);
}

.pagination-next {
    margin-left: 0.25rem;
    font-weight: 700;
}

.pagination-next:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.12);
}

/* 8. Match strip (#180) — two landmarks. Homepage: compact pair under
   masthead, table after pagination. Dated Briefing: both after Sources.
   No outbound match-centre links. */
.match-snapshot {
    margin: 0 0 0.85rem;
}

.match-snapshot-compact {
    margin: 0 0 1.15rem;
}

.match-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0;
}

.match-pair-single {
    grid-template-columns: 1fr;
}

.match-cell {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.match-snapshot-compact .match-cell {
    /* Same white card language as Feed .source-card / Briefing pair. */
    padding: 0.45rem 0.7rem;
}

.match-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 0.35rem;
}

.match-snapshot-compact .match-label {
    font-size: 0.65rem;
    line-height: 1.15;
    margin: 0;
}

.match-headline {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 0.25rem;
}

.match-snapshot-compact .match-headline {
    font-size: 0.85rem;
    line-height: 1.2;
    margin: 0;
}

.match-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

.match-meta-comp,
.match-meta-when {
    display: block;
    white-space: nowrap;
}

.match-snapshot-compact .match-meta {
    font-size: 0.7rem;
    line-height: 1.15;
}

.league-snapshot {
    overflow: visible;
    margin: 1.25rem 0 1.75rem;
    padding-top: 1.1rem;
    border-top: 2px solid var(--primary);
}

.mini-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
}

.mini-table caption {
    caption-side: top;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
    overflow: visible;
    padding-top: 0.2rem;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.mini-table thead th:first-child {
    border-top-left-radius: var(--radius);
}

.mini-table thead th:last-child {
    border-top-right-radius: var(--radius);
}

.mini-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius);
}

.mini-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius);
}

.mini-table th,
.mini-table td {
    padding: 0.5rem 0.75rem;
}

.mini-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.mini-table td {
    border-bottom: 1px solid var(--line);
}

.mini-table tbody tr:last-child td {
    border-bottom: none;
}

.mini-table .pos,
.mini-table .pts {
    width: 2.75rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mini-table th.pos,
.mini-table th.pts {
    text-align: right;
}

.mini-table tr.is-edition {
    background: rgba(var(--primary-rgb), 0.12);
    font-weight: 700;
}

.mini-table tr.is-edition td {
    color: var(--primary-ink);
}

@media (max-width: 420px) {
    .match-pair {
        grid-template-columns: 1fr;
    }

    .match-snapshot-compact .match-pair {
        grid-template-columns: 1fr 1fr;
    }
}

/* G1b desktop — masthead sits above the desk. Grid starts at the
   tease/Feed band. Left 300px track is reserved and empty. Pair is a
   row. Literals first so a missed var cannot stretch the centre.
   84rem (1344px) fits --desk 1282px plus body padding. */
@media (min-width: 84rem) {
    .home-shell {
        width: 1282px;
        width: var(--desk);
        max-width: 1282px;
        max-width: var(--desk);
    }

    .home-shell > .masthead,
    .home-shell > .site-footer {
        width: 650px;
        max-width: 650px;
        width: var(--centre, 650px);
        max-width: var(--centre, 650px);
        margin-left: calc(300px + 1rem);
        margin-left: calc(var(--rail, 300px) + var(--gap, 1rem));
        margin-right: 0;
    }

    .desk {
        display: grid;
        grid-template-columns: 300px 650px 300px;
        grid-template-columns: var(--rail) var(--centre) var(--rail);
        column-gap: 1rem;
        column-gap: var(--gap, 1rem);
        align-items: start;
        width: 1282px;
        width: var(--desk);
        max-width: 1282px;
        max-width: var(--desk);
    }

    .desk > .centre {
        grid-column: 2;
        order: unset;
        min-width: 0;
        width: 650px;
        max-width: 650px;
        width: var(--centre, 650px);
        max-width: var(--centre, 650px);
    }

    .rail-match {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        grid-column: 3;
        grid-row: 1 / -1;
        width: 300px;
        max-width: 300px;
        width: var(--rail, 300px);
        max-width: var(--rail, 300px);
        position: sticky;
        top: 1rem;
        align-self: start;
    }

    .rail-match .match-snapshot,
    .rail-match .match-snapshot-compact,
    .rail-match .league-snapshot {
        order: unset;
        margin: 0;
    }

    .rail-match .match-pair,
    .rail-match .match-pair-single,
    .rail-match .match-snapshot-compact .match-pair {
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .rail-match .match-snapshot-compact .match-cell {
        padding: 0.4rem 0.45rem;
    }

    .rail-match .league-snapshot {
        padding-top: 0;
        border-top: none;
    }

    .rail-match .mini-table {
        font-size: 0.74rem;
    }

    .rail-match .mini-table caption {
        font-size: 0.62rem;
        margin: 0 0 0.3rem;
    }

    .rail-match .mini-table th,
    .rail-match .mini-table td {
        padding: 0.24rem 0.5rem;
    }
}

/* 9. Site Footer */
.site-footer {
    margin-top: 0;
    padding: 1.75rem 1rem 1.5rem;
    border-top: 2px solid var(--primary);
    text-align: center;
    background: linear-gradient(180deg, #fafafa 0%, #f1f5f9 100%);
    border-radius: 0 0 var(--radius) var(--radius);
}

.site-footer p {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    max-width: 36em;
    margin-left: auto;
    margin-right: auto;
}

.footer-nav {
    margin-top: 0.75rem !important;
}

.footer-nav a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

.footer-nav a:hover {
    color: var(--primary-ink);
}

/* 10. Privacy */
.privacy-page {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.75rem;
}

.privacy-page h1 {
    font-size: 1.85rem;
    margin: 0 0 0.85rem;
}

.privacy-page p {
    color: var(--ink);
    margin: 0 0 1rem;
    max-width: 36em;
}

.privacy-page p:last-child {
    margin-bottom: 0;
}

/* 11. Visit-counting choice. Equal Accept / Reject; not a modal. */
.consent-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--card);
    border-top: 2px solid var(--primary);
    padding: 0.85rem 1rem 1rem;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.consent-bar-inner {
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.consent-copy {
    flex: 1 1 12rem;
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.consent-copy a {
    color: var(--primary);
    font-weight: 700;
}

.consent-actions {
    display: flex;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 13rem;
}

.consent-btn {
    flex: 1 1 6.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.consent-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.consent-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

body:has(.consent-bar) {
    padding-bottom: 7rem;
}

.staff-dry-run .staff-note,
.staff-dry-run .staff-meta {
    color: var(--muted);
    margin: 0 0 1rem;
}

.staff-editions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin: 0 0 1.25rem;
}

.staff-editions a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.staff-editions a:hover,
.staff-editions a:focus-visible,
.staff-editions a[aria-current="page"] {
    text-decoration: underline;
}

.skip-reason {
    padding: 0.85rem 1rem;
    margin: 0 0 1.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-weight: 700;
}
