/* ==========================================================================
   Accessibility Widget — portable, self-contained
   Copy this folder to any site and include both files.
   Theme tokens (override per site if needed):
   ========================================================================== */
:root {
  --a11y-navy: #0f172a;
  --a11y-navy-soft: #1e293b;
  --a11y-royal: #2563eb;
  --a11y-royal-dark: #1d4ed8;
  --a11y-gold: #f59e0b;
  --a11y-gold-soft: #fef3c7;
  --a11y-mist: #f8fafc;
  --a11y-ink: #111827;
  --a11y-line: #e2e8f0;
  --a11y-white: #ffffff;
  --a11y-radius: 16px;
  --a11y-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  --a11y-text-scale: 1;
  --a11y-letter-spacing: 0em;
  --a11y-word-spacing: 0em;
  --a11y-line-height: 1.5;
  --a11y-paragraph-width: 100%;
  --a11y-cursor-scale: 1;
  --a11y-dblclick-delay: 0ms;
}

/* OpenDyslexic — loaded only when active */
@font-face {
  font-family: "OpenDyslexic";
  src: url("https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.0/OpenDyslexic-Regular.woff")
    format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Site-wide accessibility effects (applied on <html>)
   -------------------------------------------------------------------------- */

html[class*="a11y-"]:not(.a11y-disable-smooth):not(.a11y-reduce-motion) {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html[class*="a11y-"] {
    scroll-behavior: auto;
  }
}

html.a11y-text-sm {
  --a11y-text-scale: 0.875;
}
html.a11y-text-md {
  --a11y-text-scale: 1;
}
html.a11y-text-lg {
  --a11y-text-scale: 1.125;
}
html.a11y-text-xl {
  --a11y-text-scale: 1.25;
}
html.a11y-text-xxl {
  --a11y-text-scale: 1.5;
}
html.a11y-text-xxxl {
  --a11y-text-scale: 1.75;
}

html[class*="a11y-text-"] {
  font-size: calc(100% * var(--a11y-text-scale));
}

/* Font overrides — ONLY applied when the user explicitly picks a font.
   Default leaves the site's own font untouched (no rule at all). */
html.a11y-font-arial body,
html.a11y-font-arial body * {
  font-family: Arial, Helvetica, sans-serif !important;
}
html.a11y-font-opendyslexic body,
html.a11y-font-opendyslexic body * {
  font-family: "OpenDyslexic", Arial, sans-serif !important;
}

html.a11y-letter-spacing {
  --a11y-letter-spacing: 0.12em;
}
html.a11y-word-spacing {
  --a11y-word-spacing: 0.16em;
}
html.a11y-line-height {
  --a11y-line-height: 2;
}
html.a11y-paragraph-narrow {
  --a11y-paragraph-width: 65ch;
}
html.a11y-paragraph-wide {
  --a11y-paragraph-width: 85ch;
}

html.a11y-letter-spacing body p,
html.a11y-letter-spacing body li,
html.a11y-letter-spacing body span,
html.a11y-letter-spacing body a,
html.a11y-letter-spacing body h1,
html.a11y-letter-spacing body h2,
html.a11y-letter-spacing body h3,
html.a11y-letter-spacing body h4,
html.a11y-letter-spacing body h5,
html.a11y-letter-spacing body h6 {
  letter-spacing: var(--a11y-letter-spacing) !important;
}
html.a11y-word-spacing body p,
html.a11y-word-spacing body li,
html.a11y-word-spacing body span,
html.a11y-word-spacing body a {
  word-spacing: var(--a11y-word-spacing) !important;
}
html.a11y-line-height body p,
html.a11y-line-height body li {
  line-height: var(--a11y-line-height) !important;
}

html.a11y-paragraph-narrow body p,
html.a11y-paragraph-wide body p {
  max-width: var(--a11y-paragraph-width);
}

html.a11y-align-left body p {
  text-align: left !important;
}
html.a11y-align-right body p {
  text-align: right !important;
}
html.a11y-align-center body p {
  text-align: center !important;
}
html.a11y-align-justify body p {
  text-align: justify !important;
}

/* Color modes — filters are applied to BODY (not html) so the widget,
   which is mounted outside <body>, is never inverted/tinted and its
   fixed position stays anchored to the viewport. */
html.a11y-dark-mode body {
  color-scheme: dark;
  filter: invert(1) hue-rotate(180deg);
}
html.a11y-dark-mode body img,
html.a11y-dark-mode body video,
html.a11y-dark-mode body picture,
html.a11y-dark-mode body iframe {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-light-mode body {
  color-scheme: light;
  filter: brightness(1.08) contrast(1.05);
}

html.a11y-high-contrast body {
  filter: contrast(1.4) saturate(1.1);
}
html.a11y-high-contrast body a {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
  font-weight: 600;
}
html.a11y-high-contrast body button,
html.a11y-high-contrast body [role="button"] {
  outline: 2px solid #0f172a !important;
  outline-offset: 2px;
}

html.a11y-negative body {
  filter: invert(1);
}
html.a11y-negative body img,
html.a11y-negative body video {
  filter: invert(1);
}

html.a11y-invert body {
  filter: invert(1) hue-rotate(180deg);
}
html.a11y-invert body img,
html.a11y-invert body video {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-monochrome body {
  filter: grayscale(1);
}
html.a11y-sepia body {
  filter: sepia(0.8);
}
html.a11y-low-saturation body {
  filter: saturate(0.4);
}
html.a11y-high-saturation body {
  filter: saturate(1.8);
}
html.a11y-blue-filter body {
  filter: sepia(0.2) hue-rotate(180deg) saturate(1.2);
}
html.a11y-yellow-filter body {
  filter: sepia(0.4) hue-rotate(10deg) saturate(1.1);
}

/* Color blindness — SVG filters referenced from widget */
html.a11y-protanopia body {
  filter: url("#a11y-filter-protanopia");
}
html.a11y-deuteranopia body {
  filter: url("#a11y-filter-deuteranopia");
}
html.a11y-tritanopia body {
  filter: url("#a11y-filter-tritanopia");
}

/* Highlights */
html.a11y-highlight-links a:not(.a11y-widget a) {
  outline: 3px solid var(--a11y-gold) !important;
  outline-offset: 2px;
  background: var(--a11y-gold-soft) !important;
  text-decoration: underline !important;
}
html.a11y-highlight-buttons button:not(.a11y-widget *),
html.a11y-highlight-buttons [role="button"]:not(.a11y-widget *),
html.a11y-highlight-buttons a.btn:not(.a11y-widget *),
html.a11y-highlight-buttons .button:not(.a11y-widget *) {
  outline: 3px solid var(--a11y-royal) !important;
  outline-offset: 2px;
}
html.a11y-highlight-headings h1:not(.a11y-widget *),
html.a11y-highlight-headings h2:not(.a11y-widget *),
html.a11y-highlight-headings h3:not(.a11y-widget *),
html.a11y-highlight-headings h4:not(.a11y-widget *),
html.a11y-highlight-headings h5:not(.a11y-widget *),
html.a11y-highlight-headings h6:not(.a11y-widget *) {
  outline: 3px solid var(--a11y-gold) !important;
  outline-offset: 4px;
  background: rgba(245, 158, 11, 0.12) !important;
}
html.a11y-highlight-forms input:not(.a11y-widget *),
html.a11y-highlight-forms textarea:not(.a11y-widget *),
html.a11y-highlight-forms select:not(.a11y-widget *) {
  outline: 2px solid var(--a11y-royal) !important;
  outline-offset: 2px;
}
html.a11y-highlight-focus *:focus:not(.a11y-widget *) {
  outline: 4px solid var(--a11y-gold) !important;
  outline-offset: 3px !important;
}
html.a11y-highlight-hover *:hover:not(.a11y-widget):not(.a11y-widget *) {
  outline: 2px dashed var(--a11y-royal) !important;
  outline-offset: 2px;
}
html.a11y-underline-links a:not(.a11y-widget a) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* Reading */
html.a11y-hide-images img:not(.a11y-widget *) {
  visibility: hidden !important;
}
html.a11y-show-alt img:not(.a11y-widget *) {
  font-size: 0.875rem;
  color: var(--a11y-ink);
  background: var(--a11y-mist);
  border: 1px dashed var(--a11y-line);
  padding: 0.5rem;
}
html.a11y-hide-distractions [class*="marquee"]:not(.a11y-widget *),
html.a11y-hide-distractions [class*="animate-"]:not(.a11y-widget *),
html.a11y-hide-distractions .sticky-call:not(.a11y-widget *) {
  opacity: 0.15 !important;
  pointer-events: none !important;
}

/* Cursor sizes */
html.a11y-cursor-large,
html.a11y-cursor-large *:not(.a11y-widget):not(.a11y-widget *) {
  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 fill='%23000' d='M5 3l14 9-6 1-2 7z'/%3E%3C/svg%3E")
      0 0,
    auto !important;
}
html.a11y-cursor-xlarge,
html.a11y-cursor-xlarge *:not(.a11y-widget):not(.a11y-widget *) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M5 3l14 9-6 1-2 7z'/%3E%3C/svg%3E")
      0 0,
    auto !important;
}
html.a11y-cursor-black *:not(.a11y-widget):not(.a11y-widget *) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M5 3l14 9-6 1-2 7z'/%3E%3C/svg%3E")
      0 0,
    auto !important;
}
html.a11y-cursor-white *:not(.a11y-widget):not(.a11y-widget *) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='1' d='M5 3l14 9-6 1-2 7z'/%3E%3C/svg%3E")
      0 0,
    auto !important;
}
html.a11y-cursor-yellow *:not(.a11y-widget):not(.a11y-widget *) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='%23f59e0b' stroke='%23000' stroke-width='1' d='M5 3l14 9-6 1-2 7z'/%3E%3C/svg%3E")
      0 0,
    auto !important;
}
html.a11y-cursor-crosshair *:not(.a11y-widget):not(.a11y-widget *) {
  cursor: crosshair !important;
}
html.a11y-cursor-circle *:not(.a11y-widget):not(.a11y-widget *) {
  cursor: cell !important;
}

/* Large click areas */
html.a11y-large-click a:not(.a11y-widget a),
html.a11y-large-click button:not(.a11y-widget *),
html.a11y-large-click [role="button"]:not(.a11y-widget *) {
  min-height: 48px !important;
  min-width: 48px !important;
  padding: 0.75rem 1rem !important;
}

/* Navigation / focus */
html.a11y-focus-outline *:focus:not(.a11y-widget *) {
  outline: 3px solid var(--a11y-royal) !important;
  outline-offset: 3px !important;
}
html.a11y-tab-highlight *:focus-visible:not(.a11y-widget *) {
  box-shadow: 0 0 0 4px var(--a11y-gold) !important;
}
html.a11y-sticky-focus *:focus:not(.a11y-widget *) {
  outline: 4px solid var(--a11y-gold) !important;
  outline-offset: 4px !important;
  background: rgba(245, 158, 11, 0.15) !important;
}
html.a11y-keyboard-nav *:focus:not(.a11y-widget *) {
  outline: 3px dashed var(--a11y-royal) !important;
}

/* Animations off — pause, don't destroy, so toggling off resumes cleanly */
html.a11y-stop-animations *:not(.a11y-widget):not(.a11y-widget *),
html.a11y-stop-animations *:not(.a11y-widget):not(.a11y-widget *)::before,
html.a11y-stop-animations *:not(.a11y-widget):not(.a11y-widget *)::after {
  animation-play-state: paused !important;
  transition: none !important;
}

/* Pause carousels / marquees only — class-based so it reverses when toggled off */
html.a11y-pause-carousels [class*="carousel"],
html.a11y-pause-carousels [class*="marquee"],
html.a11y-pause-carousels .gallery-marquee,
html.a11y-pause-carousels .reviews-carousel {
  animation-play-state: paused !important;
}
html.a11y-pause-gif img[src$=".gif"]:not(.a11y-widget *) {
  visibility: hidden;
}
html.a11y-pause-gif img[src$=".gif"]:not(.a11y-widget *)::after {
  content: attr(alt);
}
html.a11y-disable-parallax *:not(.a11y-widget *) {
  transform: none !important;
}
html.a11y-disable-smooth-scroll {
  scroll-behavior: auto !important;
}
html.a11y-disable-hover-anim *:not(.a11y-widget *):hover {
  transform: none !important;
}
html.a11y-disable-transition *:not(.a11y-widget):not(.a11y-widget *),
html.a11y-disable-transition *:not(.a11y-widget):not(.a11y-widget *)::before,
html.a11y-disable-transition *:not(.a11y-widget):not(.a11y-widget *)::after {
  transition: none !important;
}
html.a11y-reduce-motion *:not(.a11y-widget):not(.a11y-widget *),
html.a11y-reduce-motion *:not(.a11y-widget):not(.a11y-widget *)::before,
html.a11y-reduce-motion *:not(.a11y-widget):not(.a11y-widget *)::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* Focus mode — gentle dim, no blur */
html.a11y-focus-mode body > * {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
html.a11y-focus-mode body > *:hover,
html.a11y-focus-mode body > *:focus-within {
  opacity: 1;
}

@media (hover: none) and (pointer: coarse) {
  html.a11y-focus-mode body > * {
    opacity: 1;
  }
  html.a11y-focus-mode main {
    opacity: 1;
  }
}

/* Magnifier — subtle zoom anchored to cursor; ring is a separate overlay layer */
html.a11y-magnifier-zoom body {
  transform: scale(1.18);
  transform-origin: var(--a11y-mag-x, 50vw) var(--a11y-mag-y, 50vh);
  transition: transform-origin 0.04s linear;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Widget UI (isolated from site styles)
   -------------------------------------------------------------------------- */

.a11y-widget,
.a11y-widget *,
.a11y-widget *::before,
.a11y-widget *::after {
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, Heebo, sans-serif;
  line-height: 1.4;
  letter-spacing: normal;
  word-spacing: normal;
}

.a11y-widget {
  position: fixed;
  z-index: 2147483646;
  direction: rtl;
  /* Fixed px base so page text-scaling (which changes html font-size)
     never distorts the widget. All widget sizes below use em off this. */
  font-size: 16px;
  line-height: 1.4;
  color: var(--a11y-ink);
  -webkit-font-smoothing: antialiased;
}

.a11y-widget[dir="ltr"] {
  direction: ltr;
}

/* Floating trigger button */
.a11y-widget__trigger {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--a11y-gold);
  background: linear-gradient(135deg, var(--a11y-navy) 0%, var(--a11y-navy-soft) 100%);
  color: var(--a11y-white);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--a11y-shadow), 0 0 0 4px rgba(245, 158, 11, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
  z-index: 2147483647;
  touch-action: none;
}

.a11y-widget__trigger:hover {
  transform: scale(1.06);
  box-shadow: var(--a11y-shadow), 0 0 0 6px rgba(37, 99, 235, 0.2);
}

.a11y-widget__trigger:focus-visible {
  outline: 3px solid var(--a11y-gold);
  outline-offset: 3px;
}

.a11y-widget__trigger:active {
  cursor: grabbing;
}

.a11y-widget__trigger svg {
  width: 30px;
  height: 30px;
  pointer-events: none;
  display: block;
}

.a11y-widget__svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--a11y-royal);
}

.a11y-widget__svg-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.a11y-widget__section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.a11y-widget__section-icon.a11y-widget__svg-icon svg {
  width: 20px;
  height: 20px;
}

.a11y-widget__section-header[aria-expanded="true"] .a11y-widget__section-icon {
  color: var(--a11y-royal-dark);
}

.a11y-widget__section-icon {
  flex-shrink: 0;
}

.a11y-widget__trigger.is-dragging {
  transform: scale(1.08);
  cursor: grabbing;
}

/* Position presets */
.a11y-widget--pos-bottom-right .a11y-widget__trigger {
  bottom: 24px;
  right: 24px;
  left: auto;
  top: auto;
}
.a11y-widget--pos-bottom-left .a11y-widget__trigger {
  bottom: 24px;
  left: 24px;
  right: auto;
  top: auto;
}
.a11y-widget--pos-top-right .a11y-widget__trigger {
  top: 24px;
  right: 24px;
  left: auto;
  bottom: auto;
}
.a11y-widget--pos-top-left .a11y-widget__trigger {
  top: 24px;
  left: 24px;
  right: auto;
  bottom: auto;
}
.a11y-widget--pos-custom .a11y-widget__trigger {
  bottom: auto;
  right: auto;
  left: auto;
  top: auto;
}

/* Panel */
.a11y-widget__panel {
  position: fixed;
  width: min(420px, calc(100vw - 32px));
  max-height: min(85vh, 720px);
  background: var(--a11y-white);
  border: 1px solid var(--a11y-line);
  border-radius: var(--a11y-radius);
  box-shadow: var(--a11y-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
  z-index: 2147483646;
}

.a11y-widget__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.a11y-widget--pos-bottom-right .a11y-widget__panel,
.a11y-widget--pos-top-right .a11y-widget__panel {
  right: 24px;
  left: auto;
}
.a11y-widget--pos-bottom-left .a11y-widget__panel,
.a11y-widget--pos-top-left .a11y-widget__panel {
  left: 24px;
  right: auto;
}
.a11y-widget--pos-bottom-right .a11y-widget__panel,
.a11y-widget--pos-bottom-left .a11y-widget__panel {
  bottom: 92px;
  top: auto;
}
.a11y-widget--pos-top-right .a11y-widget__panel,
.a11y-widget--pos-top-left .a11y-widget__panel {
  top: 92px;
  bottom: auto;
}
.a11y-widget--pos-custom .a11y-widget__panel {
  bottom: auto;
  right: auto;
}

.a11y-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--a11y-navy) 0%, var(--a11y-navy-soft) 100%);
  color: var(--a11y-white);
}

.a11y-widget__title {
  margin: 0;
  font-size: 1.125em;
  font-weight: 700;
}

.a11y-widget__close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--a11y-white);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.a11y-widget__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.a11y-widget__close:focus-visible {
  outline: 2px solid var(--a11y-gold);
  outline-offset: 2px;
}

.a11y-widget__body {
  overflow-y: auto;
  padding: 12px;
  flex: 1;
  background: var(--a11y-mist);
}

.a11y-widget__section {
  background: var(--a11y-white);
  border: 1px solid var(--a11y-line);
  border-radius: calc(var(--a11y-radius) - 4px);
  margin-bottom: 10px;
  overflow: hidden;
}

.a11y-widget__section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--a11y-white);
  border: none;
  cursor: pointer;
  font-size: 0.9375em;
  font-weight: 600;
  color: var(--a11y-navy);
  text-align: inherit;
}

.a11y-widget__section-header:hover {
  background: var(--a11y-gold-soft);
}

.a11y-widget__section-header:focus-visible {
  outline: 2px solid var(--a11y-royal);
  outline-offset: -2px;
}

.a11y-widget__section-header[aria-expanded="true"] {
  background: var(--a11y-royal-soft, #dbeafe);
  color: var(--a11y-royal-dark);
}

.a11y-widget__section-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--a11y-ink);
  opacity: 0.6;
}

.a11y-widget__section-header[aria-expanded="true"] .a11y-widget__section-chevron {
  transform: rotate(180deg);
}

.a11y-widget__section-content {
  display: none;
  padding: 8px 12px 14px;
  border-top: 1px solid var(--a11y-line);
}

.a11y-widget__section-content.is-open {
  display: block;
}

.a11y-widget__profiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0;
}

.a11y-widget__profile-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--a11y-line);
  border-radius: 10px;
  background: var(--a11y-white);
  cursor: pointer;
  text-align: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.a11y-widget__profile-btn:hover {
  border-color: var(--a11y-royal);
  background: #f0f7ff;
}

.a11y-widget__profile-btn:focus-visible {
  outline: 2px solid var(--a11y-royal);
  outline-offset: 2px;
}

.a11y-widget__profile-btn.is-active {
  border-color: var(--a11y-gold);
  background: var(--a11y-gold-soft);
}

.a11y-widget__profile-name {
  font-weight: 600;
  font-size: 0.875em;
  color: var(--a11y-navy);
}

.a11y-widget__profile-desc {
  font-size: 0.8125em;
  color: #475569;
}

.a11y-widget__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.a11y-widget__grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.a11y-widget__toggle,
.a11y-widget__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--a11y-line);
  border-radius: 8px;
  background: var(--a11y-white);
  cursor: pointer;
  font-size: 0.8125em;
  text-align: inherit;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.a11y-widget__toggle:hover,
.a11y-widget__option:hover {
  border-color: var(--a11y-royal);
}

.a11y-widget__toggle:focus-visible,
.a11y-widget__option:focus-visible {
  outline: 2px solid var(--a11y-royal);
  outline-offset: 1px;
}

.a11y-widget__toggle.is-on,
.a11y-widget__option.is-selected {
  border-color: var(--a11y-gold);
  background: var(--a11y-gold-soft);
  font-weight: 600;
}

.a11y-widget__toggle.is-on .a11y-widget__svg-icon {
  color: #b45309;
}

.a11y-widget__toggle-icon {
  flex-shrink: 0;
}

.a11y-widget__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.8125em;
}

.a11y-widget__position-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.a11y-widget__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid var(--a11y-line);
  background: var(--a11y-white);
}

.a11y-widget__action {
  flex: 1;
  min-width: calc(50% - 3px);
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--a11y-line);
  background: var(--a11y-white);
  cursor: pointer;
  font-size: 0.8125em;
  font-weight: 500;
  color: var(--a11y-navy);
  transition: background 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.a11y-widget__action:hover {
  background: var(--a11y-mist);
  border-color: var(--a11y-royal);
}

.a11y-widget__action:focus-visible {
  outline: 2px solid var(--a11y-royal);
  outline-offset: 1px;
}

.a11y-widget__action--primary {
  background: var(--a11y-royal);
  border-color: var(--a11y-royal);
  color: var(--a11y-white);
}

.a11y-widget__action--primary:hover {
  background: var(--a11y-royal-dark);
}

.a11y-widget__action--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.a11y-widget__action--danger:hover {
  background: #fee2e2;
}

.a11y-widget__select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--a11y-line);
  border-radius: 8px;
  background: var(--a11y-white);
  font-size: 0.8125em;
  color: var(--a11y-ink);
  cursor: pointer;
}

.a11y-widget__select:focus-visible {
  outline: 2px solid var(--a11y-royal);
  outline-offset: 1px;
}

.a11y-widget__info {
  font-size: 0.8125em;
  color: #475569;
  padding: 4px 0 8px;
  line-height: 1.5;
}

.a11y-widget__version {
  text-align: center;
  font-size: 0.75em;
  color: #64748b;
  padding: 4px 12px 8px;
}

/* Tooltip */
.a11y-widget__tooltip {
  position: fixed;
  z-index: 2147483647;
  max-width: 280px;
  padding: 10px 14px;
  background: var(--a11y-navy);
  color: var(--a11y-white);
  border-radius: 10px;
  font-size: 0.8125em;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  box-shadow: var(--a11y-shadow);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.a11y-widget__tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.a11y-widget__tooltip strong {
  display: block;
  margin-bottom: 2px;
  color: var(--a11y-gold);
}

/* --------------------------------------------------------------------------
   Overlay layers (JS-injected on <html>, never share class names with toggles)
   -------------------------------------------------------------------------- */

.a11y-layer {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 2147483640;
  will-change: transform;
}

/* Reading mask — horizontal spotlight band; box-shadow dims everything else */
.a11y-layer-reading-mask {
  left: 0;
  right: 0;
  width: 100%;
  height: 72px;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.68);
  border-top: 2px solid rgba(245, 158, 11, 0.45);
  border-bottom: 2px solid rgba(245, 158, 11, 0.45);
}

/* Reading guide — thin gold line */
.a11y-layer-reading-guide {
  left: 0;
  right: 0;
  width: 100%;
  height: 2px;
  background: var(--a11y-gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.55);
}

/* Line highlight — soft blue band */
.a11y-layer-line-highlight {
  left: 0;
  right: 0;
  width: 100%;
  height: 40px;
  background: rgba(37, 99, 235, 0.1);
  border-top: 2px solid rgba(37, 99, 235, 0.45);
  border-bottom: 2px solid rgba(37, 99, 235, 0.45);
}

/* Magnifier ring — transparent lens, no white fill */
.a11y-layer-magnifier-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--a11y-gold);
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.15),
    0 8px 28px rgba(15, 23, 42, 0.22),
    inset 0 0 18px rgba(245, 158, 11, 0.08);
  background: transparent;
}

.a11y-layer-trail-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--a11y-gold);
  pointer-events: none;
  z-index: 2147483639;
  opacity: 0.65;
  will-change: transform, opacity;
}

/* Skip link: off-screen until focused; always in early tab order when in body */
.a11y-skip-link {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483647;
  padding: 12px 24px;
  background: var(--a11y-navy);
  color: var(--a11y-white);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

/* Skip link stays visible when toggle is on */
html.a11y-skip-link-active .a11y-skip-link {
  top: 16px;
}

.a11y-skip-link:focus,
.a11y-skip-link:focus-visible {
  top: 16px;
  outline: 3px solid var(--a11y-gold);
  outline-offset: 2px;
}

/* Highlight paragraph under cursor */
body [data-a11y-para-active] {
  outline: 3px solid var(--a11y-gold) !important;
  outline-offset: 4px;
  background: rgba(245, 158, 11, 0.12) !important;
  border-radius: 4px;
}

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

@media (max-width: 767px) {
  html.a11y-widget-panel-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .a11y-widget {
    font-size: 15px;
  }

  /* Keep the button clear of the site's mobile call bar and phone safe area. */
  .a11y-widget--pos-bottom-right .a11y-widget__trigger,
  .a11y-widget--pos-bottom-left .a11y-widget__trigger {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .a11y-widget--pos-bottom-right .a11y-widget__trigger,
  .a11y-widget--pos-top-right .a11y-widget__trigger {
    right: max(14px, env(safe-area-inset-right, 0px));
  }

  .a11y-widget--pos-bottom-left .a11y-widget__trigger,
  .a11y-widget--pos-top-left .a11y-widget__trigger {
    left: max(14px, env(safe-area-inset-left, 0px));
  }

  .a11y-widget--pos-top-right .a11y-widget__trigger,
  .a11y-widget--pos-top-left .a11y-widget__trigger {
    top: max(14px, env(safe-area-inset-top, 0px));
  }

  .a11y-widget__trigger {
    width: 52px;
    height: 52px;
  }

  .a11y-widget__trigger:hover {
    transform: none;
  }

  /* Mobile bottom sheet: always remains inside the visual viewport. */
  .a11y-widget__panel,
  .a11y-widget--pos-bottom-right .a11y-widget__panel,
  .a11y-widget--pos-bottom-left .a11y-widget__panel,
  .a11y-widget--pos-top-right .a11y-widget__panel,
  .a11y-widget--pos-top-left .a11y-widget__panel,
  .a11y-widget--pos-custom .a11y-widget__panel {
    top: max(8px, env(safe-area-inset-top, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    width: auto;
    max-height: none;
    border-radius: 18px;
    transform: translateY(20px);
  }

  .a11y-widget__panel.is-open {
    transform: translateY(0);
  }

  .a11y-widget__header {
    padding: 13px 15px;
    flex-shrink: 0;
  }

  .a11y-widget__body {
    padding: 8px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .a11y-widget__section {
    margin-bottom: 7px;
  }

  .a11y-widget__section-header {
    min-height: 46px;
    padding: 10px 12px;
  }

  .a11y-widget__section-content {
    padding: 8px 9px 11px;
  }

  .a11y-widget__profiles,
  .a11y-widget__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .a11y-widget__grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .a11y-widget__toggle,
  .a11y-widget__option,
  .a11y-widget__profile-btn {
    min-height: 44px;
  }

  .a11y-widget__footer {
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
  }

  .a11y-widget__action {
    min-height: 44px;
  }
}

/* Hide FAB while the modal panel is open so it cannot sit above the dialog */
html.a11y-widget-panel-open .a11y-widget__trigger {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

:root {
  --a11y-mobile-bottom-clearance: 90;
}

/* Mouse-only controls and hover cards are not useful on touch-only devices. */
@media (hover: none) and (pointer: coarse) {
  .a11y-widget__section[data-section="cursor"],
  .a11y-widget__section[data-section="mouse"] {
    display: none;
  }

  .a11y-widget__tooltip {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-widget__panel,
  .a11y-widget__trigger,
  .a11y-widget__section-chevron,
  .a11y-widget__tooltip {
    transition: none;
  }
}
