/* Connect2Teach Access — styles
   Everything is sized in rem so the "Text size" setting scales the whole app. */

@font-face { font-family: "Lexend"; src: url("../fonts/lexend-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/lexend-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/lexend-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("../fonts/opendyslexic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("../fonts/opendyslexic-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #faf8f3;          /* warm off-white: less glare than pure white */
  --surface: #ffffff;
  --surface-2: #f1eee6;
  --text: #1c1f26;
  --muted: #4a5160;       /* 7.6:1 on --bg */
  --primary: #1b3a6b;     /* deep blue */
  --primary-ink: #ffffff;
  --accent: #0e6b5e;      /* teal, 6.3:1 on white */
  --sun: #f6c343;
  --line: #d6d1c4;
  --ok: #17663a; --ok-bg: #e5f4ea;
  --err: #a1261d; --err-bg: #fbe9e7;
  --info: #1b4f8a; --info-bg: #e7f0fb;
  --link: #1b4f8a;
  --focus: #f6c343;
  --radius: .9rem;
  --shadow: 0 1px 2px rgba(20,25,40,.06), 0 6px 20px rgba(20,25,40,.07);
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --lh: 1.65;
  --ls: 0;
  --ws: 0;
  --target: 2.75rem;      /* 44px minimum touch target */
}

/* ---------- Settings applied by the accessibility menu ---------- */
html.f-dyslexic { --font: "OpenDyslexic", "Lexend", system-ui, sans-serif; }
html.f-system   { --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
html.f-mono     { --font: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; }
html.lh-1 { --lh: 2; }      html.lh-2 { --lh: 2.5; }
html.ls-1 { --ls: .06em; --ws: .16em; }  html.ls-2 { --ls: .12em; --ws: .32em; }
html.big-targets { --target: 3.5rem; }

html.c-dark {
  --bg: #000; --surface: #000; --surface-2: #111; --text: #fff; --muted: #f0f0f0;
  --primary: #ffe14d; --primary-ink: #000; --accent: #7df9ff; --line: #fff;
  --link: #ffe14d; --focus: #00e5ff; --shadow: none;
  --ok: #8dff9b; --ok-bg: #000; --err: #ff8f8f; --err-bg: #000; --info: #9fd0ff; --info-bg: #000;
}
html.c-light {
  --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #000;
  --primary: #000; --primary-ink: #fff; --accent: #000; --line: #000;
  --link: #0000c8; --focus: #c80000; --shadow: none;
  --ok: #005a00; --err: #b00000; --info: #00007a;
}
html.c-dark *, html.c-light * { box-shadow: none !important; text-shadow: none !important; }
html.c-dark .card, html.c-light .card, html.c-dark .btn, html.c-light .btn { border-width: 2px !important; }
html.c-dark .hero, html.c-light .hero { background: var(--bg) !important; }

#page { filter: var(--page-filter, none); }
html.c-invert #page img, html.c-invert #page video { filter: invert(1) hue-rotate(180deg); }

html.links-on #page a:not(.btn):not(.brand):not(.module-card) { text-decoration: underline 0.15em !important; text-underline-offset: .2em; background: #ffe14d !important; color: #000 !important; }
html.links-on #page a:not(.btn):not(.brand):not(.module-card) * { color: #000 !important; }
html.links-on #page .module-card { outline: .2rem solid #ffe14d; }
html.align-on #page * { text-align: left !important; }
html.hide-images #page img, html.hide-images #page .illus { visibility: hidden !important; }
html.stop-anim *, html.stop-anim *::before, html.stop-anim *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.big-cursor, html.big-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 3l14 7-6 2-2 6z' fill='black' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 4 2, auto !important; }
html.focus-strong *:focus-visible { outline: .3rem solid var(--focus) !important; outline-offset: .2rem !important; box-shadow: 0 0 0 .55rem #000 !important; }
html.click-speak #page p, html.click-speak #page li, html.click-speak #page h1, html.click-speak #page h2, html.click-speak #page h3, html.click-speak #page td, html.click-speak #page .speakable { cursor: help; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1.0625rem; line-height: var(--lh);
  letter-spacing: var(--ls); word-spacing: var(--ws);
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; color: var(--text); letter-spacing: var(--ls); }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: 70ch; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .15em; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: .2rem solid var(--focus); outline-offset: .2rem; border-radius: .2rem; }
main:focus { outline: none; }
kbd { font-family: inherit; font-size: .85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .3rem; padding: 0 .35em; background: var(--surface); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -10rem; z-index: 1000; background: var(--primary); color: var(--primary-ink); padding: .8rem 1.2rem; border-radius: .5rem; font-weight: 600; }
.skip:focus { top: 1rem; }
.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(34rem, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.ic { width: 1.25em; height: 1.25em; vertical-align: -0.22em; flex: none; }
.ic-lg { width: 1.9rem; height: 1.9rem; }
.ic-xl { width: 2.6rem; height: 2.6rem; }
.inline { display: inline; margin: 0; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--target); padding: .55rem 1.2rem; border-radius: 999px;
  border: 2px solid var(--primary); background: var(--primary); color: var(--primary-ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-sun { background: var(--sun); border-color: var(--sun); color: #1c1f26; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-small { min-height: 2.4rem; padding: .35rem .95rem; font-size: .95rem; }
html.big-targets .btn-small { min-height: var(--target); }
.linklike { background: none; border: 0; padding: .4rem .2rem; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; min-height: var(--target); }

label, .label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field { margin-bottom: 1.1rem; }
.hint { display: block; font-size: .92rem; color: var(--muted); font-weight: 400; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: var(--target); padding: .55rem .8rem; font: inherit; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-radius: .6rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 8rem; resize: vertical; }
fieldset { border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
legend { font-weight: 600; padding: 0 .4rem; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 400; min-height: var(--target); margin: 0; }
.check input { width: 1.4rem; height: 1.4rem; accent-color: var(--primary); }
.field-error { color: var(--err); font-weight: 600; }

.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: .7rem; margin: 1.2rem 0; border: 2px solid; font-weight: 500; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.notice-error { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.notice-info { background: var(--info-bg); border-color: var(--info); color: var(--info); }
.notice span, .notice p { color: var(--text); margin: 0; }

/* ---------- Header / footer ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.2rem; flex-wrap: wrap; padding-block: .4rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-size: 1.15rem; }
.brand-mark { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--primary); color: var(--primary-ink); }
.brand-mark .ic { width: 1.7rem; height: 1.7rem; }
.brand strong { color: var(--accent); }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: .4rem 1.1rem; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a:not(.btn) { color: var(--text); text-decoration: none; padding: .5rem .2rem; display: inline-flex; min-height: var(--target); align-items: center; }
.main-nav a:not(.btn):hover, .main-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .18em; }
.site-footer { margin-top: 4rem; background: var(--surface); border-top: 1px solid var(--line); padding: 1.6rem 0; font-size: .95rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.footer-row p { margin: 0; }

/* ---------- Landing page ---------- */
.hero { background: linear-gradient(160deg, #e9f1fb 0%, var(--bg) 55%, #fdf3d8 100%); padding: 3.5rem 0 3rem; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; }
.hero-grid > *, .split > *, .grid-2 > * { min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--accent); background: var(--surface); border: 1px solid var(--line); padding: .25rem .8rem; border-radius: 999px; font-size: .95rem; margin-bottom: 1rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1rem; }
.hero-visual { position: relative; }
.hero-visual img { border-radius: 1.4rem; box-shadow: var(--shadow); }
.icon-orbit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; list-style: none; padding: 0; margin: 0; }
.orbit-item { aspect-ratio: 1; display: grid; place-items: center; text-align: center; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: var(--shadow); padding: .6rem; font-size: .85rem; font-weight: 600; color: var(--primary); }
.orbit-item .ic { width: 2.3rem; height: 2.3rem; color: var(--accent); }
.orbit-item:nth-child(odd) .ic { color: var(--primary); }
.trust { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .95rem; }
.trust li { display: flex; align-items: center; gap: .4rem; }
.trust .ic { color: var(--ok); }

.section { padding: 3.5rem 0 1rem; }
.section-head { max-width: 46rem; margin-bottom: 2rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1.1rem; list-style: none; padding: 0; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.1rem; box-shadow: var(--shadow); }
.card h3 { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.card p { margin: 0; color: var(--muted); font-size: .98rem; }
.card-icon { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: .9rem; background: var(--info-bg); color: var(--primary); margin-bottom: .8rem; }
.card-icon img { width: 100%; height: 100%; object-fit: contain; }
.card:nth-child(3n+2) .card-icon { background: #e3f3ef; color: var(--accent); }
.card:nth-child(3n) .card-icon { background: #fdf1d3; color: #7a5300; }
html.c-dark .card-icon, html.c-light .card-icon { background: transparent !important; border: 2px solid var(--line); color: var(--text) !important; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .8rem; padding: 0; list-style: none; }
.tags li { font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

.compare { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.compare th, .compare td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: var(--primary); color: var(--primary-ink); }
.compare td:nth-child(2) { font-weight: 600; }
.yes { color: var(--ok); } .no { color: var(--muted); }
.table-scroll { overflow-x: auto; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.checklist li { display: flex; gap: .6rem; margin-bottom: .7rem; }
.checklist .ic { color: var(--ok); margin-top: .25rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.6rem; box-shadow: var(--shadow); }
.try-strip { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; background: var(--primary); color: var(--primary-ink); padding: 1.4rem 1.6rem; border-radius: 1.2rem; }
.try-strip h2, .try-strip p { color: var(--primary-ink); margin: 0; }
.try-strip .btn { background: var(--sun); border-color: var(--sun); color: #1c1f26; }

/* ---------- App pages ---------- */
.page-title { padding: 2.2rem 0 .5rem; }
.page-title p { color: var(--muted); }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.2rem; }
.module-card { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 1.1rem; padding: 1.4rem; box-shadow: var(--shadow); min-height: 11rem; }
.module-card:hover { border-color: var(--primary); }
.module-card .go { margin-top: auto; font-weight: 600; color: var(--primary); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .9rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; border: 1px solid currentColor; }
.badge-admin { color: #6b2d8f; } .badge-teacher { color: var(--accent); } .badge-student { color: var(--info); }
.badge-active { color: var(--ok); } .badge-invited { color: #8a5a00; } .badge-disabled { color: var(--err); } .badge-new { color: var(--err); }
.toolbar-row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; justify-content: space-between; margin: 1rem 0; }
.copybox { display: flex; gap: .5rem; align-items: stretch; margin: .6rem 0; }
.copybox input { font-size: .9rem; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; border-bottom: 2px solid var(--line); }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--text); border-radius: .6rem .6rem 0 0; min-height: var(--target); display: inline-flex; align-items: center; gap: .4rem; }
.tabs a[aria-current] { background: var(--primary); color: var(--primary-ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.bar { height: .7rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; min-width: 6rem; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* ---------- Reading Studio ---------- */
.reader-controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0; padding: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.reader { background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; padding: clamp(1.2rem, 4vw, 2.4rem); font-size: 1.35rem; line-height: calc(var(--lh) + .25); max-width: 46rem; box-shadow: var(--shadow); }
.reader .sent { border-radius: .3rem; transition: background .15s; }
.reader .w { border-radius: .25rem; cursor: pointer; padding: 0 .04em; }
.reader .w:hover { background: var(--surface-2); outline: 1px dashed var(--line); }
.reader .w.now { background: var(--sun); color: #1c1f26; box-shadow: 0 0 0 .12em var(--sun); }
.reader .sent.now { background: rgba(246, 195, 67, .22); }
.reader.one-at-a-time .sent { display: none; }
.reader.one-at-a-time .sent.current { display: inline; font-size: 1.15em; }
html.c-dark .reader .w.now { background: #ffe14d; color: #000; }
.syllables { min-height: 4.5rem; margin: 1rem 0; padding: 1rem 1.2rem; border: 2px dashed var(--line); border-radius: 1rem; font-size: 1.6rem; letter-spacing: .04em; }
.syllables .syl:nth-child(odd) { color: var(--primary); } .syllables .syl:nth-child(even) { color: var(--accent); }
.syllables .dot { color: var(--muted); padding: 0 .1em; }
.quiz { margin-top: 1.5rem; }
.choice-list { display: grid; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.choice { width: 100%; text-align: left; justify-content: flex-start; border-radius: .8rem; background: var(--surface); color: var(--text); border-color: var(--line); font-weight: 500; min-height: 3.2rem; }
.choice.correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.wrong { border-color: var(--err); background: var(--err-bg); }
.feedback { font-weight: 600; margin-top: .8rem; display: flex; align-items: center; gap: .5rem; min-height: 1.6rem; }
.feedback.ok { color: var(--ok); } .feedback.err { color: var(--err); }

/* ---------- Math ---------- */
.math-stage { background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; padding: clamp(1rem, 3vw, 2rem); box-shadow: var(--shadow); }
.problem { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 700; text-align: center; margin: .2rem 0 1rem; letter-spacing: .05em; }
.visual { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.2rem; margin: 1rem 0 1.4rem; min-height: 5rem; }
.tenframe { display: grid; grid-template-columns: repeat(5, 2.1rem); gap: .3rem; padding: .4rem; border: 2px solid var(--text); border-radius: .5rem; }
.tenframe span { width: 2.1rem; height: 2.1rem; border: 1px solid var(--line); border-radius: .3rem; display: grid; place-items: center; }
.dot-a, .dot-b { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: block; }
.dot-a { background: var(--primary); }
.dot-b { background: var(--accent); border-radius: .25rem; }   /* different SHAPE too, not only colour */
.dot-gone { background: transparent; border: 2px dashed var(--err); width: 1.5rem; height: 1.5rem; border-radius: 50%; display: block; position: relative; }
.dot-gone::after { content: ""; position: absolute; inset: 45% -10%; height: 2px; background: var(--err); transform: rotate(-45deg); }
.op { font-size: 2.2rem; font-weight: 700; }
.tens-rod { display: flex; flex-direction: column; gap: 2px; padding: 2px; border: 2px solid var(--primary); border-radius: .3rem; }
.tens-rod i { width: 1.2rem; height: .7rem; background: var(--primary); display: block; }
.ones i { width: 1.2rem; height: 1.2rem; background: var(--accent); display: inline-block; margin: 1px; border-radius: .2rem; }
.numline { width: 100%; overflow-x: auto; padding: .5rem 0 1rem; }
.numline ol { display: flex; list-style: none; padding: 0 1rem; margin: 0; min-width: max-content; border-top: 3px solid var(--text); }
.numline li { width: 2.6rem; text-align: center; position: relative; padding-top: .6rem; font-size: .95rem; }
.numline li::before { content: ""; position: absolute; top: -.5rem; left: 50%; width: 2px; height: .9rem; background: var(--text); }
.numline li.start { font-weight: 700; color: var(--primary); }
.numline li.hop { color: var(--accent); font-weight: 700; }
.numline li.hop::after { content: "⌒"; position: absolute; top: -2.1rem; left: -40%; font-size: 1.8rem; color: var(--accent); }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .8rem; max-width: 30rem; margin: 0 auto; }
.answers .btn { font-size: 1.8rem; min-height: 4.2rem; border-radius: 1rem; background: var(--surface); color: var(--text); border-color: var(--line); }
.answers .btn.correct { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.answers .btn.wrong { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.score { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem; color: var(--muted); }
.stars { font-size: 1.6rem; letter-spacing: .1em; }

/* ---------- Accessibility menu ---------- */
.a11y-launch {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 900; width: 3.7rem; height: 3.7rem; border-radius: 50%;
  border: 3px solid #fff; background: #1b3a6b; color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.a11y-launch:hover { background: #0e6b5e; }
.a11y-launch:focus-visible { outline: .25rem solid #f6c343; outline-offset: .2rem; }
.a11y-panel {
  position: fixed; right: 1rem; bottom: 5.6rem; z-index: 901; width: min(27rem, calc(100vw - 2rem)); max-height: calc(100vh - 7rem);
  display: flex; flex-direction: column; background: #fff; color: #1c1f26; border: 2px solid #1b3a6b; border-radius: 1.1rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.3); font-family: "Lexend", system-ui, sans-serif; letter-spacing: 0; word-spacing: 0; line-height: 1.45; text-align: left;
}
html.f-dyslexic .a11y-panel { font-family: "OpenDyslexic", sans-serif; }
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; background: #1b3a6b; color: #fff; border-radius: .9rem .9rem 0 0; }
.a11y-head h2 { font-size: 1.15rem; margin: 0; color: #fff; display: flex; gap: .5rem; align-items: center; }
.a11y-close { background: transparent; border: 2px solid #fff; color: #fff; border-radius: .6rem; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; cursor: pointer; }
.a11y-body { overflow-y: auto; padding: .9rem 1rem 1.1rem; }
.a11y-hint { font-size: .85rem; color: #4a5160; margin: 0 0 .6rem; }
.a11y-sub { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: #0e6b5e; margin: 1.1rem 0 .5rem; }
.a11y-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.a11y-tile, .a11y-toggle {
  display: flex; align-items: center; gap: .55rem; text-align: left; min-height: 3rem; padding: .5rem .7rem;
  background: #f5f3ee; color: #1c1f26; border: 2px solid #d6d1c4; border-radius: .7rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.a11y-tile .ic-lg { width: 1.6rem; height: 1.6rem; color: #1b3a6b; }
.a11y-tile[aria-pressed="true"], .a11y-toggle[aria-pressed="true"] { background: #1b3a6b; border-color: #1b3a6b; color: #fff; }
.a11y-tile[aria-pressed="true"] .ic-lg { color: #f6c343; }
.a11y-tile[aria-pressed="true"]::after, .a11y-toggle[aria-pressed="true"]::after { content: "✓"; margin-left: auto; font-weight: 700; color: #f6c343; }
.a11y-toggles { display: grid; grid-template-columns: 1fr; gap: .4rem; }
.a11y-row { display: flex; align-items: center; gap: .6rem; margin: .45rem 0; flex-wrap: wrap; }
.a11y-row select, .a11y-row input[type=range] { flex: 1 1 10rem; min-height: 2.75rem; border: 2px solid #d6d1c4; border-radius: .6rem; background: #fff; color: #1c1f26; font: inherit; font-size: .92rem; padding: .3rem .5rem; }
.a11y-label { flex: 0 0 9.5rem; font-weight: 600; font-size: .92rem; margin: 0; display: flex; gap: .35rem; align-items: center; }
.a11y-step { min-width: 3rem; min-height: 2.75rem; font: inherit; font-weight: 700; border: 2px solid #1b3a6b; background: #fff; color: #1b3a6b; border-radius: .6rem; cursor: pointer; }
.a11y-row output { min-width: 3.5rem; text-align: center; font-weight: 700; }
.a11y-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.a11y-actions .btn { font-size: .9rem; min-height: 2.75rem; padding: .4rem .9rem; background: #1b3a6b; border-color: #1b3a6b; color: #fff; }
.a11y-actions .btn-ghost { background: #fff; color: #1b3a6b; }
.a11y-panel :focus-visible { outline: .22rem solid #f6c343; outline-offset: .15rem; box-shadow: 0 0 0 .4rem #1b3a6b; }

.a11y-ruler { position: fixed; left: 0; right: 0; height: 2.6rem; z-index: 800; pointer-events: none; background: rgba(246,195,67,.28); border-top: 3px solid #1b3a6b; border-bottom: 3px solid #1b3a6b; transform: translateY(-50%); }
.a11y-mask { position: fixed; left: 0; right: 0; z-index: 800; pointer-events: none; background: rgba(0,0,0,.6); }
.a11y-tint { position: fixed; inset: 0; z-index: 799; pointer-events: none; mix-blend-mode: multiply; }
.a11y-caption { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 850; max-width: min(46rem, calc(100vw - 7rem)); background: rgba(0,0,0,.88); color: #fff; padding: .6rem 1.1rem; border-radius: .7rem; font-size: 1.15rem; line-height: 1.45; font-family: "Lexend", system-ui, sans-serif; }
.a11y-flash { position: fixed; inset: 0; z-index: 950; pointer-events: none; border: 1.2rem solid; animation: a11yflash .9s ease-out forwards; }
.a11y-flash.ok { border-color: #17a34a; } .a11y-flash.err { border-color: #dc2626; } .a11y-flash.info { border-color: #2563eb; }
@keyframes a11yflash { 0% { opacity: 1; } 100% { opacity: 0; } }
html.stop-anim .a11y-flash { animation: none !important; opacity: .9; }
.speaking { outline: .25rem solid var(--sun) !important; outline-offset: .3rem; border-radius: .3rem; }

/* ---------- Responsive ---------- */
@media (max-width: 52rem) {
  .hero-grid, .split, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding-top: 2.2rem; }
  .a11y-label { flex-basis: 100%; }
  .reader-controls { position: static; }
}
@media print {
  .a11y-launch, .a11y-panel, .site-header nav, .reader-controls { display: none !important; }
}
