/* course/course-page.css
   ===================================================================
   The course page (course/course-page.js). Ported from the approved
   mockup's styles for hybrid.html (docs/mockups/course-page/shared/
   course.css, a.css and h.css), together with every figure-kit rule of
   course.css and the route rules of h.css, whether or not hybrid.html
   uses them, since the covers draw with any of them. The changes:

   - Every rule is under .cp, the page's root; there is no global reset.
     The mockup's .wrap and .btn are .cp-wrap and .cp-btn.
   - Colours come only from the theme tokens (design/tokens.css), so a
     theme switch recolours the route and the figures without a redraw.
     The figure tokens are defined here from them, because
     design/widget-figure.css is not loaded at boot.
   - The book's series hue (data-hue on the root) colours the hero
     figure's second series, and only it, through --fig-s with a text
     variant --fig-s-tx; thumbnails keep the kit's slate. Both meet
     contrast floors on the page in either theme (see .cp below).
   - The layout follows the page's own width (container queries on .cp),
     not the window's: in the app the page sits beside the sidebar. An
     engine without container queries gets the same tiers from @media
     rules at the matching window widths. The hero sits beside the title
     from an 820 px page. Its text column keeps 500 px from an 868 px
     page and 440 px below that; course-page.js picks the title's size
     step for each column (and for a 300 px phone column), so that its
     longest word fits.
   - The app's reading rules (design/lesson-prose.css, as
     body[data-view="textbooks"] #ct h1, h2, h3 and p) carry an id, which
     no class rule outranks. Every rule here whose element is an h1, h2 or
     p is therefore written .cp:not(#cp-w): #cp-w matches nothing, so the
     :not() only lends the rule an id's weight. Those rules set the font,
     the colour and every margin they need.
   - Segment mode for the route (narrow screens) and the part toggle's
     hidden lists are new; the mockup had neither.
   =================================================================== */

/* ---------- the root: tokens, type, container ---------- */
.cp {
  /* this sheet applied: app.js (_courseSheetIn) reads it before it draws
     the page, as a failed stylesheet load resolves in LazyBundle */
  --cp-sheet: 1;
  /* the second series: --fig-s for its strokes and marks (at least 3:1
     against the page) and --fig-s-tx for its text (at least 4.5:1), in
     both themes; tools/audit/check-course-page.js ("kit") computes both
     from the token values. Here they are the kit's slate; the hero host
     sets them from the book's hue (below). The light tokens are too pale
     on paper (ochre is 2.6:1), so where color-mix is supported the light
     theme deepens each hue toward the ink; elsewhere strokes take the
     nearest token that passes and text takes the ink. */
  --cp-slate: var(--cy);
  --cp-slate-tx: var(--tx1);
  --cp-sage: var(--gn);
  --cp-sage-tx: var(--tx1);
  --cp-ochre: var(--or);
  --cp-ochre-tx: var(--tx1);
  --fig-s: var(--cp-slate);
  --fig-s-tx: var(--cp-slate-tx);
  /* "done" text in green: --gn is 4.49:1 on light paper, under the 4.5:1
     text floor, so text takes this variant, held to the same floors and
     computed by the same gate; marks keep --gn */
  --cp-gn-tx: var(--tx1);
  /* the primary button's hover: deeper in light, lighter in dark, its
     label above 7:1 in both */
  --cp-btn-hover: var(--ac-strong);
  /* the rest of the figure tokens the kit's classes read */
  --fig-mute: var(--tx3);
  --fig-pos: var(--ac-strong);
  --fig-neg: var(--cp-slate);
  --fig-hatch: var(--tx);
  --cp-hatch-a: 0.16;
  --cp-maxw: 1180px;
  container: cp / inline-size;
  display: block;
  color: var(--tx);
  font: 400 16px/1.6 var(--font-sans);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
[data-theme="dark"] .cp {
  --cp-slate-tx: var(--cy);
  --cp-sage-tx: var(--gn);
  --cp-ochre: var(--yl);
  --cp-ochre-tx: var(--yl);
  --cp-gn-tx: var(--gn);
  --cp-btn-hover: var(--ac2);
  --fig-pos: var(--ac2);
  --cp-hatch-a: 0.14;
}
@supports (color: color-mix(in srgb, currentColor 50%, transparent)) {
  [data-theme="light"] .cp {
    --cp-slate: color-mix(in srgb, var(--cy) 80%, var(--tx));
    --cp-slate-tx: color-mix(in srgb, var(--cy) 80%, var(--tx));
    --cp-sage: color-mix(in srgb, var(--gn) 85%, var(--tx));
    --cp-sage-tx: color-mix(in srgb, var(--gn) 85%, var(--tx));
    --cp-ochre: color-mix(in srgb, var(--yl) 85%, var(--tx));
    --cp-ochre-tx: color-mix(in srgb, var(--yl) 60%, var(--tx));
    --cp-gn-tx: color-mix(in srgb, var(--gn) 90%, var(--tx));
  }
}
/* The book's hue colours the hero figure's second series and nothing else
   (spec, Rules): only inside the hero host does --fig-s take the hue.
   Everywhere else, every thumbnail included, it keeps the kit's slate. */
.cp[data-hue="slate"] [data-cp-fig="hero"] { --fig-s: var(--cp-slate); --fig-s-tx: var(--cp-slate-tx); }
.cp[data-hue="sage"] [data-cp-fig="hero"] { --fig-s: var(--cp-sage); --fig-s-tx: var(--cp-sage-tx); }
.cp[data-hue="ochre"] [data-cp-fig="hero"] { --fig-s: var(--cp-ochre); --fig-s-tx: var(--cp-ochre-tx); }

.cp, .cp *, .cp *::before, .cp *::after { box-sizing: border-box; }
.cp ol, .cp ul { margin: 0; padding: 0; list-style: none; }
.cp figure { margin: 0; }
.cp button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; margin: 0; padding: 0; cursor: pointer; text-align: inherit; transition: none; }
.cp a { color: var(--ac-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cp .cp-wrap { max-width: var(--cp-maxw); margin: 0 auto; }
.cp .kick { font: 600 13px/1.3 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.09em; color: var(--ac-strong); }

/* buttons */
.cp .cp-btn {
  display: inline-flex; align-items: center; gap: 12px;
  font: 600 15px/1 var(--font-sans); letter-spacing: 0.005em;
  padding: 15px 22px 15px 24px; border-radius: 3px;
  background: var(--ac); color: var(--ac-tx); text-decoration: none;
}
/* hover states are the template's own (the mockup is a still) */
.cp .cp-btn:hover { background: var(--cp-btn-hover); }
.cp .cp-btn .arr { font-weight: 500; }
.cp .cp-btn-ghost { background: none; color: var(--tx); box-shadow: inset 0 0 0 1px var(--bdr2); }
.cp .cp-btn-ghost:hover { background: var(--ac-soft); }

/* ---------- the title page ---------- */
/* The hero sits beside the title on a desktop down to an 820 px page, so a
   1280 px laptop with the app's sidebar keeps it there. The title column
   keeps 500 px (course-page.js's TITLE_COL_WIDE, for which the title's size
   step is chosen), so a 1366 or 1440 px laptop keeps the mockup's title;
   the figure column gives way first, down to 320 px. Pages of 820 to 867 px,
   too narrow for that, keep 440 px (the band below). */
.cp .a-hero { display: grid; grid-template-columns: minmax(500px, 1fr) minmax(320px, 540px); gap: 0 76px; padding-top: 64px; padding-bottom: 48px; align-items: start; }
/* a title page with no hero figure (no cover) keeps no empty column */
.cp .a-hero.cp-hero-solo { grid-template-columns: minmax(0, 1fr); }
.cp .a-kick { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cp .a-kick .dotsep { color: var(--tx3); }
/* the size steps are course-page.js's TITLE_STEPS: keep the two in step
   (tools/audit/check-course-page.js resolves every step in every tier) */
.cp:not(#cp-w) .a-title {
  font: 380 112px/0.94 var(--font-serif); letter-spacing: -0.035em; color: var(--tx);
  margin: 22px 0 0; text-wrap: balance; overflow-wrap: break-word;
}
.cp:not(#cp-w) .a-title.t-mid { font-size: 86px; line-height: 0.98; letter-spacing: -0.03em; }
.cp:not(#cp-w) .a-title.t-long { font-size: 64px; line-height: 1.02; letter-spacing: -0.025em; }
.cp:not(#cp-w) .a-title.t-xlong { font-size: 50px; line-height: 1.04; letter-spacing: -0.02em; }
.cp:not(#cp-w) .a-tag { font: italic 400 25px/1.38 var(--font-serif); color: var(--tx1); margin: 30px 0 0; max-width: 30em; text-wrap: pretty; }
.cp:not(#cp-w) .a-desc { font: 400 16.5px/1.65 var(--font-serif); color: var(--tx2); margin: 18px 0 0; max-width: 34em; text-wrap: pretty; }
.cp .a-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 36px; }
.cp .a-cta-sub { font: 400 14px/1.4 var(--font-sans); color: var(--tx2); }
.cp .a-cta-sub b { font-weight: 600; color: var(--tx1); }

/* the hero figure, set like a kit figure: a rule, a kicker, a title, the plate, a caption */
.cp .a-fig { border-top: 1px solid var(--tx); padding-top: 14px; margin-top: 6px; }
/* where the kicker and the live mark cannot share a line, the mark wraps
   below, so the kicker keeps its line */
.cp .a-fig-kick { display: flex; justify-content: space-between; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; }
.cp .a-fig-live { font: 500 11.5px/1.2 var(--font-sans); color: var(--tx3); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cp .a-fig-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gn); box-shadow: 0 0 0 3px var(--gn-bg); }
/* balanced, so a narrow figure column does not leave a word alone on a line */
.cp:not(#cp-w) .a-fig-title { font: 500 21px/1.3 var(--font-serif); letter-spacing: -0.005em; color: var(--tx); margin: 8px 0 6px; text-wrap: balance; }
/* the plate keeps the hero's room until it is drawn: the height the cover's
   hero.aspect says its draw makes, which html() writes on the plate as two
   pieces, --cp-r* x width + --cp-p*, the first (a) for plates narrower
   than --cp-at (one piece twice when there is one). A padding percentage
   is of the plate's own width, so this holds in every layout, with no
   query: below --cp-at the min() takes piece a, from it the max() takes
   piece b (a is never the lower at the switch; the covers gate checks).
   With no aspect the plate keeps 0.70 of its width. */
.cp .a-fig-plot { margin: 6px 0 0; }
.cp .a-fig-plot:not([data-cp-drawn]) {
  padding-top: max(calc(var(--cp-rb, 0.7) * 100% + var(--cp-pb, 0px)),
    min(calc(var(--cp-ra, 0.7) * 100% + var(--cp-pa, 0px)), calc(var(--cp-rb, 0.7) * 100% + var(--cp-pb, 0px) + (var(--cp-at, 0px) - 100%) * 1000)));
}
.cp .a-fig-plot > svg { max-width: 100%; height: auto; }
.cp .a-fig-cap { font: 400 14.5px/1.6 var(--font-serif); color: var(--tx1); margin-top: 6px; text-wrap: pretty; }
.cp .a-fig-cap b { font-weight: 600; color: var(--ac-strong); font-variant-numeric: lining-nums tabular-nums; }

/* ---------- the route ---------- */
.cp .h-route { padding-bottom: 8px; }
.cp .h-route-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 14px 0 6px; border-top: 1px solid var(--tx); }
.cp .h-route-k { font: 600 13px/1.2 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--ac-strong); }
.cp .h-route-sum { font: italic 400 14px/1.4 var(--font-serif); color: var(--tx2); }
.cp .cp-sum-segs { display: none; }
.cp[data-cp-route-mode="segments"] .cp-sum-segs { display: inline; }
.cp[data-cp-route-mode="segments"] .cp-sum-beads { display: none; }
.cp .h-route-leg { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px/1 var(--font-sans); color: var(--tx2); }
.cp .h-route-leg i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.3px var(--tx3); display: inline-block; margin-left: 8px; }
.cp .h-route-leg i.on { background: var(--ac); box-shadow: none; }
.cp .cp-route { padding: 8px 0 14px; }
.cp .cp-route svg { display: block; overflow: visible; }
.cp .hr-act { font: 600 12.5px/1 var(--font-sans); }
.cp .hr-act-n { font: italic 500 15px/1 var(--font-serif); fill: var(--ac-strong); }
.cp .hr-act-name { font-variant-caps: all-small-caps; letter-spacing: 0.09em; fill: var(--tx2); }
.cp .hr-brk { stroke: var(--bdr2); stroke-width: 1; fill: none; }
.cp .hr-lead { stroke: var(--bdr2); stroke-width: 1; stroke-dasharray: 1.5 2.5; }
.cp .hr-line { stroke: var(--bdr2); stroke-width: 2; stroke-linecap: round; }
.cp .hr-line.on { stroke: var(--ac); }
.cp .hr-st { fill: var(--bg); stroke: var(--tx3); stroke-width: 1.3; }
.cp .hr-st.on { fill: var(--ac); stroke: var(--ac); }
/* segment mode: a part is one bar, hollow ahead and terracotta where done */
.cp .hr-seg { fill: var(--bg); stroke: var(--tx3); stroke-width: 1.2; }
.cp .hr-seg.on { fill: var(--ac); stroke: var(--ac); }
.cp .hr-here { fill: none; stroke: var(--ac); stroke-width: 1.6; }
.cp .hr-here-dot { fill: var(--ac); }
.cp .hr-pn { font: 400 15px/1 var(--font-serif); fill: var(--tx); font-variant-numeric: lining-nums; }
.cp .hr-pn.done { fill: var(--tx3); }
.cp .hr-pn.cur { fill: var(--ac-strong); font-weight: 600; }
.cp .hr-tag { font: 600 11.5px/1 var(--font-sans); fill: var(--ac-strong); }

/* The static page's stand-in for the route band (html() with opts.ssr): an
   empty placeholder, hidden from assistive technology, that keeps the drawn
   band's room so the page below it stays put when the app's band takes its
   place. The band is its head (a 1 px rule, 20 px of padding and 19.6 px
   for one line; more when its summary or legend wraps) plus the route
   (routeLayout's height: 111 px for one act-label row and 130 px for two on
   a page of 560 px or more, less on a phone's scale) and 30 px of padding.
   Above 560 px the head keeps one line and the books' acts take one row
   (181.6 px) or two (200.6 px); the slot keeps the midpoint, 191 px, so the
   takeover moves the page 9.6 px at most. Below 560 px each tier keeps the
   midpoint of the heights all 15 books' bands take at the widths it holds
   (measured in Chromium, 280 to 1104 px of page, at 1 px about each tier's
   edge), so none moves the page more than 24 px. */
.cp .cp-route-slot { height: 191px; }
.cp .cp-route-slot ~ .cp-wrap .a-facts { margin-top: 28px; }

/* the next-section card (returning readers) */
.cp .h-next { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 0 56px; padding: 22px 0 24px; border-top: 1px solid var(--bdr); }
.cp .h-next-k { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cp .h-next-n { font: 500 13px/1 var(--font-sans); color: var(--tx3); font-variant-numeric: lining-nums tabular-nums; }
.cp:not(#cp-w) .h-next-t { font: 500 27px/1.2 var(--font-serif); letter-spacing: -0.01em; color: var(--tx); margin: 10px 0 0; text-wrap: balance; }
.cp:not(#cp-w) .h-next-p { font: 400 14px/1.5 var(--font-sans); color: var(--tx2); margin: 6px 0 0; }
.cp .h-next .cp-btn { margin-top: 18px; }
.cp .h-next-h { font: 600 12px/1.3 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.09em; color: var(--tx2); }
.cp .h-next-obj { margin-top: 6px; columns: 2; column-gap: 32px; }
.cp .h-next-obj li { break-inside: avoid; position: relative; padding: 6px 0 6px 18px; font: 400 15px/1.5 var(--font-serif); color: var(--tx1); }
.cp .h-next-obj li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 7px; height: 1px; background: var(--ac); }

/* ---------- the facts row (booktabs) ---------- */
.cp .h-route ~ .cp-wrap .a-facts { margin-top: 28px; }
.cp .a-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--tx); border-bottom: 1px solid var(--bdr); }
.cp .a-fact { padding: 20px 0 20px 26px; border-left: 1px solid var(--bdr); }
.cp .a-fact:first-child { border-left: 0; padding-left: 0; }
.cp .a-fact-n { font: 380 46px/1 var(--font-serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--tx); }
.cp .a-fact-l { font: 600 12.5px/1.3 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.08em; color: var(--tx2); margin-top: 8px; }

/* ---------- what you will learn, and who it is for ---------- */
.cp .a-about { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 0 76px; padding-top: 72px; }
.cp:not(#cp-w) .a-h2 { font: 600 15px/1.3 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--tx2); margin: 0; }
.cp .a-learn { margin-top: 18px; counter-reset: cp-learn; }
.cp .a-learn li { display: grid; grid-template-columns: 34px minmax(0, 1fr); padding: 13px 0; border-top: 1px solid var(--bdr); font: 400 17px/1.55 var(--font-serif); color: var(--tx); text-wrap: pretty; }
.cp .a-learn li:last-child { border-bottom: 1px solid var(--bdr); }
.cp .a-learn li::before { counter-increment: cp-learn; content: counter(cp-learn); font: italic 500 17px/1.55 var(--font-serif); color: var(--ac-strong); }
.cp:not(#cp-w) .a-for { font: 400 17px/1.6 var(--font-serif); color: var(--tx1); margin: 18px 0 0; padding-top: 13px; border-top: 1px solid var(--bdr); text-wrap: pretty; }
.cp .a-more { margin-top: 26px; }
.cp .a-more summary { cursor: pointer; font: 500 14.5px/1.3 var(--font-sans); color: var(--ac-strong); list-style: none; display: inline-flex; gap: 8px; align-items: center; }
.cp .a-more summary::-webkit-details-marker { display: none; }
.cp .a-more summary::after { content: "+"; font-weight: 400; }
.cp .a-more[open] summary::after { content: "\2212"; }
.cp:not(#cp-w) .a-more p { font: 400 15.5px/1.65 var(--font-serif); color: var(--tx1); margin: 12px 0 0; }

/* ---------- contents ---------- */
.cp .a-toc { padding-top: 96px; padding-bottom: 40px; }
.cp .a-toc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 18px; flex-wrap: wrap; }
.cp:not(#cp-w) .a-toc-title { font: 380 48px/1 var(--font-serif); letter-spacing: -0.02em; color: var(--tx); margin: 0; }
.cp .a-toc-sum { font: 400 14.5px/1.4 var(--font-sans); color: var(--tx2); }
.cp .a-part { border-top: 1px solid var(--bdr); }
.cp .a-part:last-child { border-bottom: 1px solid var(--bdr); }
.cp .a-toc-head + .a-part { border-top-color: var(--tx); }
.cp .a-ph { display: grid; grid-template-columns: 112px minmax(0, 1fr) 200px; gap: 0 36px; width: 100%; padding: 30px 0; align-items: start; }
.cp .a-pn { display: flex; flex-direction: column; gap: 4px; }
.cp .a-pn-k { font: 600 11.5px/1 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--tx3); }
.cp .a-pn-n { font: 330 60px/0.9 var(--font-serif); letter-spacing: -0.03em; font-variant-numeric: lining-nums; color: var(--tx); }
.cp .a-part.is-cur .a-pn-n { color: var(--ac-strong); }
.cp .a-part.is-done .a-pn-n { color: var(--tx3); }
.cp .a-pt { display: block; min-width: 0; }
.cp .a-pt-t { display: block; font: 500 25px/1.25 var(--font-serif); letter-spacing: -0.008em; color: var(--tx); text-wrap: balance; }
.cp .a-ph:hover .a-pt-t { color: var(--ac-strong); }
.cp .a-pt-run { font: 400 15.5px/1.6 var(--font-serif); color: var(--tx2); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp .a-pt-run i { font-style: normal; color: var(--bdr2); padding: 0 0.45em; }
.cp .a-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; font: 600 12.5px/1.2 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.07em; color: var(--tx3); }
.cp .a-ticks { display: inline-flex; gap: 3px; }
.cp .a-ticks i { width: 14px; height: 3px; background: var(--bdr2); opacity: 0.6; }
.cp .a-ticks i.on { background: var(--ac); opacity: 1; }
.cp .a-meta .a-read { color: var(--tx2); }
.cp .a-meta .a-read.all { color: var(--cp-gn-tx); }
/* a thumbnail is a 184 by 108 figure at the slot's width; the slot keeps that room until it is drawn */
.cp .a-thumb { display: block; width: 200px; min-height: 121px; padding-top: 4px; }
.cp .a-thumb .fg { width: 100%; height: auto; }
/* a cover may print the part's own number under its thumbnail: the value, then what it is and where it is printed */
.cp .a-thumb-n { display: block; margin-top: 6px; font: 400 11.5px/1.35 var(--font-sans); color: var(--tx3); font-variant-numeric: tabular-nums; }
.cp .a-thumb-v { display: block; font-size: 13px; font-weight: 600; color: var(--tx); }
.cp .a-thumb-w { display: block; }
.cp .h-thumb-none { height: 117px; display: flex; align-items: center; justify-content: center; font: 600 11.5px/1 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--tx3); box-shadow: inset 0 0 0 1px var(--bdr); }

/* the acts, as quiet group headings in the contents */
.cp .h-acth { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 0 36px; align-items: baseline; padding: 34px 0 10px; }
.cp .a-toc-head + .h-acth { padding-top: 18px; }
.cp .h-acth-n { font: italic 500 18px/1 var(--font-serif); color: var(--ac-strong); }
.cp .h-acth-name { font: 600 13px/1.2 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--tx2); }
.cp .h-acth-meta { font: 500 12.5px/1.2 var(--font-sans); color: var(--tx3); }
.cp .a-toc-head + .h-acth + .a-part { border-top-color: var(--bdr); }

/* a part's sections: a list of links, hidden until the part is opened */
.cp .a-secs { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0 36px; padding: 0 0 34px; }
.cp .a-secs[hidden] { display: none; }
.cp .a-secs ol { grid-column: 2; border-top: 1px solid var(--bdr); }
.cp .a-secs li { border-bottom: 1px solid var(--bdr); }
.cp .a-secs li:last-child { border-bottom: 0; }
.cp .a-sec { display: grid; grid-template-columns: 48px minmax(0, 1fr) 92px; gap: 0 16px; padding: 14px 0 15px; align-items: baseline; color: inherit; text-decoration: none; }
.cp .a-sn { font: 500 13.5px/1.5 var(--font-sans); font-variant-numeric: lining-nums tabular-nums; color: var(--tx3); }
.cp .a-sx { display: block; min-width: 0; }
.cp .a-st { font: 400 18px/1.4 var(--font-serif); color: var(--tx); }
.cp .a-sec:hover .a-st { color: var(--ac-strong); }
.cp .a-so { display: block; font: 400 14px/1.55 var(--font-sans); color: var(--tx2); margin-top: 4px; }
.cp .a-ss { justify-self: end; font: 600 12px/1 var(--font-sans); font-variant-caps: all-small-caps; letter-spacing: 0.08em; color: var(--tx3); white-space: nowrap; }
.cp .a-ss.done { color: var(--cp-gn-tx); }
.cp .a-ss.next { color: var(--ac-tx); background: var(--ac); padding: 5px 8px 6px; border-radius: 2px; }
.cp .a-sec.is-next .a-st { color: var(--ac-strong); font-weight: 500; }

.cp .a-foot { border-top: 1px solid var(--bdr); margin-top: 56px; padding: 26px 0 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font: 400 13.5px/1.5 var(--font-sans); color: var(--tx2); }

/* ---------- SVG figures (course/fig-lite.js, window.CourseFig) ---------- */
.cp .fg { display: block; overflow: visible; font-family: var(--font-sans); }
.cp .fg .ln { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.cp .fg .ln.w2 { stroke-width: 2.2; }
.cp .fg .ln.thin { stroke-width: 1; }
.cp .fg .ln.dash { stroke-dasharray: 5 4; }
.cp .fg-thumb .ln { vector-effect: non-scaling-stroke; stroke-width: 1.4; }
.cp .fg-thumb .ln.w2 { stroke-width: 2; }
.cp .fg-thumb .ln.thin { stroke-width: 0.9; }
.cp .fg .ln.ink { stroke: var(--tx); }
.cp .fg .ln.acc { stroke: var(--ac); }
.cp .fg .ln.s { stroke: var(--fig-s); }
.cp .fg .ln.mute { stroke: var(--fig-mute); }
.cp .fg .ln.gn { stroke: var(--gn); }
.cp .fg .ln.rd { stroke: var(--rd); }
.cp .fg .dt { stroke: var(--bg); stroke-width: 1.5; }
.cp .fg .dt.acc { fill: var(--ac); }
.cp .fg .dt.s { fill: var(--fig-s); }
.cp .fg .dt.ink { fill: var(--tx); }
.cp .fg .dt.rd { fill: var(--rd); }
.cp .fg .dt.gn { fill: var(--gn); }
.cp .fg .dt.ink-o { fill: var(--bg); stroke: var(--tx); stroke-width: 1.2; }
.cp .fg .dt.mute-f { fill: var(--fig-mute); fill-opacity: 0.42; stroke: none; }
.cp .fg .dt.acc-ring { fill: none; stroke: var(--ac); stroke-width: 1.6; }
.cp .fg .dt.lab-brine { stroke: var(--fig-s); }
.cp .fg .dt.lab-oil { stroke: var(--gn); }
.cp .fg .dt.lab-gas { stroke: var(--rd); }
.cp .fg .ar.band { fill: var(--tx); fill-opacity: 0.055; }
.cp .fg .ar.band-s { fill: var(--fig-s); fill-opacity: 0.13; }
.cp .fg .ar.band-acc { fill: var(--ac); fill-opacity: 0.12; }
.cp .fg .ar.bar-s { fill: var(--fig-s); fill-opacity: 0.32; }
.cp .fg .ar.bar-rd { fill: var(--rd); }
.cp .fg .ar.bar-acc { fill: var(--ac); }
.cp .fg .ar.bar-mute { fill: var(--fig-mute); fill-opacity: 0.35; }
/* the hatch: the ink at a low opacity per theme (widget-figure.css's
   --fig-hatch is the same ink and opacity, written as one colour) */
.cp .fg .hatch-ln { stroke: var(--fig-hatch); stroke-opacity: var(--cp-hatch-a); stroke-width: 1.7; }
.cp .fg .rl { stroke: var(--fig-mute); stroke-width: 1; }
.cp .fg .rl.dot { stroke-dasharray: 1.5 3; }
.cp .fg .rl.acc-rule { stroke: var(--ac); stroke-opacity: 0.6; }
.cp .fg .rl.brk { stroke: var(--tx); stroke-width: 1.1; }
.cp .fg-thumb .rl { vector-effect: non-scaling-stroke; }
.cp .fg .sp, .cp .fg .tk { stroke: var(--tx); stroke-width: 1; }
.cp .fg .sp-thumb { stroke: var(--bdr2); vector-effect: non-scaling-stroke; }
.cp .fg .gr { stroke: var(--bdr); stroke-width: 1; }
.cp .fg .tl { fill: var(--fig-mute); font-size: 11px; font-variant-numeric: lining-nums tabular-nums; }
.cp .fg .al { fill: var(--tx1); font-size: 11.5px; font-weight: 500; }
.cp .fg .lab { font-size: 11.5px; font-weight: 500; paint-order: stroke; stroke: var(--bg); stroke-width: 3.5px; stroke-linejoin: round; }
.cp .fg .t-acc { fill: var(--ac-strong); }
/* text in the hue takes its text variant, which keeps 4.5:1 on the page */
.cp .fg .t-s { fill: var(--fig-s-tx); }
.cp .fg .t-ink { fill: var(--tx); }
.cp .fg .t-mute { fill: var(--fig-mute); }
.cp .fg .t-rd { fill: var(--rd); }
.cp .fg .t-gn { fill: var(--cp-gn-tx); }
.cp .fg .sym { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.12em; }
.cp .fg-raster { display: block; width: 100%; height: auto; }
.cp .fg .dt.coll { fill: var(--tx); fill-opacity: 0.32; stroke: none; }
.cp .fg .dt.coll-ink { fill: var(--tx); fill-opacity: 0.55; stroke: none; }
.cp .fg .px { stroke: none; }
.cp .fg .px.pos { fill: var(--fig-pos); }
.cp .fg .px.neg { fill: var(--fig-neg); }
.cp .fg .px.seq { fill: var(--ac); }
.cp .fg .rcv { fill: var(--tx); }
.cp .fg .vstop0 { stop-color: var(--fig-s); stop-opacity: 0.04; }
.cp .fg .vstop1 { stop-color: var(--fig-s); stop-opacity: 0.30; }
.cp .fg ellipse.ln { fill: none; }
.cp .fg .ln.w3 { stroke-width: 3; }
.cp .fg-thumb .ln.w3 { stroke-width: 2.6; }
.cp .fg .dt.acc-open { fill: var(--bg); stroke: var(--ac); stroke-width: 1.5; }
.cp .fg .dt.s-open { fill: var(--bg); stroke: var(--fig-s); stroke-width: 1.5; }
.cp .fg .ah { stroke: none; }
.cp .fg .ah.ink { fill: var(--tx); }
.cp .fg .ah.acc { fill: var(--ac); }
.cp .fg .ah.s { fill: var(--fig-s); }
.cp .fg .ln.fillsoft-s { fill: var(--fig-s); fill-opacity: 0.12; }
.cp .fg .ln.fillsoft-acc { fill: var(--ac); fill-opacity: 0.14; }
.cp .fg .ln.fillsoft-ink { fill: var(--tx); fill-opacity: 0.07; }
.cp .fg .ln.fill-bg { fill: var(--bg); }
.cp .fg .ar.band-acc2 { fill: var(--ac); fill-opacity: 0.22; }

/* ---------- the same tiers without container queries ----------
   An engine without size container queries (Safari before 16, Chrome
   before 105) skips every @container block below, which would leave a
   phone with the desktop layout. These are the same rules, at the window
   widths at which the app gives the page those widths with the sidebar
   open: a page of N px is at most the window less 436 px from 1200 px
   windows, less 376 from 1024, less 360 from 769, and nearly the whole
   window on a phone; a band from N px starts one past the widest window
   whose page is narrower. The two blocks that meet at a 1256 px window end
   at .98 px, so a window between whole pixels (browser zoom) falls in one
   of them, not in neither; the container tiers they mirror meet in range
   syntax for the same reason. tools/audit/check-course-page.js ("kit")
   keeps each block the twin of its @container block. */
@supports not (container-type: inline-size) {
  @media (max-width: 1535px) {
    .cp .a-hero { column-gap: 48px; }
  }
  @media (min-width: 1256px) and (max-width: 1303.98px) {
    .cp .a-hero { grid-template-columns: minmax(440px, 1fr) minmax(320px, 540px); }
    .cp:not(#cp-w) .a-hero:not(.cp-hero-solo) .a-title.t-n-mid { font-size: 86px; line-height: 0.98; letter-spacing: -0.03em; }
    .cp:not(#cp-w) .a-hero:not(.cp-hero-solo) .a-title.t-n-long { font-size: 64px; line-height: 1.02; letter-spacing: -0.025em; }
    .cp:not(#cp-w) .a-hero:not(.cp-hero-solo) .a-title.t-n-xlong { font-size: 50px; line-height: 1.04; letter-spacing: -0.02em; }
  }
  @media (max-width: 1255.98px) {
    .cp .a-hero { grid-template-columns: minmax(0, 1fr); }
    .cp .a-fig { margin-top: 44px; max-width: 640px; }
  }
  @media (max-width: 1096px) {
    .cp .a-hero { padding-top: 34px; padding-bottom: 36px; }
    .cp:not(#cp-w) .a-title { font-size: 66px; margin-top: 16px; }
    .cp:not(#cp-w) .a-title.t-mid { font-size: 52px; }
    .cp:not(#cp-w) .a-title.t-long { font-size: 40px; line-height: 1.06; }
    .cp:not(#cp-w) .a-title.t-xlong { font-size: 32px; line-height: 1.08; }
    /* a title whose phone step is not its desktop one (course-page.js picks
       each for its own column) */
    .cp:not(#cp-w) .a-hero .a-title.t-p-short { font-size: 66px; line-height: 0.94; letter-spacing: -0.035em; }
    .cp:not(#cp-w) .a-hero .a-title.t-p-mid { font-size: 52px; line-height: 0.98; letter-spacing: -0.03em; }
    .cp:not(#cp-w) .a-hero .a-title.t-p-long { font-size: 40px; line-height: 1.06; letter-spacing: -0.025em; }
    .cp:not(#cp-w) .a-hero .a-title.t-p-xlong { font-size: 32px; line-height: 1.08; letter-spacing: -0.02em; }
    .cp:not(#cp-w) .a-tag { font-size: 20px; margin-top: 20px; }
    .cp:not(#cp-w) .a-desc { font-size: 16px; }
    .cp .a-cta { margin-top: 26px; gap: 12px; }
    .cp .a-cta .cp-btn { width: 100%; justify-content: space-between; }
    .cp .a-fig { max-width: none; }
    .cp:not(#cp-w) .a-fig-title { font-size: 19px; }
    .cp .a-fig-cap { font-size: 14px; }
    .cp .h-route-leg { margin-left: 0; }
    .cp .h-route-head { column-gap: 6px; }
    .cp .h-next { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .cp .h-next .cp-btn { width: 100%; justify-content: space-between; }
    .cp:not(#cp-w) .h-next-t { font-size: 22px; }
    .cp .h-next-obj { columns: 1; }
    .cp .a-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cp .a-fact { padding: 16px 0 16px 16px; }
    .cp .a-fact:nth-child(3) { border-left: 0; padding-left: 0; }
    .cp .a-fact:nth-child(n+3) { border-top: 1px solid var(--bdr); }
    .cp .a-fact-n { font-size: 38px; }
    .cp .a-about { grid-template-columns: minmax(0, 1fr); padding-top: 48px; gap: 40px; }
    .cp .a-learn li { font-size: 16px; grid-template-columns: 26px minmax(0, 1fr); }
    .cp .a-toc { padding-top: 64px; }
    .cp:not(#cp-w) .a-toc-title { font-size: 38px; }
    .cp .h-acth { grid-template-columns: 40px minmax(0, 1fr); gap: 0 14px; padding-top: 26px; }
    .cp .h-acth-meta { grid-column: 2; margin-top: 4px; }
    .cp .a-ph { grid-template-columns: 40px minmax(0, 1fr) 92px; gap: 0 14px; padding: 22px 0; }
    .cp .a-pn-k { display: none; }
    .cp .a-pn-n { font-size: 34px; }
    .cp .a-pt-t { font-size: 19px; line-height: 1.3; }
    .cp .a-pt-run { font-size: 14px; line-height: 1.5; margin-top: 6px; }
    .cp .a-meta { gap: 10px; margin-top: 10px; font-size: 12px; }
    .cp .a-ticks i { width: 9px; }
    .cp .a-thumb { width: 92px; min-height: 56px; padding-top: 2px; }
    .cp .a-thumb-n { margin-top: 4px; font-size: 10.5px; line-height: 1.3; }
    .cp .a-thumb-v { font-size: 12px; }
    .cp .h-thumb-none { height: 54px; font-size: 10.5px; }
    .cp .a-secs { grid-template-columns: minmax(0, 1fr); padding-bottom: 24px; }
    .cp .a-secs ol { grid-column: 1; }
    .cp .a-sec { grid-template-columns: 34px minmax(0, 1fr); gap: 0 10px; }
    .cp .a-st { font-size: 16.5px; }
    .cp .a-so { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .cp .a-ss { grid-column: 2; justify-self: start; margin-top: 8px; }
    .cp .a-ss:empty { display: none; }
  }
  @media (max-width: 919px) {
    .cp .cp-route-slot { height: 183px; }
  }
  @media (max-width: 805px) {
    .cp .cp-route-slot { height: 205px; }
  }
  @media (max-width: 386px) {
    .cp .cp-route-slot { height: 228px; }
  }
  @media (max-width: 340px) {
    .cp .cp-route-slot { height: 253px; }
  }
}

/* ---------- the layout tiers, by the page's own width ----------
   Container queries on .cp, since in the app the page shares the window
   with the sidebar. An engine without them gets the same rules from the
   @media block above, at the window widths that give the page those
   widths with the sidebar open. */

/* under 1100 px of page: a narrower gap between the title and the hero */
@container cp (max-width: 1099px) {
  .cp .a-hero { column-gap: 48px; }
}

/* 820 to 867 px of page (a 1280 px laptop with the app's sidebar): too
   narrow for a 500 px title column beside the hero, so the column keeps
   440 px (course-page.js's TITLE_COL_NARROW), and a title whose longest
   word needs a smaller step there takes its t-n- step. A title page with no
   hero keeps the whole width, and its title its size. */
@container cp (820px <= width < 868px) {
  .cp .a-hero { grid-template-columns: minmax(440px, 1fr) minmax(320px, 540px); }
  .cp:not(#cp-w) .a-hero:not(.cp-hero-solo) .a-title.t-n-mid { font-size: 86px; line-height: 0.98; letter-spacing: -0.03em; }
  .cp:not(#cp-w) .a-hero:not(.cp-hero-solo) .a-title.t-n-long { font-size: 64px; line-height: 1.02; letter-spacing: -0.025em; }
  .cp:not(#cp-w) .a-hero:not(.cp-hero-solo) .a-title.t-n-xlong { font-size: 50px; line-height: 1.04; letter-spacing: -0.02em; }
}

/* under 820 px of page: too narrow for the hero beside the title */
@container cp (width < 820px) {
  .cp .a-hero { grid-template-columns: minmax(0, 1fr); }
  .cp .a-fig { margin-top: 44px; max-width: 640px; }
}

/* ---------- a phone-wide page ---------- */
@container cp (max-width: 720px) {
  .cp .a-hero { padding-top: 34px; padding-bottom: 36px; }
  .cp:not(#cp-w) .a-title { font-size: 66px; margin-top: 16px; }
  .cp:not(#cp-w) .a-title.t-mid { font-size: 52px; }
  .cp:not(#cp-w) .a-title.t-long { font-size: 40px; line-height: 1.06; }
  .cp:not(#cp-w) .a-title.t-xlong { font-size: 32px; line-height: 1.08; }
  /* a title whose phone step is not its desktop one (course-page.js picks
     each for its own column) */
  .cp:not(#cp-w) .a-hero .a-title.t-p-short { font-size: 66px; line-height: 0.94; letter-spacing: -0.035em; }
  .cp:not(#cp-w) .a-hero .a-title.t-p-mid { font-size: 52px; line-height: 0.98; letter-spacing: -0.03em; }
  .cp:not(#cp-w) .a-hero .a-title.t-p-long { font-size: 40px; line-height: 1.06; letter-spacing: -0.025em; }
  .cp:not(#cp-w) .a-hero .a-title.t-p-xlong { font-size: 32px; line-height: 1.08; letter-spacing: -0.02em; }
  .cp:not(#cp-w) .a-tag { font-size: 20px; margin-top: 20px; }
  .cp:not(#cp-w) .a-desc { font-size: 16px; }
  .cp .a-cta { margin-top: 26px; gap: 12px; }
  .cp .a-cta .cp-btn { width: 100%; justify-content: space-between; }
  .cp .a-fig { max-width: none; }
  .cp:not(#cp-w) .a-fig-title { font-size: 19px; }
  .cp .a-fig-cap { font-size: 14px; }
  .cp .h-route-leg { margin-left: 0; }
  /* "The route" and its summary share the head's first line on a 390 px
     phone (366 px of route), which the slot's 205 px tier counts on. With
     the 14 px gap the four chapter books' summaries ("16 chapters in 5
     acts, one segment per chapter") came to within a pixel of the line's
     end, so a sub-pixel difference in text width between machines sent the
     summary to a line of its own in CI and grew the band 29.7 px at the
     takeover. A 6 px gap leaves them some 8 px to spare; the row gap stays
     14 px. */
  .cp .h-route-head { column-gap: 6px; }
  .cp .h-next { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cp .h-next .cp-btn { width: 100%; justify-content: space-between; }
  .cp:not(#cp-w) .h-next-t { font-size: 22px; }
  .cp .h-next-obj { columns: 1; }
  .cp .a-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp .a-fact { padding: 16px 0 16px 16px; }
  .cp .a-fact:nth-child(3) { border-left: 0; padding-left: 0; }
  .cp .a-fact:nth-child(n+3) { border-top: 1px solid var(--bdr); }
  .cp .a-fact-n { font-size: 38px; }
  .cp .a-about { grid-template-columns: minmax(0, 1fr); padding-top: 48px; gap: 40px; }
  .cp .a-learn li { font-size: 16px; grid-template-columns: 26px minmax(0, 1fr); }
  .cp .a-toc { padding-top: 64px; }
  .cp:not(#cp-w) .a-toc-title { font-size: 38px; }
  .cp .h-acth { grid-template-columns: 40px minmax(0, 1fr); gap: 0 14px; padding-top: 26px; }
  .cp .h-acth-meta { grid-column: 2; margin-top: 4px; }
  .cp .a-ph { grid-template-columns: 40px minmax(0, 1fr) 92px; gap: 0 14px; padding: 22px 0; }
  .cp .a-pn-k { display: none; }
  .cp .a-pn-n { font-size: 34px; }
  .cp .a-pt-t { font-size: 19px; line-height: 1.3; }
  .cp .a-pt-run { font-size: 14px; line-height: 1.5; margin-top: 6px; }
  .cp .a-meta { gap: 10px; margin-top: 10px; font-size: 12px; }
  .cp .a-ticks i { width: 9px; }
  .cp .a-thumb { width: 92px; min-height: 56px; padding-top: 2px; }
  .cp .a-thumb-n { margin-top: 4px; font-size: 10.5px; line-height: 1.3; }
  .cp .a-thumb-v { font-size: 12px; }
  .cp .h-thumb-none { height: 54px; font-size: 10.5px; }
  .cp .a-secs { grid-template-columns: minmax(0, 1fr); padding-bottom: 24px; }
  .cp .a-secs ol { grid-column: 1; }
  .cp .a-sec { grid-template-columns: 34px minmax(0, 1fr); gap: 0 10px; }
  .cp .a-st { font-size: 16.5px; }
  .cp .a-so { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cp .a-ss { grid-column: 2; justify-self: start; margin-top: 8px; }
  .cp .a-ss:empty { display: none; }
}

/* ---------- the route slot's height, below 560 px of page ----------
   (see .cp-route-slot above). The route is drawn on its phone scale. Each
   tier gives the midpoint of the band heights all 15 books take at the
   widths it holds, so that none moves the page by more than 24 px; the
   tiers meet in range syntax, so a page between whole pixels falls in one. */

/* under 560 px: the books' bands are 161.6 to 205.1 px */
@container cp (width < 560px) {
  .cp .cp-route-slot { height: 183px; }
}

/* under 446 px: every book's band is 205.1 px (two act rows; at 445 px two
   books' acts still fit one row, 188 px) */
@container cp (width < 446px) {
  .cp .cp-route-slot { height: 205px; }
}

/* under 363 px: 205.1 to 251.7 px, as the legend and the act rows wrap */
@container cp (width < 363px) {
  .cp .cp-route-slot { height: 228px; }
}

/* under 321 px: 234.7 to 271.3 px */
@container cp (width < 321px) {
  .cp .cp-route-slot { height: 253px; }
}

/* ---------- print ----------
   Paper is white and browsers leave backgrounds out, so nothing here
   forces one. The page prints in ink: every text takes the body's colour,
   which the site's print rule sets; the terracotta button, whose label
   printed near-white on white, becomes an outline. The route band and the
   live mark mean nothing on paper. The figures' marks take the theme's
   tokens, pale on paper in the dark theme, so there the figures are left
   out. */
@media print {
  /* the body's print ink (styles.css): #ct keeps the theme's --tx, which
     in the dark theme is pale ink on white paper */
  .cp { color: var(--print-ink) !important; }
  .cp * { color: inherit !important; }
  .cp .cp-btn { background: none !important; box-shadow: inset 0 0 0 1px currentColor; }
  .cp .h-route, .cp .a-fig-live { display: none !important; }
  [data-theme="dark"] .cp .a-fig, [data-theme="dark"] .cp .a-thumb { display: none !important; }
}
