body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

main {
    flex: 1;
}

.site-header {
    background-color: var(--site-header-background, var(--bs-body-bg));
    color: var(--site-header-foreground, var(--bs-body-color));
}

.site-footer {
    background-color: var(--site-footer-background, var(--bs-body-bg));
    color: var(--site-footer-foreground, var(--bs-secondary-color));
}

    .site-header .site-brand,
    .site-header nav a,
    .site-footer nav a {
        color: inherit;
    }

    .site-header nav a,
    .site-footer nav a {
        padding: 0.2rem 0.35rem;
        border-radius: 0;
        text-decoration: none;
        transition: background-color 120ms ease, box-shadow 120ms ease, transform 60ms ease;
    }

        .site-header nav a:hover,
        .site-footer nav a:hover {
            color: inherit;
            background-color: color-mix(in srgb, currentColor 12%, transparent);
        }

        .site-header nav a:focus-visible,
        .site-footer nav a:focus-visible {
            color: inherit;
            outline: 2px solid currentColor;
            outline-offset: 2px;
            background-color: color-mix(in srgb, currentColor 12%, transparent);
        }

        .site-header nav a[aria-current="page"],
        .site-footer nav a[aria-current="page"] {
            color: inherit;
            background-color: color-mix(in srgb, currentColor 16%, transparent);
            box-shadow: inset 0 -2px 0 currentColor;
            font-weight: 600;
        }

            .site-header nav a[aria-current="page"]:hover,
            .site-header nav a[aria-current="page"]:focus-visible,
            .site-footer nav a[aria-current="page"]:hover,
            .site-footer nav a[aria-current="page"]:focus-visible {
                background-color: color-mix(in srgb, currentColor 22%, transparent);
            }

        .site-header nav a:active,
        .site-footer nav a:active {
            color: inherit;
            background-color: color-mix(in srgb, currentColor 30%, transparent);
            box-shadow: inset 0 0 0 1px currentColor;
            transform: translateY(1px);
            transition: none;
        }

.site-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
}

.site-logo-slot {
    display: flex;
    max-width: min(var(--site-logo-max-width), 45vw);
    height: var(--site-logo-max-height);
    flex: 0 1 auto;
    align-items: center;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 120ms ease;
}

    .site-logo-slot.site-logo-loaded {
        opacity: 1;
    }

.site-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: left center;
}

.environment-strip {
    height: 0.35rem;
    flex: 0 0 auto;
}

    .environment-strip.environment-development {
        background-color: var(--bs-info);
    }

    .environment-strip.environment-staging {
        background-color: var(--bs-warning);
    }

.page-card {
    max-width: 980px;
}

.downloads-page {
    max-width: 1120px;
}

.download-page-header {
    padding: 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 5%);
}

.download-toolbar {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.view-mode-switch {
    min-height: 2rem;
}

.access-code-panel {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-tertiary-bg);
}

.access-code-heading {
    min-width: 10rem;
}

.artifact-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.artifact-nav-link {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    color: var(--bs-secondary-color);
    background: var(--bs-body-bg);
    font-size: 0.875rem;
    text-decoration: none;
}

    .artifact-nav-link:hover,
    .artifact-nav-link:focus-visible {
        color: var(--bs-body-color);
        border-color: var(--bs-secondary-color);
    }

.global-info,
.empty-state {
    padding: 1rem 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
}

.artifact-card {
    margin-bottom: 1.5rem;
    scroll-margin-top: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 0.35rem 1.25rem rgb(0 0 0 / 4%);
    overflow: hidden;
}

.artifact-card-body {
    padding: 1.5rem;
}

.artifact-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.artifact-description {
    margin-top: 1rem;
    color: var(--bs-secondary-color);
}

    .artifact-description > h1:first-child,
    .artifact-description > h2:first-child,
    .release-notes .markdown-content > h1:first-child,
    .release-notes .markdown-content > h2:first-child {
        display: none;
    }

.current-downloads {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--bs-secondary-bg) 55%, var(--bs-body-bg));
}

.download-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.download-version-meta,
.download-item-meta,
.download-item-note,
.download-file-name {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.download-version-meta {
    margin-top: 0.25rem;
}

.release-notes,
.older-downloads {
    margin-top: 0.75rem;
}

    .release-notes summary,
    .older-downloads summary {
        cursor: pointer;
        font-weight: 600;
    }

    .release-notes summary {
        display: inline-flex;
        padding: 0.35rem 0.6rem;
        border-radius: 0.45rem;
        background: rgb(var(--bs-body-bg-rgb) / 55%);
        color: var(--bs-secondary-color);
        font-size: 0.875rem;
    }

    .older-downloads > summary {
        padding: 0.75rem 0;
    }

.platform-list,
.older-version-platforms {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.platform-section {
    padding: 0.9rem 1rem;
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--bs-tertiary-bg) 78%, var(--bs-body-bg));
}

.platform-header {
    margin-bottom: 0.65rem;
}

.platform-info {
    margin: -0.1rem 0 0.75rem;
    color: var(--bs-secondary-color);
}

.download-list {
    display: grid;
    gap: 0.35rem;
}

.download-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-radius: 0.5rem;
    background: rgb(var(--bs-body-bg-rgb) / 68%);
}

.download-item-locked {
    background: var(--bs-tertiary-bg);
}

.download-item-main {
    min-width: 0;
}

.download-item-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.download-item-heading {
    font-weight: 600;
}

.download-file-name {
    margin-top: 0.15rem;
    font-weight: 400;
}

.download-file-name-primary {
    margin-top: 0;
    color: var(--bs-body-color);
    font-size: 0.95rem;
    font-weight: 500;
}

.download-item-note {
    margin-top: 0.3rem;
}

.download-item-info {
    margin-top: 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.925rem;
}

.download-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.download-item-meta {
    white-space: nowrap;
}

.older-version-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    margin-left: 0.4rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.older-version-list {
    display: grid;
    gap: 0.75rem;
    padding: 0.25rem 0 0;
}

.older-version-group {
    padding: 1rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--bs-secondary-bg) 55%, var(--bs-body-bg));
}

.older-version-header {
    margin-bottom: 0;
}

.older-version-platforms {
    margin-top: 0.75rem;
}

.markdown-content > :last-child,
.download-item-info > :last-child {
    margin-bottom: 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin-top: 1.5rem;
}

    .markdown-content h1:first-child,
    .markdown-content h2:first-child,
    .markdown-content h3:first-child,
    .markdown-content h4:first-child {
        margin-top: 0;
    }

.markdown-content pre {
    padding: 1rem;
    border-radius: 0.75rem;
    background: var(--bs-tertiary-bg);
    overflow-x: auto;
}

.markdown-content code {
    word-break: break-word;
}

.markdown-content table {
    width: 100%;
}

.catalog-loading-state {
    display: flex;
    min-height: 12rem;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 0.35rem 1.25rem rgb(0 0 0 / 4%);
}

.catalog-loading-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-loading-overlay {
    position: fixed;
    z-index: 1100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgb(var(--bs-body-bg-rgb) / 82%);
    backdrop-filter: blur(2px);
}

.page-loading-dialog {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: min(28rem, 100%);
    padding: 0.9rem 1.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
    font-weight: 600;
}

body.page-loading-active {
    cursor: progress;
}

@media (max-width: 767.98px) {
    .download-page-header,
    .artifact-card-body {
        padding: 1rem;
    }

    .download-toolbar {
        flex-direction: column;
    }

    .download-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .download-item-actions {
        justify-content: space-between;
    }
}

@media (max-width: 399.98px) {
    .download-item-actions {
        align-items: stretch;
        flex-direction: column;
    }

        .download-item-actions .btn {
            width: 100%;
        }
}