/* ==========================================================================
   The Exam Hub — lesson slides (v36, js/lessons.js)
   Ash, 2026-09-28: CENTURY's "colour scheme and diagrams really help to make it tangible and digestible".
   A slide is always a light page in the subject's colour (maths yellow, science green, English blue) with a faint
   pattern, white cards with coloured edges, key words in colour and large worked examples — on either app theme,
   as the question paper is always ivory. Every text colour here is at least 4.5:1 on the surface it sits on.
   ========================================================================== */
.lesson {
  --lsBg: #FBEFC6; --lsDeep: #7A5400; --lsLine: rgba(122,84,0,.22); --lsSoft: rgba(255,255,255,.55);
  --lsInk: #1B2433; --lsInk2: #3F4A5C; --kw: #6F2BD9; --coral: #B3321F; --lsBlue: #0B6FB3;
  --c1: #0A7470; --c2: #6F2BD9; --c3: #B3321F; --c4: #1767B5; --c5: #2A7331; --c6: #955300;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}
.lesson.sub-science { --lsBg: #C9EFDB; --lsDeep: #0B6150; --lsLine: rgba(11,97,80,.22); }
.lesson.sub-english { --lsBg: #D1E8F8; --lsDeep: #134F8A; --lsLine: rgba(19,79,138,.22); }
.lesson [hidden] { display: none !important; }
body.ls-open { overflow: hidden; }

.ls-wrap { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 36px); }
.ls-top { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; color: #F3EEE2; }
.ls-kick { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold2); }
.ls-kick svg { width: 18px; height: 18px; }
.ls-top h2 { margin: 0; font-size: calc(24px * var(--fs)); color: var(--ivory); }
.ls-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.ls-top .btn.quiet { color: var(--text); border: 1px solid var(--line2); min-height: 40px; }
.ls-loading { background: var(--lsBg); color: var(--lsInk); border-radius: 22px; padding: 40px; font-size: 17px; text-align: center; }
.ls-loading .btn { margin-left: 10px; }

.ls-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
.ls-stage { position: relative; padding: 0 30px; }
.ls-scroll { max-height: calc(100vh - 110px); overflow: auto; border-radius: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.35); overscroll-behavior: contain; }
.ls-slide {
  position: relative; min-height: min(620px, calc(100vh - 110px)); padding: 26px 40px 30px; border-radius: 24px;
  color: var(--lsInk); font-family: var(--sans); font-size: calc(17px * var(--fs)); line-height: 1.55;
  background-color: var(--lsBg); border: 10px solid #FFFFFF;
  background-image: var(--lsPat); background-size: 220px 220px;
}
.ls-slide.in { animation: lsIn .22s ease-out; }
@keyframes lsIn { from { opacity: .35; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lesson.sub-maths .ls-slide, .lesson-cta.sub-maths, .intro-go.lesson.sub-maths { --lsPat: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(122,84,0,0.10)' stroke-width='2' stroke-linecap='round'><path d='M24 30h18M33 21v18'/><path d='M150 28l14 14M164 28l-14 14'/><path d='M92 96h20M102 88h.1M102 104h.1'/><circle cx='190' cy='110' r='12'/><path d='M30 150l16-26 16 26z'/><path d='M120 170h22M120 178h22'/><path d='M70 205l10-10 10 10'/><path d='M180 190c0-8 12-8 12 0s12 8 12 0'/><path d='M60 60l6-12 6 12M62 56h8'/></svg>"); }
.lesson.sub-science .ls-slide, .lesson-cta.sub-science, .intro-go.lesson.sub-science { --lsPat: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(11,97,80,0.11)' stroke-width='2' stroke-linecap='round'><circle cx='40' cy='40' r='4'/><ellipse cx='40' cy='40' rx='18' ry='7'/><ellipse cx='40' cy='40' rx='18' ry='7' transform='rotate(60 40 40)'/><path d='M150 20v18l-10 18h24l-10-18V20'/><path d='M100 120c10-20 30-20 34-2-16 8-28 8-34 2z'/><path d='M100 120l24-8'/><path d='M40 160c8 6 16 6 24 0s16-6 24 0'/><path d='M40 172c8 6 16 6 24 0s16-6 24 0'/><circle cx='180' cy='170' r='10'/><circle cx='196' cy='182' r='6'/><path d='M186 176l6 3'/></svg>"); }
.lesson.sub-english .ls-slide, .lesson-cta.sub-english, .intro-go.lesson.sub-english { --lsPat: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(19,79,138,0.11)' stroke-width='2' stroke-linecap='round'><path d='M26 30c0-8 10-8 10 0 0 6-6 10-10 12M42 30c0-8 10-8 10 0 0 6-6 10-10 12'/><path d='M140 30h30v34h-30zM140 64c6-4 24-4 30 0M155 30v34'/><path d='M60 130l40-40 8 8-40 40-12 4z'/><path d='M150 150l10-24 10 24M154 142h12'/><path d='M178 150c0-10 14-10 14 0v8'/><path d='M30 190h40M30 200h28'/></svg>"); }

/* the arrows beside the slide (CENTURY's round blue buttons) */
.ls-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid #FFFFFF; background: #0B72B8; color: #FFFFFF; font-size: 34px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.35); padding: 0 0 4px;
}
.ls-arrow.ls-prev { left: 0; } .ls-arrow.ls-next { right: 0; }
.ls-arrow[disabled] { opacity: 0; pointer-events: none; }
.ls-arrow:focus-visible, .ls-side button:focus-visible, .lb-reveal:focus-visible { outline: 3px solid var(--gold2); outline-offset: 3px; }

/* the list of slides (right) */
.ls-side { background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 16px 14px; position: sticky; top: 8px; }
.ls-side-h { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold2); margin: 0 0 8px 6px; }
.ls-side ol { list-style: none; margin: 0; padding: 0; position: relative; }
.ls-side li { position: relative; }
.ls-side li + li::before { content: ''; position: absolute; left: 17px; top: -8px; height: 16px; border-left: 2px solid var(--line2); }
.ls-side button { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 7px 8px; color: var(--text); font-size: 13.5px; line-height: 1.35; min-height: 40px; }
.ls-side button:hover { background: rgba(255,255,255,.05); }
.ls-side .sd { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--muted2); background: transparent; }
.ls-side button.done .sd { border-color: #5DD9C6; background: #5DD9C6; box-shadow: inset 0 0 0 3px var(--panel); }
.ls-side button.on { background: rgba(201,163,39,.12); color: var(--gold3); font-weight: 700; }
.ls-side button.on .sd { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 3px var(--panel); }
.ls-side-p { font-size: 12.5px; color: var(--muted); margin: 12px 6px 0; line-height: 1.5; }

.ls-foot { display: none; align-items: center; gap: 10px; padding: 12px 2px 0; }
.ls-foot .btn { min-height: 46px; }
.ls-dots { flex: 1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ls-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.22); }
.ls-dots i.done { background: #5DD9C6; } .ls-dots i.on { background: var(--gold); transform: scale(1.35); }

/* ---------- inside a slide ---------- */
.ls-num { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ls-num > span:first-child { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; color: var(--lsDeep); background: var(--lsSoft); border: 1px solid var(--lsLine); border-radius: 999px; padding: 2px 10px; }
.ls-band { font-size: 12px; font-weight: 700; color: #FFFFFF; background: var(--lsDeep); border-radius: 999px; padding: 3px 10px; }
.ls-h { font-family: var(--sans); font-weight: 800; font-size: calc(27px * var(--fs)); line-height: 1.2; letter-spacing: -.01em; color: var(--lsInk); margin: 0 0 16px; outline: none; }
.ls-slide .ls-blocks > * + *, .ls-slide .lb-col > * + * { margin-top: 14px; }
.ls-slide .kw { color: var(--kw); font-weight: 800; }
.ls-slide b { font-weight: 800; }
.ls-slide sup { font-size: .7em; line-height: 0; }
/* [[3|4]]: a fraction, one number over the other */
.lfr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .86em; line-height: 1.12; margin: 0 .12em; }
.lfr > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .18em 1px; }
.lfr > span:last-child { padding: 1px .18em 0; }
.lb-p { margin: 0; max-width: 64em; }
.lb-list { margin: 0; padding: 0; list-style: none; }
.lb-list li { position: relative; padding-left: 26px; margin: 6px 0; }
.lb-list li::before { content: ''; position: absolute; left: 6px; top: .58em; width: 10px; height: 10px; border-radius: 3px; background: var(--c1); transform: rotate(45deg); }
.lb-list li:nth-child(2n)::before { background: var(--c2); } .lb-list li:nth-child(3n)::before { background: var(--c3); }

/* white cards with coloured edges */
.lb-card, .lb-big, .lb-call, .lb-terms, .lb-fig, .lb-work, .lb-check, .lb-table, .lb-quote, .lb-person, .ls-end {
  background: #FDFFFF; border-radius: 18px; box-shadow: 0 4px 0 rgba(0,0,0,.06), 0 10px 22px rgba(0,0,0,.06);
}
.lb-cards { display: grid; gap: 16px; }
.lb-cards.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lb-cards.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lb-card { border: 3px solid var(--tc, var(--c1)); padding: 16px 18px; }
.lb-card h4 { margin: 0 0 6px; font-family: var(--sans); font-size: calc(19px * var(--fs)); font-weight: 800; color: var(--tc, var(--c1)); }
.lb-card p { margin: 0; } .lb-card p + p { margin-top: 8px; }
.c1 { --tc: var(--c1); } .c2 { --tc: var(--c2); } .c3 { --tc: var(--c3); } .c4 { --tc: var(--c4); } .c5 { --tc: var(--c5); } .c6 { --tc: var(--c6); }

.lb-big { padding: 16px 22px; text-align: center; border: 3px solid var(--lsDeep); }
.lb-big-t { font-size: calc(25px * var(--fs)); font-weight: 800; line-height: 1.3; }
.lb-big-n { font-size: calc(15px * var(--fs)); color: var(--lsInk2); margin-top: 4px; }

.lb-call { position: relative; padding: 24px 20px 15px; margin-top: 22px !important; }
.lb-call:first-child { margin-top: 26px !important; }   /* p126: its label (16px above the box) clears the title */
.nw { white-space: nowrap; }
.ls-slide sub { font-size: .7em; line-height: 0; }
/* p128: a column vector, {{4|−3}}: the numbers stacked in tall round brackets */
.lcv { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: middle; line-height: 1.12; padding: .08em .42em; margin: 0 .12em; border-left: .11em solid currentColor; border-right: .11em solid currentColor; border-radius: .7em / 50%; font-size: .92em; white-space: nowrap; }
.lb-badge { position: absolute; left: 14px; top: -16px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 4px 16px 4px 6px; font-weight: 800; font-size: calc(15px * var(--fs)); color: #FFFFFF; background: #0B6CAD; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.lb-badge i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #FFFFFF; color: #0B6CAD; font-weight: 900; }
.lb-badge svg { width: 20px; height: 20px; margin-left: 4px; }
.lb-call.tip .lb-badge { background: #1E6E2F; padding-left: 12px; }
.lb-call.trap .lb-badge { background: #A82E1B; padding-left: 12px; }
.lb-call.rem { border: 2px solid rgba(11,108,173,.25); }
.lb-call.tip { border: 2px solid rgba(30,110,47,.25); }
.lb-call.trap { border: 2px solid rgba(168,46,27,.3); background: #FFF8F5; }

.lb-terms { margin: 0; padding: 14px 18px; border: 3px solid var(--c2); display: grid; gap: 8px; }
.lb-term { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 12px; align-items: baseline; }
.lb-term + .lb-term { border-top: 1px dashed rgba(0,0,0,.12); padding-top: 8px; }
.lb-term dt { font-weight: 800; color: var(--kw); }
.lb-term dd { margin: 0; }

.lb-fig { padding: 14px; display: flex; flex-direction: column; align-items: center; }
/* a figure in a lesson is drawn larger than in a question (.qfigure is capped at 460px there) */
.lesson .lb-fig .qfigure { margin: 0; max-width: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; }
.lesson .lb-fig .qfigure svg { display: block; width: min(100%, calc(var(--fw) * 1.45 * var(--fs) * var(--figk, 1))); max-width: 100%; height: auto; }
.lesson .lb-fig.wide .qfigure svg { width: min(100%, calc(var(--fw) * 1.8 * var(--fs))); }
.lb-fig .qfigures { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; align-items: flex-end; }
/* p112: several drawings in one block. Each at its own drawn size times one factor, so similar shapes keep their ratio,
   in a grid the block's width decides (a container query): four go four across, then two by two, then one column */
.lesson .lb-fig.multi { container-type: inline-size; align-items: stretch; }
.lesson .lb-fig.multi .qfigures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; justify-items: center; align-items: end; width: 100%; }
.lesson .lb-fig.nf-3 .qfigures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (min-width: 760px) { .lesson .lb-fig.nf-4 .qfigures { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 520px) { .lesson .lb-fig.nf-3 .qfigures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 340px) { .lesson .lb-fig.multi .qfigures { grid-template-columns: minmax(0, 1fr); } }
/* p125: { stack: true } — wide drawings go one above the other before their labels get too small */
@container (max-width: 700px) { .lesson .lb-fig.multi.stack .qfigures { grid-template-columns: minmax(0, 1fr); } .lesson .lb-fig.multi.stack .qfigure svg { width: min(100%, calc(var(--fw) * 1.25 * var(--fs))); } }
.lesson .lb-fig.multi .qfigure { width: auto; max-width: 100%; }
.lesson .lb-fig.multi .qfigure svg { width: calc(var(--fw) * 1.1 * var(--fs) * var(--figk, 1)); max-width: 100%; }   /* p131: { scale } */
.lesson .lb-fig .qfigure figcaption.cap { font-size: calc(13.5px * var(--fs)); margin-top: 6px; }
.lb-cap { font-size: calc(14px * var(--fs)); color: var(--lsInk2); margin-top: 6px; text-align: center; }
/* p105: a word-labelled cell, redrawn with letters and a key on a narrow screen */
.lb-fig.lb-narrow { display: none; }
.lb-key { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; width: 100%; }
.lb-key li { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: calc(15px * var(--fs)); }
.lb-key b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF; background: var(--tc); font-size: 14px; }
@media (max-width: 600px) { .lb-fig.lb-wide { display: none; } .lb-fig.lb-narrow { display: flex; } }
@media (max-width: 900px) { .ls-slide .lb-cols.fig-notes { grid-template-columns: minmax(0, 1fr); } }   /* .ls-slide: it must outrank the two-column rule further down */

.lb-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.lb-cols.wide-1 { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.lb-cols.wide-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.lb-cols.fig-notes { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; }

/* a worked example, a line at a time */
.lb-work { padding: 18px 20px; border: 3px solid var(--c4); container-type: inline-size; }
.lb-work-q { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 10px; }
.lb-pill { display: inline-block; background: var(--lsBg); border: 1px solid var(--lsLine); border-radius: 12px; padding: 5px 14px; font-weight: 800; font-size: calc(15px * var(--fs)); color: var(--lsDeep); }
.lb-work-qt { font-weight: 800; font-size: calc(19px * var(--fs)); }
/* the lines keep to one line each and line up; the notes take the rest of the width, or go under a line when the card is narrow */
.lb-work-lines { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 22px; row-gap: 6px; align-items: center; }
.w-row { display: contents; }
.w-line { font-size: calc(25px * var(--fs)); font-weight: 700; letter-spacing: .01em; padding-left: 18px; white-space: nowrap; }
@container (max-width: 560px) { .lb-work-lines { grid-template-columns: minmax(0, 1fr); row-gap: 2px; } .w-line { white-space: normal; padding-left: 8px; } .w-note { padding: 0 0 8px 22px; } .w-note:empty { display: none; } }
.w-note { color: var(--coral); font-weight: 700; font-size: calc(15.5px * var(--fs)); line-height: 1.4; }
.w-arrow { margin-right: 6px; }

/* questions to try */
.lb-check { padding: 18px 20px; border: 3px solid #2E8B3E; }
.lb-check-q { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.lb-q { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #2B7F39; color: #FFFFFF; font-weight: 900; font-size: 19px; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.lb-check-qt { font-weight: 800; font-size: calc(18px * var(--fs)); }
.lb-parts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; }
.lb-parts li { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.lb-let { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF; font-weight: 800; font-size: 15px; }
.lb-let.l0 { background: #C8453F; } .lb-let.l1 { background: #B0392F; } .lb-let.l2 { background: #962E26; } .lb-let.l3 { background: #74231D; }
.lb-part { background: var(--lsBg); border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: calc(18px * var(--fs)); }
.lb-ans { grid-column: 2; color: var(--coral); font-weight: 800; font-size: calc(20px * var(--fs)); padding-left: 4px; }
.lb-ans.one { display: block; margin-top: 8px; padding-left: 54px; }
.lb-reveal { margin-top: 14px; margin-left: 54px; min-height: 42px; padding: 8px 18px; border-radius: 999px; border: 2px solid #2B7F39; background: #FFFFFF; color: #1F5F2A; font-weight: 800; font-size: 14.5px; }
.lb-reveal:hover { background: #EEF8F0; }

/* a table */
.lb-table { padding: 6px; overflow-x: auto; }
.lb-table table { width: 100%; border-collapse: collapse; font-size: calc(16px * var(--fs)); }
.lb-table th, .lb-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid rgba(0,0,0,.09); vertical-align: top; }
.lb-table thead th { background: var(--lsBg); color: var(--lsDeep); font-weight: 800; border-bottom: 2px solid var(--lsLine); }
.lb-table thead th:first-child { border-top-left-radius: 12px; } .lb-table thead th:last-child { border-top-right-radius: 12px; }
.lb-table tbody th { font-weight: 800; color: var(--lsInk); }
.lb-table tr:last-child th, .lb-table tr:last-child td { border-bottom: 0; }
/* a multiplication grid (expanding brackets): a real grid, large and centred */
.lb-table.grid { padding: 14px; display: flex; justify-content: center; }
.lb-table.grid table { width: auto; border-collapse: separate; border-spacing: 6px; }
.lb-table.grid th, .lb-table.grid td { text-align: center; min-width: 76px; padding: 12px 14px; font-size: calc(22px * var(--fs)); font-weight: 800; border: 0; border-radius: 12px; }
.lb-table.grid thead th { background: var(--lsBg); color: var(--c4); }
.lb-table.grid thead th:first-child { background: transparent; color: var(--coral); }
.lb-table.grid tbody th { background: var(--lsBg); color: var(--c4); }
.lb-table.grid td { background: #EFE7FF; color: var(--kw); }

/* steps with arrows */
.lb-flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 38px; align-items: stretch; }
.lb-flow li { position: relative; flex: 1 1 140px; background: #FDFFFF; border-radius: 16px; border: 3px solid var(--tc); padding: 12px 14px; font-weight: 700; text-align: center; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.06); }
.lb-flow li + li::before { content: '→'; position: absolute; left: -31px; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 900; color: var(--lsDeep); }
/* p114: a column of steps ({ down: true }, or .stack, set by lessons.js when a row would wrap or squeeze a step past six
   lines) sizes each box to its words: the 140px basis above is a width in a row, and in a column it was each box's height */
.lb-flow.down ol, .lb-flow.stack ol { flex-direction: column; gap: 30px; }
.lb-flow.down li, .lb-flow.stack li { flex: 0 0 auto; }
.lb-flow.down li + li::before, .lb-flow.stack li + li::before { content: '↓'; left: 50%; top: -29px; transform: translateX(-50%); }
.lb-flow-back { text-align: right; font-weight: 800; color: var(--lsDeep); font-size: 14px; margin-top: 6px; }

/* a timeline */
.lb-time { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.lb-time::before { content: ''; position: absolute; left: 14px; top: 10px; bottom: 10px; border-left: 3px solid var(--lsLine); }
.lb-time li { position: relative; display: grid; grid-template-columns: minmax(110px, 22%) 1fr; gap: 12px; padding: 6px 0 6px 34px; align-items: baseline; }
.lb-time li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 21px; height: 21px; border-radius: 50%; background: var(--tc); border: 4px solid #FDFFFF; box-shadow: 0 0 0 2px var(--tc); box-sizing: border-box; }
.lt-l { font-weight: 800; color: var(--tc); }
.lt-t { background: #FDFFFF; border-radius: 12px; padding: 7px 12px; box-shadow: 0 3px 0 rgba(0,0,0,.05); }

/* a quotation */
.lb-quote { margin: 0; padding: 16px 20px; border-left: 8px solid var(--c1); }
.lb-quote blockquote { margin: 0; font-style: italic; font-size: calc(21px * var(--fs)); line-height: 1.45; font-weight: 600; }
.lb-quote blockquote::before { content: '“'; } .lb-quote blockquote::after { content: '”'; }
.lb-quote figcaption { margin-top: 4px; font-size: calc(14px * var(--fs)); color: var(--lsInk2); font-weight: 600; }
.lb-quote-m { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(0,0,0,.14); color: #0A5F5B; font-weight: 600; }

/* characters */
.lb-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lb-person { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 14px; border: 3px solid var(--tc); align-items: start; }
.lb-init { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; line-height: 1; flex: none; background: var(--tc); color: #FFFFFF; font-weight: 900; font-size: 19px; }
.lb-person b { display: block; color: var(--tc); font-size: calc(17px * var(--fs)); }
.lb-person div > span { display: block; font-size: calc(15.5px * var(--fs)); line-height: 1.45; }

/* the end of the lesson */
.ls-end { margin-top: 22px; padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; border: 3px solid var(--lsDeep); }
.ls-end-tick { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #2B7F39; color: #FFFFFF; display: grid; place-items: center; }
.ls-end-tick svg { width: 26px; height: 26px; }
.ls-end > div:nth-child(2) { flex: 1 1 260px; }
.ls-end b { display: block; font-size: calc(18px * var(--fs)); }
.ls-end span { color: var(--lsInk2); font-size: calc(15px * var(--fs)); }
.ls-end-b { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-end .btn.ghost { background: #FFFFFF; color: var(--lsInk); border: 2px solid var(--lsLine); }
.ls-end .btn.quiet { color: var(--lsInk); text-decoration: underline; }

/* dyslexia-friendly font and letter spacing reach the slides too */
body.dys .ls-slide, body.dys .ls-slide :not(svg, svg *) { font-family: var(--dysFont) !important; letter-spacing: .02em; word-spacing: .09em; }

/* ---------- the "Learn it first" card on an activity page ---------- */
.lesson-cta { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 16px; color: #1B2433; background-color: var(--lsBg); background-image: var(--lsPat); background-size: 160px 160px; border: 3px solid #FFFFFF; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.lesson-cta.sub-maths { --lsBg: #FBEFC6; --lsDeep: #7A5400; }
.lesson-cta.sub-science { --lsBg: #C9EFDB; --lsDeep: #0B6150; }
.lesson-cta.sub-english { --lsBg: #D1E8F8; --lsDeep: #134F8A; }
.lesson-cta .lc-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #FFFFFF; color: var(--lsDeep); box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.lesson-cta .lc-ico svg { width: 26px; height: 26px; }
.lesson-cta .lc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lesson-cta .lc-t b { font-size: 15.5px; color: var(--lsDeep); }
.lesson-cta .lc-t > span { font-size: 13.5px; color: #2E3747; }
.lesson-cta .lc-state { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px !important; font-weight: 700; color: #3F4A5C !important; margin-top: 2px; }
.lesson-cta .lc-state.done { color: #1E6E2F !important; }
.lesson-cta .lc-state svg { width: 14px; height: 14px; }
.lesson-cta .lc-go { flex: none; background: #0F2347; color: #FFFFFF; border: 0; min-height: 42px; }
.lesson-cta .lc-go:hover { background: #1A3563; }
.lesson-cta.none { background: transparent; background-image: none; border: 1px dashed var(--line); box-shadow: none; color: var(--muted); font-size: 13.5px; padding: 10px 12px; }
.lesson-cta.none svg { flex: none; width: 20px; height: 20px; color: var(--gold2); }
/* the Lesson button in a session's header, and the offer on a topic's first question */
.lesson-offer { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: #D1E8F8; color: #1B2433; border: 2px solid #FFFFFF; }
.lesson-offer.sub-maths { background: #FBEFC6; } .lesson-offer.sub-science { background: #C9EFDB; } .lesson-offer.sub-english { background: #D1E8F8; }
.lesson-offer svg { flex: none; width: 24px; height: 24px; color: #0F2347; }
.lesson-offer span { flex: 1; font-size: 14.5px; }
.lesson-offer .btn { flex: none; background: #0F2347; color: #FFFFFF; border: 0; min-height: 40px; }
.qhead .btn.lesson-btn svg { width: 16px; height: 16px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1040px) {
  .ls-body { grid-template-columns: minmax(0, 1fr); }
  .ls-side { display: none; }
  .ls-foot { display: flex; position: sticky; bottom: 0; background: var(--bg2); margin: 14px -18px 0; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(0,0,0,.25); }
  body.light .ls-foot { background: #FFFFFF; }
  /* the whole sheet scrolls, as on a phone: a slide scrolling inside a frame is awkward on a tablet */
  .ls-stage { padding: 0; }
  .ls-arrow { display: none; }
  .ls-scroll { max-height: none; overflow: visible; }
  .ls-slide { min-height: 0; }
}
@media (max-width: 760px) {
  .lesson { padding: 0; }
  .lesson .ls-wrap { min-height: 100vh; min-height: 100dvh; }
  .ls-top { padding: 10px 12px 8px; gap: 8px; }
  .ls-top h2 { font-size: calc(18px * var(--fs)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .ls-kick span, .ls-count { display: none; }
  .ls-stage { padding: 0; flex: 1; min-width: 0; }
  .ls-body { display: flex; flex-direction: column; flex: 1; align-items: stretch; }   /* not the grid's start: a slide fills the width (p124) */
  .ls-arrow { display: none; }
  .ls-scroll { max-height: none; overflow: visible; border-radius: 0; box-shadow: none; }
  .ls-slide { min-height: 0; padding: 16px 16px 20px; border-radius: 0; border-width: 0; }
  .ls-h { font-size: calc(22px * var(--fs)); margin-bottom: 12px; }
  .ls-slide { font-size: calc(16px * var(--fs)); }
  .ls-foot { margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .lb-cards.n2, .lb-cards.n3, .lb-cols, .lb-cols.wide-1, .lb-cols.wide-2, .lb-cols.fig-notes { grid-template-columns: minmax(0, 1fr); }
  .lb-parts { grid-template-columns: minmax(0, 1fr); }
  .lb-table th, .lb-table td { padding: 7px 8px; }
  .lb-table table { font-size: calc(15px * var(--fs)); }
  /* p125: a wide table of words, one block per row; the column headings stay for screen readers */
  .lb-table.wide { overflow: visible; }
  .lb-table.wide table, .lb-table.wide tbody, .lb-table.wide tr, .lb-table.wide th, .lb-table.wide td { display: block; width: auto; }
  .lb-table.wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .lb-table.wide tr { padding: 10px 8px; border-bottom: 1px solid rgba(0,0,0,.09); }
  .lb-table.wide tr:last-child { border-bottom: 0; }
  .lb-table.wide th, .lb-table.wide td { padding: 2px 0; border-bottom: 0; }
  .lb-table.wide tbody th { color: var(--lsDeep); font-size: calc(16px * var(--fs)); margin-bottom: 3px; }
  .lb-table.wide td:empty { display: none; }
  .lb-table.wide td[data-l]::before { content: attr(data-l) ": "; font-weight: 800; color: var(--lsInk); }
  /* a grid of short numbers (two dice) stays a grid, with smaller cells */
  .lb-table.grid { padding: 8px; }
  .lb-table.grid table { border-spacing: 3px; }
  .lb-table.grid th, .lb-table.grid td { min-width: 0; padding: 7px 5px; font-size: calc(16px * var(--fs)); border-radius: 8px; }
  .w-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .w-line { font-size: calc(21px * var(--fs)); padding-left: 4px; }
  .w-note { padding: 0 0 6px 18px; font-size: calc(14.5px * var(--fs)); }
  .lb-term { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lb-time li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .lb-flow ol { flex-direction: column; gap: 28px; }
  .lb-flow li { flex: 0 0 auto; }   /* p114: as tall as its words, not 140px */
  .lb-flow li + li::before { content: '↓'; left: 50%; top: -27px; transform: translateX(-50%); }
  .lb-big-t { font-size: calc(21px * var(--fs)); }
  .lb-quote blockquote { font-size: calc(18.5px * var(--fs)); }
  .lb-reveal, .lb-ans.one { margin-left: 0; padding-left: 16px; }
  .lb-ans.one { padding-left: 0; }
  .lesson-cta { flex-wrap: wrap; }
  .lesson-cta .lc-go { width: 100%; }
  .lesson-offer { flex-wrap: wrap; }
  .lesson-offer .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ls-slide.in { animation: none; } }

/* an example sentence and what it does (literary methods) */
.lb-ex { background: #FDFFFF; border-radius: 18px; box-shadow: 0 4px 0 rgba(0,0,0,.06), 0 10px 22px rgba(0,0,0,.06); padding: 14px 18px; border: 3px solid var(--c1); }
.lb-ex:nth-child(3n+2) { border-color: var(--c2); } .lb-ex:nth-child(3n) { border-color: var(--c4); }
.lb-ex-s { font-style: italic; font-weight: 600; font-size: calc(19px * var(--fs)); line-height: 1.45; }
.lb-ex-m { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.14); font-weight: 600; color: #0A5F5B; }
@media (max-width: 760px) { .lb-ex-s { font-size: calc(17.5px * var(--fs)); } }

/* p163: the activity page's lesson line, and the first screen inside an activity */
.lesson-note { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.lesson-note svg { flex: none; width: 20px; height: 20px; color: var(--gold2); margin-top: 0; }
.lesson-note b { color: var(--text); }
.intro-card { max-width: 760px; margin: 0 auto; }
.intro-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 20px; }
.intro-go { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 14px 16px; border-radius: 16px; text-align: left; font: inherit; cursor: pointer; border: 3px solid transparent; }
.intro-go .ig-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.intro-go .ig-ico svg { width: 26px; height: 26px; }
.intro-go .ig-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.intro-go .ig-t b { font-size: 17px; }
.intro-go .ig-t > span { font-size: 13.5px; margin-top: 2px; }
.intro-go.lesson { color: #1B2433; background-color: var(--lsBg); background-image: var(--lsPat); background-size: 160px 160px; border-color: #FFFFFF; }
.intro-go.lesson.sub-maths { --lsBg: #FBEFC6; --lsDeep: #7A5400; }
.intro-go.lesson.sub-science { --lsBg: #C9EFDB; --lsDeep: #0B6150; }
.intro-go.lesson.sub-english { --lsBg: #D1E8F8; --lsDeep: #134F8A; }
.intro-go.lesson .ig-ico { background: #FFFFFF; color: var(--lsDeep); }
.intro-go.lesson b { color: var(--lsDeep); }
.intro-go.lesson .ig-t > span { color: #2E3747; }
.intro-go.start { background: var(--goldGrad); color: #1B1405; box-shadow: 0 8px 22px rgba(201,163,39,.28); }
.intro-go.start .ig-ico { background: rgba(255,255,255,.55); color: #1B1405; }
.intro-go.start .ig-t > span { color: #3A2C08; }
.intro-go:focus-visible { outline: 3px solid var(--gold2); outline-offset: 2px; }
.intro-card .lit-more { margin-top: 16px; }
/* the activity page is one column now (the method card beside it is gone) */
.act-setup { max-width: 760px; }
/* the Method button in a question's header: gold and easy to spot; after a wrong answer it glows twice, slowly (no flashing) */
.qhead .btn.method-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; background: rgba(201,163,39,.12); border: 1px solid rgba(201,163,39,.55); color: var(--gold3); }
.qhead .btn.method-btn:hover { background: rgba(201,163,39,.22); }
.qhead .btn.method-btn svg { width: 16px; height: 16px; flex: none; }
body.light .qhead .btn.method-btn { background: rgba(201,163,39,.14); border-color: rgba(168,132,26,.6); color: #6B5208; }
@keyframes methodNudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(227,197,102,0); } 50% { box-shadow: 0 0 0 6px rgba(227,197,102,.5); background: rgba(201,163,39,.32); } }
.qhead .btn.method-btn.nudge { animation: methodNudge 1.2s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { .qhead .btn.method-btn.nudge { animation: none; box-shadow: 0 0 0 3px rgba(227,197,102,.55); } }
