/* The reading pages: the lesson reader and the course page, in black and white.
 *
 * James picked this look on 2026-10-25 (docs/mockups/lesson-accent-2026-10-25.html, option 2R;
 * docs/mockups/course-page-2026-10-25.html, option A). White page, a near-white grey for the top
 * bar and the side rails, black ink, Inter for the chrome, Source Serif 4 for lesson prose and
 * JetBrains Mono for small labels. One accent, ink blue, and only in these places: links, the
 * current item in the "Where you are" tree, in "On this page" and in the course chapter rail, the
 * guiding-question bar, and the small square before each section or chapter heading. The "This
 * lesson" block and the B1 mark stay black.
 *
 * The map and sky keep their own styles in index.html; nothing here touches them.
 */

.rd-sheet, #course {
  --p-ink: #09090b; --p-soft: #3f3f46; --p-dim: #71717a; --p-faint: #a1a1aa;
  --p-rule: #e4e4e7; --p-rail: #f7f7f8; --p-acc: #1e3a8a; --p-lul: #93a3c8; --p-trunk: #d4d4d8;
  --p-sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --p-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --p-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

/* ---- the reader ---------------------------------------------------------------------------- */
#reader { position: fixed; inset: 0; z-index: 40; }
#reader[hidden] { display: none; }
.rd-scrim { position: absolute; inset: 0; background: rgba(4,5,10,.72); backdrop-filter: blur(2px); }
html.light .rd-scrim { background: rgba(244,245,248,.72); }
.rd-sheet {
  position: absolute; inset: 20px; margin: 0 auto; max-width: 1480px;
  background: #fff; color: var(--p-ink); border: 1px solid var(--p-ink);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.6); color-scheme: light;
  font-family: var(--p-sans);
}

/* Top bar: the mark, the breadcrumb, the close button. */
.rd-bar {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px; flex: 0 0 auto;
  border-bottom: 1px solid var(--p-rule); background: var(--p-rail);
}
.rd-wm, #course .wm {
  display: inline-flex; align-items: center; gap: 6px; font-size: 16px; letter-spacing: -0.035em;
  white-space: nowrap; color: var(--p-ink); cursor: pointer; text-decoration: none;
}
.rd-wm b, #course .wm b { font-weight: 700; }
.rd-wm svg, #course .wm svg { width: 16px; height: 16px; flex: none; }
.rd-crumb {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--p-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rd-crumb a { color: var(--p-soft); cursor: pointer; }
.rd-crumb a:hover { color: var(--p-acc); text-decoration: underline; text-decoration-color: var(--p-lul); }
.rd-crumb b { color: var(--p-ink); font-weight: 600; }
.rd-sep { color: var(--p-faint); }
.rd-x, #course .x {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--p-rule); background: #fff; color: var(--p-soft);
  font-size: 20px; line-height: 1; cursor: pointer; font-family: var(--p-sans);
}
.rd-x:hover, #course .x:hover { color: var(--p-ink); border-color: var(--p-ink); }

/* Three columns: the shaded rails frame the white page. */
.rd-cols { display: flex; flex-grow: 1; overflow: hidden; position: relative; }
.rd-left, .rd-right {
  flex: 0 0 210px; padding: 18px 14px; overflow-y: auto; font-size: 12.5px;
  color: var(--p-soft); background: var(--p-rail); line-height: 1.4;
}
.rd-left { border-right: 1px solid var(--p-rule); }
.rd-right { border-left: 1px solid var(--p-rule); flex-basis: 230px; }
.rd-left h4, .rd-right h4, .rd-rc-h {
  margin: 0 0 9px; font-family: var(--p-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--p-dim);
}
.rd-rc-h { display: flex; justify-content: space-between; align-items: baseline; }
.rd-rc-h a {
  font-family: var(--p-sans); text-transform: none; letter-spacing: 0; font-size: 11.5px;
  font-weight: 600; color: var(--p-ink); cursor: pointer;
}
.rd-rc-h a:hover { text-decoration: underline; }

/* Where you are: ancestors stacked, this star marked in blue, its children or siblings below. */
.rd-ob {
  display: flex; align-items: baseline; gap: 7px; padding: 5px 8px; border: 1px solid var(--p-rule);
  background: #fff; font-size: 12.5px; line-height: 1.3; color: var(--p-soft);
  cursor: pointer; text-decoration: none;
}
a.rd-ob:hover { border-color: var(--p-faint); color: var(--p-ink); }
.rd-ob.me { border: 1.5px solid var(--p-acc); color: var(--p-ink); font-weight: 600; cursor: default; }
.rd-cnt { margin-left: auto; font-size: 11px; color: var(--p-faint); font-family: var(--p-mono); }
.rd-v { width: 1px; height: 8px; background: var(--p-trunk); margin-left: 14px; }
.rd-trunk { margin: 0 0 0 14px; border-left: 1px solid var(--p-trunk); padding: 6px 0 2px; }
.rd-trunk .rd-ob, .rd-trunk .rd-more { position: relative; margin: 0 0 6px 12px; }
.rd-trunk .rd-ob::before, .rd-trunk .rd-more::before {
  content: ""; position: absolute; left: -13px; top: 50%; width: 12px; height: 1px; background: var(--p-trunk);
}
.rd-more { display: block; padding: 2px 0; font-size: 12px; font-weight: 600; color: var(--p-ink); cursor: pointer; }
.rd-more:hover { text-decoration: underline; }
.rd-more span { color: var(--p-dim); font-weight: 400; }
/* The written / area / unwritten dots stay in the markup but the 2R look has none. */
.rd-dot { display: none; }

/* On this page, with the section in view marked. Then previous and next. */
.rd-otp { margin-top: 22px !important; }
.rd-toc { display: block; padding: 4px 0; color: var(--p-soft); cursor: pointer; }
.rd-toc:hover { color: var(--p-ink); }
.rd-toc.on { color: var(--p-ink); font-weight: 600; border-left: 2px solid var(--p-acc); padding-left: 8px; margin-left: -10px; }
.rd-step { margin-top: 18px; border-top: 1px solid var(--p-rule); padding-top: 12px; }
.rd-step a { display: block; padding: 3px 0 5px; color: var(--p-acc); cursor: pointer; }
.rd-step a:hover { text-decoration: underline; text-decoration-color: var(--p-lul); }

/* Right rail: what this lesson needs, this lesson, what it unlocks; then notation, elsewhere. */
.rd-pu {
  display: block; border: 1px solid var(--p-ink); background: #fff; padding: 7px 9px; margin-bottom: 7px;
  color: var(--p-ink); text-decoration: none; cursor: pointer;
}
.rd-pu:hover .t { text-decoration: underline; text-decoration-color: var(--p-faint); }
.rd-pu.need { border-left-width: 3px; }
.rd-pu.lock { border-style: dashed; border-color: var(--p-dim); }
.rd-pu .t { display: block; font-weight: 600; font-size: 12.5px; line-height: 1.3; }
.rd-pu .c { display: block; font-family: var(--p-mono); font-size: 10px; color: var(--p-dim); margin-top: 2px; }
.rd-pu-list .rd-xtra { display: none; }
.rd-pu-list.all .rd-xtra { display: block; }
.rd-pills.all .rd-xtra { display: inline-block; }
.rd-pu-more { display: block; font-size: 12px; font-weight: 600; color: var(--p-ink); cursor: pointer; margin: 0 0 8px; }
.rd-pu-more:hover { text-decoration: underline; }
.rd-arrow { text-align: center; color: var(--p-dim); font-size: 11px; margin: 2px 0 8px; font-family: var(--p-mono); }
.rd-here { background: var(--p-ink); color: #fff; padding: 7px 9px; margin-bottom: 7px; font-weight: 600; font-size: 12.5px; }
.rd-chain { margin-bottom: 22px; }
.rd-side-block { margin-bottom: 20px; }
.rd-side-block a { color: var(--p-acc); text-decoration: none; }
.rd-side-block a:hover { text-decoration: underline; text-decoration-color: var(--p-lul); }
.rd-side-block div { padding: 3px 0; }
.rd-not { display: flex; gap: 9px; align-items: baseline; padding: 4px 0; }
.rd-sym { color: var(--p-ink); min-width: 26px; flex-shrink: 0; }

/* The full chart, laid over the reading column. */
.rd-full {
  position: absolute; top: 14px; left: 224px; right: 24px; max-height: calc(100% - 28px); overflow-y: auto;
  background: #fff; border: 1px solid var(--p-ink); box-shadow: 0 16px 50px rgba(0,0,0,.18); z-index: 2;
}
.rd-full[hidden] { display: none; }
.rd-full-h {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 14px;
  border-bottom: 1px solid var(--p-rule); font-weight: 600; color: var(--p-ink); font-size: 14px;
  position: sticky; top: 0; background: var(--p-rail);
}
.rd-full-h button { background: none; border: 0; font-size: 20px; color: var(--p-dim); cursor: pointer; min-width: 36px; min-height: 36px; }
.rd-fc { display: flex; flex-direction: column; align-items: center; padding: 14px; }
.rd-fb {
  display: flex; gap: 6px; align-items: center; padding: 5px 10px; border: 1px solid var(--p-rule);
  background: #fff; font-size: 12.5px; color: var(--p-soft); cursor: pointer; text-decoration: none;
}
a.rd-fb:hover { border-color: var(--p-faint); color: var(--p-ink); }
.rd-fb.me, .rd-fb.here { border: 1.5px solid var(--p-acc); font-weight: 600; color: var(--p-ink); }
.rd-fv { width: 1px; height: 12px; background: var(--p-trunk); }
.rd-fbar { width: 92%; height: 1px; background: var(--p-trunk); }
.rd-frow { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 8px; width: 100%; margin-top: 10px; }
.rd-fcol { display: flex; flex-direction: column; gap: 3px; }
.rd-fg { display: flex; gap: 5px; align-items: center; padding-left: 8px; font-size: 11.5px; color: var(--p-dim); cursor: pointer; text-decoration: none; }
a.rd-fg:hover { color: var(--p-ink); }
.rd-fg.more { color: var(--p-faint); cursor: default; }

/* The lesson column. .rd-main scrolls (tools/render_star.mjs relies on that); .rd-page holds the
   measure, so the scroll bar sits at the rail's edge and not in the middle of the page. */
.rd-main {
  flex: 1; min-width: 0; overflow-y: auto; padding: 28px 44px 70px; background: #fff;
  font-family: var(--p-serif); font-size: 16.5px; line-height: 1.62; color: var(--p-ink);
}
.rd-page { max-width: 760px; margin: 0 auto; }
.rd-meta {
  font-family: var(--p-mono); font-size: 11px; color: var(--p-dim); letter-spacing: .04em;
  text-transform: uppercase; margin: 0 0 10px;
}
.rd-main h1 {
  font-family: var(--p-serif); font-size: 31px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.15; margin: 0 0 12px; color: var(--p-ink);
}
.rd-q {
  margin: 0 0 24px; padding: 2px 0 2px 16px; border-left: 2px solid var(--p-acc);
  color: var(--p-soft); font-style: italic; font-size: 16.5px; line-height: 1.5;
}
/* A section heading, open or folded: a small blue square, then the words. */
.rd-main h2, .rd-fold summary {
  display: flex; align-items: center; margin: 38px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--p-rule); font-family: var(--p-sans); font-size: 18.5px;
  font-weight: 700; letter-spacing: -0.01em; color: var(--p-ink); line-height: 1.3;
}
.rd-main h2::before, .rd-fold summary::before {
  content: ""; flex: none; width: 7px; height: 7px; background: var(--p-acc); margin-right: 9px;
}
.rd-main h3 {
  margin: 26px 0 8px; font-family: var(--p-sans); font-size: 15.5px; font-weight: 600; color: var(--p-ink);
}
.rd-main p { margin: 0 0 14px; }
.rd-main ul, .rd-main ol { margin: 0 0 16px; padding-left: 30px; }
.rd-main li { margin: 8px 0; padding-left: 4px; }
.rd-main ol li::marker { font-family: var(--p-sans); font-weight: 600; font-size: 14.5px; color: var(--p-ink); }
.rd-main strong { font-weight: 600; }
.rd-main a, .rd-main a.wl {
  color: var(--p-acc); cursor: pointer; text-decoration: underline;
  text-decoration-color: var(--p-lul); text-underline-offset: 3px;
}
.rd-main a:hover { text-decoration-color: var(--p-acc); }
.rd-display { margin: 16px 0; text-align: center; overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.rd-table { margin: 16px 0; overflow-x: auto; max-width: 100%; }
.rd-table table { border-collapse: collapse; margin: 0 auto; }
.rd-table th, .rd-table td { padding: 5px 14px; text-align: center; border-bottom: 1px solid var(--p-rule); }
.rd-table thead th { border-top: 1.5px solid var(--p-ink); border-bottom: 1px solid var(--p-ink); font-weight: 600; }
.rd-table tbody tr:last-child td { border-bottom: 1.5px solid var(--p-ink); }

/* A result boxed apart, the way a textbook sets off a theorem. */
.rd-result { margin: 22px 0; padding: 14px 20px 4px; border: 1px solid var(--p-ink); background: var(--p-rail); }

/* Worked example: a black tab on a shaded box. */
.rd-ex { margin: 30px 0; border-top: 2px solid var(--p-ink); background: var(--p-rail); padding: 0 20px 6px; }
.rd-ex-tag {
  display: inline-block; margin: 0 0 0 -20px; padding: 4px 12px; background: var(--p-ink); color: #fff;
  font-family: var(--p-mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
}
.rd-ex h3 { margin: 12px 0 10px; }
.rd-sol { display: block; margin: 16px 0 8px; font-family: var(--p-sans); font-size: 14.5px; font-weight: 600; color: var(--p-ink); }

.rd-fold { margin: 0 0 14px; }
.rd-fold summary { list-style: none; cursor: pointer; margin: 38px 0 0; }
.rd-fold summary::-webkit-details-marker { display: none; }
.rd-fold summary::after {
  content: "show"; margin-left: 12px; font-family: var(--p-mono); font-size: 10.5px; font-weight: 500;
  color: var(--p-dim); text-transform: uppercase; letter-spacing: .1em;
}
.rd-fold[open] summary::after { content: "hide"; }
.rd-fold[open] summary { margin-bottom: 12px; }
.rd-fold[open] { padding-bottom: 10px; border-bottom: 1px solid var(--p-rule); }

/* Figures are ink on paper, numbered. */
.rd-fig { margin: 24px auto; text-align: center; --fig-ink: #09090b; --fig-dim: #71717a; --fig-label: #09090b; --fig-shade: rgba(9,9,11,.08); }
.rd-fig svg { display: inline-block; max-width: 100%; height: auto; overflow: visible; }
.rd-fig figcaption { margin: 8px auto 0; max-width: 560px; font-size: 14px; line-height: 1.45; color: var(--p-soft); }
.rd-fig figcaption b { font-family: var(--p-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--p-ink); margin-right: 8px; }
.katex { font-size: 1.04em; }
.ftex .katex { font-size: 1em; }
.rd-foot { margin-top: 50px; padding-top: 14px; border-top: 1px solid var(--p-rule); font-family: var(--p-sans); font-size: 12px; color: var(--p-dim); }
.rd-main .katex { font-size: 1.02em; }
.rd-main .nw { white-space: nowrap; }

/* Phones: no rails. The prerequisites strip and the folded "Where you are" sit under the question. */
.rd-strip, .rd-where { display: none; }
.rd-strip {
  grid-template-columns: 1fr; gap: 6px; border: 1px solid var(--p-rule); background: var(--p-rail);
  padding: 10px 12px; margin: 0 0 18px; font-family: var(--p-sans); font-size: 13px; line-height: 1.4;
}
.rd-strip .lab { font-family: var(--p-mono); font-size: 10.5px; letter-spacing: .1em; color: var(--p-dim); text-transform: uppercase; }
.rd-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.rd-pill {
  display: inline-block; border: 1px solid var(--p-ink); background: #fff; padding: 3px 8px;
  color: var(--p-ink); font-weight: 500; cursor: pointer; text-decoration: none; max-width: 100%;
}
.rd-main a.rd-pill, .rd-main a.rd-pu-more { color: var(--p-ink); text-decoration: none; }
.rd-main a.rd-pill:hover { border-color: var(--p-ink); text-decoration: underline; text-decoration-color: var(--p-faint); }
.rd-pill.need { border-left-width: 3px; }
.rd-pill.lock { border-style: dashed; border-color: var(--p-dim); }
.rd-pill small { font-family: var(--p-mono); font-size: 10px; color: var(--p-dim); margin-left: 5px; font-weight: 400; }
.rd-pills .rd-pu-more { display: inline-block; margin: 0; padding: 3px 2px; }
.rd-where summary {
  list-style: none; cursor: pointer; display: flex; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--p-rule); background: var(--p-rail);
  font: 600 13px var(--p-sans); color: var(--p-ink);
}
.rd-where summary::-webkit-details-marker { display: none; }
.rd-where summary span { margin-left: auto; color: var(--p-dim); font-weight: 400; }
.rd-where summary::after { content: "\25BE"; }
.rd-where[open] summary::after { content: "\25B4"; }
.rd-where-body { border: 1px solid var(--p-rule); border-top: 0; padding: 10px; font-family: var(--p-sans); }

@media (max-width: 760px) {
  .rd-sheet { inset: 0; border: 0; }
  .rd-left, .rd-right, .rd-crumb { display: none; }
  .rd-bar { justify-content: space-between; }
  .rd-strip { display: grid; }
  .rd-where { display: block; margin: 0 0 18px; }
  .rd-full { left: 10px; right: 10px; }
  .rd-main { padding: 18px 16px 50px; font-size: 16px; }
  .rd-main h1 { font-size: 26px; }
  .rd-ex { padding: 0 14px 4px; }
  .rd-ex-tag { margin-left: -14px; }
}

/* ---- the course page (option A: one scroll, chapter rail) ---------------------------------- */
#course {
  position: fixed; inset: 0; z-index: 35; overflow-y: auto; background: rgba(5,6,11,.86);
  backdrop-filter: blur(3px); font-family: var(--p-sans);
}
#course[hidden] { display: none; }
#course .cp {
  max-width: 1240px; margin: 20px auto 60px; background: #fff; color: var(--p-ink);
  border: 1px solid var(--p-ink); color-scheme: light; position: relative;
}
#course a { color: var(--p-acc); text-decoration: none; cursor: pointer; }
#course .rbar {
  display: flex; align-items: center; gap: 14px; padding: 8px 16px;
  border-bottom: 1px solid var(--p-rule); background: var(--p-rail);
}
#course .crumbs { flex: 1; min-width: 0; font-size: 12.5px; color: var(--p-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#course .crumbs b { color: var(--p-ink); font-weight: 600; }

#course .head { padding: 26px 32px 20px; border-bottom: 1px solid var(--p-rule); background: var(--p-rail); }
#course .ey { font-family: var(--p-mono); font-size: 11px; letter-spacing: .1em; color: var(--p-dim); text-transform: uppercase; }
#course .head h1 { font-family: var(--p-serif); font-size: 38px; font-weight: 600; margin: 4px 0 6px; letter-spacing: -0.01em; line-height: 1.15; }
#course .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--p-soft); }
#course .facts b { color: var(--p-ink); font-weight: 600; }
#course .acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
#course .btn {
  border: 1px solid var(--p-ink); background: #fff; color: var(--p-ink); font: 600 13px var(--p-sans);
  padding: 7px 12px; cursor: pointer;
}
#course .btn:hover { background: var(--p-ink); color: #fff; }

#course .body { display: grid; grid-template-columns: 240px 1fr; }
#course .rail { background: var(--p-rail); border-right: 1px solid var(--p-rule); }
#course .rail-in { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 18px 14px; font-size: 13px; }
#course .rail-h { font-family: var(--p-mono); font-size: 10.5px; letter-spacing: .1em; color: var(--p-dim); text-transform: uppercase; margin: 0 0 9px; font-weight: 500; }
#course .rail .c {
  display: grid; grid-template-columns: 22px 1fr; gap: 4px; padding: 6px 8px; color: var(--p-soft);
  line-height: 1.35; cursor: pointer; border-left: 2px solid transparent;
}
#course .rail .c:hover { color: var(--p-ink); }
#course .rail .c i { font-style: normal; font-family: var(--p-mono); font-size: 11px; color: var(--p-dim); padding-top: 2px; }
#course .rail .c.on { color: var(--p-ink); font-weight: 600; border-left-color: var(--p-acc); background: #fff; }
#course .rail .c.on i { color: var(--p-acc); }

#course .main { padding: 24px 32px 40px; min-width: 0; }
#course .chap { margin-bottom: 30px; scroll-margin-top: 12px; }
#course .chap-h { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--p-rule); }
#course .chap-h::before { content: ""; width: 8px; height: 8px; background: var(--p-acc); flex: none; align-self: flex-start; margin-top: 9px; }
#course .chap-h .n { font-family: var(--p-mono); font-size: 12px; color: var(--p-dim); }
#course .chap-h h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; flex: 1; line-height: 1.3; }
#course .chap-h .m { font-family: var(--p-mono); font-size: 11px; color: var(--p-dim); white-space: nowrap; }
#course .sum { font-family: var(--p-serif); font-size: 15.5px; line-height: 1.55; color: var(--p-soft); margin: 10px 0; max-width: 760px; }
#course .review { font-size: 12.5px; color: var(--p-dim); margin: 0 0 10px; line-height: 1.9; }
#course .review a { border: 1px solid var(--p-rule); background: var(--p-rail); padding: 2px 7px; margin-right: 4px; white-space: nowrap; color: var(--p-soft); }
#course .review a:hover { border-color: var(--p-faint); color: var(--p-ink); }

#course .row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid var(--p-rule); font-size: 14.5px;
}
#course .row .n { font-family: var(--p-mono); font-size: 11.5px; color: var(--p-dim); }
#course .row .t { min-width: 0; }
#course .row .t a { color: var(--p-ink); }
#course .row .t a:hover { color: var(--p-acc); text-decoration: underline; text-decoration-color: var(--p-lul); }
#course .rt { font-family: var(--p-mono); font-size: 10px; color: var(--p-dim); border: 1px solid var(--p-rule); padding: 0 4px; margin-left: 8px; white-space: nowrap; }
#course .row .tools { display: flex; gap: 12px; align-items: center; font-size: 12.5px; white-space: nowrap; }
#course .row .tools a:hover { text-decoration: underline; text-decoration-color: var(--p-lul); }
#course .row .ws .sm { display: none; }
#course .row.qz { background: var(--p-rail); font-size: 13px; }
#course .row.qz .t { font-weight: 600; }
#course .row small { font-weight: 400; color: var(--p-dim); margin-left: 8px; }
#course .row.test { background: var(--p-ink); color: #fff; font-size: 13px; }
#course .row.test .t { font-weight: 600; }
#course .row.test .n, #course .row.test small { color: #d4d4d8; }
#course .row.test .tools a { color: #fff; text-decoration: underline; text-decoration-color: #71717a; }

/* Phone: the rail becomes a chapter picker that sticks while you scroll. A real <select> sits
   invisibly over it, so the phone's own picker opens. */
#course .dd { display: none; }
@media (max-width: 760px) {
  #course .cp { margin: 0; border: 0; min-height: 100%; }
  #course .crumbs { display: none; }
  #course .rbar { justify-content: space-between; }
  #course .head { padding: 20px 16px 16px; }
  #course .head h1 { font-size: 30px; }
  #course .body { grid-template-columns: 1fr; }
  #course .rail { display: none; }
  #course .dd {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 2;
    border: 1px solid var(--p-ink); background: #fff; padding: 9px 12px; font-size: 13.5px; font-weight: 600;
    margin: 12px 16px 0; box-shadow: 0 -12px 0 #fff;
  }
  #course .dd .ddt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #course .dd small { font-family: var(--p-mono); font-size: 11px; color: var(--p-dim); font-weight: 400; margin-right: 6px; }
  #course .dd select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
  #course .main { padding: 16px; }
  #course .chap { scroll-margin-top: 64px; }
  #course .row { grid-template-columns: 38px 1fr auto; font-size: 14px; }
  #course .row .ws .lg { display: none; }
  #course .row .ws .sm { display: inline; }
  #course .chap-h { flex-wrap: wrap; }
  #course .chap-h h2 { flex-basis: calc(100% - 40px); font-size: 18px; }
  #course .chap-h .m { margin-left: 18px; }
}
