/* NUETable theme (loaded after style.css). Calm study desk: cool paper, deep teal ink, a serif for reading, one colour per learning area.
   Local fonts only (no CDN). Variable names from style.css are kept so every lesson widget keeps working. */
:root{--a:var(--brand)}
html{scroll-behavior:smooth}
body{font:17px/1.6 var(--sans);background:var(--bg);color:var(--ink);padding-bottom:84px;letter-spacing:0}
h1,h2{font-family:var(--serif);font-weight:600;letter-spacing:-.01em}
h1{font-size:32px;line-height:1.15;margin:10px 0 8px}h2{font-size:24px;line-height:1.25;margin:36px 0 10px}h3{font:700 15px var(--sans);margin:20px 0 6px}
.lead{font-size:18px;color:var(--mute);margin:6px 0 18px;max-width:56ch}
a{color:var(--brand);text-underline-offset:3px}
.skip{position:absolute;left:-999px;top:0}.skip:focus{left:12px;top:8px;z-index:50;background:var(--card);padding:10px 14px;border-radius:10px;border:2px solid var(--brand)}
:focus-visible{outline:3px solid var(--brand);outline-offset:2px;border-radius:6px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* frame */
.top{max-width:720px;padding:14px 20px 4px}.brand{font:700 19px var(--serif)}.brand span{color:var(--brand)}
.top .pill.warn{font-size:12px}
main{max-width:720px;padding:6px 20px 36px}
.tabs{display:flex;justify-content:space-around;background:var(--card);border-top:1px solid var(--line);left:0;right:0;transform:none;max-width:none;width:auto;border-left:0;border-right:0}
.tabs>a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px 7px;font-size:12px;min-height:56px;justify-content:center;box-shadow:none}
.tabs>a.on{color:var(--brand);font-weight:600}.tabs>a svg{display:block}
.tabs>a.sbrand,.subnav{display:none}
@media(min-width:960px){
  body{padding:0 0 0 var(--nav)}
  .top{display:none}
  .tabs{position:fixed;top:0;bottom:0;left:0;right:auto;width:var(--nav);flex-direction:column;justify-content:flex-start;gap:2px;padding:26px 14px;border-top:0;border-right:1px solid var(--line);overflow-y:auto}
  .tabs>a{flex-direction:row;justify-content:flex-start;gap:12px;padding:10px 14px;font-size:16px;min-height:44px;border-radius:10px;border-top:0}
  .tabs>a:hover{background:var(--brand2)}.tabs>a.on{background:var(--brand2);border-top:0}
  .tabs>a.sbrand{display:block;border-radius:0;min-height:0;font:700 24px var(--serif);color:var(--ink);text-decoration:none;padding:0 14px 22px}.tabs>a.sbrand span{color:var(--brand)}
  .subnav{display:flex;flex-direction:column;gap:2px;margin:18px 0 0;padding-top:14px;border-top:1px solid var(--line)}
  .subnav a{display:flex;align-items:center;gap:10px;padding:8px 14px;font-size:15px;color:var(--mute);text-decoration:none;border-radius:10px;min-height:40px}
  .subnav a i{width:10px;height:10px;border-radius:50%;background:var(--a)}.subnav a:hover{background:var(--brand2)}.subnav a.on{color:var(--ink);font-weight:600;background:var(--brand2)}
  .tabs::after{content:"AI-drafted content, not reviewed by a teacher";margin-top:auto;padding:14px 14px 0;font-size:12.5px;color:var(--mute);line-height:1.4}
  main{max-width:760px;margin:0 auto;padding:40px 32px 64px}
  body{padding-bottom:0}
}

/* home and lists */
.hero h1{font-size:36px;margin:6px 0 6px}
.alist{display:grid;gap:12px;margin:14px 0 10px}
@media(max-width:480px){.hero h1{font-size:30px}}
.quick{margin:22px 0 8px;border-top:1px solid var(--line)}
.quick a{display:grid;grid-template-columns:1fr auto;column-gap:12px;padding:14px 4px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none;min-height:60px}
.quick a::after{content:"›";grid-row:1/3;grid-column:2;align-self:center;font-size:26px;color:var(--mute)}
.quick b{font-weight:600}.quick span{color:var(--mute);font-size:15px}.quick a:hover{background:var(--brand2)}
.tcard{display:block;padding:15px 6px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none}.tcard:hover{background:var(--brand2)}
.tcard b{display:block;font:600 20px/1.25 var(--serif)}.tcard .tblurb{display:block;margin:2px 0 4px;color:var(--ink);font-size:15.5px}
.crumbs{font-size:14px;margin:6px 0 4px}.crumbs a{color:var(--a)}
.foot{margin-top:26px}
main>h1:first-of-type::before,.hero h1::before{content:none}
.finder input{border-radius:12px}
.more>summary{padding:10px 0}

/* buttons, chips, notes, cards */
.btn{min-height:48px;border-radius:12px;padding:10px 20px;font:600 16px var(--sans);background:var(--brand);border-color:var(--brand)}
:where([data-theme="dark"]) .btn{color:#0b1213}
.btn.alt{background:transparent;color:var(--brand);border-width:1.5px}
.chip{min-height:44px}.chip.on{background:var(--brand);border-color:var(--brand)}
:where([data-theme="dark"]) .chip.on{color:#0b1213}
.card{border-radius:14px;background:var(--card)}
.note{border-radius:10px;background:var(--warnbg);color:var(--warn)}
.pill{background:var(--brand2);color:var(--brand)}.pill.warn{background:var(--warnbg);color:var(--warn)}

/* lesson cards on the topic page */
.feature{background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:16px 18px}
:where([data-theme="dark"]) .feature{color:var(--ink)}
.feature b{font:600 21px/1.25 var(--serif)}.feature span:last-child,.feature span{opacity:1;color:var(--mute);font-size:15px}.feature:hover{box-shadow:0 2px 10px rgba(20,40,40,.08)}

/* reading: lessons */
.msec p,.msec li,.msec blockquote{font-family:var(--serif);font-size:18.5px;line-height:1.72;max-width:62ch}
.msec h2{margin-top:0}.msec table,.msec td,.msec th{font-family:var(--sans)}
.mhead h1{font-size:34px}
.obj{background:var(--card);border-radius:14px}
.obj blockquote{font-family:var(--serif);font-weight:500}
.exb{border-top-color:var(--hair)}.exb h3{font:600 20px var(--serif)}
.snav{background:var(--bg);border-bottom:1px solid var(--line)}
.lim{border-radius:14px}

/* practice builder */
fieldset{margin:0 0 20px}legend{font:600 18px var(--serif);margin-bottom:6px}
.chk{min-height:46px}.seg span{border-radius:10px}

/* choice cards for practice entry screen */
.hm-choices{display:grid;grid-template-columns:1fr;gap:12px;margin:16px 0}
@media(min-width:600px){.hm-choices{grid-template-columns:1fr 1fr}}
.choice-card{display:block;padding:18px 16px;border:1px solid var(--line);border-radius:14px;background:var(--card);color:var(--ink);text-decoration:none;transition:transform .14s var(--ease-out),background-color .15s var(--ease-out),border-color .15s var(--ease-out)}
.choice-card:hover{transform:translateY(-2px);background:var(--brand2);border-color:var(--a)}
.choice-card:active{transform:scale(.98)}
.choice-card b{display:block;font:600 18px/1.3 var(--serif);margin-bottom:6px}
.choice-card p{margin:0;font:400 14px/1.5 var(--sans);color:var(--mute)}
.choice-card[style*="--a:var(--color-brand)"]{border-color:var(--color-brand);box-shadow:0 0 0 1px var(--color-brand)}
.choice-card[style*="--a:var(--color-brand)"]:hover{background:color-mix(in srgb,var(--color-brand) 10%,var(--card));transform:translateY(-2px)}

/* mistakes */
.mrow{padding:18px;border-radius:14px;margin:16px 0}
.lab{display:block;font:600 13px var(--sans);color:var(--mute);margin:12px 0 2px}

.yours p,.right p{margin:2px 0;color:var(--ink)}
/* fixes: style.css gave .tabs a an inset shadow and flex:1 */
.tabs a.on{box-shadow:none}
@media(min-width:960px){.tabs>a,.subnav a{flex:none}.tabs>a{padding:9px 14px}}

/* trial polish: home, resume, tactile press feedback (Apple Design: feedback on press, restraint, size-specific tracking) */
h1,.hero h1{letter-spacing:-.02em}h2{letter-spacing:-.012em}
.alist{grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:340px){.alist{grid-template-columns:1fr}}
/* ===== Design system and practice, session 16 =====
   Direction (Unslop): calm, exact, patient; an exam paper and a teacher's marking pen. Mode (Impeccable): Operate for the
   app, Read for questions and lessons, so restraint and familiar patterns, one accent, two surface levels at most
   (Taste adaptation: "never text in a box in a box"). Values from Unslop tokens: 4px scale, one ease-out curve,
   hairlines at about 10% ink, press 0.97. Practice runs in a focus mode without the app navigation. */
:root{--ease-out:cubic-bezier(.23,1,.32,1);
  --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E")}
html{color-scheme:light;accent-color:var(--brand);caret-color:var(--brand);scrollbar-color:var(--ring) transparent}
::selection{background:color-mix(in srgb,var(--brand) 22%,transparent)}
h1,h2{text-wrap:balance}h3{font-weight:600}.brand,.tabs>a.sbrand{font-weight:600}
.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
sup{font-size:.72em;line-height:0;vertical-align:.5em}
math{font-size:1.05em}
.ic{flex:none;display:inline-block;vertical-align:middle}
.btn,.opt,.chip,.tabs>a,.revact a,.qclose{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.btn{transition:transform .14s var(--ease-out),background-color .15s var(--ease-out),border-color .15s var(--ease-out)}
.btn:active:not([disabled]){transform:scale(.97)}
.tcard,.quick a,.feature{transition:transform .14s var(--ease-out),background-color .15s var(--ease-out),border-color .15s var(--ease-out)}
.feature:active{transform:scale(.98)}
.tcard{position:relative;padding-right:36px}.tcard::after,.quick a::after{content:"";width:18px;height:18px;background:var(--mute);-webkit-mask:var(--chev) center/18px no-repeat;mask:var(--chev) center/18px no-repeat}
.tcard::after{position:absolute;right:6px;top:50%;margin-top:-9px;float:none}
.quick a::after{font-size:0}

/* focus mode: practice without the app navigation */
body.focus{padding:0}
body.focus .tabs,body.focus .top{display:none}
body.focus main{max-width:680px;margin:0 auto;padding:var(--s3) 20px var(--s8)}
@media(min-width:960px){body.focus main{padding:var(--s6) var(--s6) var(--s8)}}
.qhead{display:flex;align-items:center;gap:var(--s3);min-height:48px}
.qclose{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 var(--s3) 0 var(--s1);margin-left:calc(-1 * var(--s1));border-radius:var(--r-sm);color:var(--mute);text-decoration:none;font:500 15px var(--sans)}
.qclose:hover{color:var(--ink);background:var(--brand2)}
.qtopic{flex:1;min-width:0;text-align:center;font:500 15px/1.3 var(--sans);color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qcount{flex:none;min-width:56px;text-align:right;font:500 15px var(--sans);font-variant-numeric:tabular-nums}
.qclock{flex:none;font:600 15px var(--sans);font-variant-numeric:tabular-nums;padding:var(--s1) 10px;border-radius:var(--r-sm);background:var(--brand2);color:var(--brand)}
.bar{display:flex;gap:3px;height:4px;margin:var(--s1) 0 var(--s7)}
.bar i{flex:1;min-width:0;border-radius:2px;background:var(--hair)}
.bar i.on{background:var(--ink)}.bar i.ok{background:var(--ok)}.bar i.bad{background:var(--bad)}.bar i.cur{background:var(--ring)}
.bar.res{margin:var(--s4) 0 var(--s4)}
@media(max-width:600px){.bar{margin-bottom:var(--s6)}.bar.res{margin-bottom:var(--s4)}}
body.focus .note{margin:0 0 var(--s5)}

.qq{margin:0 0 var(--s6)}
.qq .prompt,.qq>p,.qq li{font:400 20px/1.55 var(--serif);margin:0;max-width:60ch;text-wrap:pretty;font-variant-numeric:lining-nums}
.qq table{font:15px var(--sans)}.qq .qfig{margin:var(--s4) 0 0}
.qsrc{margin:var(--s3) 0 0;font:14px/1.45 var(--sans);color:var(--warn)}

.opts{border-top:1px solid var(--hair)}
.opt{display:grid;grid-template-columns:28px 1fr;align-items:start;column-gap:var(--s4);row-gap:2px;width:100%;margin:0;padding:14px var(--s2);min-height:56px;border:0;border-bottom:1px solid var(--hair);border-radius:0;background:transparent;color:var(--ink);text-align:left;font:400 18px/1.45 var(--serif);font-variant-numeric:lining-nums;cursor:pointer;transition:background-color .15s var(--ease-out),color .15s var(--ease-out)}
.opt .ot{overflow-wrap:anywhere;padding-top:1px}
.ol{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1.5px solid var(--ring);font:600 13px/1 var(--sans);color:var(--mute);flex:none;transition:background-color .15s var(--ease-out),border-color .15s var(--ease-out),color .15s var(--ease-out)}
@media(hover:hover) and (pointer:fine){.opt:hover:not([disabled]):not(.sel){background:color-mix(in srgb,var(--brand2) 55%,transparent)}.opt:hover:not([disabled]) .ol{border-color:var(--brand);color:var(--brand)}}
.opt:focus-visible{outline:2px solid var(--brand);outline-offset:-2px;border-radius:var(--r-sm)}
.opt.sel{background:var(--brand2)}.opt.sel .ol{background:var(--brand);border-color:var(--brand);color:#fff}
.opt[disabled]{cursor:default;opacity:1;color:var(--ink)}
.opt.dim{color:var(--mute)}.opt.dim .ol{opacity:.55}
.opt.ok{background:color-mix(in srgb,var(--okbg) 75%,transparent)}.opt.bad{background:color-mix(in srgb,var(--badbg) 75%,transparent)}
.opt.ok .ol{background:var(--ok);border-color:var(--ok);color:#fff}.opt.bad .ol{background:var(--bad);border-color:var(--bad);color:#fff}
.om{grid-column:2;display:inline-flex;align-items:center;gap:6px;font:600 13px/1.3 var(--sans)}.opt.ok .om{color:var(--ok)}.opt.bad .om{color:var(--bad)}
:where([data-theme="dark"]) .opt.sel .ol,:where([data-theme="dark"]) .opt.ok .ol,:where([data-theme="dark"]) .opt.bad .ol{color:#0b1213}

.act{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s3) var(--s4);margin:var(--s5) 0 0}
.act .btn{min-width:200px}
@media(max-width:600px){.act .btn{width:100%}}
#hint{flex:1 1 200px;min-width:0}#hint.need{color:var(--bad);font-weight:600}
.vd{flex:1 1 100%;display:flex;align-items:flex-start;gap:var(--s2);margin:0;font:16px/1.5 var(--sans);color:var(--ink)}
.vd .ic{margin-top:3px}.vd b{font-weight:600}.vd.ok .ic,.vd.ok b{color:var(--ok)}.vd.bad .ic,.vd.bad b{color:var(--bad)}

.why{margin:var(--s7) 0 0;padding-top:var(--s5);border-top:1px solid var(--hair)}
.wh{font:600 16px/1.4 var(--sans);margin:0 0 var(--s2)}
.why>p{font-size:16px;line-height:1.6;margin:0 0 var(--s5);max-width:68ch}
.fold{border-top:1px solid var(--hair)}
.fold>summary{display:flex;align-items:center;gap:var(--s2);min-height:48px;padding:0;font:600 15px var(--sans);list-style:none;cursor:pointer}
.fold>summary::-webkit-details-marker{display:none}
.fold>summary::before{content:"";width:16px;height:16px;flex:none;background:currentColor;-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transition:transform .15s var(--ease-out)}
.fold[open]>summary::before{transform:rotate(90deg)}
.fold ol{margin:0 0 var(--s4);padding-left:22px}.fold li{margin:6px 0;font-size:16px;line-height:1.55;max-width:68ch}
.fold>p{font-size:16px;max-width:68ch}
.fold.quiet>summary{font-weight:500;font-size:14px;color:var(--mute)}
.oth{margin:0 0 var(--s4)}.othh{display:flex;gap:var(--s3);align-items:baseline;margin:0 0 var(--s1);font:400 17px/1.45 var(--serif)}
.othh .ol{width:24px;height:24px;font-size:12px}.oth>p:not(.othh){margin:0 0 0 36px;font-size:15px;line-height:1.55;max-width:66ch}
.rl{display:flex;flex-wrap:wrap;align-items:center;gap:0 var(--s3);margin:0;padding:var(--s2) 0;border-top:1px solid var(--hair)}
.rl a{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-weight:600;text-decoration:none}.rl a:hover{text-decoration:underline}
.src{margin:0;padding-top:var(--s3);border-top:1px solid var(--hair);font:13.5px/1.5 var(--sans);color:var(--mute)}
.again{margin:var(--s6) 0 0}

/* results */
.score{margin:var(--s2) 0 var(--s1);font:400 20px var(--serif)}.score b{font:600 48px/1 var(--serif);font-variant-numeric:tabular-nums;margin-right:6px}
.rqs-list{border-top:1px solid var(--hair)}.rq{border-bottom:1px solid var(--hair)}
.rq summary{display:grid;grid-template-columns:28px 1fr auto;gap:var(--s3);align-items:baseline;padding:var(--s3) var(--s1);min-height:48px;list-style:none;cursor:pointer}
.rq summary::-webkit-details-marker{display:none}
.rqn{color:var(--mute);font-variant-numeric:tabular-nums}.rqt{font-size:15.5px;line-height:1.4}
.rqs{display:inline-flex;align-items:center;gap:var(--s1);font:600 13px var(--sans);color:var(--mute)}.rq.ok .rqs{color:var(--ok)}.rq.bad .rqs{color:var(--bad)}
.rqb{padding:0 var(--s1) var(--s5)}.rqb .prompt{font:400 18px/1.5 var(--serif)}.rqb .why{margin-top:var(--s5)}
.ans{display:flex;gap:var(--s3);align-items:baseline;margin:var(--s2) 0;font:400 18px/1.45 var(--serif)}

/* journey: next step, topics to revisit, mistakes, lesson header */
.nextstep{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--s3) var(--s4);margin:var(--s4) 0 var(--s2);padding:var(--s4) 0;border-top:1px solid var(--hair);border-bottom:1px solid var(--hair)}
.nextstep p{margin:0;flex:1 1 220px}.nextstep b{font-weight:600}.nextstep .btn{flex:none}
.revlist{border-top:1px solid var(--hair);margin:var(--s2) 0 var(--s1)}
.rev{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--s1) var(--s4);padding:10px var(--s1);border-bottom:1px solid var(--hair)}
.revt{display:grid;gap:2px;min-width:0}.revt b{font-weight:600}
.revact{display:flex;gap:var(--s1)}.revact a{display:inline-flex;align-items:center;min-height:44px;padding:0 var(--s3);border-radius:var(--r-sm);font-size:15px;font-weight:600;text-decoration:none}
.revact a:first-child{background:var(--brand2)}.revact a:hover{text-decoration:underline}
.mrow .prompt{font:400 18px/1.5 var(--serif)}
.lab{display:inline-flex;align-items:center;gap:6px}
.yours,.right{border:0;padding:0;margin:var(--s3) 0}.yours .lab{color:var(--bad)}.right .lab{color:var(--ok)}
.yours p,.right p{font-family:var(--serif);font-size:17px}
.mmeta{margin:0 0 var(--s4);color:var(--mute);font-size:15px}

/* journey: areas and lessons as calm rows (no equal-card grid, no thick coloured edges); the area colour stays as a dot */
.alist{grid-template-columns:1fr;gap:0;margin:var(--s4) 0;border-top:1px solid var(--hair)}
.feature{border:1px solid var(--hair);border-radius:var(--r-md);padding:var(--s4) var(--s5);background:var(--card)}
.feature:hover{border-color:var(--brand);box-shadow:none}
.more>summary{display:flex;align-items:center;gap:var(--s2);min-height:48px;padding:0;list-style:none;cursor:pointer}
.more>summary::-webkit-details-marker{display:none}
.more>summary::before{content:"";width:16px;height:16px;flex:none;background:currentColor;-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transition:transform .15s var(--ease-out)}
.more[open]>summary::before{transform:rotate(90deg)}
.exb h3 .exn{font:inherit;color:var(--mute)}

/* lesson reading pages: one reading column, quiet section tabs, two surface levels at most */
.back{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-size:15px;text-decoration:none;color:var(--mute)}.back:hover{color:var(--ink)}
.mhead{margin:0 0 var(--s4)}.mhead h1{margin:var(--s1) 0 var(--s2)}
.mmeta{margin:0;color:var(--mute);font-size:15px}.mstatus{margin:var(--s1) 0 0;font-size:14px;color:var(--warn)}
.snav{gap:var(--s5);margin:0 -20px var(--s5);padding:0 20px;background:var(--bg);border-bottom:1px solid var(--hair)}
.snav a{flex:none;padding:var(--s3) 0;border-radius:0;background:none;color:var(--mute);font-size:15px;font-weight:500;border-bottom:2px solid transparent;min-height:44px;display:inline-flex;align-items:center}
.snav a:hover{color:var(--ink);outline:none}.snav a:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
@media(min-width:960px){.snav{margin:0 0 var(--s5);padding:0}}
.obj{padding:var(--s5);border:1px solid var(--hair);margin:var(--s5) 0}.obj h2{font:600 15px var(--sans);color:var(--mute);margin:0 0 var(--s2)}
.obj blockquote{font:500 20px/1.45 var(--serif);margin:0 0 var(--s2)}.obj .fold{border-top:1px solid var(--hair);margin-top:var(--s3)}
.msec{margin:var(--s7) 0 0}.msec>h2{margin:0 0 var(--s3)}
.exb{margin:var(--s6) 0 0}.exb header{margin:0 0 var(--s3)}.exb h3{font:600 20px/1.35 var(--serif)}.idea{font-size:15px}
.exq{padding:var(--s4) var(--s5);border:1px solid var(--hair);border-radius:var(--r-md);background:var(--card)}
.exans{border-radius:var(--r-sm)}
.mistlist{border-top:1px solid var(--hair)}
.mist{margin:0;padding:var(--s4) 0;border:0;border-bottom:1px solid var(--hair);border-radius:0;background:none}
.mist .wrong{font:500 18px/1.45 var(--serif);color:var(--bad)}
.lim{background:none;color:var(--ink);border:1px solid var(--hair);border-radius:var(--r-md);padding:var(--s4) var(--s5)}.lim h2{color:var(--warn);font:600 16px var(--sans)}
.explorer,.amap{border:1px solid var(--hair);border-radius:var(--r-md)}

/* practise builder: a short form on the page, one group per area (folded), one start action */
.builder fieldset{margin:0 0 var(--s6)}.builder legend{font:600 16px var(--sans);margin:0 0 var(--s3);padding:0}
.topics{border-top:1px solid var(--hair)!important}
.tgroup{border-bottom:1px solid var(--hair)}
.tgroup>summary{position:relative;display:flex;align-items:center;gap:var(--s3);min-height:56px;padding:0 0 0 22px;list-style:none;cursor:pointer}
.tgroup>summary::-webkit-details-marker{display:none}
.tgroup>summary::before{content:"";position:absolute;left:2px;top:50%;margin-top:-5px;width:10px;height:10px;border-radius:50%;background:var(--a)}
.tgroup>summary::after{content:"";margin-left:auto;width:16px;height:16px;flex:none;background:var(--mute);-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transform:rotate(90deg);transition:transform .15s var(--ease-out)}
.tgroup[open]>summary::after{transform:rotate(-90deg)}
.tgn{font:600 18px var(--serif)}.tgc{font-variant-numeric:tabular-nums}
.tgall{margin:0 0 var(--s1) 22px}.tgroup .chk{margin-left:22px}.tgroup>label:last-child{margin-bottom:var(--s3)}
.builder .more{margin:0 0 var(--s4);border-top:1px solid var(--hair);border-bottom:1px solid var(--hair)}
.builder .more fieldset{margin:var(--s2) 0 var(--s4)}
#msg:not(:empty){color:var(--bad);font-weight:600}
.mhead h1{text-wrap:pretty}
.exam{margin:var(--s5) 0 var(--s6);padding:var(--s5);border:1px solid var(--hair);border-radius:var(--r-md);background:var(--card)}.exam h2{margin:0 0 var(--s2)}
.exam .act select{min-height:48px}
.lockh{font:600 16px var(--sans);margin:var(--s6) 0 var(--s2)}
.lockrow{display:flex;gap:var(--s3);padding:var(--s3) 0;border-top:1px solid var(--hair);color:var(--mute)}.lockrow .ic{margin-top:3px}.lockrow b{color:var(--ink);font-weight:600}.lockrow p{margin:2px 0 0}
/* secondary actions as text links beside the one filled button */
.tl{display:inline-flex;align-items:center;min-height:44px;padding:0 var(--s1);font-weight:600;font-size:16px;text-decoration:underline;text-decoration-color:var(--ring);text-underline-offset:4px}
.tl:hover{text-decoration-color:currentColor}
@media(max-width:600px){.act .btn+.tl{margin-left:0}}
.tcard:first-of-type{border-top:1px solid var(--hair)}
/* contrast fixes from the measured scan (WCAG 4.5:1 text, 3:1 large) */
.crumbs a{color:var(--brand)}
.opt.dim .ol{opacity:1;color:var(--mute);border-color:var(--hair)}
:where([data-theme="dark"]) .seg input:checked+span{color:#0b1213}
.h3{font:600 17px var(--sans);margin:var(--s5) 0 var(--s2)}
.more .card{margin:0;padding:var(--s3) var(--s1);border:0;border-bottom:1px solid var(--hair);border-radius:0;background:none}
.more .card b{font:600 17px/1.35 var(--serif)}

/* ===== Type, session 18: self-hosted Source Serif 4 (reading: questions, lessons, headings) and Source Sans 3 (interface).
   Variable fonts, Latin subset, SIL OFL (public/fonts/README.txt). Optical sizing follows the font size automatically. */
@font-face{font-family:"Source Serif 4";font-style:normal;font-weight:200 900;font-display:swap;src:url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations"),url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Source Serif 4";font-style:italic;font-weight:200 900;font-display:swap;src:url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2-variations"),url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Source Sans 3";font-style:normal;font-weight:200 900;font-display:swap;src:url(fonts/source-sans-3-latin-wght-normal.woff2) format("woff2-variations"),url(fonts/source-sans-3-latin-wght-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
body{font-family:var(--sans);font-size:17px;font-optical-sizing:auto;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
h1,h2{font-weight:600;letter-spacing:-.015em}h1{letter-spacing:-.02em}
.qq .prompt,.qq>p,.opt,.msec p,.msec li{font-optical-sizing:auto}
/* home: each area row carries a thin line of real progress (questions seen on this device), in the area colour */
.aprog{grid-column:1/-1;display:block;height:3px;margin-top:var(--s2);border-radius:2px;background:var(--hair);overflow:hidden}
.aprog i{display:block;height:100%;width:100%;background:var(--a);transform-origin:left center}
/* lesson widgets and data tables in the same system: hairline rules, left-aligned text, tabular figures, muted colour fills */
table{border-collapse:collapse;font:15px/1.45 var(--sans);font-variant-numeric:tabular-nums lining-nums}
th,td{border:0;border-bottom:1px solid var(--hair);padding:var(--s2) var(--s3);text-align:left;vertical-align:top}
th{background:none;font-weight:600;font-size:14px;color:var(--mute)}
tr:first-child th{border-bottom-color:var(--ring)}
.scroll{border-top:1px solid var(--hair)}.scroll table{margin:0}
.qq table th,.qq table td{text-align:center}.qq table th:first-child,.qq table td:first-child{text-align:left}
.bar3-row{border:1px solid var(--hair);border-radius:var(--r-sm);min-height:44px}
.bar3-row div{color:var(--color-text);font:500 15px var(--sans)}.bar3-row{gap:2px;background:var(--bg)}.bar3-row div+div{border-left:0}
.astmt{border:1px solid var(--hair);border-radius:var(--r-sm);font-size:15.5px}.astmt b{font-weight:600;color:var(--mute)}
.a-main{border-color:var(--brand);background:var(--brand2)}.a-main b{color:var(--brand)}
.a-intermediate{border:1.5px dashed var(--ring)}.a-reported{border-color:color-mix(in srgb,var(--warn) 45%,transparent)}
.aarrow{font-size:13px}
.ex-verdict,.exans{border-radius:var(--r-sm)}
.explorer{padding:var(--s4) var(--s5)}
/* status page: curriculum map rows become two-line entries on phones; a real table from 600px */
button.chip{font:inherit;font-size:15px;background:none;cursor:pointer}
@media(max-width:599px){
  #ot,#ot tbody{display:block}#ot tr:first-child{display:none}
  #ot tr{display:grid;grid-template-columns:auto 1fr;column-gap:var(--s3);padding:var(--s3) 0;border-bottom:1px solid var(--hair)}
  #ot tr[hidden]{display:none}
  #ot td{border:0;padding:0}
  #ot td:nth-child(1){grid-row:1;grid-column:1;color:var(--mute);font-size:14px;padding-top:2px}
  #ot td:nth-child(3){grid-row:1;grid-column:2;font-weight:600}
  #ot td:nth-child(2),#ot td:nth-child(4){grid-column:2;color:var(--mute);font-size:14px;display:inline}
  #ot td:nth-child(5){grid-column:2;font-size:14px;margin-top:2px}
  .scroll:has(#ot){overflow:visible;border-top:1px solid var(--hair)}
}
input[type=file]{font:15px var(--sans);color:var(--mute);max-width:100%}
input[type=file]::file-selector-button{min-height:44px;padding:0 var(--s4);margin-right:var(--s3);border:1px solid var(--ring);border-radius:var(--r-sm);background:var(--card);color:var(--ink);font:600 15px var(--sans);cursor:pointer}
input[type=file]::file-selector-button:hover{border-color:var(--brand)}

/* no category colour anywhere in the interface: areas are named, not colour-coded */
.tgroup>summary{padding-left:0}.tgall,.tgroup .chk{margin-left:0}
.aprog i{background:var(--ink)}
/* type: large light display serif, quiet sans interface */
h1{font:500 40px/1.08 var(--serif);letter-spacing:-.028em;margin:var(--s2) 0 var(--s3)}
h2{font:500 26px/1.2 var(--serif);letter-spacing:-.018em}
.hero h1{font-size:44px}
@media(max-width:600px){h1,.hero h1{font-size:33px}h2{font-size:23px}}
.lead{font-size:18px;line-height:1.55;color:var(--mute);max-width:46ch}
.tgn,.feature b,.exb h3{font-weight:500}
.qq .prompt,.qq>p{font-size:21px;line-height:1.5}
/* controls: black primary, text secondary, small radii */
.btn{min-height:44px;padding:0 var(--s5);display:inline-flex;align-items:center;justify-content:center;border-radius:var(--r-sm);border:1px solid var(--ink);background:var(--ink);color:var(--bg)!important;font:600 15.5px var(--sans);letter-spacing:.005em}
.btn.alt{background:transparent;color:var(--ink)!important;border-color:var(--ring)}
.btn.alt:hover{border-color:var(--ink)}
.btn:hover:not(.alt){background:color-mix(in srgb,var(--ink) 86%,var(--bg))}
.chip,.seg span{border-radius:var(--r-sm)!important;border:1px solid var(--ring)!important;min-height:40px;padding:var(--s2) var(--s4);font-weight:500}
.chip.on,.seg input:checked+span{background:var(--ink)!important;border-color:var(--ink)!important;color:var(--bg)!important}
.card,.exam,.obj,.exq,.explorer,.amap,.feature,.lim{border-radius:var(--r-md);border-color:var(--hair)}
.opt.sel .ol{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.opt.ok .ol,.opt.bad .ol{color:var(--bg)}
.pill{border-radius:var(--r-sm);background:none;border:1px solid var(--hair);color:var(--mute);font-weight:500}
.pill.warn{color:var(--warn);border-color:color-mix(in srgb,var(--warn) 35%,transparent);background:none}
.topnote{font-size:13px;color:var(--mute)}
/* chrome: the sidebar and tab bar sit on the page, hairline only */
.tabs{background:var(--bg)!important;border-color:var(--hair)!important}
.tabs>a{color:var(--mute)}.tabs>a.on{color:var(--ink);background:none!important;font-weight:600}
@media(min-width:960px){.tabs>a:hover{background:var(--brand2)}.tabs>a.on{background:var(--brand2)!important}.tabs>a.sbrand{font:500 22px var(--serif);letter-spacing:-.01em}}
.tabs svg{stroke-width:1.5}
.first{margin:var(--s5) 0 var(--s6);padding:var(--s5) 0;border-top:1px solid var(--hair);border-bottom:1px solid var(--hair)}.first p{margin:0;max-width:52ch;font-size:17px}
.empty{margin:var(--s4) 0;padding:var(--s5) 0;border-top:1px solid var(--hair);border-bottom:1px solid var(--hair);color:var(--mute)}
/* lessons: contents list follows the reader; beside the reading column on wide screens */
.mside{display:contents}
.snav a[aria-current]{color:var(--ink);border-bottom-color:var(--ink)}
@media(min-width:1180px){
  main:has(.mgrid){max-width:1060px}
  .mgrid{display:grid;grid-template-columns:minmax(0,680px) 220px;justify-content:space-between;gap:var(--s8)}
  .mside{display:block;order:2}
  .mside .snav{position:sticky;top:var(--s6);display:flex;flex-direction:column;gap:0;margin:0;padding:0;border:0;background:none;overflow:visible}
  .mside .snav a{min-height:36px;padding:var(--s1) 0 var(--s1) var(--s4);border:0;border-left:1px solid var(--hair);font-size:14.5px;white-space:normal;line-height:1.35}
  .mside .snav a[aria-current]{border-left:2px solid var(--ink);padding-left:calc(var(--s4) - 1px);font-weight:600}
}
/* mistakes: one compact row each; the explanation and the actions open on demand */
.mklist{border-top:1px solid var(--hair)}
.mk{border-bottom:1px solid var(--hair)}
.mk>summary{display:grid;gap:2px;padding:var(--s3) 28px var(--s3) 0;position:relative;list-style:none;cursor:pointer;min-height:56px;font-weight:400}
.mk>summary::-webkit-details-marker{display:none}
.mk>summary::after{content:"";position:absolute;right:2px;top:var(--s4);width:16px;height:16px;background:var(--mute);-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transform:rotate(90deg);transition:transform .15s var(--ease-out)}
.mk[open]>summary::after{transform:rotate(-90deg)}
.mkq{font:400 17px/1.45 var(--serif);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mkm{font-size:14px;color:var(--mute)}
.mk[open] .mkq{display:none}
.mkb{padding:0 0 var(--s4)}.mkb .prompt{font:400 18px/1.5 var(--serif);margin-top:0}
.first{border-bottom:0;padding-bottom:0}

/* session 19b: fewer boxes. Content blocks become typographic sections divided by hairlines; only interactive tools
   (explorers, argument maps) and the worked-example prompt keep a surface. */
main .card,.feature,.obj,.exam,.lim{background:none;border:0;border-top:1px solid var(--hair);border-radius:0;box-shadow:none;padding:var(--s5) 0 var(--s2);margin:var(--s5) 0}
main .card h2,.exam h2,.lim h2{margin-top:0}
.grid .card{border-top:1px solid var(--hair)}
.feature{display:block;padding-bottom:var(--s5);border-bottom:1px solid var(--hair);text-decoration:none;color:var(--ink)}
.feature b{display:block;font:500 26px/1.2 var(--serif);letter-spacing:-.015em;margin:0 0 var(--s2)}
.feature span{display:block}
.feature::after{content:"Open the lesson";display:inline-flex;margin-top:var(--s3);font:600 15.5px var(--sans);text-decoration:underline;text-decoration-color:var(--ring);text-underline-offset:4px}
.feature:hover::after{text-decoration-color:currentColor}.feature:hover{background:none}
.obj{padding-top:var(--s5)}.obj blockquote{font:400 24px/1.4 var(--serif);letter-spacing:-.01em;max-width:34ch}
.obj h2{font:600 14px var(--sans);color:var(--mute)}
.exq{border:0;background:var(--card);border-radius:var(--r-md)}
.lim{border-bottom:1px solid var(--hair);padding-bottom:var(--s4)}
.explorer,.amap{background:var(--card);border-color:var(--hair)}
/* motion: the question enters (opacity and transform only), the options follow 40ms later; the verdict fades in */
@keyframes q-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes q-fade{from{opacity:0}to{opacity:1}}
.qq.enter{animation:q-enter .32s var(--ease-out) both}
.opts.enter{animation:q-enter .32s var(--ease-out) .04s both}
.vd{animation:q-fade .2s var(--ease-out) both}
@media(prefers-reduced-motion:reduce){.qq.enter,.opts.enter,.vd{animation:none}}
/* results: one large numeral */
.score{margin:var(--s4) 0 var(--s2);font:400 22px/1.2 var(--serif);color:var(--mute)}
.score b{display:block;font:400 88px/0.95 var(--serif);letter-spacing:-.04em;color:var(--ink);font-variant-numeric:lining-nums tabular-nums;margin:0 0 var(--s2)}
.rq summary{font-weight:400}.rqt{font:400 16.5px/1.45 var(--serif)}

/* ===== Session 20: practice refinement (Apple Design: feedback on press, restraint; Emil: press 0.97-0.99, ease-out, no motion on keyboard actions;
   Unslop: richness only where it means something). Progress is a segment strip that records right and wrong; the Check action stays quiet
   until an option is chosen; options give instant press feedback; from 1000px the explanation sits in a margin beside the question. */
.opt{transition:background-color .15s var(--ease-out),color .15s var(--ease-out),transform .14s var(--ease-out)}
.opt:active:not([disabled]){transform:scale(.99);background:var(--brand2)}
.opt:active:not([disabled]) .ol{border-color:var(--ink);color:var(--ink)}
.opt.sel{background:var(--brand2)}
.opt.ok{background:color-mix(in srgb,var(--okbg) 60%,transparent)}.opt.bad{background:color-mix(in srgb,var(--badbg) 60%,transparent)}
.opt.ok,.opt.bad{border-radius:var(--r-md);border-bottom-color:transparent}
.btn.alt[aria-disabled="true"]{color:var(--mute)!important;border-color:var(--hair)}
.btn.alt[aria-disabled="true"]:hover{border-color:var(--hair)}
#hint{font-size:14.5px}
.bar i{transition:background-color .2s var(--ease-out)}
@media(min-width:1000px){
  body.focus main:has(.qgrid){max-width:1080px}
  .qgrid{display:grid;grid-template-columns:minmax(0,600px) minmax(0,1fr);grid-template-rows:auto auto auto auto 1fr;column-gap:var(--s8);align-items:start}
  .qgrid>.qhead{grid-area:1/1/2/-1}.qgrid>.bar{grid-area:2/1/3/-1}.qgrid>.note{grid-area:3/1/4/-1}
  .qgrid>.qcol{grid-area:4/1/5/2}.qgrid>.acol{grid-area:4/2/6/3}.qgrid>.again{grid-area:5/1/6/2;margin:0}
  .qgrid .qq .prompt,.qgrid .qq>p{font-size:24px;line-height:1.45}
  .qgrid .opt{font-size:19px}
  .acol{padding-top:var(--s1)}
  .acol .why{margin:0;padding-top:0;border-top:0}
}
@media(prefers-reduced-motion:reduce){.opt,.bar i{transition:none}.opt:active:not([disabled]){transform:none}}
.opt .ot math,.ans math{font-size:1.15em}

/* ===== Session 21: maths display (mathrender.js emits MathML). Letters stay upright like the surrounding text; fractions in
   questions and options use the larger "display" style so numerals stay readable on a phone. */
math{font-size:1.08em;font-family:"STIX Two Math","Cambria Math","Latin Modern Math","Noto Sans Math","Source Serif 4",serif}
math mi{font-style:normal}
.qq math,.opt .ot math,.ans math,.exq math,.mkb math,.steps math{math-style:normal;font-size:1em}
.why math,.msec math,.rqb math{font-size:1.12em}

/* ===== Session 21: colour and the lesson player. Strategy (Impeccable colorize): colour has roles, not decoration.
   Paper stays warm; the AREA colour (--a, set per route) drives the main action, selection, progress and the current step;
   three fixed tints name the kinds of material (worked example = area tint, "check yourself" = amber, common mistake = rose);
   green and red keep meaning right and wrong. Pages outside an area use a deep ink blue. The dark theme is composed, not inverted. */
:root{--accent:var(--a,var(--brand))}
:where([data-theme="dark"]):root{--accent:color-mix(in srgb,var(--a,#27428f) 52%,#fff)}
::selection{background:color-mix(in srgb,var(--accent) 24%,transparent)}
html{accent-color:var(--accent);caret-color:var(--accent)}
body{background:var(--bg)}
a{color:var(--accent)}
.btn{background:var(--accent);border-color:var(--accent);color:var(--on-accent)!important}
.btn:hover:not(.alt){background:color-mix(in srgb,var(--accent) 88%,var(--ink))}
.btn.alt{background:transparent;color:var(--accent)!important;border-color:color-mix(in srgb,var(--accent) 45%,transparent)}
.btn.alt:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}
.btn.alt[aria-disabled="true"]{color:var(--mute)!important;border-color:var(--hair)}
.chip.on,.seg input:checked+span{background:var(--accent)!important;border-color:var(--accent)!important;color:var(--on-accent)!important}
.tl,.rl a,.back{color:var(--accent)}
/* navigation */
.tabs>a.on{color:var(--accent)}.tabs>a.on svg{stroke-width:2}
@media(min-width:960px){.tabs>a.on{background:color-mix(in srgb,var(--accent) 10%,transparent)!important}}
.tgroup>summary{padding-left:var(--s5)}
.aprog i{background:var(--a)}
.nextstep{border-top:1px solid var(--hair);border-bottom:1px solid var(--hair);background:color-mix(in srgb,var(--accent) 6%,transparent)}
/* practice */
.bar i.cur{background:color-mix(in srgb,var(--accent) 45%,transparent)}.bar i.on{background:var(--accent)}
.opt.sel{background:color-mix(in srgb,var(--accent) 9%,transparent)}
.opt.sel .ol{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.opt:hover:not([disabled]):not(.sel){background:color-mix(in srgb,var(--accent) 6%,transparent)}
.opt:hover:not([disabled]) .ol{border-color:var(--accent);color:var(--accent)}
.opt:active:not([disabled]){background:color-mix(in srgb,var(--accent) 12%,transparent)}
.opt:active:not([disabled]) .ol{border-color:var(--accent);color:var(--accent)}
.opt:focus-visible,.lopt:focus-visible{outline:2px solid var(--accent)}
.opt.ok .ol,.opt.bad .ol,.lopt.ok .ol,.lopt.bad .ol{color:var(--on-accent)}
.qclock{background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}
.score b{color:var(--accent)}
.tryit{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s2) var(--s3);margin:var(--s3) 0 var(--s4)}
.tryit label{display:flex;align-items:center;gap:var(--s2);font:600 14.5px var(--sans)}
.tryit input{width:9.5em;min-height:44px;padding:0 var(--s3);border:1px solid var(--ring);border-radius:var(--r-sm);background:var(--card);color:var(--ink);font:400 17px var(--serif)}
.tryit input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.tryit .btn{min-height:44px;padding:0 var(--s4)}.tryit p{flex:1 1 100%;margin:0}
.okmsg{color:var(--ok);font-weight:600}.badmsg{color:var(--bad);font-weight:600}.need{color:var(--warn);font-weight:600}

/* lesson player */
.lgrid{display:block}
.lrail{display:none}
.lmain{min-width:0}
.lbar{display:flex;gap:3px;height:4px;margin:var(--s2) 0 var(--s3)}
.lbar i{flex:1;border-radius:2px;background:var(--hair)}.lbar i.done{background:var(--accent)}.lbar i.cur{background:color-mix(in srgb,var(--accent) 45%,transparent)}
.lbar i.done.cur{background:var(--accent)}
.lcount{margin:0 0 var(--s2);font:600 14px var(--sans);color:var(--accent)}
.lall{margin:0 0 var(--s4)}
.lall>summary{display:inline-flex;align-items:center;gap:var(--s2);min-height:44px;font:500 14.5px var(--sans);color:var(--mute);cursor:pointer;list-style:none}
.lall>summary::-webkit-details-marker{display:none}
.lall>summary::before{content:"";width:16px;height:16px;background:currentColor;-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transition:transform .15s var(--ease-out)}
.lall[open]>summary::before{transform:rotate(90deg)}
.lsteps{list-style:none;margin:0;padding:0}
.lsteps li{margin:0}
.lsteps a{display:grid;grid-template-columns:28px 1fr;column-gap:var(--s3);align-items:start;padding:var(--s2) var(--s1);min-height:44px;border-radius:var(--r-md);color:var(--ink);text-decoration:none}
.lsteps a:hover{background:color-mix(in srgb,var(--accent) 7%,transparent)}
.lk{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1.5px solid var(--ring);font:600 13px var(--sans);color:var(--mute);font-variant-numeric:tabular-nums}
.lsteps .done .lk{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.lsteps .cur .lk{border-color:var(--accent);color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent)}
.lsteps .cur.done .lk{color:var(--on-accent)}
.lt{font:500 16px/1.4 var(--sans);padding-top:3px}.lt small{display:block;margin-top:1px;font:400 13.5px var(--sans);color:var(--mute)}
.lsteps .cur .lt{font-weight:600}
.lstep h2{font:500 30px/1.15 var(--serif);letter-spacing:-.02em;margin:var(--s2) 0 var(--s4)}
.lstep .lsec{margin:0 0 var(--s4)}
.lstep .lsec>p,.lstep .lsec li{font:400 18px/1.65 var(--serif);max-width:62ch;text-wrap:pretty}
.lstep .lsec>p{margin:0 0 var(--s4)}
.lstep .lsec b{font-weight:600;background:linear-gradient(transparent 64%,color-mix(in srgb,var(--accent) 20%,transparent) 64%);padding:0 1px}
.lstep .lsec h3,.lstep .lsec h2{font:600 18px var(--sans);margin:var(--s5) 0 var(--s2)}
.lstep .lsec ul,.lstep .lsec ol{padding-left:22px;margin:0 0 var(--s4)}.lstep .lsec li{margin:6px 0}
.lstep .lsec table{font:16px var(--sans)}
.lstep .lsec .explorer,.lstep .lsec .amap,.lstep .lsec .qfig{background:var(--card);border-radius:var(--r-lg)}
/* worked example: area tint */
.exb{background:var(--t-ex);border:0;border-radius:var(--r-lg);padding:var(--s5);margin:var(--s5) 0}
.exb h3{font:500 22px/1.25 var(--serif);margin:0 0 var(--s1)}.exb .exn{color:var(--accent)}
.exb .idea{margin:0 0 var(--s3);font:14.5px var(--sans);color:var(--mute)}
.exq{background:var(--card);border-radius:var(--r-md);padding:var(--s3) var(--s4)}.exq .prompt{margin:0;font:400 18px/1.55 var(--serif)}
.steps{margin:var(--s4) 0;padding-left:24px}.steps li{font:400 17px/1.6 var(--serif);margin:var(--s2) 0}
.exans{font:17px/1.55 var(--serif);padding:var(--s3) var(--s4);border-radius:var(--r-md);background:color-mix(in srgb,var(--ok) 10%,transparent)}
/* check yourself: amber */
.lchk{margin:var(--s6) 0 var(--s4);padding:var(--s5);border-radius:var(--r-lg);background:var(--t-chk)}
.lchk h3,.lchk h4{margin:0 0 var(--s3);font:600 14.5px var(--sans);color:var(--warn)}
.lq .prompt{margin:0 0 var(--s4);font:400 19px/1.5 var(--serif)}
.lopts{display:grid;gap:var(--s2)}
.lopt{display:grid;grid-template-columns:28px 1fr;column-gap:var(--s3);align-items:start;width:100%;min-height:52px;padding:12px var(--s3);border:1px solid var(--hair);border-radius:var(--r-md);background:var(--card);color:var(--ink);text-align:left;font:400 17.5px/1.45 var(--serif);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:border-color .15s var(--ease-out),background-color .15s var(--ease-out),transform .14s var(--ease-out)}
.lopt .ot{padding-top:2px;overflow-wrap:anywhere}
.lopt:hover:not(:disabled){border-color:var(--accent)}.lopt:active:not(:disabled){transform:scale(.99)}
.lopt:disabled{cursor:default;color:var(--ink);opacity:1}
.lopt.ok{border-color:var(--ok);background:var(--okbg)}.lopt.ok .ol{background:var(--ok);border-color:var(--ok)}
.lopt.bad{border-color:var(--bad);background:var(--badbg)}.lopt.bad .ol{background:var(--bad);border-color:var(--bad)}
.lopt .om{grid-column:2}.lopt.ok .om{color:var(--ok)}.lopt.bad .om{color:var(--bad)}
.lfb{margin-top:var(--s3)}.lfb .vd{animation:q-fade .2s var(--ease-out) both}.lfb .vd span{font-size:16.5px;line-height:1.55}
.lfb .row{margin:var(--s3) 0 0}
/* common mistakes: rose */
.mistlist{display:grid;gap:var(--s3);margin:var(--s5) 0}
.mist{padding:var(--s4) var(--s5);border-radius:var(--r-lg);background:var(--t-mist)}
.mist p{margin:0 0 var(--s2);font:16.5px/1.55 var(--sans)}.mist p:last-child{margin:0}
.mist .wrong{font:500 18px/1.45 var(--serif);color:var(--bad)}
/* steps nav and end of lesson */
.lnav{display:flex;justify-content:space-between;gap:var(--s3);margin:var(--s6) 0 var(--s2)}
.lnav .btn{min-width:130px;gap:var(--s2)}.lnav .btn:last-child{margin-left:auto}
.lhint{margin:0 0 var(--s4)}
.lsum{margin:var(--s5) 0;padding:var(--s4) var(--s5);border-radius:var(--r-lg);background:var(--t-ex)}.lsum h3{margin:0 0 var(--s2);font:600 15px var(--sans)}.lsum li{font:17px/1.6 var(--serif);margin:6px 0}
/* overview */
.lovr{display:grid;gap:var(--s6)}
.lovr h2{margin:0 0 var(--s3)}
.lgoals ul{padding-left:20px}.lgoals li{font:18px/1.6 var(--serif);margin:6px 0}
.lplan .lsteps{border-top:1px solid var(--hair);margin-bottom:var(--s4)}.lplan .lsteps li{border-bottom:1px solid var(--hair)}
.lplan .lsteps a{padding:var(--s3) var(--s1)}
@media(min-width:1000px){
  main:has(.lgrid){max-width:1060px}
  .lgrid{display:grid;grid-template-columns:230px minmax(0,680px);justify-content:space-between;column-gap:var(--s7);align-items:start}
  .lrail{display:block;position:sticky;top:var(--s6)}
  .lrail .lsteps a{padding:var(--s2) var(--s2)}
  .lbar,.lall,.lcount{display:none}
  .lovr{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:var(--s7)}
  .lovr .lplan{grid-row:1/3;grid-column:2}.lovr .lgoals{grid-column:1}.lovr .obj{grid-column:1}
}
@media(prefers-reduced-motion:reduce){.lopt,.lall>summary::before{transition:none}.lopt:active{transform:none}}

.lovr .lplan{order:-1}
@media(min-width:1000px){.lovr .lplan{order:0}}
.lopt .ot math{math-style:normal;font-size:1em}
.lq .prompt{white-space:pre-line}
.lfb:focus{outline:none}
/* the area colour is set on #app, so the accent must be resolved there (a :root value would be computed before --a exists) */
#app{--accent:var(--a,var(--brand));--t-ex:color-mix(in srgb,var(--accent) 7%,var(--bg))}
:where([data-theme="dark"]) #app{--accent:color-mix(in srgb,var(--a,#27428f) 52%,#fff);--t-ex:color-mix(in srgb,var(--accent) 11%,var(--bg))}

/* ===== M4.10 design pass (session 25): feedback beside the option, marked graph points, step emphasis, touch targets, desktop step count ===== */
/* check feedback now follows the option it explains (lesson.js moves it) */
.lopts>.lfb{margin:0 0 var(--s1);padding:var(--s1) var(--s3) var(--s2)}
.lopt .om{font-size:14px}
/* graph: points the lesson names, and labels that stay readable at phone width */
.gpt{fill:var(--ink);stroke:var(--card);stroke-width:2}
.gm{fill:var(--ink);font:600 11.5px var(--sans);paint-order:stroke;stroke:var(--card);stroke-width:3px;stroke-linejoin:round}
.lstep .qfig{max-width:480px}
@media(max-width:600px){.lstep .qfig .gt{font-size:12px}.lstep .qfig .gm{font-size:12.5px}}
/* touch targets (measured below 44 px in M4.10 at 390 px) */
.lstep .exall{min-height:44px;padding:0 var(--s2)}
.lstep .qfig summary{padding:12px 0;cursor:pointer}
.lstep input[type=range]{min-height:44px}
/* desktop: the step count stays visible above the step heading */
@media(min-width:1000px){.lcount{display:block;margin:0 0 var(--s1);color:var(--mute)}}

/* ===== M4.10 visual refinement (session 25b): from tinted slabs to ruled, typographic structure =====
   Reading surface = paper. One lifted sheet (the card token) for worked examples, summaries and figures; the check keeps its amber
   because it is the only activity; common mistakes become a ruled list. Colour is spent on the area accent (labels, numerals) and on right/wrong. */
#app{--t-ex:var(--card)}
:where([data-theme="dark"]) #app{--t-ex:var(--card)}
/* run-in headings ("Through two points.") read as headings, not as highlighted key terms */
.lstep .lsec b.lead-in{background:none;padding:0;font-weight:600}
.lstep{animation:q-fade .2s var(--ease-out) both}
@media(prefers-reduced-motion:reduce){.lstep{animation:none}}
/* worked example: label, title, method, problem, then numbered working in ruled rows */
.exb{padding:var(--s5) var(--s5) var(--s4);border:1px solid var(--hair);border-radius:var(--r-lg);margin:var(--s6) 0}
.exb header{margin:0 0 var(--s4)}
.exb h3{font:500 24px/1.2 var(--serif);letter-spacing:-.012em;margin:0}
.exb h3 .exn{display:block;margin:0 0 var(--s1);font:600 13.5px/1.3 var(--sans);letter-spacing:.01em;color:var(--accent)}
.exb .idea{margin:var(--s1) 0 0;font:14.5px/1.45 var(--sans);color:var(--mute)}
.exq{background:none;border-radius:0;padding:0 0 var(--s4);border-bottom:1px solid var(--hair)}
.exq .prompt{font:400 19px/1.55 var(--serif)}
.tryit{margin:var(--s4) 0 0}
.exb .steps{list-style:none;counter-reset:st;margin:0;padding:0}
.exb .steps li{counter-increment:st;position:relative;display:block;margin:0;padding:var(--s3) 0 var(--s3) 38px;border-bottom:1px solid var(--hair);font:400 18px/1.6 var(--serif);color:color-mix(in srgb,var(--ink) 82%,transparent)}
.exb .steps li[hidden]{display:none}
.exb .steps li::before{content:counter(st);position:absolute;left:0;top:calc(var(--s3) + 3px);min-width:22px;height:22px;padding:0 1px;border:1px solid color-mix(in srgb,var(--accent) 45%,transparent);border-radius:11px;text-align:center;font:600 12.5px/20px var(--sans);color:var(--accent)}
.exb .steps li.cur{color:var(--ink)}
.exb .steps li.cur::before{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.exans{margin:0;padding:var(--s3) 0 0;border:0;border-radius:0;background:none;font:500 20px/1.45 var(--serif)}
.exans b{margin-right:var(--s2);font:600 13.5px var(--sans);color:var(--accent)}
.exb .row{margin-top:var(--s4)}
/* common mistakes: a ruled list under one label */
.mistlist{display:block;margin:var(--s6) 0 var(--s5);border-top:0}
.mistlist>h3{margin:0 0 var(--s1);font:600 14.5px var(--sans);color:var(--mute)}
.mist{padding:var(--s4) 0;border-radius:0;background:none;border-top:1px solid var(--hair)}
.mist:last-child{border-bottom:1px solid var(--hair)}
.mist p:not(.wrong){margin:var(--s1) 0 0;font:400 17px/1.6 var(--serif)}
.mist .wrong{margin:0;font:500 19px/1.4 var(--serif);color:var(--bad)}
.mist b{margin-right:var(--s1);font:600 14.5px var(--sans);color:color-mix(in srgb,var(--ink) 72%,transparent)}
/* figure: the same sheet as the examples */
.lstep .qfig{background:var(--card);border:1px solid var(--hair);border-radius:var(--r-lg);padding:var(--s3) var(--s4) var(--s1);margin:var(--s5) 0}
.lstep .qfig figcaption{font:600 14px var(--sans);color:var(--mute);margin:0 0 var(--s1)}
.glegs{fill:none;stroke:var(--mute);stroke-width:1.5;stroke-dasharray:4 3}
.gleg{fill:var(--mute);font-weight:600}
/* the progress strip and its summary share one row on phones */
.lall>summary{display:flex;justify-content:space-between;width:100%}
.lall>summary .lc{font:600 14px var(--sans);color:var(--accent)}
.lall>summary .la{display:inline-flex;align-items:center;gap:var(--s2)}
.lall>summary::before{display:none}
.lall>summary .la::before{content:"";width:16px;height:16px;background:currentColor;-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transition:transform .15s var(--ease-out)}
.lall[open]>summary .la::before{transform:rotate(90deg)}
.lmain>.lcount{display:none}
@media(min-width:1000px){.lmain>.lcount{display:block}}
@media(max-width:600px){.exb{padding:var(--s4) var(--s4) var(--s3)}.exb h3{font-size:22px}.exb .steps li{padding-left:34px;font-size:17.5px}.lchk{padding:var(--s4)}}
.gt{paint-order:stroke;stroke:var(--card);stroke-width:3px;stroke-linejoin:round}
.lstep .lsec .scroll,.lstep .lsec table{margin-top:var(--s4);margin-bottom:var(--s4)}
.lstep .lsec .scroll table{margin:0}
.lsum{border:1px solid var(--hair);padding:var(--s4) var(--s5)}
.lsum h3{color:var(--mute);font-size:14.5px}
/* the live equation in an explorer is mathematics, so it takes the reading face */
.explorer .ex-eq{font:500 24px/1.3 var(--serif);letter-spacing:-.01em}
/* the feedback region receives focus after an answer: show it to keyboard users, not after a tap or click */
.lfb:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--r-sm)}

/* ===== M3.6 pass (session 26): widgets inside lessons lose their nested fills and stray highlights ===== */
.lstep .lsec .bar3 b,.lstep .explorer b,.lstep .ex-verdict b{background:none;padding:0}
.lstep .explorer .ex-verdict{background:none;border:0;border-top:1px solid var(--hair);border-radius:0;padding:var(--s3) 0 0;margin-top:var(--s3)}
.lstep .lsec>table:has(th:nth-child(3)),.lstep .lsec>.scroll>table:has(th:nth-child(3)){width:100%}
.lstep .lsec>table,.lstep .lsec>.scroll>table{min-width:min(100%,26rem)}
.nb{white-space:nowrap}
.exall[hidden]{display:none}

/* ===== CT1 and PS1 pass (session 27): argument maps, text tables, filter widget ===== */
.lstep .lsec td b,.lstep .lsec th b,.lstep .amap b,.lstep .astmt b{background:none;padding:0}
@media(max-width:600px){
  .lstep .stack,.lstep .stack tbody{display:block}
  .lstep .stack tr{display:block;padding:var(--s3) 0;border-bottom:1px solid var(--hair)}
  .lstep .stack tr:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);padding:0;border:0}
  .lstep .stack td{display:block;padding:0;border:0;font:400 16.5px/1.5 var(--serif)}
  .lstep .stack td:first-child{font:600 17.5px/1.4 var(--serif);margin-bottom:var(--s1)}
  .lstep .stack td[data-l]::before{content:attr(data-l) ": ";font:600 13.5px var(--sans);color:var(--mute)}
}
.lstep .amap .a-main{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,var(--card))}
.lstep .amap .a-main b{color:var(--accent)}
/* the amber check surface is lighter than the page: links and the reveal button take a darker mix of the area accent so every area stays above 4.5:1 */
.lchk a,.lchk .btn.alt{color:color-mix(in srgb,var(--accent) 72%,var(--ink))!important}

/* ===== CT2 to CT7 pass (session 28) ===== */
.lstep h2+.mistlist{margin-top:var(--s2)}

/* ===== PS2, PS3 and PS-K pass (session 29): charts take the lesson's area colour ===== */
.lstep .fbar,.lstep .gdot{fill:var(--accent)}
.lstep .qfig:not(:has(.gline2)) .gline{stroke:var(--accent)}
/* lessons with many steps (13 to 15): the sticky rail scrolls inside itself instead of running off the bottom of the window */
@media(min-width:1000px){.lrail{max-height:calc(100vh - var(--s6) * 2);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-right:var(--s1)}}

/* ===== M4.10 and guided lessons carry the Home language (session 30) =====
   The stepper becomes a typographic index (numerals, no circles), and the short subject-colour rule that marks the Home lead and the areas
   also marks the lesson title and the current step heading. */
.lk{width:auto;min-width:26px;height:auto;border:0;border-radius:0;box-shadow:none;background:none;justify-self:start;padding-top:2px;font:500 17px/1.4 var(--serif);color:var(--mute)}
.lsteps .done .lk,.lsteps .cur .lk,.lsteps .cur.done .lk{background:none;border:0;box-shadow:none;color:var(--accent)}
.lsteps .cur .lk{font-weight:600}
.lsteps .lk svg{display:block;margin-top:4px}
.mhead h1{max-width:22ch;font:500 40px/1.1 var(--serif);letter-spacing:-.025em}
.mhead h1::before,.lstep>h2:not(.sr)::before,.lmain>.lcount::before{content:"";display:block;width:28px;height:2px;margin-bottom:var(--s4);background:var(--accent)}
.lmain>.lcount::before{display:none}
@media(min-width:1000px){.lstep>h2:not(.sr)::before{display:none}.lmain>.lcount::before{display:block}.lmain>.lcount{margin-bottom:var(--s3)}}
@media(max-width:600px){.mhead h1{font-size:32px}}
.mhead h1{font-size:36px;max-width:24ch}.mhead h1::before{margin-top:var(--s2)}@media(max-width:600px){.mhead h1{font-size:30px}}

/* ===== Design Constitution v1.0 (session 31): "Warm Editorial Intelligence" =====
   THIS BLOCK IS THE SOURCE OF TRUTH for colour, type, space, radius and the shell. Earlier blocks above are history: where they disagree, this one wins
   (it comes last). Canonical names are --color-*, --area-*, --space-*, --r-*, --shadow-*. The legacy names (--bg, --card, --ink, --mute, --hair, --ring,
   --brand, --brand2, --ok, --bad, --warn, --s1..--s8) are aliases so every older rule keeps working; do not add new hex values outside this block.
   Roles: neutral surfaces and text carry the content; terracotta (--brand) marks global actions, selection and focus; each study area has its own colour
   (--area-*, exposed per route as --a / --a-soft / --a-line) used for subject labels, markers, steps, progress and charts; green and red only mean right and wrong. */
:root{
  --color-page:#F5F2EC;--color-surface:#FAF8F4;--color-surface-raised:#FDFCF9;--color-surface-soft:#EEEAE3;--color-surface-sunken:#E9E5DD;
  --color-text:#27251F;--color-text-secondary:#615B52;--color-text-muted:#6B6358;--color-border:#DCD7CD;--color-border-strong:#B5AEA2;
  --color-brand:#A34F34;--color-brand-hover:#873E2A;--color-brand-soft:#F1E1D8;--color-focus:#A34F34;--color-on-brand:#fff;
  --color-walnut:#76543C;--color-olive:#68705B;
  --color-success:#286647;--color-error:#A13F36;--color-warning:#8A5A13;--color-info:#315F9B;
  --area-math:#315F9B;--area-math-soft:#E7EDF6;--area-math-line:#B9CBE0;
  --area-geometry:#24766F;--area-geometry-soft:#E4EFEC;--area-geometry-line:#B8D4CE;
  --area-ct:#765080;--area-ct-soft:#EFE7F0;--area-ct-line:#D4C1DA;
  --area-ps:#8A5A13;--area-ps-soft:#F3EAD8;--area-ps-line:#DCC79E;
  --shadow-raised:0 6px 20px rgba(39,37,31,.06);
}
/* Warm Editorial Ink (session 54): warm charcoal, not near-black. Page #211F1B, surfaces step up by about 4 points of lightness; text and accent from the brief, muted text raised to hold 4.5:1 on the soft surface (scripts/test-theme.mjs). */
:where([data-theme="dark"]):root{color-scheme:dark;--color-page:#1E1D1C;--color-surface:#262524;--color-surface-raised:#2E2D2B;--color-surface-soft:#343331;--color-surface-sunken:#171716;
  --color-text:#ECE9E3;--color-text-secondary:#B8B4AB;--color-text-muted:#A29E95;--color-border:#403E3B;--color-border-strong:#75716A;
  --color-brand:#CB8966;--color-brand-hover:#D99A78;--color-brand-soft:#372D28;--color-focus:#D99A78;--color-on-brand:#211712;
  --color-walnut:#B18A67;--color-olive:#A3AD8F;
  --color-success:#91C3A0;--color-error:#E18B7D;--color-warning:#E3B66A;--color-info:#91B3E2;
  --area-math:#91B3E2;--area-math-soft:#26364B;--area-math-line:#425B78;
  --area-geometry:#78BFB2;--area-geometry-soft:#223B37;--area-geometry-line:#3B645D;
  --area-ct:#C5A0D0;--area-ct-soft:#3A2D3F;--area-ct-line:#66506D;
  --area-ps:#E3B66A;--area-ps-soft:#41351F;--area-ps-line:#6F592F;
  --shadow-raised:0 6px 20px rgba(0,0,0,.22);}
:root{
  /* legacy aliases */
  --bg:var(--color-page);--card:var(--color-surface);--ink:var(--color-text);--mute:var(--color-text-secondary);--line:var(--color-border);
  --hair:var(--color-border);--ring:var(--color-border-strong);--brand:var(--color-brand);--brand2:var(--color-surface-soft);--on-accent:var(--color-on-brand);
  --ok:var(--color-success);--bad:var(--color-error);--warn:var(--color-warning);
  --okbg:color-mix(in srgb,var(--color-success) 10%,var(--color-surface));--badbg:color-mix(in srgb,var(--color-error) 9%,var(--color-surface));--warnbg:color-mix(in srgb,var(--color-warning) 11%,var(--color-surface));
  --t-chk:var(--color-surface-soft);--t-mist:var(--color-surface-soft);--t-ex:var(--color-surface);
  --c1:var(--area-ps);--c2:var(--area-math);--c3:var(--area-geometry);
  /* type */
  --serif:"Source Serif 4",Georgia,"Times New Roman",serif;--sans:"Source Sans 3",system-ui,-apple-system,"Segoe UI",sans-serif;
  /* space: 4 px base */
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;--space-16:64px;--space-20:80px;--space-24:96px;
  --s1:var(--space-1);--s2:var(--space-2);--s3:var(--space-3);--s4:var(--space-4);--s5:var(--space-6);--s6:var(--space-8);--s7:var(--space-12);--s8:var(--space-16);
  /* radius */
  --r-sm:4px;--r-md:8px;--r-lg:12px;--r-pill:999px;
  --nav:248px;--t-fast:140ms;
}
/* the study-area accent resolves on #app (set per route as --a); outside an area it is the brand colour */
#app,.hm-lead,.hm-area{--accent:var(--a,var(--color-brand))}
:where([data-theme="dark"]) #app,:where([data-theme="dark"]) .hm-lead,:where([data-theme="dark"]) .hm-area{--accent:var(--a,var(--color-brand))}
:where([data-theme="dark"]) #app{--t-ex:var(--color-surface)}
html{color-scheme:light;accent-color:var(--color-brand);caret-color:var(--color-brand)}
::selection{background:color-mix(in srgb,var(--color-brand) 24%,transparent)}
:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px;border-radius:var(--r-sm)}
.opt:focus-visible,.lopt:focus-visible,.lfb:focus-visible,.tryit input:focus-visible{outline:2px solid var(--color-focus)}

/* --- type: Source Serif 4 reads (titles, lessons, questions), Source Sans 3 operates (navigation, buttons, labels, metadata) --- */
body{font:400 16px/25px var(--sans);background:var(--color-page);color:var(--color-text)}
h1{font:400 36px/42px var(--serif);letter-spacing:-.01em;margin:var(--space-2) 0 var(--space-3)}
h2{font:400 28px/35px var(--serif);letter-spacing:-.005em;margin:var(--space-10) 0 var(--space-3)}
h3{font:400 22px/29px var(--serif);letter-spacing:0;margin:var(--space-6) 0 var(--space-2)}
h4{font:600 18px/25px var(--sans);margin:var(--space-5) 0 var(--space-2)}
.h3{font:600 18px/25px var(--sans)}
.lead{font:400 19px/29px var(--sans);color:var(--color-text-secondary);max-width:60ch}
.small,.mute.small{font-size:14px;line-height:20px}
@media(max-width:767px){
  h1{font-size:30px;line-height:36px}h2{font-size:25px;line-height:32px}h3{font-size:20px;line-height:27px}.lead{font-size:17px;line-height:26px}
}
/* text links: the brand colour on light; on dark the spec's own lighter brand step (#C77A56 measured 3.97 to 4.47:1 on raised and soft surfaces, below 4.5:1) */
:root{--color-link:var(--color-brand);--color-link-hover:var(--color-brand-hover)}
:where([data-theme="dark"]):root{--color-link:var(--color-brand-hover);--color-link-hover:var(--color-text)}
a{color:var(--color-link)}
a:hover{color:var(--color-link-hover)}
.eyebrow,.hm-eb,.hm-gl,.sgl{font:600 12px/16px var(--sans);letter-spacing:.08em;text-transform:uppercase}

/* --- controls: one filled brand action per context, secondary outlined, text action in brand colour --- */
.btn{min-height:44px;padding:0 var(--space-6);border-radius:var(--r-md);border:1px solid var(--color-brand);background:var(--color-brand);color:var(--color-on-brand)!important;font:600 15.5px/1 var(--sans);letter-spacing:0;transition:background-color var(--t-fast) ease,border-color var(--t-fast) ease,transform .14s var(--ease-out)}
.btn:hover:not(.alt){background:var(--color-brand-hover);border-color:var(--color-brand-hover)}
.btn.alt{background:transparent;color:var(--color-text)!important;border:1px solid var(--color-border-strong)}
.btn.alt:hover{background:var(--color-surface-soft);border-color:var(--color-text-secondary)}
.btn.alt[aria-disabled="true"],.btn[disabled]{color:var(--color-text-secondary)!important;background:transparent;border-color:var(--color-border)}
.tl,.rl a,.back,.crumbs a{color:var(--color-link)}
.tl:hover,.rl a:hover,.back:hover{color:var(--color-link-hover)}
.chip.on,.seg input:checked+span{background:var(--color-brand)!important;border-color:var(--color-brand)!important;color:var(--color-on-brand)!important}
.chip,.seg span{border-color:var(--color-border-strong)!important;border-radius:var(--r-md)!important}
input[type=text],input[type=search],input:not([type]),select,textarea{border-radius:var(--r-md)}
::placeholder{color:var(--color-text-muted);opacity:1} /* the browser default (#757575) measured 3.2:1 on the dark input surface */
.qclock{background:var(--color-brand-soft);color:var(--color-text)} /* brand text on brand-soft measures 4.43 (light) and 4.17 (dark): below 4.5 */
.score b{color:var(--color-text)}
.pill{border-radius:var(--r-sm)}
.note{border-radius:var(--r-md);background:var(--warnbg);color:var(--color-warning)}

/* --- surfaces: structure from spacing and type first; 1 px borders; 12 px for grouped functional surfaces --- */
.card,.exam,.obj,.exq,.explorer,.amap,.feature,.lim,.mrow,.lsum,.exb,.lchk,.lstep .qfig{border-radius:var(--r-lg)}
.card,.feature{background:var(--color-surface);border:1px solid var(--color-border)}
.exb,.lstep .qfig,.lsum{background:var(--color-surface);border:1px solid var(--color-border)}
.lchk{background:var(--color-surface-soft);border:1px solid var(--color-border)}
.lchk .lopt{background:var(--color-surface-raised)}
.lchk a,.lchk .btn.alt{color:var(--color-link)!important}
.lchk .btn.alt{color:var(--color-text)!important}
.lchk h3,.lchk h4{color:var(--color-text-secondary);font:600 14px/20px var(--sans)}
.explorer,.amap{border-color:var(--color-border)}

/* --- answer options: bordered tiles with a lettered marker; selected = brand border + tint + filled marker; right/wrong carry a written label --- */
.opts{display:grid;gap:var(--space-2);border-top:0}
.opt{border:1px solid var(--color-border);border-radius:var(--r-md);background:var(--color-surface);padding:var(--space-3) var(--space-4);min-height:56px;transition:background-color var(--t-fast) ease,border-color var(--t-fast) ease}
.opt .ol,.lopt .ol{border-color:var(--color-border-strong)}
@media(hover:hover) and (pointer:fine){
  .opt:hover:not([disabled]):not(.sel),.lopt:hover:not(:disabled){background:var(--color-surface-soft);border-color:var(--color-border-strong)}
  .opt:hover:not([disabled]) .ol{border-color:var(--color-brand);color:var(--color-brand)}
}
.opt:active:not([disabled]){background:var(--color-surface-sunken)}
.opt.sel{background:var(--color-brand-soft);border-color:var(--color-brand);box-shadow:inset 0 0 0 1px var(--color-brand)}
.opt.sel .ol{background:var(--color-brand);border-color:var(--color-brand);color:var(--color-on-brand)}
.opt.ok,.lopt.ok{border-color:var(--color-success);background:var(--okbg);box-shadow:inset 0 0 0 1px var(--color-success)}
.opt.bad,.lopt.bad{border-color:var(--color-error);background:var(--badbg);box-shadow:inset 0 0 0 1px var(--color-error)}
.opt.ok .ol,.lopt.ok .ol{background:var(--color-success);border-color:var(--color-success);color:var(--color-on-brand)}
.opt.bad .ol,.lopt.bad .ol{background:var(--color-error);border-color:var(--color-error);color:var(--color-on-brand)}
.opt.dim{background:transparent}
.lopt{border-color:var(--color-border);border-radius:var(--r-md)}
.lopt:hover:not(:disabled){border-color:var(--color-border-strong)}
.vd.ok .ic,.vd.ok b{color:var(--color-success)}.vd.bad .ic,.vd.bad b{color:var(--color-error)}
.qq .prompt,.qq>p,.lq .prompt{font:400 20px/29px var(--serif)}
@media(max-width:767px){.qq .prompt,.qq>p,.lq .prompt{font-size:19px;line-height:28px}}

/* --- shell --- */
main{max-width:1160px;margin:0 auto;padding:var(--space-2) 20px var(--space-10)}
@media(min-width:480px){main{padding-inline:var(--space-6)}}
.top .brand{display:inline-block;padding:9px 0}
.tabs{background:var(--color-surface)!important;border-color:var(--color-border)!important}
.tabs>a{color:var(--color-text-secondary)}
.tabs>a.on{color:var(--color-brand);background:none!important}
.tabs>a.on svg{stroke-width:2}
.subnav{display:none}
@media(min-width:960px){
  body{padding-left:var(--nav)}
  main{padding:var(--space-10) var(--space-12) var(--space-16)}
  body:not(.focus) main:not(:has(.hm,.hm-contents,.lgrid))>*{max-width:760px} /* focus mode (practice) keeps its own width, including the question + explanation grid */
  .tabs{width:var(--nav);padding:var(--space-8) var(--space-3) var(--space-6);gap:2px;background:var(--color-page)!important}
  .tabs>a.sbrand{padding:0 var(--space-3) var(--space-6);font:600 24px/1.1 var(--serif);letter-spacing:-.01em;color:var(--color-text)}
  .tabs>a.sbrand span{color:var(--color-brand)}
  .tabs>a:not(.sbrand){position:relative;flex-direction:row;justify-content:flex-start;gap:var(--space-3);min-height:44px;padding:0 var(--space-3);border-radius:var(--r-md);font:500 15.5px/1 var(--sans);color:var(--color-text-secondary);background:none!important}
  .tabs>a svg{display:block;width:19px;height:19px;stroke-width:1.6;opacity:.85}
  .tabs>a:not(.sbrand):hover{background:var(--color-surface-soft)!important;color:var(--color-text)}
  .tabs>a.on{color:var(--color-text);font-weight:600;background:var(--color-surface-soft)!important}
  .tabs>a.on span{text-decoration:none}
  .tabs>a.on svg{opacity:1;stroke-width:1.9;color:var(--color-brand)}
  .subnav{display:flex;flex-direction:column;gap:var(--space-5);margin:var(--space-6) 0 0;padding-top:var(--space-6);border-top:1px solid var(--color-border)}
  .sgrp{display:grid;gap:2px}
  .sgl{margin:0 0 var(--space-1);padding:0 var(--space-3);color:var(--color-text-muted)}
  .subnav a{position:relative;display:flex;align-items:center;gap:10px;min-height:44px;padding:var(--space-1) var(--space-3);border-radius:var(--r-md);font:500 15px/20px var(--sans);color:var(--color-text-secondary);background:none!important;text-decoration:none}
  .subnav a span{text-align:left}
  .subnav a i{flex:none;width:3px;height:16px;border-radius:2px;background:var(--a);transition:height var(--t-fast) ease}
  .subnav a:hover{background:var(--color-surface-soft)!important;color:var(--color-text)}
  .subnav a.on{color:var(--color-text);font-weight:600;background:var(--color-surface-soft)!important}
  .subnav a.on i{height:26px}
  .tabs::after{padding:var(--space-4) var(--space-3) 0;font:13px/18px var(--sans);color:var(--color-text-muted)}
}
@media(min-width:1280px){main{padding-inline:56px}}

/* --- Learn page: the area entries (markup shared with Home, whose own compact rules below are scoped to .hm) --- */
.aprog{height:3px;background:var(--color-border)}
.aprog i{background:var(--a,var(--color-brand))}
.hm-contents{display:grid;gap:var(--space-12)}
.hm-group{display:grid;gap:var(--space-6)}
.hm-gl{margin:0;padding:0 0 var(--space-3);border-bottom:1px solid var(--color-border);color:var(--color-text-secondary)}
.hm-gb{display:grid;gap:var(--space-8)}
.hm-area{position:relative;display:block}
.hm-area::before{content:"";display:block;width:24px;height:3px;border-radius:2px;background:var(--a)}
.hm-an{display:flex;align-items:center;gap:var(--space-2);margin:var(--space-3) 0 0;font:400 24px/30px var(--serif);letter-spacing:-.005em}
.hm-an a{color:var(--color-text);text-decoration:none}
.hm-an a::after{content:"";position:absolute;inset:0}
.hm-an::after{content:"";flex:none;width:16px;height:16px;background:var(--color-text-muted);-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transition:transform var(--t-fast) ease,background-color var(--t-fast) ease}
.hm-area:hover .hm-an::after{transform:translateX(3px);background:var(--a)}
.hm-area:hover .hm-an a{text-decoration:underline;text-decoration-color:var(--a);text-decoration-thickness:2px;text-underline-offset:5px}
.hm-an a:focus-visible{outline:none}
.hm-area:has(a:focus-visible){outline:2px solid var(--color-focus);outline-offset:8px;border-radius:var(--r-md)}
.hm-ab{margin:var(--space-1) 0 0;font:400 15px/22px var(--sans);color:var(--color-text-secondary)}
.hm-am{margin:var(--space-2) 0 0;font:400 13.5px/20px var(--sans);color:var(--color-text-muted);font-variant-numeric:tabular-nums}
.hm-ab+.hm-am{margin-top:var(--space-3)}.hm-am+.hm-am{margin-top:0}
.hm-area .aprog{display:block;margin-top:var(--space-3)}
.hm-find .finder label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hm-find .finder input,main:has(.hm-contents) .finder input{width:100%;min-height:44px;padding:0 var(--space-4);border:1px solid var(--color-border-strong);border-radius:var(--r-md);background:var(--color-surface-raised);font:400 17px var(--serif);color:var(--color-text)}
.hm-find .finder input:focus-visible,main:has(.hm-contents) .finder input:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px;border-color:var(--color-focus)}
@media(min-width:768px){.hm-gb{grid-template-columns:1fr 1fr;gap:var(--space-8) var(--space-12)}}
@media(max-width:767px){.hm-an{font-size:22px;line-height:28px}}
@media(prefers-reduced-motion:reduce){.hm-an::after,.hm-area{transition:none}.hm-area:hover .hm-an::after{transform:none}}

/* --- Home, "bands" (approved Study A, session 34). Band 1 = the learner's place (current lesson, practise and review); band 2 = the study index with the two parent sections side by side.
   Layout switches on the CONTENT width (container query on <main>), not the viewport: the sidebar takes 248 px and the page padding 48 to 56 px, so the content is 616 px at a 960 px viewport and 896 px at 1240.
   Thresholds: index columns from 700 px, lesson | practise-and-review columns from 820 px, practise-and-review as three columns between 560 and 819 px. --- */
main:has(.hm){container:home/inline-size}
.hm{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--space-10)}
.hm-intro h1{margin:0 0 var(--space-2);font-size:32px;line-height:38px}
.hm-sub{margin:0;font:400 17px/26px var(--sans);color:var(--color-text-secondary)}
.hm-band{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--space-8);align-items:start;padding-top:var(--space-6);border-top:1px solid var(--color-border)}
.hm .hm-eb{margin:0;font:600 13px/20px var(--sans);letter-spacing:0;text-transform:none;color:var(--color-text-secondary)}
.hm-lead{min-width:0}
.hm-title{margin:var(--space-2) 0 0;max-width:26ch;font:400 30px/36px var(--serif);letter-spacing:-.01em;text-wrap:balance}
.hm-title.long{max-width:34ch;font-size:24px;line-height:30px}
.hm-stand{margin:var(--space-2) 0 0;max-width:46ch;font:400 18px/27px var(--serif);color:var(--color-text-secondary);text-wrap:pretty}
.hm-meta{margin:var(--space-4) 0 0;font:400 14.5px/21px var(--sans);color:var(--color-text-secondary)}
.hm-ar{display:block;margin-bottom:2px;font-weight:600;color:var(--a,var(--color-text-secondary))}
.hm-ar::before{content:"";display:inline-block;width:14px;height:3px;margin:0 var(--space-2) 3px 0;border-radius:2px;background:var(--a)}
.hm-acts{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 var(--space-6);margin:var(--space-3) 0 0}
.hm-acts .tl{display:inline-flex;align-items:center;min-height:44px;padding:0}
.hm-go{display:inline-flex;align-items:center;gap:var(--space-2);min-height:44px;font:600 16px/24px var(--sans);color:var(--color-link);text-decoration:none}
.hm-go span{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px;text-decoration-color:color-mix(in srgb,var(--color-link) 40%,transparent)}
.hm-go::after{content:"";flex:none;width:18px;height:18px;background:currentColor;-webkit-mask:var(--arr) center/18px no-repeat;mask:var(--arr) center/18px no-repeat;transition:transform var(--t-fast) ease}
.hm-go:hover span{text-decoration-color:currentColor}.hm-go:hover::after{transform:translateX(3px)}
.hm-go:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}
:root{--arr:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E")}
.hm-device{min-width:0}
.hm .hm-sl{margin:0;padding:0 0 var(--space-2);border:0;font:600 13px/20px var(--sans);letter-spacing:0;text-transform:none;color:var(--color-text-secondary)}
.hm-links{margin:0;padding:0;list-style:none;border-top:1px solid var(--color-border)}
.hm-links li{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:var(--space-4);border-bottom:1px solid var(--color-border)}
.hm-links a{flex:0 0 170px;display:inline-flex;align-items:center;min-height:44px;padding:0;font:600 16px/24px var(--sans);color:var(--color-link);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--color-link) 45%,transparent);text-underline-offset:4px}
.hm-links a:hover{color:var(--color-link-hover);text-decoration-color:currentColor}
.hm-links span{flex:1 1 150px;font:13.5px/20px var(--sans);color:var(--color-text-secondary)}
.hm-facts{display:flex;flex-wrap:wrap;gap:var(--space-1) var(--space-6);margin:var(--space-3) 0 0}
.hm-facts div{display:flex;gap:var(--space-3);align-items:baseline}
.hm-facts dt{font:14px/20px var(--sans);color:var(--color-text-secondary)}.hm-facts dd{margin:0;font:600 15px/22px var(--sans);font-variant-numeric:tabular-nums}
/* band 2: the study index. Parent heading with a hairline, then one row per area (3 px subject marker, serif name, one description line, counts). No cards. */
.hm .hm-contents{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--space-8)}
.hm .hm-group{display:grid;gap:0}
.hm .hm-gb{display:block}
.hm .hm-gl{margin:0;padding:0 0 var(--space-3);border-bottom:1px solid var(--color-border);color:var(--color-text-secondary)}
.hm .hm-area{position:relative;display:block;padding:var(--space-4) var(--space-3) var(--space-4) var(--space-4);border-bottom:1px solid var(--color-border);transition:background-color var(--t-fast) ease}
.hm .hm-area::before{content:"";position:absolute;left:0;top:var(--space-4);width:3px;height:27px;border-radius:2px;background:var(--a)}
.hm .hm-area:hover{background:var(--color-surface-soft)}
.hm .hm-area:hover .hm-am{color:var(--color-text-secondary)} /* muted text measures 4.39:1 on the soft hover surface */
.hm .hm-an{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);margin:0;font:400 22px/28px var(--serif);letter-spacing:-.005em}
.hm .hm-an a{color:var(--color-text);text-decoration:none}
.hm .hm-an a::after{content:"";position:absolute;inset:0}
.hm .hm-an::after{content:"";flex:none;width:16px;height:16px;background:var(--color-text-muted);-webkit-mask:var(--chev) center/16px no-repeat;mask:var(--chev) center/16px no-repeat;transition:transform var(--t-fast) ease,background-color var(--t-fast) ease}
.hm .hm-area:hover .hm-an::after{transform:translateX(3px);background:var(--a)}
.hm .hm-area:hover .hm-an a{text-decoration:underline;text-decoration-color:var(--a);text-decoration-thickness:2px;text-underline-offset:5px}
.hm .hm-an a:focus-visible{outline:none}
.hm .hm-area:has(a:focus-visible){outline:2px solid var(--color-focus);outline-offset:-2px}
.hm .hm-ab{margin:2px 0 0;font:400 14.5px/21px var(--sans);color:var(--color-text-secondary)}
.hm .hm-am{margin:2px 0 0;font:400 13px/19px var(--sans);color:var(--color-text-muted);font-variant-numeric:tabular-nums}
.hm-find{max-width:560px}
.hm-find .finder label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hm-find .finder input{width:100%;min-height:44px;padding:0 var(--space-4);border:1px solid var(--color-border-strong);border-radius:var(--r-md);background:var(--color-surface-raised);font:400 17px var(--serif);color:var(--color-text)}
.hm-find .finder input:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px;border-color:var(--color-focus)}
.hm-notes{display:grid;gap:var(--space-3);max-width:72ch;font:13.5px/20px var(--sans);color:var(--color-text-muted)}.hm-notes p{margin:0}
@media(max-width:767px){.hm{gap:var(--space-8)}.hm-title{font-size:28px;line-height:34px}.hm-title.long{font-size:24px;line-height:30px}}
@media(prefers-reduced-motion:reduce){.hm-an::after,.hm-go::after,.subnav a i,.hm-area{transition:none}.hm-area:hover .hm-an::after,.hm-go:hover::after{transform:none}}
@container home (min-width:560px) and (max-width:819px){
  .hm-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:var(--space-6)}
  .hm-links li{display:block;border-bottom:0}
  .hm-links a{display:flex;flex:none}
  .hm-links span{display:block;flex:none}
}
@container home (min-width:700px){
  .hm .hm-contents{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:var(--space-10)}
  .hm-notes{grid-template-columns:1fr 1fr;gap:var(--space-8);max-width:none}
}
@container home (min-width:820px){
  .hm-band{grid-template-columns:minmax(0,1fr) minmax(300px,344px);column-gap:var(--space-12)}
}

/* --- lessons: the same system. Subject rule (24x3 px, area colour) marks the title and the step; prose is Source Serif 4 at 18/30 --- */
.mhead h1{max-width:24ch;font:400 36px/42px var(--serif);letter-spacing:-.01em}
.mhead h1::before,.lstep>h2:not(.sr)::before,.lmain>.lcount::before{width:24px;height:3px;border-radius:2px;background:var(--accent)}
.lstep h2{font:400 28px/35px var(--serif);letter-spacing:-.005em}
.lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font:400 18px/30px var(--serif);max-width:66ch}
.lstep .lsec h3,.lstep .lsec h2{font:600 18px/25px var(--sans)}
.lstep .lsec b:not(.lead-in){background:linear-gradient(transparent 62%,var(--a-soft,var(--color-brand-soft)) 62%)}
.lcount,.lall>summary .lc{color:var(--accent)}
.exb h3{font:400 24px/30px var(--serif)}
.exb h3 .exn,.exans b,.exb .steps li::before{color:var(--accent)}
.exq .prompt{font:400 20px/29px var(--serif)}
.lstep .amap .a-main{border-color:var(--accent);background:var(--a-soft,var(--color-surface-soft))}
.lsteps a:hover{background:var(--color-surface-soft)}
.lsteps a{border-radius:var(--r-md)}
.lopt .ol,.opt .ol{font-family:var(--sans)}
.bar i.on,.lbar i.done{background:var(--accent)}
.bar i.cur,.lbar i.cur{background:color-mix(in srgb,var(--accent) 45%,transparent)}
@media(max-width:767px){
  .mhead h1{font-size:30px;line-height:36px}
  .lstep h2{font-size:25px;line-height:32px}
  .lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font-size:17px;line-height:29px}
}

/* --- audit follow-up (2026-11-19): 44 px targets for separate controls; links inside a sentence keep their inline size (WCAG 2.5.8 exception) --- */
.chip,.seg span{min-height:44px}
.seg span{display:inline-flex;align-items:center;justify-content:center}
.tgall .link,.crumbs a,#ot td a{display:inline-flex;align-items:center;min-height:44px}
/* forced colours (Windows High Contrast): selected state must not rely on a tint, and bar fills must survive the system palette */
@media(forced-colors:active){
  .opt.sel,.lopt.sel,.chip.on,.seg input:checked+span,.tabs>a.on,.subnav a.on,.snav a.on{outline:3px solid Highlight;outline-offset:-3px}
  .aprog i,.bar i{forced-color-adjust:none;background:Highlight}
}

/* --- critique follow-up (2026-11-19): topic state, answer reassurance, sticky Start --- */
.tst{display:inline-flex;align-items:center;gap:var(--space-2);font:600 13px/20px var(--sans);color:var(--color-text-secondary)}
.tst::before{content:"";flex:none;width:10px;height:10px;box-sizing:border-box;border-radius:50%;border:1.5px solid var(--accent,var(--color-text-muted))}
.tst.mid::before{background:linear-gradient(90deg,var(--accent,var(--color-text-muted)) 50%,transparent 50%)}
.tst.good::before{background:var(--accent,var(--color-text-muted))}
.tcard .tst{display:flex;margin:var(--space-1) 0}
.vd-s{display:block;margin-top:2px;font:400 14px/20px var(--sans);color:var(--color-text-secondary)}
.builder>.act{position:sticky;bottom:0;z-index:4;margin-top:var(--space-4);padding:var(--space-3) 0;background:var(--color-page);border-top:1px solid var(--color-border)}
@media(max-width:959px){.builder>.act{bottom:var(--tabh,65px)}}

/* --- explorers: the figure must fit beside its controls. At 1280 px the angle explorer's figure was 577 x 451 px, so the slider and the angles it moves could not be seen together --- */
.explorer svg{display:block;max-height:min(50vh,360px)}

/* --- design pass (2026-11-20): text actions align with the page edge; the "Revisit" link no longer outweighs the explanation --- */
.tl{padding-inline:0}
.rl a{font-weight:500}

/* --- Blueprint pass (2026-11-21): fact greeting, step trail, Progress, Notebook, lesson notes. Tokens only, no new colour values. --- */
.hm-intro h1{font:400 48px/56px var(--serif);letter-spacing:-.01em;max-width:28ch;text-wrap:balance}
.hm-intro h1.long{font-size:32px;line-height:40px;max-width:36ch}
@media(max-width:767px){.hm-intro h1{font-size:30px;line-height:36px}.hm-intro h1.long{font-size:26px;line-height:32px}}
/* step trail: shape carries the state (filled = finished, ring with a dot = here, empty = not finished, notched = a check was missed first time) */
.trail{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-3);margin:0;padding:0;list-style:none}
.trail li{position:relative;flex:none;box-sizing:border-box;width:12px;height:12px;border-radius:50%;border:1.5px solid var(--color-border-strong)}
.trail li.done{background:var(--accent);border-color:var(--accent)}
.trail li.cur{background:transparent;border-color:var(--accent)}
.trail li.cur::after{content:"";position:absolute;inset:2.25px;border-radius:50%;background:var(--accent)}
.trail li.miss{clip-path:polygon(0 0,36% 0,50% 36%,64% 0,100% 0,100% 100%,0 100%)}
.hm-trail{margin:var(--space-3) 0 0}
.lbar{height:auto;gap:0}
@media(forced-colors:active){.trail li{forced-color-adjust:none}.trail li.done,.trail li.cur::after{background:Highlight}.trail li.cur,.trail li.done{border-color:Highlight}}
/* progress */
.pg{display:grid;gap:var(--space-8)}
.pg h2{margin:0 0 var(--space-3);font:600 17px/24px var(--sans)}
.prow{padding:var(--space-3) 0;border-bottom:1px solid var(--color-border)}
.prn{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:var(--space-1) var(--space-4);margin:0 0 var(--space-2)}
.prn a{display:inline-flex;align-items:center;min-height:44px;font:600 17px/24px var(--sans);color:var(--a);text-decoration:none}
.pbar{display:flex;gap:2px;height:8px;overflow:hidden;border-radius:4px}
.pbar i{display:block;min-width:0;height:100%}
.pbar .d{background:var(--a)}.pbar .m{background:color-mix(in srgb,var(--a) 45%,transparent)}.pbar .o{background:var(--color-border)}
.ptab td a{display:inline-flex;align-items:center;min-height:44px}
.ptab .num{text-align:right;font-variant-numeric:tabular-nums}
@media(forced-colors:active){.pbar i{forced-color-adjust:none}.pbar .d{background:Highlight}.pbar .m,.pbar .o{background:GrayText}}
/* notes on lesson text (notes.js) and the notebook */
::highlight(notes){background-color:var(--area-ct-soft);color:inherit;text-decoration:underline;text-decoration-color:var(--area-ct);text-decoration-thickness:2px}
/* the selection toolbar: created by notes.js next to the selected text, nothing permanent in the lesson */
.lnpop{position:fixed;z-index:40;display:flex;flex-wrap:wrap;gap:var(--space-2);width:max-content;max-width:min(340px,calc(100vw - 16px));box-sizing:border-box;padding:var(--space-2);border:1px solid var(--color-border-strong);border-radius:var(--r-md);background:var(--color-surface-raised);box-shadow:var(--shadow-raised);transition:opacity .12s var(--ease-out)}
.lnpop:not([data-mode=add]){display:block;width:min(340px,calc(100vw - 16px))}
.lnpop .btn{min-height:44px;padding:0 var(--space-4)}
.lnpop .row{display:flex;flex-wrap:wrap;gap:var(--space-2);margin:0}
.lnpop .lnnote{margin:0 0 var(--space-2);padding:var(--space-1) var(--space-2);font:400 16px/24px var(--serif);overflow-wrap:anywhere}
.lnpop .lnform blockquote{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.lsec[tabindex="-1"]:focus{outline:0} /* focus is parked on the text block after a note closes, so Tab continues from there; it is not a control */
.lnform{display:grid;gap:var(--space-2);margin:0}
.lnform label{font:600 14px/20px var(--sans)}
.lnform textarea{width:100%;box-sizing:border-box;padding:var(--space-3);border:1px solid var(--color-border-strong);border-radius:var(--r-md);background:var(--color-surface-raised);color:var(--color-text);font:400 17px/26px var(--serif)}
.lnform textarea:focus-visible,.lnpop .btn:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}
.lnlist{margin:0;padding:0;list-style:none}
.lnlist li,.nbe{padding:var(--space-3) 0;border-bottom:1px solid var(--color-border)}
.lnlist blockquote,.nbq,.lnform blockquote{margin:0;padding:var(--space-2) var(--space-3);border:0;border-radius:var(--r-lg);background:color-mix(in srgb,var(--area-ct) 14%,transparent);font:400 17px/26px var(--serif)}
.lnlist p,.nbn{margin:var(--space-2) 0 0}
.lnlist .link,.nbe .link{min-height:44px;padding:0 var(--space-3) 0 0}
.nbl{display:grid;margin-top:var(--space-4)}
@media(prefers-reduced-motion:reduce){.lnpop{transition:none}}
.nbl,.pg,.lnform{grid-template-columns:minmax(0,1fr)}

/* --- Review repair 1 (2026-11-21): 44px targets, sentence-case group labels, shell mark and scope, tonal panels. Tokens only. --- */
.hm .hm-an a{display:flex;align-items:center;min-height:44px}
.hm-foot{display:flex;flex-wrap:wrap;gap:0 var(--space-6);margin:0}
.hm-foot a{display:inline-flex;align-items:center;min-height:44px}
.hm .hm-gl,.sgl{font-size:13px;line-height:20px;letter-spacing:0;text-transform:none}
.mark{display:inline-block;vertical-align:-3px;margin-right:var(--space-2);color:var(--color-brand)}
.tabs>a.sbrand .scope{display:block;margin-top:var(--space-1);font:400 13px/18px var(--sans);letter-spacing:0;color:var(--color-text-secondary)}
.hm-acts{align-items:center}
/* tonal panels: one step off the ground, a fill and no border (a border or a fill step, never both) */
.hm-band{padding:var(--space-5);border:0;border-radius:var(--r-lg);background:var(--color-surface)}
.hm .hm-contents{gap:var(--space-4)}
.hm .hm-group{align-content:start;padding:var(--space-5);border-radius:var(--r-lg);background:var(--color-surface)}
.tabs>a.sbrand .mark,.top .brand .mark{display:inline-block;stroke-width:2.2;color:var(--color-brand)}
/* review repair 2: the primary label always takes the on-brand ink in both themes (dark: #211712 on #C77A56, measured 5.3:1); disabled buttons keep their own colour */
.btn:not(.alt):not([disabled]):not([aria-disabled="true"]){color:var(--color-on-brand)!important}

/* --- Build pass (2026-11-21): one title scale, one motion pair, one press scale. Tokens only, no new colour values. --- */
:root{--t-state:200ms}
/* app title: 36px, as the brand scale records (the 48px greeting read as a landing-page headline) */
.hm-intro h1{font-size:36px;line-height:44px;max-width:30ch}
.hm-intro h1.long{font-size:28px;line-height:36px;max-width:38ch}
@media(max-width:767px){.hm-intro h1{font-size:30px;line-height:36px}.hm-intro h1.long{font-size:26px;line-height:32px}}
/* state changes (next question, next lesson step, a revealed worked step) share one duration and one ease-out; none performs on first load of a view */
.qq.enter,.opts.enter{animation-duration:var(--t-state)}
.vd,.lfb .vd,.lstep{animation-duration:var(--t-state)}
.steps li:not([hidden]){animation-duration:var(--t-state);animation-timing-function:var(--ease-out)}
/* press feedback: the same 0.98 scale on every pressable surface */
.btn:active:not([disabled]),.opt:active:not([disabled]),.lopt:active:not(:disabled){transform:scale(.98)}

/* --- Review repair 1 (2026-11-21): terracotta only on the primary action, selection and focus; balanced lead band; five phone tabs. Tokens only, no new colour values. --- */
/* ordinary text links take the ink colour (still underlined); --color-brand stays on the one primary button, the selected state and the focus ring */
:root{--color-link:var(--color-text);--color-link-hover:var(--color-text)}
/* selected nav row: soft fill and weight only (no bar, no tinted icon) */
@media(min-width:960px){.tabs>a.on::before{content:none}.tabs>a.on svg{color:inherit}}
/* lead band: at the two-column width the practise-and-review column takes the band's height and its rows share it on an even pitch, so both columns end level */
@container home (min-width:820px){
  .hm-band{align-items:stretch}
  .hm-device{display:flex;flex-direction:column}
  .hm-links{flex:1;display:grid;grid-auto-rows:minmax(44px,1fr)}
  .hm-links li{align-items:center}
}
/* phone: five tabs; Exams is on Home under Practise and review and Notebook beside Curriculum details */
@media(max-width:959px){.tabs>a[data-r="exams"],.tabs>a[data-r="notebook"]{display:none}}

/* mini test at the end of a lesson step (lesson.js): a heading, the questions, one verdict. Tokens only. */
.lmini{margin:var(--space-6) 0 var(--space-4)}
.lmini>h3{margin:0 0 var(--space-1);font:600 20px/28px var(--sans);color:var(--color-text)}
.lmini>.mute{margin:0 0 var(--space-3)}
.lmini .lchk{margin:var(--space-3) 0}
.lverdict:empty{display:none}
.lverdict{margin-top:var(--space-4)}
.lverdict .row{display:flex;margin:var(--space-3) 0 0}
.lverdict .btn{min-height:44px}
.lverdict .small{margin:var(--space-2) 0 0}

/* --- session 51: Practise as three ordered steps, MOCK card, numbered Learn sequence, grouped mistakes (tokens only; no new colours) --- */
.mockcard{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-4);padding:var(--space-5);border:1px solid var(--color-brand);border-radius:var(--r-lg);background:var(--color-brand-soft);margin:var(--space-6) 0}
.mockcard h2{margin:0 0 var(--space-1);font-size:22px;line-height:29px}.mockcard p{margin:0;max-width:56ch;color:var(--color-text-secondary)}.mockcard>div{flex:1 1 280px}
.mockcard.locked{border-color:var(--color-border-strong);background:var(--color-surface)}
.ph{margin-top:var(--space-8)}
.pb .pstep{border:0;border-top:1px solid var(--color-border);margin:0;padding:var(--space-5) 0}
.pb .pstep legend{font:600 18px/25px var(--sans);padding:0 var(--space-3) 0 0;display:flex;align-items:center;gap:var(--space-3);float:left;width:100%;margin-bottom:var(--space-3)}
.pb .pstep legend+*{clear:both}
.pn{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:var(--r-pill);background:var(--color-text);color:var(--color-page);font:600 14px/1 var(--sans)}
.pb .chip{display:inline-flex;gap:var(--space-1);align-items:center}.pb .pc{font-weight:400}
.tpanel .tgall{margin:var(--space-2) 0}
.lgroup{border-top:1px solid var(--color-border);padding:var(--space-2) 0}
.lgroup>summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--space-1) var(--space-4);min-height:44px;padding:var(--space-3) 0;cursor:pointer;list-style:none}
.lgroup>summary::-webkit-details-marker{display:none}
.lgroup>summary::before{content:"";width:10px;height:10px;border-radius:var(--r-pill);background:var(--a,var(--color-brand));align-self:center}
.lgn{font:400 24px/30px var(--serif)}
.lgroup>.hm-ab{margin:0 0 var(--space-3)}
ol.seq{list-style:none;margin:0;padding:0;counter-reset:seq}
ol.seq>li{counter-increment:seq;position:relative;padding-left:var(--space-8)}
ol.seq>li::before{content:counter(seq);position:absolute;left:0;top:var(--space-4);width:24px;font:600 14px/20px var(--sans);color:var(--color-text-secondary);text-align:right}
.mtopic{margin:var(--space-3) 0 var(--space-5)}
.mth{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-2) var(--space-4)}
.mth h3{margin:0;font:600 18px/25px var(--sans)}.mta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-4)}
.mta .btn{min-height:40px;padding:0 var(--space-4)}
.hm-wait{margin-top:var(--space-8)}

/* ===== Distill (session 33): one Next per viewport; worked solution and other options share one fold; Practise builder folds away. */
.fold .oh{margin:var(--space-5) 0 var(--space-2);font:600 15px/20px var(--sans);color:var(--color-text-secondary)}
.pdet>summary>h2{margin:0}
@media(max-width:999px){
  .qgrid>.again{position:sticky;bottom:0;z-index:4;margin:var(--space-6) 0 0;padding:var(--space-3) 0 max(var(--space-3),env(safe-area-inset-bottom));background:var(--color-page);border-top:1px solid var(--color-border)}
}
@media(max-width:600px){.qgrid>.again .btn{width:100%}}
@media(min-width:1000px){.qgrid>.again{margin-top:var(--space-5)}}

/* ===== Clarify (session 33): key to the status words. */
.labels dl{margin:0 0 var(--space-3);max-width:68ch}
.labels dt{margin:var(--space-3) 0 0;font-weight:600;color:var(--color-text)}
.labels dd{margin:0;color:var(--color-text-secondary)}

/* ===== Layout (session 33): Exams = three cards, closed ones muted. */
.exam.closed h2{display:flex;align-items:center;gap:var(--space-2);color:var(--color-text-secondary)}
.exam.closed h2 .ic{flex:none}

/* ===== Polish (session 33): no widow words, no repeated page name above the tab bar. */
h1,h2,h3,.lead{text-wrap:balance}
p,li,dd,summary,.small{text-wrap:pretty}
@media(max-width:959px){.topnote{display:none}}
.vd[tabindex="-1"]:focus{outline:none}

/* ===== Practise (session 33b): ways in, mock panel, area tiles, big question counts. Tokens only. */
.pways{display:grid;gap:var(--space-4);margin:var(--space-6) 0 var(--space-8)}
.pway{display:block;padding:var(--space-4) 0 var(--space-4);border-top:1px solid var(--color-border-strong);color:var(--color-text);text-decoration:none;transition:border-color .2s var(--ease-out)}
.pway .pw-t{display:flex;align-items:baseline;gap:var(--space-2);font:500 26px/32px var(--serif);letter-spacing:-.01em}
.pway .pw-t::after{content:"\2192";margin-left:auto;font:400 22px/1 var(--sans);color:var(--color-brand);transition:transform .25s var(--ease-out)}
.pway:hover{border-top-color:var(--color-brand)}.pway:hover .pw-t::after{transform:translateX(6px)}
.pway .pw-s{display:block;margin-top:var(--space-1);font:400 15px/22px var(--sans);color:var(--color-text-secondary);max-width:42ch}
.pw-n{display:inline-grid;place-items:center;min-width:28px;height:28px;padding:0 8px;border-radius:var(--r-pill);background:var(--color-brand);color:var(--color-on-brand);font:600 15px/1 var(--sans)}
.pway.off .pw-t{color:var(--color-text-secondary)}
.pmock{display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-6);border-radius:var(--r-lg);background:var(--color-brand-soft);border:1px solid var(--color-brand);color:var(--color-text);text-decoration:none}
.pmock .pm-k{font:600 14px/20px var(--sans);color:var(--color-text-secondary)}
.pmock .pm-t{font:400 32px/38px var(--serif);letter-spacing:-.015em;text-wrap:balance}
.pmock .pm-s{font:400 15px/22px var(--sans);color:var(--color-text-secondary);max-width:44ch}
.pmock .pm-b{align-self:flex-start;margin-top:var(--space-4)}
a.pmock:hover .pm-b{filter:brightness(1.06)}
.pmock.locked{background:var(--color-surface);border-color:var(--color-border-strong)}
.pmock.locked .pm-t{color:var(--color-text-secondary)}
@media(min-width:760px){
  .pways{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);grid-template-rows:auto auto;column-gap:var(--space-8)}
  .pways .pmock{grid-column:2;grid-row:1/3}
  .pways .pway{grid-column:1}
}
.atiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-3);margin:0 0 var(--space-4)}
@media(min-width:760px){.atiles{grid-template-columns:repeat(4,minmax(0,1fr))}}
.atile{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:96px;padding:var(--space-3) var(--space-4);border:1px solid var(--a-line,var(--color-border));border-radius:var(--r-md);background:var(--color-surface);color:var(--color-text);text-align:left;font:inherit;cursor:pointer;position:relative;transition:background-color .2s var(--ease-out),box-shadow .2s var(--ease-out),transform .12s var(--ease-out)}
.atile::before{content:"";width:22px;height:4px;border-radius:2px;background:var(--a,var(--color-brand));margin-bottom:var(--space-2)}
.atile:active{transform:scale(.98)}
.atile .at-n{font:500 18px/23px var(--serif)}
.atile .at-m{font:400 14px/20px var(--sans);color:var(--color-text-secondary)}
.atile .at-c{margin-top:auto;font:600 14px/20px var(--sans);color:var(--a,var(--color-brand))}
.atile.on{background:var(--a-soft,var(--color-brand-soft));box-shadow:inset 0 0 0 2px var(--a,var(--color-brand));border-color:transparent}
.tpanel{padding:var(--space-2) var(--space-4) var(--space-3);border-radius:var(--r-md);background:var(--a-soft,var(--color-surface))}
.nq{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:var(--space-2);margin:0 0 var(--space-5)}
.nq label{display:block;cursor:pointer}
.nq input{position:absolute;opacity:0;width:1px;height:1px}
.nq span{display:grid;place-items:center;min-height:64px;border:1px solid var(--color-border-strong);border-radius:var(--r-md);background:var(--color-surface);font:400 30px/1 var(--serif);font-variant-numeric:lining-nums;transition:background-color .2s var(--ease-out),color .2s var(--ease-out),transform .12s var(--ease-out)}
.nq label:active span{transform:scale(.97)}
.nq input:checked+span{background:var(--color-brand);border-color:var(--color-brand);color:var(--color-on-brand)}
.nq input:focus-visible+span{outline:3px solid var(--color-focus,var(--color-brand));outline-offset:3px}
.pb .pstep legend{font:500 22px/28px var(--serif);letter-spacing:-.01em}
@media(prefers-reduced-motion:reduce){.pway .pw-t::after,.atile,.nq span{transition:none}.atile:active,.nq label:active span{transform:none}}
.tpanel{background:none;border:1px solid var(--a-line,var(--color-border));padding:var(--space-2) var(--space-4) var(--space-3)}
@media(min-width:760px){.tpanel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:var(--space-6)}.tpanel[hidden]{display:none}.tpanel .tgall{grid-column:1/-1}}

/* ===== Home dashboard (session 33c). Owner reference: cream three-zone dashboard, ink pill buttons, peach and teal art cards, outlined side cards.
   New tokens live here with the other colours: --ink-* (primary button), --art-* (gradient pairs for the art cards). Scoped to Home for now. */
:root{--ink-bg:#211E1A;--ink-text:#FAF6EE;--ink-hover:#3A352E;--panel:#FDFCF9;--panel-line:#E3DED5;
  --art-peach-a:#F8DCCB;--art-peach-b:#EDA98B;--art-teal-a:#D4E4E0;--art-teal-b:#8DB5B0;--art-sand-a:#F4E6CF;--art-sand-b:#DDB98A;--art-ink:#3B2A22}
:where([data-theme="dark"]):root{--ink-bg:#F0EADF;--ink-text:#211712;--ink-hover:#FFFFFF;--panel:#262524;--panel-line:#3A3835;
  --art-peach-a:#6B3F2E;--art-peach-b:#3F2A22;--art-teal-a:#2F4C48;--art-teal-b:#1E322F;--art-sand-a:#5C4A2C;--art-sand-b:#392F1F;--art-ink:#F3E2D6}
.ink{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);min-height:48px;padding:0 var(--space-6);border-radius:var(--r-pill);background:var(--ink-bg);color:var(--ink-text);font:600 16px/1 var(--sans);text-decoration:none;border:0;cursor:pointer;transition:background-color .2s var(--ease-out),transform .12s var(--ease-out)}
.ink:hover{background:var(--ink-hover)}.ink:active{transform:scale(.97)}.ink.sm{min-height:44px;padding:0 var(--space-5);font-size:15px}
main:has(.hd){max-width:1240px}
.hd-head h1{margin:0 0 var(--space-1);font:400 34px/40px var(--serif);letter-spacing:-.015em;max-width:30ch;text-wrap:balance}.hd-head h1.long{font-size:26px;line-height:32px}
.hd-head{margin:var(--space-2) 0 var(--space-6)}
.hd-grid{display:grid;gap:var(--space-6);align-items:start}
@media(min-width:1000px){.hd-grid{grid-template-columns:minmax(0,1.55fr) minmax(0,1fr)}}
.hd-main{padding:var(--space-6);border-radius:24px;background:var(--panel);border:1px solid var(--panel-line)}
.hd-top{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin:0 0 var(--space-4)}
.hd-h{margin:0;font:600 15px/22px var(--sans);color:var(--color-text-secondary)}
.hd-all{font:500 14px/20px var(--sans);color:var(--color-text-secondary);text-decoration:underline;text-underline-offset:4px;display:inline-flex;align-items:center;min-height:44px}
/* the existing lead panel, restyled inside the dashboard */
.hd-main .hm-lead{padding:0 0 var(--space-6);border:0;background:none}
.hd-main .hm-eb{display:none}
.hd-main .hm-title{font:400 32px/38px var(--serif);max-width:20ch}.hd-main .hm-title.long{font-size:26px;line-height:32px}
.hd-main .hm-stand{font:400 17px/26px var(--serif)}
.hd-main .hm-acts .btn{min-height:48px;padding:0 var(--space-6);border-radius:var(--r-pill);background:var(--ink-bg);color:var(--ink-text);border:0;font-weight:600}
.hd-main .hm-acts .btn:hover{background:var(--ink-hover)}
.hd-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-4)}
.art{position:relative;display:flex;flex-direction:column;justify-content:flex-end;gap:2px;min-height:190px;padding:var(--space-5);border-radius:var(--r-lg);overflow:hidden;color:var(--art-ink);text-decoration:none;isolation:isolate;transition:transform .3s var(--ease-out),box-shadow .3s var(--ease-out)}
.art:hover{transform:translateY(-3px);box-shadow:0 14px 28px -16px rgba(33,24,18,.45)}
.art.wide{grid-column:1/-1;min-height:170px}.art.tall{min-height:230px}
.art.peach{background:linear-gradient(140deg,var(--art-peach-a),var(--art-peach-b))}
.art.teal{background:linear-gradient(140deg,var(--art-teal-a),var(--art-teal-b))}
.art.sand{background:linear-gradient(140deg,var(--art-sand-a),var(--art-sand-b))}
.art-fan{position:absolute;right:0;bottom:0;width:78%;height:100%;z-index:-1;color:#fff;transition:transform .6s var(--ease-out)}
.art:hover .art-fan{transform:scale(1.06) rotate(-2deg)}
.art .art-t{font:400 26px/32px var(--serif);letter-spacing:-.01em}
.art .art-s{font:400 14.5px/21px var(--sans);max-width:24ch}
.art .art-b,.art .art-k{align-self:flex-start;margin-top:var(--space-3);padding:6px 14px;border:1px solid currentColor;border-radius:var(--r-pill);font:600 13px/20px var(--sans)}
.hd-side{display:grid;gap:var(--space-6)}
.hd-pin{display:block;margin:0 0 var(--space-3);padding:var(--space-4);border:1px solid var(--panel-line);border-radius:var(--r-md);background:var(--panel);color:var(--color-text);text-decoration:none;transition:border-color .2s var(--ease-out),transform .2s var(--ease-out)}
.hd-pin:hover{border-color:var(--color-text-muted);transform:translateY(-2px)}
.hd-pin b{display:block;margin:2px 0 var(--space-2);font:500 18px/24px var(--serif)}
.hd-pa{font:400 13px/18px var(--sans);color:var(--color-text-secondary)}
.hd-ps{display:inline-flex;align-items:center;gap:6px;font:500 13px/18px var(--sans);color:var(--color-error)}
.hd-empty{margin:0;padding:var(--space-4);border:1px dashed var(--panel-line);border-radius:var(--r-md);font:400 15px/22px var(--sans);color:var(--color-text-secondary)}
.hd-learn{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-3)}
.hd-lt{display:grid;grid-template-columns:auto 1fr;column-gap:var(--space-3);align-items:center;padding:var(--space-3);border-radius:var(--r-md);background:var(--panel);border:1px solid var(--panel-line);color:var(--color-text);text-decoration:none;transition:border-color .2s var(--ease-out)}
.hd-lt:hover{border-color:var(--a,var(--color-text-muted))}
.hd-ic{grid-row:1/3;display:grid;place-items:center;width:44px;height:44px;border-radius:var(--r-md);background:var(--a-soft);color:var(--a)}
.hd-ln{font:600 15px/20px var(--sans)}.hd-lm{font:400 12.5px/17px var(--sans);color:var(--color-text-secondary)}
.hd-bar{grid-column:1/-1;display:block;height:4px;margin-top:var(--space-3);border-radius:2px;background:var(--a-soft);overflow:hidden}.hd-bar i{display:block;height:100%;background:var(--a)}
@media(max-width:600px){.hd-main{padding:var(--space-4);border-radius:var(--r-lg)}.hd-head h1{font-size:28px;line-height:34px}.hd-main .hm-title{font-size:27px;line-height:33px}.hd-learn{grid-template-columns:1fr}.art.tall{min-height:200px}}
@media(prefers-reduced-motion:reduce){.art,.art-fan,.hd-pin,.ink{transition:none}.art:hover,.art:hover .art-fan,.hd-pin:hover{transform:none}}
@media(min-width:1000px){.hd-grid{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}}
.hd-learn{grid-template-columns:1fr}
@media(min-width:1500px){.hd-learn{grid-template-columns:repeat(2,minmax(0,1fr))}}
:where([data-theme="dark"]):root .art-fan{opacity:.38;color:var(--art-ink)}
.art.tall .art-fan{width:70%}
/* Bug fix: the global a:hover link colour made ink pills and art cards unreadable on hover (text took the pill's own colour). */
a.ink,a.ink:hover,a.ink:focus-visible{color:var(--ink-text)}
a.art,a.art:hover,a.art:focus-visible{color:var(--art-ink)}
a.hd-pin,a.hd-pin:hover,a.hd-lt,a.hd-lt:hover,a.pway,a.pway:hover,a.pmock,a.pmock:hover{color:var(--color-text)}
/* Home "Your next step" pill: hover turns into an outlined pill (accepted from a live variant session). */
.hd-top a.ink{box-shadow:inset 0 0 0 2px transparent;transition:background-color .2s var(--ease-out),color .2s var(--ease-out),box-shadow .2s var(--ease-out),transform .12s var(--ease-out)}
.hd-top a.ink:hover{background:transparent;color:var(--ink-bg);box-shadow:inset 0 0 0 2px var(--ink-bg)}
main:has(.hd){max-width:1360px}

/* ===== Theme control (session 54): a two-state Light / Dark switch. Tokens only. Phone: icons in the header; desktop: icon and word in the sidebar; while a focused screen hides both, a small floating one. ===== */
.theme{display:inline-flex;gap:2px;padding:2px;border:1px solid var(--color-border);border-radius:var(--r-md);background:var(--color-surface)}
.theme button{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);min-width:44px;min-height:40px;padding:0 var(--space-3);border:0;border-radius:var(--r-sm);background:none;color:var(--color-text-secondary);font:500 14px/1 var(--sans);cursor:pointer;transition:background-color var(--t-fast) ease,color var(--t-fast) ease}
.theme button:hover{background:var(--color-surface-soft);color:var(--color-text)}
.theme button[aria-pressed="true"]{background:var(--color-surface-soft);color:var(--color-text);font-weight:600;box-shadow:inset 0 0 0 1px var(--color-border-strong)}
.theme button[aria-pressed="true"] svg{color:var(--color-brand)}
.theme--top span,.theme--float span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.theme--page,.theme--float{display:none}
@media(min-width:960px){
  .theme--top{display:none}
}
body.focus .theme--top,body.focus .theme--page{display:none}
body.focus .theme--float{display:inline-flex;position:fixed;top:var(--space-2);right:var(--space-2);z-index:30;box-shadow:var(--shadow-raised)}
@media(forced-colors:active){.theme button[aria-pressed="true"]{outline:2px solid Highlight;outline-offset:-2px}}

/* theme switch is instant: no colour transition runs while the attribute changes (the class is set for 80 ms by theme-init.js) */
.theme-switching *,.theme-switching *::before,.theme-switching *::after{transition:none!important;animation-duration:0s!important}

/* ===== Open entries (session 54): lesson entries on a topic page and plain content blocks sit on the page with a hairline above, not in a framed card ===== */
.feature{background:none;border:0;border-top:1px solid var(--color-border);border-radius:0;padding:var(--space-5) 0}
.feature:hover{background:none;border-color:var(--color-border-strong)}
.feature:hover::after{text-decoration-color:currentColor}
.feature:last-of-type{border-bottom:1px solid var(--color-border)}

/* ===== Type, session 54: Newsreader reads (headings, lessons, questions), Inter operates (interface), IBM Plex Mono marks numbers (timers, question counts).
   Self-hosted variable/static Latin subsets, SIL Open Font Licence 1.1 (public/fonts/LICENSE-*.txt, README.txt). Source Serif 4 / Source Sans 3 stay in the stacks as fallbacks, so glyphs outside the subset still render. ===== */
@font-face{font-family:"Newsreader";font-style:normal;font-weight:200 800;font-display:swap;src:url(fonts/newsreader-latin-opsz-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Newsreader";font-style:italic;font-weight:200 800;font-display:swap;src:url(fonts/newsreader-latin-opsz-italic.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/inter-latin-wght-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:600;font-display:swap;src:url(fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{
  --serif:"Newsreader","Source Serif 4",Georgia,"Times New Roman",serif;
  --sans:"Inter","Source Sans 3",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,"SFMono-Regular",Consolas,monospace;
}
/* numbers that are measurements, not prose: timers, question counts, step counts */
.qclock,.qcount,.rqn,.lcount,.hd-lm{font-family:var(--mono);font-variant-numeric:tabular-nums;letter-spacing:0}
.qclock{font-weight:500;font-size:14px}.qcount{font-weight:500;font-size:14px}.lcount{font-weight:500;font-size:13px}
/* Newsreader has a smaller x-height than Source Serif 4: reading sizes go up one step (lessons 19/31, questions 21/30; phone 18/30 and 20/29) */
.lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font-size:19px;line-height:31px}
.qq .prompt,.qq>p,.lq .prompt,.exq .prompt{font-size:21px;line-height:30px}
@media(max-width:767px){.lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font-size:18px;line-height:30px}.qq .prompt,.qq>p,.lq .prompt,.exq .prompt{font-size:20px;line-height:29px}}
/* focused screens (practice, exam): the floating theme control sits in the header's right corner, so the header reserves its width on a phone and the question count and timer stay visible */
@media(max-width:759px){body.focus .qhead{padding-right:calc(2 * 44px + 2 * var(--space-2))}body.focus .qtopic{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(max-width:480px){body.focus .qhead{gap:var(--space-2);padding-right:92px}body.focus .qtopic{display:none}body.focus .qcount{min-width:0}body.focus .qhead .qclock{margin-left:auto}}
/* Progress: the suggested next lesson and the first section no longer touch */
.hm-acts+.pg{margin-top:var(--space-8)}

/* ===== Typeset (session 54b): Home panel text was Newsreader 400 in grey, which read thin. Sturdier weights and the primary ink colour; sizes up one step. ===== */
.hd-head h1,.hm-intro h1{font-weight:500}
.hm-title{font-weight:500;letter-spacing:-.012em}
.hm-stand{font-weight:450;font-size:19px;line-height:29px;color:var(--color-text);max-width:48ch}
.hm-meta{font-weight:500;font-size:15px;line-height:22px}
.hm-ar{font-weight:600}
.hd-main .hm-title{font-weight:500}
.hd-main .hm-stand{font-weight:450;font-size:19px;line-height:29px}
.hd-main .hm-meta{font-weight:500}
@media(max-width:600px){.hd-main .hm-stand{font-size:18px;line-height:28px}}

/* ===== Bitter (session 54c, owner's request): a sturdy open slab serif for the Home panel's title and description only. SIL OFL, self-hosted (public/fonts/LICENSE-bitter.txt). ===== */
@font-face{font-family:"Bitter";font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/bitter-latin-wght-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{--slab:"Bitter","Newsreader",Georgia,serif}
.hd-main .hm-title{font-family:var(--slab);font-weight:600;letter-spacing:-.01em}
.hd-main .hm-stand{font-family:var(--slab);font-weight:400;font-size:17px;line-height:27px}
@media(max-width:600px){.hd-main .hm-stand{font-size:16px;line-height:26px}}

/* ===== Bitter in lessons (session 54d, owner's request): lesson title, step titles and lesson prose. Questions, Home greeting and the rest stay Newsreader. Bitter's x-height is large, so the reading size steps back down (17/28, phone 16/27). ===== */
.mhead h1,.lstep h2{font-family:var(--slab);font-weight:600;letter-spacing:-.012em}
.lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font-family:var(--slab);font-weight:400;font-size:17px;line-height:28px}
@media(max-width:767px){.lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font-size:16px;line-height:27px}}

/* ===== Theme control, softer (session 54e, owner's request): a pill track with a soft inner pill for the chosen state, no hard outline, a gentle ease. ===== */
.theme{gap:2px;padding:3px;border:0;border-radius:var(--r-pill);background:var(--color-surface-soft);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--color-border) 70%,transparent)}
.theme button{border-radius:var(--r-pill);min-height:38px;padding:0 var(--space-4);transition:background-color .28s cubic-bezier(.22,1,.36,1),color .28s cubic-bezier(.22,1,.36,1),box-shadow .28s cubic-bezier(.22,1,.36,1)}
.theme--top button,.theme--float button{padding:0;min-width:44px}
.theme button:hover{background:color-mix(in srgb,var(--color-surface-raised) 55%,transparent)}
.theme button[aria-pressed="true"]{background:var(--color-surface-raised);color:var(--color-text);font-weight:500;box-shadow:0 1px 3px color-mix(in srgb,var(--color-text) 14%,transparent)}
.theme button[aria-pressed="true"] svg{color:var(--color-brand)}
.theme button:focus-visible{outline-offset:1px;border-radius:var(--r-pill)}
@media(prefers-reduced-motion:reduce){.theme button{transition:none}}

/* ===== Softer highlights (session 54f, owner's request): key terms and saved notes are marked with a gentle full-height wash of the area colour (not a bar under the lower half of the word), rounded and cloned across line breaks. ===== */
.lstep .lsec b:not(.lead-in){background:color-mix(in srgb,var(--a,var(--color-brand)) 13%,transparent);border-radius:var(--r-sm);padding:.04em .22em;margin:0 -.04em;-webkit-box-decoration-break:clone;box-decoration-break:clone;font-weight:600}
::highlight(notes){background-color:color-mix(in srgb,var(--area-ct) 22%,transparent);color:inherit;text-decoration:none}

/* ===== Home footer (session 54g, owner's request): the long notes block became a quiet row of links and one honesty line; the area note and the key to the labels now live on the Curriculum details page. ===== */
.hm-notes{gap:var(--space-4);max-width:none;padding-top:var(--space-6);border-top:1px solid var(--color-border)}
.hm-notes .hm-foot{gap:var(--space-1) var(--space-6)}
.hm-notes .hm-foot a{font:500 15px/20px var(--sans);color:var(--color-text);text-decoration:none;border-bottom:1px solid var(--color-border-strong);padding:0}
.hm-notes .hm-foot a:hover{border-bottom-color:var(--color-brand)}
.hm-fine{max-width:62ch;font:400 13px/19px var(--sans);color:var(--color-text-muted)}
.hm-fine a{color:var(--color-text-secondary)}

/* ===== Session 54h (owner's feedback) ===== */
/* the Light/Dark control is no longer pinned in the sidebar: on desktop it sits at the top right of the page and scrolls away with it (on a phone it is in the header, as before) */
@media(min-width:960px){.theme--page{display:inline-flex;position:absolute;top:var(--space-5);right:var(--space-8);z-index:5}.theme--page button{padding:0;min-width:44px}.theme--page span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}}
/* Dark: the primary pills were cream-white and read bulky; they take the terracotta the other Dark primary buttons use, and are a little slimmer */
:where([data-theme="dark"]):root{--ink-bg:var(--color-brand);--ink-text:var(--color-on-brand);--ink-hover:var(--color-brand-hover)}
.ink{min-height:44px;padding:0 var(--space-5);font-weight:600}
/* numbers: sturdier weights (Plex Mono 400 and Newsreader 400 numerals read fragile) */
.hd-lm,.hm-am,.hm-facts dd,.lc,.rqn{font-weight:500}
.hd-lm{font-size:13.5px}
.lk{font-family:var(--mono);font-weight:600;font-size:15px}
.nq span{font-weight:600}
.qcount,.qclock{font-weight:600}
.lcount{font-weight:600}

/* ===== FoldText (session 54j, owner's order): CSS of the React Bits component, adapted to the app (inline in a heading, inherits the heading's type, tokens only). ===== */
/* the effect is applied to the heading itself, so the root keeps the heading's own display and type (resetting them shrank topic titles to body size) */
.fold-text{white-space:pre-wrap}
.fold-text-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;user-select:none}
.fold-text-visual{display:inline}
.fold-text-word{display:inline-block;white-space:nowrap}
.fold-text-segment{display:inline-block;perspective:var(--fold-perspective,700px);vertical-align:baseline}
.fold-text-segment[data-fold-split='line']{display:block}
.fold-text-piece{--fold-shade:linear-gradient(180deg,rgba(0,0,0,.58) 0%,rgba(0,0,0,.22) 42%,rgba(255,255,255,.26) 100%);position:relative;display:inline-block;backface-visibility:hidden;transform-origin:50% 0%}
.fold-text-piece[data-fold-hinge='bottom']{--fold-shade:linear-gradient(0deg,rgba(0,0,0,.58) 0%,rgba(0,0,0,.22) 42%,rgba(255,255,255,.26) 100%);transform-origin:50% 100%}
.fold-text-piece[data-fold-hinge='left']{--fold-shade:linear-gradient(90deg,rgba(0,0,0,.58) 0%,rgba(0,0,0,.22) 42%,rgba(255,255,255,.26) 100%);transform-origin:0% 50%}
.fold-text-piece[data-fold-hinge='right']{--fold-shade:linear-gradient(270deg,rgba(0,0,0,.58) 0%,rgba(0,0,0,.22) 42%,rgba(255,255,255,.26) 100%);transform-origin:100% 50%}
.fold-text-piece[data-fold-style='blinds']{perspective:var(--fold-perspective,700px)}
.fold-text-slat{position:relative;display:inline-block;backface-visibility:hidden}
.fold-text-slat[data-fold-slat='b']{position:absolute;inset:0;visibility:hidden}
.fold-text-piece::after,.fold-text-slat::after{content:attr(data-fold-text);position:absolute;inset:0;pointer-events:none;color:transparent;-webkit-text-fill-color:transparent;background-image:var(--fold-shade);-webkit-background-clip:text;background-clip:text;opacity:var(--fold-crease,0)}
@media(prefers-reduced-motion:reduce){.fold-text-piece,.fold-text-slat{transform:none!important}.fold-text-piece::after,.fold-text-slat::after{opacity:0!important}}

/* Home panel buttons (session 54p, owner's request): "Continue the lesson" behaves like "Quick quiz": on hover the fill goes and a 2 px outline in the button colour takes over. */
.hd-main .hm-acts .btn,.hd-main .hm-acts a.ink{box-shadow:inset 0 0 0 2px transparent;transition:background-color .2s var(--ease-out),color .2s var(--ease-out),box-shadow .2s var(--ease-out),transform .12s var(--ease-out)}
.hd-main .hm-acts .btn:hover:not(.alt):not([disabled]),.hd-main .hm-acts a.ink:hover{background:transparent;border-color:transparent;color:var(--ink-bg)!important;box-shadow:inset 0 0 0 2px var(--ink-bg)}
@media(prefers-reduced-motion:reduce){.hd-main .hm-acts .btn,.hd-main .hm-acts a.ink{transition:none}}

/* ===== Theme switch animation (session 54q, owner's request): the new theme grows out of the Light/Dark control as a circle (View Transitions API; theme.js drives the clip-path). Instant where the API is missing or motion is reduced. ===== */
html.vt-theme::view-transition-old(root),html.vt-theme::view-transition-new(root){animation:none;mix-blend-mode:normal}
html.vt-theme::view-transition-old(root){z-index:1}
html.vt-theme::view-transition-new(root){z-index:2147483646}

/* ===== Softer corners (session 54r, owner: the Next step banner looked sharp-cut and awkward) ===== */
/* the banner is a rounded, softly tinted panel (no full-width hairlines); its button is a pill like the Home buttons */
.nextstep{padding:var(--space-4) var(--space-5);border:0;border-radius:20px;background:color-mix(in srgb,var(--accent) 9%,var(--color-surface))}
.nextstep .btn{min-height:44px;padding:0 var(--space-6)}
/* every filled or outlined .btn is a pill; notes and mock panels get the same soft corner */
.btn{border-radius:var(--r-pill)}
.note,.mockcard,.pmock{border-radius:20px}

/* ===== Lesson entries on a topic page (session 54s, owner: "awkward and clumsy, declutter, more visual and intuitive") =====
   One rounded, quiet card per lesson: code and state on top, the title, three short facts, a segmented step bar and one action. Tokens only. */
.feature.lc{display:grid;gap:var(--space-3);margin:var(--space-4) 0;padding:var(--space-5) var(--space-6);border:0;border-radius:20px;background:var(--color-surface);color:var(--color-text);text-decoration:none;transition:background-color .2s var(--ease-out),box-shadow .2s var(--ease-out),transform .14s var(--ease-out)}
.feature.lc::after{content:none}
.feature.lc:last-of-type{border-bottom:0}
.feature.lc:hover{background:var(--color-surface-raised);box-shadow:var(--shadow-raised)}
.feature.lc:active{transform:scale(.99)}
.lc-top{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);font:500 13px/18px var(--sans);color:var(--color-text-secondary)}
.lc-code{font-family:var(--mono);font-weight:500;letter-spacing:0;color:var(--color-text-muted)}
.lc-state{color:var(--accent,var(--color-text-secondary));font-weight:600}
.feature.lc .lc-title{display:block;margin:0;font:500 24px/30px var(--serif);letter-spacing:-.01em;text-wrap:balance}
.lc-meta{display:flex;flex-wrap:wrap;gap:var(--space-1) var(--space-4);font:400 14px/20px var(--sans);color:var(--color-text-secondary)}
.lc-meta span{display:inline;opacity:1;color:inherit;font-size:inherit}
.lc-foot{display:flex;align-items:center;gap:var(--space-5);margin-top:var(--space-1)}
.lc-bar{display:flex;flex:1;gap:4px;min-width:0}
.lc-bar i{display:block;flex:1;height:6px;border-radius:var(--r-pill);background:var(--color-border)}
.lc-bar i.on{background:var(--accent,var(--color-brand))}
.lc-go{display:inline-flex;align-items:center;gap:var(--space-2);flex:none;min-height:44px;padding:0 var(--space-5);border-radius:var(--r-pill);background:var(--ink-bg);color:var(--ink-text);font:600 15px/1 var(--sans);transition:background-color .2s var(--ease-out),color .2s var(--ease-out),box-shadow .2s var(--ease-out)}
.feature.lc:hover .lc-go{background:transparent;color:var(--ink-bg);box-shadow:inset 0 0 0 2px var(--ink-bg)}
.lc-go svg{transition:transform .2s var(--ease-out)}.feature.lc:hover .lc-go svg{transform:translateX(3px)}
.feature.lc:focus-visible{outline:2px solid var(--color-focus);outline-offset:3px}
@media(max-width:600px){.feature.lc{padding:var(--space-4) var(--space-5)}.feature.lc .lc-title{font-size:21px;line-height:27px}.lc-foot{gap:var(--space-3)}.lc-go{padding:0 var(--space-4)}}
@media(prefers-reduced-motion:reduce){.feature.lc,.lc-go,.lc-go svg{transition:none}.feature.lc:hover .lc-go svg{transform:none}}
/* older `.feature span{display:block}` and `.feature b` rules would stack the pieces: restate each piece's layout with the entry's own class */
.feature.lc .lc-top{display:flex}
.feature.lc .lc-meta{display:flex}
.feature.lc .lc-meta span{display:inline}
.feature.lc .lc-foot{display:flex}
.feature.lc .lc-bar{display:flex}
.feature.lc .lc-go{display:inline-flex}
.feature.lc .lc-state,.feature.lc .lc-code{display:inline;margin:0}
.feature.lc .lc-meta{gap:var(--space-1) var(--space-4)}
.feature.lc .lc-go{color:var(--ink-text);background:var(--ink-bg)}
.feature.lc:hover .lc-go{background:transparent;color:var(--ink-bg)}
.feature.lc .lc-state{color:var(--accent,var(--color-text-secondary))}
.feature.lc .lc-code{color:var(--color-text-muted)}
.feature.lc .lc-meta,.feature.lc .lc-meta span{color:var(--color-text-secondary)}
/* lesson facts: icon and number (session 54t, owner: "add a bit of icons and declutter these three things") */
.feature.lc .lc-meta{gap:var(--space-1) var(--space-5)}
.feature.lc .lc-meta>span{display:inline-flex;align-items:center;gap:6px;font-variant-numeric:tabular-nums}
.feature.lc .lc-meta svg{flex:none;opacity:.75}
.feature.lc .lc-meta .sr{position:absolute}

/* ===== Lesson fact tooltips (session 54u, owner: describe what the icons mean when the cursor rests on them) =====
   A small rounded card above the fact, after a short pause on hover and at once on keyboard focus or a tap. Same surface, radius and type as the rest of the app. */
.feature.lc .lc-meta>.lc-fact{position:relative;cursor:help;border-radius:var(--r-sm);outline-offset:4px}
.lc-tip{position:absolute;left:0;bottom:calc(100% + 10px);z-index:20;display:block;width:max-content;max-width:min(240px,70vw);padding:var(--space-3) var(--space-4);border-radius:var(--r-lg);background:var(--color-surface-raised);color:var(--color-text-secondary);box-shadow:0 8px 24px color-mix(in srgb,var(--color-text) 18%,transparent),inset 0 0 0 1px var(--color-border);font:400 13px/19px var(--sans);text-align:left;white-space:normal;pointer-events:none;opacity:0;transform:translateY(4px);visibility:hidden;transition:opacity .16s var(--ease-out),transform .16s var(--ease-out),visibility 0s linear .16s}
.lc-tip b{display:block;margin-bottom:2px;color:var(--color-text);font:600 13px/18px var(--sans)}
.lc-tip::after{content:"";position:absolute;left:18px;top:100%;width:10px;height:10px;margin-top:-5px;background:inherit;border-radius:2px;transform:rotate(45deg);clip-path:polygon(100% 0,100% 100%,0 100%)}
@media(hover:hover){.lc-fact:hover .lc-tip{opacity:1;transform:none;visibility:visible;transition-delay:.35s,.35s,.35s}}
.lc-fact:focus-visible .lc-tip,.lc-fact:focus .lc-tip{opacity:1;transform:none;visibility:visible;transition-delay:0s}
@media(prefers-reduced-motion:reduce){.lc-tip{transition:none;transform:none}}
.feature.lc .lc-meta .lc-tip{display:block;position:absolute;color:var(--color-text-secondary);font:400 13px/19px var(--sans);opacity:0;visibility:hidden}
.feature.lc .lc-meta .lc-tip b{display:block;color:var(--color-text)}
@media(hover:hover){.feature.lc .lc-meta .lc-fact:hover .lc-tip{opacity:1;visibility:visible}}
.feature.lc .lc-meta .lc-fact:focus .lc-tip,.feature.lc .lc-meta .lc-fact:focus-visible .lc-tip{opacity:1;visibility:visible}

/* ===== Practise topic picker as pills (session 54v, owner: declutter) =====
   The checkbox list is a wrap of rounded selectable pills: the topic name and a small question count (the full "N questions" is the tooltip). The real checkboxes stay, visually hidden, so keyboard and screen-reader use are unchanged. */
.tpanel{display:flex!important;flex-wrap:wrap;align-items:center;gap:var(--space-2) var(--space-2);padding:var(--space-4) 0 var(--space-2);border:0;border-radius:0;background:none}
.tpanel[hidden]{display:none!important}
.tpanel .tgall{flex:0 0 100%;margin:0 0 var(--space-1)}
.tpanel .tgall .link{min-height:32px;font:600 14px/20px var(--sans);color:var(--color-text-secondary)}
.tpanel .chk{position:relative;display:inline-flex;min-height:0;margin:0}
.tpanel .chk input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.tpanel .chk span{display:inline-flex;align-items:center;gap:var(--space-2);min-height:44px;padding:0 var(--space-4);border:1px solid var(--a-line,var(--color-border-strong));border-radius:var(--r-pill);background:var(--color-surface);color:var(--color-text);font:500 15px/20px var(--sans);transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),box-shadow .2s var(--ease-out),transform .12s var(--ease-out)}
.tpanel .chk small{font:500 12.5px/18px var(--mono);color:var(--color-text-muted);letter-spacing:0}
@media(hover:hover){.tpanel .chk:hover span{border-color:var(--a,var(--color-brand));background:var(--color-surface-raised)}}
.tpanel .chk:active span{transform:scale(.98)}
.tpanel .chk:has(input:checked) span{border-color:var(--a,var(--color-brand));background:var(--a-soft,var(--color-brand-soft));box-shadow:inset 0 0 0 1px var(--a,var(--color-brand));font-weight:600}
.tpanel .chk:has(input:checked) small{color:var(--color-text-secondary)}
.tpanel .chk:has(input:checked) span::before{content:"";flex:none;width:14px;height:14px;background:var(--a,var(--color-brand));-webkit-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/14px no-repeat;mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/14px no-repeat}
.tpanel .chk:has(input:focus-visible) span{outline:2px solid var(--color-focus);outline-offset:2px}
@media(prefers-reduced-motion:reduce){.tpanel .chk span{transition:none}}

/* lesson card action: the same terracotta as the "Review them" button, and the same hover (a deeper terracotta) */
.feature.lc .lc-go{background:var(--color-brand);color:var(--color-on-brand)}
.feature.lc:hover .lc-go{background:var(--color-brand-hover);color:var(--color-on-brand);box-shadow:none}

/* ===== Reading serif: Bitter everywhere (session 54w, owner: Newsreader looks faint and unsuitable; a Caecilia-like slab instead) =====
   Bitter (SIL OFL, already self-hosted) replaces Newsreader as --serif for titles, questions, answers, lessons and lists. Newsreader stays only as a fallback in the stack.
   Bitter is wider and has a larger x-height, so sizes step down about 8% and headings take weight 500. IBM Plex Mono (counts, timers) and Inter (interface) are unchanged. */
:root{--serif:"Bitter","Newsreader",Georgia,"Times New Roman",serif;--slab:var(--serif)}
h1,h2,h3,.hd-head h1,.hm-intro h1{font-weight:500}
h1{font-size:32px;line-height:40px;letter-spacing:-.01em}
h2{font-size:25px;line-height:32px}
h3{font-size:20px;line-height:27px}
.hd-head h1{font-size:30px;line-height:38px}.hd-head h1.long{font-size:24px;line-height:32px}
.mhead h1{font-size:32px;line-height:40px}
.lstep h2{font-size:25px;line-height:32px}
.qq .prompt,.qq>p,.lq .prompt,.exq .prompt{font-size:19px;line-height:29px;font-weight:400}
.mkq{font-size:16px;line-height:25px;font-weight:400}
.lgn{font-size:21px;line-height:27px;font-weight:500}
.pway .pw-t{font-size:23px;line-height:29px;font-weight:500}
.pmock .pm-t{font-size:28px;line-height:34px;font-weight:500}
.hm-an,.hm .hm-an{font-size:20px;line-height:26px;font-weight:500}
.hd-main .hm-title{font-size:28px;line-height:35px}.hd-main .hm-title.long{font-size:22px;line-height:29px}
.feature.lc .lc-title{font-size:21px;line-height:28px}
.nq span{font-size:26px;font-weight:600}
.atile .at-n{font-size:17px;line-height:22px;font-weight:500}
.lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font-size:17px;line-height:28px}
@media(max-width:767px){
  h1,.mhead h1{font-size:27px;line-height:34px}h2,.lstep h2{font-size:22px;line-height:29px}h3{font-size:19px;line-height:26px}
  .hd-head h1{font-size:25px;line-height:32px}.hd-head h1.long{font-size:22px;line-height:29px}
  .qq .prompt,.qq>p,.lq .prompt,.exq .prompt{font-size:18px;line-height:27px}
  .feature.lc .lc-title{font-size:19px;line-height:26px}
  .lstep .lsec>p,.lstep .lsec li,.msec p,.msec li{font-size:16px;line-height:26px}
}
/* focused question screens set their own larger sizes; bring them down to Bitter's scale */
body .qq .prompt,body .qq>p,body .lq .prompt,body .exq .prompt{font-size:21px;line-height:31px}
body .opt,body .lopt{font-size:17px;line-height:25px}
@media(max-width:767px){body .qq .prompt,body .qq>p,body .lq .prompt,body .exq .prompt{font-size:19px;line-height:28px}body .opt,body .lopt{font-size:16px;line-height:24px}}

/* ===== Digits (session 54x, owner: "numbers don't suit"): inside the serif stack the digits 0-9 and % are drawn by Inter (the file already loaded for the interface) so numbers read clean and even next to the slab letters. No new font file. ===== */
@font-face{font-family:"Serif Numerals";font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/inter-latin-wght-normal.woff2) format("woff2");unicode-range:U+0030-0039,U+0025;size-adjust:96%}
:root{--serif:"Serif Numerals","Bitter","Newsreader",Georgia,"Times New Roman",serif;--slab:var(--serif)}

/* ===== Practise entry cards and the Leave button (session 54y, owner: declutter, icons, more character) ===== */
/* three entries: quick quiz and retry are soft rounded cards with an icon tile; the mock panel gets a small icon; no hairlines */
.pways{gap:var(--space-3)}
.pway{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:var(--space-4);align-items:center;padding:var(--space-4) var(--space-5);border:0;border-radius:20px;background:var(--color-surface);transition:background-color .2s var(--ease-out),box-shadow .2s var(--ease-out),transform .12s var(--ease-out)}
.pway:hover{background:var(--color-surface-raised);box-shadow:var(--shadow-raised)}
.pway:active{transform:scale(.99)}
.pway .pw-ic{grid-row:1/3;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:var(--color-brand-soft);color:var(--color-brand)}
.pway .pw-t{font:500 20px/26px var(--serif);letter-spacing:-.005em}
.pway .pw-t::after{font-size:20px}
.pway .pw-s{grid-column:2;margin-top:2px;font:400 14px/20px var(--sans);max-width:none}
.pway.off .pw-ic{background:var(--color-surface-soft);color:var(--color-text-muted)}
.pm-k{display:inline-flex;align-items:center;gap:var(--space-2)}
.pm-ic{flex:none;color:var(--color-text-muted)}
.pmock:not(.locked) .pm-ic{color:var(--color-brand)}
/* Leave: a soft pill with the cross in the brand colour; the cross turns a quarter on hover */
.qclose{gap:var(--space-2);min-height:40px;padding:0 var(--space-4) 0 var(--space-3);margin-left:0;border-radius:var(--r-pill);background:var(--color-surface-soft);color:var(--color-text);font:500 15px/1 var(--sans);transition:background-color .2s var(--ease-out),color .2s var(--ease-out),box-shadow .2s var(--ease-out)}
.qclose .ic,.qclose svg{color:var(--color-brand);transition:transform .25s var(--ease-out)}
.qclose:hover{background:var(--color-brand-soft);color:var(--color-text);box-shadow:inset 0 0 0 1px var(--color-brand)}
.qclose:hover .ic,.qclose:hover svg{transform:rotate(90deg)}
@media(prefers-reduced-motion:reduce){.pway,.qclose,.qclose svg{transition:none}.qclose:hover svg{transform:none}}

/* ===== Topic cards on Learn (session 54z, owner: fewer words, icons, status as a pill) =====
   A rounded card per topic: title with the status as a compact pill, the one-line blurb, then icon facts (lessons, questions, your answers) with the same hover tooltips as the lesson cards. */
.tcard{display:grid;gap:var(--space-2);margin:var(--space-2) 0;padding:var(--space-4) var(--space-12) var(--space-4) var(--space-5);border:0;border-radius:20px;background:var(--color-surface);transition:background-color .2s var(--ease-out),box-shadow .2s var(--ease-out),transform .14s var(--ease-out)}
.tcard:first-of-type{border-top:0}
.tcard:hover{background:var(--color-surface-raised);box-shadow:var(--shadow-raised)}
.tcard:active{transform:scale(.99)}
.tcard::after{right:var(--space-5)}
.tcard .tc-top{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap}
.tcard .tc-top b{display:block;font:500 20px/26px var(--serif);letter-spacing:-.005em;text-wrap:balance}
.tcard .tst{display:inline-flex;margin:0;padding:2px var(--space-3) 2px var(--space-2);border-radius:var(--r-pill);background:var(--color-surface-soft);font:600 12.5px/20px var(--sans);white-space:nowrap}
.tcard .tblurb{display:block;margin:0;color:var(--color-text-secondary);font:400 15px/22px var(--sans)}
.tcard .tc-facts{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-1) var(--space-5);margin-top:var(--space-1);font:400 14px/20px var(--sans);color:var(--color-text-secondary)}
.tcard .tc-facts>.lc-fact{position:relative;display:inline-flex;align-items:center;gap:6px;cursor:help;border-radius:var(--r-sm);outline-offset:4px;font-variant-numeric:tabular-nums}
.tcard .tc-facts svg{flex:none;opacity:.75}
.tcard .tc-facts .sr{position:absolute}
.tcard .tc-facts .lc-tip{display:block;position:absolute;color:var(--color-text-secondary);font:400 13px/19px var(--sans)}
.tcard .tc-facts .lc-tip b{display:block;color:var(--color-text);font:600 13px/18px var(--sans)}
@media(hover:hover){.tcard .tc-facts .lc-fact:hover .lc-tip{opacity:1;visibility:visible}}
.tcard .tc-facts .lc-fact:focus .lc-tip,.tcard .tc-facts .lc-fact:focus-visible .lc-tip{opacity:1;visibility:visible}
.tcard .tc-also{color:var(--color-text-muted)}
@media(max-width:600px){.tcard{padding:var(--space-4) var(--space-10) var(--space-4) var(--space-4)}.tcard .tc-top b{font-size:18px;line-height:24px}}
@media(prefers-reduced-motion:reduce){.tcard{transition:none}}

/* Learn: each area is a rounded card with its icon tile; the one-line area blurb inside is hidden (the name and the topics say it); the topic cards sit inside as the lighter layer */
.lgroup{margin:var(--space-3) 0;padding:var(--space-2) var(--space-4);border:0;border-radius:20px;background:var(--color-surface)}
.lgroup>summary{display:flex;align-items:center;gap:var(--space-4);min-height:64px;padding:var(--space-2) 0}
.lgroup>summary::before{content:none}
.lgroup>summary::after{content:"";margin-left:auto;flex:none;width:18px;height:18px;background:var(--color-text-muted);-webkit-mask:var(--chev) center/18px no-repeat;mask:var(--chev) center/18px no-repeat;transform:rotate(90deg);transition:transform .2s var(--ease-out)}
.lgroup[open]>summary::after{transform:rotate(-90deg)}
.lg-ic{display:grid;place-items:center;flex:none;width:44px;height:44px;border-radius:50%;background:var(--a-soft,var(--color-surface-soft));color:var(--a,var(--color-text))}
.lg-ic svg{width:22px;height:22px}
.lgroup .lgn{font:500 21px/27px var(--serif)}
.lg-n{margin-left:auto;padding-right:var(--space-3);font:500 13px/18px var(--sans);color:var(--color-text-secondary);white-space:nowrap}
.lgroup>.hm-ab{display:none}
.lgroup>ol.seq{padding-bottom:var(--space-2)}
.lgroup .tcard{background:var(--color-surface-raised);box-shadow:none}
.lgroup .tcard:hover{background:var(--color-surface-soft)}
@media(max-width:600px){.lg-n{display:none}.lgroup{padding:var(--space-1) var(--space-3)}.lgroup .lgn{font-size:19px;line-height:25px}}
@media(prefers-reduced-motion:reduce){.lgroup>summary::after{transition:none}}

/* ===== Touch feedback (session 54aa, owner: "more touch feedback from the system and buttons") =====
   1. a clear pressed state on everything you can press (scale and a little dimming, 100 ms in, 200 ms out);
   2. a soft ripple from the press point (touch.js);
   3. a small pop when an option is chosen (the wrong-answer shake was removed for calm learning screens);
   4. a light vibration on touch phones (touch.js). All of it is off when the system asks for reduced motion. */
.btn:active:not([disabled]),.ink:active,.lc-go:active,.qclose:active,.chip:active,.seg span:active,.theme button:active,.atile:active,.nq label:active span,.tpanel .chk:active span{transform:scale(.95);filter:brightness(.94);transition-duration:.08s}
.opt:active:not([disabled]),.lopt:active:not(:disabled),.tcard:active,.feature.lc:active,.pway:active,.art:active,.hd-lt:active,.lgroup>summary:active,.mrow:active{transform:scale(.985);filter:brightness(.97)}
.tabs>a:active{transform:scale(.9)}
.tabs>a:active svg{transform:translateY(1px)}
.btn,.ink,.lc-go,.qclose,.chip,.theme button,.atile,.opt,.lopt,.tcard,.pway,.art{transition-property:transform,filter,background-color,border-color,color,box-shadow;transition-duration:.2s;transition-timing-function:var(--ease-out)}
.rip-host{overflow:hidden}
:where(.rip-host){position:relative}
.rip{position:absolute;z-index:0;border-radius:50%;pointer-events:none;background:currentColor;opacity:.18;transform:scale(0);animation:rip .55s cubic-bezier(.22,1,.36,1) forwards}
@keyframes rip{to{transform:scale(1);opacity:0}}
@keyframes selpop{0%{transform:scale(1)}40%{transform:scale(1.012)}100%{transform:scale(1)}}
.opt.sel{animation:selpop .28s var(--ease-out)}
@media(prefers-reduced-motion:reduce){.rip{display:none}.opt.sel{animation:none}.btn:active,.ink:active,.lc-go:active,.qclose:active,.chip:active,.atile:active,.opt:active,.tcard:active,.pway:active,.tabs>a:active{transform:none}}
/* syllabus codes are no longer shown on lesson cards or lesson headers (session 54ab); the state sits at the right of the card's top row */
.lc-top{justify-content:flex-end}

/* bug fix (session 54ac): hovering a chosen option made its letter brand-on-brand (the hover rule for the letter outranked the chosen-state rule), so the letter vanished. The chosen, right and wrong states keep their own letter colours on hover. */
.opt.sel:hover .ol,.opt.sel:hover:not([disabled]) .ol,.opt.sel:focus-visible .ol{background:var(--color-brand);border-color:var(--color-brand);color:var(--color-on-brand)}
.opt.ok:hover .ol,.opt.ok:hover:not([disabled]) .ol,.lopt.ok:hover .ol{background:var(--color-success);border-color:var(--color-success);color:var(--color-on-brand)}
.opt.bad:hover .ol,.opt.bad:hover:not([disabled]) .ol,.lopt.bad:hover .ol{background:var(--color-error);border-color:var(--color-error);color:var(--color-on-brand)}

/* ===== Lesson overview, decluttered (session 54ad, owner: lesson pages look too cluttered) =====
   Header: area, time and step count as one quiet row of small facts; the draft label stays, as a small pill. Goals get check marks, the prerequisites become small pills, the steps sit in one rounded card
   with a segmented progress bar and one button, and "What the specification asks" is a closed fold below. */
.mhead .mmeta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 var(--space-2);font:500 14px/20px var(--sans);color:var(--color-text-secondary)}
.mhead .mf{display:inline-flex;align-items:center;gap:6px}
.mhead .mf svg{flex:none;opacity:.75}
.mhead .mf-area{padding:2px var(--space-3);border-radius:var(--r-pill);background:var(--a-soft,var(--color-surface-soft));color:var(--a,var(--color-text));font-weight:600}
.mhead .mstatus{display:inline-flex;margin:0;padding:2px var(--space-3);border-radius:var(--r-pill);background:color-mix(in srgb,var(--color-warning) 12%,var(--color-surface));color:var(--color-warning);font:500 12.5px/20px var(--sans)}
.lgoals ul{list-style:none;margin:0;padding:0}
.lgoals li{position:relative;margin:0 0 var(--space-3);padding-left:30px}
.lgoals li::before{content:"";position:absolute;left:0;top:5px;width:18px;height:18px;background:var(--a,var(--color-brand));-webkit-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/18px no-repeat;mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/18px no-repeat}
.lpre{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2);margin-top:var(--space-5)}
.lpre-t{flex:0 0 100%;font:600 13px/18px var(--sans);color:var(--color-text-muted)}
.lp{padding:4px var(--space-3);border-radius:var(--r-pill);background:var(--color-surface-soft);font:500 13.5px/20px var(--sans);color:var(--color-text-secondary)}
.lovr .lplan{align-self:start;padding:var(--space-5) var(--space-6);border-radius:20px;background:var(--color-surface)}
.lovr .lplan h2{margin-top:0;font-size:21px;line-height:27px}
.lprog{display:flex;align-items:center;gap:var(--space-3);margin:var(--space-4) 0 0}
.lbar2{display:flex;flex:1;gap:4px;min-width:0}
.lbar2 i{display:block;flex:1;height:6px;border-radius:var(--r-pill);background:var(--color-border)}
.lbar2 i.on{background:var(--a,var(--color-brand))}
.lprog-n{flex:none;font:500 13px/18px var(--mono);color:var(--color-text-secondary)}
.lovr .lplan .act{margin-top:var(--space-4);gap:var(--space-5)}
.lspec{grid-column:1/-1;margin-top:var(--space-6)}
.lspec>summary{font:600 15px/22px var(--sans)}
.lspec blockquote{margin:var(--space-3) 0;padding:var(--space-3) var(--space-4);border:0;border-radius:var(--r-lg);background:var(--color-surface);font:400 16px/25px var(--serif)}

/* ===== Lesson steps: the side list is gone (session 54ae, owner: it takes too much space) =====
   The steps are one tap away in the "All steps" fold under the progress dots (the same fold phones already used), plus Back / Continue at the foot of every step. */
.lrail{display:none!important}
.lgrid{display:block!important}
.lgrid>.lmain{max-width:760px;margin-inline:auto}
.lbar,.lall{display:block!important}
.lbar{display:flex!important}
.lmain>.lcount{display:none!important}
.lall>summary{display:flex}

/* ===== "Common mistakes" in lessons (session 54af, owner: declutter) =====
   Each mistake is a soft rounded card: the wrong idea with a small cross, then two short rows, "Why it fails" (warning icon) and "Do this instead" (tick), no hairlines. Tokens only. */
.mistlist{display:grid;gap:var(--space-3);margin:var(--space-6) 0 var(--space-5);border:0}
.mistlist>h3{margin:0;font:600 14px/20px var(--sans);color:var(--color-text-secondary)}
.mistlist .mist{margin:0;padding:var(--space-4) var(--space-5);border:0;border-radius:20px;background:var(--color-surface)}
.mistlist .mist:last-child{border:0}
.mistlist .mist p{margin:0}
.mistlist .mist .wrong{position:relative;padding-left:30px;font:500 17px/25px var(--serif);color:var(--color-error)}
.mistlist .mist .wrong::before{content:"";position:absolute;left:0;top:4px;width:18px;height:18px;background:var(--color-error);-webkit-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center/18px no-repeat;mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center/18px no-repeat}
.mistlist .mist p:not(.wrong){position:relative;margin-top:var(--space-3);padding-left:30px;font:400 16px/25px var(--serif);color:var(--color-text)}
.mistlist .mist p:not(.wrong)::before{content:"";position:absolute;left:0;top:4px;width:18px;height:18px;background:var(--color-text-muted);-webkit-mask:center/18px no-repeat;mask:center/18px no-repeat}
.mistlist .mist .mist-b p:nth-child(1)::before{background:var(--color-warning);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v5M12 17h.01M12 21a9 9 0 100-18 9 9 0 000 18Z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v5M12 17h.01M12 21a9 9 0 100-18 9 9 0 000 18Z'/%3E%3C/svg%3E")}
.mistlist .mist .mist-b p:nth-child(2)::before{background:var(--color-success);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E")}
.mistlist .mist b{margin-right:var(--space-1);font:600 14px/25px var(--sans);color:var(--color-text-secondary)}
@media(max-width:600px){.mistlist .mist{padding:var(--space-4)}.mistlist .mist .wrong{font-size:16px;line-height:24px}}

/* ===== Deep lesson screens and folded mistake blocks (lesson rebuild pilot). One idea per screen, nothing moves on its own. Tokens only. */
.mist>summary{display:block;min-height:44px;list-style:none;cursor:pointer}
.mist>summary::-webkit-details-marker{display:none}
.mist>summary .wrong{display:block}
.mist-cue{display:flex;align-items:center;gap:6px;min-height:32px;padding-left:30px;font:600 14px/22px var(--sans);color:var(--color-text-secondary)}
.mist-cue::before{content:"";width:14px;height:14px;flex:none;background:currentColor;-webkit-mask:var(--chev) center/14px no-repeat;mask:var(--chev) center/14px no-repeat}
.mist[open] .mist-cue::before{transform:rotate(90deg)}
.exb .steps li p{margin:0}
.exb .steps li .ln{font-weight:600;overflow-wrap:anywhere}
.exb .steps li .lx{margin-top:var(--space-2);font:400 15.5px/24px var(--sans)}
.deep{max-width:720px;margin-inline:auto}
.dwhere{margin:var(--space-4) 0 var(--space-1);font:600 14px/20px var(--sans);color:var(--color-text-secondary)}
.deep>h1{margin-top:0}
.deep .lsec>p,.deep .lsec li{font:400 17px/28px var(--serif);max-width:62ch}
.deep .lsec table{margin:var(--space-3) 0}
@media(max-width:600px){.deep .lsec th,.deep .lsec td{padding-inline:var(--space-1);font-size:14px;line-height:20px;overflow-wrap:anywhere}.deep .lsec table{width:100%}}
.dsaved{margin:var(--space-5) 0 0;font:400 13.5px/20px var(--sans);color:var(--color-text-muted)}
.dnav{display:flex;flex-wrap:wrap;justify-content:space-between;gap:var(--space-3);margin:var(--space-6) 0 0}
.dnav .btn{min-width:150px}.dnav .btn:last-child{margin-left:auto}
.dparts{display:grid;gap:var(--space-2);margin:var(--space-4) 0;padding:0;list-style:none}
.dparts a{display:block;min-height:44px;padding:var(--space-3) var(--space-4);border:1px solid var(--color-border);border-radius:var(--r-lg);background:var(--color-surface);color:var(--color-text);text-decoration:none}
.dparts a:hover{border-color:var(--color-border-strong)}
.dparts span{display:block;font:600 16px/23px var(--sans)}
.dparts small{display:block;font:400 14px/20px var(--sans);color:var(--color-text-secondary)}
.ldeep{grid-column:1/-1;margin-top:var(--space-6)}
.dpick a.chip{display:inline-flex;align-items:center;min-height:44px;text-decoration:none}
.dtag{display:inline-block;margin:var(--space-4) 0 0;padding:2px var(--space-3);border-radius:var(--r-pill);background:var(--a-soft,var(--color-surface-soft));font:600 13px/20px var(--sans)}
.deep .lopts{display:grid;gap:var(--space-2);margin-top:var(--space-4)}
.deep .lopt.sel{border-color:var(--color-brand);background:var(--color-brand-soft)}
.deep .lopt.sel .ol{background:var(--color-brand);border-color:var(--color-brand);color:var(--color-on-brand)}
.dact{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);margin-top:var(--space-4)}
.deep .link{min-height:44px}
.dq{padding:var(--space-4) var(--space-5);border:1px solid var(--color-border);border-radius:var(--r-lg);background:var(--color-surface)}
.dq p{margin:0}
.dpass{margin:var(--space-3) 0 0;padding-left:22px}
.dpass li{margin:var(--space-2) 0;font:400 17px/27px var(--serif)}
.dwork ol{margin:0;padding-left:22px}
.dwork li{margin:var(--space-2) 0;font:400 16px/25px var(--serif);overflow-wrap:anywhere}
.deep .dwork h2{margin:var(--space-5) 0 var(--space-2);font:600 15px/22px var(--sans);color:var(--color-text-secondary)}
.deep .dstep h2{margin:var(--space-5) 0 var(--space-3);font:600 19px/28px var(--serif)}
.dfield{display:grid;gap:var(--space-2);font:600 14px/20px var(--sans)}
.dfield input{width:100%;max-width:440px;min-height:48px;padding:0 var(--space-3);border:1px solid var(--color-border-strong);border-radius:var(--r-md);background:var(--color-surface-raised);color:var(--color-text);font:400 18px/24px var(--sans)}
.dkeys{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.dkeys button{min-width:48px;min-height:44px;border:1px solid var(--color-border-strong);border-radius:var(--r-md);background:var(--color-surface);color:var(--color-text);font:600 17px/1 var(--sans);cursor:pointer}
.dkeys button:disabled,.dfield input:disabled{opacity:.6;cursor:default}
.dch{display:grid;gap:var(--space-2)}
.dch .chk{min-height:48px}
.dhints{margin:var(--space-3) 0 0;padding:0;list-style:none}
.dhints li{margin:var(--space-2) 0;padding:var(--space-3) var(--space-4);border-radius:var(--r-md);background:var(--color-surface-soft);font:400 16px/25px var(--sans)}
.dscore{margin:var(--space-5) 0;font:600 19px/28px var(--sans)}
.dres li{margin:var(--space-3) 0;line-height:26px}
.dcard{padding:var(--space-5);border:1px solid var(--color-border);border-radius:var(--r-lg);background:var(--color-surface)}
.deep .dcard h2{margin:0;font:600 15px/22px var(--sans);color:var(--color-text-secondary)}
.deep .dcard h3{margin:var(--space-4) 0 var(--space-1);font:600 14px/20px var(--sans);color:var(--color-text-secondary)}
.dcard p{margin:var(--space-1) 0}
.dcard .dformula{margin:var(--space-2) 0;font:600 20px/32px var(--serif);overflow-wrap:anywhere}
.dcard dl{margin:0}.dcard dl div{display:flex;gap:var(--space-3)}.dcard dt{flex:0 0 auto;min-width:3ch;font-weight:600}.dcard dd{margin:0}
.dworked .exb h3{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap} /* the screen title already names the example */
.dcard dl.words div{display:block;margin-bottom:var(--space-2)}
@media(max-width:600px){.dnav .btn{width:100%}.dq,.dcard{padding:var(--space-4)}}

/* ===== Stacked fractions on neighbouring lines (2026-11-26): the math box was exactly the line height, so denominators and numerators collided. ===== */
math:has(mfrac){padding-block:var(--space-1)}
