.a11y-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 0;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
    cursor: pointer;
    z-index: 9999;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.a11y-toggle:hover,
.a11y-toggle:focus-visible {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, .45);
    outline: 3px solid rgba(37, 99, 235, .24);
    outline-offset: 3px;
}

.a11y-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    pointer-events: none;
}

.a11y-panel {
    position: fixed;
    bottom: 88px;
    left: 24px;
    width: min(300px, calc(100vw - 48px));
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 18px 60px rgba(15, 23, 42, .18);
    z-index: 9998;
    display: none;
    direction: rtl;
}

.a11y-panel.open {
    display: block;
}

.a11y-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1e293b;
}

.a11y-option {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 12px;
}

.a11y-option:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.a11y-option label {
    display: block;
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 8px;
    color: #334155;
}

.a11y-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.a11y-btn {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    padding: 7px 10px;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.a11y-btn:hover,
.a11y-btn:focus-visible,
.a11y-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    outline: none;
}

body.a11y-font-large {
    font-size: 112%;
}

body.a11y-font-xl {
    font-size: 125%;
}

body.a11y-contrast {
    background: #000 !important;
    color: #fff !important;
}

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

body.a11y-contrast a,
body.a11y-contrast button {
    color: #ffeb3b !important;
}

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

body.a11y-links a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

@media (max-width: 640px) {
    .a11y-toggle {
        bottom: 16px;
        left: 16px;
    }

    .a11y-panel {
        bottom: 78px;
        left: 16px;
        width: min(300px, calc(100vw - 32px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .a11y-toggle,
    .a11y-btn {
        transition: none;
    }
}
