/* Floating accessibility launcher and panel */
.a11y-launcher, .a11y-panel, .a11y-reading-guide {
    box-sizing: border-box;
}
.a11y-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    border: 2px solid #4f35ff;
    border-radius: 999px;
    background: #4f35ff;
    color: #fff;
    font: 600 15px/1.2 Arial, sans-serif;
    box-shadow: 0 4px 18px rgb(0 0 0 / 20%);
    cursor: pointer;
}
.a11y-launcher:focus-visible, .a11y-panel button:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 3px;
}
.a11y-launcher span[aria-hidden="true"] { font-size: 20px; }
.a11y-panel {
    position: fixed;
    right: 18px;
    bottom: 78px;
    z-index: 9999;
    width: min(340px, calc(100vw - 24px));
    max-height: min(78vh, 620px);
    overflow: auto;
    background: #fff;
    color: #202124;
    border: 1px solid #dedee7;
    border-radius: 14px;
    box-shadow: 0 10px 35px rgb(0 0 0 / 24%);
    font: 14px/1.45 Arial, sans-serif;
}
.a11y-panel[aria-hidden="true"] { display: none; }
.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px 12px;
    border-bottom: 1px solid #e9e9ef;
}
.a11y-panel-header h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.a11y-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}
.a11y-panel-content { padding: 12px; }
.a11y-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.a11y-option {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 8px 4px;
    border: 1px solid #ececf2;
    border-radius: 10px;
    background: #f8f8fb;
    color: #262631;
    text-align: center;
    font: inherit;
    font-size: 11px;
    line-height: 1.25;
    cursor: pointer;
}
.a11y-option:hover { border-color: #7565ff; background: #f1efff; }
.a11y-option[aria-pressed="true"] {
    border: 2px solid #6246ff;
    background: #ece8ff;
    color: #3821cb;
    box-shadow: inset 0 0 0 1px rgb(98 70 255 / 8%);
}
.a11y-symbol {
    display: block;
    font-size: 23px;
    line-height: 1.1;
    font-weight: 500;
}
.a11y-note { min-height: 2.4em; margin: 12px 2px 8px; color: #555568; font-size: 12px; }
.a11y-reset {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: #ead7ff;
    color: #302043;
    font: 600 13px/1.3 Arial, sans-serif;
    cursor: pointer;
}
.a11y-panel-footer {
    padding: 10px 12px;
    border-top: 1px solid #eeeef3;
    color: #686878;
    font-size: 11px;
    text-align: center;
}
.a11y-reading-guide {
    position: fixed;
    left: 0;
    right: 0;
    top: 35%;
    height: 48px;
    z-index: 9997;
    pointer-events: none;
    border-top: 2px solid #5942ff;
    border-bottom: 2px solid #5942ff;
    background: rgb(255 230 80 / 15%);
}
.a11y-reading-guide[hidden] { display: none !important; }

/* User-selectable page modes */
html.a11y-text-spacing body,
html.a11y-text-spacing body * {
    letter-spacing: .12em !important;
    word-spacing: .16em !important;
}
html.a11y-line-height body,
html.a11y-line-height body * { line-height: 1.8 !important; }
html.a11y-dyslexia body,
html.a11y-dyslexia body * {
    font-family: Arial, Verdana, sans-serif !important;
    font-weight: 500;
}
html.a11y-low-saturation body { filter: saturate(.25); }
html.a11y-invert-colors body { filter: invert(1) hue-rotate(180deg); }
html.a11y-low-saturation.a11y-invert-colors body { filter: saturate(.25) invert(1) hue-rotate(180deg); }
html.a11y-invert-colors img,
html.a11y-invert-colors video,
html.a11y-invert-colors iframe { filter: invert(1) hue-rotate(180deg); }
html.a11y-highlight-links body a {
    background: #fff2a8 !important;
    color: #111 !important;
    outline: 2px solid #a15c00 !important;
    text-decoration: underline !important;
}
html.a11y-large-cursor body,
html.a11y-large-cursor body * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M3 2 L3 25 L9 19 L14 29 L19 26 L14 16 L23 16 Z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 3 2, auto !important; }
html.a11y-hide-images body img,
html.a11y-hide-images body picture,
html.a11y-hide-images body svg:not([aria-hidden="true"]) { visibility: hidden !important; }
html.a11y-pause-animations body *,
html.a11y-pause-animations body *::before,
html.a11y-pause-animations body *::after {
    animation-play-state: paused !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
}
html.a11y-reading-guide-mode { scroll-behavior: auto !important; }
@media (max-width: 480px) {
    .a11y-launcher { right: 12px; bottom: 12px; padding: 11px 13px; }
    .a11y-panel { right: 12px; bottom: 70px; width: min(340px, calc(100vw - 24px)); }
    .a11y-grid { gap: 7px; }
    .a11y-option { min-height: 72px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
