:root{--bg:#F4F6FB;--card:#FFFFFF;--ink:#192055;--muted:#575D69;--line:#DDE2EE;--navy:#181E51;--blue:#3F54A3;
--orange:#ED6842;--green:#1D7240;--red:#A3332B;--sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.6 var(--sans)}
a{color:var(--blue)}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--orange);outline-offset:2px}
.mast{background:var(--navy);padding:12px 24px}
.brand{display:flex;align-items:center;gap:12px;color:#fff;font-weight:800;font-size:18px;text-decoration:none}
.badge{width:40px;height:40px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center}
.badge img{width:32px;height:32px}.lab{color:var(--orange)}
.page{max-width:900px;margin:0 auto;padding:24px 16px 48px}
.foot{max-width:900px;margin:0 auto;padding:0 16px 24px;color:var(--muted);font-size:13px}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px 20px;margin:16px 0}
.row{display:flex;flex-wrap:wrap;gap:12px}
label{display:flex;flex-direction:column;font-size:13px;font-weight:600;color:var(--muted);gap:4px}
input,select{font:16px var(--sans);padding:6px 8px;border:1px solid var(--line);border-radius:8px;color:var(--ink)}
.answer-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 14px;margin-top:12px}
.answer{flex:1 1 260px;max-width:420px}.answer input{font-size:20px;width:100%}
.keys{display:flex;flex-wrap:wrap;gap:6px}
.keys button{min-width:44px;min-height:44px;font:600 18px var(--sans);background:#fff;color:var(--ink);
border:1px solid var(--line);border-radius:8px;padding:4px 10px}
.keys button:hover{border-color:var(--blue)}
code{font-size:.92em;background:#EEF1F8;border-radius:4px;padding:0 .2em}
[hidden]{display:none!important}
.preview{min-height:2.6em;margin:8px 0;font-size:18px;display:flex;align-items:center;gap:8px}
.preview math{font-size:1.25em}
button{font:600 15px var(--sans);background:var(--blue);color:#fff;border:0;border-radius:8px;padding:8px 18px;cursor:pointer}
.label{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700;margin-right:6px}
.muted{color:var(--muted);font-size:14px}.bad{color:var(--red)}
.verdict{font-size:18px;font-weight:700}.v-right{color:var(--green)}.v-wrong,.v-unreadable{color:var(--red)}
.v-form,.v-unit{color:#A23E1C}
math{font-size:1.1em}
.mast{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.nav{display:flex;align-items:center;gap:14px;color:#fff;font-size:14px}.nav a{color:#fff}
.nav form{margin:0}.who{opacity:.85}
button.link{background:none;border:1px solid rgba(255,255,255,.5);color:#fff;padding:4px 10px;font-size:14px}
.narrow{max-width:420px;display:flex;flex-direction:column;gap:12px}
.flash{border-radius:10px;padding:8px 14px}.flash-error{background:#FDEDE7;color:var(--red)}.flash-ok{background:#E5F6EC;color:var(--green)}
.table{width:100%;border-collapse:collapse;background:var(--card);border:1px solid var(--line);border-radius:10px;font-size:15px}
.table th,.table td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
.table th{background:#E9EDF8;font-size:13px}
tr.inactive td{color:var(--muted);text-decoration:line-through}
.actions{display:flex;gap:6px;flex-wrap:wrap}.actions form{margin:0}
button.small{font-size:13px;padding:4px 10px}button.secondary{background:#fff;color:var(--blue);border:1px solid var(--line)}
.children{border:1px solid var(--line);border-radius:10px;margin:12px 0;padding:8px 12px}
label.check{flex-direction:row;align-items:center;gap:6px;font-weight:500;color:var(--ink)}
.link-text{word-break:break-all;font-size:14px}
@media (max-width:640px){.table{display:block;overflow-x:auto}}
.badge-active{font-size:13px;background:#E5F6EC;color:var(--green);border-radius:6px;padding:2px 8px;vertical-align:middle}
.crumb{color:var(--muted);font-size:14px;margin:0}.crumb a{color:var(--muted)}
.unit-card{display:flex;flex-direction:column;gap:2px;text-decoration:none;color:var(--ink)}.unit-title{font-size:20px;font-weight:700}
.unit-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;align-items:start}
@media (max-width:820px){.unit-layout{grid-template-columns:minmax(0,1fr)}}
.unit-steps ol{list-style:none;margin:0;padding:0}.unit-steps li{padding:8px 0;border-bottom:1px solid var(--line);display:flex;gap:8px;justify-content:space-between;align-items:baseline}
.unit-steps li:last-child{border-bottom:0}.unit-steps li.current a{color:var(--ink);font-weight:700}.unit-steps a{text-decoration:none}
.small-h{font-size:17px;margin:0 0 4px}
.page{max-width:1180px}
.lesson h2{margin-top:0}.lesson p,.lesson li{max-width:72ch}
.lesson blockquote{margin:12px 0;padding:8px 14px;background:#E9EDF8;border-radius:10px}

.fig img{max-width:100%;width:420px;height:auto;background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.decide{border:2px solid var(--orange);border-radius:14px;padding:12px 18px;margin:16px 0}
.kicker{font-size:13px;letter-spacing:.06em;text-transform:uppercase;font-weight:800;color:var(--orange)}
.decide .q{font-weight:700;font-size:18px}.choices{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
button.choice{width:100%;text-align:left;background:#fff;color:var(--ink);border:1px solid var(--line);font-weight:600;font-size:16px;padding:10px 14px}
button.choice.is-right{border-color:var(--green);background:#E5F6EC}button.choice.is-wrong{border-color:var(--red);background:#FDEDE7}
.feedback{padding:6px 14px;color:var(--ink)}
.worked{background:#F4F6FB;border-radius:12px;padding:10px 16px;margin:14px 0}.worked h3{margin:2px 0 6px}.worked .stmt{font-weight:600}

.ask-field button.choice{width:auto}.ask-result.is-right{color:var(--green);font-weight:700}.ask-result.is-wrong{color:var(--red)}
.pager{display:flex;justify-content:space-between;gap:12px;margin-top:20px}
a.button{display:inline-block;font:600 15px var(--sans);background:var(--blue);color:#fff;border-radius:8px;padding:8px 18px;text-decoration:none}
a.button.secondary{background:#fff;color:var(--blue);border:1px solid var(--blue)}
progress.progress{appearance:none;-webkit-appearance:none;width:100%;height:8px;border:0;border-radius:6px;background:#E2E6F0;margin:10px 0 18px;overflow:hidden}
progress.progress::-webkit-progress-bar{background:#E2E6F0;border-radius:6px}
progress.progress::-webkit-progress-value{background:var(--orange);border-radius:6px}
progress.progress::-moz-progress-bar{background:var(--orange);border-radius:6px}
.practice-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:22px;align-items:start}
@media (max-width:900px){.practice-layout{grid-template-columns:minmax(0,1fr)}}
.problem-body{display:flex;gap:18px;flex-wrap:wrap}.statement{flex:1 1 280px;font-size:18px}.problem-fig{flex:0 1 300px}
.unit-word{font-weight:600}.help-row{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;margin-top:10px}
.hint{flex-basis:100%;background:#F4F6FB;border-radius:10px;padding:8px 12px;margin:0}
button.secondary{background:#fff;color:var(--blue);border:1px solid var(--line)}
.verdict-card{border-left:6px solid var(--line)}.verdict-card.v-right{border-left-color:var(--green)}.verdict-card.v-wrong{border-left-color:var(--red)}
.verdict-card.v-form,.verdict-card.v-unit{border-left-color:var(--orange);background:#FDF1EC}
.verdict-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.verdict-head h2{margin:0}
.band{font-size:14px;font-weight:700;border:1px solid var(--line);border-radius:999px;padding:3px 10px;background:#fff}
.route-card .kicker{color:var(--blue)}.route-list{padding-left:18px}.route-list li{margin:6px 0}
.ok-text{color:var(--green);font-weight:600}.repair{margin-top:12px}
/* mini-quizzes (A3b) */
.quiz-builder fieldset{border:1px solid var(--line);border-radius:8px;margin:0 0 14px;padding:10px 14px}
.quiz-builder legend{font-weight:600;padding:0 4px}
label.check{display:flex;margin:4px 0}label.field{display:block;margin-top:8px}
.small{font-size:13px}
.quiz-nav{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 14px}
.quiz-nav a{border:1px solid var(--line);border-radius:6px;padding:4px 10px;text-decoration:none;background:var(--card)}
.quiz-nav a.answered{border-color:var(--blue)}
.quiz-nav a.current{background:var(--blue);color:#fff;border-color:var(--blue)}
.quiz-nav a.finish-link{margin-left:auto}
/* a verdict card's text stays ink: its border and its heading's words carry the verdict (D54: no green text on white) */
.verdict-card.v-right,.verdict-card.v-wrong,.verdict-card.v-unreadable,.verdict-card.v-form,.verdict-card.v-unit{color:var(--ink)}
/* full rounds (A3c) */
.round-bar{position:sticky;top:0;z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:12px;justify-content:space-between;
  background:var(--card);border:1px solid var(--line);border-radius:10px;padding:8px 14px;margin:8px 0}
.round-name{font-weight:700}
.timer{font:700 22px/1 var(--sans);font-variant-numeric:tabular-nums;min-width:4ch;text-align:right}
.timer.late{color:var(--red)}
.pairs{display:flex;gap:6px}
.pair-dot{display:inline-block;width:1.8em;height:1.8em;line-height:1.8em;text-align:center;border-radius:50%;border:1px solid var(--line);font-size:13px}
.pair-dot.done{background:var(--line)}.pair-dot.now{background:var(--blue);color:#fff;border-color:var(--blue)}
.round-page{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;align-items:start;margin:16px 0}
.paper-page{display:block;max-width:100%;height:auto;border:1px solid var(--line);border-radius:6px;background:#fff;margin:0 0 12px}
.answer-col{display:flex;flex-direction:column;gap:6px;position:sticky;top:84px}
.round-answer{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.round-answer .num{font-weight:700;min-width:2.2em;display:inline-block;text-align:right}
.round-answer input[data-num]{flex:1 1 9em;min-width:0;max-width:14em;font-size:17px;padding:5px 8px}
.round-answer .preview{flex-basis:100%;min-height:0;margin:0 0 4px 2.6em;font-size:15px}
.save-state{color:var(--muted)}
.paper-list{list-style:none;padding:0;margin:0}
.paper-list li{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid var(--line)}
.paper-list .paper-name{font-weight:600;min-width:14em}
.paper-list form{margin:0 0 0 auto}
.table-wrap{overflow-x:auto}
.round-table tr.v-right td:nth-child(3){color:var(--green);font-weight:600}
.key-review{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.key-pages{position:sticky;top:8px}
.done-list{columns:2;margin:0}
@media (max-width:760px){.round-page,.key-review{grid-template-columns:1fr}.answer-col,.key-pages{position:static}}
/* lesson and practice pages (D81): a step pill, Back and Next with progress dots, ticks on steps read, the reference
   sheet in a panel that slides over the page, a unit's video in the page */
.step-pill{display:inline-block;margin:0 0 6px;padding:3px 10px;border-radius:999px;background:#FDEDE7;color:#A23E1C;
  font-size:13px;font-weight:700}
.pager{align-items:center;flex-wrap:wrap}
.dots{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;flex:1 1 auto}
.dot{width:11px;height:11px;border-radius:50%;background:var(--line);display:inline-block}
.dot.seen{background:#AEB9DA}.dot.now{background:var(--orange);transform:scale(1.25)}
.dot:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.side-progress{display:flex;flex-direction:column;gap:2px;margin-bottom:6px}
.side-progress .progress{margin:4px 0 8px}
.unit-steps li.done a{color:var(--ink)}.tick{color:var(--green);font-weight:700}
.side-sheet{display:block;text-align:center;margin:12px 0}
.unit-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}
.unit-grid .unit-card{margin:0}
.unit-card .progress{margin:10px 0 6px}
.unit-stats{display:flex;flex-wrap:wrap;gap:4px 14px;color:var(--muted)}
.card-go{margin-top:8px;font-weight:700;color:var(--blue)}
.unit-card:hover .card-go,.unit-card:focus-visible .card-go{text-decoration:underline}
.video-card{margin:16px 0}
.video-play{display:flex;align-items:center;gap:16px;width:100%;max-width:640px;aspect-ratio:16/9;padding:24px;border:0;
  border-radius:12px;background:linear-gradient(135deg,var(--navy),var(--blue));color:#fff;text-align:left;cursor:pointer}
.video-play:focus-visible{outline:3px solid var(--orange);outline-offset:3px}
.play-icon{flex:0 0 64px;height:64px;border-radius:50%;background:var(--orange);position:relative}
.play-icon::after{content:"";position:absolute;left:26px;top:20px;border-left:20px solid #fff;border-top:12px solid transparent;
  border-bottom:12px solid transparent}
.video-text{display:flex;flex-direction:column;gap:6px}.video-title{font:700 18px/1.3 var(--sans)}
.video-meta{font-size:14px;opacity:.9}
.video-frame{display:block;width:100%;max-width:640px;aspect-ratio:16/9;border:0;border-radius:12px;background:#000}
.sheet-drawer{position:fixed;top:0;right:0;bottom:0;width:min(460px,100vw);z-index:30;background:var(--card);
  border-left:1px solid var(--line);box-shadow:-8px 0 24px rgba(24,30,81,.18);display:flex;flex-direction:column}
.sheet-drawer[hidden]{display:none}
.sheet-drawer:focus{outline:none}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;
  border-bottom:1px solid var(--line);background:var(--navy);color:#fff}
.sheet-head h2{margin:0;font-size:18px;color:#fff}
.sheet-close{background:#fff;color:var(--navy);border:0;border-radius:8px;padding:4px 12px;font-weight:700}
.sheet-body{overflow:auto;padding:12px 16px 24px}
.sheet-body table{font-size:14px}
@media (min-width:1280px){body.sheet-open main.page{margin-right:470px}}
@media (max-width:640px){.sheet-drawer{top:auto;width:100vw;height:80vh;border-left:0;border-top:1px solid var(--line);
  border-radius:16px 16px 0 0;box-shadow:0 -8px 24px rgba(24,30,81,.2)}}
/* lessons, second pass (D81): Your turn as a numbered column of steps; worked examples with their steps set apart;
   the floating sheet button on phones only, the side column kept in view on wider screens */
.lesson p,.lesson li{line-height:1.75}
.try-steps{list-style:none;margin:14px 0 4px;padding:0}
.try-step{position:relative;margin:0 0 0 13px;padding:4px 0 16px 26px;border-left:2px solid var(--line)}
.try-step:last-child{border-left-color:transparent}
.try-step .marker{position:absolute;left:-12px;top:6px;width:22px;height:22px;border-radius:50%;background:var(--card);
  border:2px solid #AEB9DA}
.try-step.ask .marker{border-color:var(--orange);background:#FDEDE7}
.try-step.done .marker{border-color:var(--green);background:var(--green)}
.try-step.done .marker::after{content:"";position:absolute;left:6px;top:2px;width:5px;height:10px;border:solid #fff;
  border-width:0 2px 2px 0;transform:rotate(45deg)}
.try-text p{margin:0 0 8px}
.ask-q{font-size:17px}
.ask-choices{display:flex;flex-direction:column;gap:8px;max-width:620px}
.ask-choices button.choice:disabled{opacity:1;cursor:default}.ask-choices button.choice:disabled:not(.chosen){opacity:.5}
.ask-input{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.ask-input input{font-size:17px;padding:6px 10px;width:12em}
.try-reading{margin:6px 0 0;min-height:1.4em}
.ask-result{margin:6px 0 0;min-height:1.4em}
.ask-result.is-right{color:var(--green);font-weight:700}.ask-result.is-wrong{color:var(--red);font-weight:600}
button.link-button{background:none;border:0;padding:0;color:var(--blue);text-decoration:underline;font:inherit;cursor:pointer}
.try.finished .try-steps .try-step:last-child .marker{border-color:var(--green)}

.ask-result:empty,.try-reading:empty{display:none}
.worked .stmt{font-size:17px}
@media (min-width:821px){.unit-side{position:sticky;top:12px}}
/* lists as cards for a young audience (D81): a list of named ideas is a grid of cards; common mistakes are warning
   cards and the recap key-idea cards; numbered instructions have number badges; plain bullets an accent marker */
.lesson ul.cards{list-style:none;padding:0;margin:14px 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.lesson ul.cards > li{margin:0;padding:12px 14px;background:#F4F6FB;border:1px solid var(--line);border-radius:12px;max-width:none;line-height:1.6}
.lesson ul.cards > li > strong:first-child,.lesson ul.cards > li > p:first-child > strong:first-child{display:block;
  color:var(--navy);font-size:16px;margin-bottom:4px}
.lesson ul.cards > li p{margin:0}
.lesson.sec-recap > ul{list-style:none;padding:0;margin:14px 0;display:grid;gap:10px}
.lesson.sec-recap > ul > li{position:relative;margin:0;padding:12px 14px 12px 50px;background:#EEF8F2;border:1px solid #BFE3CD;
  border-radius:12px;max-width:none;line-height:1.6}
.lesson.sec-recap > ul > li::before{content:"";position:absolute;left:14px;top:13px;width:24px;height:24px;border-radius:50%;background:var(--green)}
.lesson.sec-recap > ul > li::after{content:"";position:absolute;left:23px;top:17px;width:6px;height:12px;border:solid #fff;
  border-width:0 2px 2px 0;transform:rotate(45deg)}
.lesson > ol{list-style:none;counter-reset:n;padding:0;margin:14px 0}
.lesson > ol > li{counter-increment:n;position:relative;margin:10px 0;padding:8px 12px 8px 46px;background:#F4F6FB;border-radius:10px}
.lesson > ol > li::before{content:counter(n);position:absolute;left:10px;top:8px;width:26px;height:26px;border-radius:50%;
  background:var(--blue);color:#fff;font-weight:700;text-align:center;line-height:26px;font-size:14px}
.lesson ul:not(.cards) > li::marker{color:var(--orange)}
.lesson th{background:#E9EDF8;color:var(--navy)}.lesson th,.lesson td{border:0;border-bottom:1px solid var(--line);padding:8px 12px}
.lesson tr:nth-child(even) td{background:#FAFBFE}.lesson tr:last-child td{border-bottom:0}
.lesson blockquote{border-left:4px solid var(--blue)}
/* phones: the lesson's Back and Next stay at the bottom of the screen, with a count instead of the dots */
.step-count{display:none;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
@media (max-width:640px){
  .lesson .pager{position:sticky;bottom:0;z-index:20;margin:16px -20px -16px;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));
    background:var(--card);border-top:1px solid var(--line);border-radius:0 0 14px 14px;flex-wrap:nowrap}
  .lesson .pager .dots{display:none}
  .step-count{display:block;flex:1;text-align:center}
}
@media (max-width:820px){.unit-layout .lesson{order:1}.unit-layout .unit-side{order:2}}
/* worked examples as walkthroughs, and idea boxes (D82) */
.problem-card{background:var(--card);border:2px solid var(--blue);border-radius:12px;padding:10px 16px 12px;margin:8px 0 14px}
.problem-tag,.tag{display:inline-block;font-size:12px;font-weight:800;letter-spacing:.04em;border-radius:999px;padding:2px 10px}
.problem-tag{background:var(--blue);color:#fff;text-transform:uppercase;margin-bottom:6px}
.problem-card p{margin:0;font-weight:600;font-size:17px;line-height:1.65}
.walk-steps{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.walk-step{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px 14px;line-height:1.75}
.walk-step .tag{margin-right:6px;vertical-align:1px}
.tag-move{background:#E4E8F6;color:var(--navy)}
.tag-answer{background:var(--green);color:#fff}.walk-step.kind-answer{border-color:#9FD3B5;background:#F1FAF4}
.tag-check{background:#E5F6EC;color:var(--green)}
.tag-alt{background:#FDEDE7;color:#A23E1C}.walk-step.kind-alt{border-style:dashed;border-color:#F0B49D}
.walk-controls{display:flex;align-items:center;gap:14px;margin-top:12px;flex-wrap:wrap}
.walk-step:focus{outline:none}
.lesson .idea{background:#F4F6FB;border:1px solid var(--line);border-left:5px solid var(--blue);border-radius:12px;padding:12px 16px;margin:14px 0}
.lesson .idea p{margin:0;max-width:72ch}
.lesson .idea .idea-title{font-weight:800;color:var(--navy);font-size:17px;margin:0 0 4px}
.lesson blockquote .idea{border:0;background:none;padding:0;margin:0}
/* no bare bullets (D82): a plain list is a column of soft rows with a small marker; a sub-list inside a card stays compact;
   the lists that have their own look (cards, choices, common mistakes, the recap) keep it */
.lesson:not(.sec-common-mistakes):not(.sec-recap) ul:not(.cards):not(.choices){list-style:none;padding:0;margin:12px 0;
  display:flex;flex-direction:column;gap:8px}
.lesson:not(.sec-common-mistakes):not(.sec-recap) ul:not(.cards):not(.choices) > li{position:relative;margin:0;
  padding:8px 12px 8px 34px;background:#F4F6FB;border-radius:10px;max-width:72ch}
.lesson:not(.sec-common-mistakes):not(.sec-recap) ul:not(.cards):not(.choices) > li::before{content:"";position:absolute;
  left:14px;top:1.05em;width:8px;height:8px;border-radius:2px;background:var(--orange);transform:rotate(45deg)}
.lesson .cards ul{gap:4px;margin:6px 0 0}
.lesson .cards ul > li{background:var(--card)!important;padding:4px 10px 4px 28px!important}
.lesson .cards ul > li::before{left:10px!important}
.nobr{white-space:nowrap}
/* D82, third pass: tables, the worked example's reveal, common mistakes as "why is it wrong?" cards */
.lesson .table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px;margin:14px 0;background:var(--card)}
.lesson .table-wrap table{width:100%;border-collapse:collapse;font-size:15px}
.lesson .table-wrap th,.lesson .table-wrap td{text-align:left;padding:9px 14px;border:0;border-bottom:1px solid var(--line);vertical-align:top}
.lesson .table-wrap tr:last-child td{border-bottom:0}
.lesson .table-wrap th{background:#E9EDF8;color:var(--navy);font-size:14px}
.lesson table.has-not td:last-child{color:var(--red)}
.lesson table.has-not td:last-child:not(:empty)::before{content:"✗ ";font-weight:800}
.lesson table.has-not td:nth-last-child(2):not(:empty)::before{content:"✓ ";color:var(--green);font-weight:800}
.lesson table.has-not th:last-child{color:var(--red)}
button.walk-next{display:block;width:100%;text-align:left;background:var(--card);color:var(--blue);border:2px dashed #AEB9DA;
  border-radius:12px;padding:10px 14px;font-weight:700}
button.walk-next:hover{border-color:var(--blue)}
.lesson.sec-common-mistakes > ul{list-style:none;padding:0;margin:14px 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;align-items:start}
.lesson.sec-common-mistakes > ul > li.mistake{margin:0;padding:0;background:var(--card);border:1px solid var(--line);border-radius:14px;
  box-shadow:0 1px 3px rgba(24,30,81,.08);max-width:none}
.lesson.sec-common-mistakes > ul > li.plain{margin:0;padding:12px 16px;background:var(--card);border:1px solid var(--line);border-radius:14px}
li.mistake summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:auto 1fr;gap:2px 12px;padding:14px 16px;align-items:start}
li.mistake summary::-webkit-details-marker{display:none}
li.mistake summary:focus-visible{outline:2px solid var(--blue);outline-offset:-2px;border-radius:14px}
li.mistake .x{grid-row:span 2;width:30px;height:30px;border-radius:50%;background:#FDE3DC;position:relative}
li.mistake .x::before{content:"✗";position:absolute;inset:0;text-align:center;line-height:30px;color:var(--red);font-weight:900;font-size:17px}
li.mistake .m-title{font-weight:800;font-size:16px;line-height:1.4}
li.mistake .m-why{color:var(--blue);font-weight:700;font-size:14px}
li.mistake .m-why::after{content:" ▾"}
li.mistake details[open] .m-why::after{content:" ▴"}
li.mistake details[open]{border-top:0}
li.mistake .m-body{padding:0 16px 14px 58px;line-height:1.7}
del.wrong{color:var(--red);text-decoration-thickness:2px}
.mistakes-all{margin:4px 0 0}
/* the red-team pass and more room for content (D83): a compact header and page, the unit's title in its side panel,
   the sheet button in the pager (never floating over controls), stacked tables on phones, one honest next action */
.mast{padding:6px 16px}.badge{width:32px;height:32px}.badge img{width:26px;height:26px}.brand{font-size:16px;gap:10px}
.nav a,.nav button.link{display:inline-flex;align-items:center;min-height:40px;padding:0 6px}
.nav button.link{min-height:32px;padding:0 10px}
@media (max-width:640px){.mast{gap:4px}.nav{width:100%;justify-content:space-between;gap:4px}.nav .who{display:none}
  .nav a{min-height:44px;padding:0 10px;font-size:15px;font-weight:600}}
.page{padding:12px 16px 32px}
h1{font-size:1.6rem;line-height:1.25;margin:.25em 0 .4em}
.card{margin:12px 0;padding:14px 18px}
progress.progress{margin:4px 0 10px}
.crumb{margin:0 0 6px}.crumb-unit{color:var(--ink);font-weight:600}
.unit-layout{grid-template-columns:240px minmax(0,1fr);gap:16px;margin-top:4px}
.unit-layout .card{margin:0 0 12px}
.side-title{font-size:18px;margin:0 0 2px}.side-meta{margin:0 0 8px}
.lesson h2{font-size:1.35rem;line-height:1.3;margin:2px 0 8px}
.step-pill{margin:0 0 4px;padding:2px 10px;font-size:12px}
.lesson > p:first-of-type{margin-top:0}
.pager{margin-top:14px}
a.button.pager-sheet{display:none}
@media (max-width:820px){a.button.pager-sheet{display:inline-block}.unit-layout{grid-template-columns:minmax(0,1fr)}}
@media (max-width:640px){.lesson .pager{gap:8px}.lesson .pager .button{padding:8px 12px}}
.pager-note{margin:8px 0 0;font-weight:600;color:#A23E1C}
/* step dots: a bigger target, read steps filled */
.dots{gap:2px}
.dot{width:12px;height:12px;border:6px solid transparent;background-clip:padding-box;box-sizing:content-box;background-color:var(--line)}
.dot.seen{background-color:var(--blue)}.dot.now{background-color:var(--orange);transform:none;width:16px;height:16px;border-width:4px}
/* tables: a card per row on a phone */
@media (max-width:560px){
  .lesson table.stack,.lesson table.stack tbody,.lesson table.stack tr,.lesson table.stack td{display:block;width:100%}
  .lesson table.stack thead{display:none}
  .lesson table.stack tr{padding:8px 12px;border-bottom:1px solid var(--line)}
  .lesson table.stack tr:last-child{border-bottom:0}
  .lesson .table-wrap table.stack td{padding:2px 0;border:0;background:none}
  .lesson table.stack td:first-child{font-weight:700;color:var(--navy)}
  .lesson table.stack:not(.has-not) td:not(:first-child)::before{content:attr(data-label) ": ";color:var(--muted);font-weight:600}
  .lesson table.stack td:empty{display:none}
}
/* wrong working, struck through even when it is math */
del.wrong{text-decoration:none;position:relative;display:inline-block}
del.wrong::after{content:"";position:absolute;left:-2px;right:-2px;top:55%;border-top:2px solid var(--red);transform:rotate(-4deg)}
/* common mistakes: one column; a mistake without a separate explanation has the same card */
.lesson.sec-common-mistakes > ul{grid-template-columns:minmax(0,1fr);max-width:760px}
.lesson.sec-common-mistakes > ul > li.plain{position:relative;padding:14px 16px 14px 58px;line-height:1.6;font-weight:600}
.lesson.sec-common-mistakes > ul > li.plain::before{content:"✗";position:absolute;left:16px;top:12px;width:30px;height:30px;
  border-radius:50%;background:#FDE3DC;color:var(--red);font-weight:900;text-align:center;line-height:30px}
/* Your turn: how to type, the keys, a clear ending */
/* a round's keys (D94): one row in the bar for the box last used; on a phone each exam problem's own row, above its
   box while the box is in use, so the problem keeps the screen while she reads */
.round-bar .keys button{min-width:36px;min-height:34px;font-size:16px;padding:2px 8px}
.round-problem .answer-col .keys{display:none}
.try .keys{margin:8px 0 0}.try .keys button{min-width:40px;min-height:40px;font-size:16px}
.ask-input input{width:14em;max-width:100%}
.try-reading{font-size:16px;color:var(--ink)}.try-reading math{font-size:1.25em}
.try-done{margin:10px 0 0;padding:10px 14px;border-radius:12px;background:#E5F6EC;border:1px solid #9FD3B5;font-weight:700;color:var(--ink)}
.ask-result a{font-weight:700}
/* buttons */
button.big,a.button.big{font-size:17px;padding:12px 22px}
button.danger{background:var(--red)}
a.button.continue{font-weight:700}
/* home and start screens */
.next-card{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:var(--ink);max-width:560px;border:2px solid var(--blue)}
.next-card .progress{margin:6px 0}
.big-go{align-self:flex-start;font-size:17px;padding:10px 20px}
.home-links{display:flex;flex-wrap:wrap;gap:8px}
.start-card{max-width:640px}.start-card h1{margin-top:2px}
.rules{list-style:none;padding:0;margin:10px 0 16px;display:flex;flex-direction:column;gap:8px}
.rules li{padding:8px 12px 8px 34px;background:#F4F6FB;border-radius:10px;position:relative}
.rules li::before{content:"";position:absolute;left:14px;top:1.05em;width:8px;height:8px;border-radius:2px;background:var(--orange);transform:rotate(45deg)}
.start-card form{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
/* practice */
.practice-layout{gap:16px}
.practice-layout .card{margin:0 0 12px}
.verdict-card.v-later{border-left-color:var(--blue)}
.give-up{margin-left:auto;align-self:center}
.solution-more summary,.route-how summary,.paper-again summary{cursor:pointer;font-weight:700;color:var(--blue)}
.practice-pager{margin-top:4px}
.route-body{margin:10px 0}
.repair-ask{font-size:17px}
/* rounds */
.timer-box{display:flex;align-items:baseline;gap:8px}.timer-label{font-size:13px;font-weight:700;color:var(--muted)}
.end-round{position:relative}
.end-round summary{cursor:pointer;font-size:14px;color:var(--red);font-weight:600;list-style:none;padding:6px 4px}
.end-round summary::-webkit-details-marker{display:none}
.end-pop{position:absolute;right:0;top:100%;z-index:6;width:min(320px,80vw);background:var(--card);border:1px solid var(--line);
  border-radius:12px;padding:12px 14px;box-shadow:0 8px 24px rgba(24,30,81,.18)}
.end-pop p{margin:0 0 10px;font-size:14px}
.round-sub{margin:4px 0 8px;font-size:14px;color:var(--muted)}
.round-page{margin:8px 0 16px}
.paper-scroll{position:relative;overflow-x:auto;border-radius:6px}
.paper-scroll .zoom-toggle{position:absolute;right:8px;top:8px}
.paper-scroll.zoomed .paper-page{max-width:none;width:200%}
#finish-btn{margin-top:10px;font-size:16px;padding:10px 18px}
.done-list{columns:auto;list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.done-list li{background:#F4F6FB;border-radius:10px;padding:6px 12px}.done-list .num{font-weight:700;margin-right:6px}
@media (max-width:760px){.round-target .answer-col{position:sticky;bottom:0;z-index:4;background:var(--card);
  border-top:1px solid var(--line);padding:8px 0 calc(8px + env(safe-area-inset-bottom,0px));box-shadow:0 -6px 16px rgba(24,30,81,.08)}}
.paper-list .button{margin-left:auto}
.paper-list a.paper-name{text-decoration:none}
.practice-layout:not(.has-feedback){grid-template-columns:minmax(0,760px)}
span.button.big-go{display:inline-block;background:var(--blue);color:#fff;border-radius:8px;font-weight:700;text-decoration:none}
.verdict-card math,.route-card math{font-size:1.25em}
.paper-list li{padding:4px 0}
/* the administrator's account reset (D84) */
a.button.small{font-size:13px;padding:4px 10px}
a.button.danger-outline{background:#fff;color:var(--red);border:1px solid var(--red)}
.confirm-card{border:2px solid var(--red)}.confirm-card .kicker{color:var(--red)}
.foot{max-width:1180px}
/* original exams in rounds (D92): the statement and its figure where a past paper shows its page */
.round-problem .problem-text{display:flex;flex-direction:column;gap:8px;background:var(--card);border:1px solid var(--line);border-radius:6px;padding:12px 14px}
.round-problem .problem-text .num{font-weight:700}
.round-problem .problem-text .fig img,.exam-review .fig img{max-width:min(100%,420px);height:auto}
.exam-review{margin:8px 0}
.exam-review summary{cursor:pointer}
.exam-review .problem-text{margin:8px 0}
.card.exam-review{color:var(--ink)}
.exam-review.v-right summary{color:var(--green)}
.exam-review:is(.v-wrong,.v-unreadable) summary{color:var(--red)}.exam-review:is(.v-form,.v-unit) summary{color:#A23E1C}
.label.pick{color:var(--green)}
.round-problem .statement table,.exam-review .statement table{border-collapse:collapse;margin:8px 0;font-variant-numeric:tabular-nums}
.round-problem .statement :is(th,td),.exam-review .statement :is(th,td){border:1px solid var(--line);padding:4px 12px;text-align:center}
.round-problem .statement :is(th,td):first-child,.exam-review .statement :is(th,td):first-child{text-align:left;background:#F4F6FB}
.round-problem .statement,.exam-review .statement{flex:none}
.round-problem{margin:6px 0}
.round-problem .problem-text{display:grid;grid-template-columns:2em minmax(0,1fr);gap:6px 4px;align-items:start}
.round-problem .problem-text .fig{grid-column:2;margin:0}
.round-problem .problem-text .statement p:first-child{margin-top:0}
@media (max-width:760px){.round-target .round-problem .answer-col{position:static;box-shadow:none}}
/* an exam round a page at a time (D92): five Sprint problems or a Target pair to a page on a wider screen, with Back,
   where she is and Next kept in view at the bottom; on a phone one problem per screen, and the page itself never
   scrolls: the bar on one line, the problem (scrolling inside itself only when it cannot fit), its answer, the buttons */
.qnav{display:none}
body.paged .round-problem:not(.is-current){display:none}
body.paged .qnav{display:block;position:sticky;bottom:0;z-index:4;background:var(--bg);padding:10px 0 12px}
@media (min-width:761px){
  .qnav-grid{left:50%;right:auto;width:min(100%,520px);transform:translateX(-50%);grid-template-columns:repeat(10,1fr)}
  body.paged .page{max-width:1100px;padding-top:8px;padding-bottom:0}
  body.paged .round-problem .statement{line-height:1.5}
  body.paged .round-problem{grid-template-columns:minmax(0,1fr) 270px;gap:12px;margin:6px 0}
  body.paged .round-problem .answer-col{position:static}
  body.paged .round-problem .problem-text{grid-template-columns:2em minmax(0,1fr) auto;padding:8px 14px}
  body.paged .round-problem .problem-text .fig{grid-column:3;grid-row:1 / span 2;margin:0}
  body.paged .round-problem .problem-text .fig img{width:auto;max-width:300px;max-height:260px}
}
.qnav-bar{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:center}
.qnav-bar .qnav-back{justify-self:start}.qnav-bar .qnav-next{justify-self:end;min-width:6.5em}
.qnav-bar button{padding:10px 16px}.qnav-bar button:disabled{opacity:.4;cursor:default}
.qnav-where{display:flex;flex-direction:column;align-items:center;line-height:1.25;background:var(--card);color:var(--ink);
  border:1px solid var(--line)}
.qnav-where span{font-weight:400;font-size:12px;color:var(--muted)}
.qnav-grid{position:absolute;left:0;right:0;bottom:100%;z-index:6;display:grid;grid-template-columns:repeat(6,1fr);gap:6px;
  background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px;box-shadow:0 -6px 24px rgba(24,30,81,.16)}
.qnav-num{background:#fff;color:var(--ink);border:1px solid var(--line);padding:8px 0;font-variant-numeric:tabular-nums}
.qnav-num.answered{background:#DCE2F3;border-color:#AEB9DA}
.qnav-num.now{outline:2px solid var(--orange);outline-offset:1px}
.qnav-legend{grid-column:1/-1;margin:2px 0 0;color:var(--muted)}
@media (max-width:760px){
  body.paged{height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
  body.paged .mast,body.paged .round-sub,body.paged .done-card{display:none}
  body.paged .page{flex:1 1 auto;min-height:0;width:100%;display:flex;flex-direction:column;padding:8px 12px 10px}
  body.paged .round-bar{position:static;margin:0 0 8px;flex-wrap:nowrap;gap:10px;padding:4px 12px}
  body.paged .round-name{flex:1 1 auto;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.paged .round-bar:has(.pairs) .round-name,body.paged .timer-label{display:none}
  body.paged .pairs{flex:1 1 auto}
  body.paged .end-round summary{padding:2px 0}
  body.paged #round-form{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
  body.paged .round-problem.is-current{display:flex;flex-direction:column;align-items:stretch;gap:10px;flex:0 1 auto;
    min-height:0;margin:0}
  body.paged .round-problem.is-current .problem-text{flex:0 1 auto;min-height:0;overflow-y:auto}
  body.paged .round-problem .answer-col{position:static;box-shadow:none;padding:0;border:0;background:none}
  body.paged .round-problem .round-answer .num{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  body.paged .round-problem .round-answer input[data-num]{flex:1 1 8em;min-width:0;max-width:14em;font-size:18px;padding:8px 10px}
  body.paged .round-problem .round-answer .preview{margin-left:0}
  body.paged .round-problem .statement{line-height:1.5}
  body.paged .round-problem.is-current:has(.fig),body.paged .round-problem.is-current:has(.fig) .problem-text{flex:1 1 auto}
  body.paged .round-problem .problem-text:has(.fig){grid-template-rows:auto minmax(110px,1fr)}
  body.paged .round-problem .problem-text .fig{align-self:stretch;min-height:0;position:relative;margin:0;cursor:zoom-in}
  body.paged .round-problem .problem-text .fig img{width:100%;height:100%;max-width:420px;object-fit:contain}
  body.paged .round-problem .fig.small::after,body.paged .round-problem .fig.zoomed::after{content:"Tap to enlarge";
    position:absolute;right:6px;bottom:6px;font-size:12px;font-weight:600;color:#fff;background:var(--navy);border-radius:999px;
    padding:1px 8px}
  body.paged .round-problem .problem-text .fig.zoomed{position:fixed;inset:0;z-index:40;background:rgba(24,30,81,.88);
    padding:16px;display:flex;align-items:center;justify-content:center;cursor:zoom-out}
  body.paged .round-problem .problem-text .fig.zoomed img{max-width:none}
  body.paged .round-problem .fig.zoomed::after{content:"Tap to close";right:auto;left:50%;bottom:28px;transform:translateX(-50%);
    font-size:14px;padding:4px 14px}
  body.paged .round-problem .problem-text{grid-template-columns:minmax(0,1fr)}
  body.paged .round-problem .problem-text > .num{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  body.paged .round-problem .problem-text .fig{grid-column:1}
  body.paged .round-problem #finish-btn{display:none}
  body.paged .round-bar .keys{display:none}
  body.paged .round-problem .answer-col:focus-within .keys{display:flex;order:-1}
  body.paged .round-problem .answer-col .keys button{min-height:40px;flex:1 1 0;min-width:0;padding:4px}
  body.paged .qnav{position:relative;margin-top:auto;padding:10px 0 0}
}
/* a short phone screen: tighter type and spacing, so the longest problems still fit */
@media (max-width:760px) and (max-height:700px){
  body.paged .page{padding:6px 10px 8px}
  body.paged .round-bar{margin-bottom:6px}
  body.paged .round-problem.is-current{gap:8px}
  body.paged .round-problem .problem-text{padding:8px 12px}
  body.paged .round-problem .statement{font-size:15px;line-height:1.45}
  body.paged .qnav{padding-top:8px}
  body.paged .qnav-bar button{padding:8px 14px}
}
