.matchday-brief-app {
    --matchday-content-width: 1160px;
    min-height: 100vh;
    background: var(--color-background-page);
    color: var(--color-text);
}

.matchday-brief-app + .site-footer .footer-wordmark {
    display: none;
}

.matchday-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
    min-height: 78px;
    padding: 16px max(22px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid rgb(var(--color-text-primary-rgb) / 0.1);
    background: rgb(var(--color-surface-rgb) / 0.9);
    backdrop-filter: blur(18px);
}

.matchday-nav .brand {
    width: max-content;
}

.matchday-nav .brand-wordmark {
    display: block;
    width: 120px;
    height: auto;
}

.matchday-product-name {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.88rem;
    font-weight: 800;
}

.matchday-product-name > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent-primary);
    box-shadow: 0 0 0 5px rgb(var(--color-accent-primary-rgb) / 0.1);
}

.matchday-nav-links {
    display: flex;
    justify-content: flex-end;
    gap: 22px;
    font-size: 0.88rem;
    font-weight: 700;
}

.matchday-nav-links a {
    color: rgb(var(--color-text-primary-rgb) / 0.68);
    text-decoration: none;
    transition: color 140ms ease;
}

.matchday-nav-links a:hover {
    color: var(--color-text);
}

.matchday-shell {
    display: grid;
    gap: 24px;
    width: min(var(--matchday-content-width), calc(100% - 44px));
    margin: 0 auto;
    padding: 42px 0 80px;
}

.matchday-panel {
    min-width: 0;
}

.matchday-stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0 0 48px;
}

.matchday-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 48px;
    padding: 0 20px 18px 0;
    border: 0;
    border-bottom: 2px solid rgb(var(--color-text-primary-rgb) / 0.12);
    border-radius: 0;
    background: transparent;
    color: rgb(var(--color-text-primary-rgb) / 0.45);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    text-align: left;
    cursor: default;
    opacity: 1;
    transition: border-color 160ms ease, color 160ms ease;
}

.matchday-step span:first-child {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgb(var(--color-text-primary-rgb) / 0.14);
    border-radius: 50%;
    background: rgb(var(--color-surface-rgb) / 0.75);
    color: inherit;
    font-size: 0.76rem;
    font-weight: 850;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.matchday-step.is-complete {
    border-bottom-color: rgb(var(--color-accent-primary-rgb) / 0.45);
    color: rgb(var(--color-text-primary-rgb) / 0.7);
    cursor: pointer;
}

.matchday-step.is-complete span:first-child {
    border-color: rgb(var(--color-accent-primary-rgb) / 0.3);
    background: rgb(var(--color-accent-primary-rgb) / 0.09);
    color: var(--color-accent-primary-strong);
}

.matchday-step.is-active {
    border-bottom-color: var(--color-accent-primary);
    color: var(--color-text);
}

.matchday-step.is-active span:first-child {
    border-color: var(--color-accent-primary);
    background: var(--color-accent-primary);
    color: var(--color-surface);
}

.matchday-step:focus-visible,
.matchday-back-button:focus-visible,
.matchday-tile:focus-visible,
.matchday-state-button:focus-visible,
.matchday-primary-button:focus-visible,
.matchday-secondary-button:focus-visible {
    outline: 3px solid rgb(var(--color-accent-primary-rgb) / 0.3);
    outline-offset: 3px;
}

.matchday-screen {
    display: none;
    gap: 24px;
}

.matchday-screen.is-active {
    display: grid;
    animation: matchday-screen-enter 180ms ease-out;
}

.matchday-screen-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.matchday-screen-heading > div {
    min-width: 0;
}

.matchday-eyebrow {
    margin: 0 0 8px;
    color: var(--color-accent-primary-strong);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.matchday-screen h1,
.matchday-output h2,
.matchday-output p {
    margin: 0;
}

.matchday-screen h1 {
    max-width: 760px;
    font-size: 2.35rem;
    line-height: 1.08;
}

.matchday-count {
    flex: 0 0 auto;
    margin-bottom: 4px;
    padding: 7px 10px;
    border: 1px solid rgb(var(--color-text-primary-rgb) / 0.12);
    border-radius: 999px;
    background: rgb(var(--color-surface-rgb) / 0.72);
    color: rgb(var(--color-text-primary-rgb) / 0.64);
    font-size: 0.76rem;
    font-weight: 800;
}

.matchday-count strong {
    color: var(--color-text);
    font-weight: 900;
}

.matchday-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgb(var(--color-text-primary-rgb) / 0.64);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    cursor: pointer;
    transition: color 140ms ease;
}

.matchday-back-button span {
    font-size: 1rem;
    transition: transform 140ms ease;
}

.matchday-back-button:hover {
    color: var(--color-text);
}

.matchday-back-button:hover span {
    transform: translateX(-3px);
}

.matchday-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.matchday-club-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.matchday-language-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 720px;
}

.matchday-language-code {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgb(var(--color-accent-primary-rgb) / 0.28);
    border-radius: 8px;
    background: rgb(var(--color-accent-primary-rgb) / 0.08);
    color: var(--color-accent-primary);
    font-size: 0.9rem;
    font-weight: 800;
}

.matchday-language-tile small {
    display: block;
    margin-top: 5px;
    color: rgb(var(--color-text-primary-rgb) / 0.64);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
}

.matchday-tile {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 30px;
    gap: 16px;
    align-items: center;
    min-width: 0;
    min-height: 112px;
    padding: 18px;
    border: 1px solid rgb(var(--color-text-primary-rgb) / 0.13);
    border-radius: 8px;
    background: rgb(var(--color-surface-rgb) / 0.84);
    box-shadow: 0 10px 28px rgb(var(--color-text-primary-rgb) / 0.045);
    color: var(--color-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.matchday-tile::after {
    content: "\2192";
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgb(var(--color-text-primary-rgb) / 0.12);
    border-radius: 50%;
    color: rgb(var(--color-text-primary-rgb) / 0.5);
    font-size: 0.95rem;
    transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.matchday-tile:hover {
    transform: translateY(-3px);
    border-color: rgb(var(--color-accent-primary-rgb) / 0.42);
    background: var(--color-surface);
    box-shadow: 0 16px 38px rgb(var(--color-text-primary-rgb) / 0.08);
}

.matchday-tile:hover::after {
    transform: translateX(2px);
    border-color: var(--color-accent-primary);
    background: var(--color-accent-primary);
    color: var(--color-surface);
}

.matchday-tile strong {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.matchday-league-logo,
.matchday-league-logo-fallback {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border: 1px solid rgb(var(--color-text-primary-rgb) / 0.1);
    border-radius: 8px;
    background: var(--color-surface);
}

.matchday-league-logo img {
    display: block;
    max-width: 52px;
    max-height: 52px;
    object-fit: contain;
}

.matchday-league-logo-fallback {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--color-accent-primary-strong);
    font-size: 0.78rem;
    font-weight: 900;
}

.matchday-club-logo {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
}

.matchday-club-logo img {
    display: block;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
}

.matchday-club-badge {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgb(var(--color-accent-primary-rgb) / 0.1);
    color: var(--color-accent-primary-strong);
    font-size: 0.74rem;
    font-weight: 900;
}

.matchday-logo-fallback {
    display: none;
}

.matchday-entity-logo.is-missing img {
    display: none;
}

.matchday-entity-logo.is-missing .matchday-logo-fallback {
    display: grid;
}

.matchday-empty-state,
.matchday-loading-state {
    grid-column: 1 / -1;
}

.matchday-loading-state {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.matchday-club-grid .matchday-loading-state {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.matchday-skeleton {
    min-height: 112px;
    border: 1px solid rgb(var(--color-text-primary-rgb) / 0.08);
    border-radius: 8px;
    background: rgb(var(--color-surface-rgb) / 0.72);
    animation: matchday-pulse 1.2s ease-in-out infinite alternate;
}

.matchday-empty-state {
    display: grid;
    justify-items: start;
    gap: 10px;
    min-height: 144px;
    padding: 28px;
    border: 1px dashed rgb(var(--color-text-primary-rgb) / 0.22);
    border-radius: 8px;
    color: rgb(var(--color-text-primary-rgb) / 0.66);
    line-height: 1.5;
}

.matchday-empty-state strong {
    color: var(--color-text);
    font-size: 1rem;
}

.matchday-state-button {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.matchday-fixture-list {
    display: grid;
    gap: 10px;
}

.matchday-fixture-list > .matchday-loading-state {
    grid-template-columns: 1fr;
}

.matchday-fixture-tile {
    grid-template-columns: 120px minmax(0, 1fr) 118px;
    min-height: 104px;
    padding: 16px 18px;
}

.matchday-fixture-tile::after {
    display: none;
}

.matchday-fixture-date {
    display: grid;
    gap: 4px;
    align-content: center;
    align-self: stretch;
    padding-right: 18px;
    border-right: 1px solid rgb(var(--color-text-primary-rgb) / 0.1);
}

.matchday-fixture-date small {
    color: rgb(var(--color-text-primary-rgb) / 0.58);
    font-size: 0.75rem;
    font-weight: 750;
}

.matchday-fixture-date strong {
    font-size: 1.25rem;
}

.matchday-match-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.matchday-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.matchday-team:last-child {
    flex-direction: row-reverse;
    text-align: right;
}

.matchday-team-logo {
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    width: 38px;
    height: 38px;
}

.matchday-team-logo img {
    display: block;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

.matchday-team-logo .matchday-club-badge {
    width: 34px;
    height: 34px;
    font-size: 0.64rem;
}

.matchday-team strong {
    min-width: 0;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.matchday-vs {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgb(var(--color-text-primary-rgb) / 0.055);
    color: rgb(var(--color-text-primary-rgb) / 0.5);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
}

.matchday-generate {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--color-accent-primary-strong);
    font-size: 0.8rem;
    font-weight: 850;
}

.matchday-generate span:last-child {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgb(var(--color-accent-primary-rgb) / 0.3);
    border-radius: 50%;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.matchday-fixture-tile:hover .matchday-generate span:last-child {
    transform: translateX(2px);
    background: var(--color-accent-primary);
    color: var(--color-surface);
}

.matchday-output {
    display: none;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    overflow: hidden;
    border: 1px solid rgb(var(--color-text-primary-rgb) / 0.13);
    border-radius: 8px;
    background: rgb(var(--color-surface-rgb) / 0.86);
    box-shadow: 0 18px 48px rgb(var(--color-text-primary-rgb) / 0.07);
}

.matchday-output.is-active {
    display: grid;
    animation: matchday-screen-enter 180ms ease-out;
}

.matchday-brief-summary,
.matchday-generation-panel {
    display: grid;
    align-content: center;
    min-height: 210px;
    padding: 28px;
}

.matchday-brief-summary {
    border-right: 1px solid rgb(var(--color-text-primary-rgb) / 0.1);
}

.matchday-brief-summary h2 {
    font-size: 1.75rem;
    line-height: 1.12;
}

.matchday-brief-summary > p:last-child,
.matchday-generation-copy > p {
    color: rgb(var(--color-text-primary-rgb) / 0.62);
    line-height: 1.5;
}

.matchday-brief-summary > p:last-child {
    white-space: pre-line;
}

.matchday-generation-panel {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    transition: background 180ms ease;
}

.matchday-generation-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.matchday-generation-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.matchday-generation-heading span {
    color: rgb(var(--color-text-primary-rgb) / 0.58);
    font-size: 0.84rem;
    font-weight: 800;
}

.matchday-generation-indicator {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 2px solid rgb(var(--color-text-primary-rgb) / 0.12);
    border-radius: 50%;
}

.matchday-generation-panel.is-processing .matchday-generation-indicator {
    border-color: rgb(var(--color-accent-primary-rgb) / 0.2);
    border-top-color: var(--color-accent-primary);
    animation: matchday-generation-spin 850ms linear infinite;
}

.matchday-generation-panel.is-ready {
    background: color-mix(in srgb, var(--color-accent-primary) 5%, var(--color-surface));
}

.matchday-generation-panel.is-ready .matchday-generation-indicator {
    border-color: var(--color-accent-primary);
    background: var(--color-accent-primary);
    color: var(--color-surface);
}

.matchday-generation-panel.is-ready .matchday-generation-indicator::after {
    content: "\2713";
    font-size: 1.25rem;
    font-weight: 900;
}

.matchday-generation-panel.is-error {
    background: color-mix(in srgb, var(--color-accent-danger) 6%, var(--color-surface));
}

.matchday-generation-panel.is-error .matchday-generation-indicator {
    border-color: var(--color-accent-danger);
    color: var(--color-accent-danger);
}

.matchday-generation-panel.is-error .matchday-generation-indicator::after {
    content: "!";
    font-size: 1.35rem;
    font-weight: 900;
}

@keyframes matchday-generation-spin {
    to {
        transform: rotate(360deg);
    }
}

.matchday-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgb(var(--color-text-primary-rgb) / 0.1);
}

.matchday-primary-button,
.matchday-secondary-button {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 850;
    cursor: pointer;
}

.matchday-primary-button {
    border-color: var(--color-accent-primary);
    background: var(--color-accent-primary);
    color: var(--color-surface);
}

.matchday-primary-button:hover:not(:disabled) {
    border-color: var(--color-accent-primary-strong);
    background: var(--color-accent-primary-strong);
}

.matchday-secondary-button {
    background: transparent;
}

.matchday-secondary-button:hover {
    background: rgb(var(--color-text-primary-rgb) / 0.05);
}

.matchday-primary-button:disabled {
    border-color: var(--color-disabled-border);
    background: var(--color-disabled-background);
    color: rgb(var(--color-text-primary-rgb) / 0.44);
    cursor: wait;
}

@keyframes matchday-screen-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes matchday-pulse {
    from {
        opacity: 0.48;
    }

    to {
        opacity: 1;
    }
}

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

    .matchday-club-grid,
    .matchday-club-grid .matchday-loading-state {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .matchday-fixture-tile {
        grid-template-columns: 100px minmax(0, 1fr) 104px;
    }
}

@media (max-width: 760px) {
    .matchday-nav {
        grid-template-columns: 1fr auto;
        min-height: 68px;
        padding: 12px 14px;
    }

    .matchday-product-name {
        display: none;
    }

    .matchday-nav .brand-wordmark {
        width: 94px;
    }

    .matchday-shell {
        width: min(100% - 32px, var(--matchday-content-width));
        padding: 30px 0 56px;
    }

    .matchday-stepper {
        margin-bottom: 36px;
    }

    .matchday-step {
        gap: 7px;
        padding-right: 8px;
        font-size: 0.75rem;
    }

    .matchday-step span:first-child {
        width: 25px;
        height: 25px;
    }

    .matchday-screen h1 {
        font-size: 1.85rem;
    }

    .matchday-club-grid,
    .matchday-club-grid .matchday-loading-state {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .matchday-fixture-tile {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .matchday-generate {
        grid-column: 1 / -1;
        justify-content: flex-end;
        padding-top: 12px;
        border-top: 1px solid rgb(var(--color-text-primary-rgb) / 0.08);
    }

    .matchday-output {
        grid-template-columns: 1fr;
    }

    .matchday-brief-summary,
    .matchday-generation-panel {
        min-height: auto;
        padding: 24px;
    }

    .matchday-brief-summary {
        border-right: 0;
        border-bottom: 1px solid rgb(var(--color-text-primary-rgb) / 0.1);
    }
}

@media (max-width: 560px) {
    .matchday-nav-links {
        gap: 14px;
        font-size: 0.8rem;
    }

    .matchday-shell {
        width: min(100% - 24px, var(--matchday-content-width));
        padding-top: 24px;
    }

    .matchday-step {
        justify-content: center;
        padding: 0 2px 13px;
    }

    .matchday-step span:last-child {
        display: none;
    }

    .matchday-screen-heading {
        align-items: start;
        flex-direction: column;
        gap: 12px;
    }

    .matchday-count {
        margin-bottom: 0;
    }

    .matchday-tile-grid,
    .matchday-club-grid,
    .matchday-loading-state,
    .matchday-club-grid .matchday-loading-state {
        grid-template-columns: 1fr;
    }

    .matchday-tile {
        min-height: 96px;
        padding: 14px;
    }

    .matchday-league-logo,
    .matchday-league-logo-fallback {
        width: 58px;
        height: 58px;
    }

    .matchday-league-logo img {
        max-width: 46px;
        max-height: 46px;
    }

    .matchday-fixture-tile {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .matchday-fixture-date {
        grid-template-columns: 1fr auto;
        align-items: center;
        padding: 0 0 12px;
        border-right: 0;
        border-bottom: 1px solid rgb(var(--color-text-primary-rgb) / 0.1);
    }

    .matchday-match-line {
        grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
        gap: 7px;
    }

    .matchday-team {
        align-items: flex-start;
        flex-direction: column;
    }

    .matchday-team:last-child {
        align-items: flex-end;
        flex-direction: column;
    }

    .matchday-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .matchday-primary-button,
    .matchday-secondary-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .matchday-screen.is-active,
    .matchday-output.is-active,
    .matchday-skeleton,
    .matchday-generation-panel.is-processing .matchday-generation-indicator {
        animation: none;
    }

    .matchday-tile,
    .matchday-tile::after,
    .matchday-back-button span,
    .matchday-generate span:last-child {
        transition: none;
    }
}
