/* UnifiedIQ accessibility toolbar (1.40.0).
   Two parts: the widget UI (.uiqa-*) and the preference styles it toggles on <html>. */

/* ── Trigger button ── */
.uiqa-trigger {
  position: fixed; left: 16px; bottom: 16px; z-index: 2147482500;
  width: 52px; height: 52px; border-radius: 50%;
  background: #0b3ad6; color: #fff; border: 2px solid #fff;
  box-shadow: 0 3px 16px rgba(0,0,0,.3);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.uiqa-trigger svg { width: 28px; height: 28px; fill: currentColor; }
.uiqa-trigger:focus-visible, .uiqa-trigger:focus { outline: 3px solid #0b3ad6; outline-offset: 3px; }

/* ── Panel ── */
.uiqa-panel {
  position: fixed; left: 16px; bottom: 80px; z-index: 2147482501;
  width: 320px; max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); overflow: auto;
  background: #fff; color: #16181c; border: 1px solid #c9ced6; border-radius: 14px;
  box-shadow: 0 16px 50px rgba(0,0,0,.3);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; line-height: 1.5;
  padding: 16px;
}
.uiqa-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.uiqa-panel__title { margin: 0; font-size: 17px; font-weight: 700; }
.uiqa-close {
  background: #eef1f5; color: #16181c; border: 1px solid #c9ced6; border-radius: 8px;
  width: 36px; height: 36px; font-size: 18px; cursor: pointer; line-height: 1;
}
.uiqa-close:focus-visible, .uiqa-close:focus { outline: 3px solid #0b3ad6; outline-offset: 2px; }

.uiqa-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #e7ebf0; }
.uiqa-row:first-of-type { border-top: 0; }
.uiqa-row__label { font-weight: 600; }

.uiqa-size { display: inline-flex; gap: 6px; }
.uiqa-size button {
  width: 38px; height: 38px; border: 1px solid #c9ced6; background: #fff; color: #16181c;
  border-radius: 8px; cursor: pointer; font-weight: 700;
}
.uiqa-size button[aria-pressed="true"] { background: #0b3ad6; color: #fff; border-color: #0b3ad6; }
.uiqa-size button:focus-visible, .uiqa-size button:focus { outline: 3px solid #0b3ad6; outline-offset: 2px; }

/* Toggle buttons behave as switches (aria-pressed) */
.uiqa-toggle {
  min-width: 64px; height: 38px; padding: 0 14px; cursor: pointer; font-weight: 600;
  border: 1px solid #c9ced6; background: #fff; color: #16181c; border-radius: 999px;
}
.uiqa-toggle[aria-pressed="true"] { background: #0b3ad6; color: #fff; border-color: #0b3ad6; }
.uiqa-toggle:focus-visible, .uiqa-toggle:focus { outline: 3px solid #0b3ad6; outline-offset: 2px; }

.uiqa-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.uiqa-reset {
  background: #eef1f5; color: #16181c; border: 1px solid #c9ced6; border-radius: 8px;
  padding: 9px 14px; font-weight: 600; cursor: pointer;
}
.uiqa-reset:focus-visible, .uiqa-reset:focus { outline: 3px solid #0b3ad6; outline-offset: 2px; }
.uiqa-links-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.uiqa-statement { color: #0b3ad6; text-decoration: underline; font-weight: 600; background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.uiqa-statement:focus-visible, .uiqa-statement:focus { outline: 3px solid #0b3ad6; outline-offset: 2px; }

.uiqa-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;
}
.uiqa-hidden { display: none !important; }

@media (prefers-color-scheme: dark) {
  .uiqa-panel { background: #16181c; color: #eef1f5; border-color: #343a42; }
  .uiqa-close, .uiqa-reset { background: #232a31; color: #eef1f5; border-color: #343a42; }
  .uiqa-size button, .uiqa-toggle { background: #232a31; color: #eef1f5; border-color: #343a42; }
  .uiqa-row { border-color: #2a3139; }
}

/* ═══ Preference styles applied to <html> ═══ */

/* Text scaling is applied via documentElement.style.fontSize by the script. */

html.uiqa-readable, html.uiqa-readable * {
  font-family: Verdana, Tahoma, "Trebuchet MS", "Segoe UI", Arial, sans-serif !important;
  letter-spacing: .02em !important;
}

html.uiqa-spacing p, html.uiqa-spacing li, html.uiqa-spacing dd, html.uiqa-spacing dt,
html.uiqa-spacing a, html.uiqa-spacing span, html.uiqa-spacing blockquote,
html.uiqa-spacing h1, html.uiqa-spacing h2, html.uiqa-spacing h3, html.uiqa-spacing h4 {
  line-height: 1.8 !important;
  letter-spacing: .12em !important;
  word-spacing: .16em !important;
}

html.uiqa-contrast, html.uiqa-contrast body { background: #ffffff !important; color: #000000 !important; }
html.uiqa-contrast p, html.uiqa-contrast li, html.uiqa-contrast span, html.uiqa-contrast td,
html.uiqa-contrast h1, html.uiqa-contrast h2, html.uiqa-contrast h3, html.uiqa-contrast h4,
html.uiqa-contrast h5, html.uiqa-contrast h6, html.uiqa-contrast label, html.uiqa-contrast dt, html.uiqa-contrast dd {
  color: #000000 !important;
}
html.uiqa-contrast a { color: #00398c !important; text-decoration: underline !important; }
html.uiqa-contrast button, html.uiqa-contrast .button, html.uiqa-contrast input[type="submit"] {
  background: #00398c !important; color: #ffffff !important; border: 2px solid #000 !important;
}
html.uiqa-contrast :focus, html.uiqa-contrast :focus-visible { outline: 3px solid #000 !important; outline-offset: 2px !important; }

html.uiqa-links a { text-decoration: underline !important; outline: 1px solid currentColor; outline-offset: 2px; }

html.uiqa-motion *, html.uiqa-motion *::before, html.uiqa-motion *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; scroll-behavior: auto !important;
}

html.uiqa-cursor, html.uiqa-cursor * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M8 4 L8 40 L18 30 L25 44 L31 41 L24 27 L38 27 Z" fill="black" stroke="white" stroke-width="2"/></svg>') 4 4, auto !important;
}

/* Keep the toolbar's own UI readable even while a high-contrast/readable mode is on. */
html.uiqa-readable .uiqa-panel, html.uiqa-readable .uiqa-panel * { letter-spacing: normal !important; }
