/* Public accessibility panel */
.a11y-controls-panel {
    position: fixed;
    top: 6.9rem;
    right: 1rem;
    width: min(92vw, 320px);
    border: 1px solid rgba(0, 51, 152, 0.2);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.2);
    z-index: 1080;
}

.a11y-controls-panel[hidden] {
    display: none !important;
}

.a11y-controls-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem 0.45rem;
    border-bottom: 1px solid rgba(0, 51, 152, 0.12);
}

.a11y-controls-panel__title {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--color-primary);
}

.a11y-controls-panel__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-primary);
}

.a11y-controls-panel__close:hover,
.a11y-controls-panel__close:focus {
    background: rgba(0, 51, 152, 0.08);
}

.a11y-controls-panel__body {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem 0.8rem 0.65rem;
}

.a11y-controls-panel__action,
.a11y-controls-panel__reset {
    border: 1px solid rgba(0, 51, 152, 0.22);
    border-radius: 999px;
    background: #ffffff;
    color: var(--color-primary);
    font-weight: 600;
    line-height: 1.2;
    padding: 0.55rem 0.8rem;
    text-align: left;
}

.a11y-controls-panel__action:hover,
.a11y-controls-panel__action:focus,
.a11y-controls-panel__reset:hover,
.a11y-controls-panel__reset:focus {
    background: rgba(0, 51, 152, 0.08);
}

.a11y-controls-panel__action.is-active {
    background: rgba(0, 51, 152, 0.16);
    border-color: rgba(0, 51, 152, 0.45);
}

.a11y-controls-panel__footer {
    padding: 0 0.8rem 0.85rem;
}

.a11y-controls-panel__reset {
    width: 100%;
    text-align: center;
}

/* Shared accessibility effects (for guests and profile plugin classes) */
html.members-a11y-large-text {
    font-size: calc(100% * var(--members-a11y-font-scale, 1.12));
}

body.members-a11y-large-text p,
body.members-a11y-large-text li,
body.members-a11y-large-text label,
body.members-a11y-large-text input,
body.members-a11y-large-text select,
body.members-a11y-large-text textarea,
body.members-a11y-large-text button,
body.members-a11y-large-text .btn {
    line-height: 1.65;
}

body.members-a11y-highlight-links a:not(.btn):not(.badge):not(.dropdown-item) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
}

body.members-a11y-high-contrast {
    color: #0f172a;
    background-color: #ffffff;
}

body.members-a11y-high-contrast :focus-visible {
    outline: 3px solid #ffbf00 !important;
    outline-offset: 3px;
}

body.members-a11y-high-contrast .btn,
body.members-a11y-high-contrast .card,
body.members-a11y-high-contrast .alert,
body.members-a11y-high-contrast .form-control,
body.members-a11y-high-contrast .form-select,
body.members-a11y-high-contrast .modal-content {
    box-shadow: none !important;
    border-color: #123b7a !important;
}

body.members-a11y-high-contrast .text-muted,
body.members-a11y-high-contrast .text-body-secondary {
    color: #243b53 !important;
}

body.members-a11y-monochrome {
    filter: grayscale(1);
}

html[data-theme="dark"] .a11y-controls-panel {
    background: rgba(15, 23, 42, 0.98);
    border-color: #334155;
    box-shadow: 0 0.9rem 1.8rem rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .a11y-controls-panel__head {
    border-color: #334155;
}

html[data-theme="dark"] .a11y-controls-panel__title,
html[data-theme="dark"] .a11y-controls-panel__close,
html[data-theme="dark"] .a11y-controls-panel__action,
html[data-theme="dark"] .a11y-controls-panel__reset {
    color: #dbeafe;
}

html[data-theme="dark"] .a11y-controls-panel__action,
html[data-theme="dark"] .a11y-controls-panel__reset {
    background: #16233a;
    border-color: #36547a;
}

html[data-theme="dark"] .a11y-controls-panel__action:hover,
html[data-theme="dark"] .a11y-controls-panel__action:focus,
html[data-theme="dark"] .a11y-controls-panel__reset:hover,
html[data-theme="dark"] .a11y-controls-panel__reset:focus,
html[data-theme="dark"] .a11y-controls-panel__action.is-active {
    background: #1e3a5f;
}

@media (max-width: 991.98px) {
    .a11y-controls-panel {
        top: 4.6rem;
        right: 0.6rem;
        width: min(94vw, 300px);
    }
}
