.klx-a11y-toolbar-button {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.7);
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding: 0;
}

.klx-a11y-toolbar-button svg {
    width: 24px;
    height: 24px;
    fill: #000000;
}

.klx-a11y-toolbar-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: none;
}

.klx-a11y-toolbar-modal-backdrop.is-open {
    display: block;
}

.klx-a11y-toolbar-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.klx-a11y-toolbar-modal.is-open {
    display: flex;
}

.klx-a11y-toolbar-modal__dialog {
    background: #ffffff;
    color: #000000;
    max-width: 420px;
    width: calc(100% - 32px);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 20px 24px 16px;
}

.klx-a11y-toolbar-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.klx-a11y-toolbar-modal__title {
    font-size: 18px;
    margin: 0;
    font-family: var(--wp--preset--font-family--body);
}

.klx-a11y-toolbar-modal__close {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    font-size: 2rem;
}

.klx-a11y-toolbar-modal__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.klx-a11y-toolbar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.klx-a11y-toolbar-toggle__label {
    flex: 1;
}

.klx-a11y-toolbar-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;
}

.klx-switch {
    position: relative;
    display: inline-block;
    width: 100%;
    cursor: pointer;
}

.klx-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.klx-switch-slider {
    position: absolute;
    cursor: pointer;
    right: 0;
    background-color: #d4d4d4;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 999px;
    width: 40px;
    height: 22px;
}

.klx-switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.klx-switch input:checked + .klx-switch-slider {
    background-color: var(--klx-a11y-primary-color, #0b5b60);
}

.klx-switch input:checked + .klx-switch-slider::before {
    transform: translateX(18px);
}

.klx-switch input:focus-visible + .klx-switch-slider {
    outline: var(--klx-a11y-focus-outline-width, 2px) solid var(--klx-a11y-focus-outline-color, #005fcc);
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    .klx-a11y-toolbar-button {
        background-color: #1b1b1b;
        border-color: rgba(255, 255, 255, 0.7);
    }

    .klx-a11y-toolbar-button svg {
        fill: #ffffff;
    }

    .klx-a11y-toolbar-modal__dialog {
        background: #1b1b1b;
        color: #ffffff;
    }

    .klx-a11y-toolbar-modal__close,
    .klx-a11y-toolbar-modal__title {
        color: #ffffff;
    }

    .klx-a11y-toolbar-modal-backdrop {
        background: rgba(0, 0, 0, 0.6);
    }

    .klx-switch-slider {
        background-color: #555555;
    }

    .klx-switch-slider::before {
        background-color: #f5f5f5;
    }
}

/* ============================================================
   Reduce Animations mode (.klx-a11y-reduce-motion)
   Applied when the user activates the "Reduce animations" toggle.
   Mirrors the prefers-reduced-motion: reduce media query as a user-controlled
   class, covering all animation and transition layers site-wide.
   WCAG 2.1 SC 2.2.2 (Pause, Stop, Hide) — Level A
   WCAG 2.1 SC 2.3.3 (Animation from Interactions) — Level AAA
   ============================================================ */

/* Broad rule: all transitions become instant and one-shot animations complete
   immediately. This covers button hover effects, colour transitions, transform
   easing, focus ring transitions, and any other CSS motion on the page. */
.klx-a11y-reduce-motion *,
.klx-a11y-reduce-motion *::before,
.klx-a11y-reduce-motion *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
}

/* klx-animated elements start at opacity:0 and only become visible once
   klx-animation-active is added by JS. Guarantee visibility regardless of
   whether the IntersectionObserver has fired yet (e.g. when the toggle is
   switched mid-session on content below the fold). */
.klx-a11y-reduce-motion .klx-animated {
    opacity: 1 !important;
}

/* Logo slider — infinite scroll must be stopped entirely; the 0.01ms duration
   above would still cause it to loop very fast without this override. */
.klx-a11y-reduce-motion .klx-logo-slider--logos {
    animation: none !important;
}

/* Image-with-markings pulse pointer — infinite pulse, stop completely. */
.klx-a11y-reduce-motion .wp-block-klx-image-with-markings-and-modal__marker {
    animation: none !important;
}

/* Floating buttons — animation: slideIn forwards is the only thing making them
   visible (opacity:0 base + translateX offset). Restore appearance explicitly. */
.klx-a11y-reduce-motion .floating-button {
    opacity: 1 !important;
    transform: none !important;
}