/* ============================================================
   The accessibility menu (shared/a11y/a11y-menu.js) and every setting's effect on the page.
   Owner, 2026-10-27: the portal's accessibility icon and features on the website; five settings in the main menu,
   everything else under "More advanced settings". Load AFTER the page's own stylesheet.

   No hex lives in the menu's own rules: every colour is a token from concepts/orbit-path/style.css (--panel-solid,
   --text, --text-dim, --label, --line, --line-strong, --pressed-bg, --pressed-fg, --chip-bg, --focus …), so it is drawn
   in the page's theme. The only hexes are in the settings' token overrides (Higher contrast, Red-green) and every one is
   from current/assets/css/main.css. Each effect is a rule on an <html> attribute the reader turned on, so a page whose
   reader never opened the menu renders exactly as before — except Focus Halo and the Windows contrast repairs, which the
   portal rules always on: the first paints only on keyboard focus, the second only in a Windows contrast theme.
   ============================================================ */

/* ---------- shared pieces ---------- */
.s3a-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.s3a-wrap { position: relative; display: inline-flex; align-items: center; font-family: var(--font-body); }
.s3a-wrap *, .s3a-reader * { box-sizing: border-box; }
.s3a-wrap [hidden], .s3a-reader[hidden], .s3a-reader [hidden] { display: none !important; }
.s3a-i { width: 1rem; height: 1rem; flex: none; }
.s3a-ck { width: 0.875rem; height: 0.875rem; flex: none; }

/* ---------- the button: the portal's Two Rings, a 44 px square that grows with the reader's text ---------- */
.s3a-trigger {
  --s3a-r: var(--radius-sm, 0.625rem);
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; min-width: 44px; min-height: 44px;
  margin: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--s3a-r);
  background: var(--chip-bg); color: var(--text); cursor: pointer;
}
.s3a-trigger:hover { background: var(--chip-bg-hover); }
.s3a-trigger[aria-expanded="true"] { background: var(--chip-bg-hover); box-shadow: inset 0 0 0 1px var(--line-strong); }
.s3a-rings { width: 1.5rem; height: 1.5rem; display: block; }

/* ---------- the menu: a raised card in the site's panel language, with the CTA gradient as its top stripe ---------- */
.s3a-panel {
  position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 130;
  width: 22rem; max-width: calc(100vw - 2rem); max-height: calc(100vh - 6rem); max-height: calc(100dvh - 6rem); overflow-y: auto; overscroll-behavior: contain;
  padding: 0.875rem; border: 0; border-top: 3px solid transparent; border-radius: var(--radius-md, 0.875rem);
  background: linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box, var(--grad-cta) border-box;
  box-shadow: 0 0 0 1px var(--line-strong), 0 18px 44px var(--plate-shadow);
  color: var(--text); font: 400 0.9375rem/1.45 var(--font-body); letter-spacing: normal; word-spacing: normal; text-align: left;
  container: s3a / inline-size;
}
/* More advanced settings takes over the panel at every width (the five are hidden while it is open, Back brings them
   back), at one width that fits the needs and the preview (design critic r1). */
.s3a-panel[data-wide] { width: min(46rem, calc(100vw - 2rem)); }
/* Inside a scrolling box (the phone menu) the menu opens in place, full width, and that box scrolls it. */
.s3a-panel[data-inline] { position: static; width: 100%; max-width: none; max-height: none; overflow: visible; margin-top: 0.6rem; box-shadow: 0 0 0 1px var(--line-strong); }
.s3a-wrap:has(> .s3a-panel[data-inline]:not([hidden])) { flex-wrap: wrap; width: 100%; }
.s3a-panel :is(h2, h3, h4, p, ul) { margin: 0; }
.s3a-panel ul { list-style: none; padding: 0; }
.s3a-panel :is(h2, h3, h4) { letter-spacing: normal; text-wrap: balance; }
.s3a-body { display: grid; gap: 1rem; }

/* ---------- the main menu ---------- */
.s3a-main { display: flex; flex-direction: column; gap: 0.5rem; }
.s3a-title { font: 600 0.875rem/1.3 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.s3a-item { display: grid; gap: 0.375rem; }
.s3a-label { margin-top: 0.25rem; font: 700 0.75rem/1.3 var(--font-body); color: var(--text-dim); }
.s3a-note { font-size: 0.75rem; line-height: 1.45; color: var(--text-dim); }

/* The square segmented control (the portal's), as a radio group: the chosen option is filled, with a check and an edge. */
.s3a-seg { --s3a-r: var(--radius-sm, 0.625rem); display: grid; gap: 0.25rem; padding: 0.25rem; border-radius: var(--s3a-r); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.s3a-seg[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.s3a-seg[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.s3a-seg[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s3a-opt {
  --s3a-r: 0.375rem;
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 2.75rem;
  margin: 0; padding: 0 0.25rem; border: 0; border-radius: var(--s3a-r); background: transparent; color: var(--text);
  font: 600 0.8125rem/1.2 var(--font-body); text-align: center; cursor: pointer;
}
.s3a-opt:hover { background: var(--chip-bg); }
.s3a-opt[aria-checked="true"] { background: var(--pressed-bg); color: var(--pressed-fg); box-shadow: inset 0 0 0 1.5px var(--pressed-fg); font-weight: 700; }
.s3a-opt-word { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: 0; }
.s3a-opt .s3a-ck { display: none; }
.s3a-opt[aria-checked="true"] .s3a-ck { display: inline-block; }
/* The theme pictures sit above their word, so they cost no width (the portal's rule). */
.s3a-opt:has(.s3a-ti-slot) { flex-direction: column; justify-content: flex-start; gap: 0.1875rem; padding-block: 0.375rem; }
.s3a-ti-slot { display: flex; justify-content: center; line-height: 0; }
.s3a-ti { width: 1.5em; height: 1.5em; flex: none; overflow: visible; --s3a-ti-accent: var(--label); }
.s3a-opt[aria-checked="true"] .s3a-ti { --s3a-ti-accent: currentColor; }
.s3a-ti-acc { fill: var(--s3a-ti-accent); }
.s3a-ti-soft { stroke: var(--s3a-ti-accent); stroke-width: 1.1; stroke-linejoin: round; }
/* Folds by the menu's own width in rem, which the reader's text size moves: four in a row touch at 150% on a phone. */
@container s3a (width < 20rem) {
  .s3a-seg[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s3a-seg[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s3a-seg[data-n="3"] > :nth-child(3) { grid-column: 1 / -1; }
}
/* one column only when even two in a row cannot fit: "150%" fits two to a row at 150% text on a 360 phone */
@container s3a (width < 10rem) {
  .s3a-seg[data-n="2"], .s3a-seg[data-n="3"], .s3a-seg[data-n="4"] { grid-template-columns: minmax(0, 1fr); }
  .s3a-seg[data-n="3"] > :nth-child(3) { grid-column: auto; }
}

/* On/off rows: the name, then a square On/Off mark (a check and an edge when on, never colour alone). */
.s3a-row {
  --s3a-r: 0.375rem;
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.75rem;
  margin: 0; padding: 0 0.5rem; border: 0; border-radius: var(--s3a-r); background: transparent; color: var(--text);
  font: 600 0.875rem/1.3 var(--font-body); text-align: left; cursor: pointer;
}
.s3a-row:hover { background: var(--chip-bg); }
.s3a-ind {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 0.25rem; min-width: 3.5rem; min-height: 1.75rem;
  padding: 0 0.5rem; border-radius: 0.375rem; box-shadow: inset 0 0 0 1.5px var(--line-strong); font-size: 0.875rem; font-weight: 700; color: var(--text-dim);
}
.s3a-ind .s3a-ck { display: none; }
[aria-checked="true"] > .s3a-ind { background: var(--pressed-bg); color: var(--pressed-fg); box-shadow: inset 0 0 0 1.5px var(--pressed-fg); }
[aria-checked="true"] > .s3a-ind .s3a-ck { display: inline-block; }

/* More advanced settings wears the menu's own edged button (.s3a-btn, below), full width with its chevron: a filled box
   in this menu means "this one is picked", and this button only opens more settings (design critic r1). */
.s3a-btn.s3a-more { display: flex; width: 100%; margin: 0.375rem 0 0; font-size: 0.875rem; }
.s3a-chev { width: 1rem; height: 1rem; flex: none; transform: rotate(-90deg); }

/* Plain buttons with an edge: Back, Reset, the read-aloud controls. */
.s3a-btn {
  --s3a-r: var(--radius-sm, 0.625rem);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; margin: 0; padding: 0 0.875rem;
  border: 0; border-radius: var(--s3a-r); background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font: 700 0.875rem/1.2 var(--font-body); text-align: center; cursor: pointer;
}
.s3a-btn:hover { background: var(--chip-bg); }
.s3a-btn-on { background: var(--pressed-bg); color: var(--pressed-fg); box-shadow: inset 0 0 0 1.5px var(--pressed-fg); }
.s3a-btn-on:hover { background: var(--pressed-bg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- More advanced settings: the portal's Customize page, inside the menu ---------- */
.s3a-adv { min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; container: s3a-adv / inline-size; }
.s3a-adv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; }
.s3a-adv-h { font: 700 1.125rem/1.25 var(--font-head); color: var(--text); }
.s3a-lede { font-size: 0.8125rem; line-height: 1.5; color: var(--text-dim); max-width: 40em; }
.s3a-count { font-size: 0.8125rem; color: var(--text-dim); }
.s3a-count b { font-size: 0.9375rem; color: var(--text); }
/* The needs across the top: a bar under the chosen one, and a check beside its name. */
.s3a-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--line); }
.s3a-tab {
  --s3a-r: 0.375rem;
  display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; margin: 0; padding: 0 0.75rem; border: 0;
  border-radius: var(--s3a-r) var(--s3a-r) 0 0; background: transparent; color: var(--text-dim); font: 600 0.875rem/1.2 var(--font-body);
  cursor: pointer; box-shadow: inset 0 -3px 0 transparent;
}
.s3a-tab b { font-weight: 600; }
.s3a-tab .s3a-ck { display: none; }
.s3a-tab:hover { color: var(--text); background: var(--chip-bg); }
.s3a-tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--pressed-bg); }
.s3a-tab[aria-selected="true"] b { font-weight: 800; }
.s3a-tab[aria-selected="true"] .s3a-ck { display: inline-block; }
.s3a-tab-c { font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.s3a-tab-c:empty { display: none; }
@container s3a-adv (width < 30rem) {
  .s3a-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.375rem; border: 0; }
  .s3a-tab { justify-content: flex-start; flex-wrap: wrap; padding: 0.375rem 0.75rem; border-radius: 0.375rem; box-shadow: inset 0 0 0 1.5px var(--line-strong); text-align: left; }
  .s3a-tab[aria-selected="true"] { background: var(--pressed-bg); color: var(--pressed-fg); box-shadow: inset 0 0 0 1.5px var(--pressed-fg); }
  .s3a-tab[aria-selected="true"]:hover { background: var(--pressed-bg); }
}
.s3a-adv-body { display: grid; gap: 1rem; min-width: 0; }
@container s3a-adv (min-width: 34rem) {
  .s3a-adv-body { grid-template-columns: minmax(0, 1fr) 15rem; align-items: start; }
  .s3a-adv-body > .s3a-tabpanels { grid-column: 1; grid-row: 1; }
  .s3a-adv-body > .s3a-foot { grid-column: 1; grid-row: 2; }
  /* The preview stays in view while the settings it shows scroll past it (the portal's sticky preview; design critic
     r1). It spans the settings and Reset, so nothing pushes it off the top before the end of the menu (measured: 49 px
     cut off at 150% text when its area ended with the settings). Held only while the whole preview fits in the menu
     (data-pv-fits, set by the module): at 200% zoom it does not, and it then scrolls with the settings as before. */
  .s3a-pv { grid-column: 2; grid-row: 1 / span 2; }
  .s3a-panel[data-pv-fits] .s3a-pv { position: sticky; top: 0.75rem; }
}
.s3a-tabpanel { min-width: 0; }
.s3a-who { margin-bottom: 0.625rem !important; font-size: 0.8125rem; line-height: 1.5; color: var(--text-dim); }
.s3a-rows { border-radius: var(--radius-sm, 0.625rem); box-shadow: inset 0 0 0 1px var(--line-strong); container: s3a-rows / inline-size; }
.s3a-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.75rem; padding: 0.75rem 0.875rem; border-top: 1px solid var(--line); }
.s3a-r:first-child { border-top: 0; }
/* a row with nothing beside its text gives the text the whole row (no empty column and gap on the right) */
.s3a-r:not(:has(> .s3a-r-ctl)) { grid-template-columns: minmax(0, 1fr); }
/* Narrow rows put the switch under its text, left-aligned, measured by the rows' own width (the portal's narrow layout).
   rem grows with the reader's text size, so this also takes over at big text: at 150% on a phone the description had
   72 px beside the switch, one word per line (design critic r1). */
@container s3a-rows (width < 26rem) {
  .s3a-r { grid-template-columns: minmax(0, 1fr); padding-inline: 0.75rem; }
  .s3a-r > .s3a-r-ctl { justify-content: flex-start; padding-top: 0.375rem; }
}
.s3a-r-text { min-width: 0; container: s3a-row / inline-size; }
/* A setting's choices fold by the row's own width too: beside the preview, at 150% text, four in a row split "150%",
   and at 1440 "Patterns only" wrapped in a 75 px option (design critic r1), so four go 2 x 2 below 26rem. */
@container s3a-row (width < 26rem) {
  .s3a-r .s3a-seg[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Color-blind mode's four labels are the longest: at 1440 its row is 26.5rem wide, four in a row are 101 px each, and
   "Patterns only" still wrapped with its check 4 px from the edge (measured after the 26rem fold), so it folds sooner. */
@container s3a-row (width < 34rem) {
  .s3a-r .s3a-seg[data-s3a-choice="colorBlind"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* and one to a row where two would wrap it (a phone at 130% text and up; rem grows with the text, bold included) */
@container s3a-row (width < 17rem) {
  .s3a-r .s3a-seg[data-s3a-choice="colorBlind"] { grid-template-columns: minmax(0, 1fr); }
}
@container s3a-row (width < 20rem) {
  .s3a-r .s3a-seg[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s3a-r .s3a-seg[data-n="3"] > :nth-child(3) { grid-column: 1 / -1; }
}
@container s3a-row (width < 10rem) {
  .s3a-r .s3a-seg[data-n="2"], .s3a-r .s3a-seg[data-n="3"], .s3a-r .s3a-seg[data-n="4"] { grid-template-columns: minmax(0, 1fr); }
  .s3a-r .s3a-seg[data-n="3"] > :nth-child(3) { grid-column: auto; }
}
.s3a-r-ctl { display: flex; align-items: flex-start; justify-content: flex-end; }
.s3a-name { font: 700 0.9375rem/1.3 var(--font-head); color: var(--text); }
.s3a-says { margin-top: 0.25rem !important; max-width: 34em; font-size: 0.8125rem; line-height: 1.5; color: var(--text-dim); }
.s3a-helps { margin-top: 0.375rem !important; }
.s3a-r .s3a-seg, .s3a-r .s3a-play { margin-top: 0.5rem; }
/* The switch: a square track and the word beside it, never a pill. */
.s3a-sw { --s3a-r: 0.375rem; display: inline-flex; align-items: center; gap: 0.5rem; min-width: 2.75rem; min-height: 2.75rem; margin: 0; padding: 0 0.25rem; border: 0; border-radius: var(--s3a-r); background: transparent; color: var(--text); font: 700 0.8125rem var(--font-body); cursor: pointer; }
.s3a-sw i { position: relative; display: block; width: 3rem; height: 1.75rem; border-radius: 0.375rem; background: var(--panel-solid); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.s3a-sw i b { position: absolute; left: 0.25rem; top: 0.25rem; width: 1.25rem; height: 1.25rem; border-radius: 0.1875rem; background: var(--text-dim); }
.s3a-sw[aria-checked="true"] i { background: var(--pressed-bg); box-shadow: inset 0 0 0 1.5px var(--pressed-fg); }
.s3a-sw[aria-checked="true"] i b { left: auto; right: 0.25rem; background: var(--pressed-fg); }
.s3a-sw > span { min-width: 1.75rem; text-align: left; }
.s3a-tag { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 1.75rem; padding: 0 0.5rem; border-radius: 0.375rem; box-shadow: inset 0 0 0 1.5px var(--label); color: var(--text); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.s3a-play { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.s3a-play .s3a-note { flex-basis: 100%; }

/* The preview: the raised card with its top stripe; its sample is ordinary page text under the page's own rules. */
.s3a-pv { padding: 0.875rem; border-radius: var(--radius-sm, 0.625rem); border-top: 3px solid var(--label); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.s3a-pv-eye { display: flex; align-items: center; gap: 0.375rem; font: 600 0.72rem/1.3 var(--font-head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--label); }
.s3a-pv-h { margin-top: 0.25rem !important; font: 700 1rem/1.3 var(--font-head); color: var(--text); }
.s3a-pv-paper { position: relative; margin-top: 0.75rem; padding: 0.875rem 1rem; border-radius: 0.375rem; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.s3a-pv-title { padding-right: 2rem; font: 700 1rem/1.3 var(--font-head); color: var(--text); }
.s3a-pv-text { margin-top: 0.5rem !important; font-size: 0.9375rem; line-height: 1.6; color: var(--text); }
.s3a-pv-link { margin-top: 0.625rem !important; font-size: 0.9375rem; }
/* 44 px tall, the site's target size (officer r1 fix 7); Highlight links still underlines it */
.s3a-wrap .s3a-panel .s3a-pv-link a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; color: var(--label); background: none; text-decoration: none; font-weight: 600; }
.s3a-wrap .s3a-panel .s3a-pv-link a:hover { text-decoration: underline; }
.s3a-pv-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 0.75rem; }
.s3a-pv-strip i { display: block; height: 0.625rem; border-radius: 2px; background: var(--bar-track); box-shadow: inset 0 0 0 1px var(--line-strong); }
.s3a-pv-strip i[data-seg="on"] { background: var(--bar-fill); box-shadow: none; }
.s3a-pv-done { margin-top: 0.25rem !important; font-size: 0.8125rem; color: var(--text); }
.s3a-pv-art { position: absolute; right: 0.75rem; top: 0.75rem; width: 1.5rem; height: 1.5rem; color: var(--label); }
.s3a-pv-lh { margin-top: 0.75rem !important; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); }
.s3a-pv-on { display: grid; gap: 0.25rem; margin-top: 0.25rem !important; font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.s3a-pv-on li { display: flex; align-items: center; gap: 0.375rem; }
.s3a-pv-on .s3a-ck { color: var(--label); }
.s3a-pv-all { display: grid; gap: 0.125rem; margin-top: 0.25rem !important; padding-left: 1.125rem !important; list-style: disc !important; font-size: 0.8125rem; color: var(--text); }
.s3a-pv-none { margin-top: 0.75rem !important; font-size: 0.8125rem; color: var(--text); }
.s3a-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.s3a-saved { font-size: 0.8125rem; color: var(--text-dim); }

/* ---------- Focus Halo, always on (the portal's standard): a clear ring on every focused control ---------- */
:focus-visible { outline-style: solid !important; outline-width: 3px !important; outline-color: var(--focus) !important; }
html[data-contrast="more"] :focus-visible { outline-width: 4px !important; }
/* the site's ring rounds to 4 px; menu controls keep their own corners, and the ring never hides under a neighbour */
.s3a-wrap :focus-visible, .s3a-reader :focus-visible { outline-offset: 2px; border-radius: var(--s3a-r, 4px); position: relative; z-index: 1; }
.s3a-adv-h:focus { outline: none; }

/* ---------- Skip to main content, always on: the page's own .skip-link look, or this one for a page without it ---------- */
.s3a-skip { position: fixed; left: 1rem; top: calc(var(--nav-h, 76px) + 0.5rem); z-index: 300; transform: translateY(-200%); opacity: 0; padding: 0.7rem 1.2rem; border: 2px solid var(--focus); border-radius: var(--radius-sm, 0.625rem); background: var(--skip-bg, var(--panel-solid)); color: var(--skip-fg, var(--text)); font-weight: 600; text-decoration: none; }
.s3a-skip:focus { transform: none; opacity: 1; }

/* ---------- Read this page aloud: the words on screen as they are read, with Pause and Stop ---------- */
.s3a-reader {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 98;
  width: min(46rem, calc(100vw - 2rem)); max-height: 40vh; overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem 1rem; padding: 0.75rem 1rem;
  border: 1px solid var(--line-strong); border-top: 3px solid var(--label); border-radius: var(--radius-md, 0.875rem);
  background: var(--panel-solid); color: var(--text); box-shadow: 0 18px 44px var(--plate-shadow); font-family: var(--font-body);
}
.s3a-reader p { margin: 0; }
.s3a-reader-status { grid-column: 1 / -1; font: 600 0.74rem/1.3 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.s3a-reader-text { font-size: 1.0625rem; line-height: 1.55; color: var(--text); }
.s3a-reader-text mark { padding: 0 0.12em; border-radius: 0.2rem; background: var(--pressed-bg); color: var(--pressed-fg); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.s3a-reader-ctl { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 600px) { .s3a-reader { grid-template-columns: minmax(0, 1fr); } }
[data-s3a-reading] { outline: 3px dashed var(--focus) !important; outline-offset: 4px !important; }

/* ---------- Line guide and Reading mask: under the nav and the menu, never taking a pointer ---------- */
.s3a-guide-veil { position: fixed; z-index: 95; pointer-events: none; background: color-mix(in srgb, var(--bg) 62%, transparent); }
.s3a-guide-rule { position: fixed; z-index: 96; height: 2px; pointer-events: none; background: var(--text); }
[data-s3a-guide][hidden] { display: none; }
.s3a-mask { position: fixed; left: 0; right: 0; z-index: 97; pointer-events: none; background: rgba(1, 2, 16, 0.62); }
html[data-theme="light"] .s3a-mask { background: rgba(4, 18, 27, 0.5); }
.s3a-mask-top { top: 0; height: max(0px, calc(var(--s3a-mask-y, 40vh) - 2.5rem)); border-bottom: 2px solid var(--text); }
.s3a-mask-bottom { top: calc(var(--s3a-mask-y, 40vh) + 2.5rem); bottom: 0; border-top: 2px solid var(--text); }
html[data-theme="light"] .s3a-mask-top { border-bottom-color: #ffffff; }
html[data-theme="light"] .s3a-mask-bottom { border-top-color: #ffffff; }

/* ══════════════════════════════════════════ each setting's effect on the page ══════════════════════════════════════════
   [data-a11y-preview] is the menu's own sample, so every effect the preview promises lands there too. */

/* ---------- Higher contrast: words fully dark or fully bright, solid edges, opaque surfaces, the dark sky dimmed ---------- */
html[data-contrast="more"]:not([data-theme="light"]) {
  --text: #ffffff; --text-dim: #ffffff; --label: #7fffff; --outline: #7fffff;
  --line: #007feb; --line-strong: #00afcc; --chip-bg: #0a1040; --chip-bg-hover: #041318;
  --nav-bg: #010210; --nav-bg-scrolled: #010210;
}
html[data-contrast="more"][data-theme="light"] {
  --text: #04121b; --text-dim: #04121b; --label: #17383d; --outline: #17383d;
  --line: #0b6a72; --line-strong: #0b6a72; --chip-bg: #ffffff; --chip-bg-hover: #e7f6f8;
  --nav-bg: #ffffff; --nav-bg-scrolled: #ffffff;
}
html[data-contrast="more"] .site-nav { border-bottom: 2px solid var(--line-strong); backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-contrast="more"] .outline { color: var(--text) !important; -webkit-text-stroke: 0 !important; }
html[data-contrast="more"] :is(.hero-plate, .station-copy, .leader-plate, .closing-plate, .page-plate, .page-panel, .screen, .screen-cap, .stat) { border: 2px solid var(--line-strong) !important; }
html[data-contrast="more"] .btn { box-shadow: inset 0 0 0 2px var(--text) !important; }
html[data-contrast="more"] .btn-primary { box-shadow: inset 0 0 0 2px var(--ink) !important; outline: 2px solid var(--text); outline-offset: 0; }
html[data-contrast="more"] .btn-primary:focus-visible { outline-offset: 3px; }
html[data-contrast="more"] :is(.theme-toggle, .nav-toggle, .motion-toggle, .contact-chip, .s3a-trigger) { border: 2px solid var(--line-strong); }
/* The sky's canvases only, and in the dark theme only: the logo and its ring stay at full strength. In light a faded
   sky goes toward the pale page under it (measured: saturation 0.52 to 0.19, luminance 0.235 to 0.562 beside the logo),
   and her light sky is never pale, with the stars always lighter than the sky (2026-10-26, 2026-10-27; design critic r1).
   In light every word already sits on a solid plate with a 2 px edge. */
html[data-contrast="more"]:not([data-theme="light"]) :is(.galaxy, .meteors, .nebula-canvas, .sky-meteors) { opacity: 0.35; }
html[data-contrast="more"] .nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
html[data-contrast="more"] :is(main, footer) :is(p, li) a { text-decoration-thickness: 2px; }

/* ---------- Highlight links ---------- */
html[data-links="on"] :is(main, footer, [data-a11y-preview]) a[href]:not(.btn, .contact-chip, [role="button"], [role="tab"]) {
  text-decoration-line: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
}
/* ---------- Highlight headings ---------- */
html[data-headings="on"] :is(main, [data-a11y-preview]) :is(h1, h2, h3, h4) { border-inline-start: 0.3125rem solid currentColor; padding-inline-start: 0.625rem !important; }
html[data-headings="on"] main .visually-hidden { border: 0 !important; }

/* ---------- Line spacing and Letter spacing (the portal's values, inside WCAG 1.4.12's range) ---------- */
html[data-line-spacing="roomy"] :is(main, footer, [data-a11y-preview]) :is(p, li, dd, dt, blockquote, td, th, label, figcaption) { line-height: 1.85 !important; }
html[data-line-spacing="extra"] :is(main, footer, [data-a11y-preview]) :is(p, li, dd, dt, blockquote, td, th, label, figcaption) { line-height: 2.1 !important; }
html[data-line-spacing="roomy"] :is(main, footer, [data-a11y-preview]) p { margin-bottom: 1.25em; }
html[data-line-spacing="extra"] :is(main, footer, [data-a11y-preview]) p { margin-bottom: 1.6em; }
html[data-line-spacing] [data-a11y-preview] p { margin-bottom: 0; }
html[data-letter-spacing="on"] :is(main, footer, [data-a11y-preview]) { letter-spacing: 0.05em; word-spacing: 0.16em; }
html[data-letter-spacing="on"] :is(main, footer, [data-a11y-preview]) :is(p, li, dd, dt, blockquote, td, th, label, figcaption, button, a):not(.label, .eyebrow) { letter-spacing: 0.05em !important; word-spacing: 0.16em !important; }

/* ---------- Color-blind mode ----------
   Patterns (every choice but Off): a stripe on progress fills, a ring on the half-done mark, a dashed edge on the
   not-started mark and on orbit stops not reached yet, so nothing is told apart by colour alone. */
html[data-color-blind] :is(.bar > span, [data-seg="on"], [role="progressbar"] > :first-child) {
  background-image: repeating-linear-gradient(135deg, transparent 0 0.25rem, color-mix(in srgb, var(--screen-bg) 62%, transparent) 0.25rem 0.4375rem) !important;
}
html[data-color-blind] [data-seg="next"] { outline: 2px dashed var(--text); outline-offset: -2px; }
html[data-color-blind] .chk.half { background: linear-gradient(90deg, var(--chk) 50%, transparent 50%) !important; box-shadow: inset 0 0 0 2px var(--chk); }
html[data-color-blind] .chk.none { background: transparent !important; border: 2px dashed var(--text-dim); }
html[data-color-blind] .orbit-node:not(.lit) { stroke-dasharray: 3 3; }
html[data-color-blind] .orbit-node.lit { stroke-width: 4; }
/* Red-green: the green-leaning teal marks (done, progress, the right answer, lit stops) become the palette's blue,
   which red-green colour blindness keeps apart from the grey-blue ground. */
html[data-color-blind="red-green"]:not([data-theme="light"]) { --chk: #007feb; --bar-fill: #007feb; --node-fill: #007feb; }
html[data-color-blind="red-green"][data-theme="light"] { --chk: #1a53f0; --bar-fill: #1a53f0; --node-fill: #1a53f0; }
/* No color: the whole page in grey (the portal's saturate(0)). A filter on the root element is not the containing block of
   fixed elements, so the nav and the menu stay where they are. */
html[data-color-blind="no-color"] { filter: grayscale(1); }

/* ---------- Pause animations also stops the smooth sliding scroll of the skip link and jump links ----------
   The device's reduce-motion setting already does (orbit-path/style.css); the menu's own setting must not do less
   (officer r1 fix 6). Calm mode pauses through the same setting. */
html[data-motion="off"] { scroll-behavior: auto !important; }

/* ---------- Hide decorative images, and Calm mode (which also pauses motion through the saved Motion setting) ----------
   The galaxy, its nebulae and the shooting stars, the ring around the logo, the logo art in the sky, the star's trail and
   its stops, the "Follow the orbit" hint, the inner pages' star art and ring (.sl-sun, the ring host), and any decorative
   picture (empty alt text or data-decor). visibility, not
   display, so no canvas changes size and nothing has to re-measure. Pictures that explain something stay. */
/* .nebula-canvas: the station bursts (officer r1 fix 1: with motion paused they paint a still cloud at every stop, so
   Calm mode made them appear). canvas[aria-hidden="true"]: any decorative canvas, so the next sky layer is not missed
   the same way. A page that hides them also rests them (it listens for s3-a11y-change). */
html:is([data-hide-decor="on"], [data-calm="on"]) :is(.hero-sky, .page-sky-ground, .orbit, .comet-canvas, .nebula-canvas, .sky-meteors, canvas[aria-hidden="true"], .meteors, .logo-ring, .hero-hint, .hint-dot, .sl-sun, [data-ring-host], [data-decor]) { visibility: hidden !important; }
html:is([data-hide-decor="on"], [data-calm="on"]) :is(main, [data-a11y-preview]) img[alt=""] { visibility: hidden !important; }
/* on a phone the homepage's sky is a band in the flow: the plate moves up over it instead of leaving a hole */
@media (max-width: 959px) {
  html:is([data-hide-decor="on"], [data-calm="on"]) .hero-sky { margin-bottom: calc(-1 * max(54svh, 360px)); }
  html:is([data-hide-decor="on"], [data-calm="on"]) .hero-grid { margin-top: 1rem; }
  html:is([data-hide-decor="on"], [data-calm="on"]) .page-sky { padding-top: calc(var(--nav-h) + 1rem / var(--ts, 1)); }
}

/* ---------- Windows contrast themes, always on ----------
   In forced colours the computer picks every colour and removes box-shadows and backgrounds, so the edges, the chosen
   options, the current page and the colour-only marks are repaired here. The canvases cannot follow the reader's colours,
   so they step aside. */
@media (forced-colors: active) {
  .s3a-trigger, .s3a-opt, .s3a-row .s3a-ind, .s3a-btn, .s3a-more, .s3a-tab, .s3a-sw i, .s3a-tag { border: 1px solid ButtonText !important; }
  .s3a-panel, .s3a-reader, .s3a-pv, .s3a-rows { border: 1px solid CanvasText !important; }
  .s3a-seg { border: 1px solid CanvasText; }
  :is([aria-checked="true"], [aria-pressed="true"], [aria-selected="true"]) { outline: 2px solid Highlight !important; outline-offset: 1px; }
  .s3a-sw i b { forced-color-adjust: none; background: CanvasText; }
  .s3a-sw[aria-checked="true"] i b { background: Highlight; }
  .s3a-ti { --s3a-ti-accent: currentColor; }
  .nav-links a[aria-current="page"], .footer-nav a[aria-current="page"] { outline: 3px solid Highlight; outline-offset: -3px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
  :is(.theme-toggle, .nav-toggle, .motion-toggle, .btn, .contact-chip) { border: 2px solid ButtonText !important; }
  :is(.hero-plate, .station-copy, .leader-plate, .closing-plate, .page-plate, .page-panel, .screen, .screen-cap, .stat) { border: 1px solid CanvasText !important; }
  .nav-toggle .bar { forced-color-adjust: none; background: ButtonText; }
  :is(.galaxy, .comet-canvas, .nebula-canvas, .sky-meteors, .meteors, .logo-ring, .ps-stars, .ps-art, .far-over-galaxy) { visibility: hidden; } /* the star layers added since (officer, launch review) */
  .bar { forced-color-adjust: none; background: Canvas; border: 1px solid CanvasText; }
  .bar > span { forced-color-adjust: none; background: CanvasText !important; }
  .chk, .radio, .q-mark { forced-color-adjust: none; border: 2px solid CanvasText; }
  .chk { background: CanvasText !important; }
  .chk::after { border-color: Canvas !important; }
  .chk.half { background: linear-gradient(90deg, CanvasText 50%, Canvas 50%) !important; }
  .chk.none { background: Canvas !important; }
  .radio.on { background: radial-gradient(circle, CanvasText 0 45%, Canvas 50%) !important; }
  .s3a-pv-strip i { forced-color-adjust: none; background: Canvas; border: 1px solid CanvasText; }
  .s3a-pv-strip i[data-seg="on"] { background: CanvasText; }
  .s3a-reader-text mark { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .s3a-guide-veil, .s3a-mask { background: Canvas; opacity: 0.85; }
  [data-s3a-reading] { outline-color: Highlight !important; }
  /* The menu card is painted by two gradients (its fill and its top stripe), and forced colors drop every gradient, which
     left the card see-through with the page's words behind the menu's (measured: 100,179 px changed under it). A system
     colour is kept, so the card gets the reader's own Canvas. */
  .s3a-panel { background: Canvas !important; }
}

/* a visible way out on a phone, where tapping outside is not obvious */
.s3a-titlerow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.s3a-close { display: none; min-height: 44px; width: auto; }
@media (max-width: 959px), (pointer: coarse) { .s3a-close { display: inline-flex; align-items: center; } }
/* phones: the panel centered with even gutters, and readable labels (phone audit r1, 2026-11-04) */
@media (max-width: 599px) {
  .s3a-panel:not([data-inline]) { position: fixed; left: 1rem; right: 1rem; width: auto; max-width: none; top: calc(var(--nav-h, 76px) + 0.5rem); }
  .s3a-label { font-size: 0.875rem; }
  .s3a-close { display: inline-flex; align-items: center; }
  .s3a-adv-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .s3a-row { padding-inline: 0; }
}
