.rjn-portal .rjn-privacy-panel,
.rjn-portal .rjn-a11y-panel {
    position: static;
    inset: auto;
    width: min(
        calc(100% - var(--rjn-shell-gutter) - var(--rjn-shell-gutter)),
        var(--rjn-shell-max)
    );
    max-height: none;
    overflow: visible;
    margin: .75rem auto;
    padding: 1rem;
    border: 1px solid var(--nexo-border-control);
    border-radius: .75rem;
    background: var(--nexo-surface);
    color: var(--nexo-text);
    overflow-wrap: anywhere;
}

.rjn-a11y-panel[hidden],
.rjn-privacy-panel[hidden],
.rjn-a11y-trigger[hidden] {
    display: none !important;
}

.rjn-a11y-panel h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.rjn-a11y-panel p {
    margin-block: .5rem;
}

.rjn-a11y-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    margin-block: .75rem;
}

.rjn-a11y-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-block: .75rem;
}

.rjn-a11y-panel button,
.rjn-a11y-panel select {
    min-height: 44px;
    max-width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--nexo-border-control);
    border-radius: .5rem;
    background: var(--nexo-bg-subtle);
    color: var(--nexo-text);
    white-space: normal;
    overflow-wrap: anywhere;
}

.rjn-a11y-panel button[aria-pressed="true"] {
    border: 2px solid var(--nexo-ring);
    font-weight: 700;
}

.rjn-a11y-trigger {
    min-width: 44px;
    min-height: 44px;
}

.rjn-portal .nexo-header,
.rjn-portal .nexo-header__actions,
.rjn-portal .nexo-header__nav {
    flex-wrap: wrap;
}

.rjn-portal .nexo-header__nav a,
.rjn-portal .nexo-footer a,
.rjn-portal .nexo-btn {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.rjn-portal :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--nexo-ring);
    outline-offset: 3px;
}

.rjn-legal-disclaimer {
    margin-block: 1rem;
    padding: .85rem;
    border: 1px solid var(--nexo-border);
    border-inline-start: 4px solid var(--nexo-ring);
    border-radius: .6rem;
    background: var(--nexo-bg-subtle);
    line-height: 1.6;
}

html[data-rjn-a11y-scale="125"] { font-size: 125%; }
html[data-rjn-a11y-scale="150"] { font-size: 150%; }
html[data-rjn-a11y-scale="175"] { font-size: 175%; }
html[data-rjn-a11y-scale="200"] { font-size: 200%; }

html[data-rjn-a11y-scale] {
    --rjn-shell-gutter: clamp(12px, 2vw, 32px);
}

html[data-rjn-a11y-scale] .rjn-portal > .nexo-header {
    position: static;
}

html[data-rjn-a11y-scale] .rjn-reader-grid:has(> .rjn-reader-toc) {
    grid-template-columns: minmax(0, 1fr);
}

html[data-rjn-a11y-scale] .rjn-reader-toc {
    position: static;
    max-height: none;
}

html[data-rjn-a11y-scale] .rjn-reader-back {
    display: inline-flex;
}

body[data-rjn-a11y-contrast="high"] {
    --nexo-bg: #000;
    --nexo-bg-subtle: #000;
    --nexo-surface: #000;
    --nexo-surface-raised: #000;
    --nexo-surface-sunken: #000;
    --nexo-text: #fff;
    --nexo-text-muted: #fff;
    --nexo-text-subtle: #fff;
    --nexo-border: #fff;
    --nexo-border-strong: #fff;
    --nexo-border-control: #fff;
    --nexo-primary: #000;
    --nexo-primary-fg: #ff0;
    --nexo-primary-hover: #000;
    --nexo-primary-subtle: #000;
    --nexo-primary-subtle-fg: #ff0;
    --nexo-link: #ff0;
    --nexo-ring: #ff0;
    background: #000 !important;
    color: #fff !important;
    color-scheme: dark;
}

body[data-rjn-a11y-contrast="high"] a {
    color: #ff0 !important;
    text-decoration: underline;
}

body[data-rjn-a11y-contrast="high"] :is(button,input,select,textarea) {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body[data-rjn-a11y-links="underlined"] a {
    text-decoration: underline !important;
    text-underline-offset: .15em;
}

body[data-rjn-a11y-motion="reduced"] *,
body[data-rjn-a11y-motion="reduced"] *::before,
body[data-rjn-a11y-motion="reduced"] *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
}

@media (max-width: 600px) {
    html[data-rjn-a11y-scale] .rjn-discovery-stats,
    html[data-rjn-a11y-scale] .rjn-category-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    html[data-rjn-a11y-scale] .rjn-source-logo {
        flex-wrap: wrap;
    }

    html[data-rjn-a11y-scale] .rjn-source-logo span {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    html[data-rjn-a11y-scale] .rjn-animated-brand .rjn-credit {
        white-space: normal;
    }
}

@media print {
    .rjn-a11y-trigger,
    .rjn-a11y-panel,
    .rjn-privacy-panel {
        display: none !important;
    }
}
