/* Batch 18 — cross-cutting accessibility, resilience and viewport hardening. */

html {
    scroll-padding-top: 4.5rem;
}

body.r2-app {
    overflow-x: clip;
}

.r2-shell,
.r2-shell__main,
.r2-shell__content,
.r2-page,
.r2-page > *,
.r2-section,
.r2-grid,
.r2-table-wrap,
.r2-compact-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.r2-shell__content {
    overflow-wrap: anywhere;
}

.r2-table-wrap,
.r2-compact-table-wrap {
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
}

.r2-app :target {
    scroll-margin-top: 5rem;
}

.r2-app [aria-busy="true"] {
    cursor: progress;
}

.r2-app .btn,
.r2-app .button-link,
.r2-app .r2-button,
.r2-app button,
.r2-app summary,
.r2-app input,
.r2-app select,
.r2-app textarea {
    scroll-margin-block: 5rem 2rem;
}

.r2-app .btn:focus-visible,
.r2-app .button-link:focus-visible,
.r2-app .nav-link:focus-visible,
.r2-app summary:focus-visible {
    outline: 2px solid var(--r2-focus-color, #1d63c6);
    outline-offset: 2px;
    box-shadow: var(--r2-focus-ring, 0 0 0 4px rgba(29, 99, 198, 0.2));
}

.r2-network-banner {
    position: fixed;
    z-index: 1500;
    top: 0;
    left: 50%;
    width: min(calc(100% - 2rem), 42rem);
    padding: 0.65rem 1rem;
    border: 1px solid #d97706;
    border-top: 0;
    background: #fff7e8;
    color: #6f3d08;
    font-size: 0.875rem;
    font-weight: 650;
    text-align: center;
    transform: translateX(-50%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.r2-network-banner[hidden] {
    display: none !important;
}

.r2-live-region {
    position: fixed;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.app-modal-backdrop[aria-hidden="true"] {
    pointer-events: none;
}

.r2-public-state {
    width: min(calc(100% - 2rem), 46rem);
    margin: min(14vh, 8rem) auto;
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid #d9dee7;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.r2-public-state h1 {
    margin: 0.25rem 0 0.75rem;
}

.r2-public-state small {
    display: block;
    margin-top: 1.5rem;
    color: #667085;
}

@media (max-width: 85.375rem) {
    .r2-shell__content {
        padding-inline: clamp(0.75rem, 1.8vw, 1.5rem);
    }

    .r2-page {
        padding-inline: 0;
    }
}

@media (max-width: 56rem) {
    html {
        scroll-padding-top: 3.5rem;
    }

    .r2-network-banner {
        width: 100%;
        border-inline: 0;
    }

    .r2-app .r2-button,
    .r2-app .btn,
    .r2-app .button-link,
    .r2-app summary {
        min-height: 2.5rem;
    }
}

@media (forced-colors: active) {
    .r2-app :focus-visible,
    .r2-app .btn:focus-visible,
    .r2-app .button-link:focus-visible,
    .r2-app .nav-link:focus-visible,
    .r2-app summary:focus-visible {
        outline: 3px solid CanvasText;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
