/* book.css - the online book's look (notes_book.py; book_base.html,
   book_home.html, book_lesson.html; book.js adds the interactive classes).

   Owner, 28 Nov 2026: "very good looking notes ... but very clean"; then,
   after the first look: "the notes do not feel natural; on laptop, have the
   topics and subtopics on the left; when I click next, move me to next on
   top; slide very smooth; consistency everywhere; let the user know where
   they are at all times". So: one slim top bar that always says where you
   are (lesson, then the section you are reading, a line for how far through
   the lesson, a ring for the whole book); contents on the left on a laptop
   and in a slide-in panel on a phone (one component, both sizes); calm,
   book-like headings; every list card the same; slides that glide. The
   notes' own text colours (pack.css, scoped to .notes) stay as in the PDF.
   Phone first (owner rule: build at ~390 px, then widen).

   Map:
     1. tokens and base             7. list cards (one look for every list)
     2. top bar, settings, flash    8. exam radar, exam answers, past questions
     3. buttons and chips           9. slides (a gliding track)
     4. page layout and contents   10. up next, buy bar, toast, burst, motion
     5. contents page rows         11. reading settings, dark page, wide screens
     6. lesson header and notes */

/* ---- 1. Tokens and base ------------------------------------------------ */

/* Colours and sizes named once. Heat = how often the exam asks an area. */
:root {
    --bk-bg: #f6f7fb;
    --bk-card: #ffffff;
    --bk-ink: #14213d;
    --bk-muted: #64748b;
    --bk-line: #e6e9f0;
    --bk-soft-line: #f0f2f6;
    --bk-green: #0a7d3b;
    --bk-green-soft: #e8f6ee;
    --bk-blue: #2563eb;
    --bk-heat-1: #38bdf8;
    --bk-heat-2: #eab308;
    --bk-heat-3: #f97316;
    --bk-heat-4: #ef4444;
    --bk-bar-h: 58px;
    --bk-radius: 18px;
    --bk-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
    --bk-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -16px rgba(15, 23, 42, 0.22);
}
html { -webkit-text-size-adjust: 100%; }
body.bk {
    margin: 0;
    background: var(--bk-bg);
    color: var(--bk-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}
/* The contents panel is open on a phone: the page behind it does not scroll. */
body.bk-side-open { overflow: hidden; }
/* Links take the text colour around them. :where() keeps this rule at zero weight,
   so a link styled as a button (white on green) keeps its own colour: found in the
   Chrome test, 28 Nov 2026, "Get the notes" was dark on green. */
:where(.bk) a { color: inherit; }
/* Keyboard focus is always visible. */
.bk :focus-visible { outline: 2px solid var(--bk-green); outline-offset: 2px; }
/* "hidden" always hides. Several pieces here set their own display (the slide bar
   is flex), which would otherwise beat the hidden attribute: found in the Chrome
   test, 28 Nov 2026, when the slide bar showed in Read view. */
.bk [hidden] { display: none !important; }
/* Text for screen readers only. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- 2. Top bar, settings panel, flash messages ------------------------- */

/* The one bar on every book page: back, WHERE YOU ARE (title and a live second
   line), the book ring, contents (phone), settings. It never scrolls away. */
.bk-top {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 2px;
    height: var(--bk-bar-h); padding: 0 6px; box-sizing: border-box;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--bk-line);
}
/* Round icon buttons (back, contents, Aa). */
.bk-icon-btn {
    flex: none; display: grid; place-items: center;
    width: 42px; height: 42px; border: 0; border-radius: 50%;
    background: transparent; color: var(--bk-ink); cursor: pointer; text-decoration: none;
}
.bk-icon-btn:hover { background: #f1f4f8; }
.bk-icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bk-aa { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
/* Where you are: the lesson on the first line, the section being read on the second. */
.bk-top-mid { flex: 1; min-width: 0; padding: 0 6px; }
.bk-top-title { font-size: 14.5px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-top-sub { font-size: 12.5px; line-height: 1.35; color: var(--bk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s ease; }
.bk-top-sub b { color: var(--bk-green); }
.bk-top-sub.is-changing { opacity: 0.35; }
/* The whole book's progress: a small ring and the share done. */
.bk-pct {
    flex: none; display: inline-flex; align-items: center; gap: 5px;
    margin: 0 2px; padding: 3px 10px 3px 3px; border-radius: 999px;
    background: #f2f5f9; color: var(--bk-ink); font-size: 12.5px; font-weight: 800; text-decoration: none;
}
.bk-pct svg { width: 24px; height: 24px; transform: rotate(-90deg); }
.bk-pct circle { fill: none; stroke-width: 4.5; }
.bk-pct-bg { stroke: #e1e6ee; }
.bk-pct-fg { stroke: var(--bk-green); stroke-linecap: round; transition: stroke-dasharray 0.6s var(--bk-ease); }
/* The thin line along the bottom of the bar: how far through THIS lesson (or the
   book's share on the contents page). */
.bk-top-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.bk-top-line i { display: block; width: 0; height: 100%; background: var(--bk-green); border-radius: 0 3px 3px 0; transition: width 0.15s linear; }

/* The reading settings panel under the Aa button. */
.bk-prefs {
    position: fixed; top: calc(var(--bk-bar-h) + 4px); right: 10px; z-index: 40;
    width: 250px; padding: 8px 14px;
    background: var(--bk-card); border: 1px solid var(--bk-line); border-radius: 16px; box-shadow: var(--bk-shadow);
}
.bk-prefs-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.bk-prefs-row + .bk-prefs-row { border-top: 1px solid var(--bk-soft-line); }

/* Messages after a redirect. */
.bk-flash-wrap { max-width: 760px; margin: 12px auto 0; padding: 0 16px; }
.bk-flash { padding: 12px 14px; border-radius: 12px; background: #fff7e6; color: #7a4a00; font-size: 14px; }
.bk-flash.is-success { background: var(--bk-green-soft); color: var(--bk-green); }

/* ---- 3. Buttons, segmented controls, chips ------------------------------ */

/* A main action; a second, smaller line can sit inside (<small>). */
.bk-btn {
    display: inline-flex; flex-direction: column; justify-content: center;
    min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 1px solid transparent;
    font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.bk-btn small { font-size: 12.5px; font-weight: 500; opacity: 0.88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bk-btn-primary { background: var(--bk-green); color: #ffffff; }
.bk-btn-primary:hover { background: #086a32; }
.bk-btn-ghost { background: var(--bk-card); color: var(--bk-ink); border-color: var(--bk-line); }
/* Two or more options side by side (Read | Quick | Slides, A- | A+). */
.bk-seg { display: inline-flex; padding: 3px; gap: 2px; background: #eef1f5; border-radius: 12px; }
.bk-seg button {
    border: 0; background: transparent; color: var(--bk-muted);
    padding: 8px 13px; border-radius: 9px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.bk-seg button[aria-pressed="true"] { background: var(--bk-card); color: var(--bk-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
/* A switch that stays on (Test me). */
.bk-chip {
    border: 1px solid var(--bk-line); background: var(--bk-card); color: var(--bk-ink);
    padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.bk-chip[aria-pressed="true"] { background: var(--bk-ink); border-color: var(--bk-ink); color: #ffffff; }
/* A small label ("Free"). */
.bk-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--bk-green-soft); color: var(--bk-green); font-size: 11.5px; font-weight: 700; }

/* ---- 4. Page layout and the contents panel ------------------------------ */

/* The reading column; room at the foot for the buy bar and slide controls. */
.bk-main { max-width: 760px; margin: 0 auto; padding: 16px 14px 140px; min-width: 0; }

/* The contents panel (lesson pages). Phone: slides in from the left over a dim
   page. Laptop (section 11): always there, on the left, beside the notes. */
.bk-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: min(88vw, 380px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 40px; box-sizing: border-box;
    background: var(--bk-card); box-shadow: 12px 0 40px -20px rgba(15, 23, 42, 0.5);
    transform: translateX(-105%); visibility: hidden;
    transition: transform 0.3s var(--bk-ease), visibility 0s linear 0.3s;
}
body.bk-side-open .bk-side { transform: none; visibility: visible; transition: transform 0.3s var(--bk-ease); }
.bk-scrim {
    position: fixed; inset: 0; z-index: 45; background: rgba(15, 23, 42, 0.38);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
body.bk-side-open .bk-scrim { opacity: 1; pointer-events: auto; }
/* The panel's head stays at its top: name and Hide, what is done and not yet,
   the time left and the finish date at the reader's pace, and the filter. */
.bk-side-head {
    position: sticky; top: 0; z-index: 2;
    padding: 12px 16px 12px; box-sizing: border-box;
    background: var(--bk-card); border-bottom: 1px solid var(--bk-line); font-size: 14px;
}
.bk-side-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bk-side-title a { text-decoration: none; font-size: 15px; }
.bk-side-hide {
    border: 1px solid var(--bk-line); background: var(--bk-card); color: var(--bk-muted);
    padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.bk-side-hide:hover { color: var(--bk-ink); border-color: #d3d9e3; }
.bk-side-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; font-size: 13px; color: var(--bk-muted); }
.bk-side-stats b { font-size: 15px; }
.bk-side-stats .is-done b { color: var(--bk-green); }
.bk-side-stats .is-left b { color: var(--bk-ink); }
.bk-side-time { margin-left: auto; }
.bk-side-eta { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--bk-muted); }
.bk-side-eta b { color: var(--bk-ink); }
/* The filter (the same control in the lesson panel and on the contents page):
   All, Not yet, Done, HOT. Its buttons share the width; HOT wears the radar's red. */
.bk-filter { display: flex; }
.bk-filter button { flex: 1; white-space: nowrap; }
.bk-filter .is-hot { color: #c81e1e; }
.bk-filter .is-hot small { font-size: 11px; font-weight: 800; opacity: 0.8; }
.bk-filter .is-hot[aria-pressed="true"] { background: #fff1f2; color: #b91c1c; }
/* What each filter hides: "Not yet" the finished lessons, "Done" the rest, "HOT" all
   but the most asked (data-heat 4). A topic, a part or a panel section with nothing
   left to show folds away with them. */
.bk-filterable.show-left .bk-row.is-read,
.bk-filterable.show-done .bk-row:not(.is-read),
.bk-filterable.show-hot .bk-row:not([data-heat="4"]) { display: none; }
.bk-filterable.show-left .bk-group:not(:has(.bk-row:not(.is-read))),
.bk-filterable.show-done .bk-group:not(:has(.bk-row.is-read)),
.bk-filterable.show-hot .bk-group:not(:has(.bk-row[data-heat="4"])) { display: none; }
.bk-filterable.show-left .bk-part:not(:has(.bk-row:not(.is-read))),
.bk-filterable.show-done .bk-part:not(:has(.bk-row.is-read)),
.bk-filterable.show-hot .bk-part:not(:has(.bk-row[data-heat="4"])) { display: none; }
.bk-filterable.show-done .bk-row.is-current:not(.is-read) + .bk-sections,
.bk-filterable.show-left .bk-row.is-current.is-read + .bk-sections,
.bk-filterable.show-hot .bk-row.is-current:not([data-heat="4"]) + .bk-sections { display: none; }
/* While filtering, the panel's part names step aside (each group keeps its topic
   name), and an empty filter says so in words. */
.bk-filterable:is(.show-left, .show-done, .show-hot) .bk-side-part { display: none; }
.bk-side-empty { margin: 18px 16px; font-size: 13.5px; line-height: 1.5; color: var(--bk-muted); }
/* On the contents page the filter stays under the bar while the list scrolls. */
.bk-filterbar { position: sticky; top: calc(var(--bk-bar-h) + 8px); z-index: 10; margin: 18px 0 0; box-shadow: 0 6px 18px -14px rgba(15, 23, 42, 0.4); }
.bk-contents .bk-side-empty { margin: 22px 4px; }
/* A finished lesson reads as finished: a green tick and a softer title. */
.bk-row.is-read .bk-row-title { color: var(--bk-muted); }
.bk-row.is-read.is-current .bk-row-title { color: var(--bk-ink); }
.bk-side-part { margin: 18px 16px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bk-muted); }
.bk-side-topic { margin: 12px 16px 2px; font-size: 13.5px; font-weight: 700; }
.bk-side .bk-row { min-height: 46px; padding: 8px 16px; grid-template-columns: 20px 1fr auto; gap: 10px; }
.bk-side .bk-row-title { font-size: 14px; }
/* The current lesson's own sections, under its row: the one being read is lit. */
.bk-sections { margin: 2px 0 10px 46px; border-left: 2px solid var(--bk-line); }
.bk-sec {
    display: block; margin-left: -2px; padding: 6px 12px; border-left: 2px solid transparent;
    font-size: 13px; line-height: 1.35; color: var(--bk-muted); text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.bk-sec:hover { color: var(--bk-ink); }
.bk-sec.is-exam::before { content: "Exam "; font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; color: var(--bk-blue); }
.bk-sec.on { color: var(--bk-green); border-left-color: var(--bk-green); font-weight: 700; }

/* ---- 5. Contents page (book_home.html) and contents rows ---------------- */

/* The hero card: the book, its version, progress or the offer. */
.bk-hero { padding: 22px 20px; background: var(--bk-card); border: 1px solid var(--bk-line); border-radius: 22px; box-shadow: var(--bk-shadow); }
.bk-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bk-green); }
.bk-hero h1 { margin: 6px 0 4px; font-size: 24px; line-height: 1.2; }
.bk-version { margin: 0 0 18px; font-size: 13px; color: var(--bk-muted); }
/* Ring on the left, count and Continue on the right. */
.bk-hero-progress { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; }
.bk-ring, .bk-ring-text { grid-area: 1 / 1; width: 96px; height: 96px; }
.bk-ring { transform: rotate(-90deg); }
.bk-ring circle { fill: none; stroke-width: 11; }
.bk-ring-bg { stroke: #edf0f5; }
.bk-ring-fg { stroke: var(--bk-green); stroke-linecap: round; transition: stroke-dasharray 0.8s var(--bk-ease); }
.bk-ring-text { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.bk-ring-text b { font-size: 24px; }
.bk-ring-text span { font-size: 12px; color: var(--bk-muted); }
.bk-hero-side { grid-column: 2; min-width: 0; }
.bk-hero-count { margin: 0 0 10px; font-size: 15px; color: var(--bk-muted); }
.bk-hero-count b { color: var(--bk-ink); font-size: 17px; }
.bk-hero-eta { margin: -4px 0 12px; font-size: 13px; line-height: 1.45; color: var(--bk-muted); }
.bk-hero-eta b { color: var(--bk-ink); }
.bk-hero-side .bk-btn { width: 100%; box-sizing: border-box; }
.bk-hero-note { margin: 0; font-size: 14px; }
/* The visitor's offer: free lesson first, then buying. */
.bk-offer { display: flex; flex-direction: column; gap: 10px; }
.bk-offer-note { margin: 2px 0 0; font-size: 13px; color: var(--bk-muted); }
.bk-legend { display: flex; align-items: center; gap: 8px; margin: 18px 4px 0; font-size: 12.5px; color: var(--bk-muted); }

/* A part, then its topics as cards of lesson rows. */
.bk-part { margin-top: 26px; }
.bk-part-title { margin: 0 4px 10px; font-size: 13px; font-weight: 700; color: var(--bk-muted); }
.bk-part-title span { display: inline-block; margin-right: 6px; padding: 2px 9px; border-radius: 999px; background: var(--bk-ink); color: #ffffff; font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.bk-topic { margin: 0 0 12px; background: var(--bk-card); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); overflow: hidden; box-shadow: var(--bk-shadow); }
.bk-topic-head { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 14px 16px 10px; }
.bk-topic-n { grid-column: 1; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bk-green); }
.bk-topic-title { grid-column: 1; font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.bk-topic-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 4px 10px; border-radius: 999px; background: #f1f4f8; font-size: 12.5px; font-weight: 700; color: var(--bk-muted); white-space: nowrap; }
.bk-topic-count.is-done { background: var(--bk-green-soft); color: var(--bk-green); }

/* One lesson row (contents page and panel): mark, title and minutes, exam radar. */
.bk-row {
    display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center;
    min-height: 54px; padding: 10px 16px; border-top: 1px solid var(--bk-soft-line);
    color: var(--bk-ink); text-decoration: none;
}
.bk-topic > .bk-row:first-child { border-top: 0; }
.bk-row:hover { background: #fafbfd; }
.bk-row.is-current { background: var(--bk-green-soft); box-shadow: inset 3px 0 0 var(--bk-green); }
.bk-row-main { min-width: 0; }
.bk-row-title { display: block; font-size: 15px; line-height: 1.35; }
.bk-row-title b { color: var(--bk-muted); font-weight: 700; margin-right: 2px; }
.bk-row-meta { display: block; margin-top: 2px; font-size: 12.5px; color: var(--bk-muted); }
.bk-row.is-locked .bk-row-title { color: #6b7385; }
/* The status mark: empty ring, half ring while reading, green tick when read, lock. */
.bk-mark { width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box; border: 2px solid #cfd6e1; position: relative; }
.bk-row.is-reading .bk-mark { border-color: var(--bk-green); background: conic-gradient(var(--bk-green) 0 50%, transparent 50% 100%); }
.bk-row.is-read .bk-mark { border-color: var(--bk-green); background: var(--bk-green); }
.bk-row.is-read .bk-mark::after {
    content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
    border: solid #ffffff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.bk-row.is-locked .bk-mark {
    border: 0; border-radius: 0;
    background: no-repeat center / 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}

/* ---- 6. Lesson header and the notes ------------------------------------ */

.bk-head { padding: 6px 2px 2px; }
.bk-head h1 { margin: 6px 0 10px; font-size: 26px; line-height: 1.22; letter-spacing: -0.01em; }
.bk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; color: var(--bk-muted); }
/* The lesson's status chip. */
.bk-status { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #fff4e0; color: #9a5b00; }
.bk-status.is-read { background: var(--bk-green-soft); color: var(--bk-green); }
.bk-status.is-read::before { content: "\2713\00a0"; }
.bk-status.is-free { background: #eef2ff; color: #4338ca; }
/* The view tools under the header. */
.bk-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 12px; }

/* The notes: one white page, book-like type; size from the reading settings.
   Anything the reader jumps to stops just under the top bar (scroll-margin). */
.notes {
    padding: 20px 18px 10px; margin: 0 -4px;
    background: var(--bk-card); border: 1px solid var(--bk-line); border-radius: 22px; box-shadow: var(--bk-shadow);
    font-family: inherit; font-size: 16.5px; line-height: 1.68; overflow-wrap: anywhere;
    scroll-margin-top: calc(var(--bk-bar-h) + 12px);
}
.notes [id^="sec-"] { scroll-margin-top: calc(var(--bk-bar-h) + 14px); }
/* Calm, consistent headings for a screen (pack.css prints them as colour bars):
   dark text, one thin green marker, the same rhythm everywhere. */
.notes h2, .notes h3, .notes h3.calc, .notes h4 {
    background: none; color: var(--bk-ink); border: 0; border-radius: 0; box-shadow: none;
    line-height: 1.3; letter-spacing: -0.005em;
}
.notes h2 { font-size: 1.25em; padding: 0; margin: 1.6em 0 0.6em; }
.notes h3, .notes h3.calc { font-size: 1.14em; padding: 0 0 0 0.7em; margin: 1.8em 0 0.6em; box-shadow: inset 3px 0 0 var(--bk-green); }
.notes h4 { font-size: 1.04em; padding: 0; margin: 1.6em 0 0.5em; }
.notes h3 > .odds { font-size: 0.68em; }
.notes .slide:first-child > :first-child, .notes > :first-child { margin-top: 0; }
.notes p { margin: 0 0 0.85em; }
.notes ul, .notes ol { padding-left: 1.35em; margin: 0 0 0.95em; }
.notes li { margin-bottom: 0.4em; }
.notes .say { margin-top: 0.15em; font-size: 0.95em; }
/* The callout boxes: same colours as the PDF, one shape everywhere. */
.notes .plain, .notes .trap, .notes .tip, .notes .key, .notes .asked, .notes .model,
.notes .case, .notes .practice, .notes .exam, .notes .q, .notes .facts, .notes .mixup {
    border-radius: 16px; padding: 0.95em 1.05em; margin: 1.3em 0; border-left-width: 4px;
}
/* The print-only list band down the margin: the list card names the list instead. */
.notes ul[data-band], .notes ol[data-band] { padding-right: 0; }
.notes ul[data-band]::after, .notes ol[data-band]::after { display: none; }
/* The lesson title inside the notes repeats the header: hidden. Written as
   :is(h2, h3).bk-dup so it outweighs pack.css "h3:has(> .odds) { display: flex }". */
.notes :is(h2, h3).bk-dup { display: none; }
/* The video link line under a topic. */
.notes .ad a { text-decoration: underline; text-underline-offset: 2px; }
/* A "(-> 1.4)" reference: a small chip that opens that sub-topic. */
.notes a.goto { display: inline-block; padding: 0 0.4em; border-radius: 6px; background: #eaf1ff; color: #1d4ed8; font-weight: 700; text-decoration: none; }
/* Wide tables scroll inside their own box. */
.notes .bk-table { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1em 0; border-radius: 12px; }
.notes .bk-table table { margin: 0; font-size: 0.9em; }
/* "Kenya in numbers" side notes (pack.css floats them to the right, 38% wide). On a
   narrow column there is no room beside them, so, as the phone PDF does
   (phone-slides.css), they sit full width in the flow. Found in the Chrome test,
   28 Nov 2026: at 390 px the list card next to one was squeezed to a sliver. */
@media (max-width: 699px) {
    .notes .facts { float: none; width: auto; margin: 1.2em 0; font-size: 0.86em; }
}

/* Quick revise (owner, 28 Nov 2026: "for someone without time ... still get value").
   Kept: headings, list cards with each point's one-line meaning, bold-led lines
   ("What it is: ..."), exam questions, past questions, rhythm lines, traps, key
   facts, "Don't mix them up" and tables. Hidden: other paragraphs, everyday and
   at-work examples, the plain-terms, practice, case and numbers boxes, video links. */
.notes.is-quick .slide > p:not(.rhythm):not(:has(> strong:first-child)),
.notes.is-quick .slide > :is(.plain, .practice, .case, .facts, .tip, .ad),
.notes.is-quick .lay, .notes.is-quick .acc { display: none; }
.bk-quick-note { margin: -4px 4px 12px; font-size: 13.5px; color: var(--bk-muted); }
.bk-quick-note b { color: var(--bk-green); }

/* ---- 7. List cards: one look for every list ----------------------------- */

/* A list becomes a card: its name, how many points, its own Test me, numbered
   points. Every card looks the same (owner: "consistency everywhere"). */
.notes .lcard {
    --ac: var(--bk-blue); --ac-soft: #f4f7fe; --ac-line: #e3e9f6;
    margin: 1.3em 0; padding: 0 0 0.4em;
    background: #ffffff; border: 1px solid var(--ac-line); border-radius: 16px; overflow: hidden;
}
.notes .lcard-head { display: flex; align-items: center; gap: 10px; padding: 0.6em 0.9em 0.6em 1em; background: var(--ac-soft); border-bottom: 1px solid var(--ac-line); }
.notes .lcard-name { flex: 1; min-width: 0; font-size: 0.72em; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ac); line-height: 1.35; }
.notes .lcard-count { font-size: 0.72em; font-weight: 700; color: var(--bk-muted); white-space: nowrap; }
.notes .lcard-test {
    flex: none; padding: 0.35em 0.85em; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--ac-line); background: #ffffff; color: var(--ac); font: inherit; font-size: 0.74em; font-weight: 800;
}
.notes .lcard.is-testing .lcard-test { background: var(--ac); border-color: var(--ac); color: #ffffff; }
.notes .lcard.is-testing .lcard-count::after { content: " \00b7  tap to reveal"; }
/* Everything in the card keeps clear of its edges. */
.notes .lcard > :not(.lcard-head) { margin-left: 1em; margin-right: 1em; }
.notes .lcard > p:nth-child(2) { margin-top: 0.85em; }
.notes .lcard > p.where { color: var(--bk-muted); }
/* Numbered points in round badges. */
.notes .lcard > ul, .notes .lcard > ol { list-style: none; counter-reset: pt; padding: 0; margin-top: 0.8em; }
.notes .lcard > ul > li, .notes .lcard > ol > li { counter-increment: pt; position: relative; padding: 0.5em 0 0.5em 2.2em; margin: 0; }
.notes .lcard > ul > li + li, .notes .lcard > ol > li + li { border-top: 1px dashed #eceff4; }
.notes .lcard > ul > li::before, .notes .lcard > ol > li::before {
    content: counter(pt); position: absolute; left: 0; top: 0.6em;
    display: grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 50%;
    background: var(--ac); color: #ffffff; font-size: 0.8em; font-weight: 800; text-shadow: none;
}
.notes .lcard li ul { list-style: disc; padding-left: 1.2em; }
/* A one-line list that only holds the real list (book.js is-wrapper): no badge on
   the line; the inner list keeps its own numbers. */
.notes .lcard.is-wrapper > ul > li, .notes .lcard.is-wrapper > ol > li { padding-left: 0; }
.notes .lcard.is-wrapper > ul > li::before, .notes .lcard.is-wrapper > ol > li::before { display: none; }
/* The rhythm line closes the card. */
.notes .lcard .rhythm { margin-top: 0.4em; margin-bottom: 0.6em; padding: 0.5em 0.8em; border-radius: 12px; background: var(--ac-soft); }
/* Test me: each point blurred until tapped; the number stays, so the count is known. */
.notes .lcard.is-testing > ul > li:not(.is-shown), .notes .lcard.is-testing > ol > li:not(.is-shown) { cursor: pointer; }
.notes .lcard.is-testing > ul > li:not(.is-shown), .notes .lcard.is-testing > ul > li:not(.is-shown) *,
.notes .lcard.is-testing > ol > li:not(.is-shown), .notes .lcard.is-testing > ol > li:not(.is-shown) * {
    color: transparent; text-shadow: 0 0 9px rgba(20, 33, 61, 0.5); border-left-color: transparent;
}
.notes .lcard.is-testing li.is-shown { animation: bk-pop 0.25s ease; }

/* ---- 8. What might be examined: radar, exam answers, past questions ----- */

/* The exam radar: four bars, lit by heat, and its word. */
.bk-radar { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.bk-radar-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 15px; }
.bk-radar-bars i { width: 4px; border-radius: 2px; background: #e2e7ef; }
.bk-radar-bars i:nth-child(1) { height: 6px; }
.bk-radar-bars i:nth-child(2) { height: 9px; }
.bk-radar-bars i:nth-child(3) { height: 12px; }
.bk-radar-bars i:nth-child(4) { height: 15px; }
.bk-radar.heat-1 i.on { background: var(--bk-heat-1); }
.bk-radar.heat-2 i.on { background: var(--bk-heat-2); }
.bk-radar.heat-3 i.on { background: var(--bk-heat-3); }
.bk-radar.heat-4 i.on { background: var(--bk-heat-4); }
.bk-radar-label { font-size: 12px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.bk-radar.heat-1 .bk-radar-label { color: #0284c7; }
.bk-radar.heat-2 .bk-radar-label { color: #a16207; }
.bk-radar.heat-3 .bk-radar-label { color: #c2410c; }
.bk-radar.heat-4 .bk-radar-label { color: #dc2626; }
/* In a contents row only the bars show on a phone (the title needs the room). */
.bk-radar.is-small .bk-radar-label { display: none; }
/* The lesson's exam strip: radar and the notes' words, on the heat's soft colour. */
.bk-exam-odds { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; border: 1px solid transparent; }
.bk-exam-odds.heat-1 { background: #f0f9ff; border-color: #d4eefc; }
.bk-exam-odds.heat-2 { background: #fefce8; border-color: #f6ebb0; }
.bk-exam-odds.heat-3 { background: #fff7ed; border-color: #fddcbd; }
.bk-exam-odds.heat-4 { background: #fff1f2; border-color: #fecdd3; }
.bk-exam-odds .bk-radar-label { display: none; }

/* An IN THE EXAM box: the question shows, the answer waits behind a button. */
.notes .exam-reveal {
    display: block; width: 100%; margin: 0.7em 0 0.1em; padding: 0.8em 1em; cursor: pointer;
    border: 1.5px dashed #2979ff; border-radius: 12px; background: #ffffff; color: #1d4ed8;
    font: inherit; font-size: 0.9em; font-weight: 800;
}
.notes .exam-reveal[aria-expanded="true"] { border-style: solid; background: transparent; padding: 0.5em 1em; font-size: 0.82em; }
.notes .exam-answer { margin-top: 0.8em; animation: bk-pop 0.25s ease; }

/* The EXAM AREA: past sittings as a timeline, newest first. */
.notes .asked { background: #ffffff; border: 1px solid #fde3c8; border-top: 4px solid var(--bk-heat-3); border-left-width: 1px; }
.notes .asked > ul { list-style: none; padding-left: 0; margin-left: 0.35em; border-left: 2px solid #fde3c8; }
.notes .asked > ul > li { position: relative; padding: 0.15em 0 0.5em 1.05em; margin: 0; }
.notes .asked > ul > li::before {
    content: ""; position: absolute; left: -6px; top: 0.55em;
    width: 10px; height: 10px; border-radius: 50%; background: var(--bk-heat-3); box-shadow: 0 0 0 3px #ffffff;
}
.notes .asked.is-collapsed .bk-more { display: none; }
.notes .asked-more {
    margin: 0.3em 0 0; padding: 0.45em 0.9em; border-radius: 999px; cursor: pointer;
    border: 1px solid #fcd9b6; background: #fff7ef; color: #c2410c; font: inherit; font-size: 0.82em; font-weight: 800;
}

/* ---- 9. Slides: a track of cards that glides ---------------------------- */

/* Read view: the track and its slides are plain wrappers. */
.notes .bk-track, .notes .slide { display: block; }
/* Slides view: the notes become a window one slide wide; the track holds every
   slide side by side and moves (book.js sets --i, the slide shown). The window's
   height follows the slide shown, gently. A finger drags the track horizontally;
   up and down still scroll the page (touch-action: pan-y). */
.notes.is-slides {
    background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0;
    overflow: hidden; touch-action: pan-y; transition: height 0.4s var(--bk-ease);
}
.notes.is-slides .bk-track {
    display: flex; align-items: flex-start; gap: 16px;
    transform: translateX(calc(var(--i, 0) * -1 * (100% + 16px)));
    transition: transform 0.5s var(--bk-ease); will-change: transform;
}
/* While a finger drags, the track follows it exactly (no easing). */
.notes.is-slides .bk-track.is-dragging { transition: none; }
.notes.is-slides .slide {
    flex: 0 0 100%; min-width: 0; box-sizing: border-box; min-height: 50vh;
    padding: 1.3em 1.15em; background: var(--bk-card); border: 1px solid var(--bk-line); border-radius: 22px;
}
.notes.is-slides .slide > :first-child { margin-top: 0; }
.notes.is-slides .slide > :last-child { margin-bottom: 0; }
/* The slide controls stay at the foot of the screen. */
.bk-slidebar {
    position: sticky; bottom: 12px; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 14px 0 0; padding: 8px; border-radius: 18px;
    background: rgba(255, 255, 255, 0.96); border: 1px solid var(--bk-line); box-shadow: var(--bk-shadow);
}
.bk-slidebar .bk-btn { min-width: 64px; align-items: center; font-size: 20px; padding: 8px 18px; }
.bk-slide-count { font-size: 14px; color: var(--bk-muted); }
.bk-slide-count b { color: var(--bk-ink); }
/* The end-of-lesson marker (Read and Quick; the last slide counts in Slides). */
.bk-end { height: 1px; }

/* ---- 10. Up next, buy bar, toast, burst, motion ------------------------- */

.bk-next { margin-top: 28px; }
.bk-next-label { margin: 0 4px 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bk-muted); }
/* The next lesson as one big card with an arrow. */
.bk-next-card {
    position: relative; display: grid; gap: 4px; padding: 16px 56px 16px 18px;
    background: var(--bk-card); border: 1px solid var(--bk-line); border-radius: 20px; box-shadow: var(--bk-shadow);
    text-decoration: none; color: var(--bk-ink); transition: transform 0.15s ease;
}
.bk-next-card:hover { transform: translateY(-1px); }
.bk-next-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bk-green); }
.bk-next-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.bk-next-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--bk-muted); }
.bk-next-go { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bk-green); color: #ffffff; font-size: 18px; }
.bk-prev { display: inline-block; margin: 14px 4px 0; font-size: 14px; color: var(--bk-muted); text-decoration: none; }

/* A visitor on the free lesson: the offer pinned to the bottom. */
.bk-buybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--bk-line); box-shadow: 0 -8px 24px -18px rgba(15, 23, 42, 0.35);
}
.bk-buybar span { display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.bk-buybar small { color: var(--bk-muted); font-size: 12.5px; }
.bk-buybar .bk-btn { min-height: 44px; padding: 8px 16px; }

/* Short messages at the foot of the screen. */
.bk-toast {
    position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60;
    transform: translateX(-50%); max-width: calc(100% - 32px); box-sizing: border-box;
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px;
    background: var(--bk-ink); color: #ffffff; font-size: 14px; font-weight: 600; box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.6);
    animation: bk-toast-in 0.2s ease;
}
body:has(.bk-buybar) .bk-toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
body.bk-slides-on .bk-toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
.bk-toast-btn { flex: none; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.35); background: transparent; color: #ffffff; font: inherit; font-size: 13px; cursor: pointer; }

/* The "lesson read" burst: dots flying out from the middle, then gone. */
.bk-burst { position: fixed; left: 50%; top: 42%; z-index: 70; width: 0; height: 0; pointer-events: none; }
.bk-burst i {
    position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
    animation: bk-burst 1.1s ease-out forwards;
}
.bk-burst i.c0 { background: #2563eb; }
.bk-burst i.c1 { background: #7c3aed; }
.bk-burst i.c2 { background: #0d9488; }
.bk-burst i.c3 { background: #ea580c; }
.bk-burst i.c4 { background: #db2777; }
.bk-burst i.c5 { background: var(--bk-green); }

/* Motion. */
@keyframes bk-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes bk-toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes bk-burst {
    0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(-130px) scale(0.6); }
}
/* A reader who asked for less motion gets none of it (slides then switch at once). */
@media (prefers-reduced-motion: reduce) {
    .bk *, .bk *::before, .bk *::after { animation: none !important; transition: none !important; }
    .bk-burst { display: none; }
}

/* ---- 11. Reading settings, dark page, wide screens ---------------------- */

/* Text size steps (book_prefs.js puts one class on <html>). */
html.bk-size-1 .notes { font-size: 14.5px; }
html.bk-size-2 .notes { font-size: 15.5px; }
html.bk-size-3 .notes { font-size: 16.5px; }
html.bk-size-4 .notes { font-size: 18px; }
html.bk-size-5 .notes { font-size: 19.5px; }

/* Dark page: the chrome turns dark, and the notes are inverted with their hues
   turned back, which keeps every colour recognisable without a second palette. */
html.bk-dark body.bk { background: #0d111a; color: #e6e9ef; }
html.bk-dark .bk-top { background: rgba(17, 22, 33, 0.95); border-color: #232a3a; }
html.bk-dark .bk-icon-btn { color: #e6e9ef; }
html.bk-dark .bk-icon-btn:hover { background: #1c2333; }
html.bk-dark .bk-pct { background: #1c2333; color: #e6e9ef; }
html.bk-dark .bk-pct-bg { stroke: #2c3548; }
html.bk-dark .bk-hero, html.bk-dark .bk-topic, html.bk-dark .bk-next-card, html.bk-dark .bk-side,
html.bk-dark .bk-side-head, html.bk-dark .bk-prefs, html.bk-dark .bk-buybar, html.bk-dark .bk-slidebar {
    background: #151b28; border-color: #232a3a; color: #e6e9ef;
}
html.bk-dark .bk-row { color: #e6e9ef; border-color: #1f2636; }
html.bk-dark .bk-row:hover { background: #1a2130; }
html.bk-dark .bk-row.is-current { background: #12301f; }
html.bk-dark .bk-sections { border-color: #2c3548; }
html.bk-dark .bk-seg { background: #1c2333; }
html.bk-dark .bk-seg button[aria-pressed="true"], html.bk-dark .bk-chip, html.bk-dark .bk-btn-ghost { background: #232b3d; color: #e6e9ef; border-color: #2c3548; }
html.bk-dark .bk-topic-count { background: #1f2636; }
html.bk-dark .bk-exam-odds { filter: brightness(0.92); color: var(--bk-ink); }
html.bk-dark .notes { filter: invert(0.92) hue-rotate(180deg); }

/* Wider screens: more room, the radar's word shows in the rows too. */
@media (min-width: 560px) {
    .bk-main { padding: 22px 20px 140px; }
    .bk-radar.is-small .bk-radar-label { display: inline; font-size: 11px; }
    .notes { padding: 28px 30px 12px; margin: 0; }
    .notes.is-slides .slide { padding: 1.6em 1.7em; }
    .bk-hero { padding: 28px; }
    .bk-hero h1 { font-size: 28px; }
}
/* Laptop (owner: "on laptop, have the topics and subtopics on the left ... hide
   if I click hide ... not an overlay but part of the page"): the contents panel
   is a column of the page on the left, no dimming; the reading column sits
   beside it. "Hide" slides the column away and the reading column takes the
   room; the contents button on the bar brings it back. book_prefs.js puts
   bk-side-hidden on <html> before the first paint, so the choice holds on
   every lesson without a flash. */
@media (min-width: 960px) {
    .bk-layout { display: flex; align-items: flex-start; }
    .bk-side {
        position: sticky; top: var(--bk-bar-h); z-index: 5;
        flex: 0 0 340px; width: 340px; height: calc(100vh - var(--bk-bar-h));
        transform: none; visibility: visible; box-shadow: none;
        border-right: 1px solid var(--bk-line);
        transition: margin-left 0.35s var(--bk-ease), opacity 0.3s ease;
    }
    html.bk-side-hidden .bk-side { margin-left: -341px; opacity: 0; pointer-events: none; }
    .bk-scrim { display: none; }
    body.bk-side-open { overflow: auto; }
    .bk-main { flex: 1 1 auto; max-width: 820px; }
    .bk-head h1 { font-size: 30px; }
    .notes { padding: 34px 40px 16px; }
}
