/* Online lesson player (lessons/player.js). Sized for an 11.6" school Chromebook (1366x768) first, then phones. */
:root { --g: #006a45; --g2: #25845b; --gl: #e7f3ed; --gb: #b6e2c8; --ink: #1b1c1c; --mut: #5d6860; --line: #e2e8f0; --bg: #fbf9f8; --red: #c0392b; --redl: #fdecea; --sun: #e5a220;
  --disp: 'Plus Jakarta Sans', system-ui, sans-serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.5; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--disp); line-height: 1.2; }

.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 15px; }
.brand { font-family: var(--disp); font-weight: 800; color: var(--g); text-decoration: none; }
.top-sep { color: var(--mut); }
.top-in .back { margin-left: auto; color: var(--g); font-weight: 700; text-decoration: none; white-space: nowrap; }
.top-in .back:hover { text-decoration: underline; }
a.tool { text-decoration: none; }
.part { max-width: 1240px; margin: 0 auto; padding: 16px 20px 60px; }
.part-sub { color: var(--mut); margin: 0 0 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--g); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 10px; cursor: pointer; text-decoration: none; font-size: 16px; }
.btn:hover { background: #00583a; }
.btn.small { padding: 7px 13px; font-size: 14.5px; }
.btn.big { padding: 14px 34px; font-size: 19px; }
.btn.ghost { background: #fff; color: var(--g); box-shadow: inset 0 0 0 2px var(--gb); }
.btn.ghost:hover { background: var(--gl); }
.btn:focus-visible, .chip:focus-visible, .opt:focus-visible, .pslot:focus-visible, .slot:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ── word bank: tap a word, then its spot ── */
.bank { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.bank-hint { font-size: 13.5px; font-weight: 600; color: var(--mut); margin-bottom: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--gb); background: var(--gl); color: #0b4d33; font-weight: 700; padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 16px; touch-action: manipulation; }
.chip.on { background: var(--g); border-color: var(--g); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,106,69,.25); }
.chip:disabled { opacity: .28; cursor: default; text-decoration: line-through; }
.chip.still { cursor: default; }
.bank.nudge { animation: nudge .5s; }
@keyframes nudge { 0%,100% { transform: none; } 30% { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--sun); } }
.bad { animation: shake .45s; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
g.slot.bad { animation: none; }
g.slot.bad rect { fill: var(--redl); stroke: var(--red); }

/* ── diagrams ── */
.dia { width: 100%; height: auto; display: block; font-family: var(--sans); }
.dia-name { font-size: 4.6px; font-weight: 700; fill: var(--g); paint-order: stroke; stroke: #fff; stroke-width: 1.2px; }
.dia-name.grey { fill: #7c867f; }
.dia-num { font-size: 5.2px; font-weight: 800; fill: #fff; }
.slot { cursor: pointer; }
.slot rect { fill: #fff; stroke: #9aa59d; stroke-width: .5; stroke-dasharray: 1.6 1.1; }
.slot:hover rect { stroke: var(--g); fill: var(--gl); }
.slot-text { font-size: 4.2px; font-weight: 700; fill: #0b4d33; }
.slot.filled rect { fill: var(--gl); stroke: var(--g); stroke-dasharray: none; }
.slot.right rect { fill: var(--gl); stroke: var(--g); stroke-width: .9; }
.slot.wrongfill rect { fill: var(--redl); stroke: var(--red); stroke-width: .9; stroke-dasharray: none; }
.slot.wrongfill .slot-text { fill: var(--red); }
.scene { width: 100%; height: auto; display: block; border-radius: 12px; font-family: var(--sans); }
.scene-name { font-size: 30px; font-weight: 700; fill: var(--g); }
.scene-num { font-size: 38px; font-weight: 800; fill: #fff; }

.label-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.label-pic { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; max-height: calc(100vh - 150px); display: flex; justify-content: center; }
.label-pic .dia { max-height: calc(100vh - 175px); width: auto; max-width: 100%; }
.label-wrap .bank { position: sticky; top: 12px; }

/* ── questions ── */
.qs { display: flex; flex-direction: column; gap: 14px; }
.q { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.q.ok { border-color: var(--gb); box-shadow: inset 4px 0 0 var(--g); }
.q-text { font-weight: 600; margin-bottom: 10px; }
.q-n { color: var(--g); font-weight: 800; }
.opts { display: grid; gap: 7px; }
.opt { text-align: left; display: flex; gap: 10px; align-items: center; border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer; touch-action: manipulation; }
.opt:hover:not(:disabled) { border-color: var(--gb); background: #f6fbf8; }
.opt-l { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #eef1ef; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.opt.right { border-color: var(--g); background: var(--gl); }
.opt.right .opt-l { background: var(--g); color: #fff; }
.opt.wrong { border-color: #f1b3ab; background: var(--redl); color: #8e2a1f; }
.opt.picked { border-color: var(--g); background: #f6fbf8; }
.opt.picked .opt-l { background: var(--g); color: #fff; }
.marked .opt.picked:not(.right) { border-color: #f1b3ab; }
textarea { width: 100%; font: inherit; border: 2px solid var(--line); border-radius: 10px; padding: 9px 11px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--g2); }
.q-btns { margin-top: 8px; }
.sample { margin-top: 8px; }
.sample:not(:empty) { background: var(--gl); border-radius: 10px; padding: 10px 12px; }
.sample-h { font-weight: 700; color: var(--g); font-size: 14px; }
.sample-ask { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 600; }
.steps { display: grid; gap: 7px; }
.step { text-align: left; display: flex; gap: 10px; align-items: center; border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px dashed #b8c2bb; display: grid; place-items: center; font-weight: 800; color: #fff; }
.step[data-n] .step-n { background: var(--g); border: 0; }
.q.ok .step { border-color: var(--gb); }

/* ── read: passage and questions side by side, each scrolls on its own ── */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.pane { height: calc(100vh - 96px); overflow: auto; padding-right: 4px; }
.passage { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.passage h2 { margin-top: 0; color: var(--g); }
.passage p { margin: 0 0 12px; }
.passage b { color: #0b4d33; }
.passage figure { margin: 4px 0 14px; }
.passage img { width: 100%; height: auto; border-radius: 10px; display: block; }
.passage figcaption { font-size: 14px; color: var(--mut); margin-top: 5px; }
.pane-h { margin: 0 0 10px; font-size: 20px; }

/* ── practice ── */
.practice { display: flex; flex-direction: column; gap: 28px; }
.psec h2 { margin: 0 0 4px; color: var(--g); }
.psec h3 { margin: 22px 0 10px; }
.sticky-bank { position: sticky; top: 0; z-index: 2; padding: 6px 0; background: var(--bg); }
.prows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.prow { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.pclue { flex: 1; }
.pslot { flex: none; width: 190px; min-height: 40px; border: 2px dashed #b8c2bb; border-radius: 10px; background: #fff; font-weight: 700; color: #0b4d33; cursor: pointer; }
.pslot:hover { border-color: var(--g); background: var(--gl); }
.pslot.filled { border: 2px solid var(--g); background: var(--gl); cursor: default; }
.pslot.bad { border-color: var(--red); background: var(--redl); }
.group { flex: none; width: 92px; text-align: center; font-size: 13px; font-weight: 800; text-transform: uppercase; padding: 4px 0; border-radius: 6px; }
.group.in { background: #e8f0fb; color: #1e40af; }
.group.out { background: #fef3e2; color: #92400e; }

/* ── crossword ── */
.xwrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.xleft { position: sticky; top: 10px; }
.xbar { background: var(--g); color: #fff; font-weight: 600; border-radius: 10px; padding: 9px 13px; margin-bottom: 10px; min-height: 44px; }
.xw { display: grid; gap: 0; width: 100%; max-height: calc(100vh - 240px); max-width: calc((100vh - 240px) * 1.5); }
.xc { position: relative; background: #fff; outline: 1px solid var(--ink); }
.xc input { width: 100%; height: 100%; border: 0; background: transparent; text-align: center; font: 700 clamp(12px, 2.2vw, 22px) var(--sans); text-transform: uppercase; color: var(--ink); padding: 0; caret-color: transparent; }
.xc input:focus { outline: none; background: #ffe9a8; }
.xc.word { background: #fff7d6; }
.xc.wrong input { color: var(--red); background: var(--redl); }
.xn { position: absolute; left: 2px; top: 0; font-size: clamp(7px, .8vw, 10px); font-weight: 700; color: var(--mut); pointer-events: none; }
.xtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.xmsg { font-weight: 600; color: var(--mut); }
.xbank { margin-top: 10px; }
.xclues { max-height: calc(100vh - 90px); overflow: auto; }
.xl h3 { margin: 4px 0 6px; color: var(--g); }
.xclue { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 15.5px; }
.xclue:hover { background: #f1f4f2; }
.xclue.on { background: #fff7d6; }
.xclue b { color: var(--g); margin-right: 3px; }

/* ── quiz ── */
.quiz { display: flex; flex-direction: column; gap: 26px; }
.quiz .label-wrap { margin-top: 8px; }
.hand { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ── end card ── */
.card-wrap { max-width: 560px; margin: 30px auto 60px; padding: 0 16px; }
.card { background: #fff; border: 2px solid var(--g); border-radius: 18px; padding: 20px 22px; box-shadow: 0 10px 30px rgba(0,60,40,.12); }
.card-top { display: flex; gap: 12px; align-items: center; }
.card-check { width: 44px; height: 44px; border-radius: 50%; background: var(--g); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 800; flex: none; }
.card-kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--g); }
.card-title { font-family: var(--disp); font-weight: 800; font-size: 20px; }
.card-name { width: 100%; margin: 14px 0 4px; font: 700 20px var(--sans); border: 0; border-bottom: 2px solid var(--gb); padding: 6px 2px; }
.card-name:focus { outline: none; border-color: var(--g); }
.card-when { color: var(--mut); font-size: 14px; }
.card-lines { margin: 12px 0; padding-left: 20px; }
.card-written { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 15px; }
.card-written p { margin: 6px 0; }
.card-sub { font-weight: 800; font-size: 13px; text-transform: uppercase; color: var(--mut); }
.card-how { background: var(--gl); border-radius: 10px; padding: 9px 12px; font-size: 14.5px; margin-top: 12px; }
.card-btns { margin-top: 12px; }
.card-again { margin-top: 12px; }

/* ── slides ── */
body.student .deck, .deck { height: 100vh; display: flex; flex-direction: column; background: #10261c; }
.stage { flex: 1; min-height: 0; margin: 14px auto 0; width: min(calc(100vw - 28px), calc((100vh - 80px) * 16 / 9)); aspect-ratio: 16 / 9; max-height: calc(100vh - 80px);
  background: #fff; border-radius: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 3%; padding: 3.2% 3.6%; overflow: hidden; font-size: clamp(14px, 1.75vw, 30px); }
.deck.teacher .stage { width: min(calc(100vw - 28px), calc((100vh - 190px) * 16 / 9)); max-height: calc(100vh - 190px); }
.stage.tall { grid-template-columns: 1.25fr 1fr; }
.stage.no-pic { grid-template-columns: 1fr; }
.stage.pic-only { grid-template-columns: 1fr; }
.stage.pic-only .sl-text h1 { margin-bottom: .2em; }
.sl-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.sl-tag { font-size: .62em; font-weight: 800; text-transform: uppercase; color: var(--g2); letter-spacing: .02em; }
.sl-text h1 { font-size: 1.6em; margin: .15em 0 .5em; color: var(--ink); }
.sl-text ul, .sl-text ol { margin: 0; padding-left: 1.1em; }
.sl-text li { margin-bottom: .5em; }
.sl-text b { color: var(--g); }
.sl-sub { font-size: 1.05em; color: var(--mut); margin: 0 0 .8em; }
.sl-goals-h { font-weight: 700; margin-bottom: .3em; }
.sl-ask { font-weight: 600; }
.sl-check li { margin-bottom: .7em; }
.sl-ans { color: var(--g); font-weight: 800; }
.sl-q { font-size: 1.35em; font-weight: 700; }
.sl-punch { font-size: 1.6em; font-weight: 800; color: var(--g); margin: .2em 0; }
.myth, .fact { border-radius: .5em; padding: .55em .75em; margin-bottom: .6em; }
.myth { background: var(--redl); }
.fact { background: var(--gl); }
.myth-h, .fact-h { font-size: .65em; font-weight: 800; text-transform: uppercase; }
.myth-h { color: var(--red); }
.fact-h { color: var(--g); }
.sl-pic { min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.sl-pic svg { max-width: 100%; max-height: 100%; width: auto; height: 100%; }
.sl-pic .scene { height: auto; width: 100%; }
.stage.pic-only { grid-template-rows: auto 1fr; }
.stage.pic-only .sl-pic { min-height: 0; }
.slidebar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: #e3efe8; width: min(calc(100vw - 28px), calc((100vh - 80px) * 16 / 9)); margin: 0 auto; }
.deck.teacher .slidebar { width: min(calc(100vw - 28px), calc((100vh - 190px) * 16 / 9)); }
.nav { width: 46px; height: 40px; border-radius: 10px; border: 0; background: #fff; color: var(--g); font-size: 28px; font-weight: 700; line-height: 1; cursor: pointer; }
.nav:disabled { opacity: .35; cursor: default; }
.count { font-weight: 700; min-width: 64px; text-align: center; }
.grow { flex: 1; }
.tool { border: 1px solid #5a7a6a; background: transparent; color: #e3efe8; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 14px; font-weight: 600; }
.tool.on { background: #e3efe8; color: #10261c; }
.notes { width: min(calc(100vw - 28px), calc((100vh - 190px) * 16 / 9)); margin: 0 auto 12px; background: #fff8e3; color: #3b3220; border-radius: 10px; padding: 9px 13px; font-size: 14.5px; max-height: 96px; overflow: auto; }
.deck ~ .card-wrap { position: fixed; inset: 0; margin: 0; max-width: none; display: grid; place-items: center; background: rgba(16,38,28,.75); }
.deck ~ .card-wrap .card { width: min(520px, 92vw); }

body.figure { background: #fff; }
.figure-pic { width: 900px; padding: 20px; background: #fff; }


/* ── compare (sort into groups), order, tables ── */
.bins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.bin { text-align: left; border: 2px dashed #b8c2bb; border-radius: 14px; background: #fff; padding: 10px 12px; cursor: pointer; min-height: 150px; display: flex; flex-direction: column; gap: 8px; }
.bin:hover { border-color: var(--g); background: #f6fbf8; }
.bin.bad { border-color: var(--red); background: var(--redl); }
.bin-pic { height: 110px; display: flex; justify-content: center; }
.bin-pic .dia { width: auto; height: 100%; }
.bin-name { font-family: var(--disp); font-weight: 800; color: var(--g); }
.bin-items { display: flex; flex-wrap: wrap; gap: 6px; }
.order-wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.order-pic { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.phead { background: none; border: 0; font-weight: 800; font-size: 13px; text-transform: uppercase; color: var(--mut); padding-top: 0; padding-bottom: 0; }
.pslot-h { width: 190px; flex: none; text-align: center; }
.group.plain { background: #eef1ef; color: #1b1c1c; text-transform: none; font-size: 14px; width: 150px; }
.phead .group.plain { background: none; text-transform: uppercase; font-size: 13px; color: var(--mut); }
input.pslot.typed { font: 700 16px var(--sans); text-align: center; border-style: solid; }
input.pslot.typed:focus { outline: none; border-color: var(--g); }
.dia-mark { font-size: 3.4px; font-weight: 800; fill: #1b1c1c; paint-order: stroke; stroke: #fff; stroke-width: 0.5px; }
@media (max-width: 820px) { .bins, .order-wrap { grid-template-columns: 1fr; } .group.plain { width: auto; } }

/* ── teacher page ── */
.tp { max-width: 900px; margin: 0 auto; padding: 26px 20px 70px; }
.tp-kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--g2); }
.tp h1 { font-size: 34px; margin: 4px 0 10px; }
.tp-lead { font-size: 18px; color: #3f4942; margin: 0 0 18px; }
.tp-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.tp-how > div { background: var(--gl); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.tp-list { display: flex; flex-direction: column; gap: 10px; }
.tp-row { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tp-what { flex: 1; }
.tp-name { font-family: var(--disp); font-weight: 800; font-size: 18px; }
.tp-text { color: var(--mut); font-size: 15px; }
.tp-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tp-form { margin-top: 18px; }
.tp-form .tp-row { border: 2px solid var(--gb); }
.tp-steps { margin: 10px 4px 0; padding-left: 22px; color: #3f4942; font-size: 15px; }
.tp-steps li { margin-bottom: 5px; }
.tp-foot { margin-top: 22px; color: var(--mut); }
.tp-foot a { color: var(--g); font-weight: 700; }

@media (max-width: 820px) {
  .split, .label-wrap, .xwrap { grid-template-columns: 1fr; }
  .pane, .xclues { height: auto; max-height: none; overflow: visible; }
  .xleft { position: static; }
  .label-pic, .label-pic .dia { max-height: none; }
  .label-pic .dia { width: 100%; }
  .label-wrap .bank { position: sticky; bottom: 0; top: auto; }
  .prow { flex-wrap: wrap; }
  .pslot { width: 100%; }
  .tp-how { grid-template-columns: 1fr; }
  .tp-row { flex-direction: column; align-items: stretch; }
  .tp-btns { justify-content: flex-start; }
  .stage { grid-template-columns: 1fr !important; aspect-ratio: auto; overflow: auto; font-size: 16px; }
}
@media print {
  body * { visibility: hidden; }
  .card, .card * { visibility: visible; }
  .card-wrap { position: absolute !important; inset: 0 auto auto 0 !important; background: none !important; display: block !important; }
  .card { box-shadow: none; }
  .card-btns, .card-again { display: none; }
}
