/* The GCSE book (public/courses/gcse/). Hand-maintained, like style.css.
   Loaded only by book pages, after style.css.

   COLOUR TOKENS: every pairing below was computed (WCAG relative luminance), not eyeballed.
   Strand/status colours as text on white / paper (#f8f5ee) / paper-dim (#efe9db):
     number      #1a5bb0   6.63 / 6.09 / 5.48
     algebra     #6a3aa2   7.66 / 7.04 / 6.33
     ratio       #a14400   6.28 / 5.77 / 5.19
     geometry    #1c7338   5.90 / 5.42 / 4.87
     probability #ad1f5c   6.71 / 6.17 / 5.55
     statistics  #7a5800   6.51 / 5.98 / 5.38
     term (teal) #0a6a6a   6.40 / 5.88 / 5.28
     right       #15702f   6.19 / 5.69 / 5.12
     oops        #a8321f   6.69 / 6.14 / 5.52
   Each strand colour on its own tint (the chip background) is 5.10 or better,
   body ink (#1b2430) on any tint is 12.9 or better, and white text on a strand
   colour is the same figure as the "on white" column. Colour is never the only
   signal: chips carry the strand name, answers carry words and a tick/cross. */

:root{
  --c-number:#1a5bb0;      --t-number:#e4eefb;
  --c-algebra:#6a3aa2;     --t-algebra:#efe7f8;
  --c-ratio:#a14400;       --t-ratio:#fbeadb;
  --c-geometry:#1c7338;    --t-geometry:#e1f3e6;
  --c-probability:#ad1f5c; --t-probability:#fbe3ee;
  --c-statistics:#7a5800;  --t-statistics:#f6ecc9;
  --c-term:#0a6a6a;        --t-term:#dff1f1;
  --c-right:#15702f;       --t-right:#e1f3e6;
  --c-oops:#a8321f;        --t-oops:#fbe6e1;
  --strand:var(--gold);
  --tint:var(--paper-dim);
}

.book .strand-number,.book.strand-number{--strand:var(--c-number);--tint:var(--t-number);}
.book.strand-algebra{--strand:var(--c-algebra);--tint:var(--t-algebra);}
.book.strand-ratio{--strand:var(--c-ratio);--tint:var(--t-ratio);}
.book.strand-geometry{--strand:var(--c-geometry);--tint:var(--t-geometry);}
.book.strand-probability{--strand:var(--c-probability);--tint:var(--t-probability);}
.book.strand-statistics{--strand:var(--c-statistics);--tint:var(--t-statistics);}

.sr,.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.muted{color:var(--ink-soft);font-size:.95rem;}

.book section{padding:44px 0;}
.book .wrap.narrow{max-width:800px;}
.book h2{margin-top:0;}
.book h3{margin-top:1.4em;}
.book .hero h1{margin-bottom:.35em;}
.book-hero{padding:48px 0 54px;border-bottom:6px solid var(--strand);}
.book-hero .wrap{display:block;}
.btn-ghost-dark{border-color:var(--navy);color:var(--navy);}
.btn-ghost-dark:hover{border-color:var(--gold);color:var(--navy-dark);background:var(--paper-dim);}
.book a:focus-visible,.book button:focus-visible,.book input:focus-visible,.book select:focus-visible,.book summary:focus-visible{outline:3px solid var(--navy);outline-offset:2px;border-radius:4px;}

.crumbs{font-size:.9rem;margin-bottom:22px;color:var(--ink-soft);}
.crumbs a{color:var(--navy-mid);}

/* ---------- strand chips ---------- */
.chip{display:inline-block;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:2px 10px;border-radius:999px;border:1px solid currentColor;vertical-align:middle;}
.chip-number{background:var(--t-number);color:var(--c-number);}
.chip-algebra{background:var(--t-algebra);color:var(--c-algebra);}
.chip-ratio{background:var(--t-ratio);color:var(--c-ratio);}
.chip-geometry{background:var(--t-geometry);color:var(--c-geometry);}
.chip-probability{background:var(--t-probability);color:var(--c-probability);}
.chip-statistics{background:var(--t-statistics);color:var(--c-statistics);}
.chip-higher{background:var(--navy);color:var(--white);border-color:var(--navy);}
.legend{list-style:none;display:flex;flex-wrap:wrap;gap:10px;padding:0;margin:26px 0 0;}
.soon{display:inline-block;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--ink-soft);border:1px dashed var(--ink-soft);border-radius:999px;padding:0 8px;margin-left:6px;}

/* ---------- mathematical words ---------- */
.term{color:var(--c-term);font-weight:600;text-decoration:underline dotted 2px;text-underline-offset:4px;background:var(--t-term);border-radius:3px;padding:0 2px;cursor:help;}
.term:hover{color:var(--navy-dark);}
.term-sample{color:var(--c-term);background:var(--t-term);border-radius:3px;padding:0 4px;font-weight:700;}
.term-pop{position:absolute;z-index:100;max-width:min(22rem,calc(100vw - 16px));background:var(--navy);color:var(--white);border-radius:10px;padding:14px 16px;box-shadow:var(--shadow);font-size:.95rem;line-height:1.5;}
.term-pop-def{display:block;margin-bottom:8px;}
.term-pop-more{color:var(--gold-light);font-weight:700;}
.term-pop-more:hover{color:var(--white);}

/* ---------- fractions (stacked) ---------- */
.frac{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;text-align:center;line-height:1.15;font-size:.92em;margin:0 .12em;}
.frac .fn{padding:0 .2em;border-bottom:1.5px solid currentColor;}
.frac .fd{padding:0 .2em;}

/* ---------- building blocks ---------- */
.key{background:var(--tint);border-left:6px solid var(--strand);border-radius:0 var(--radius) var(--radius) 0;padding:14px 20px;margin:20px 0;}
.key p{margin:0;color:var(--ink);}
.sum-line{font-family:"Fraunces",Georgia,serif;font-size:1.5rem;color:var(--strand);font-weight:600;text-align:center;margin:18px 0;}
.worked{background:var(--white);border:1px solid var(--line);border-top:5px solid var(--strand);border-radius:var(--radius);padding:16px 22px 8px;margin:22px 0;box-shadow:var(--shadow);}
.worked h3{margin:0 0 .5em;font-size:1.05rem;color:var(--strand);}
.worked.faded{border-top-style:dashed;}
.steps{counter-reset:step;list-style:none;padding:0;margin:0 0 12px;}
.steps li{counter-increment:step;position:relative;padding:0 0 10px 38px;color:var(--ink);}
.steps li::before{content:counter(step);position:absolute;left:0;top:0;width:26px;height:26px;border-radius:50%;background:var(--strand);color:var(--white);font-weight:700;font-size:.85rem;display:grid;place-items:center;}
.pairs{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:18px 0;}
.pairs div{background:var(--tint);border-radius:var(--radius);padding:10px 14px;text-align:center;color:var(--ink);}
.flip-section{background:linear-gradient(180deg,var(--tint),var(--paper));}
.flip-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:18px 0;}
@media (max-width:640px){.flip-grid{grid-template-columns:1fr;}}
.flip-side{background:var(--white);border:2px solid var(--strand);border-radius:var(--radius);padding:6px 20px;}
.flip-side:last-child{border-style:dashed;}
.flip-side h3{margin-top:.7em;color:var(--strand);}
.tick.traps li::before{content:"!";color:var(--c-oops);}
.figure{margin:22px 0;text-align:center;}
.figure figcaption{color:var(--ink-soft);font-size:.92rem;}
.pyth-svg{width:100%;max-width:360px;height:auto;margin:0 auto;}
.pyth-svg .sq{stroke:var(--navy);stroke-width:2;}
.pyth-svg .sq-1{fill:#e4eefb;}
.pyth-svg .sq-2{fill:#fbeadb;}
.pyth-svg .sq-3{fill:#e1f3e6;}
.pyth-svg .tri{fill:var(--white);stroke:var(--navy);stroke-width:3;}
.pyth-svg .rt{fill:none;stroke:var(--navy);stroke-width:2;}
.pyth-svg .svg-t{font:700 15px "Source Sans 3",sans-serif;fill:var(--ink);}
.checklist{list-style:none;padding:0;margin:0 0 16px;}
.checklist li{margin-bottom:8px;}
.checklist label{display:flex;gap:12px;align-items:flex-start;color:var(--ink);cursor:pointer;}
.checklist input{width:22px;height:22px;flex:none;margin-top:2px;accent-color:var(--strand);}
.method{padding-left:1.3em;}
.method li{margin-bottom:10px;color:var(--ink-soft);}
.method li b{color:var(--ink);}
.how-card h3{margin-top:0;color:var(--navy);}
.steps-grid .step h3{margin-top:0;color:var(--navy);}
.steps-grid .step p{font-size:.97rem;}
.progress-line{color:#d9e0ea;font-size:.95rem;display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.bar{display:inline-block;width:160px;height:12px;border-radius:999px;background:rgba(255,255,255,.2);overflow:hidden;}
.bar-fill{display:block;height:100%;background:var(--gold);}

/* ---------- before you start / unlocks ---------- */
.bys{background:var(--white);border:1px solid var(--line);border-left:6px solid var(--strand);border-radius:var(--radius);padding:8px 24px 14px;margin:22px 0;}
.bys h2{font-size:1.2rem;margin-top:12px;}
.needs{list-style:none;padding:0;margin:0 0 10px;display:grid;gap:8px;}
.needs li{color:var(--ink);}
.needs li.planned{color:var(--ink-soft);}

/* ---------- pyramid ---------- */
.pyramid{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px;}
.pyr-layer{padding:0;}
.layer-label{font-family:"Source Sans 3",sans-serif;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft);margin:10px 0 6px;text-align:center;font-weight:700;}
.pyr-row{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:12px;justify-content:center;}
.pyr-node{flex:0 1 230px;background:var(--white);border:1px solid var(--line);border-left:7px solid var(--strand);border-radius:10px;padding:0;display:flex;flex-direction:column;}
.pyr-node.strand-number{--strand:var(--c-number);}
.pyr-node.strand-algebra{--strand:var(--c-algebra);}
.pyr-node.strand-ratio{--strand:var(--c-ratio);}
.pyr-node.strand-geometry{--strand:var(--c-geometry);}
.pyr-node.strand-probability{--strand:var(--c-probability);}
.pyr-node.strand-statistics{--strand:var(--c-statistics);}
.pyr-node a,.planned-node{display:block;padding:12px 14px 8px;text-decoration:none;color:var(--ink);flex:1;}
.pyr-node.live{box-shadow:var(--shadow);}
.pyr-node.live a:hover{background:var(--paper);}
.node-title{display:block;font-weight:700;font-family:"Fraunces",Georgia,serif;color:var(--strand);font-size:1.05rem;line-height:1.2;}
.needs-line{display:block;font-size:.8rem;color:var(--ink-soft);margin-top:4px;}
.pyr-node.planned{background:var(--paper-dim);border-style:dashed;border-left-style:solid;}
.pyr-node.planned .node-title{color:var(--ink-soft);}
.node-progress{display:block;padding:0 14px 10px;font-size:.82rem;font-weight:700;color:var(--ink-soft);}
.node-progress.has-progress{color:var(--c-right);}

/* ---------- questions ---------- */
.ckw{background:var(--tint);border-top:1px solid var(--line);border-bottom:1px solid var(--line);}
.ckw h2::before{content:"\270E\00a0";color:var(--strand);}
.ckw .intro{color:var(--ink);}
.exam-section{background:var(--paper-dim);border-top:4px double var(--navy);}
.q{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:16px 20px;margin:16px 0;box-shadow:var(--shadow);counter-increment:qn;}
.q.q-correct{border-color:var(--c-right);border-left:6px solid var(--c-right);}
.qtext{color:var(--ink);font-size:1.02rem;margin-bottom:.8em;}
.qnum{display:inline-block;min-width:1.7em;height:1.7em;line-height:1.7em;margin-right:8px;border-radius:50%;background:var(--strand);color:var(--white);text-align:center;font-weight:700;font-size:.85rem;}
.q-form{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:8px;}
.q-input{flex:1 1 180px;min-width:0;font:inherit;font-size:1.05rem;padding:10px 12px;border:2px solid var(--navy-mid);border-radius:8px;background:var(--white);color:var(--ink);}
.q-input:read-only{background:var(--t-right);border-color:var(--c-right);}
.blank-input{font:inherit;color:var(--ink);text-align:center;min-height:36px;padding:2px 6px;margin:0 .15em;border:2px solid var(--navy-mid);border-radius:8px;background:var(--white);vertical-align:baseline;max-width:100%;}
.blank-input:read-only{background:var(--t-right);border-color:var(--c-right);}
.blank-input.blank-wrong{background:var(--t-oops);border-color:var(--c-oops);}
.blank-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:0 0 12px;}
.blank-status{margin:0;font-weight:600;color:var(--ink);}
.blank-status.blank-ok{color:var(--c-right);}
.btn-check,.btn-stuck,.mc-option{font:inherit;cursor:pointer;min-height:44px;}
/* The symbol row always takes its room and is only shown while you are typing. If it came and went with focus, pressing
   "Give me a clue" (which takes focus away from the box) moved the button 54px between mouse-down and mouse-up, so the first press was lost. */
.sym-row{display:flex;visibility:hidden;gap:6px;width:100%;}
.q-form:focus-within .sym-row{visibility:visible;}
.q-correct .sym-row{display:none !important;}
.sym-btn{font:inherit;font-weight:700;min-width:44px;min-height:44px;border:2px solid var(--navy-mid);border-radius:10px;background:var(--white);color:var(--navy);cursor:pointer;}
.sym-btn:hover{background:var(--paper-dim);}
.duck-typed summary{cursor:pointer;color:var(--navy);font-weight:700;min-height:44px;display:flex;align-items:center;}
@media (max-width:640px){.q-live:not(.q-correct) .q-form .sym-row{display:flex;visibility:visible;}
.q-live .q-form{position:sticky;bottom:0;background:var(--paper);padding:8px 0;z-index:5;}}
.btn-check{background:var(--navy);color:var(--white);border:2px solid var(--navy);border-radius:999px;padding:9px 22px;font-weight:700;}
.btn-check:hover{background:var(--navy-mid);}
.btn-stuck{background:var(--white);color:var(--navy);border:2px dashed var(--navy-mid);border-radius:999px;padding:7px 18px;font-weight:700;font-size:.92rem;}
.btn-stuck:hover:not(:disabled){background:var(--paper-dim);}
.btn-stuck:disabled{color:var(--ink-soft);border-color:var(--line);cursor:default;}
.q-feedback{min-height:1.4em;margin:6px 0;font-weight:600;color:var(--ink);}
.q-feedback.ok{color:var(--c-right);}
.q-feedback.ok::before{content:"\2713\00a0";}
.q-feedback.oops{color:var(--c-oops);}
.q-feedback.oops::before{content:none;}
.mc{display:grid;gap:8px;margin-bottom:6px;}
.mc-option{text-align:left;background:var(--white);color:var(--ink);border:2px solid var(--navy-mid);border-radius:10px;padding:10px 14px;}
.mc-option:hover{background:var(--paper-dim);}
.mc-option.is-right{background:var(--t-right);border-color:var(--c-right);}
.mc-option.is-right::after{content:"  \2713 correct";font-weight:700;color:var(--c-right);}
.mc-option.is-wrong{background:var(--t-oops);border-color:var(--c-oops);}
.mc-option.is-wrong::after{content:"  not this one";font-weight:700;color:var(--c-oops);}
/* Hints are lettered A, B, C with a clear gap, so a hint that starts with a number is never mistaken for a list number (1. 2 + 5 looks like 1.2). */
.rungs{margin:12px 0 0;padding:0;list-style:none;counter-reset:hint;color:var(--ink);}
.rungs li{counter-increment:hint;position:relative;margin-bottom:10px;background:var(--t-term);border-radius:8px;padding:10px 14px 10px 6.2em;}
/* The clue letter is drawn here for sighted readers (empty alt text after the slash) and written in words by the script, so a screen reader says "Clue A" once. */
.rungs li::before{content:"Clue " counter(hint, upper-alpha);content:"Clue " counter(hint, upper-alpha) / "";position:absolute;left:14px;top:10px;font-weight:700;color:var(--c-term);white-space:nowrap;}
/* Where there is little room (a phone, or the wider easy-read font) the label sits on its own line, so it can never touch the words. */
@media (max-width:480px){.rungs li,.q .ladder li{padding-left:14px;}.rungs li::before,.q .ladder li::before{position:static;display:block;margin-bottom:2px;}}
html.read-easy .rungs li,html.read-easy .q .ladder li{padding-left:14px;}
html.read-easy .rungs li::before,html.read-easy .q .ladder li::before{position:static;display:block;margin-bottom:2px;}
.rungs li.ask-rung::before{content:none;}
.rungs li.ask-rung{padding-left:14px;counter-increment:none;}
.q .solution{border-top:2px dashed var(--line);margin-top:12px;padding-top:6px;}
.q .solution::before{content:"Why:";font-weight:700;color:var(--strand);display:block;}
.q .solution p{color:var(--ink);margin-bottom:.5em;}
.q .ladder{padding:0;list-style:none;counter-reset:hint;color:var(--ink);}
.q .ladder::before{content:"Clues";display:block;font-weight:700;margin-bottom:4px;color:var(--c-term);}
.q .ladder li{counter-increment:hint;position:relative;margin-bottom:8px;padding-left:5.6em;}
.q .ladder li::before{content:"Clue " counter(hint, upper-alpha);position:absolute;left:0;font-weight:700;color:var(--c-term);white-space:nowrap;}
.q .wrong{padding-left:1.3em;color:var(--c-oops);}
.q .options{padding-left:1.3em;color:var(--ink);}

/* With the script running, hints and answers wait until asked for. Without it, everything shows. */
.js .q .ladder,.js .q .wrong,.js .q .options,.js .q .solution{display:none;}
.js .q .solution.open{display:block;}

/* Reviewer mode (?review=1): everything open, with labels for what each part is. */
.js.review .q .ladder,.js.review .q .wrong,.js.review .q .options,.js.review .q .solution{display:block;}
.review .q .wrong::before{content:"If the student types:";display:block;font-weight:700;}
.review .q .wrong li::before{content:attr(data-if) " \2192 ";font-weight:700;}
.review .q .options::before{content:"Options (the marked one is correct):";display:block;font-weight:700;}
.review .q .options li[data-correct]::after{content:" \2714 correct";font-weight:700;}
.review .q .options li[data-why]::after{content:" \2192 " attr(data-why);color:var(--ink-soft);}
.review-answer{margin:8px 0;padding:6px 10px;border-left:4px solid var(--navy-mid);background:var(--paper);color:var(--ink);font-weight:700;}
.review-banner{margin:0 0 16px;padding:10px 14px;border:2px solid var(--navy-mid);border-radius:8px;background:var(--paper);color:var(--ink);font-weight:700;}

/* ---------- kitchen scale and geometry figures ---------- */
.scale-svg,.geo-svg{width:100%;max-width:420px;height:auto;margin:0 auto;display:block;}
.scale-svg .base,.scale-svg .post{fill:var(--navy);}
.scale-svg .beam{stroke:var(--navy);stroke-width:7;stroke-linecap:round;}
.scale-svg .pivot{fill:var(--gold);stroke:var(--navy);stroke-width:3;}
.scale-svg .cord{stroke:var(--navy-mid);stroke-width:2;}
.scale-svg .pan{fill:#efe9db;stroke:var(--navy);stroke-width:3;}
.scale-svg .wt{stroke:var(--navy);stroke-width:2;}
.scale-svg .wt-x{fill:#efe7f8;}
.scale-svg .wt-n{fill:#fbeadb;}
.scale-svg .wlab{font:700 17px "Source Sans 3",sans-serif;fill:var(--ink);}
.scale-svg .eq-sign{font:700 28px "Fraunces",Georgia,serif;fill:var(--c-algebra);}
.geo-svg .ln{stroke:var(--navy);stroke-width:3;stroke-linecap:round;}
.geo-svg .arc{fill:none;stroke:var(--c-geometry);stroke-width:3;}
.geo-svg .tri{fill:#e1f3e6;stroke:var(--navy);stroke-width:3;}
.geo-svg .arrow{fill:none;stroke:var(--navy);stroke-width:2.5;}
.geo-svg .svg-t{font:700 17px "Source Sans 3",sans-serif;fill:var(--ink);}

/* ---------- the "think it through" clue ---------- */
/* Contrast: ink #1b2430 on #fff7d6 14.55; clue label teal #0a6a6a on #fff7d6 5.95. */
.rungs li.duck-rung{background:#fff7d6;border:2px dashed var(--c-statistics);}
.duck-body-text{flex:1;min-width:0;}
.duck-body-text p{color:var(--ink);margin-bottom:.5em;}
.duck-prompts{margin:.2em 0 .8em;padding-left:1.3em;color:var(--ink);}
.duck-text{width:100%;font:inherit;padding:10px 12px;border:2px solid var(--navy-mid);border-radius:8px;background:var(--white);color:var(--ink);resize:vertical;}
.duck-note{font-size:.88rem;}


/* ---------- feedback: nearly (right value, different form), facts lists, listen ---------- */
.q-feedback.nearly{color:#7a4a00;}
.q-feedback.nearly::before{content:"\2192\00a0Nearly: ";font-weight:700;}
.facts{list-style:none;margin:0 0 .8em;padding:8px 14px;background:var(--paper);border-left:4px solid var(--strand);border-radius:0 8px 8px 0;}
.facts li{color:var(--ink);margin:2px 0;}
.listen{font:inherit;font-size:.78rem;font-weight:700;margin-left:10px;padding:1px 10px;min-height:44px;border:1.5px solid var(--navy-mid);border-radius:999px;background:var(--white);color:var(--navy);cursor:pointer;vertical-align:middle;}
.listen:hover{background:var(--paper-dim);}
.duck-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px;}
.duck-chip{font:inherit;font-size:.88rem;padding:4px 12px;min-height:44px;border:1.5px solid var(--navy-mid);border-radius:999px;background:var(--white);color:var(--navy);cursor:pointer;}
.duck-chip:hover{background:var(--paper-dim);}

/* ---------- reading options ---------- */
.read-tools{max-width:800px;margin:0 auto;padding:6px 24px;}
.read-tools summary{cursor:pointer;font-weight:700;color:var(--navy);padding:6px 0;}
.read-tools{box-sizing:border-box;max-width:100%;}
.read-row{display:flex;flex-wrap:wrap;gap:8px;padding:6px 0 10px;max-width:100%;}
.read-row > *{max-width:100%;}
.read-row select{max-width:100%;}
.read-row label{display:flex;flex-wrap:wrap;align-items:center;gap:6px;}
.read-btn{font:inherit;font-size:.92rem;padding:6px 14px;border:2px solid var(--navy-mid);border-radius:999px;background:var(--white);color:var(--navy);cursor:pointer;}
.read-btn:hover{background:var(--paper-dim);}
.read-btn[aria-pressed="true"]{background:var(--navy);color:var(--white);}
html.read-big1{font-size:112.5%;}
html.read-big2{font-size:125%;}
html.read-big3{font-size:150%;}
html.read-easy body,html.read-easy .book{font-family:Verdana,"Trebuchet MS",Tahoma,sans-serif;line-height:1.9;letter-spacing:.03em;word-spacing:.12em;}
html.read-easy .book h1,html.read-easy .book h2,html.read-easy .book h3,html.read-easy .node-title,html.read-easy .sum-line{font-family:Verdana,"Trebuchet MS",Tahoma,sans-serif;letter-spacing:.02em;}
html.read-easy .book p,html.read-easy .book li{max-width:68ch;}
html.read-tint body{background:#fdf1d6;}
html.read-tint .book .card,html.read-tint .book .q,html.read-tint .book .worked,html.read-tint .book .bys,html.read-tint .book .g-entry{background:#fffaf0;}
.read-ruler{position:fixed;left:0;right:0;top:-100px;height:2.6em;background:rgba(255,235,120,.28);border-top:2px solid rgba(122,88,0,.45);border-bottom:2px solid rgba(122,88,0,.45);pointer-events:none;display:none;z-index:60;}
html.read-ruler-on .read-ruler{display:block;}

/* ---------- mixed practice ---------- */
.practice-topics{border:1px solid var(--line);border-radius:var(--radius);background:var(--white);padding:10px 16px 14px;margin:14px 0;}
.practice-topics legend{font-weight:700;color:var(--navy);padding:0 6px;}
.practice-topics ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:4px 16px;}
.practice-topics label{display:flex;gap:8px;align-items:center;color:var(--ink);}
.practice-topics input{width:20px;height:20px;accent-color:var(--navy);}
.practice-status{color:var(--ink);font-weight:600;}
.words-strip{background:var(--white);border:1px solid var(--line);border-left:6px solid var(--c-term);border-radius:var(--radius);padding:8px 22px 12px;margin:18px 0;}
.words-strip h2{font-size:1.15rem;margin-top:10px;}
.words-strip dl{margin:0;display:grid;gap:6px;}
.words-strip dt{font-weight:700;}
.words-strip dd{margin:0 0 4px;color:var(--ink);}

/* ---------- display fixes (from the UX review) ---------- */
/* The site header is sticky on the main site; on book pages it would take a quarter of a phone screen. */
body .site-header{position:static;}
body .site-header .wrap{padding-top:8px;padding-bottom:8px;gap:8px;}
body .header-cta,body .brand{min-height:44px;display:inline-flex;align-items:center;}
body nav.mainnav a{display:inline-flex;align-items:center;min-height:44px;}
@media (max-width:700px){
  nav.mainnav ul{gap:4px 14px;}
  .brand svg{width:34px;height:34px;}
}
.read-tools summary{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:2px solid var(--navy);border-radius:999px;background:var(--white);color:var(--navy);list-style:none;}
.read-tools summary::-webkit-details-marker{display:none;}
.read-tools summary::before{content:"Aa";font-family:"Fraunces",Georgia,serif;font-weight:700;font-size:1.1rem;}
.read-tools[open] summary{background:var(--navy);color:var(--white);}
.read-btn{min-height:44px;}
.read-btn[aria-pressed="true"]::before{content:"\2713\00a0";}
.read-btn[aria-pressed="false"]::before{content:"Off:\00a0";font-weight:400;}
.read-btn[aria-pressed="true"]::before{content:"On:\00a0 \2713\00a0";font-weight:700;}
.read-size{align-self:center;font-weight:600;color:var(--ink);min-width:7.5em;}
.read-reset{border-color:transparent;background:none;text-decoration:underline;}
@media (max-width:560px){.read-row{display:grid;grid-template-columns:1fr 1fr;}}
.read-ruler{background:rgba(255,224,70,.38);border-top:2px solid rgba(150,105,0,.8);border-bottom:2px solid rgba(150,105,0,.8);mix-blend-mode:multiply;}
.toc{max-width:800px;margin:0 auto;padding:4px 24px;}
.fast-route{max-width:800px;margin:6px auto 0;padding:4px 24px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
.fast-label{font-weight:700;color:var(--navy);}
.fast-link,.fast-toggle{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border:2px solid var(--navy-mid);border-radius:999px;background:var(--white);color:var(--navy);font:inherit;font-weight:700;text-decoration:none;cursor:pointer;}
.fast-toggle[aria-pressed="true"]{background:var(--navy);color:var(--white);}
.fast-route-on details.recap,.fast-route-on section.ckw:not(.going-further),.fast-route-on section.warmup-sec{display:none;}
.timed-panel{padding:18px 0;background:var(--paper-dim);}
.timed-clock{font-size:1.6rem;font-weight:800;color:var(--navy);margin:10px 0 2px;}
.timed-status{font-weight:700;margin:2px 0 10px;}
.diag-progress{font-weight:700;color:var(--navy);margin:12px 0 4px;}
.qtable-wide{overflow-x:auto;max-width:100%;}
.key-table{border-collapse:collapse;width:100%;font-size:.95rem;}
.key-table caption{text-align:left;font-weight:700;color:var(--navy);padding:6px 0;}
.key-table th,.key-table td{border:1px solid var(--line);padding:6px 10px;text-align:left;vertical-align:top;}
.key-table thead th{background:var(--navy);color:var(--white);}
.key-table tbody th{background:var(--paper-dim);font-weight:700;}
.key-scheme{margin:6px 0 0;padding-left:1.2em;font-size:.88rem;color:var(--ink-soft);}
.markscheme{list-style:none;padding-left:0;}
.markscheme li{margin:6px 0;}
.mark-box{width:22px;height:22px;vertical-align:middle;margin-right:6px;accent-color:var(--navy);}
.mark-total{font-weight:700;color:var(--navy);margin-top:10px;}
.qtag{display:inline-block;font-size:.82rem;font-weight:700;padding:1px 9px;border-radius:999px;border:1.5px solid var(--navy-mid);color:var(--navy);background:var(--white);margin-right:4px;vertical-align:middle;}
.qtag-from{text-decoration:none;}
.toc summary{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:2px solid var(--navy-mid);border-radius:999px;background:var(--white);color:var(--navy);font-weight:700;cursor:pointer;}
.toc ol{columns:2 260px;column-gap:28px;margin:10px 0 6px;padding-left:1.4em;}
.toc li{margin-bottom:6px;break-inside:avoid;}
.toc a{display:inline-block;padding:4px 0;min-height:32px;color:var(--navy);}
.to-top{position:fixed;right:14px;bottom:14px;z-index:70;min-height:44px;min-width:44px;padding:0 16px;border:2px solid var(--navy);border-radius:999px;background:var(--white);color:var(--navy);font:inherit;font-weight:700;box-shadow:var(--shadow);cursor:pointer;}
@media (max-width:640px){.to-top{bottom:150px;}}
.q-feedback.ok::before{content:"\2713\00a0 ";}
.q-feedback.oops::before{content:none;}
.q-feedback.nearly::before{content:"\2248\00a0Nearly: ";font-weight:700;}
.q-help{margin-top:12px;}
.duck-note{font-size:.95rem;color:var(--ink);}
.scale-svg .wlab{font-size:20px;}
.scale-svg .eq-sign{transform:translateY(16px);}
.geo-svg .svg-t{font-size:19px;}

/* ---------- question figures ---------- */
.qfig{margin:6px 0 12px;text-align:center;}
.qfig svg{width:100%;max-width:320px;height:auto;}
.qfig figcaption{font-size:.88rem;color:var(--ink-soft);}
.qfig .tri{fill:#e1f3e6;stroke:var(--navy);stroke-width:3;}
.qfig .sq{fill:#e4eefb;stroke:var(--navy);stroke-width:2.5;}

.g-line{display:block;margin-top:3px;}
.g-line:first-of-type{margin-top:4px;}
.term-pop-fig{display:block;background:#fff;border-radius:8px;padding:4px;margin:6px 0;}
.term-pop-fig svg{width:100%;max-width:200px;height:auto;display:block;margin:0 auto;}
.read-select{display:inline-flex;align-items:center;gap:6px;color:var(--ink);font-weight:600;}
.read-select select{font:inherit;min-height:44px;padding:0 8px;border:2px solid var(--navy-mid);border-radius:8px;background:var(--white);color:var(--ink);max-width:220px;}
.g-fig{max-width:200px;margin:4px 0 8px;background:var(--paper);border-radius:8px;padding:4px;}
.g-fig svg{width:100%;height:auto;display:block;}
.geo-svg .hyp{stroke:#ad1f5c;stroke-width:5;}
.dq{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:14px 18px;margin:12px 0;}
.dq .q-input{width:100%;max-width:260px;}
.diag-results{margin:18px 0;}
.diag-results h2{font-size:1.3rem;}
.diag-start{padding-left:1.4em;}
.diag-start li{margin-bottom:6px;}
.diag-list{list-style:none;margin:0 0 8px;padding:0;}
.diag-list li{display:flex;gap:10px;align-items:center;margin:4px 0;color:var(--ink);}
.diag-list .bar{background:var(--line);}
.diag-list .bar-fill{background:var(--c-right);}
.book[data-book-page="practice"] .qnum,.book[data-book-page="diagnostic"] .qnum,.book[data-book-page="stretch"] .qnum,.book[data-book-page="foundation"] .qnum,.book[data-book-page="parents"] .qnum{background:var(--navy);}
.skip-link{position:absolute;left:-999px;top:8px;z-index:200;background:var(--navy);color:var(--white);padding:10px 16px;border-radius:8px;font-weight:700;}
.skip-link:focus{left:8px;}
body :focus-visible{outline:3px solid #0f2440;outline-offset:2px;}
.term-pop a:focus-visible{outline-color:#fff;}
.site-header :focus-visible,footer :focus-visible{outline-color:#e4c886;}
footer li a{display:inline-block;padding:.45rem .25rem;}
.g-tools input,.g-tools select{max-width:100%;box-sizing:border-box;}
.q-feedback.ok::before{content:"\2713\00a0 ";content:"\2713\00a0 " / "";}
.q-feedback.oops::before{content:none;}
.q-feedback.nearly::before{content:"\2248\00a0Nearly: ";content:"\2248\00a0Nearly: " / "";}
/* ---------- glossary ---------- */
.glossary .g-letter{padding:0;margin-top:28px;}
.g-letter-h{font-size:2.2rem;color:var(--gold);border-bottom:2px solid var(--gold);margin:0 0 10px;}
.g-entry{background:var(--white);border:1px solid var(--line);border-left:7px solid var(--strand);border-radius:var(--radius);padding:4px 22px 10px;margin:14px 0;}
.g-entry:target{box-shadow:0 0 0 3px var(--navy);}
.g-entry.strand-number{--strand:var(--c-number);}
.g-entry.strand-algebra{--strand:var(--c-algebra);}
.g-entry.strand-ratio{--strand:var(--c-ratio);}
.g-entry.strand-geometry{--strand:var(--c-geometry);}
.g-entry.strand-probability{--strand:var(--c-probability);}
.g-entry.strand-statistics{--strand:var(--c-statistics);}
.g-entry h3{margin:.7em 0 .3em;font-size:1.3rem;color:var(--strand);}
.g-entry p{color:var(--ink);margin-bottom:.5em;}
.g-def{font-size:1.04rem;}
.g-example{background:var(--paper);border-radius:8px;padding:8px 12px;}
.g-watch b{color:var(--c-oops);}
.g-flip b{color:var(--c-term);}
.g-used{font-size:.9rem;color:var(--ink-soft);}
.g-tools{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;margin:16px 0;}
.g-tools select,.g-tools input{font:inherit;padding:8px 10px;border:2px solid var(--navy-mid);border-radius:8px;background:var(--white);color:var(--ink);}
.g-count{margin:0;color:var(--ink-soft);flex-basis:100%;}
.g-jump a{display:inline-block;padding:2px 8px;font-weight:700;}
[hidden]{display:none !important;}

/* ---------- calculator (only inside questions where one is allowed) ---------- */
.q-calc{margin:10px 0;}
.btn-calc{font:inherit;font-weight:700;min-height:44px;padding:8px 16px;border:2px solid var(--navy-mid);border-radius:10px;background:var(--t-term);color:var(--navy);cursor:pointer;}
.btn-calc:hover{background:var(--paper-dim);}
.btn-calc[aria-expanded="true"]{background:var(--navy);color:var(--white);}
.calc{max-width:340px;margin-top:10px;padding:12px;border:2px solid var(--navy-mid);border-radius:14px;background:var(--paper-dim);}
.calc[hidden]{display:none;}
.calc:focus{outline:3px solid var(--navy-mid);outline-offset:2px;}
.calc-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;}
.calc-tip{margin:0;font-size:.9rem;color:var(--ink);}
.calc-dismiss{align-self:flex-end;font:inherit;font-weight:700;min-height:44px;padding:6px 14px;border:2px solid var(--navy-mid);border-radius:10px;background:var(--white);color:var(--navy);cursor:pointer;}
.calc-screen{position:relative;margin-bottom:10px;padding:8px 12px;border-radius:8px;background:var(--white);color:var(--ink);border:2px solid var(--navy-mid);text-align:right;}
.calc-expr{min-height:1.6em;font-size:1.15rem;color:var(--ink);white-space:nowrap;overflow:hidden;}
.calc-result{display:block;min-height:2.2rem;font-size:1.7rem;font-weight:700;overflow-wrap:anywhere;}
.calc-pad{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;}
.calc-key{font:inherit;font-weight:700;font-size:1.1rem;min-height:48px;border:2px solid var(--navy-mid);border-radius:10px;background:var(--white);color:var(--navy);cursor:pointer;}
.calc-key:hover{background:var(--paper);}
.calc-control{background:var(--paper);font-size:.95rem;}
.calc-binary,.calc-open,.calc-bracket{background:var(--t-term);}
.calc-binary{font-size:1.4rem;}
.calc-5col{max-width:400px;}
.calc-pad[data-cols="5"]{grid-template-columns:repeat(5,minmax(0,1fr));}
.calc-pad[data-cols="5"] .calc-key{padding:0;min-width:0;}
.calc-fn,.calc-fnbig,.calc-times10{background:var(--t-term);font-size:.9rem;border-radius:22px;}
.calc-fnbig{font-size:1.35rem;}
.calc-binary{border-radius:4px;}
.calc-pad[data-cols="5"] .calc-control{font-size:.78rem;}
.calc-mode{position:absolute;left:10px;top:6px;font-size:.75rem;font-weight:700;letter-spacing:.05em;color:var(--ink);}
/* On a phone the keypad uses the whole width of the question card so every key is a comfortable tap. */
@media (max-width:640px){
  .calc{max-width:none;margin-left:-20px;margin-right:-20px;padding:8px;}
  .calc-pad{gap:5px;}
}
.calc-equals{background:var(--navy);color:var(--white);}
.calc-equals:hover{background:var(--navy-dark);}
/* The floating Top button would cover the right-hand keys on a phone. */
body:has(.calc:not([hidden])) .to-top{display:none;}

/* ---------- print: everything open, no controls ---------- */
@media print{
  .qtable-wide{overflow:visible;}
  .key-table{font-size:.8rem;}
  .key-table tr{break-inside:avoid;}
  .site-header,footer,.hero-actions,.q-form,.q-help,.btn,.g-tools,[data-reset-progress],.crumbs{display:none !important;}
  .js .q .ladder,.js .q .solution{display:none !important;}
  .js .print-answers .q .solution{display:block !important;}
  .fast-route,.toc,.to-top,.listen,.sym-row,.timed-panel,.q-calc{display:none !important;}
  .book section{padding:14px 0;}
  .q,.worked,.key{box-shadow:none;break-inside:avoid;}
  .term{background:none;}
  .term-pop{display:none !important;}
  body{background:#fff;}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto;}}

/* Footer and kicker contrast on book pages (computed: footer text #c9d3e0 on #081627 = 11.6;
   kicker #7a5a14 on white 6.1 / paper 5.6 / paper-dim 5.0). The main site's own pages need the
   same two fixes: see docs/book-authoring.md. */
footer p{color:#c9d3e0;}
.book .kicker{color:#7a5a14;}

/* ---- round 5 (fresh-student testing) ---- */
/* Buttons that sit on a white section, not on the navy hero, need their own colours (they were white on pale). */
.book section:not(.hero) .btn-ghost{background:var(--white);color:var(--navy);border:2px solid var(--navy-mid);}
.book section:not(.hero) .btn-ghost:hover{background:var(--paper-dim);}
/* A question you finished earlier shows it after a reload. */
.q.q-was-done{border-left:6px solid var(--c-right);}
.q.q-was-done .qnum::after{content:"\2713";margin-left:2px;}
.set-done{font-weight:700;color:var(--navy);background:var(--t-right);border-radius:10px;padding:10px 14px;margin:14px 0;}
.range-banner{max-width:800px;margin:10px auto;padding:10px 24px;background:var(--t-term);font-weight:700;}
/* Timed set: the clock stays in view while you answer. */
.timed-filter{font:inherit;min-height:44px;margin:4px 8px 4px 0;max-width:100%;}
.to-top.top-away{display:none;}
/* Reading options must wrap, never run off a 320px screen. */
.read-row{flex-wrap:wrap;}
.read-row > *{min-width:0;max-width:100%;}
.q,.qtext,.worked,.key{overflow-wrap:anywhere;}
.fast-route-on .worked{display:none;}
.qtag-paper{background:var(--t-term);}
.key-working{display:none;margin-top:6px;font-size:.88rem;color:var(--ink-soft);}
.show-working .key-working{display:block;}
.print-name{display:none;}
.tier-tag{display:inline-block;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--navy);border:1.5px solid var(--navy-mid);border-radius:999px;padding:0 7px;margin-left:6px;vertical-align:middle;background:var(--white);}
.next-up{padding:18px 0;background:var(--t-term);}
.next-up .btn{margin:0 10px 6px 0;}
.route{margin:22px 0;}
.route-weeks li{margin:6px 0;line-height:1.7;}
/* Windows high-contrast and "more contrast" settings: colour must never be the only signal. */
@media (forced-colors:active){
  .q,.worked,.key,.card{border:1px solid CanvasText;}
  .q-feedback{border:2px solid CanvasText;padding:6px 10px;}
  .q.q-correct,.q.q-was-done{border:3px solid Highlight;}
  .mc-option.is-right{border:3px solid Highlight;}
  .mc-option.is-wrong{border:3px dashed CanvasText;}
  .term,.listen,.btn-check,.btn-stuck,.sym-btn,.fast-toggle,.fast-link{border:2px solid ButtonText;}
  svg text,.svg-t{fill:CanvasText;}
  svg rect,svg path,svg line,svg circle,svg polygon,svg polyline{stroke:CanvasText;}
  .mark-box,.q-input{forced-color-adjust:auto;}
}
@media (prefers-contrast:more){
  .muted,.crumbs{color:var(--ink);}
  .q-feedback{border:2px solid var(--ink);padding:6px 10px;}
  .btn-stuck,.listen{border-color:var(--ink);}
}
/* ---------- search box in the header (book pages only) ----------
   Contrast, computed (WCAG relative luminance):
     typed text   ink #1b2430 on white                 15.65
     placeholder  ink-soft #4a5568 on white             7.53
     result title ink on white 15.65, on the highlighted row paper-dim #efe9db 12.93
     result detail ink-soft on white 7.53, on paper-dim 6.22
     focus ring   gold-light #e4c886 on the navy header 9.58 (the navy ring used elsewhere would vanish on navy)
     input edge   white on navy 15.59
     badges       Topic white on navy 15.59; Word meaning teal #0a6a6a on #dff1f1 5.48; others ink on paper-dim 12.93
     result count (screen-reader only, not drawn) */
.book-search{position:relative;flex:1 0 100%;order:9;max-width:40rem;}
.book-search input{width:100%;font:inherit;font-size:1rem;color:var(--ink);background:var(--white);border:2px solid var(--white);border-radius:999px;padding:8px 16px;min-height:44px;}
.book-search input::placeholder{color:var(--ink-soft);opacity:1;}
.book .book-search input:focus-visible,.site-header .book-search input:focus-visible{outline:3px solid var(--gold-light);outline-offset:2px;}
.book-search-results{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:60;list-style:none;margin:0;padding:6px;background:var(--white);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);max-height:min(26rem,70vh);overflow-y:auto;}
.book-search-results[hidden],.book-search-empty[hidden]{display:none;}
.book-search-results a{display:block;padding:8px 12px;border-radius:8px;color:var(--ink);text-decoration:none;}
.book-search-results a:hover,.book-search-results a[aria-selected="true"]{background:var(--paper-dim);outline:2px solid var(--navy);outline-offset:-2px;}
.book-search-results .bs-title{display:block;font-weight:700;}
.book-search-results .bs-snippet{display:block;font-size:.88rem;color:var(--ink-soft);line-height:1.4;}
.book-search-results .bs-badge{display:inline-block;font-size:.72rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;border-radius:999px;padding:1px 9px;margin-bottom:3px;background:var(--paper-dim);color:var(--ink);}
.book-search-results .bs-badge-topic{background:var(--navy);color:var(--white);}
.book-search-results .bs-badge-term{background:var(--t-term);color:var(--c-term);}
/* The "6 results" line is for screen readers only: it was white-on-white (inherited from the header) and showed as a blank gap on phones. */
.book-search-results .book-search-count{color:var(--ink-soft);position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.book-search-empty a{color:var(--navy-mid);font-weight:700;}
@media (max-width:700px){.book-search-results .bs-snippet{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}.site-header:has(.book-search) nav.mainnav ul{gap:4px 12px;}}
.book-search-empty{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:60;margin:0;padding:12px 16px;background:var(--white);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);}
@media (max-width:700px){.book-search{max-width:none;width:100%;}}
@media print{.book-search{display:none !important;}}

/* Printing a worksheet: only the questions, with room to work, and a line for a name. */
@media print{
  .print-name{display:block;font-weight:700;margin:0 0 14px;}
  .print-sheet .hero,.print-sheet .toc,.print-sheet .fast-route,.print-sheet .bys,.print-sheet .words-strip,.print-sheet .key,.print-sheet .worked,.print-sheet details,.print-sheet .flip-grid,.print-sheet .set-done,.print-sheet .range-banner,.print-sheet .read-tools,.print-sheet nav{display:none !important;}
  .print-sheet section:not(:has(.q)){display:none !important;}
  .print-sheet section .wrap > :not(.q):not(h2),.print-sheet section .wrap .wrap > :not(.q):not(h2){display:none !important;}
  .print-sheet .q{min-height:7em;padding-bottom:3em;border:1px solid #888;margin:10px 0;break-inside:avoid;}
  .print-sheet .q .q-help,.print-sheet .q .q-form,.print-sheet .q .solution,.print-sheet .q .q-feedback,.print-sheet .listen,.print-sheet .btn-check{display:none !important;}
  .print-sheet .mc{display:block;}
  .print-sheet .mc-option{border:1px solid #888;margin:4px 0;}
  .print-sheet,.print-sheet *{background:#fff !important;color:#000 !important;}
  .fast-route{display:none !important;}
}

/* ---------- "Flip it" pictures (every flip-side box) ----------
   Text on white: ink #1b2430 (12.9+), soft labels ink-soft #4a5568 on white 7.5.
   Strokes are navy #0f2440 on white (16+). The unknown is a pale yellow fill with ink text. */
.flipfig{margin:6px 0 4px;text-align:center;}
.flipfig svg{width:100%;max-width:340px;height:auto;margin:0 auto;display:block;}
.flipfig .svg-t{font-size:inherit;}
.flipfig .fl-soft{fill:var(--ink-soft);font-weight:600;}
.flipfig .fl-box{fill:var(--tint);stroke:var(--navy);stroke-width:2.5;}
.flipfig .fl-unk{fill:#fff3c4;stroke:var(--navy);stroke-width:2.5;stroke-dasharray:6 4;}
.flipfig .fl-alt{fill:#fbeadb;}
.flipfig .fl-arr{stroke:var(--navy);stroke-width:4;stroke-linecap:round;fill:none;}
.flipfig .fl-head{fill:var(--navy);}
.flipfig .fl-c{fill:var(--t-number);stroke:var(--navy);stroke-width:2;}
.flipfig .fl-red{fill:var(--c-probability);stroke:var(--navy);stroke-width:2;}
.flipfig .fl-dot{fill:var(--c-probability);stroke:var(--navy);stroke-width:1.5;}
.flipfig .fl-ghost{fill:#fff3c4;stroke:var(--navy);stroke-width:2.5;stroke-dasharray:6 4;}
.flipfig .fl-curve{fill:none;stroke:var(--c-algebra);stroke-width:4;stroke-linejoin:round;}
.flipfig .fl-jump{fill:none;stroke:var(--c-number);stroke-width:3.5;}
.flipfig .fl-grid{stroke:#c9c3b4;stroke-width:1;}
.flipfig .fl-ven{fill:var(--t-number);fill-opacity:.7;stroke:var(--navy);stroke-width:2;}
.flipfig .fl-ven2{fill:var(--t-ratio);}
.flipfig .fl-ring{fill:none;stroke:var(--c-probability);stroke-width:5;}
.flipfig .fl-q{fill:#fff3c4;stroke:var(--navy);stroke-width:2;}
.flipfig .hyp-b{stroke:var(--c-ratio);}
@media (forced-colors:active){.flipfig .fl-box,.flipfig .fl-unk,.flipfig .fl-ghost{fill:Canvas;}.flipfig .fl-head{fill:CanvasText;}}

/* ---- round 6 (engine and look) ---- */
/* "Where you will use this" sits on the navy hero. It inherited the grey body colour (#4a5568 on #0f2440 = 2.07, a fail).
   Computed: #d9e0ea on #0f2440 = 11.73, on the darker end of the gradient #081627 = 13.69. */
.hero .where-use{color:#d9e0ea;}
.hero .where-use b{color:var(--white);}
/* Listen: loading, playing and hidden states. */
.listen[aria-busy="true"]{cursor:progress;color:var(--ink-soft);}
.listen.is-playing{background:var(--navy);color:var(--white);}
.read-nolisten .listen{display:none;}
/* Timed set: choices before starting, and the clock. It sticks to the top of the page in its own row,
   so it never sits on top of a question's "Uses:" tag or the Back button (it used to float over them on a phone). */
.timed-options{display:grid;gap:4px;margin:8px 0 12px;}
.timed-tick{display:flex;gap:8px;align-items:flex-start;color:var(--ink);min-height:44px;padding:6px 0;}
.timed-tick input{width:22px;height:22px;flex:none;margin:0;accent-color:var(--navy);}
main > .timed-clock{position:sticky;top:0;z-index:80;width:fit-content;max-width:calc(100% - 16px);margin:0 8px 6px auto;padding:4px 14px;background:var(--white);border:2px solid var(--navy);border-radius:999px;font-size:1.1rem;box-shadow:var(--shadow);}
main > .timed-clock[hidden]{display:none;}
.timed-running .q{scroll-margin-top:64px;}
section[hidden]{display:none !important;}
/* The Top button fades while it would sit on a clue or a message (a phone), so it never hides any words. */
.to-top.top-fade{opacity:0;pointer-events:none;}
.to-top.top-fade:focus-visible{opacity:1;pointer-events:auto;}
/* Skipping the basics also folds away "Before you start" and "Words you need". */
.fast-route-on .bys:not(.unlocks),.fast-route-on .words-strip{display:none;}
/* The search box's result count is for screen readers (it was a visible line that left a gap above the first result on a phone). */
.book-search-results .book-search-count{color:var(--ink-soft);position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
/* A worksheet: multiple choice in the written order, lettered, with room to work; no typing instructions. */
@media print{
  .print-sheet .type-hint{display:none !important;}
  .print-sheet .mc{display:flex;flex-direction:column;}
  .print-sheet .mc-option{order:var(--src,0);}
  .print-sheet .mc-option::before{content:attr(data-letter) ")\00a0";font-weight:700;}
  .print-sheet .mc-option.is-right::after,.print-sheet .mc-option.is-wrong::after{content:none;}
  .print-sheet .q{min-height:12em;padding-bottom:5em;}
}

/* Reflection figure grid lines (decorative; the labelled points carry the meaning). */
.geo-svg .grid{stroke:#c3ccd8;stroke-width:1;fill:none;}
