/* Lesson screen (js/views/LessonView.js): top bar (its bottom edge is the lesson's progress
   line) · outline (left) · stage (centre: heading, card, footer) · teacher panel (right).
   Values from css/tokens.css; buttons, chips, the main box, folds and toasts
   from css/components.css. Blue (--target) is ONLY for the letters being taught. */

/* the lesson owns the whole window: no header pill, no page padding */
body.in-lesson{background:var(--color-bg)}
body.in-lesson .ambient{background:var(--color-bg)}
body.in-lesson .os{padding:0}
body.in-lesson .lesson-view{margin:0;padding:0;min-height:0}

/* the view and the stage frame (the stage itself is .lv-stage.activity-card below) */
.lesson-view{display:flex;flex-direction:column;min-height:100vh;background:transparent}
.activity-card{flex:1;width:100%;background:transparent;display:flex;flex-direction:column;position:relative;text-align:center}
.activity-content{flex:1;min-height:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}

.lv{position:fixed;inset:0;z-index:var(--z-lesson);display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-ink);font-family:var(--font-body)}

/* ── top bar: one hairline along its bottom; the ink line on it fills as the lesson goes (steps done / all steps) ── */
.lv-top{position:relative;flex:none;height:var(--lv-top);display:flex;align-items:center;gap:var(--space-4);padding:0 var(--space-5);border-bottom:var(--border-hair) solid var(--color-line)}
.lv-line{display:none;position:absolute;left:0;bottom:calc(-1 * var(--border-hair));width:calc(var(--done,0) * 100%);height:var(--progress-h);background:var(--color-ink);transition:width var(--dur-panel) var(--ease-plain);pointer-events:none}
.lv-crumb{display:flex;align-items:center;gap:var(--space-3);min-width:0;font-size:var(--text-lg)}
.lv-crumb .btn{flex:none;padding:var(--crumb-pad)}
.lv-backto{display:inline-flex;align-items:center;gap:var(--space-1);min-width:0}   /* ‹ Lesson 12: back to the lessons */
.lv-backto svg{flex:none;width:var(--text-lg);height:var(--text-lg)}
.lv-sep{color:var(--color-sep)}
.lv-cur{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--color-ink)}
.lv-unit{flex:none;display:inline-flex;align-items:center;gap:var(--space-4);margin-left:var(--space-4);padding:var(--space-1) var(--space-6);border-radius:var(--radius-pill);background:var(--color-row);color:var(--color-soft);font-size:var(--text-sm);white-space:nowrap}   /* Unit 4 · 3 of 5 */
.lv-udots{display:inline-flex;gap:var(--space-2)}
.lv-udots i{width:var(--space-6);height:var(--space-2);border-radius:var(--radius-pill);background:var(--color-line)}
.lv-udots i.done{background:var(--color-pill-on-line)}
.lv-udots i.on{background:var(--color-stroke-1)}
.lv-udots i.st:not(.on):not(.done){background:var(--color-story-line)}   /* the fifth: the Story lesson */
.lv-tools{margin-left:auto;display:flex;align-items:center;gap:var(--space-1)}
.lv-lang{margin:0 var(--space-2)}

.lv-main{flex:1;min-height:0;display:flex;position:relative}

/* ── outline (left) ── */
.lo-in{width:var(--lo-w);padding:var(--space-6) var(--space-5) var(--space-8)}
/* A stage: its name and count, then its cards as pills. The stage the class is in sits in a grey, rounded container. */
.lo-stage{padding:var(--space-4) var(--space-5) var(--space-5);border-radius:var(--radius-2xl)}
.lo-stage + .lo-stage{margin-top:var(--space-2)}
.lo-stage.now{background:var(--color-row)}   /* the same grey as the teacher panel's pills */
.lo-head{display:flex;align-items:center;gap:var(--space-3);width:100%;height:var(--lo-head-h);padding:0 var(--space-2);background:none;border:0;font:inherit;text-align:left;cursor:pointer;color:var(--color-ink)}
.lo-sname{font-size:var(--text-sm);font-weight:var(--weight-semibold);letter-spacing:var(--tracking-caps);text-transform:uppercase;color:var(--color-ink)}   /* stage titles: small capitals, as in the teacher panel */
.lo-head:hover .lo-sname{text-decoration:underline;text-underline-offset:var(--underline-offset)}
.lo-head.done .lo-sname{color:var(--color-soft);font-weight:var(--weight-semibold)}
.lo-head.done .lo-sname::after{content:' ✓';font-size:var(--text-xs)}
.lo-cnt{margin-left:auto;flex:none;font-size:var(--text-sm);color:var(--color-soft);font-variant-numeric:tabular-nums}
/* The cards: pills. To come: outlined; done: a quiet grey fill; now: the soft blue pill. */
.lo-pills{display:flex;flex-wrap:wrap;gap:var(--space-2);padding:var(--space-2) 0 0 var(--space-2)}
.lo-pill{display:inline-flex;align-items:baseline;gap:var(--space-2);max-width:100%;height:var(--lo-pill-h);padding:0 var(--space-5);align-items:center;border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-pill);background:var(--color-bg);font:inherit;font-size:var(--text-md);font-weight:var(--weight-medium);color:var(--color-text);white-space:nowrap;cursor:pointer}
.lo-pill:hover{border-color:var(--color-ui)}
.lo-pill.done{background:var(--color-row);border-color:transparent;color:var(--color-soft)}
.lo-stage.now .lo-pill.done{border-color:var(--color-line)}   /* same grey as the container; a hairline keeps it visible */
.lo-pill.on{background:var(--color-pill-on);border-color:var(--color-pill-on-line);color:var(--color-pill-on-ink);font-weight:var(--weight-semibold)}
.lo-pill:focus-visible{border-radius:var(--radius-pill)}   /* the global focus ring (base.css), rounded to the pill */
/* a pill with steps inside: the pill and its ▾ joined as one */
.lo-pw{display:inline-flex;max-width:100%}
.lo-pw>.lo-pill{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:var(--space-3)}
.lo-dd{flex:none;height:var(--lo-pill-h);padding:0 var(--space-3);border:var(--border-hair) solid var(--color-line);border-left:0;border-radius:0 var(--radius-pill) var(--radius-pill) 0;background:var(--color-bg);font:inherit;font-size:var(--text-xs);color:var(--color-soft);cursor:pointer}
.lo-dd.done{background:var(--color-row);border-color:transparent}
.lo-dd.on{background:var(--color-pill-on);border-color:var(--color-pill-on-line);color:var(--color-pill-on-ink)}
.lo-pw.open .lo-dd{color:var(--color-ink)}
/* its menu: numbered steps (never the words: many cards hide their answers) */
.lo-menu{margin:var(--space-3) 0 0 var(--space-2);padding:var(--space-3);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-md);background:var(--color-bg)}
.lo-menu-k{margin-bottom:var(--space-2);font-size:var(--text-xs);color:var(--color-soft)}
.lo-steps{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.lo-step{min-width:var(--lo-pill-h);height:var(--lo-pill-h);padding:0 var(--space-2);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-md);background:var(--color-bg);font:inherit;font-size:var(--text-md);font-variant-numeric:tabular-nums;color:var(--color-text);cursor:pointer}
.lo-step.done{background:var(--color-row);border-color:transparent;color:var(--color-soft)}
.lo-step.on{background:var(--color-pill-on);border-color:var(--color-pill-on-line);color:var(--color-pill-on-ink);font-weight:var(--weight-semibold)}
.lo-kind{flex:none;font-size:var(--text-xs);font-weight:var(--weight-medium);opacity:var(--lo-kind-dim)}
.lo-txt{min-width:0;overflow:hidden;text-overflow:ellipsis}
.lo-txt .snd-tag{margin-left:var(--nudge);font-size:var(--text-2xs);font-weight:var(--weight-medium);color:var(--color-soft)}
/* Review folds to its name once the class is past it (one tap opens it). */
.lo-fold{list-style:none;cursor:pointer}
.lo-fold::-webkit-details-marker{display:none}
.lo-fold .lo-cnt::after{content:'';display:inline-block;width:var(--dot-sm);height:var(--dot-sm);margin-left:var(--space-4);border-right:var(--border-chevron) solid currentColor;border-bottom:var(--border-chevron) solid currentColor;transform:translateY(var(--chevron-lift)) rotate(45deg);transition:transform var(--dur-tap) var(--ease-plain)}
.lo-review:not([open]) .lo-fold .lo-cnt::after{transform:translateY(0) rotate(-45deg)}
.lo-fold:hover .lo-sname{text-decoration:underline;text-underline-offset:var(--underline-offset)}

/* ── stage (centre): the same on every card ──
   middle  only what the class looks at (the work), centred
   bottom  the footer: the children's instruction on the left, the step and the controls on the right
   .lv-body is the size container the card's sizes are measured against (css/cards.css):
   the stage less the footer and --stage-room, so a card is as big as before the footer. */
.lv .lv-stage{flex:1;min-width:0;position:relative;display:flex;flex-direction:column;padding:0;background:transparent;text-align:center}
.lv-card{flex:1;min-height:0;display:flex;flex-direction:column}
.lv-fitting,.lv-fitting *{transition:none!important}   /* while the card is sized (LessonView _fitStage) */
.lv-body{flex:1;min-height:0;display:flex;flex-direction:column;container-type:size;padding:0 var(--stage-side) var(--stage-room)}
/* the instruction and its helper leave the card for the footer (and so does their wrapper,
   when it held nothing else) */
.lv .k-line.lv-hl-src,.lv .k-card :has(> .lv-hl-src:only-child){display:none}

/* the footer: a hairline along its top (no box). Left: the instruction the class reads (Korean),
   its helper after it in grey; never cut short: the helper drops to a second line and the footer
   grows. Right: the step (1 / 3), ‹, ▶ and the black button. */
.lv-foot{flex:none;min-height:var(--lv-foot);display:flex;align-items:center;gap:var(--space-8);padding:var(--space-6) var(--space-10) var(--space-6) var(--space-16);border-top:var(--border-hair) solid var(--color-line);text-align:left}
.lv-say{flex:1;min-width:0;word-break:keep-all;text-wrap:balance;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:var(--space-6);row-gap:var(--space-1)}
.lv-instr{font-size:var(--text-instr);font-weight:var(--weight-semibold);line-height:var(--leading-line);letter-spacing:var(--tracking-body);color:var(--color-ink)}
.lv-hint{font-size:var(--text-5xl);font-weight:var(--weight-medium);line-height:var(--leading-line);color:var(--color-soft)}
/* the instruction in English, small, under the Korean: it wraps to a second line rather than being cut short (none under a meaning) */
.lv-en{flex-basis:100%;min-width:0;contain:inline-size;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:var(--text-instr-en);font-weight:var(--weight-regular);line-height:var(--leading-line);color:var(--color-soft)}
.lv-instr:empty,.lv-hint:empty,.lv-en:empty,.lv-num:empty{display:none}
.lv-num{flex:0 1000 auto;display:flex;min-width:0;max-width:var(--lv-num-max);overflow:hidden;margin-right:calc(var(--space-4) - var(--space-8));font-size:var(--text-xl);color:var(--color-soft);font-variant-numeric:tabular-nums;white-space:pre}   /* the card's name and its step: Hands up th · 3 / 8; it gives way before the instruction wraps */
.lv-nname{flex:0 1000 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}   /* the card's name gives way first; the step never does */
.lv-nname.lv-nsub{flex-shrink:1}   /* the step's own name (문장) gives way only after the card's name */
.lv-nname.gone{display:none}   /* too little room to read it: not shown at all (no 지난 시…) */
.lv-nstep{flex:none}
/* the instruction comes first: the controls give up the card's name before the instruction wraps */
.lv-say{flex:1 1 auto}
.lv-ctl{flex:none;display:flex;align-items:center;gap:var(--space-2)}
.lv-cardctl{display:contents}
/* A narrow stage (both side panels open on a small laptop): the instruction gets its own
   line and the buttons go under it, as on a phone, so the words never run into the buttons. */
.lv-card{container:lv-card / inline-size}
@container lv-card (max-width:560px){
  .lv-foot{flex-wrap:wrap;gap:var(--space-2) var(--space-4);padding:var(--space-6) var(--space-4) var(--space-4) var(--space-8)}
  .lv-say{flex-basis:100%}
  .lv-ctl,.lv-num:not(:empty){margin-left:auto}
  .lv-num:not(:empty)+.lv-ctl{margin-left:0}
}
.lv-again>span{display:none}   /* 처음부터 at the end of a card: just ↺ (its name is the button's label) */
.lv-again::before{content:'';width:var(--icon-lg);height:var(--icon-lg);background:currentColor;-webkit-mask:var(--img-again) center/contain no-repeat;mask:var(--img-again) center/contain no-repeat}
.lv-ctl .btn--foot:not(.btn--icon){margin-left:var(--space-4)}
.lv-ctl [id$="-prev"]:not(#cn-prev){display:none}   /* a card's own Back: ‹ presses it */
.lv-ctl .nav-exitfull{display:none}
body.lv-full .lv-ctl .nav-exitfull{display:inline-flex}

/* ── teacher panel (right): plain sections on hairlines, no boxes inside boxes ── */
.lv-teacher{flex:none;width:0;overflow:hidden;display:flex;flex-direction:column;background:var(--color-bg);border-left:var(--border-hair) solid transparent;transition:width var(--dur-panel) var(--ease-plain);text-align:left}
.lv.tp-open .lv-teacher{width:var(--tp-w);border-left-color:var(--color-line)}
.tp-in{position:relative;flex:0 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;width:var(--tp-w);padding:var(--space-10) var(--space-12) var(--space-12);display:flex;flex-direction:column;gap:var(--tp-section-gap)}
/* One column, the same order on every card: header · instruction · words · say now · notes ·
   on screen. Each part keeps its size while the card steps (the instruction has room for two
   lines, the word box for its longest word and a two-line hint, a hidden chip for its word);
   what the stage says changes every step, so it comes last. */
.tp-say-sec{padding-top:var(--tp-section-gap);border-top:var(--border-hair) solid var(--color-line)}
.tp-sec .section-label{margin-bottom:var(--space-1)}
.tp-sec[hidden]{display:none}
.tp-meaning{font-size:var(--text-3xl);font-weight:var(--weight-semibold);line-height:var(--leading-lead);color:var(--color-ink)}
/* header: the card's name, and Answers hidden (on every card, so the instruction starts at the same height) */
.tp-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);margin-bottom:calc(-1 * var(--space-6));font-size:var(--text-md);font-weight:var(--weight-medium);color:var(--color-soft)}
.tp-where{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* a note for the teacher floats over the header row instead of pushing the column down */
.tp-in>.tp-toast{order:99;margin:0}   /* a note goes under the panel's boxes: it covers none of them, and nothing above it moves */
.tp-sec{display:flex;flex-direction:column;gap:var(--space-4)}
.lv-teacher p{margin:0}
.lv-teacher .tp-do{font-size:var(--text-base);line-height:var(--leading-note);color:var(--color-text);margin-top:var(--space-4)}
/* Now: one short instruction, the biggest text in the panel */
.tp-lead-sec,.tp-yousay-sec{display:flex;flex-direction:column;gap:var(--tp-item-gap)}
/* You say: the English to say to the class, in quotes, so it never reads as an instruction to the teacher. */
.tp-yousay{min-height:calc(2em * var(--leading-lead));font-size:var(--text-lead);line-height:var(--leading-lead);font-weight:var(--weight-medium);letter-spacing:var(--tracking-lead);color:var(--color-ink)}
.tp-yousay::before{content:'“'}.tp-yousay::after{content:'”'}
.tp-yousay.tp-empty::before,.tp-yousay.tp-empty::after{content:none}
/* You say and You do sit in soft grey pills, always two lines tall (text centred) so nothing below moves as a card steps */
.tp-yousay,.tp-lead-box{background:var(--color-row);border-radius:var(--radius-2xl);padding:var(--space-5) var(--space-7)}
/* the transfer check's Good / Again: about the class, never a child */
.tp-check-sec{display:flex;flex-direction:column;gap:var(--tp-item-gap)}
.tp-check{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3)}
.tp-chk{height:var(--lo-pill-h);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-md);background:var(--color-bg);font:inherit;font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);cursor:pointer}
.tp-chk.on{background:var(--color-right-fill);border-color:var(--color-right);color:var(--color-right-ink)}
.tp-chk[data-check="again"].on{background:var(--color-pill-on);border-color:var(--color-pill-on-line);color:var(--color-pill-on-ink)}
.tp-check-note{min-height:calc(2em * var(--leading-note));margin:0;font-size:var(--text-sm);line-height:var(--leading-note);color:var(--color-soft)}   /* two lines, so a language switch moves nothing */
.tp-yousay{box-sizing:content-box}
.tp-yousay.tp-yousay,.tp-lead.tp-lead{min-height:calc(2em * var(--leading-note));display:flex;align-items:center;font-size:var(--text-base);line-height:var(--leading-note);font-weight:var(--weight-medium)}
.tp-yousay::before,.tp-yousay::after{content:none}
.tp-yousay.tp-empty{background:none}
/* the panel's section titles are small capitals */
.lv-teacher .tp-k{font-size:var(--text-sm);font-weight:var(--weight-semibold);letter-spacing:var(--tracking-caps);text-transform:uppercase}
/* The tip sits under the answer, with a line above it like the other sections. */
.tp-in>.tp-notes,.tp-in>.tp-words-sec,.tp-in>.tp-lesson-sec{padding-top:var(--tp-section-gap);border-top:var(--border-hair) solid var(--color-line)}
/* the line and its other-language copy share one place (the taller sets the height) */
.tp-lead-box,.tp-words-box,.tp-part-box{display:grid}
.tp-lead-box>*,.tp-words-box>*,.tp-part-box>*{grid-area:1/1;min-width:0}
.tp-lead-other,.tp-lead-max,.tp-words-other,.tp-part-other{visibility:hidden}
.tp-lead{min-height:calc(2em * var(--leading-lead));font-size:var(--text-lead);line-height:var(--leading-lead);font-weight:var(--weight-semibold);letter-spacing:var(--tracking-lead);color:var(--color-ink)}
.tp-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-1);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-soft)}
.tp-steps[hidden]{display:none}
.tp-steps li{display:flex}
/* each step is a button: tap one to go there (the stage has no step strip) */
.tp-step{display:flex;align-items:center;gap:var(--space-4);width:100%;padding:var(--space-1) var(--space-2);margin:0 calc(-1 * var(--space-2));border-radius:var(--radius-md);color:inherit;font:inherit;text-align:left}
.tp-step:hover{background:var(--color-hover);color:var(--color-ink)}
.tp-steps i{font-style:normal;flex:none;width:var(--step-dot);height:var(--step-dot);border-radius:var(--radius-round);display:grid;place-items:center;font-size:var(--text-xs);border:var(--border-hair) solid var(--color-line)}
.tp-steps li.done i{border-color:transparent;background:var(--color-hover)}
.tp-steps li.on{color:var(--color-ink);font-weight:var(--weight-bold)}
.tp-steps li.on i{background:var(--color-ink);border-color:var(--color-ink);color:var(--color-panel)}
/* words and say now */
.tp-words-sec,.tp-say-sec{gap:var(--tp-item-gap)}
.tp-nowrow{display:flex;align-items:center;justify-content:space-between;gap:var(--space-5);min-height:var(--row-h)}
/* notes: one line each, with an icon */
.tp-notes{display:grid}
.tp-notes-in{grid-area:1/1;min-width:0;display:flex;flex-direction:column;gap:var(--tp-item-gap)}
.tp-notes-other{visibility:hidden}
.tp-note-row,.tp-note-row.tp-sec{display:flex;flex-direction:row;align-items:flex-start;gap:var(--space-5);font-size:var(--text-base);line-height:var(--leading-note);color:var(--color-text)}
.tp-note-row>svg{flex:none;width:var(--icon-sm);height:var(--icon-sm);margin-top:var(--space-1);color:var(--color-soft)}
.tp-note-row>div{min-width:0}
/* Korean trap (English panel only): why the class makes the mistake, and each Korean form spelled out with ▶ */
.tp-trap{display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-6);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-xl);background:var(--color-panel);font-size:var(--text-base);line-height:var(--leading-note);color:var(--color-text)}
.tp-trap-why{margin:0}
.tp-trap-say{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:var(--space-2)}
.tp-trap-say li{display:flex;align-items:center;gap:var(--space-4)}
.tp-trap-play{flex:none;width:var(--icon-lg);height:var(--icon-lg);padding:0}
.tp-trap-play svg{width:var(--icon-sm);height:var(--icon-sm)}
.tp-trap-ko{flex:none;font-weight:var(--weight-semibold);color:var(--color-wrong-ink)}
.tp-trap-rom b{font-weight:var(--weight-semibold);color:var(--color-ink)}
/* the bottom row: as tall as the stage footer, so one line runs across the screen. 자세히 / More
   sits in it; opened, its text shows above the row (the column above scrolls). */
details.tp-bar{flex:1 1 0;min-height:var(--lv-foot-now,var(--lv-foot));width:var(--tp-w);display:flex;flex-direction:column-reverse;padding:0;border:0}
details.tp-bar::details-content{flex:1 1 auto;min-height:0;overflow-y:auto;border-top:var(--border-hair) solid var(--color-line)}   /* open: from under the say-now box down to the bottom row */
details.tp-bar>summary{flex:none;height:var(--lv-foot-now,var(--lv-foot));padding:0 var(--space-12);border-top:var(--border-hair) solid var(--color-line);
  font-size:var(--text-lg);font-weight:var(--weight-medium);color:var(--color-text)}
details.tp-bar>summary:hover{background:var(--color-hover)}
.tp-more{display:flex;flex-direction:column;gap:var(--tp-section-gap);padding:var(--space-10) var(--space-12) var(--space-12)}
/* More open: the whole panel scrolls as one (the boxes above, then the lesson notes), with More kept at the bottom.
   (Before, each half scrolled on its own and the lower boxes, like Words, were cut off.) */
.lv.tp-open .lv-teacher:has(details.tp-bar[open]){overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
.lv-teacher:has(details.tp-bar[open]) .tp-in{flex:none;overflow:visible}
.lv-teacher:has(details.tp-bar[open]) details.tp-bar{flex:1 0 auto;min-height:0;justify-content:space-between}   /* fills the rest of the panel: More stays at the bottom, open or closed */
.lv-teacher details.tp-bar[open]::details-content{overflow:visible}
.lv-teacher details.tp-bar[open]>summary{position:sticky;bottom:0;z-index:1;background:var(--color-bg)}
.lv-teacher details.tp-bar[open]>summary:hover{background:var(--color-hover)}
.tp-more>.tp-sec+.tp-sec{padding-top:var(--tp-section-gap);border-top:var(--border-hair) solid var(--color-line)}
/* section lines run edge to edge and meet the panel's own border */
.tp-say-sec,.tp-in>.tp-notes,.tp-in>.tp-words-sec,.tp-in>.tp-lesson-sec,.tp-more>.tp-sec+.tp-sec{margin-inline:calc(-1 * var(--space-12));padding-inline:var(--space-12)}
.tp-opts{display:flex;flex-direction:column;gap:var(--tp-item-gap)}
.tp-fold dl,.tp-lesson-sec dl{margin:0}
.tp-fold dt,.tp-lesson-sec dt{font-size:var(--text-md);font-weight:var(--weight-semibold);color:var(--color-soft)}
.tp-fold dd,.tp-lesson-sec dd{margin:var(--nudge) 0 var(--space-6);font-size:var(--text-base);line-height:var(--leading-note);color:var(--color-text)}   /* the same level as the tip */
.tp-now{font-family:var(--font-display);font-size:var(--text-say);font-weight:var(--weight-bold);line-height:var(--leading-tight);letter-spacing:var(--tracking-tight);color:var(--color-ink)}
.tp-say-one{display:flex;flex-direction:column;gap:var(--space-2)}   /* one of two sounds to say, with its word */
.tp-words{display:flex;flex-wrap:wrap;gap:var(--space-3)}
/* teacher word chips (.chip--box) */
.tp-w.no{color:var(--color-text)}
.tp-m{font-size:var(--text-sm);font-weight:var(--weight-medium)}
.tp-tag{margin-left:.45em;padding:0 .35em;border-radius:var(--radius-sm);background:var(--color-hover)}
.tp-w.yes .tp-m{color:var(--color-ink)}
.tp-w.no .tp-m{color:var(--color-soft)}
.tp-w.cur .tp-m{color:inherit}
.tp-w.cur .tp-tag{background:var(--color-on-ink-tag)}
.tp-tip{font-size:var(--text-base);line-height:var(--leading-note);color:var(--color-text)}
/* the short/full review switch (.btn--secondary.btn--block) */
.tp-review{margin-top:var(--space-7);min-height:var(--row-h);padding:var(--review-pad);border:var(--border-hair) solid var(--btn-secondary-border);border-radius:var(--btn-radius-ui);color:var(--color-text);font-size:var(--text-base)}

/* ── full screen: the stage only (its footer keeps the controls, and an exit button) ── */
body.lv-full .lv-top,body.lv-full .lv-teacher{display:none}

/* ── phones / small tablets: panels slide over the stage ── */
@media (max-width:800px){
  .lv-body{padding:0 var(--stage-side-phone) var(--stage-room-phone)}
  /* the instruction gets the whole width (it wraps, never cut short); the controls go under it */
  .lv-foot{flex-wrap:wrap;gap:var(--space-2) var(--space-4);padding:var(--space-6) var(--space-4) var(--space-4) var(--space-8)}
  .lv-say{flex-basis:100%}
  .lv-ctl{gap:0;margin-left:auto}
  .lv-num:not(:empty){margin-left:auto}
  .lv-num:not(:empty)+.lv-ctl{margin-left:0}
  .lv-ctl .btn--foot:not(.btn--icon){min-width:0;margin-left:var(--space-2);padding:0 var(--space-7)}
  /* the teacher panel stacks under the stage (which keeps the whole screen, so the card's size doesn't change) */
  .lv-main{flex-direction:column;overflow-y:auto}
  .lv .lv-stage{flex:none;height:calc(100dvh - var(--lv-top))}
  .lv:not(.tp-open) .lv-teacher{display:none}
  .lv.tp-open .lv-teacher{width:100%;border-left:0;border-top:var(--border-hair) solid var(--color-line);transition:none}
  .lv-teacher .tp-in,.lv-teacher .tp-bar{width:auto}
  .lv-teacher .tp-in{overflow:visible}
  details.tp-bar{flex:none}
}

/* The view's fade-in must not use transform here: a transformed ancestor
   would make the fixed lesson layout measure against it (zero height) for
   the first frame. Fade only. */
.view.lesson-view{transform:none}

/* A quiet note for the teacher (.toast): bottom-left of the stage, above the footer */
.lv-toast{position:absolute;left:var(--space-10);bottom:calc(var(--lv-foot) + var(--space-8));max-width:min(var(--toast-w),calc(100% - var(--space-20)))}
@media (max-width:800px){.lv-toast{left:var(--space-7);right:var(--space-7);bottom:calc(var(--lv-foot) + var(--space-4));max-width:none}}

/* Answers hidden (the class can see this screen): hold to see the word;
   the list shows ? until each word is revealed on the stage.
   The word and its sentence sit in one well (.tp-reveal); Hold to see covers it and turns
   see-through while held, so nothing moves: same box, same place, hidden or shown. */
.tp-reveal .tp-peek{display:none}
.hide-ans .tp-hides .tp-reveal{position:relative;min-height:var(--say-box-h);align-content:center;padding:var(--space-6) var(--space-7);border:var(--border-hair) dashed var(--color-ui);border-radius:var(--radius-2xl);background:transparent}
.hide-ans .tp-hides .tp-reveal .tp-peek{display:flex;position:absolute;inset:0;width:100%;height:100%;gap:var(--space-3);border-radius:inherit;background:var(--color-bg);color:var(--color-soft);font-size:var(--text-base);font-weight:var(--weight-semibold);user-select:none;-webkit-user-select:none;touch-action:none;white-space:nowrap}
.hide-ans .tp-hides .tp-peek:hover{background:var(--color-hover);color:var(--color-ink)}
.hide-ans .tp-hides .tp-peek svg{width:var(--icon-sm);height:var(--icon-sm);flex:none}
.hide-ans .tp-hides.peek .tp-peek{opacity:0}
/* Shown (held, or answers not hidden): the same well turns the grey of the You say / You do pills.
   A word sits in the middle; a sentence starts top left. */
.tp-nowbox .tp-reveal{min-height:var(--say-box-h);padding:var(--space-6) var(--space-7);border:var(--border-hair) solid transparent;border-radius:var(--radius-2xl);background:var(--color-row);align-content:center;justify-items:center;text-align:center}
.tp-nowbox .tp-reveal .tp-nowrow{justify-content:center}
.tp-nowbox.tp-long .tp-reveal{align-content:start;justify-items:start;text-align:left}
.tp-nowbox.tp-long .tp-reveal .tp-nowrow{justify-content:flex-start}
.hide-ans .tp-hides.peek .tp-reveal{background:var(--color-row);border-color:transparent}
.hide-ans .tp-hides:not(.peek) .tp-reveal>:not(.tp-peek){visibility:hidden}
.tp-wq{display:none}
.tp-wt{position:relative}
/* Hidden-answer lists: an even grid (as many per row as fit), every chip as wide as the card's
   longest revealed chip (--tp-chip-w, measured by LessonView._evenChips); where a word and its tag
   side by side would leave fewer than three a row, the tag goes under the word (.tp-stack). */
.tp-even.tp-words,.tp-even .tp-words{display:grid;grid-template-columns:repeat(auto-fill,var(--tp-chip-w));grid-auto-rows:1fr}   /* every row the same height too */
.tp-even .tp-w{width:100%;justify-content:center}
.tp-stack .tp-wt{display:inline-flex;flex-direction:column;align-items:center}
.tp-stack .tp-tag{margin-left:0;padding:0;background:none;color:var(--color-soft)}   /* under the word: a quiet label, no pill */
.tp-stack .tp-w.cur .tp-tag{background:none;color:inherit;opacity:var(--opacity-label)}
.tp-wrap .tp-tag{white-space:normal;text-wrap:balance;text-align:center}
.hide-ans .tp-secret .tp-w:not(.shown) .tp-wt{visibility:hidden}
.hide-ans .tp-secret .tp-w:not(.shown) .tp-wq{display:grid;place-items:center;position:absolute;inset:0;visibility:visible;color:var(--color-soft)}
.hide-ans .tp-secret .tp-w.cur:not(.shown) .tp-wq{color:inherit}
.tp-why{font-size:var(--text-xl);line-height:var(--leading-note);font-weight:var(--weight-regular);color:var(--color-text);margin-top:var(--space-2)}

/* Hold to see: on a mirrored TV the class sees the panel too, so the word in the well
   is modest (a presenter view, TV showing only the stage, is the full fix): the word
   first, its sentence quieter underneath. */
.tp-reveal{display:grid}
.tp-reveal>.tp-say,.tp-plan>.tp-say,.tp-nothing{grid-area:1/1;min-width:0}
.tp-plan{display:contents}
.tp-plan>.tp-say{visibility:hidden}
.tp-plan .tp-why{min-height:2lh}   /* a hint can be one line in one language and two in the other */

/* A tip that names the answer waits until the first word is revealed */
.tp-tipbox{display:grid}
.tp-tipbox>p{grid-area:1/1}
.tp-tip-wait{visibility:hidden;font-size:var(--text-md);color:var(--color-soft)}
.hide-ans .tp-tiplater:not(.shown) .tp-tip,.hide-ans .tp-notes.tp-wait{visibility:hidden}   /* a tip that names the answer waits, icon and all */
.tp-spoil-note p{margin:0;font-size:var(--text-sm);line-height:var(--leading-note)}
.tp-spoil-note .tp-spoil-why{color:var(--color-soft)}
.hide-ans .tp-tagsecret .tp-w:not(.shown) .tp-tag{visibility:hidden}   /* Talk: the sample answer waits until the card shows it */
.tp-notes,.tp-notes *{transition-property:none}   /* …and shows at once (an eased visibility can sit hidden until the next frame) */
.hide-ans .tp-tiplater:not(.shown) .tp-tip-wait{visibility:visible}

/* "On screen" in English mode: the stage's Korean with its English */
.tp-onscreen{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-4)}
.tp-onscreen li{font-size:var(--text-lg);line-height:var(--leading-relaxed);color:var(--color-ink)}
.tp-os-eq{color:var(--color-ui)}
.tp-sec[hidden]{display:none}

/* Answer chips: a label before a hidden answer (Answer ?) */
.tp-wl{font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--color-soft);margin-right:var(--space-1)}
.tp-w.cur .tp-wl{color:inherit;opacity:var(--opacity-label)}
/* A sentence or a single word: big, one per line, no box around it */
.tp-big .tp-words{flex-direction:column;align-items:flex-start;gap:var(--space-4)}
.tp-big .tp-w:first-child{padding:0;border:0;background:none;font-family:var(--font-display);font-size:var(--text-6xl);font-weight:var(--weight-bold);line-height:var(--leading-chip);letter-spacing:var(--tracking-body)}
.tp-words .tp-w:not(.cur){background:var(--color-panel)}
.tp-big .tp-w:first-child{background:none}
.tp-big .tp-w.tp-labelled{font-size:var(--text-lg)}
.tp-nowrow{min-height:0}
.tp-nowrow .tp-now{flex:1;min-width:0;overflow-wrap:anywhere}

/* Nothing to say now (the read-back): the box keeps its size and says so */
.tp-nothing{display:none;align-self:center;font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-soft)}
.tp-nowbox.tp-none .tp-nothing{display:block}
.tp-nowbox.tp-none .tp-reveal>.tp-say{visibility:hidden}
.hide-ans .tp-hides.tp-none .tp-reveal>.tp-nothing{visibility:visible}
.hide-ans .tp-hides.tp-none .tp-reveal .tp-peek{display:none}
.tp-fold .tp-do+.tp-lesson{margin-top:var(--space-7);padding-top:var(--space-6);border-top:var(--border-hair) solid var(--color-line)}

/* ── Side panels as white cards (2026-11-12) ──────────────────────────────
   Every part of the teacher panel, and every stage in the outline, is a white card with its
   name as a small pill inside it (normal case, not capitals). The teacher panel's pills are
   the soft blue; in the outline only the stage the class is in is blue (outlined in blue too),
   the rest grey, so the eye finds where the class is. */
.lo-stage{background:var(--color-panel);border:var(--border-hair) solid var(--color-line);padding:var(--space-5)}
.lo-stage + .lo-stage{margin-top:var(--space-4)}
.lo-stage.now{background:var(--color-panel);border-color:var(--color-pill-on-line);outline:var(--border-thick) solid var(--color-pill-on)}
.lo-sname{display:inline-block;padding:var(--pill-pad-y) var(--pill-pad-x);border-radius:var(--radius-pill);background:var(--color-row);color:var(--color-text);font-size:var(--text-sm);font-weight:var(--weight-semibold);letter-spacing:var(--tracking-none);text-transform:none;line-height:var(--leading-none)}
.lo-stage.now .lo-sname{background:var(--color-pill-on);color:var(--color-pill-on-ink)}
.lo-head.done .lo-sname{color:var(--color-soft)}
.lo-head:hover .lo-sname,.lo-fold:hover .lo-sname{text-decoration:none;filter:brightness(.97)}
.lo-pills{padding:var(--space-4) 0 0}
/* ── The six parts (2026-11-18): every lesson is Review · Learn · Practise · Words · Write · Read ──
   Each part is a white card: a number, its name, then its cards as pills. The part the class is in
   is outlined in blue; the next one shows in grey (to plan ahead); done parts fold to their name. */
.lo-part{background:var(--color-panel);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-2xl);padding:var(--space-4) var(--space-5)}
.lo-part + .lo-part{margin-top:var(--space-3)}
.lo-part.now{border-color:var(--color-pill-on-line);outline:var(--border-thick) solid var(--color-pill-on)}
.lo-part.next .lo-pills{opacity:var(--lo-kind-dim)}
.lo-phead{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:0;background:none;border:0;font:inherit;text-align:left;cursor:pointer;color:var(--color-ink)}
.lo-pnum{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--lo-pill-h);height:var(--lo-pill-h);border-radius:var(--radius-pill);background:var(--color-row);font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--color-soft)}
.lo-part.now .lo-pnum{background:var(--color-pill-on-ink);color:var(--color-panel)}
.lo-part.done .lo-pnum{background:var(--color-soft);color:var(--color-panel)}
.lo-pname{font-size:var(--text-base);font-weight:var(--weight-semibold)}
.lo-part.done .lo-pname{color:var(--color-soft)}
.lo-part .lo-pills{padding:var(--space-3) 0 0}
.lo-part .lo-review{margin-top:var(--space-3)}
.lo-part .lo-fold{display:flex;align-items:center;gap:var(--space-3);font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--color-text)}
.lo-pill.lo-kr,.lo-pw:has(.lo-kr) .lo-dd{border-style:dashed}   /* a card built for Korean learners */
/* the top bar: the other parts are small numbered circles (done: a tick); the part the class is in
   opens into a pill with its name, the card's name, the card's steps and 3 / 8. The thin line under
   the top bar shows the whole lesson. A part (circle or pill) opens its cards. */
.lv-parts{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-3);margin:0 var(--space-6)}
.lv-part{flex:none;display:flex;align-items:center;gap:var(--space-3);min-width:0;padding:0;background:none;border:0;border-radius:var(--radius-pill);font:inherit;font-size:var(--text-sm);text-align:left;cursor:pointer;color:var(--color-soft)}
.lv-pnum{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--part-dot);height:var(--part-dot);border:var(--border-hair) solid var(--color-ui);border-radius:var(--radius-pill);font-size:var(--text-xs);font-variant-numeric:tabular-nums;color:var(--color-soft)}
.lv-part.done .lv-pnum{border-color:transparent;background:var(--color-row)}
.lv-pnum svg{width:64%;height:64%}
.lv-part:not(.now):hover .lv-pnum,.lv-part:not(.now).open .lv-pnum{border-color:var(--color-ink);color:var(--color-ink)}
.lv-part.now{flex:1;height:var(--part-pill-h);padding:0 var(--space-6) 0 var(--space-2);background:var(--color-pill-on);color:var(--color-pill-on-ink)}
.lv-part.now:hover,.lv-part.now.open{outline:var(--border-hair) solid var(--color-pill-on-line)}
.lv-part.now .lv-pnum{border:0;background:var(--color-pill-on-ink);color:var(--color-pill-on);font-weight:var(--weight-semibold)}
.lv-pname{flex:none;font-weight:var(--weight-semibold);white-space:nowrap}
.lv-pcard{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lv-pcard:not(:empty)::before{content:'· '}
.lv-pcard.has-no::before{content:none}   /* the card's number takes the dot's place */
.lv-cno{display:inline-block;margin-right:.4em;padding:0 .4em;border-radius:var(--radius-sm);background:var(--color-ink);color:var(--color-panel);font-weight:var(--weight-semibold);font-variant-numeric:tabular-nums}   /* the card's number, as the book prints it: a small black badge */
.tp-book{display:flex;align-items:center;gap:var(--space-2);margin:0 0 var(--space-4);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);background:var(--color-row);font-size:var(--text-2xl);color:var(--color-ink)}
.tp-book svg{width:1.2em;height:1.2em;flex:none;color:var(--color-soft)}
.tp-book-other{margin-left:auto;color:var(--color-soft)}
.lv-parts.tight .lv-pcard::before{content:none}   /* no part's name before it: no dot either */
.lv-pcard:empty{display:none}
.lv-pcsub{opacity:var(--lo-kind-dim)}
.lv-pseg{flex:none;display:flex;gap:var(--space-1);margin-left:auto}
.lv-pseg i{width:var(--part-seg-w);height:var(--space-2);border-radius:var(--radius-pill);background:var(--color-pill-on-line)}
.lv-pseg i.f{background:var(--color-pill-on-ink)}
.lv-pseg:empty{display:none}
.lv-pstep{flex:none;font-weight:var(--weight-semibold);font-variant-numeric:tabular-nums}
.lv-pseg:empty + .lv-pstep{margin-left:auto}
.lv-pstep:empty{display:none}
.lv-parts.tight .lv-pname,.lv-parts.tight .lv-pseg{display:none}   /* a narrow screen: the card's name and its step stay; the part's name and the step marks go first */
.lv-all{flex:none;align-self:center;display:inline-flex;align-items:center;gap:var(--space-1);height:auto;margin:0 0 0 calc(-1 * var(--space-4));padding:0;background:none;font-size:var(--text-xs);color:var(--color-soft)}
.lv-all svg{width:var(--text-md);height:var(--text-md)}
.lv-all:hover,.lv-all.open{background:none;color:var(--color-ink)}
.lv-dd{position:absolute;top:calc(100% + var(--space-2));z-index:var(--z-overlay-panel);width:min(var(--dd-w), calc(100vw - 2 * var(--space-5)));max-height:calc(100dvh - var(--lv-top) - var(--space-16));overflow-y:auto;padding:var(--space-2);background:var(--color-panel);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-2xl);box-shadow:var(--shadow-pop)}
.lv-dd[hidden]{display:none}
.lv-dd .lo-in{width:auto;padding:0}
.dd-cap,.dd-grp{display:flex;justify-content:space-between;padding:var(--space-3) var(--space-4) var(--space-1);font-size:var(--text-xs);color:var(--color-soft)}
.dd-capname{font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--color-ink)}   /* which part this list is: 3 Practise */
.dd-cap.now .dd-capname{color:var(--color-pill-on-ink)}
.dd-cap{align-items:baseline}
.dd-grp + .dd-row,.dd-cap + .dd-row{margin-top:var(--space-1)}
.dd-grp:not(:first-child){margin-top:var(--space-3)}
.dd-gname{display:inline-flex;align-items:center;gap:var(--space-2);padding:0;background:none;border:0;font:inherit;font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-ink);cursor:pointer}
.dd-capname{display:inline-flex;align-items:center;gap:var(--space-2)}
.dd-pi{display:inline-flex;width:var(--text-md);height:var(--text-md);color:var(--color-pill-on-ink)}   /* the part's icon (as in the top bar) */
.dd-pi svg{width:100%;height:100%}
.dd-today{margin-bottom:var(--space-1)}   /* Today: its own row, above the parts */
.dd-snd{margin:var(--space-2) 0 0 var(--dd-indent);padding:0 var(--space-4);font-size:var(--text-xs);font-weight:var(--weight-semibold);color:var(--color-pill-on-ink)}   /* Learn: one new sound's heading over its cards */
.dd-in{padding-left:var(--dd-indent)}
.dd-gname:hover{color:var(--color-ink);text-decoration:underline;text-underline-offset:var(--underline-offset)}
.dd-grp.now .dd-gname{color:var(--color-pill-on-ink);font-weight:var(--weight-semibold)}
.dd-row{display:flex;align-items:center;gap:var(--space-2);border-radius:var(--radius-md);color:var(--color-text)}
.dd-row:hover{background:var(--color-row)}
.dd-row.done{color:var(--color-soft)}
.dd-row.on{background:var(--color-pill-on);color:var(--color-pill-on-ink)}
.dd-go{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-4);padding:var(--space-3) var(--space-4);background:none;border:0;font:inherit;font-size:var(--text-md);color:inherit;text-align:left;cursor:pointer}
.dd-st{flex:none;width:var(--space-8);height:var(--space-8);color:var(--color-ui)}
.dd-st-fill{fill:var(--color-row)}
.dd-row.done .dd-st{color:var(--color-soft)}
.dd-row.on .dd-st{color:var(--color-pill-on-ink)}
.dd-nm{flex:1;min-width:0;display:flex;align-items:baseline;gap:var(--space-3);white-space:nowrap;overflow:hidden}
.dd-nm .lo-kind{font-size:inherit;font-weight:var(--weight-medium);opacity:1}
.dd-nm .lo-kind + .lo-txt{font-size:var(--text-sm);color:var(--color-soft)}
.dd-row.on .dd-nm .lo-kind + .lo-txt{color:var(--color-pill-on-ink)}
.dd-kr{flex:none;align-self:center;padding:0 var(--space-2);border:0;border-radius:var(--radius-pill);background:var(--tag-fill);font-size:var(--text-2xs);color:var(--color-soft)}   /* a card built for Korean learners: the app's small tag */
.dd-row.on .dd-kr{color:var(--color-pill-on-ink)}
.dd-sc{flex:none;display:inline-flex;align-items:center;gap:var(--space-1);margin-right:var(--space-2);padding:var(--space-1) var(--space-2);background:none;border:0;border-radius:var(--radius-sm);font:inherit;font-size:var(--text-xs);font-variant-numeric:tabular-nums;color:var(--color-soft);cursor:pointer}
.dd-sc:hover,.dd-sc.open{background:var(--color-panel);color:var(--color-ink)}
.dd-row.on .dd-sc{color:var(--color-pill-on-ink)}
.dd-chev{font-size:var(--text-2xs)}
.lv-dd .dd-steps{margin:0;padding:var(--space-1) var(--space-4) var(--space-3) calc(var(--space-4) + var(--space-8) + var(--space-4));border:0;background:none}
.dd-fold{list-style:none;cursor:pointer}
.dd-fold::-webkit-details-marker{display:none}
.dd-rev[open] .dd-chev{display:inline-block;transform:rotate(180deg)}
.dd-rev .lo-pills{padding:var(--space-2) var(--space-4) var(--space-3) calc(var(--space-4) + var(--space-8) + var(--space-4))}
.tp-in>.tp-part-sec{display:flex;flex-direction:column;gap:var(--space-3);margin-inline:0;padding:var(--space-6);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-2xl);background:var(--color-panel)}
.tp-part{margin:0;font-size:var(--text-base);line-height:var(--leading-note);color:var(--color-text)}
.tp-part b{font-weight:var(--weight-semibold);color:var(--color-ink)}
.tp-pnote{display:block;margin-top:var(--space-3)}   /* a card's own note, on its own line under the part's goal */

.lv-teacher .tp-k{align-self:flex-start;display:inline-block;margin:0;padding:var(--pill-pad-y) var(--pill-pad-x);border-radius:var(--radius-pill);background:var(--color-pill-on);color:var(--color-pill-on-ink);font-size:var(--text-sm);font-weight:var(--weight-semibold);letter-spacing:var(--tracking-none);text-transform:none;line-height:var(--leading-none)}
.tp-in{gap:var(--space-5)}
.tp-in>.tp-yousay-sec,.tp-in>.tp-lead-sec,.tp-in>.tp-say-sec,.tp-in>.tp-notes,.tp-in>.tp-words-sec,.tp-in>.tp-trap-sec,.tp-in>.tp-check-sec,.tp-more>.tp-sec,.tp-more>.tp-sec+.tp-sec{display:flex;flex-direction:column;gap:var(--space-4);margin-inline:0;padding:var(--space-6);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-2xl);background:var(--color-panel)}
.tp-in>.tp-yousay-sec[hidden]{display:none}
.tp-more{gap:var(--space-5)}
.tp-yousay,.tp-lead-box{background:none;padding:0;border-radius:0}
.tp-nowbox .tp-reveal{background:none;padding:var(--space-2) 0}
.tp-notes-box{display:grid}
.tp-notes .tp-note-row>svg{display:none}   /* the Tip pill says what it is */
.tp-trap{padding:0;border:0;background:none}

/* The lesson-done screen: a quiet card over the stage (Finish, or two presses on the last card). */
.lv-done{position:absolute;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;background:var(--color-scrim-soft)}
.lv-done-in{display:flex;flex-direction:column;align-items:center;gap:var(--space-10);padding:var(--space-20) var(--space-22);border-radius:var(--radius-2xl);background:var(--color-panel);text-align:center}
.lv-done-k{width:var(--space-22);height:var(--space-22);display:grid;place-items:center;border-radius:var(--radius-round);background:var(--color-right-fill);color:var(--color-right-ink);font-size:var(--text-4xl);font-weight:var(--weight-semibold)}
.lv-done h2{margin:0;font-size:var(--text-4xl);font-weight:var(--weight-semibold);color:var(--color-ink)}
.lv-done-btns{display:flex;gap:var(--space-6)}
/* Next will play a sound first: a small ▶ before the black button's label */
.lv-foot .lv-willplay:not(.btn--icon){position:relative}
.lv-foot .lv-willplay:not(.btn--icon)::before{content:"▶";position:absolute;left:var(--space-5);top:50%;transform:translateY(-50%);font-size:var(--text-2xs);line-height:var(--leading-none)}   /* in the button's padding: the label never moves */
/* the word or letter Next is saying right now (a list the class follows along); a plain letter
   (no corners of its own) gets rounded ones, so the ring is never a sharp box */
.lv .activity-content .lv-saying.lv-saying-r{border-radius:var(--radius-saying)}
.lv .activity-content .lv-saying{outline:var(--border-md) solid var(--color-ink);outline-offset:var(--space-2);transition:outline-color var(--dur-color) var(--ease-plain)}
/* the pointer hides when the mouse has not moved for a moment (LessonView) */
body.lv-idle .lv,body.lv-idle .lv *{cursor:none}
/* a control the teacher clicked keeps the focus, but shows no ring when the clicker is pressed next (only Tab shows it) */
.lv .lv-ptr:focus-visible{outline:none;box-shadow:none}

/* ── teacher panel, plain: while teaching it shows only what to do (numbered, big) and the answer;
   this part, the tip, the Korean trap and the lesson's rule wait under More. No boxes, no coloured labels. ── */
.tp-in{gap:var(--space-12)}
.lv-teacher .tp-in .tp-k{align-self:auto;display:block;margin:0 0 var(--space-3);padding:0;border-radius:0;background:none;color:var(--color-soft);font-size:var(--text-sm);font-weight:var(--weight-medium);letter-spacing:var(--tracking-none);text-transform:none}
.tp-in>.tp-lead-sec,.tp-in>.tp-say-sec,.tp-in>.tp-words-sec,.tp-in>.tp-check-sec{gap:0;padding:0;border:0;border-radius:0;background:none}
.tp-in .tp-lead-box{padding:0;background:none}
.tp-lead.tp-lead{min-height:0;display:block;font-size:var(--text-lead);line-height:var(--leading-snug);font-weight:var(--weight-medium);color:var(--color-ink)}
.tp-dosteps{display:flex;flex-direction:column;gap:var(--space-5);margin:0;padding:0;list-style:none}
.tp-dosteps li{display:flex;align-items:baseline;gap:var(--space-4)}
.tp-dosteps i{flex:none;align-self:flex-start;display:inline-flex;align-items:center;justify-content:center;width:var(--part-dot);height:var(--part-dot);margin-top:var(--nudge);border-radius:var(--radius-pill);background:var(--color-row);font-style:normal;font-size:var(--text-xs);font-weight:var(--weight-semibold);color:var(--color-soft)}
.lv-teacher .tp-in>.tp-lead-sec .tp-k{align-self:flex-start;display:inline-block;margin-bottom:var(--space-4);padding:var(--pill-pad-y) var(--pill-pad-x);border-radius:var(--radius-pill);background:var(--color-pill-on);color:var(--color-pill-on-ink);font-weight:var(--weight-semibold)}   /* Teacher: the one label that stands out */
/* a step or card change cross-fades (LessonView _smooth): what stays the same stays still */
::view-transition-old(root),::view-transition-new(root){animation-duration:var(--dur-reveal);animation-timing-function:var(--ease-plain)}

/* A card's key for the teacher (heart words): what it is, each part in plain speech, the words to say */
.tp-key{display:flex;flex-direction:column;gap:var(--space-3);font-size:var(--text-xl);line-height:var(--leading-note);color:var(--color-text)}
.tp-kwhat{margin:0;color:var(--color-soft)}
.tp-krow{display:flex;align-items:center;gap:var(--space-5)}
.tp-kb{flex:none;display:grid;place-items:center;min-width:1.9em;height:2.1em;padding:0 .3em;border:var(--border-md) solid transparent;border-radius:var(--radius-md);background:var(--tile-fill);font-family:var(--font-display);font-weight:var(--weight-bold);color:var(--color-ink)}
.tp-kb-perm{background:var(--color-heart-fill);border-color:var(--color-heart)}
.tp-kb-temp{background:var(--color-panel);border-color:var(--color-heart-later-line);border-style:dashed}
.tp-ksay{margin:var(--space-2) 0 0;color:var(--color-ink)}
.tp-key-off{visibility:hidden}

/* Say now and the Key: the panel's two cards, white with a heading under a line (🎤 Say now, 🔑 Key) */
.lv-teacher .tp-in>.tp-say-sec,.lv-teacher .tp-in>.tp-key-sec{margin-inline:0;padding:0;gap:0;background:var(--color-panel);border:var(--border-md) solid var(--color-line);border-radius:var(--radius-xl);overflow:hidden}
.lv-teacher .tp-in>.tp-say-sec>.tp-k,.lv-teacher .tp-in>.tp-key-sec>.tp-k{display:flex;align-items:center;gap:var(--space-3);margin:0;padding:var(--space-4) var(--space-6);border-bottom:var(--border-md) solid var(--color-line);border-radius:0;background:none}
.lv-teacher .tp-in>.tp-say-sec>.tp-k svg,.lv-teacher .tp-in>.tp-key-sec>.tp-k svg{flex:none;width:1.15em;height:1.15em}
.lv-teacher .tp-in>.tp-say-sec .tp-reveal{padding:var(--space-6)}
.lv-teacher .tp-in>.tp-say-sec>:not(.tp-k):not(.tp-reveal){padding-inline:var(--space-6)}
.lv-teacher .tp-in>.tp-say-sec>.tp-k+:not(.tp-reveal){padding-top:var(--space-5)}   /* a sound card's Say now (“a” · as in at): room above the sound and under its line, like the other boxes */
.lv-teacher .tp-in>.tp-say-sec>:not(.tp-k):not(.tp-reveal):last-child{padding-bottom:var(--space-6)}
.lv-teacher .tp-in>.tp-key-sec .tp-key{padding:var(--space-6)}

/* ── The footer runs across the whole screen, under the stage and the teacher panel ──
   Open or closed, the panel never changes the footer: the instruction is always at the far left,
   the controls always at the far right. The stage and the card become the grid's own cells
   (display:contents), so the card's DOM and its listeners don't move. */
@media (min-width:801px){
  .lv-main{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) auto;container:lv-card / inline-size}
  .lv .lv-stage,.lv-main .lv-card{display:contents}
  .lv-main .lv-body{grid-column:1;grid-row:1;min-width:0}
  .lv-main .lv-teacher{grid-column:2;grid-row:1;min-height:0}
  .lv-main .lv-foot{grid-column:1 / -1;grid-row:2}
}
/* The panel ends above the footer. More is the panel's own footer: always at the bottom, a line across
   the whole panel above it; opened, its text shows above it and the panel scrolls as one (More stays put). */
.lv.tp-open .lv-teacher{overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
.lv-teacher .tp-in{flex:none;overflow:visible}
.lv-teacher details.tp-bar,.lv-teacher:has(details.tp-bar[open]) details.tp-bar{flex:none;margin-top:auto;min-height:0;flex-direction:column-reverse;justify-content:flex-start}
.lv-teacher details.tp-bar::details-content{flex:none;overflow:visible;border-top:0}
.lv-teacher details.tp-bar>summary,.lv-teacher details.tp-bar[open]>summary{position:sticky;bottom:0;z-index:1;height:auto;margin:0;padding:var(--space-6) var(--space-12);border-top:var(--border-hair) solid var(--color-line);background:var(--color-bg)}
.lv-teacher details.tp-bar>summary:hover{background:var(--color-hover)}

.lv-teacher .tp-in>.tp-say-sec.tp-hides.peek .tp-reveal{background:none}   /* held: the word on the card's white, no grey */
.lv-teacher .tp-in>.tp-say-sec.tp-hides .tp-reveal{border:0;border-radius:0}   /* hidden: Hold to see on the card itself, no box inside the box */

/* The meaning pill: the footer's first thing, before the instruction. A word: its Korean big, the
   English word small under it (가방 / bag); tap it to hear the word. A sentence: its Korean only
   (the English is on the stage), a little smaller so a long one fits. */
.lv-mean{flex:0 1 auto;min-width:0;max-width:45%;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:0;margin:0;padding:var(--space-3) var(--space-12);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-pill);background:var(--tag-fill);color:var(--color-ink);font:inherit;line-height:var(--leading-tight);text-align:center;cursor:pointer}
.lv-mean[hidden]{display:none}
.lv-mean-k{font-size:calc(var(--text-instr) * .85);font-weight:var(--weight-semibold);word-break:keep-all}
.lv-mean-e{font-size:var(--text-instr-en);color:var(--color-soft)}
.lv-mean-e[hidden]{display:none}
.lv-mean.lv-mean-long{align-items:flex-start;text-align:left;border-radius:var(--radius-2xl);cursor:default}
.lv-mean.lv-mean-long .lv-mean-k{font-size:calc(var(--text-instr) * .6)}
/* the Writing card's Key: this letter's strokes (badge + cue), the start dot; in the book, where letters live */
.wl-kn{display:inline-grid;place-items:center;flex:none;width:1.5em;height:1.5em;border-radius:50%;background:var(--color-stroke-1);color:var(--color-panel);font-size:var(--text-sm);font-weight:var(--weight-bold)}
.wl-kn.wl-c1{background:var(--color-stroke-2)}
.wl-kn.wl-c2{background:var(--color-stroke-3)}
.wl-kn.wl-c3{background:var(--color-stroke-4)}
.wl-kdot{flex:none;width:.95em;height:.95em;margin:0 .275em;border-radius:50%;background:var(--color-wl-start)}
.wl-where{margin-top:var(--space-4);padding:var(--space-4) var(--space-5);border:var(--border-hair) solid var(--color-line);border-radius:var(--radius-lg);background:var(--color-bg)}
.wl-where-h{margin:0 0 var(--space-2);font-weight:var(--weight-semibold);color:var(--color-ink)}
.wl-kband{flex:none;width:1.6em;height:1.1em;border:1px solid color-mix(in srgb,var(--color-ink) 22%,transparent);border-radius:var(--radius-sm)}
.wl-kb-sky{background:var(--color-wl-sky)}
.wl-kb-grass{background:var(--color-wl-grass)}
.wl-kb-ground{background:var(--color-wl-ground)}
/* A tip or rule that names the answers (the silent letters) hides with them; a short note says why.
   (after the panel's card styles, which set every More section to flex) */
.lv .tp-more>.tp-sec.tp-spoil-note{display:none}
.lv.hide-ans .tp-more>.tp-sec.tp-spoil{display:none}
.lv.hide-ans .tp-more>.tp-sec.tp-spoil-note{display:flex;gap:var(--space-2)}
