/* ============================================================
   ACCESSIBILITY WIDGET v2 — accessibility-widget.css
   Colour palette: blue (#1a73e8) and white only.
   All class names prefixed "a11y-" to avoid conflicts.
   ============================================================ */

/* ---------- Design tokens ---------- */
.a11y-root {
  --a11y-blue:         #1a73e8;
  --a11y-blue-mid:     #1a5fc7;
  --a11y-blue-dark:    #1045a0;
  --a11y-blue-soft:    #eef4ff;
  --a11y-blue-border:  #c7d9f8;
  --a11y-blue-hover:   #ddeeff;
  --a11y-white:        #ffffff;
  --a11y-text:         #0f1f3d;
  --a11y-text-mid:     #3d5275;
  --a11y-text-muted:   #7a90b0;
  --a11y-divider:      #dce8fb;
  --a11y-radius-sm:    8px;
  --a11y-radius-md:    12px;
  --a11y-radius-lg:    18px;
  --a11y-shadow:       0 8px 32px rgba(26,115,232,.18), 0 2px 8px rgba(26,115,232,.08);
  --a11y-shadow-btn:   0 4px 16px rgba(26,115,232,.4);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  box-sizing: border-box;
}
.a11y-root *, .a11y-root *::before, .a11y-root *::after {
  box-sizing: inherit;
  font-family: inherit;
  animation-play-state: running !important;
  filter: none !important;
}

/* ---------- Floating trigger ---------- */
.a11y-trigger {
  position: fixed;
  left: 24px;
  bottom: 32px;
  z-index: 2147483646;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--a11y-blue);
  color: var(--a11y-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--a11y-shadow-btn);
  transition: background 0.18s, transform 0.15s;
  outline: none;
  position: fixed;
}
.a11y-trigger:hover  { background: var(--a11y-blue-mid); transform: scale(1.07); }
.a11y-trigger:focus-visible { outline: 3px solid var(--a11y-blue-border); outline-offset: 3px; }
.a11y-trigger svg { width: 26px; height: 26px; pointer-events: none; }

/* Badge */
.a11y-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--a11y-blue-dark);
  color: var(--a11y-white);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--a11y-white);
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.a11y-badge--visible { opacity: 1; transform: scale(1); }

/* ---------- Panel ---------- */
.a11y-panel {
  position: fixed;
  right: 88px;
  bottom: 32px;
  z-index: 2147483647;
  width: 340px;
  max-height: 86vh;
  border-radius: var(--a11y-radius-lg);
  background: var(--a11y-white);
  box-shadow: var(--a11y-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.a11y-panel--open {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

/* ---------- Header ---------- */
.a11y-header {
  background: var(--a11y-blue);
  padding: 14px 14px 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.a11y-header-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--a11y-white);
}
.a11y-header-icon svg { width: 18px; height: 18px; }
.a11y-header-title { flex: 1; min-width: 0; }
.a11y-header-title h2 {
  margin: 0;
  font-size: 15px; font-weight: 700;
  color: var(--a11y-white);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Reset All — lives in header */
.a11y-reset-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 11px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.15);
  color: var(--a11y-white);
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  outline: none;
  flex-shrink: 0;
}
.a11y-reset-btn:hover { background: rgba(255,255,255,0.28); border-color: rgba(255,255,255,0.7); }
.a11y-reset-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.8); outline-offset: 2px; }
.a11y-reset-btn svg { width: 12px; height: 12px; }

/* Close button */
.a11y-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: var(--a11y-white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  outline: none;
}
.a11y-close:hover { background: rgba(255,255,255,0.28); }
.a11y-close:focus-visible { outline: 2px solid rgba(255,255,255,0.8); outline-offset: 2px; }
.a11y-close svg { width: 13px; height: 13px; }

/* Active count pill */
.a11y-count-pill {
  display: none;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.22);
  color: var(--a11y-white);
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.a11y-count-pill--on { display: block; }

/* ---------- Scrollable body ---------- */
.a11y-body {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--a11y-blue-border) transparent;
}
.a11y-body::-webkit-scrollbar { width: 4px; }
.a11y-body::-webkit-scrollbar-thumb { background: var(--a11y-blue-border); border-radius: 4px; }

/* ---------- Profile preset row ---------- */
.a11y-profiles-wrap {
  position: relative;
  border-bottom: 1px solid var(--a11y-divider);
  background: var(--a11y-blue-soft);
  flex-shrink: 0;
}
/* Gradient fade on right edge — hints that more cards exist */
.a11y-profiles-wrap::after {
  content: "";
  position: absolute;
  right: 34px; top: 0; bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--a11y-blue-soft));
  pointer-events: none;
  z-index: 2;
}
/* Hide right fade when scrolled to end */
.a11y-profiles-wrap.a11y-at-end::after { display: none; }

.a11y-profiles {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 10px 11px 14px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}
.a11y-profiles::-webkit-scrollbar { display: none; }

/* Scroll arrow buttons — minimal, integrated style */
.a11y-scroll-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--a11y-blue);
  color: var(--a11y-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.15s, background 0.15s;
  outline: none;
  box-shadow: 0 2px 8px rgba(26,115,232,0.35);
}
.a11y-scroll-btn svg { width: 11px; height: 11px; stroke-width: 3; }
.a11y-scroll-btn--left  { left:  6px; }
.a11y-scroll-btn--right { right: 6px; }
.a11y-scroll-btn--visible { opacity: 1; pointer-events: auto; }
.a11y-scroll-btn:hover {
  background: var(--a11y-blue-mid);
  transform: translateY(-50%) scale(1.12);
}
.a11y-scroll-btn:focus-visible { outline: 2px solid var(--a11y-white); outline-offset: 2px; }

.a11y-profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 10px 8px;
  border-radius: var(--a11y-radius-sm);
  border: 1.5px solid var(--a11y-blue-border);
  background: var(--a11y-white);
  color: var(--a11y-text);
  cursor: pointer;
  flex-shrink: 0;
  min-width: 68px;
  scroll-snap-align: start;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  outline: none;
  text-align: center;
}
.a11y-profile-btn:hover { background: var(--a11y-blue-hover); border-color: var(--a11y-blue); }
.a11y-profile-btn:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-profile-btn svg  { width: 20px; height: 20px; }
.a11y-profile-btn span { font-size: 10px; font-weight: 600; line-height: 1.25; color: var(--a11y-text-mid); }
.a11y-profile-btn[aria-pressed="true"] {
  background: var(--a11y-blue);
  border-color: var(--a11y-blue);
  color: var(--a11y-white);
}
.a11y-profile-btn[aria-pressed="true"] span { color: var(--a11y-white); }

/* ---------- Section ---------- */
.a11y-section {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--a11y-divider);
}
.a11y-section:last-child { border-bottom: none; }

.a11y-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.a11y-section-head span {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--a11y-blue);
}
.a11y-section-head svg { width: 12px; height: 12px; color: var(--a11y-blue); flex-shrink: 0; }

/* ---------- 2-column grid ---------- */
.a11y-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.a11y-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }

/* ---------- Stepper card ---------- */
.a11y-stepper-card {
  background: var(--a11y-blue-soft);
  border: 1.5px solid var(--a11y-blue-border);
  border-radius: var(--a11y-radius-md);
  padding: 10px 10px 9px;
}
.a11y-stepper-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  color: var(--a11y-text-mid);
  margin-bottom: 7px;
}
.a11y-stepper-label svg { width: 13px; height: 13px; color: var(--a11y-blue); }
.a11y-stepper-row {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.a11y-step-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--a11y-blue);
  color: var(--a11y-white);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  outline: none;
}
.a11y-step-btn:hover  { background: var(--a11y-blue-mid); }
.a11y-step-btn:active { transform: scale(0.92); }
.a11y-step-btn:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-step-btn:disabled { background: var(--a11y-blue-border); cursor: not-allowed; }
.a11y-step-val {
  flex: 1; text-align: center;
  font-size: 11.5px; font-weight: 700;
  color: var(--a11y-blue);
}

/* ---------- Toggle card ---------- */
.a11y-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 8px 11px;
  border-radius: var(--a11y-radius-md);
  border: 1.5px solid var(--a11y-blue-border);
  background: var(--a11y-blue-soft);
  color: var(--a11y-text);
  cursor: pointer;
  text-align: center;
  min-height: 72px;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
  outline: none;
  -webkit-user-select: none; user-select: none;
}
.a11y-card:hover  { background: var(--a11y-blue-hover); border-color: var(--a11y-blue); }
.a11y-card:active { transform: scale(0.96); }
.a11y-card:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-card svg  { width: 20px; height: 20px; color: var(--a11y-blue-mid); transition: color 0.15s; }
.a11y-card span { font-size: 11.5px; font-weight: 600; color: var(--a11y-text-mid); line-height: 1.25; transition: color 0.15s; }
/* Active */
.a11y-card[aria-pressed="true"] {
  background: var(--a11y-blue);
  border-color: var(--a11y-blue);
}
.a11y-card[aria-pressed="true"] svg  { color: var(--a11y-white); }
.a11y-card[aria-pressed="true"] span { color: var(--a11y-white); }

/* ---------- Text align group ---------- */
.a11y-align-row {
  display: flex; gap: 6px;
  margin-top: 7px;
}
.a11y-align-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 9px 6px 8px;
  border-radius: var(--a11y-radius-sm);
  border: 1.5px solid var(--a11y-blue-border);
  background: var(--a11y-blue-soft);
  color: var(--a11y-text-mid);
  cursor: pointer;
  font-size: 10.5px; font-weight: 600;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  outline: none;
}
.a11y-align-btn svg { width: 15px; height: 15px; color: var(--a11y-blue-mid); }
.a11y-align-btn:hover { background: var(--a11y-blue-hover); border-color: var(--a11y-blue); }
.a11y-align-btn:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-align-btn[aria-pressed="true"] {
  background: var(--a11y-blue); border-color: var(--a11y-blue);
  color: var(--a11y-white);
}
.a11y-align-btn[aria-pressed="true"] svg { color: var(--a11y-white); }

/* ---------- Colour palette ---------- */
.a11y-palette-block {
  margin-top: 7px;
  background: var(--a11y-blue-soft);
  border: 1.5px solid var(--a11y-blue-border);
  border-radius: var(--a11y-radius-md);
  padding: 10px 11px 9px;
}
.a11y-palette-title {
  font-size: 10.5px; font-weight: 600;
  color: var(--a11y-text-muted);
  margin-bottom: 7px; display: block;
}
.a11y-palette-row {
  display: flex; gap: 5px; align-items: center; flex-wrap: wrap;
}
.a11y-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  outline: none; flex-shrink: 0;
}
.a11y-swatch:hover { transform: scale(1.2); }
.a11y-swatch:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-swatch[aria-pressed="true"] {
  border-color: var(--a11y-blue);
  box-shadow: 0 0 0 3px var(--a11y-blue-soft);
  transform: scale(1.2);
}
.a11y-swatch-reset {
  padding: 0 9px;
  height: 22px;
  border-radius: 11px;
  border: 1.5px solid var(--a11y-blue-border);
  background: var(--a11y-white);
  color: var(--a11y-text-muted);
  font-size: 10.5px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  outline: none;
}
.a11y-swatch-reset:hover { background: var(--a11y-blue-hover); }
.a11y-swatch-reset:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }

/* ---------- Footer (status only) ---------- */
.a11y-footer {
  padding: 7px 14px 9px;
  text-align: center;
  font-size: 10px;
  color: var(--a11y-text-muted);
  border-top: 1px solid var(--a11y-divider);
  flex-shrink: 0;
  background: var(--a11y-blue-soft);
}

/* =============================================================
   GLOBAL PAGE OVERRIDES
   ============================================================= */

/* High Contrast */
html[data-a11y-colour="high-contrast"] body *:not([class*="a11y-"]) {
  background-color: #000 !important; color: #ffff00 !important; border-color: #ffff00 !important;
}
html[data-a11y-colour="high-contrast"] body a:not([class*="a11y-"]) { color: #00ffff !important; }

/* Dark */
html[data-a11y-colour="dark"] body *:not([class*="a11y-"]) {
  background-color: #121212 !important; color: #e0e0e0 !important; border-color: #2d2d2d !important;
}
html[data-a11y-colour="dark"] body a:not([class*="a11y-"]) { color: #90caf9 !important; }
html[data-a11y-colour="dark"] body img:not([class*="a11y-"]) { filter: brightness(0.82) !important; }

/* Light */
html[data-a11y-colour="light"] body *:not([class*="a11y-"]) {
  background-color: #fffef0 !important; color: #1a1a00 !important;
}
html[data-a11y-colour="light"] body a:not([class*="a11y-"]) { color: #0000cc !important; }

/* Monochrome / Hi-Sat / Lo-Sat
   Applied to body's DIRECT CHILDREN (not body itself) so the widget's
   fixed positioning is not broken by a filter stacking context. */
html[data-a11y-colour="mono"]   body > *:not(.a11y-root) { filter: grayscale(100%) !important; }
html[data-a11y-colour="hi-sat"] body > *:not(.a11y-root) { filter: saturate(200%) !important; }
html[data-a11y-colour="lo-sat"] body > *:not(.a11y-root) { filter: saturate(50%)  !important; }

/* Readable font */
html[data-a11y-font="on"] body *:not([class*="a11y-"]) {
  font-family: Arial, Verdana, Geneva, sans-serif !important;
}

/* Highlight links */
html[data-a11y-links="on"] body a:not([class*="a11y-"]) {
  background: #fff176 !important; color: #000 !important;
  text-decoration: underline !important;
  outline: 2px solid #f9ab00 !important;
  border-radius: 2px; padding: 0 2px;
}

/* Highlight titles */
html[data-a11y-titles="on"] body h1:not([class*="a11y-"]),
html[data-a11y-titles="on"] body h2:not([class*="a11y-"]),
html[data-a11y-titles="on"] body h3:not([class*="a11y-"]),
html[data-a11y-titles="on"] body h4:not([class*="a11y-"]),
html[data-a11y-titles="on"] body h5:not([class*="a11y-"]),
html[data-a11y-titles="on"] body h6:not([class*="a11y-"]) {
  background: #e8f0fe !important; outline: 2px solid #1a73e8 !important;
  padding: 2px 6px !important; border-radius: 4px;
}

/* Pause animations */
html[data-a11y-anim="paused"] body *:not([class*="a11y-"]) {
  animation-play-state: paused !important; transition: none !important;
}

/* Highlight focus */
html[data-a11y-focus="on"] body *:not([class*="a11y-"]):focus {
  outline: 3px solid #1a73e8 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(26,115,232,0.2) !important;
}

/* Highlight hover */
html[data-a11y-hover="on"] body *:not([class*="a11y-"]):hover {
  outline: 2px solid #1a73e8 !important; outline-offset: 2px !important;
}

/* Text align */
html[data-a11y-align="left"]   body *:not([class*="a11y-"]) { text-align: left   !important; }
html[data-a11y-align="center"] body *:not([class*="a11y-"]) { text-align: center !important; }
html[data-a11y-align="right"]  body *:not([class*="a11y-"]) { text-align: right  !important; }

/* Hide images */
html[data-a11y-images="hidden"] body img:not([class*="a11y-"]),
html[data-a11y-images="hidden"] body picture:not([class*="a11y-"]) { visibility: hidden !important; }

/* Read mode */
html[data-a11y-readmode="on"] body > *:not([class*="a11y-"]):not(main):not(article):not([role="main"]) {
  display: none !important;
}
html[data-a11y-readmode="on"] body main:not([class*="a11y-"]),
html[data-a11y-readmode="on"] body article:not([class*="a11y-"]) {
  max-width: 680px !important; margin: 32px auto !important;
  font-family: Georgia, serif !important; font-size: 18px !important; line-height: 1.8 !important;
}

/* Cursors */
html[data-a11y-cursor="black"] * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpolygon points='6,4 6,36 14,28 20,44 25,42 19,26 32,26' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 6 4, auto !important;
}
html[data-a11y-cursor="white"] * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpolygon points='6,4 6,36 14,28 20,44 25,42 19,26 32,26' fill='%23fff' stroke='%23000' stroke-width='2.5'/%3E%3C/svg%3E") 6 4, auto !important;
}

/* Reading guide */
.a11y-reading-guide {
  position: fixed; left: 0; right: 0; height: 2px;
  background: rgba(26,115,232,0.65); pointer-events: none;
  z-index: 2147483640; display: none;
  box-shadow: 0 0 8px rgba(26,115,232,0.35);
}
.a11y-reading-guide--on { display: block; }

/* Reading mask */
.a11y-mask-top, .a11y-mask-bottom {
  position: fixed; left: 0; right: 0;
  background: rgba(0,0,0,0.6); pointer-events: none;
  z-index: 2147483641; display: none;
}
.a11y-mask-top    { top: 0; }
.a11y-mask-bottom { bottom: 0; }
.a11y-mask-top--on, .a11y-mask-bottom--on { display: block; }

/* Text magnifier */
.a11y-magnifier {
  position: fixed; width: 190px; min-height: 60px;
  border-radius: 10px; border: 2px solid var(--a11y-blue);
  box-shadow: 0 4px 20px rgba(26,115,232,0.25);
  pointer-events: none; z-index: 2147483642;
  background: #fff; display: none;
  padding: 10px 12px;
  font-size: 19px; line-height: 1.4; color: #0f1f3d;
  overflow: hidden;
}
.a11y-magnifier--on { display: block; }

/* ---------- Screen Reader / TTS controls ---------- */

/* Speed selector row */
.a11y-speed-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
}
.a11y-speed-label {
  font-size: 10.5px; font-weight: 600;
  color: var(--a11y-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.a11y-speed-btn {
  flex: 1;
  padding: 7px 4px;
  border-radius: var(--a11y-radius-sm);
  border: 1.5px solid var(--a11y-blue-border);
  background: var(--a11y-blue-soft);
  color: var(--a11y-text-mid);
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  outline: none; text-align: center;
}
.a11y-speed-btn:hover { background: var(--a11y-blue-hover); border-color: var(--a11y-blue); }
.a11y-speed-btn:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-speed-btn[aria-pressed="true"] {
  background: var(--a11y-blue); border-color: var(--a11y-blue); color: #fff;
}

/* Read Page / Stop action buttons */
.a11y-sr-actions {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}
.a11y-sr-play-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  border-radius: var(--a11y-radius-md);
  border: none;
  background: var(--a11y-blue);
  color: #fff;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  outline: none;
}
.a11y-sr-play-btn:hover  { background: var(--a11y-blue-mid); }
.a11y-sr-play-btn:active { transform: scale(0.97); }
.a11y-sr-play-btn:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-sr-play-btn svg { width: 13px; height: 13px; }

.a11y-sr-stop-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  border-radius: var(--a11y-radius-md);
  border: 1.5px solid var(--a11y-blue-border);
  background: var(--a11y-blue-soft);
  color: var(--a11y-text-mid);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  outline: none;
}
.a11y-sr-stop-btn:hover  { background: var(--a11y-blue-hover); border-color: var(--a11y-blue); color: var(--a11y-blue); }
.a11y-sr-stop-btn:active { transform: scale(0.97); }
.a11y-sr-stop-btn:focus-visible { outline: 2px solid var(--a11y-blue); outline-offset: 2px; }
.a11y-sr-stop-btn svg { width: 13px; height: 13px; }

/* Floating reader bar — fixed top of page */
.a11y-reader-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2147483643;
  background: var(--a11y-blue);
  color: #fff;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  box-shadow: 0 2px 16px rgba(26,115,232,0.45);
  font-family: system-ui, Arial, sans-serif;
}
.a11y-reader-bar--visible { display: flex; }

.a11y-reader-bar-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.a11y-reader-bar-icon svg { width: 14px; height: 14px; }

.a11y-reader-bar-text {
  flex: 1; font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0.88; min-width: 0;
}
.a11y-reader-bar-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; opacity: 0.65; margin-bottom: 1px;
  display: block;
}

.a11y-reader-bar-controls {
  display: flex; gap: 6px; flex-shrink: 0;
}
.a11y-reader-bar-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  outline: none;
}
.a11y-reader-bar-btn:hover { background: rgba(255,255,255,0.3); }
.a11y-reader-bar-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.7); outline-offset: 2px; }
.a11y-reader-bar-btn svg { width: 12px; height: 12px; }

/* Element being read — visual highlight on page */
.a11y-reading-now {
  outline: 2px solid #1a73e8 !important;
  outline-offset: 3px !important;
  background: rgba(26,115,232,0.07) !important;
  border-radius: 3px;
}

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .a11y-panel, .a11y-trigger, .a11y-badge,
  .a11y-card, .a11y-profile-btn { transition: none !important; }
}

/* ---------- Mobile bottom sheet ---------- */
@media (max-width: 480px) {
  .a11y-panel {
    right: 0; left: 0; bottom: 0; width: 100%;
    max-height: 76vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(20px) scale(1);
  }
  .a11y-panel--open { transform: translateY(0) scale(1); }
  .a11y-trigger { right: 16px; bottom: 16px; }
  .a11y-grid-3 { grid-template-columns: 1fr 1fr; }
}
