/* ---------- Accessibility widget: floating button + panel ---------- */
.a11y-widget {
    position: fixed;
    bottom: 24px;
    inset-inline-start: 24px;
    z-index: 100000;
}

.a11y-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background-color: var(--hs-primary, #29b6be);
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.a11y-fab:hover {
    background-color: var(--hs-primary-dark, #21959b);
    transform: translateY(-2px);
}

.a11y-fab:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.a11y-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(340px, 100vw);
    background-color: #ffffff;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    background-color: var(--hs-primary, #29b6be);
    color: #ffffff;
}

.a11y-panel-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.a11y-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.a11y-close:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.a11y-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}

.a11y-group {
    margin-bottom: 22px;
}

.a11y-group h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
}

.a11y-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px;
    background-color: #f4f5f7;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.a11y-stepper button {
    flex: 1;
    padding: 8px 0;
    border: none;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #4a5568;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.a11y-stepper button:hover {
    background-color: var(--hs-primary, #29b6be);
    border-color: var(--hs-primary, #29b6be);
    color: #ffffff;
}

.a11y-stepper-value {
    min-width: 48px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

.a11y-toggle-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.a11y-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    font-size: 14px;
    text-align: start;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.a11y-toggle span[class*="fa"] {
    width: 18px;
    text-align: center;
    color: var(--hs-primary, #29b6be);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.a11y-toggle:hover {
    border-color: var(--hs-primary, #29b6be);
}

.a11y-toggle[aria-pressed="true"] {
    background-color: var(--hs-primary, #29b6be);
    border-color: var(--hs-primary, #29b6be);
    color: #ffffff;
}

.a11y-toggle[aria-pressed="true"] span[class*="fa"] {
    color: #ffffff;
}

.a11y-panel-footer {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
}

.a11y-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 0;
    background-color: #f4f5f7;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.a11y-reset:hover {
    background-color: #e2e8f0;
}

.a11y-reading-guide {
    position: fixed;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--hs-primary, #29b6be);
    box-shadow: 0 0 8px rgba(41, 182, 190, 0.6);
    pointer-events: none;
    z-index: 99999;
}

.a11y-reading-guide[hidden] {
    display: none;
}

@media (max-width: 480px) {
    .a11y-widget {
        bottom: 16px;
        inset-inline-start: 16px;
    }

    .a11y-panel {
        width: 100vw;
    }
}

/* ---------- Accessibility widget: applied document-level states ---------- */
html.a11y-high-contrast {
    filter: contrast(1.35);
}

html.a11y-dark-mode {
    filter: invert(1) hue-rotate(180deg);
}

html.a11y-dark-mode img,
html.a11y-dark-mode video,
html.a11y-dark-mode svg,
html.a11y-dark-mode picture,
html.a11y-dark-mode [style*="background-image"] {
    filter: invert(1) hue-rotate(180deg);
}

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

html.a11y-invert-colors {
    filter: invert(1) hue-rotate(180deg);
}

html.a11y-line-height * {
    line-height: 1.9 !important;
}

html.a11y-letter-spacing * {
    letter-spacing: 0.06em !important;
}

html.a11y-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-highlight-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

html.a11y-stop-animations *,
html.a11y-stop-animations *::before,
html.a11y-stop-animations *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
}

html.a11y-big-cursor,
html.a11y-big-cursor a,
html.a11y-big-cursor button {
    cursor: pointer !important;
}

html.a11y-big-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path fill="%2329b6be" stroke="%23000" stroke-width="1" d="M4 2l14 12-6 1-3 6-5-19z"/></svg>') 4 4, auto !important;
}

html.a11y-keyboard-nav :focus-visible {
    outline: 3px solid var(--hs-primary, #29b6be) !important;
    outline-offset: 3px !important;
}
