/* ======================================================================
   TEXTBOOK STYLE (.zb-*) — lesson layout modelled on a classic maths textbook:
   Objectives, sections A/B/C, Definition / Theorem / Property / Note boxes,
   numbered Examples with Solutions (steps + reasons), proof tables,
   Check Yourself blocks with answers, and Exercises in two columns.
   Used inside lesson content.html files (Paper body).
   ====================================================================== */
body.nf { --zb-def: #d6407f; --zb-thm: #16a34a; --zb-ex: #2f7fd1; --zb-note: #ea6a12; --zb-check: #0f9488; --zb-sec: #ea6a12; --zb-sub: #b5267a;
  --zb-def-bg: #fdf0f6; --zb-thm-bg: #effaf2; --zb-note-bg: #fff5ec; --zb-check-bg: #eefaf8; }
html.dark-mode body.nf, body.nf.dark-mode { --zb-def: #f07cad; --zb-thm: #4ade80; --zb-ex: #6aa9ee; --zb-note: #fb9b4f; --zb-check: #2dd4bf; --zb-sec: #fb9b4f; --zb-sub: #e879b9;
  --zb-def-bg: #2c1823; --zb-thm-bg: #13261a; --zb-note-bg: #2b1d12; --zb-check-bg: #102624; }

.slide .zb-chapter { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; }
.slide .zb-chapter .zb-chno { font: 800 2.4rem/1 var(--nf-font); color: #fff; background: var(--zb-sub); border-radius: 8px; padding: 8px 16px; }
.slide .zb-chapter h2 { margin: 0 !important; font-size: 1.9rem; letter-spacing: .02em; text-transform: uppercase; color: var(--zb-sub) !important; }
.slide h2.zb-section { color: var(--zb-sec) !important; text-transform: uppercase; letter-spacing: .03em; font-size: 1.45rem; }
.slide h3.zb-sub { color: var(--zb-sub); font-size: 1.15rem; margin: 22px 0 8px; }

/* labelled boxes: label in a left column, content on the right */
.zb-box, .zb-ex, .zb-sol, .zb-obj { display: grid; grid-template-columns: 112px 1fr; gap: 6px 18px; margin: 18px 0; align-items: start; }
.zb-label { font: 700 13px/1 var(--nf-font); color: #fff; padding: 6px 10px; border-radius: 2px; text-align: center; align-self: start; }
.zb-body > :first-child { margin-top: 0 !important; }
.zb-body > :last-child { margin-bottom: 0 !important; }
.zb-term { font-weight: 700; margin: 0 0 6px !important; padding-bottom: 3px; border-bottom: 2px solid currentColor; display: inline-block; }
.zb-obj .zb-label { background: var(--zb-ex); }
.zb-obj ol { margin: 0; padding-left: 1.3em; }
.zb-def .zb-label { background: var(--zb-def); } .zb-def .zb-term { color: var(--zb-def); }
.zb-def .zb-body { border-left: 3px solid var(--zb-def); padding: 2px 0 2px 14px; }
.zb-thm .zb-label, .zb-prop .zb-label { background: var(--zb-thm); } .zb-thm .zb-term, .zb-prop .zb-term { color: var(--zb-thm); }
.zb-thm .zb-body, .zb-prop .zb-body { border-left: 3px solid var(--zb-thm); padding: 2px 0 2px 14px; }
.zb-note .zb-label, .zb-rem .zb-label { background: var(--zb-note); }
.zb-note .zb-body, .zb-rem .zb-body { background: var(--zb-note-bg); border-radius: 4px; padding: 10px 14px; }

/* examples */
.zb-ex { margin-top: 30px; margin-bottom: 8px; }
.zb-ex-head { display: flex; align-items: center; gap: 8px; }
.zb-ex .zb-label { background: var(--zb-ex); }
.zb-num { font: 900 1.9rem/1 var(--nf-font); color: var(--zb-ex); }
.zb-sol { margin-top: 6px; }
.zb-sol-label { font: 700 15px var(--nf-font); color: var(--zb-ex); text-align: right; padding-top: 2px; }
.zb-parts { list-style: none; padding: 0; margin: 4px 0; }
.zb-parts > li { margin: 3px 0; }
.zb-parts > li::before { content: attr(data-l) ". "; color: var(--zb-ex); font-weight: 700; }

/* step-by-step working: maths on the left, reason on the right */
.zb-steps { display: grid; grid-template-columns: auto 1fr; gap: 4px 22px; margin: 6px 0 10px; align-items: baseline; }
.zb-steps > .r { color: var(--nf-mute); font-size: .92em; }
.zb-check-line { color: var(--zb-check); font-weight: 700; }

/* proofs */
table.zb-proof { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .95em; }
table.zb-proof th { background: var(--zb-ex); color: #fff; font-weight: 600; padding: 6px 10px; text-align: left; }
table.zb-proof td { border-bottom: 1px solid var(--nf-line); padding: 6px 10px; vertical-align: top; }
table.zb-proof tr:nth-child(even) td { background: var(--nf-bg-2); }

/* figures */
.zb-fig { float: right; margin: 0 0 10px 18px; max-width: 46%; }
.zb-fig svg { width: 100%; height: auto; display: block; }
.zb-fig figcaption { font-size: 13px; color: var(--nf-mute); text-align: center; margin-top: 4px; }
.zb-fig svg text { font: 13px var(--nf-font); fill: currentColor; }
.zb-fig .acc { stroke: var(--zb-ex); } .zb-fig .acc2 { stroke: var(--zb-def); } .zb-fig .fillacc { fill: var(--zb-ex); opacity: .15; }
.zb-clear { clear: both; }
.zb-side { float: right; width: 34%; margin: 0 0 12px 18px; font-size: 14px; font-style: italic; color: var(--nf-mute); border-top: 3px solid var(--zb-check); padding-top: 6px; }

/* Check Yourself and Exercises */
.zb-checky { background: var(--zb-check-bg); border-radius: 6px; padding: 16px 20px; margin: 20px 0; }
.zb-checky h3 { color: var(--zb-check); font-style: italic; margin: 0 0 10px !important; font-size: 1.2rem; }
.zb-checky ol { margin: 0 0 8px; padding-left: 1.4em; }
.zb-answers summary { cursor: pointer; color: var(--zb-check); font-weight: 700; font-style: italic; }
.zb-answers p { margin: 6px 0 0 !important; }
.zb-exercises { margin: 10px 0 20px; }
.zb-exercises .zb-ex-title { background: var(--zb-sec); color: #fff; font: 800 1.15rem var(--nf-font); letter-spacing: .08em; padding: 8px 16px; border-radius: 4px 4px 0 0; }
.zb-exercises .zb-cols { columns: 2; column-gap: 34px; column-rule: 2px solid var(--zb-sec); padding: 14px 4px 0; margin: 0; }
.zb-exercises .zb-cols ol { padding-left: 1.6em; margin: 0 0 6px; }
.zb-exercises .zb-cols li { break-inside: avoid; margin-bottom: 12px; }
.zb-exercises .zb-cols li::marker { color: var(--zb-def); font-weight: 700; }
.zb-exercises h4 { break-after: avoid; color: var(--zb-sec); margin: 4px 0 8px; font-size: 1rem; }
@media (max-width: 700px) {
  .zb-box, .zb-ex, .zb-sol, .zb-obj { grid-template-columns: 1fr; }
  .zb-sol-label { text-align: left; }
  .zb-fig, .zb-side { float: none; max-width: 100%; width: auto; margin: 10px 0; }
  .zb-exercises .zb-cols { columns: 1; }
}

/* lesson title + timers bar (lesson.html), in the Violet site style */
body.nf .lms-topbar { justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 32px; background: var(--nf-bg); border-bottom: 1px solid var(--nf-line);
  font-family: "Google Sans Flex", "Inter", system-ui, sans-serif; }
body.nf .lms-topbar * { font-family: inherit; }
.lms-topbar .topbar-left { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.lt-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nf-blue); }
.lt-kicker:empty { display: none; }
.lt-title { font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; color: var(--nf-head); line-height: 1.25; }
/* developer/admin "Edit" button in the lesson title bar (opens editor.html) */
.lt-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--nf-line); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; color: var(--nf-head); text-decoration: none; background: var(--nf-bg); }
.lt-edit[hidden] { display: none; }
.lt-edit:hover { border-color: var(--nf-blue); color: var(--nf-blue); }
.lt-edit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ls-timers { display: flex; align-items: center; gap: 8px; }
.ls-timers[hidden] { display: none; }
.ls-timer { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 999px; border: 1px solid var(--nf-line); background: var(--nf-bg); line-height: 1; }
.ls-timer svg, .ls-timer-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--nf-blue); flex: none; }
.ls-timer small { font-size: 12px; color: var(--nf-mute); font-weight: 500; }
.ls-timer b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--nf-head); }
.ls-timer.lesson { background: var(--nf-blue-soft); border-color: transparent; }
.ls-timer.over { background: color-mix(in srgb, #d92916 10%, var(--nf-bg)); border-color: color-mix(in srgb, #d92916 35%, transparent); }
.ls-timer.over svg, .ls-timer.over b { color: #d92916; }
.ls-timer-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; color: #fff; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
  background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%); }
.ls-timer-btn:hover { background: linear-gradient(180deg, #1D4ED8 0%, #1E40AF 100%); }
.ls-timer-btn svg { color: #fff; }
.ls-timers.paused .ls-timer b { opacity: .45; }
@media (max-width: 700px) { .ls-timer small { display: none; } body.nf .lms-topbar { padding: 12px 16px; } }
.zb-warn .zb-label { background: #d92916; }
.zb-warn .zb-body { background: color-mix(in srgb, #d92916 8%, transparent); border-radius: 4px; padding: 10px 14px; }
.zb-box .zb-body table.ls-table { margin: 6px 0; }

/* ======================================================================
   STUDY THEME — the look of lesson slides in lesson.html (body.lesson-active).
   Our own textbook style: slides are white sheets on a dotted desk;
   Google Sans Flex everywhere (the website font: headings, text, questions, passages,
   MathJax digits); Indie Flower only for hand-written notes and "Solution". Box colours:
   Definition blue · Rule/Property teal · Example coral · Caution rose ·
   Remember sunny (sticky note) · Check green. Same .zb-* / .ls-* markup.
   ====================================================================== */
body.nf.paper.lesson-active .lms-main {
  --st-desk: #F3F6FB; --st-dot: #D5DEEC; --st-paper: #ffffff; --st-soft: #F6F8FC;
  --st-ink: #1C2433; --st-mute: #64708A; --st-line: #E2E8F2; --st-head: #111827;
  --st-brand: #2563EB; --st-brand-soft: #EAF1FE; --st-hl: #ffe27a;
  --st-def: #2563EB; --st-def-bg: #EFF5FF; --st-def-ln: #CFE0FD;
  --st-rule: #0b9a88; --st-rule-bg: #e8f8f5; --st-rule-ln: #bfe9e1;
  --st-ex: #f0643c; --st-ex-bg: #fff2ed; --st-ex-ln: #ffd5c7;
  --st-warn: #e0315a; --st-warn-bg: #ffeef2; --st-warn-ln: #ffc9d5;
  --st-sun: #b07800; --st-sun-bg: #fff6d6; --st-sun-ln: #f7e19a;
  --st-ok: #1f9d63; --st-ok-bg: #eafaf1; --st-ok-ln: #bce9d1;
  --st-display: "Google Sans Flex", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --st-text: "Google Sans Flex", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --st-hand: "Indie Flower", "Sriracha", "Segoe Print", "Bradley Hand", cursive;
  --st-serif: var(--st-text);   /* passages use the site font too */
  background: var(--st-desk);
}
html.dark-mode body.nf.paper.lesson-active .lms-main, body.nf.paper.lesson-active.dark-mode .lms-main {
  --st-desk: #0F131B; --st-dot: #222A3A; --st-paper: #171D29; --st-soft: #1E2533;
  --st-ink: #E5E9F0; --st-mute: #A3ACBF; --st-line: #2C3547; --st-head: #ffffff;
  --st-brand: #7AA9F8; --st-brand-soft: #1C2A45; --st-hl: #6b5612;
  --st-def: #7AA9F8; --st-def-bg: #17243D; --st-def-ln: #2A3F66;
  --st-rule: #3fd3bd; --st-rule-bg: #13282a; --st-rule-ln: #1f4743;
  --st-ex: #ff8a66; --st-ex-bg: #2c1c1a; --st-ex-ln: #4d2c25;
  --st-warn: #ff6f8d; --st-warn-bg: #2f1820; --st-warn-ln: #552838;
  --st-sun: #f5c94c; --st-sun-bg: #2a2412; --st-sun-ln: #4a3f1c;
  --st-ok: #4fd393; --st-ok-bg: #132a1f; --st-ok-ln: #1f4a35;
}
body.nf.paper.lesson-active .lms-content {
  background-image: radial-gradient(var(--st-dot) 1.2px, transparent 1.3px); background-size: 22px 22px;
  padding: 36px 20px 64px;
}
/* the sheet */
body.nf.paper.lesson-active .slide {
  max-width: 860px; background: var(--st-paper); color: var(--st-ink); font-family: var(--st-text);
  border-radius: 28px; padding: 44px 52px 48px; border: 1px solid var(--st-line);
  box-shadow: 0 1px 2px rgba(36, 31, 53, .04), 0 18px 48px -18px rgba(70, 40, 160, .18);
}
body.nf.paper.lesson-active .slide p, body.nf.paper.lesson-active .slide li { font-size: 1.07rem; line-height: 1.72; color: var(--st-ink); }
body.nf.paper.lesson-active .slide strong { color: var(--st-head); font-weight: 700; }
body.nf.paper.lesson-active .slide em { color: var(--st-brand); }
body.nf.paper.lesson-active .slide h2,
body.nf.paper.lesson-active .slide h3,
body.nf.paper.lesson-active .slide h4 { font-family: var(--st-display); color: var(--st-head); letter-spacing: -.015em; }
body.nf.paper.lesson-active .slide h2 { font-size: 2.05rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 22px; }
body.nf.paper.lesson-active .slide h3 { font-size: 1.32rem; font-weight: 700; margin: 30px 0 12px; }
body.nf.paper.lesson-active .slide ol li::marker, body.nf.paper.lesson-active .slide ul li::marker { color: var(--st-brand); font-weight: 700; }
body.nf.paper.lesson-active .slide a:not(.btn) { color: var(--st-brand); text-decoration: underline; text-underline-offset: 3px; }

/* page tag */
body.nf.paper.lesson-active .slide .ls-tag { font: 700 12px/1 var(--st-display); letter-spacing: .09em; text-transform: uppercase;
  color: var(--st-brand); background: var(--st-brand-soft); border-radius: 999px; padding: 7px 14px; margin-bottom: 18px; display: table; }

/* MathJax digits and letters follow the lesson text font */
body.nf.paper.lesson-active mjx-mn mjx-c, body.nf.paper.lesson-active mjx-mi mjx-c, body.nf.paper.lesson-active mjx-mtext mjx-c {
  font-family: MJXZERO, "Google Sans Flex", "Inter", system-ui, sans-serif !important; }
body.nf.paper.lesson-active mjx-container { color: var(--st-head); }

/* ---------- chapter banner, sections, sub-sections ---------- */
body.nf.paper.lesson-active .slide .zb-chapter { position: relative; overflow: hidden; gap: 22px; margin: 0 0 26px; padding: 26px 30px;
  border-radius: 22px; color: #fff; background: linear-gradient(125deg, #1D4ED8 0%, #2563EB 52%, #38BDF8 100%); }
body.nf.paper.lesson-active .slide .zb-chapter::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,0) 70%); pointer-events: none; }
body.nf.paper.lesson-active .slide .zb-chapter .zb-chno { position: relative; font: 700 3.1rem/1 var(--st-display); color: #fff; background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.45); border-radius: 18px; min-width: 76px; padding: 12px 14px 10px; text-align: center; }
body.nf.paper.lesson-active .slide .zb-chapter .zb-chno::before { content: "Lesson"; display: block; font: 600 11px/1 var(--st-text); letter-spacing: .12em;
  text-transform: uppercase; opacity: .85; margin-bottom: 6px; }
body.nf.paper.lesson-active .slide .zb-chapter h2 { color: #fff !important; text-transform: none; letter-spacing: -.02em; font-size: 2.25rem; }
body.nf.paper.lesson-active .slide h2.zb-section { display: table; margin: 0 0 4px; text-transform: none; letter-spacing: -.02em; font-size: 2rem; color: var(--st-head) !important;
  background: linear-gradient(transparent 60%, var(--st-hl) 60%, var(--st-hl) 92%, transparent 92%); padding: 0 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
body.nf.paper.lesson-active .slide h2.zb-section + * { margin-top: 26px; }
body.nf.paper.lesson-active .slide h3.zb-sub { display: flex; align-items: center; gap: 10px; color: var(--st-brand); font-size: 1.4rem; margin: 30px 0 12px; }
body.nf.paper.lesson-active .slide h3.zb-sub::before { content: ""; width: 10px; height: 26px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--st-brand), #60A5FA); }

/* ---------- labelled boxes: cards with a chip on top ---------- */
body.nf.paper.lesson-active .zb-box, body.nf.paper.lesson-active .zb-obj {
  --bx-c: var(--st-brand); --bx-bg: var(--st-brand-soft); --bx-ln: var(--st-def-ln);
  display: block; margin: 22px 0; padding: 18px 22px 18px; border-radius: 18px; background: var(--bx-bg); border: 1.5px solid var(--bx-ln); }
body.nf.paper.lesson-active .zb-def { --bx-c: var(--st-def); --bx-bg: var(--st-def-bg); --bx-ln: var(--st-def-ln); }
body.nf.paper.lesson-active .zb-prop, body.nf.paper.lesson-active .zb-thm { --bx-c: var(--st-rule); --bx-bg: var(--st-rule-bg); --bx-ln: var(--st-rule-ln); }
body.nf.paper.lesson-active .zb-warn { --bx-c: var(--st-warn); --bx-bg: var(--st-warn-bg); --bx-ln: var(--st-warn-ln); }
body.nf.paper.lesson-active .zb-note, body.nf.paper.lesson-active .zb-rem { --bx-c: var(--st-sun); --bx-bg: var(--st-sun-bg); --bx-ln: var(--st-sun-ln); }
body.nf.paper.lesson-active .zb-box .zb-label, body.nf.paper.lesson-active .zb-obj .zb-label {
  display: inline-flex; align-items: center; gap: 7px; background: none !important; color: var(--bx-c); padding: 0; margin: 0 0 8px; border-radius: 0;
  font: 700 12.5px/1 var(--st-display); letter-spacing: .1em; text-transform: uppercase; }
body.nf.paper.lesson-active .zb-box .zb-label::before, body.nf.paper.lesson-active .zb-obj .zb-label::before {
  content: "✦"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--bx-c); color: var(--st-paper);
  font-size: 13px; letter-spacing: 0; }
body.nf.paper.lesson-active .zb-obj .zb-label::before { content: "◎"; }
body.nf.paper.lesson-active .zb-prop .zb-label::before, body.nf.paper.lesson-active .zb-thm .zb-label::before { content: "★"; }
body.nf.paper.lesson-active .zb-warn .zb-label::before { content: "!"; font-weight: 900; font-size: 15px; }
body.nf.paper.lesson-active .zb-note .zb-label::before, body.nf.paper.lesson-active .zb-rem .zb-label::before { content: "✎"; }
body.nf.paper.lesson-active .zb-box .zb-body, body.nf.paper.lesson-active .zb-obj .zb-body { border: 0 !important; background: none !important; padding: 0 !important; border-radius: 0; }
body.nf.paper.lesson-active .zb-body p { margin-bottom: 10px; }
body.nf.paper.lesson-active .slide .zb-term { display: block; border: 0; padding: 0; margin: 0 0 6px !important; color: var(--bx-c);
  font: 700 1.25rem/1.25 var(--st-display); letter-spacing: -.01em; }
body.nf.paper.lesson-active .slide .zb-term::first-letter { text-transform: uppercase; }
/* Remember = a sticky note */
body.nf.paper.lesson-active .zb-rem, body.nf.paper.lesson-active .zb-note { border-radius: 4px 18px 18px 18px; border-style: solid;
  box-shadow: 0 10px 22px -16px rgba(140, 100, 0, .55); }
body.nf.paper.lesson-active .zb-rem .zb-label, body.nf.paper.lesson-active .zb-note .zb-label { font: 400 1.32rem/1 var(--st-hand); letter-spacing: 0; text-transform: none; }
/* Objectives = checklist */
body.nf.paper.lesson-active .zb-obj ol { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
body.nf.paper.lesson-active .zb-obj ol li { position: relative; padding-left: 32px; margin: 0; }
body.nf.paper.lesson-active .zb-obj ol li::before { content: "✓"; position: absolute; left: 0; top: 3px; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; font: 700 12px/1 var(--st-text); color: var(--st-brand); background: var(--st-paper); border: 1.5px solid var(--st-def-ln); }

/* ---------- worked examples: question card + attached solution ---------- */
body.nf.paper.lesson-active .zb-ex { display: block; margin: 34px 0 0; padding: 18px 22px 16px; background: var(--st-ex-bg);
  border: 1.5px solid var(--st-ex-ln); border-bottom: 0; border-radius: 20px 20px 0 0; }
body.nf.paper.lesson-active .zb-ex-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
body.nf.paper.lesson-active .zb-ex .zb-label { background: none; color: var(--st-ex); padding: 0; font: 700 12.5px/1 var(--st-display); letter-spacing: .1em; text-transform: uppercase; order: 2; align-self: center; }
body.nf.paper.lesson-active .zb-num { order: 1; display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 13px;
  background: var(--st-ex); color: #fff; font: 700 1.2rem/1 var(--st-display); box-shadow: 0 6px 14px -6px var(--st-ex); }
body.nf.paper.lesson-active .zb-ex .zb-body p { font-weight: 600; color: var(--st-head); }
body.nf.paper.lesson-active .zb-sol { display: block; margin: 0 0 8px; padding: 14px 22px 18px; background: var(--st-paper);
  border: 1.5px solid var(--st-ex-ln); border-top: 1.5px dashed var(--st-ex-ln); border-radius: 0 0 20px 20px; }
body.nf.paper.lesson-active .zb-sol-label { display: block; text-align: left; padding: 0; margin-bottom: 4px; color: var(--st-ex); font: 400 1.42rem/1 var(--st-hand); }
body.nf.paper.lesson-active .zb-sol-label::after { content: " ✎"; font-size: .85em; }
body.nf.paper.lesson-active .zb-parts > li { padding-left: 2px; }
body.nf.paper.lesson-active .zb-parts > li::before { content: attr(data-l); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px;
  border-radius: 50%; background: var(--st-paper); border: 1.5px solid var(--st-ex-ln); color: var(--st-ex); font: 700 12px/1 var(--st-display); vertical-align: 1px; }
body.nf.paper.lesson-active .zb-sol .zb-body strong { color: var(--st-ex); }
/* step-by-step working: maths left, hand-written reason right */
body.nf.paper.lesson-active .zb-steps { gap: 8px 26px; margin: 8px 0 10px; }
body.nf.paper.lesson-active .zb-steps > span:not(.r) { font-size: 1.06rem; }
body.nf.paper.lesson-active .zb-steps > .r { font: 400 1.14rem/1.35 var(--st-hand); color: var(--st-brand); }
/* hand-drawn arrows: before every reason, and for → ← typed in hand-written text (wrapped by handArrows() in lesson.html) */
body.nf.paper.lesson-active .zb-steps > .r:not(:empty)::before, body.nf.paper.lesson-active .slide .st-arrow {
  content: ""; display: inline-block; width: 1.15em; height: .8em; vertical-align: -.02em; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath d='M2.5 10.8c5-1.2 10.5.6 16-.4 2.4-.4 5-.9 8.6-.7M20.2 4.6c1.6 1.9 3.7 3.6 6.6 5-2.7 1.4-4.6 3.2-6.1 5.6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath d='M2.5 10.8c5-1.2 10.5.6 16-.4 2.4-.4 5-.9 8.6-.7M20.2 4.6c1.6 1.9 3.7 3.6 6.6 5-2.7 1.4-4.6 3.2-6.1 5.6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
body.nf.paper.lesson-active .zb-steps > .r:not(:empty)::before { transform: scaleX(-1); margin-right: .35em; opacity: .7; }
body.nf.paper.lesson-active .slide .st-arrow { overflow: hidden; color: inherit; -webkit-text-fill-color: transparent; font-size: inherit; margin: 0 .1em; }
body.nf.paper.lesson-active .slide .st-arrow.left { transform: scaleX(-1); }
/* hand-written text: formulas inside it are hand-written too (Indie Flower; Sriracha for the arrows, √ and π it lacks) */
body.nf.paper.lesson-active :is(.zb-steps > .r, .zb-side, .zb-sol-label, .ls-sol > strong:first-child, .zb-rem .zb-label, .zb-note .zb-label, details.ls-reveal summary) mjx-container { color: inherit; font-size: 1em; }
body.nf.paper.lesson-active :is(.zb-steps > .r, .zb-side, .zb-sol-label, .ls-sol > strong:first-child, .zb-rem .zb-label, .zb-note .zb-label, details.ls-reveal summary) mjx-c {
  font-family: "Indie Flower", "Sriracha", cursive !important; font-style: normal !important; font-weight: 400; }
body.nf.paper.lesson-active :is(.zb-steps > .r, .zb-side, .zb-sol-label, .ls-sol > strong:first-child, .zb-rem .zb-label, .zb-note .zb-label, details.ls-reveal summary) mjx-c::before {
  width: auto !important; padding: 0 !important; white-space: pre; }
body.nf.paper.lesson-active .zb-check-line { display: inline-block; color: var(--st-ok); background: var(--st-ok-bg); border-radius: 999px; padding: 1px 10px; font-weight: 700; }

/* ---------- tables ---------- */
body.nf.paper.lesson-active .ls-table { border-collapse: separate; border-spacing: 0; border: 1.5px solid var(--st-line); border-radius: 16px; overflow: hidden;
  font-size: 1rem; background: var(--st-paper); }
body.nf.paper.lesson-active .ls-table th, body.nf.paper.lesson-active .ls-table td { border: 0; border-bottom: 1px solid var(--st-line); border-right: 1px solid var(--st-line); padding: 11px 16px; color: var(--st-ink); }
body.nf.paper.lesson-active .ls-table tr > :last-child { border-right: 0; }
body.nf.paper.lesson-active .ls-table tr:last-child > * { border-bottom: 0; }
body.nf.paper.lesson-active .ls-table th { background: var(--st-brand-soft); color: var(--st-brand); font: 700 .95rem var(--st-display); letter-spacing: .01em; }
body.nf.paper.lesson-active .ls-table tr:nth-child(odd) td { background: var(--st-soft); }
body.nf.paper.lesson-active .zb-box .ls-table { background: var(--st-paper); }
body.nf.paper.lesson-active table.zb-proof { border-radius: 14px; overflow: hidden; border-collapse: separate; border-spacing: 0; border: 1.5px solid var(--st-line); }
body.nf.paper.lesson-active table.zb-proof th { background: var(--st-brand); font-family: var(--st-display); }

/* ---------- Check Yourself + questions ---------- */
body.nf.paper.lesson-active .zb-checky { background: var(--st-ok-bg); border: 2px dashed var(--st-ok-ln); border-radius: 22px; padding: 22px 24px 8px; }
body.nf.paper.lesson-active .slide .zb-checky h3 { display: flex; align-items: center; gap: 10px; font: 700 1.45rem var(--st-display); font-style: normal; color: var(--st-ok); }
body.nf.paper.lesson-active .slide .zb-checky h3::before { content: "✓"; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--st-ok); color: #fff; font-size: 17px; }
body.nf.paper.lesson-active .zb-checky .ls-q { background: var(--st-paper); border-radius: 16px; padding: 18px 20px 6px; margin-bottom: 14px; border: 1px solid var(--st-ok-ln); }
body.nf.paper.lesson-active .slide .ls-q > p.ls-ask { font: 700 1.1rem/1.45 var(--st-display); color: var(--st-head); }
body.nf.paper.lesson-active .ls-opts { gap: 8px; }
body.nf.paper.lesson-active .opt { align-items: center; gap: 14px; padding: 11px 14px; border: 1.5px solid var(--st-line); border-radius: 14px;
  background: var(--st-paper); font: 500 1.03rem/1.5 var(--st-text); color: var(--st-ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
body.nf.paper.lesson-active .opt:hover { border-color: var(--st-brand); background: var(--st-paper); transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(37, 99, 235, .6); }
body.nf.paper.lesson-active .opt b { width: 30px; height: 30px; border-radius: 10px; background: var(--st-brand-soft); color: var(--st-brand);
  font: 700 .95rem/1 var(--st-display); align-self: center; }
body.nf.paper.lesson-active .opt.correct { background: var(--st-ok-bg) !important; border-color: var(--st-ok) !important; }
body.nf.paper.lesson-active .opt.correct b { background: var(--st-ok); color: #fff; }
body.nf.paper.lesson-active .opt.wrong { background: var(--st-warn-bg) !important; border-color: var(--st-warn) !important; }
body.nf.paper.lesson-active .opt.wrong b { background: var(--st-warn); color: #fff; }
html.dark-mode body.nf.paper.lesson-active .lms-content .opt, html.dark-mode body.nf.paper.lesson-active .lms-content .opt * { color: var(--st-ink); }
html.dark-mode body.nf.paper.lesson-active .lms-content .opt b { color: var(--st-brand) !important; background: var(--st-brand-soft) !important; }
html.dark-mode body.nf.paper.lesson-active .lms-content .opt.correct b { color: #fff !important; background: var(--st-ok) !important; }
html.dark-mode body.nf.paper.lesson-active .lms-content .opt.wrong b { color: #fff !important; background: var(--st-warn) !important; }
body.nf.paper.lesson-active .ls-sol { background: var(--st-ok-bg); border: 1.5px solid var(--st-ok-ln); border-radius: 16px; padding: 16px 20px; margin-bottom: 14px; }
body.nf.paper.lesson-active .zb-checky .ls-sol { background: var(--st-soft); border-color: var(--st-line); }
body.nf.paper.lesson-active .ls-sol > strong:first-child { color: var(--st-ok); font: 400 1.42rem/1 var(--st-hand); margin-bottom: 6px; }
body.nf.paper.lesson-active .zb-answers summary { display: inline-block; font: 700 1rem var(--st-display); font-style: normal; color: var(--st-ok);
  background: var(--st-paper); border: 1.5px solid var(--st-ok-ln); border-radius: 999px; padding: 6px 16px; }

/* ---------- CT boxes (ls-key / ls-trap / ls-ex / passages / reveal) ---------- */
body.nf.paper.lesson-active .ls-key { background: var(--st-def-bg); border: 1.5px solid var(--st-def-ln); border-radius: 18px; padding: 18px 22px; }
body.nf.paper.lesson-active .ls-trap { background: var(--st-warn-bg); border: 1.5px solid var(--st-warn-ln); border-radius: 18px; padding: 18px 22px; }
body.nf.paper.lesson-active .ls-ex { background: var(--st-ex-bg); border: 1.5px solid var(--st-ex-ln); border-radius: 18px; padding: 18px 22px; }
body.nf.paper.lesson-active .ls-key-h, body.nf.paper.lesson-active .ls-ex-h, body.nf.paper.lesson-active .ls-trap-h { font: 700 12.5px/1 var(--st-display); letter-spacing: .1em; margin-bottom: 10px; }
body.nf.paper.lesson-active .ls-key-h { color: var(--st-def); } body.nf.paper.lesson-active .ls-ex-h { color: var(--st-ex); } body.nf.paper.lesson-active .ls-trap-h { color: var(--st-warn); }
body.nf.paper.lesson-active .ls-passage { position: relative; background: var(--st-soft); border: 0; border-left: 4px solid var(--st-brand); border-radius: 4px 16px 16px 4px; padding: 18px 24px 18px 26px; }
body.nf.paper.lesson-active .slide .ls-passage p { font: 400 1.12rem/1.7 var(--st-serif); color: var(--st-head); }
body.nf.paper.lesson-active .slide details.ls-reveal { border-top: 1.5px dashed var(--st-ex-ln); }
body.nf.paper.lesson-active .slide details.ls-reveal summary { display: inline-block; text-decoration: none; color: var(--st-ex); font: 400 1.3rem/1 var(--st-hand); }
body.nf.paper.lesson-active .slide details.ls-reveal summary::before { content: "✎ "; }

/* ---------- exercises, figures, side notes ---------- */
body.nf.paper.lesson-active .zb-exercises { border: 1.5px solid var(--st-line); border-radius: 20px; overflow: hidden; background: var(--st-paper); }
body.nf.paper.lesson-active .zb-exercises .zb-ex-title { border-radius: 0; background: linear-gradient(110deg, var(--st-ex), #f5a05c); font: 700 1.15rem var(--st-display); letter-spacing: .06em; padding: 12px 20px; }
body.nf.paper.lesson-active .zb-exercises .zb-cols { column-rule: 1.5px dashed var(--st-ex-ln); padding: 18px 20px 6px; }
body.nf.paper.lesson-active .zb-exercises .zb-cols li::marker { color: var(--st-ex); font-family: var(--st-display); }
body.nf.paper.lesson-active .slide .zb-exercises h4 { color: var(--st-ex); font-size: 1.05rem; }
body.nf.paper.lesson-active .zb-fig { background: var(--st-soft); border-radius: 16px; padding: 12px; border: 1px solid var(--st-line); }
body.nf.paper.lesson-active .zb-fig svg text { font-family: var(--st-text); }
body.nf.paper.lesson-active .zb-fig .acc { stroke: var(--st-brand); } body.nf.paper.lesson-active .zb-fig .acc2 { stroke: var(--st-ex); }
body.nf.paper.lesson-active .zb-fig .fillacc { fill: var(--st-brand); }
body.nf.paper.lesson-active .zb-side { font: 400 1.12rem/1.4 var(--st-hand); font-style: normal; color: var(--st-brand); border-top: 0; border-left: 3px solid var(--st-hl); padding: 2px 0 2px 12px; }

@media (max-width: 700px) {
  body.nf.paper.lesson-active .lms-content { padding: 16px 10px 48px; }
  body.nf.paper.lesson-active .slide { padding: 26px 18px 30px; border-radius: 20px; }
  body.nf.paper.lesson-active .slide h2 { font-size: 1.6rem; }
  body.nf.paper.lesson-active .slide .zb-chapter { padding: 18px; gap: 14px; }
  body.nf.paper.lesson-active .slide .zb-chapter h2 { font-size: 1.5rem; }
  body.nf.paper.lesson-active .slide .zb-chapter .zb-chno { font-size: 2.2rem; min-width: 58px; }
  body.nf.paper.lesson-active .zb-steps { grid-template-columns: 1fr; gap: 2px; }
  body.nf.paper.lesson-active .zb-steps > .r { margin-bottom: 8px; }
}
/* textbook figures: labels, fills, grid, small figures inside examples */
.zb-fig .lab-a { fill: var(--zb-ex); font-weight: 700; }
.zb-fig .lab-b { fill: var(--zb-def); font-weight: 700; }
.zb-fig .fill-a { fill: color-mix(in srgb, var(--zb-ex) 22%, transparent); stroke: var(--zb-ex); stroke-width: 1.6; }
.zb-fig .fill-b { fill: color-mix(in srgb, var(--zb-def) 22%, transparent); stroke: var(--zb-def); stroke-width: 1.6; }
.zb-fig .gridl { stroke: var(--nf-line); stroke-width: 1; }
.zb-fig.zb-fig-sm { max-width: 34%; margin-top: 2px; }
.zb-fig figcaption:empty { display: none; }
.zb-sol { clear: none; }

/* ===== IELTS lesson parts (courses/exam-prep/ace-the-ielts): recordings, gap fill, writing box, chart, transcript ===== */
.ls-audio { margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--nf-line); border-radius: 14px; background: var(--nf-bg-2); }
.ls-audio figcaption { font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nf-mute); margin-bottom: 8px; }
.ls-audio audio { display: block; width: 100%; height: 40px; }
.ls-fill { margin: 0 0 28px; }
.slide .ls-fill > p { line-height: 2.3; margin-bottom: 4px; }
input.ls-gap { font: inherit; color: var(--nf-ink); width: 11em; max-width: 100%; padding: 4px 10px; margin: 0 4px; border: 1.5px solid var(--nf-line); border-radius: 8px; background: var(--nf-bg); }
input.ls-gap:focus { outline: 2px solid var(--nf-blue); outline-offset: 1px; border-color: transparent; }
input.ls-gap.correct { border-color: #16a34a; background: color-mix(in srgb, #16a34a 10%, var(--nf-bg)); }
input.ls-gap.wrong { border-color: #dc2626; background: color-mix(in srgb, #dc2626 8%, var(--nf-bg)); }
.ls-gap-key { color: #16a34a; font-weight: 700; margin-left: 4px; }
.ls-gap-key:empty { display: none; }
.ls-fill-bar { display: flex; align-items: center; gap: 14px; margin: 14px 0 16px; }
.ls-fill-score { font-weight: 700; font-size: 1.1rem; color: var(--nf-head); }
table.ls-form td:first-child { width: 34%; color: var(--nf-mute); }
table.ls-form td b, .ls-fill > p > b:first-child { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 4px; border-radius: 6px; font-size: .85em; background: var(--nf-blue-soft); color: var(--nf-blue); margin-right: 4px; }
textarea.ls-write { display: block; width: 100%; min-height: 240px; font: inherit; line-height: 1.6; color: var(--nf-ink); padding: 14px 16px; border: 1.5px solid var(--nf-line); border-radius: 12px; background: var(--nf-bg); resize: vertical; }
textarea.ls-write:focus { outline: 2px solid var(--nf-blue); outline-offset: 1px; border-color: transparent; }
.slide p.ls-write-count { font-size: .9rem; color: var(--nf-mute); text-align: right; margin: 6px 0 18px; }
.slide p.ls-write-count.ok { color: #16a34a; font-weight: 700; }
.ls-read h3 { margin-top: 0; }
.slide .ls-passage.ls-read p { margin-bottom: 12px; }
.slide .ls-passage.ls-read p:last-child { margin-bottom: 0; }
.ls-script p { margin-bottom: 8px; }
.ls-script p > b:first-child { display: inline-block; min-width: 6.5em; color: var(--nf-mute); font-weight: 500; }
.ls-chart { margin: 0 0 22px; max-width: 560px; }
.ls-chart svg { display: block; width: 100%; height: auto; }
.ls-chart .ax line { stroke: var(--nf-ink); stroke-width: 1.5; }
.ls-chart .grid line { stroke: var(--nf-line); stroke-width: 1; }
.ls-chart .lbl, .ls-chart .val { fill: var(--nf-ink); font-size: 13px; stroke: none; }
.ls-chart .val { font-weight: 700; font-size: 12px; }
.ls-chart .b1, .ls-chart .b1 rect { fill: #2563EB; }
.ls-chart .b2, .ls-chart .b2 rect { fill: #93C5FD; }
.wl-phase.wl-track { display: block; text-decoration: none; color: inherit; }
.wl-phases:has(.wl-track) { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .wl-phases:has(.wl-track) { grid-template-columns: 1fr; } input.ls-gap { width: 8.5em; } table.ls-form td:first-child { width: 40%; } }
