/* Oct 20, 2026 (draft/dyslexia): Read-along, Reading comfort and test-day-style practice tools. No animation anywhere (the site-wide rule in styles.css already turns animations and transitions off). */
:root{ --ra-sent:#D9E8F8; --ra-word:#9CC2EA; --ra-word-ink:#1C1B1F; --bb-hl:#FFE58A; }
body.ra-c-yellow{ --ra-sent:#FBE7A6; --ra-word:#E9B949; }
body.lowglare{ --ra-sent:#25384D; --ra-word:#3F6A99; --ra-word-ink:#FFFFFF; --bb-hl:#5E5222; }
body.lowglare.ra-c-yellow{ --ra-sent:#4A4026; --ra-word:#9A7A2E; }
.ra-sample{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------- Read-along ---------- */
.ra-listen{ display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:6px 14px; margin:0 6px 8px 0; font-size:.85em; font-weight:600;
  background:transparent; color:var(--accent); border:2px solid var(--accent); border-radius:999px; }
.ra-listen .ra-ic{ font-size:.8em; }
.explain > .ra-listen, .lcard > .ra-listen, .tl-passage > .ra-listen{ margin-bottom:6px; }
.tl-passage > .ra-listen{ display:inline-flex; }  /* stay in the passage card, never a .tl-pass-wrap grid cell */
::highlight(ra-sent){ background-color:var(--ra-sent); color:inherit; }
::highlight(ra-word){ background-color:var(--ra-word); color:var(--ra-word-ink); }
.ra-cur-block{ outline:3px solid var(--ra-word) !important; outline-offset:3px; background-color:var(--ra-sent); }
.ra-dock{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(10px + env(safe-area-inset-bottom)); z-index:80; width:min(720px,calc(100vw - 16px));
  background:var(--card); color:var(--ink); border:2px solid var(--accent); border-radius:16px; padding:8px 10px 4px; box-shadow:0 4px 18px rgba(0,0,0,.18); }
.ra-dock[hidden]{ display:none; }
.ra-row{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; justify-content:center; }
.ra-b{ margin:0; min-height:44px; padding:6px 12px; font-size:.85em; }
.ra-b.on{ background:var(--soft); font-weight:700; }
.ra-b.ra-dead, .ra-b:disabled{ opacity:.45; cursor:not-allowed; color:var(--muted); border-color:var(--line); }
.ra-rate select{ width:auto; min-height:44px; padding:6px 8px; font-size:.85em; }
.ra-msg{ margin:4px 4px 2px; text-align:center; min-height:0; } .ra-msg:empty{ display:none; }
body.ra-playing .ft-fab, body.ra-playing .help-fab{ bottom:calc(var(--ra-dock-h,96px) + 20px + env(safe-area-inset-bottom)) !important; transform:none !important; }
body.ra-playing main, body.ra-playing .qm-body{ padding-bottom:calc(var(--ra-dock-h,96px) + 90px); }
body.ra-tap [data-ra-scope]{ cursor:pointer; outline:2px dashed var(--accent); outline-offset:4px; border-radius:6px; }
body.testlike .ra-listen{ }   /* Read-along stays available in timed modules when it is switched on (see build-plan.md item 5) */
@media (max-width:520px){ .ra-b{ padding:6px 9px; } .ra-dock{ padding:6px 6px 2px; } }

/* ---------- Settings → Reading card ---------- */
#readSettings .rs-box{ display:flex; gap:10px; align-items:flex-start; margin:10px 0; cursor:pointer; }
#readSettings .rs-box input{ width:22px; height:22px; min-height:0; margin:3px 0 0; flex:none; accent-color:var(--accent); }
.rs-group{ border-top:1px solid var(--line); margin-top:8px; padding-top:4px; }
.rs-sub{ margin:2px 0 10px 32px; padding-left:12px; border-left:3px solid var(--line); }
.rs-sub .row{ display:flex; flex-wrap:wrap; gap:4px 14px; }
.rs-f{ margin:8px 0; flex:1 1 170px; min-width:0; }
.rs-f label{ display:block; font-weight:600; font-size:.9em; margin-bottom:2px; }
.rs-f select{ width:100%; }
.rs-voices{ border:0; padding:0; margin:10px 0; } .rs-voices legend{ padding:0; }
.rs-voice{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 10px; border-bottom:1px dashed var(--line); padding:2px 0; }
#readSettings .rs-voice .rs-box{ flex:1 1 220px; margin:6px 0; } .rs-try{ margin:0; } .rs-try .ra-try{ min-height:44px; margin:0; }
.rs-test-on select:disabled{ opacity:.55; cursor:not-allowed; } #raBBNote a{ text-decoration:underline; }
.rs-ticks{ display:flex; justify-content:space-between; margin:2px 0 6px; }
.rs-more summary{ cursor:pointer; font-weight:600; min-height:44px; display:flex; align-items:center; }
#raPresetLine button, #rsStepLine button{ min-height:44px; margin:4px 4px 0 0; }
#readSettings input[type=range]{ width:100%; padding:0; border:0; min-height:44px; accent-color:var(--accent); background:transparent; }
.rs-preview{ border:2px dashed var(--line); border-radius:12px; padding:12px 14px; margin-top:8px; }
@media (max-width:520px){ .rs-sub{ margin-left:6px; padding-left:10px; } }

/* ---------- Reading comfort (text size, spacing, shorter lines, tints, upright text). The larger of these and the older Bigger text / Extra spacing boxes wins. ---------- */
body.rc-s1{ --fs:21px; } body.rc-s2{ --fs:23px; } body.rc-s3{ --fs:26px; }
body.rc-l1{ --ls:.05em; --ws:.12em; } body.rc-l2{ --ls:.12em; --ws:.2em; }
body.rc-h1{ --lh:1.9; } body.rc-h2{ --lh:2.2; }
body.rc .tl-passage, body.rc .tl-passage p, body.rc .q-stem, body.rc .choice, body.rc .explain, body.rc .explain p, body.rc .lcard p{ line-height:var(--lh); letter-spacing:var(--ls); word-spacing:var(--ws); }
body.rc-short .tl-passage p, body.rc-short .q-stem, body.rc-short .explain p, body.rc-short .lcard p, body.rc-short .rs-preview p{ max-width:34em; }
body.rc-upright i, body.rc-upright em, body.rc-upright cite, body.rc-upright var{ font-style:normal; }
body.rc-upright *{ text-transform:none !important; }
body.rc-t-peach:not(.lowglare){ --paper:#F7E6D8; --card:#FCF1E7; }
body.rc-t-yellow:not(.lowglare){ --paper:#F6EFCF; --card:#FCF8E4; }
body.rc-t-gray:not(.lowglare){ --paper:#E9E8E5; --card:#F4F3F1; }

/* ---------- test-day-style tools ---------- */
.bb-row{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 10px; }
.bb-b{ margin:0; min-height:44px; padding:6px 12px; font-size:.8em; font-weight:600; background:var(--card); color:var(--accent); border:2px solid var(--line); border-radius:10px; }
.bb-b[aria-pressed=true]{ background:var(--soft); border-color:var(--accent); font-weight:700; }
.bb-b[hidden], .ra-b[hidden]{ display:none; }
.bb-msg{ flex-basis:100%; }
body.bb-elim .choice{ display:inline-block; width:calc(100% - 118px); max-width:calc(100% - 118px); vertical-align:middle; box-sizing:border-box; }
.bb-x{ display:inline-block; vertical-align:middle; min-height:44px; min-width:100px; margin:8px 0 8px 8px; padding:6px 10px; font-size:.8em; font-weight:600; background:var(--card); color:var(--accent); border:2px solid var(--accent); border-radius:10px; white-space:nowrap; }
.bb-x[aria-pressed=true]{ background:var(--soft); }
.choice.bb-struck{ text-decoration:line-through; text-decoration-thickness:2px; color:var(--muted); opacity:.75; }
.bb-elim-tip{ margin:0 0 10px; }
::highlight(bb-hl){ background-color:var(--bb-hl); color:inherit; }

/* ---------- Line guide / line reader ---------- */
@media print{ .ra-listen, .ra-dock, .bb-ui, .bb-lr{ display:none !important; } }
/* Oct 19: drawn inside the passage/question box over its reading text only (passage text, stem, choices), so it scrolls with the text */
.bb-lr-host{ position:relative; }
.bb-lr{ position:absolute; z-index:4; pointer-events:none; }
.bb-lr[hidden]{ display:none; }
/* Oct 20 (Lisa): a light veil, not solid grey. About 40% of the card color plus a faint 8% shade, so dimmed text stays readable
   and the answer choices are easy to see; the veil never takes clicks (the whole guide is pointer-events:none except its buttons). */
.bb-lr-top, .bb-lr-bot{ position:absolute; left:0; right:0; pointer-events:none; background:rgba(246,246,248,.45);
  background:linear-gradient(rgba(40,40,48,.08),rgba(40,40,48,.08)),color-mix(in srgb,var(--card,#fff) 40%,transparent); }
body.lowglare .bb-lr-top, body.lowglare .bb-lr-bot{ background:rgba(0,0,0,.35); background:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1)),color-mix(in srgb,var(--card,#222) 40%,transparent); }
.bb-lr-top{ top:0; } .bb-lr-bot{ bottom:0; }
.bb-lr-band{ position:absolute; left:0; right:0; border-top:2px solid var(--accent); border-bottom:2px solid var(--accent); background:rgba(217,232,248,.18); }
.bb-lr-under .bb-lr-top, .bb-lr-under .bb-lr-bot{ display:none; }
.bb-lr-under .bb-lr-band{ border-top:0; border-bottom:3px solid var(--accent); background:none; }
/* Oct 19: the controls sit in a gutter to the right of the text column, beside the band, so they never cover text */
.bb-lr-gutter{ padding-right:58px !important; }
/* Oct 27 (learn-card fix): with the guide on a lesson card, Listen gets its own row above the text, so the band's lines never cross it */
.lcard.bb-lr-gutter > .ra-listen{ display:flex; width:max-content; max-width:100%; margin-bottom:12px; }
.bb-lr-ctl{ pointer-events:auto; position:absolute; left:calc(100% + 7px); top:-2px; display:flex; flex-direction:column; gap:4px; }
.bb-lr-ctl-up .bb-lr-ctl{ top:auto; bottom:-2px; }
.bb-lr-handle, .bb-lr-btn{ min-height:44px; min-width:44px; width:44px; margin:0; padding:4px 0; font-size:.85em; border-radius:10px; background:var(--card); }
.bb-lr-handle{ touch-action:none; cursor:ns-resize; }
@media (min-width:900px){ .bb-lr-btn[data-lr=up], .bb-lr-btn[data-lr=down]{ display:none; } }
.bb-marked-note{ margin-top:10px; }

/* Nov 10, 2026: Not now on the Read-along tip */
.ra-tip-off{ white-space:nowrap; margin-left:.35em; color:var(--muted); }
