.wg-downloads-page {
        --wg-border: rgba(148, 163, 184, .16);
        --wg-border-strong: rgba(96, 165, 250, .30);
        --wg-muted: #94a3b8;
        --wg-blue: #60a5fa;
        --wg-blue-strong: #3b82f6;
        --wg-green: #34d399;
    }

    .wg-downloads-page * {
        box-sizing: border-box;
    }

    /* ============================================================
       Hero
    ============================================================ */

    .wg-downloads-hero {
        padding-top: 4rem;
        padding-bottom: 2.25rem;
    }

    .wg-downloads-hero-copy {
        max-width: 760px;
    }

    .wg-downloads-hero-copy h1 {
        margin: .4rem 0 .7rem;
        font-size: clamp(2.2rem, 5vw, 3.8rem);
        line-height: 1.05;
        letter-spacing: -.04em;
    }

    .wg-downloads-hero-copy p {
        margin: 0;
        color: var(--wg-muted);
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* ============================================================
       Platform cards
    ============================================================ */

    .wg-download-platform-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
        margin-top: 2rem;
    }

    .wg-download-platform-card {
        position: relative;
        display: flex;
        flex-direction: column;
        min-height: 410px;
        padding: 1.8rem;
        overflow: hidden;

        border: 1px solid var(--wg-border);
        border-radius: 24px;

        background:
            radial-gradient(
                circle at top right,
                rgba(59, 130, 246, .13),
                transparent 38%
            ),
            rgba(15, 23, 42, .36);
    }

    .wg-download-platform-card--android {
        background:
            radial-gradient(
                circle at top right,
                rgba(52, 211, 153, .12),
                transparent 38%
            ),
            rgba(15, 23, 42, .36);
    }

    .wg-download-platform-card::after {
        content: "";
        position: absolute;
        width: 220px;
        height: 220px;
        right: -100px;
        bottom: -120px;
        border-radius: 999px;
        background: rgba(96, 165, 250, .07);
        pointer-events: none;
    }

    .wg-download-platform-card--android::after {
        background: rgba(52, 211, 153, .06);
    }

    .wg-download-platform-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.2rem;
    }

    .wg-download-platform-icon {
        width: 60px;
        height: 60px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;

        border: 1px solid rgba(96, 165, 250, .22);
        border-radius: 18px;

        background: rgba(59, 130, 246, .11);
        font-size: 1.8rem;
    }

    .wg-download-platform-card--android .wg-download-platform-icon {
        border-color: rgba(52, 211, 153, .22);
        background: rgba(52, 211, 153, .10);
    }

    .wg-download-status {
        padding: .35rem .65rem;
        border: 1px solid var(--wg-border);
        border-radius: 999px;
        color: var(--wg-muted);
        font-size: .72rem;
        font-weight: 800;
        white-space: nowrap;
    }

    .wg-download-platform-card h2 {
        margin: 0 0 .5rem;
        font-size: 1.55rem;
    }

    .wg-download-platform-card > p {
        margin: 0;
        color: var(--wg-muted);
        line-height: 1.6;
    }

    .wg-download-version-box {
        margin-top: 1.4rem;
        padding: 1rem;
        border: 1px solid var(--wg-border);
        border-radius: 15px;
        background: rgba(15, 23, 42, .25);
    }

    .wg-download-version-label {
        display: block;
        margin-bottom: .3rem;
        color: var(--wg-muted);
        font-size: .72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    .wg-download-version-main {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .wg-download-version-main strong {
        font-size: 1.35rem;
    }

    .wg-download-version-main span {
        color: var(--wg-muted);
        font-size: .82rem;
    }

    .wg-download-meta {
        display: flex;
        flex-wrap: wrap;
        gap: .45rem;
        margin-top: 1rem;
    }

    .wg-download-meta span {
        padding: .4rem .65rem;
        border: 1px solid var(--wg-border);
        border-radius: 999px;
        color: var(--wg-muted);
        font-size: .75rem;
    }

    .wg-download-actions {
        display: flex;
        flex-wrap: wrap;
        gap: .65rem;
        margin-top: auto;
        padding-top: 1.5rem;
    }

    /* ============================================================
       Before install
    ============================================================ */

    .wg-before-install {
        margin-top: 1.5rem;
        padding: 1.2rem;
        border: 1px solid var(--wg-border);
        border-radius: 20px;
        background: rgba(15, 23, 42, .24);
    }

    .wg-before-install-head {
        margin-bottom: 1rem;
        text-align: center;
    }

    .wg-before-install-head strong {
        display: block;
        margin-bottom: .25rem;
    }

    .wg-before-install-head span {
        color: var(--wg-muted);
        font-size: .85rem;
    }

    .wg-install-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .75rem;
    }

    .wg-install-item {
        padding: .9rem;
        border: 1px solid var(--wg-border);
        border-radius: 14px;
        background: rgba(15, 23, 42, .18);
        text-align: center;
    }

    .wg-install-item-icon {
        display: block;
        margin-bottom: .35rem;
        font-size: 1.05rem;
    }

    .wg-install-item strong {
        display: block;
        margin-bottom: .18rem;
        font-size: .78rem;
    }

    .wg-install-item span:last-child {
        color: var(--wg-muted);
        font-size: .7rem;
        line-height: 1.35;
    }

    /* ============================================================
       Older releases
    ============================================================ */

    .wg-downloads-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .wg-downloads-section-head {
        display: flex;
        justify-content: space-between;
        align-items: end;
        gap: 1rem;
        margin-bottom: 1.2rem;
    }

    .wg-downloads-section-head h2 {
        margin: .35rem 0 .4rem;
    }

    .wg-downloads-section-head p {
        margin: 0;
        color: var(--wg-muted);
    }

    .wg-older-body[hidden] {
        display: none;
    }

    .wg-release-grid {
        display: grid;
        grid-template-columns: repeat(
            auto-fit,
            minmax(min(100%, 280px), 1fr)
        );
        gap: 1rem;
    }

    .wg-release-card {
        display: flex;
        flex-direction: column;
        padding: 1.2rem;
        border: 1px solid var(--wg-border);
        border-radius: 18px;
        background: rgba(15, 23, 42, .30);
    }

    .wg-release-card h3 {
        margin: 0 0 .4rem;
        font-size: 1.05rem;
    }

    .wg-release-card p {
        margin: 0;
        color: var(--wg-muted);
        font-size: .84rem;
        line-height: 1.5;
    }

    .wg-release-card .wg-download-meta {
        margin-bottom: 1rem;
    }

    .wg-release-notes {
        margin: 0 0 1rem;
        color: var(--wg-muted);
        font-size: .78rem;
        line-height: 1.45;
    }

    .wg-release-card .btn {
        margin-top: auto;
    }

    /* ============================================================
       Empty state
    ============================================================ */

    .wg-download-empty {
        padding: 2rem;
        border: 1px solid var(--wg-border);
        border-radius: 20px;
        text-align: center;
        background: rgba(15, 23, 42, .25);
    }

    .wg-download-empty strong {
        display: block;
        margin-bottom: .4rem;
        font-size: 1rem;
    }

    .wg-download-empty p {
        margin: 0;
        color: var(--wg-muted);
    }

    /* ============================================================
       Changelog modal
    ============================================================ */

    .downloads-changelog-modal {
        position: fixed;
        inset: 0;
        z-index: 9999;

        display: none;
        align-items: center;
        justify-content: center;

        padding: 1rem;
    }

    .downloads-changelog-modal.is-open {
        display: flex;
    }

    .downloads-changelog-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(2, 6, 23, .78);
        backdrop-filter: blur(6px);
    }

    .downloads-changelog-dialog {
        position: relative;
        width: min(680px, 100%);
        max-height: 85vh;
        overflow: auto;

        border: 1px solid var(--wg-border);
        border-radius: 20px;

        background: #0f172a;
        box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    }

    .downloads-changelog-head {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.2rem 1.2rem 1rem;
        border-bottom: 1px solid var(--wg-border);
    }

    .downloads-changelog-head h2 {
        margin: .35rem 0 0;
        font-size: 1.2rem;
    }

    .downloads-changelog-close {
        width: 36px;
        height: 36px;
        border: 1px solid var(--wg-border);
        border-radius: 10px;
        background: transparent;
        color: inherit;
        cursor: pointer;
        font-size: 1.35rem;
    }

    .downloads-changelog-body {
        padding: 1.2rem;
        line-height: 1.6;
    }

    .downloads-changelog-footer {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: .65rem;
        padding: 1rem 1.2rem 1.2rem;
        border-top: 1px solid var(--wg-border);
    }

    body.modal-open {
        overflow: hidden;
    }

    /* ============================================================
       Responsive
    ============================================================ */

    @media (max-width: 900px) {
        .wg-download-platform-grid {
            grid-template-columns: 1fr;
        }

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

        .wg-downloads-section-head {
            align-items: flex-start;
            flex-direction: column;
        }
    }

    @media (max-width: 640px) {
        .wg-downloads-hero {
            padding-top: 2.8rem;
        }

        .wg-download-platform-card {
            min-height: 0;
            padding: 1.3rem;
            border-radius: 18px;
        }

        .wg-download-actions {
            flex-direction: column;
        }

        .wg-download-actions .btn {
            width: 100%;
        }

        .wg-install-grid {
            grid-template-columns: 1fr 1fr;
        }

        .wg-download-platform-top {
            align-items: center;
        }

        .wg-downloads-section {
            padding-top: 2rem;
        }

        .downloads-changelog-footer {
            flex-direction: column;
        }

        .downloads-changelog-footer .btn {
            width: 100%;
        }
    }
