/* Lesson player (lesson agent). Uses the tokens in styles.css. Subject accent comes from data-subject on the screen root. */

[data-subject="maths"] { --subj: var(--maths); --subj-soft: var(--maths-soft); }
[data-subject="english"] { --subj: var(--english); --subj-soft: var(--english-soft); }
[data-subject="science"] { --subj: var(--science); --subj-soft: var(--science-soft); }
[data-subject] { --subj: var(--brand); --subj-soft: var(--brand-soft); }

/* ---- Frame: sticky top bar, content column */
.lp-page { min-height: 100vh; }
.lp-top {
  position: sticky; top: 0; z-index: 20; padding: 10px 16px 0;
  background: rgba(246, 244, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.lp-top-row { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; min-height: 52px; }
.lp-close {
  flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; cursor: pointer;
  background: var(--card); color: var(--ink-2); font-size: 30px; line-height: 1; box-shadow: var(--shadow-1);
}
.lp-close:hover { color: var(--ink); }
.lp-top-title {
  flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 750; font-size: var(--fs-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-top .chip { flex: none; font-size: 14px; background: var(--subj-soft); color: var(--subj); }
.lp-progress { display: flex; gap: 6px; max-width: 760px; margin: 8px auto 0; padding-bottom: 10px; }
.lp-progress .seg { flex: 1; height: 8px; border-radius: 8px; background: var(--line); transition: background .3s ease; }
.lp-progress .seg.done { background: var(--subj); }
.lp-progress .seg.current { background: linear-gradient(90deg, var(--subj) 0 50%, var(--subj-soft) 50%); box-shadow: 0 0 0 2px var(--subj-soft); }

.lp-main { max-width: 760px; margin: 0 auto; padding: 18px 16px 140px; scroll-margin-top: 165px; }
.lp-loading { padding: 40px 0; text-align: center; }
.lp-error { margin-top: 24px; }

.enter { animation: rise .45s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.block { animation: rise .4s cubic-bezier(.2, .7, .3, 1) both; scroll-margin-top: 165px; margin: 0 0 18px; }
.block .block { margin: 0; animation: none; }

/* ---- Start card */
.lp-start { text-align: center; padding: 28px 22px 26px; }
.lp-start-emoji { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.lp-start h1 { font-size: var(--fs-4); }
.lp-sub { font-size: var(--fs-2); color: var(--ink-2); margin-bottom: 10px; }
.lp-mins { display: inline-block; font-weight: 700; color: var(--subj); background: var(--subj-soft); padding: 4px 14px; border-radius: var(--r-pill); margin-bottom: 14px; }
.lp-start h3 { margin-top: 8px; font-size: var(--fs-2); }
.goal-ticks { list-style: none; padding: 0; margin: 10px auto 22px; max-width: 520px; text-align: left; }
.goal-ticks li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: var(--fs-2); }
.tick {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--good-soft); color: var(--good); font-weight: 800; font-size: 16px;
}
.tick-in { animation: rise .4s both; }
.btn.big { min-height: 60px; padding: 14px 30px; font-size: var(--fs-2); }
.btn.big.good { background: var(--good); }
.btn.go { background: var(--subj); box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.btn.go:hover { filter: brightness(1.05); }

/* ---- Section header */
.sec-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 20px; }
.sec-emoji {
  flex: none; width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 30px;
  background: var(--subj-soft); box-shadow: inset 0 0 0 2px var(--subj-soft);
}
.sec-kind { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--subj); }
.sec-head h2 { margin: 0; font-size: var(--fs-4); }
.sec-body { padding-bottom: 12px; }
.sec-foot { margin-top: 16px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; }
.foot-hint { color: var(--ink-2); margin: 0; font-size: var(--fs-2); font-weight: 600; }
.sec-foot .btn.go { align-self: flex-start; }

/* ---- Text, fractions, quotes and read-aloud */
.prose { font-size: var(--fs-2); line-height: 1.55; }
.md p { margin: 0 0 .6em; }
.md p:last-child, .md ul:last-child, .md blockquote:last-child { margin-bottom: 0; }
.md ul { margin: .2em 0 .4em; padding-left: 1.2em; }
.md li { margin: .2em 0; }
.md-quote {
  margin: .5em 0; padding: 10px 16px; border-left: 4px solid var(--subj, var(--brand));
  background: var(--subj-soft, var(--brand-soft)); border-radius: 0 var(--r-s) var(--r-s) 0;
  font-style: italic; color: var(--ink);
}
.frac-wrap { display: inline-flex; align-items: center; vertical-align: middle; margin: 0 2px; line-height: 1; }
.frac-sign { font-weight: 800; margin-right: 2px; font-size: 1.05em; }
.frac {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  vertical-align: middle; font-size: 0.82em; font-weight: 800; line-height: 1.05; padding: 0 2px;
}
.frac .num { border-bottom: 2px solid currentColor; padding: 0 3px 1px; display: block; text-align: center; min-width: 1.1em; }
.frac .den { padding: 1px 3px 0; display: block; text-align: center; min-width: 1.1em; }
.speak-btn {
  margin-top: 6px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  min-height: 40px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-0); font-weight: 600;
}
.speak-btn:hover { background: var(--brand-soft); color: var(--brand-ink); }

/* ---- Key points */
.keypoints {
  background: linear-gradient(160deg, var(--subj-soft), #fff); border-radius: var(--r-l); padding: 18px 20px;
  border: 2px solid var(--subj); box-shadow: var(--shadow-1);
}
.kp-title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-3); color: var(--subj); margin-bottom: 4px; }
.kp-list { list-style: none; padding: 0; margin: 0; }
.kp-list li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed var(--line); }
.kp-list li:first-child { border-top: 0; }
.kp-list .tick { background: var(--subj); color: #fff; }
.kp-text p { margin: 0; font-weight: 600; }

/* ---- Figures */
.figure-block { margin-left: 0; margin-right: 0; text-align: center; }
.figure-block img { display: block; margin: 0 auto; max-height: 380px; background: #fff; border-radius: var(--r-m); box-shadow: var(--shadow-1); padding: 10px; }
.figure-block figcaption { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-1); }

/* ---- Callouts */
.callout { border-radius: var(--r-m); padding: 14px 18px; border-left: 6px solid; }
.callout-head { font-weight: 800; margin-bottom: 4px; font-size: var(--fs-1); }
.callout-body { font-size: var(--fs-2); }
.callout.tip { background: var(--info-soft); border-color: var(--info); }
.callout.remember { background: var(--brand-soft); border-color: var(--brand); }
.callout.warning { background: var(--accent-soft); border-color: var(--accent); }
.callout.fun { background: var(--english-soft); border-color: var(--english); }

/* ---- Flashcards with a 3D flip */
.fc-hint { margin-bottom: 8px; font-size: var(--fs-0); }
.fc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.fcard { perspective: 900px; background: transparent; border: 0; padding: 0; height: 140px; cursor: pointer; text-align: left; }
.fc-inner { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.fcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow-1);
}
.fc-front { background: #fff; border: 2px solid var(--subj); }
.fc-back { background: var(--subj); color: #fff; transform: rotateY(180deg); }
.fc-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .7; margin-bottom: 4px; }
.fc-text { font-size: var(--fs-3); font-weight: 750; font-family: var(--font-display); line-height: 1.2; }
.fcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--r-m); }

/* ---- Worked example */
.worked { background: #fff; border-radius: var(--r-l); padding: 18px 20px; box-shadow: var(--shadow-1); border-top: 6px solid var(--accent); }
.we-head { font-weight: 800; font-size: var(--fs-2); margin-bottom: 6px; }
.we-problem { font-size: var(--fs-2); font-weight: 650; margin-bottom: 8px; }
.we-steps { margin: 8px 0; padding-left: 0; list-style: none; counter-reset: we; }
.we-step { counter-increment: we; position: relative; padding: 10px 12px 10px 52px; margin-bottom: 8px; background: var(--accent-soft); border-radius: var(--r-s); animation: rise .35s both; }
.we-step::before {
  counter-increment: none; content: counter(we); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--ink); font-weight: 800; font-size: 15px;
}
.we-actions { margin-top: 6px; }
.we-answer { margin-top: 12px; padding: 12px 16px; border-radius: var(--r-s); background: var(--good-soft); color: #0b5d2a; animation: rise .35s both; }
.we-label { display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.we-answer .md { font-size: var(--fs-3); font-weight: 800; font-family: var(--font-display); }

/* ---- Explorable (hand-inked figures) */
.explorable { background: #fff; border-radius: var(--r-l); padding: 14px 14px 16px; box-shadow: var(--shadow-1); }
.exp-try { font-weight: 700; color: var(--subj); margin: 2px 4px 10px; font-size: var(--fs-1); }
.exp-stage { min-height: 120px; }
.exp-say { min-height: 1.5em; margin-top: 8px; font-size: var(--fs-1); }
.exp-say .md p { margin: 0; }
.exp-goals { margin-top: 12px; background: var(--subj-soft); border-radius: var(--r-m); padding: 10px 14px; }
.exp-goals-title { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--subj); margin-bottom: 4px; }
.exp-goals ul { list-style: none; padding: 0; margin: 0; }
.exp-goals .goal { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: var(--fs-1); font-weight: 600; transition: color .2s; }
.goal-box {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--ink-3); background: #fff;
  display: inline-grid; place-items: center; color: transparent; font-weight: 900; transition: all .25s ease;
}
.goal.done .goal-box { background: var(--good); border-color: var(--good); color: #fff; transform: scale(1.08); }
.goal.done { color: var(--good); }
.exp-status { margin-top: 8px; }
.exp-failed { background: var(--accent-soft); padding: 10px 14px; border-radius: var(--r-s); font-weight: 600; }
.exp-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.exp-done.hidden { display: none; }
.inked-frame { margin: 0; }

/* ---- Notebook summary card */
.notebook { border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-1); background: #fff; border: 2px solid var(--subj, var(--brand)); }
.nb-head { background: var(--subj, var(--brand)); color: #fff; padding: 12px 18px; font-weight: 800; font-size: var(--fs-2); }
.nb-page {
  padding: 18px 20px 20px; position: relative;
  background-color: #fcfbff;
}
.nb-md { font-size: var(--fs-2); font-weight: 650; margin-bottom: 12px; line-height: 1.45; }
.nb-md p { margin: 0; }
.nb-items { display: grid; gap: 10px; }
.nb-item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; text-align: left; padding: 10px 14px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-m); cursor: pointer; font-size: var(--fs-2); font-weight: 650;
  transition: background .2s, border-color .2s, transform .15s;
}
.nb-item:hover { border-color: var(--subj, var(--brand)); }
.nb-item:active { transform: scale(.99); }
.nb-box {
  flex: none; width: 32px; height: 32px; border-radius: 9px; border: 2.5px solid var(--subj, var(--brand)); background: #fff;
  display: grid; place-items: center; color: transparent; font-weight: 900; font-size: 19px; transition: all .2s;
}
.nb-item.ticked { border-color: var(--good); background: var(--good-soft); }
.nb-item.ticked .nb-box { background: var(--good); border-color: var(--good); color: #fff; }
.nb-hint { font-size: var(--fs-0); margin-top: 12px; }

/* ---- Question card */
.qcard {
  background: var(--card); border-radius: var(--r-l); padding: 18px 20px 16px; box-shadow: var(--shadow-1);
  border: 2px solid var(--line); transition: border-color .3s, box-shadow .3s; scroll-margin-top: 165px;
}
.qhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.qlabel { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.qstate { font-weight: 800; font-size: var(--fs-1); color: var(--ink-3); }
.qstate.ok { color: var(--good); }
.qstate.seen { color: var(--ink-2); }
.qprompt { font-size: var(--fs-3); font-weight: 700; font-family: var(--font-display); line-height: 1.3; margin-bottom: 12px; }
.qprompt p { margin: 0; }
.qimage { display: block; max-width: 100%; max-height: 320px; margin: 4px auto 14px; background: #fff; border-radius: var(--r-m); padding: 8px; box-shadow: var(--shadow-1); }
.qactions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.qactions .btn.check { min-width: 140px; }
.qactions .btn:disabled { opacity: .45; }
.qcard.correct, .qcard:has(.banner.good) { border-color: var(--good); }
.qnote { margin-top: 8px; }
.soft-note { background: var(--info-soft); color: var(--ink-2); border-radius: var(--r-s); padding: 8px 12px; margin: 0; }

/* Verdict banners */
.verdict { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.verdict.pop { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 60% { transform: scale(1.02); opacity: 1; } 100% { transform: none; } }
.banner { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-3); padding: 10px 16px; border-radius: var(--r-m); }
.banner.good { background: var(--good-soft); color: #0b6b33; }
.banner.bad { background: var(--bad-soft); color: #9c2f35; }
.banner.neutral { background: var(--info-soft); color: #075f85; font-size: var(--fs-2); }
.explain { font-size: var(--fs-2); padding: 0 4px; }
.explain p, .spelling p { margin: 0; }
.spelling { font-size: var(--fs-1); color: var(--ink-2); padding: 0 4px; }
.md.soft { color: var(--ink-2); background: #fff7f6; border-radius: var(--r-s); padding: 8px 12px; margin: 0; font-size: var(--fs-1); }
.md.soft p { margin: 0; }
.reveal { background: #fff; border: 2px solid var(--good); border-radius: var(--r-m); padding: 12px 16px; }
.reveal-answer { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.reveal-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--good); }
.reveal-answer .md { font-size: var(--fs-3); font-weight: 800; font-family: var(--font-display); }
.reveal-answer .md p { margin: 0; }
.reveal-steps { margin: 0; padding-left: 1.4em; }
.reveal-steps li { margin: 4px 0; font-size: var(--fs-2); }
.reveal-steps .md p { margin: 0; }

/* Help row and tutor */
.help-wrap { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.help-row { display: flex; flex-wrap: wrap; gap: 8px; }
.help-row.hidden { display: none; }
.help-btn {
  min-height: 44px; padding: 6px 14px; border-radius: var(--r-pill); border: 2px solid var(--line); background: #fff;
  color: var(--ink-2); font-weight: 700; cursor: pointer; font-size: var(--fs-1);
}
.help-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.help-btn:disabled { opacity: .5; cursor: default; }
.help-area { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.help-area:empty { display: none; }
.ask-form { display: flex; gap: 8px; width: 100%; margin-top: 4px; }
.ask-form.hidden { display: none; }
.ask-input {
  flex: 1; min-height: 48px; padding: 10px 14px; border-radius: var(--r-pill); border: 2px solid var(--line);
  background: #fff; font-size: var(--fs-1);
}
.ask-input:focus { outline: none; border-color: var(--brand); }
.bubble { position: relative; max-width: 92%; padding: 12px 16px; border-radius: var(--r-m); font-size: var(--fs-1); line-height: 1.58; animation: rise .3s both; }
.bubble p { margin: 0; }
.bubble p + p { margin-top: 10px; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.tutor { align-self: flex-start; background: #f2f0fb; color: var(--ink); border-bottom-left-radius: 4px; }
.bubble-label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-ink); margin-bottom: 2px; }
.thinking { display: inline-flex; gap: 5px; padding: 4px 0; }
.thinking i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: bounce 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.hint-card { background: var(--accent-soft); border-radius: var(--r-m); padding: 10px 14px; font-size: var(--fs-1); animation: rise .3s both; }
.hint-card b { display: block; margin-bottom: 2px; }
.hint-card p { margin: 0; }
.steps-box { background: #fff; border: 2px solid var(--accent); border-radius: var(--r-m); padding: 12px 14px; animation: rise .3s both; }
.steps-list { margin: 0 0 10px; padding-left: 1.4em; }
.step-in { margin: 6px 0; animation: rise .3s both; }
.step-in .md p { margin: 0; }

/* ---- Quiz */
.quiz { scroll-margin-top: 170px; }
.sec-head, .complete { scroll-margin-top: 165px; }
.quiz-intro { text-align: center; padding: 26px 22px; }
.quiz-emoji { font-size: 60px; line-height: 1; margin-bottom: 8px; }
.quiz-intro h3 { font-size: var(--fs-4); }
.quiz-intro p { font-size: var(--fs-2); color: var(--ink-2); margin: 6px 0 18px; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-count { font-weight: 800; font-size: var(--fs-1); color: var(--subj); }
.qdots { display: flex; gap: 6px; flex-wrap: wrap; }
.qdot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: background .25s, transform .25s; }
.qdot.current { background: var(--subj); transform: scale(1.25); }
.qdot.ok { background: var(--good); }
.qdot.bad { background: var(--bad); }
.qdot.saved { background: var(--subj); opacity: .55; }
.quiz-nav { margin-top: 16px; display: flex; justify-content: flex-start; }   /* same place as Continue in the parts */
.quiz-nav .btn { min-width: 200px; }
.quiz-results { text-align: center; }
.score-big { font-family: var(--font-display); font-size: 64px; font-weight: 900; line-height: 1; color: var(--subj); margin: 10px 0 4px; }
.score-band { font-family: var(--font-display); font-size: var(--fs-3); font-weight: 750; margin: 0 0 18px; }
.result-list { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; display: grid; gap: 8px; }
.result-row { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: var(--r-m); padding: 10px 14px; box-shadow: var(--shadow-1); border-left: 6px solid; }
.result-row.ok { border-color: var(--good); }
.result-row.bad { border-color: var(--bad); }
.res-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; }
.result-row.ok .res-icon { background: var(--good); }
.result-row.bad .res-icon { background: var(--bad); }
.res-q { font-weight: 650; }
.res-a { color: var(--ink-2); font-size: var(--fs-0); margin-top: 2px; }
.quiz-results .btn { min-width: 0; }
.quiz-retry h3 { font-size: var(--fs-3); }

/* ---- Summary: faces, comment, finish */
.finish { margin-top: 6px; }
.finish h3 { font-size: var(--fs-2); margin: 10px 0 6px; }
.finish .goal-ticks { margin: 0 0 6px; }
.faces { display: flex; gap: 10px; justify-content: space-between; margin: 8px 0 14px; }
.face {
  flex: 1; min-height: 64px; max-width: 96px; border-radius: var(--r-m); border: 3px solid transparent; background: #fff;
  box-shadow: var(--shadow-1); font-size: 40px; line-height: 1; cursor: pointer; transition: transform .15s, border-color .15s;
}
.face:hover { transform: translateY(-2px); }
.face.on { border-color: var(--subj); background: var(--subj-soft); transform: scale(1.08); }
.comment-label { display: block; font-weight: 700; font-size: var(--fs-1); color: var(--ink-2); margin-bottom: 14px; }
.comment {
  display: block; width: 100%; margin-top: 6px; padding: 10px 14px; border-radius: var(--r-m); border: 2px solid var(--line);
  background: #fff; font-size: var(--fs-1); resize: vertical;
}
.comment:focus { outline: none; border-color: var(--brand); }
.finish > .btn { width: 100%; }

/* ---- Completion */
.complete { text-align: center; padding: 30px 22px; }
.complete-emoji { font-size: 72px; line-height: 1; }
.complete h2 { font-size: var(--fs-5); margin-top: 6px; }
.complete .score-big { font-size: 56px; }
.break-box { margin: 18px auto 22px; max-width: 360px; background: var(--info-soft); border-radius: var(--r-l); padding: 16px 18px; }
.break-box h3 { margin: 0 0 4px; font-size: var(--fs-2); }
.countdown { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: var(--info); font-variant-numeric: tabular-nums; min-height: 1.2em; }

/* ---- Narrow screens (phone) */
@media (max-width: 520px) {
  .lp-top { padding: 8px 12px 0; }
  .lp-top-row { gap: 8px; }
  .lp-top .chip { font-size: 13px; padding: 2px 10px; }
  .lp-main { padding: 14px 12px 110px; }
  .sec-emoji { width: 52px; height: 52px; font-size: 26px; }
  .sec-head h2 { font-size: var(--fs-3); }
  .qprompt { font-size: var(--fs-2); }
  .fc-text { font-size: var(--fs-2); }
  .keypoints, .worked, .explorable, .qcard { padding-left: 14px; padding-right: 14px; }
  .face { font-size: 32px; }
  .score-big { font-size: 52px; }
  .nb-page { padding: 16px 14px 16px 26px; margin-left: 0; }
  .nb-page::before { left: 16px; }
  .qactions .btn.check, .sec-foot .btn.go, .quiz-nav .btn { width: 100%; }
  .ask-form { flex-wrap: wrap; }
  .ask-input { font-size: 16px; min-width: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .block, .enter, .we-step, .we-answer, .bubble, .verdict.pop, .hint-card, .steps-box, .step-in { animation: none !important; }
  .fc-inner { transition: none; }
}

/* Persona runs 19 Oct: on a landscape tablet (about 820 px tall) questions spilled below the screen.
   Short screens get capped diagrams and tighter cards so a question and its Check button fit together. */
@media (max-height: 900px) and (orientation: landscape) {
  .block img, .block svg:not(.inked-svg), .qimage { max-height: 40vh; width: auto; max-width: 100%; display: block; margin-left: auto; margin-right: auto; }
  .qcard { padding-top: 14px; padding-bottom: 14px; }
  .qcard .qprompt { margin-bottom: 8px; }
  .block { margin-bottom: 14px; }
  .inked-stage .inked-svg { max-height: 52vh; }
}

.steps-note { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; }


/* Every persona run (19 Oct): "having to scroll down every single time just to find the next button".
   When Continue is showing, it rides at the bottom of the screen. */
.sec-foot:has(.btn.go) {
  position: sticky; bottom: 0; z-index: 5; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
/* Quiz and retry screens put Continue/Next inside their own blocks: pin those buttons themselves too. */
.lesson [data-testid="continue"], .lesson [data-testid="next"], main [data-testid="continue"].btn.big, main [data-testid="next"].btn.big {
  position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 6; box-shadow: 0 2px 0 var(--brand-ink), var(--shadow-2);
}

/* ---- Anti-rushing: how sure, what went wrong, come back, her numbers (docs/ANTI-RUSH-DESIGN.md) */
.conf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.conf.hidden { display: none; }
.conf-label { font-size: var(--fs-1); font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.conf-chip {
  min-height: 44px; padding: 6px 16px; border-radius: var(--r-pill); border: 2px solid var(--line); background: #fff;
  color: var(--ink-2); font: inherit; font-size: var(--fs-1); font-weight: 700; cursor: pointer;
}
.conf-chip:hover { border-color: var(--brand); }
.conf-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.conf-chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.qquick:empty { display: none; }
.qquick { margin-top: 10px; }
.why { background: #fff; border: 2px solid var(--line); border-radius: var(--r-m); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.why-title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2); }
.why-opts { display: flex; flex-direction: column; gap: 8px; }
.why-opt {
  min-height: 48px; padding: 8px 16px; border-radius: var(--r-m); border: 2px solid var(--line); background: #fff;
  font: inherit; font-size: var(--fs-1); text-align: left; cursor: pointer; color: var(--ink);
}
.why-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.why-opt.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.why-opt:disabled:not(.on) { opacity: .55; cursor: default; }
.why-fix:empty { display: none; }
.comeback, .master-round, .master-outcome { display: flex; flex-direction: column; gap: 14px; }
.comeback h3, .master-round h3, .master-outcome h3 { margin: 0; }
.results-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.credit-line { margin: 0 0 8px; }
.my-numbers { text-align: left; background: var(--brand-soft); border-radius: var(--r-m); padding: 12px 18px; margin: 14px 0; }
.my-numbers h3 { margin: 0 0 6px; font-size: var(--fs-2); }
.my-numbers ul { margin: 0; padding-left: 1.2em; }
.my-numbers li { margin: 4px 0; }

/* The tutor popping in after repeated wrong tries, and the gentle nudge after a first wrong try (20 Oct). */
.coach-tag { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--brand-ink); margin: 6px 0 2px; }
.tutor-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; color: var(--muted, #6b6880); }

/* Oak National Academy lesson card */
.oak-card { padding: 18px; border: 2px solid var(--line, #d9d3f0); border-radius: 16px; background: #fff; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.oak-kicker { font-size: var(--fs-1); font-weight: 800; color: var(--accent, #6c4cf1); text-transform: uppercase; letter-spacing: .04em; }
.oak-title { margin: 0; font-size: var(--fs-4, 1.4rem); }
.oak-do, .oak-status { margin: 0; }
.oak-open { font-size: var(--fs-3); padding: 12px 22px; }
.oak-back[disabled] { opacity: .5; }
.oak-video { width: 100%; max-height: calc(100vh - 290px); background: #000; border-radius: 12px; }
/* Synchronized subtitle bar directly underneath the video frame */
.oak-caption-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-radius: 10px; background: #181623; color: #fff; font-size: 1.05rem;
  font-weight: 600; line-height: 1.4; min-height: 46px; box-sizing: border-box;
}
.oak-caption-row.hidden { display: none; }
.oak-caption-row.cc-off { background: #f3f1fa; color: var(--muted, #6b6880); }
.oak-caption-text { flex: 1; text-align: center; }
.oak-cc-btn {
  padding: 4px 10px; border-radius: 6px; border: 2px solid rgba(255,255,255,.4); background: transparent;
  color: #fff; font: inherit; font-size: 0.85rem; font-weight: 800; cursor: pointer; flex-shrink: 0;
}
.oak-cc-btn.on { background: var(--brand, #6c4cf1); border-color: var(--brand, #6c4cf1); color: #fff; }
.oak-caption-row.cc-off .oak-cc-btn { border-color: var(--line, #d9d3f0); color: var(--ink-2, #444); }
/* A video part uses the whole lesson pane, not the 760px reading column. */
.lp-main:has(.oak-video-card) { max-width: min(1400px, 100%); }
.oak-video-card { padding: 12px; align-items: stretch; }
.oak-video-card .oak-status { font-size: var(--fs-2); font-weight: 600; }
.oak-task { padding: 12px 14px; border-radius: 12px; background: #fff7e0; border: 2px solid #f2c94c; }
.oak-skip { align-self: flex-start; font-size: var(--fs-1); padding: 8px 16px; }

/* Intro objectives must remain visible above the start control. */
main .lp-start [data-testid="continue"].btn.big { position:static; bottom:auto; }

