/* ===== Accessibility widget (panel UI) ===== */
#a11y-root, #a11y-root * { box-sizing: border-box; }
#a11y-root, #a11y-root *:not(i):not([class*="fa-"]) { font-family: 'Rubik', 'Heebo', Arial, sans-serif; }
#a11y-root { --a11y-brand: #b45309; --a11y-brand-dark: #92400e; --a11y-tint: #fff7ed; --a11y-line: #f1e4d3; }

.a11y-toggle {
    position: fixed; top: 50%; left: 0; transform: translateY(-50%); z-index: 2147483000;
    width: 54px; height: 58px; padding: 0 4px 0 0; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: #b45309; color: #fff; font-size: 30px; line-height: 1;
    border-radius: 0 16px 16px 0; box-shadow: 2px 3px 10px rgba(0,0,0,.25);
    transition: width .15s ease, background .15s ease;
}
.a11y-toggle:hover { background: #92400e; width: 60px; }
.a11y-toggle:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

.a11y-panel {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(380px, 100vw); z-index: 2147483001;
    background: #fff; color: #1c1917; display: flex; flex-direction: column;
    box-shadow: 4px 0 30px rgba(0,0,0,.25); direction: rtl;
    transform: translateX(-105%); transition: transform .25s ease; visibility: hidden;
}
.a11y-panel.is-open { transform: none; visibility: visible; }
.a11y-head {
    background: linear-gradient(135deg, var(--a11y-brand), var(--a11y-brand-dark)); color: #fff;
    padding: 12px 16px; border-radius: 0 0 16px 16px; position: relative; flex: none;
}
.a11y-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.a11y-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 19px; font-weight: 700; }
.a11y-title i { font-size: 22px; }
.a11y-icon-btn { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 6px; line-height: 1; border-radius: 6px; }
.a11y-icon-btn:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
.a11y-body { overflow-y: auto; padding: 16px; flex: 1; }
.a11y-section-title { font-size: 13px; font-weight: 600; color: #78716c; margin: 4px 2px 8px; }
.a11y-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.a11y-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 96px; padding: 10px 6px; border: 1.5px solid var(--a11y-line); border-radius: 10px;
    background: #fff; color: #44403c; cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.25; text-align: center;
    transition: border-color .15s, background .15s, color .15s;
}
.a11y-tile i { font-size: 26px; color: var(--a11y-brand); }
.a11y-tile:hover { border-color: var(--a11y-brand); background: var(--a11y-tint); }
.a11y-tile:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.a11y-tile[aria-pressed="true"] { background: var(--a11y-brand); border-color: var(--a11y-brand); color: #fff; }
.a11y-tile[aria-pressed="true"] i { color: #fff; }
.a11y-scale { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px solid var(--a11y-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 18px; }
.a11y-scale-label { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.a11y-scale-label i { color: var(--a11y-brand); font-size: 18px; }
.a11y-scale-ctrl { display: flex; align-items: center; gap: 8px; }
.a11y-scale-ctrl button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--a11y-brand); color: #fff; font-size: 16px; cursor: pointer; }
.a11y-scale-ctrl button:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.a11y-scale-value { min-width: 46px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.a11y-foot { flex: none; display: flex; flex-direction: column; }
.a11y-reset { background: var(--a11y-brand); color: #fff; border: 0; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.a11y-reset:hover { background: var(--a11y-brand-dark); }
.a11y-reset:focus-visible { outline: 3px solid #1d4ed8; outline-offset: -3px; }
.a11y-note { font-size: 12px; color: #78716c; text-align: center; padding: 8px 12px; background: #fafaf9; }

.a11y-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2147483002; display: flex; align-items: center; justify-content: center; padding: 16px; }
.a11y-modal { background: #fff; color: #1c1917; border-radius: 12px; width: min(520px, 100%); max-height: 80vh; overflow: auto; padding: 20px; direction: rtl; }
.a11y-modal h2 { margin: 0 0 12px; font-size: 20px; }
.a11y-modal ol { margin: 0; padding-right: 20px; }
.a11y-modal li { margin: 6px 0; }
.a11y-modal a { color: #92400e; text-decoration: underline; }
.a11y-modal .a11y-close-modal { margin-top: 16px; background: #b45309; color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; }

.a11y-reading-guide { position: fixed; left: 0; right: 0; height: 14px; pointer-events: none; z-index: 2147482999; background: rgba(217,119,6,.25); border-top: 3px solid #b45309; border-bottom: 3px solid #b45309; display: none; }
.a11y-alt-tip { position: fixed; z-index: 2147483003; max-width: 280px; background: #1c1917; color: #fff; font-size: 14px; padding: 6px 10px; border-radius: 6px; pointer-events: none; display: none; direction: rtl; }
.a11y-speaking { outline: 3px dashed #b45309 !important; outline-offset: 2px; }

/* ===== Effects applied to the page (never to the widget) ===== */
html.a11y-zoomed body > *:not(#a11y-root):not(script):not(style) { zoom: var(--a11y-zoom, 1); }
html.a11y-mono body > *:not(#a11y-root) { filter: grayscale(1); }
html.a11y-contrast body > *:not(#a11y-root) { filter: contrast(1.6); }
html.a11y-mono.a11y-contrast body > *:not(#a11y-root) { filter: grayscale(1) contrast(1.6); }

html.a11y-dark body, html.a11y-dark body *:not(#a11y-root):not(#a11y-root *):not(img):not(video):not(svg):not(svg *) {
    background-color: #000 !important; background-image: none !important; color: #fff !important; border-color: #fff !important;
}
html.a11y-dark body a:not(#a11y-root *) { color: #fde047 !important; }
html.a11y-light body, html.a11y-light body *:not(#a11y-root):not(#a11y-root *):not(img):not(video):not(svg):not(svg *) {
    background-color: #fff !important; background-image: none !important; color: #000 !important; border-color: #000 !important;
    text-shadow: none !important;
}
html.a11y-light body a:not(#a11y-root *) { color: #1d4ed8 !important; }

html.a11y-readable body *:not(#a11y-root *):not(i):not([class*="fa-"]) { font-family: Arial, Helvetica, sans-serif !important; letter-spacing: .02em !important; word-spacing: .08em !important; }
html.a11y-spacing body p:not(#a11y-root *), html.a11y-spacing body li:not(#a11y-root *) { line-height: 2 !important; letter-spacing: .06em !important; word-spacing: .16em !important; }

html.a11y-links body a:not(#a11y-root *) { outline: 2px solid #b45309 !important; outline-offset: 2px; text-decoration: underline !important; text-underline-offset: 3px; background-color: #fef3c7 !important; color: #78350f !important; }
html.a11y-headings body :is(h1,h2,h3,h4,h5,h6):not(#a11y-root *) { outline: 3px solid #1d4ed8 !important; outline-offset: 4px; background-color: #eff6ff !important; color: #1e3a8a !important; }
html.a11y-elements body :is(a,button,input,select,textarea,[role="button"]):not(#a11y-root *):hover,
html.a11y-elements body :is(a,button,input,select,textarea,[role="button"]):not(#a11y-root *):focus { outline: 4px solid #db2777 !important; outline-offset: 2px; }

html.a11y-keyboard *:focus, html.a11y-keyboard *:focus-visible { outline: 4px solid #1d4ed8 !important; outline-offset: 3px !important; box-shadow: 0 0 0 7px #fde68a !important; }
html.a11y-big-targets body :is(a,button,input[type="submit"],input[type="button"],[role="button"]):not(#a11y-root *) { min-height: 44px; min-width: 44px; padding-top: max(.5em, 6px); padding-bottom: max(.5em, 6px); }
html.a11y-big-targets body :is(button,input,select,textarea):not(#a11y-root *) { font-size: max(1.1em, 17px) !important; }
html.a11y-big-cursor, html.a11y-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 4 L6 40 L16 30 L23 45 L30 42 L23 27 L38 27 Z' fill='%23000' stroke='%23fff' stroke-width='3'/%3E%3C/svg%3E") 6 4, auto !important;
}
html.a11y-no-anim *:not(#a11y-root *), html.a11y-no-anim *::before, html.a11y-no-anim *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
html.a11y-alt body img:not(#a11y-root *) { outline: 3px dashed #b45309; outline-offset: 2px; }
html.a11y-alt body img[alt=""]:not(#a11y-root *), html.a11y-alt body img:not([alt]):not(#a11y-root *) { outline-color: #dc2626; }
html.a11y-hide-images body img:not(#a11y-root *) { visibility: hidden !important; }
html.a11y-hide-images body *:not(#a11y-root *) { background-image: none !important; }

@media (prefers-reduced-motion: reduce) { .a11y-panel { transition: none; } }
@media (max-width: 420px) { .a11y-grid { grid-template-columns: repeat(2, 1fr); } }
