/* ---- Menu UI (fixed px so Larger Text can't scale it; isolated from all modes) ---- */
.a11y { position: fixed; bottom: 16px; z-index: 10000; font-size: 16px; pointer-events: none; }

.a11y--bottom-right { right: 16px; }

.a11y--bottom-left  { left: 16px; }

/* wrapper is click-through so footer links underneath aren't blocked */
.a11y__toggle, .a11y__panel { pointer-events: auto; }

.a11y__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; padding: 0; border-radius: 50%;
  background: var(--a11y-accent); color: #fff; border: 2px solid #fff; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.28);
}

.a11y__toggle:hover { background: color-mix(in srgb, var(--a11y-accent) 88%, #000); }

.a11y__btn-icon { width: 26px; height: 26px; }


/* Panel: fixed-height flex column */
.a11y__panel {
  position: fixed; top: 8px; right: 8px; bottom: 8px;
  width: min(376px, calc(100vw - 16px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #f3f5f7; color: #1b232b;
  border-radius: 14px; padding: 0;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  transform-origin: bottom right;
  transition: transform .22s cubic-bezier(.34,1.18,.64,1), opacity .18s ease;
}

.a11y--bottom-left .a11y__panel { left: 8px; right: auto; transform-origin: bottom left; }

.a11y__panel[hidden] { display: none; }

/* Closed state for grow/shrink anim */
.a11y__panel:not(.a11y__panel--open) { opacity: 0; transform: scale(.55); }


/* Header: accent bar with circular badge, title + shortcut, round close */
.a11y__panel-head { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--a11y-accent); color: #fff; }

.a11y__head-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.a11y__panel-title { margin: 0; font-weight: 800; font-size: 22px; line-height: 1.1; color: #fff; font-family: var(--a11y-title-font, inherit); }

.a11y__kbd { align-self: flex-start; font-size: 12px; font-weight: 600; line-height: 1; color: #fff; background: rgba(255,255,255,.22); border-radius: 6px; padding: 3px 7px; white-space: nowrap; }

/* touch-primary: no keyboard, hide shortcut hint */
@media (pointer: coarse) { .a11y[data-a11y-menu] .a11y__kbd { display: none; }
}

.a11y__close {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); cursor: pointer; line-height: 1;
}

.a11y__close:hover { background: rgba(255,255,255,.16); }

.a11y__close svg { width: 16px; height: 16px; }

/* Focus ring: the menu accent by default; white inside the accent header/footer bars */
.a11y[data-a11y-menu] :focus-visible { outline: 3px solid var(--a11y-accent) !important; outline-offset: 2px !important; }

.a11y[data-a11y-menu] .a11y__panel-head :focus-visible,
.a11y[data-a11y-menu] .a11y__footer :focus-visible { outline-color: #fff !important; }


/* Status strip: adjustments counter + Reset all (accent-tinted via .--on in JS) */
.a11y__status { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 18px; background: #fff; border-bottom: 1px solid #e7ebef; transition: background .15s ease, border-color .15s ease; }

.a11y__status--on { background: color-mix(in srgb, var(--a11y-accent) 8%, #fff); border-bottom-color: color-mix(in srgb, var(--a11y-accent) 14%, #e7ebef); }

.a11y__status-count { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #1b232b; }

.a11y__status-ico { display: inline-flex; color: #9aa2ab; transition: color .15s ease; }

.a11y__status--on .a11y__status-ico { color: #15803d; }
 /* active = success green, intentionally theme-independent */
.a11y__status-ico svg { width: 20px; height: 20px; }

.a11y__resetall { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; font-size: 14px; color: var(--a11y-accent); background: none; border: 0; padding: 4px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.a11y__resetall svg { width: 18px; height: 18px; }

.a11y__resetall:hover { color: color-mix(in srgb, var(--a11y-accent) 80%, #000); }


/* Scrolling body: positioning context for overscroll shadow + scroll indicator */
.a11y__body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }

.a11y__body::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 24px;
  background: linear-gradient(to top, rgba(0,0,0,.16), rgba(0,0,0,0));
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}

.a11y__body.is-over-bottom::after { opacity: 1; }

.a11y__sections { flex: 1 1 auto; min-height: 0; width: 100%; overflow-y: auto; padding: 12px 16px 16px; scrollbar-width: none; }

.a11y__sections::-webkit-scrollbar { width: 0; height: 0; }

/* Custom scroll indicator (visual only) */
.a11y__sb {
  position: absolute; top: 6px; bottom: 6px; right: 5px; width: 6px; display: block;
  border-radius: 999px; background: rgba(0,0,0,.06);
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}

.a11y__body.is-scrollable .a11y__sb { opacity: 1; }

.a11y__sb-thumb {
  position: absolute; left: 0; right: 0; top: 0; display: block; width: 100%;
  min-height: 24px; border-radius: 999px; background: var(--a11y-accent);
}


/* Sections (Vision / Text & Reading / Navigation & Motion) */
.a11y__section { margin: 0 0 16px; padding: 14px 14px 6px; background: #fff; border: 1px solid #e4e9ee; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }

.a11y__section:last-child { margin-bottom: 4px; }

.a11y__section-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }

.a11y__section-icon { display: inline-flex; color: var(--a11y-accent); }

.a11y__section-icon svg { width: 22px; height: 22px; }

.a11y__section-title { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--a11y-accent); }


/* Rows */
.a11y__row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-radius: 10px; }

.a11y__row + .a11y__row { border-top: 1px solid #eef1f4; }

.a11y__row--toggle { cursor: pointer; user-select: none; -webkit-user-select: none; }

.a11y__row--toggle:hover { background: color-mix(in srgb, var(--a11y-accent) 5%, #fff); }

.a11y__row--seg { display: block; padding: 12px 4px; }

.a11y__row-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }

.a11y__row-icon { flex: 0 0 auto; display: inline-flex; color: var(--a11y-accent); }

.a11y__row-icon svg { width: 24px; height: 24px; }

.a11y__row-label { flex: 1 1 auto; font-size: 15px; font-weight: 600; line-height: 1.25; color: #1b232b; }

/* OpenDyslexic "Aa" preview chip (label stays in UI font) */
.a11y__dys-chip { display: inline-flex; align-items: center; margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--a11y-accent) 12%, #fff); color: var(--a11y-accent); font-family: "OpenDyslexic", system-ui, sans-serif; font-weight: 700; font-size: 12px; line-height: 1.4; }


/* On/off toggle switch (input is visually hidden; the track/knob follow it) */
.a11y__sw-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.a11y__sw { flex: 0 0 auto; position: relative; width: 46px; height: 26px; border-radius: 999px; background: #c9ced3; transition: background .15s ease; }

.a11y__sw-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s ease; }

.a11y__sw-input:checked ~ .a11y__sw { background: var(--a11y-accent); }

.a11y__sw-input:checked ~ .a11y__sw .a11y__sw-knob { transform: translateX(20px); }

.a11y__sw-input:focus-visible ~ .a11y__sw { outline: 3px solid var(--a11y-accent); outline-offset: 2px; }


/* Segmented multi-option controls (contrast / saturation / cursor); re-click active = off */
.a11y__seg2 { display: flex; gap: 0; }

.a11y__seg2-opt { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; text-align: center; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.15; color: #1b232b; background: #fff; border: 1.5px solid #d3d9df; border-right-width: 0; border-radius: 0; padding: 9px 6px; min-height: 46px; cursor: pointer; transition: background .12s ease, color .12s ease; }

.a11y__seg2-opt:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }

.a11y__seg2-opt:last-child { border-right-width: 1.5px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; }

.a11y__seg2-opt:hover { background: color-mix(in srgb, var(--a11y-accent) 8%, #fff); }

.a11y__seg2-opt:focus-visible { outline: 3px solid var(--a11y-accent); outline-offset: 2px; position: relative; }

/* check marks active option (not colour alone); aria-pressed synced in JS */
.a11y__seg2-opt[aria-pressed="true"]::before { content: "\2713"; margin-right: 5px; font-weight: 900; }

.a11y__seg2[data-state="dark"]   [data-a11y-cycle-opt="dark"],
.a11y__seg2[data-state="invert"] [data-a11y-cycle-opt="invert"],
.a11y__seg2[data-state="low"]    [data-a11y-saturate-opt="low"],
.a11y__seg2[data-state="high"]   [data-a11y-saturate-opt="high"],
.a11y__seg2[data-state="grey"]   [data-a11y-saturate-opt="grey"],
.a11y__seg2[data-state="big"]    [data-a11y-cursor-opt="big"],
.a11y__seg2[data-state="mask"]   [data-a11y-cursor-opt="mask"],
.a11y__seg2[data-state="guide"]  [data-a11y-cursor-opt="guide"] {
  background: var(--a11y-accent); border-color: var(--a11y-accent); color: #fff;
}

/* Menu-position picker - segmented control (radios) */
.a11y__seg { display: flex; gap: 3px; padding: 3px; background: #fff; border: 1px solid #d3d9df; border-radius: 999px; }

.a11y__seg-opt { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; font-weight: 700; padding: 8px 3px; border-radius: 999px; cursor: pointer; user-select: none; -webkit-user-select: none; }

.a11y__seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.a11y__seg-opt:has(input:checked) { background: var(--a11y-accent); color: #fff; }

.a11y__seg-opt:has(input:focus-visible) { outline: 3px solid var(--a11y-accent); outline-offset: 2px; }


/* Footer: accent bar with the MDW bug (logo + tagline) and a Help link */
.a11y__footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; background: var(--a11y-accent); }

.a11y__bug { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: #fff; }

.a11y__bug-logo { height: 22px; width: auto; flex: 0 0 auto; color: #fff; }

.a11y__bug-tag { display: flex; flex-direction: column; font-size: 11px; line-height: 1.3; color: rgba(255,255,255,.9); }

.a11y__bug-by { font-weight: 700; color: #fff; }

/* Cursor tools (page-level; toggled on <html> by mdw-a11y.js) */
html.a11y-cursor-big, html.a11y-cursor-big * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 3l14 8-6.5 1.4L16 19.5l-2.6 1.1-3.4-7L5 19z' fill='%23fff' stroke='%23111' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important; }

.a11y-guide { position: fixed; left: 0; right: 0; height: 0; border-top: 5px solid var(--a11y-cursor-accent, #1b232b); box-shadow: 0 0 0 1.5px rgba(255,255,255,.75), 0 3px 8px rgba(0,0,0,.4); pointer-events: none; z-index: 9999; }

.a11y-mask-panel { position: fixed; left: 0; right: 0; background: rgba(13,18,26,.6); pointer-events: none; z-index: 9998; }

.a11y-mask-top { top: 0; box-shadow: inset 0 -3px 0 var(--a11y-cursor-accent, #1b232b); }

.a11y-mask-bottom { bottom: 0; box-shadow: inset 0 3px 0 var(--a11y-cursor-accent, #1b232b); }

/* ---- MENU ISOLATION: modes must not reach inside the menu ---- */
.a11y[data-a11y-menu], .a11y[data-a11y-menu] * {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
  letter-spacing: normal !important; word-spacing: normal !important; line-height: normal !important;
}

.a11y[data-a11y-menu] .a11y__dys-chip { font-family: "OpenDyslexic", system-ui, sans-serif !important; }

.a11y[data-a11y-menu] { filter: none !important; }

/* keep menu icons visible under hide-images */
html.a11y-hide-images .a11y[data-a11y-menu] svg { display: inline-block !important; }


/* Florida Early Vote integration. Keep map rendering and preference controls intact. */
.a11y { --a11y-accent:#0A3161; bottom:max(16px,env(safe-area-inset-bottom)); }
.a11y__close { width:44px; height:44px; }
.a11y__resetall { min-height:44px; }
.a11y__seg-opt { min-height:44px; }
.a11y__panel-title { font-size:20px; }
.a11y__panel { border:1px solid #d3d9df; }
.a11y__sections { overscroll-behavior:contain; }
.a11y__row-label { min-width:0; overflow-wrap:anywhere; }
.a11y__seg2-opt { overflow-wrap:anywhere; }
.a11y__status-count { flex-wrap:wrap; }
.a11y__status-count [data-a11y-count-text] { flex:1; }
@font-face { font-family:OpenDyslexic; font-style:normal; font-weight:400; font-display:swap; src:url('./opendyslexic-400.woff2') format('woff2'); }
@font-face { font-family:OpenDyslexic; font-style:normal; font-weight:700; font-display:swap; src:url('./opendyslexic-700.woff2') format('woff2'); }
html.a11y-text-lg { font-size:125%; }
html.a11y-dyslexia body :is(h1,h2,h3,h4,h5,h6,p,li,a,span,blockquote,label,input,button,select):not(:where(.a11y *,#map *)) { font-family:OpenDyslexic,system-ui,sans-serif!important; }
html.a11y-spacing body :is(h1,h2,h3,h4,h5,h6,p,li,a,span,blockquote,label,input,button,select):not(:where(.a11y *,#map *)) { letter-spacing:.12em!important; word-spacing:.16em!important; }
html.a11y-line-height body :is(h1,h2,h3,h4,h5,h6,p,li,blockquote,label):not(:where(.a11y *,#map *)) { line-height:2!important; }
html.a11y-reduce-motion, html.a11y-reduce-motion *, html.a11y-reduce-motion *::before, html.a11y-reduce-motion *::after { animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important; scroll-behavior:auto!important; }
html.a11y-hide-images :is(img,picture,video):not(:where(#map *, .a11y *, button *, [role=button] *)) { display:none!important; }
html.a11y-hide-images [data-decorative-bg] { background-image:none!important; }
.a11y-alt { display:none; font-style:italic; padding:4px 6px; }
html.a11y-hide-images .a11y-alt { display:inline-block; }
html.a11y-underline-links a:not(.a11y *) { text-decoration:underline!important; text-decoration-thickness:2px!important; text-underline-offset:3px!important; }
html.a11y-contrast body { background:#000!important; color:#fff!important; }
html.a11y-contrast body :is(header,main,footer,section,article,aside,nav,form,a,blockquote,figure,ul,ol,li,dl,dd,table,div):not(:where(.a11y,.a11y *,#map,#map *,.a11y-mask-panel,.a11y-guide)) { background-color:#000!important; background-image:none!important; }
html.a11y-contrast body :is(h1,h2,h3,h4,h5,h6,p,li,span,label,blockquote,figcaption,td,th,dt,dd,strong,em,small):not(:where(.a11y *,#map *)) { color:#fff!important; }
html.a11y-contrast body a:not(:where(.a11y *,#map *)),html.a11y-contrast body a :not(:where(.a11y *,#map *)) { color:#ff0!important; text-decoration:underline!important; }
html.a11y-contrast body :is(button,.btn):not(:where(.a11y *,#map *)) { background:#ff0!important; color:#000!important; border:2px solid #ff0!important; }
html.a11y-contrast body :is(button,.btn) :not(:where(.a11y *,#map *)) { color:#000!important; }
html.a11y-contrast body :is(input,select,textarea):not(.a11y *) { background:#000!important; color:#fff!important; border:2px solid #fff!important; }
html.a11y-contrast body input::placeholder { color:#ddd!important; }
html.a11y-contrast :focus-visible { outline:3px solid #ff0!important; outline-offset:3px; }
html.a11y-contrast :is(.finder-backdrop,.closing-band)::before,html.a11y-contrast :is(.finder-backdrop,.closing-band)::after { background:none!important; }
html.a11y-invert { --fev-invert:invert(1) hue-rotate(180deg); }
html.a11y-saturate-low { --fev-saturate:saturate(.5); }
html.a11y-saturate-high { --fev-saturate:saturate(1.6); }
html.a11y-saturate-grey { --fev-saturate:saturate(0); }
html:is(.a11y-invert,.a11y-saturate-low,.a11y-saturate-high,.a11y-saturate-grey) body > :not(.a11y,.a11y-mask-panel,.a11y-guide,script,style,link) { filter:var(--fev-invert,brightness(1)) var(--fev-saturate,saturate(1)); }
html.a11y-invert body { background:#11151a; }
html.a11y-invert :is(img,video):not(.a11y *) { filter:invert(1) hue-rotate(180deg); }
@media (prefers-reduced-motion:reduce) { .a11y *, .a11y *::before { transition:none!important; animation:none!important; } }
@media print { .a11y,.a11y-guide,.a11y-mask-panel { display:none!important; } }
