/* EzTax accessibility button and panel (self-contained module).
   Part of the EzTax design: turquoise fill (#1ED6D0) with dark text (#0b0b0d), light paper panel,
   turquoise text only in --a11y-tq-ink (#087370, about 5.2:1 on white).
   All selectors are prefixed with .a11y- / html.a11y-* so nothing leaks into the app.
   Display preferences are applied on <html>: filters/zoom on the root element do not create a containing
   block, so the app's fixed elements (drawer, sheets, gate) keep working. */

#a11y-root { --a11y-tq: #1ED6D0; --a11y-tq-ink: #087370; --a11y-tq-soft: #e6fbfa; --a11y-ink: #0b0b0d;
  --a11y-line: #d5d8dc; --a11y-text: #1d1d1f; --a11y-muted: #4f5560;
  position: fixed; left: calc(14px + env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 1100; direction: rtl; font-family: 'Heebo', 'Segoe UI', Arial, sans-serif; font-size: 16px; line-height: 1.5; color: var(--a11y-text); }
#a11y-root *, #a11y-root *::before, #a11y-root *::after { box-sizing: border-box; }

/* floating button: 52px round target (well above the 44px minimum) */
.a11y-fab { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--a11y-ink); background: var(--a11y-tq); color: var(--a11y-ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  box-shadow: 0 6px 18px rgba(11,11,13,.22); transition: transform .15s ease; }
.a11y-fab:hover { transform: scale(1.05); }
.a11y-fab svg { width: 28px; height: 28px; display: block; }
.a11y-fab:focus-visible, .a11y-panel :focus-visible { outline: 3px solid var(--a11y-ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--a11y-tq); }

/* panel: opens above the button, toward the inside of the page */
.a11y-panel { position: absolute; left: 0; bottom: 64px; width: min(340px, calc(100vw - 28px)); max-height: min(78vh, 620px); overflow-y: auto;
  background: #fff; border: 1px solid var(--a11y-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(11,11,13,.25); padding: 16px; }
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.a11y-title { margin: 0; font-size: 19px; font-weight: 800; color: var(--a11y-ink); }
.a11y-x { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--a11y-line); background: #fff; color: var(--a11y-ink); cursor: pointer; font-size: 22px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.a11y-x:hover { background: var(--a11y-tq-soft); }

.a11y-size { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--a11y-line); border-radius: 14px; margin-bottom: 10px; }
.a11y-size-label { text-align: center; font-weight: 700; }
.a11y-size-label small { display: block; font-weight: 500; color: var(--a11y-muted); font-size: 14px; }
.a11y-step { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--a11y-ink); background: var(--a11y-tq); color: var(--a11y-ink); font-size: 22px; font-weight: 800; cursor: pointer; padding: 0; line-height: 1; }
.a11y-step:disabled { background: #eef0f2; border-color: #9aa0a8; color: #5d636d; cursor: not-allowed; }

.a11y-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-opt { width: 100%; min-height: 64px; border-radius: 14px; border: 1px solid var(--a11y-line); background: #fff; color: var(--a11y-text);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; padding: 10px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.a11y-opt:hover { border-color: var(--a11y-tq-ink); background: var(--a11y-tq-soft); }
.a11y-opt .a11y-state { font-size: 13px; font-weight: 700; color: var(--a11y-muted); }
/* state is written in words ("פעיל" / "כבוי"); colour and border only reinforce it */
.a11y-opt[aria-pressed="true"] { border: 2px solid var(--a11y-ink); background: var(--a11y-tq); color: var(--a11y-ink); }
.a11y-opt[aria-pressed="true"] .a11y-state { color: var(--a11y-ink); }

.a11y-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--a11y-line); }
.a11y-reset { min-height: 44px; border-radius: 12px; border: 2px solid var(--a11y-ink); background: #fff; color: var(--a11y-ink); font: inherit; font-weight: 700; padding: 0 14px; cursor: pointer; }
.a11y-reset:hover { background: var(--a11y-tq-soft); }
.a11y-link { color: var(--a11y-tq-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.a11y-note { margin: 10px 0 0; font-size: 13px; color: var(--a11y-muted); }
.a11y-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- preferences, applied on <html> ---------- */

/* colour filters (combined through custom properties so several can be on at once) */
html.a11y-f { filter: var(--a11y-f-contrast, ) var(--a11y-f-gray, ) var(--a11y-f-invert, ); }
html.a11y-gray { --a11y-f-gray: grayscale(1); }
html.a11y-invert { --a11y-f-invert: invert(1) hue-rotate(180deg); background: #fff; }
html.a11y-invert img, html.a11y-invert video, html.a11y-invert picture, html.a11y-invert [style*="background-image"] { filter: invert(1) hue-rotate(180deg); }

/* high contrast: darker text, visible borders, underlined links, plus a slight contrast boost */
html.a11y-contrast { --a11y-f-contrast: contrast(1.2);
  --text: #000; --muted: #1d1d1f; --line: #1d1d1f; --tq-ink: #00403e; --ok: #064d2d; --bad: #7a0f1f; --warn: #4d3200; --bg: #fff; }
html.a11y-contrast body { color: #000; }
html.a11y-contrast a:not(.a11y-link) { text-decoration: underline !important; }
html.a11y-contrast input, html.a11y-contrast select, html.a11y-contrast textarea, html.a11y-contrast button { border-color: #000; }

/* highlight links */
html.a11y-links a:not(#a11y-root a) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px;
  outline: 2px dashed #0b0b0d; outline-offset: 2px; background-color: #fff6a8 !important; color: #0b0b0d !important; }

/* readable font: plain sans, wider spacing */
html.a11y-font body, html.a11y-font body * { font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif !important; letter-spacing: .02em !important; word-spacing: .12em !important; }
html.a11y-font body p, html.a11y-font body li { line-height: 1.8 !important; }

/* stop animations and transitions */
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* big cursor (data: SVG is allowed by the app CSP img-src) */
html.a11y-cursor, html.a11y-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 3 L6 40 L15 31 L21 45 L28 42 L22 28 L35 28 Z' fill='%230b0b0d' stroke='%23ffffff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important; }
html.a11y-cursor a, html.a11y-cursor button, html.a11y-cursor [role="button"], html.a11y-cursor label, html.a11y-cursor summary { 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 3 L6 40 L15 31 L21 45 L28 42 L22 28 L35 28 Z' fill='%23087370' stroke='%23ffffff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, pointer !important; }

@media (prefers-reduced-motion: reduce) { .a11y-fab { transition: none; } }
@media print { #a11y-root { display: none !important; } }

/* v3 (18.10.2026): same button as the MBZ audience app (round, #087370, white icon, white ring, 16px from the corner).
   The dark teal also stays visible on the turquoise gate panel, where a light turquoise button would disappear. */
/* v4 (18.10.2026, Michael): bottom-RIGHT on every screen (desktop and phone), safe-area aware; the panel opens above it, anchored right. */
#a11y-root { left: auto; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); }
#a11y-root .a11y-panel { left: auto; right: 0; }
.a11y-fab { background: #087370; color: #fff; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.a11y-fab svg { width: 26px; height: 26px; }
.a11y-fab:focus-visible { outline: 3px solid #0b0b0d; outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
html.a11y-contrast .a11y-fab { background: #000; color: #fff; }

/* v4: nothing important may end up under the bottom-right button.
   - the drawer (opens from the right, full height): its last item and its footer line keep clear of the button
   - list sheets on phones (full width, bottom-anchored): the last row can scroll above the button
   - toasts sit above the button row */
.drawer-body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.drawer-foot { padding-inline-start: 84px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
@media (max-width: 759px) { .sheet { padding-bottom: calc(88px + env(safe-area-inset-bottom)); } }
.toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
