.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}




/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Toggle button */
#accessibility-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--primary, #224099);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
@media (prefers-reduced-motion: no-preference) {
    #accessibility-toggle {
        animation: pulse 5s infinite;
    }
}
#accessibility-toggle:hover {
    transform: scale(1.1);
}

#accessibility-toggle:focus-visible {
    outline: 3px solid #ffe500;
    outline-offset: 2px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 64, 153, 0.7);
    }

    70% {
        transform: scale(1.08);
        box-shadow: 0 0 0 15px rgba(34, 64, 153, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 64, 153, 0);
    }
}

/* Menu container */
#accessibility-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(100%, 28rem);
    z-index: 1000;
    height: 100%;
    background: white;
    border-left: 2px solid var(--border, #ddd);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    will-change: transform;
/*        display: flex;
    flex-direction: column;
*/ }

#accessibility-menu.active {
    transform: translateX(0);
}

/* Prevent body scroll when menu open */
body.menu-open {
    overflow: hidden;
}

/* Header */
#accessibility-menu header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, #ddd);
}

#accessibility-menu h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--primary, #224099);
}

#accessibility-menu #close-menu {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

#accessibility-menu #close-menu:hover {
    background: #f0f0f0;
}

#accessibility-menu #close-menu:focus-visible {
    outline: 2px solid var(--primary, #224099);
}

/* Options grid */
#accessibility-menu .options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.75rem;
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

/* Action buttons */
#accessibility-menu .action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--color-surface-alt, #f8f8fa);
    border: 1px solid var(--color-border, #ddd);
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 7rem;
}

#accessibility-menu .action:hover {
    background: var(--color-accent-primary-light, #e3dbff);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#accessibility-menu .action:focus-visible {
    outline: 2px solid var(--color-accent-primary, #224099);
    outline-offset: 2px;
}

#accessibility-menu .action.active-feature {
    background: #e3dbff;
    border-color: var(--primary, #224099);
}

/* Icons */
#accessibility-menu .icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary, #224099);
}

#accessibility-menu .icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

/* Labels */
#accessibility-menu .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-primary, #222);
    line-height: 1.2;
}

/* Steps */
#accessibility-menu .steps {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

#accessibility-menu .step {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-text-muted, #d5daed);
    transition: background 0.2s;
}

#accessibility-menu .step.active {
    background: var(--color-accent-primary, #224099);
}

/* Reset button */
#accessibility-menu .action.reset {
    grid-column: 1 / -1;
    background: var(--color-accent-secondary, #ffe500);
    color: #000;
    font-weight: bold;
    min-height: 3rem;
    flex-direction: row;
    gap: 1rem;
}

#accessibility-menu .action.reset:hover {
    background: #ffd700;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #accessibility-menu {
        width: 100%;
    }

    #accessibility-menu .options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Accessibility mode styles */
body.high-contrast {
    filter: contrast(1.5);
    background: #000 !important;
}

body.high-contrast * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.inverted {
    filter: invert(1) hue-rotate(180deg);
}

body.inverted img,
body.inverted video {
    filter: invert(1) hue-rotate(180deg);
}

body.smart-contrast {
    background: #1a1a1a !important;
}

body.smart-contrast * {
    color: #f0f0f0 !important;
}

body.smart-contrast a {
    color: #4a9eff !important;
}

body.highlight-links a {
    background: yellow !important;
    color: #000 !important;
    padding: 0.2em !important;
    text-decoration: underline !important;
}

body.highlight-links-strong a {
    background: #ff0 !important;
    color: #000 !important;
    padding: 0.3em !important;
    border: 2px solid #000 !important;
}

body.highlight-focus *:focus {
    outline: 3px solid #ff0 !important;
    outline-offset: 2px !important;
}

body.font-small {
    font-size: 90% !important;
}

body.font-large {
    font-size: 110% !important;
}

body.font-xlarge {
    font-size: 125% !important;
}

body.dyslexia-light {
    font-family: Arial, sans-serif !important;
    letter-spacing: 0.05em !important;
}

body.dyslexia-medium {
    font-family: "Comic Sans MS", Arial, sans-serif !important;
    letter-spacing: 0.1em !important;
    word-spacing: 0.2em !important;
}

body.dyslexia-strong {
    font-family: "OpenDyslexic", "Comic Sans MS", Arial, sans-serif !important;
    letter-spacing: 0.15em !important;
    word-spacing: 0.3em !important;
    line-height: 1.8 !important;
}

body.cursor-white * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="15" fill="white" stroke="black" stroke-width="2"/></svg>') 16 16, auto !important;
}

body.cursor-black * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="15" fill="black" stroke="white" stroke-width="2"/></svg>') 16 16, auto !important;
}

body.cursor-large * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><circle cx="24" cy="24" r="23" fill="yellow" stroke="black" stroke-width="2"/></svg>') 24 24, auto !important;
}

body.show-tooltips [title] {
    position: relative;
}

body.show-tooltips [title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 0.5em;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 0.9em;
}

body.show-structure h1,
body.show-structure h2,
body.show-structure h3,
body.show-structure h4,
body.show-structure h5,
body.show-structure h6 {
    border-left: 4px solid #224099 !important;
    padding-left: 0.5em !important;
    background: rgba(34, 64, 153, 0.1) !important;
}

body.show-structure-strong *[role],
body.show-structure-strong nav,
body.show-structure-strong main,
body.show-structure-strong header,
body.show-structure-strong footer,
body.show-structure-strong section,
body.show-structure-strong article {
    outline: 2px dashed #224099 !important;
    outline-offset: 2px !important;
}

body.line-height-small {
    line-height: 1.3 !important;
}

body.line-height-medium {
    line-height: 1.6 !important;
}

body.line-height-large {
    line-height: 2 !important;
}

body.line-height-medium * {
    line-height: inherit !important;
}

body.line-height-large * {
    line-height: inherit !important;
}

body.text-left * {
    text-align: left !important;
}

body.text-center * {
    text-align: center !important;
}

body.text-justify * {
    text-align: justify !important;
    hyphens: auto !important;
}

body.saturation-low {
    filter: saturate(0.5);
}

body.saturation-none {
    filter: saturate(1);
}

body.saturation-high {
    filter: saturate(1.5);
}