/* Topic pages (Content Merger phase 3; python/daveth_ui/topics.py builds them).
   The reading part uses the site's own tokens, so a theme change reaches it.
   The wall is the approved "Subscription upgrade visual ideas" design, in the
   page's own theme: dark in dark, light in light (owner, 18 Oct 2026). Its
   colours are the --stage-* tokens in tokens.css. What sits on a video (the
   film's tag and button, the end of the preview) stays dark in both, because
   the picture under it is dark. */
.tp-film__frame, .tp-video__frame { --stage: #070b11; --stage-white: #f4f7fb; --stage-ink: #e9eef5; --stage-ink-2: #bcc7d8;
  --stage-muted: #9eabbe; --stage-metal: #e6c25a; --stage-metal-hi: #f3d98b; }

.tp { --tp-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --tp-prose: "Source Serif 4", Georgia, "Times New Roman", serif; --tp-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --tp-col: 880px; width: min(1080px, calc(100vw - 32px)); margin: 0 auto; padding: clamp(36px, 6vw, 72px) 0 0; }
.tp > * { margin-left: auto; margin-right: auto; }

/* the wall runs edge to edge (100vw), and 100vw counts the scrollbar: clip the
   few pixels it would add rather than let the page scroll sideways */
.page-topic #main-content { overflow-x: clip; }

/* copying (Y-31): the site turns text selection off (site.css); commands stay
   copyable, because a learner types them into a lab */
.tp-term, .tp-section code { -webkit-user-select: text; user-select: text; }

/* ---- head ---- */
.tp-head { max-width: var(--tp-col); }
.tp-crumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.tp-crumb a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.tp-crumb a:hover { color: var(--text); }
.tp-head h1 { margin: 18px 0 0; font-size: clamp(36px, 5.4vw, 56px); line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.tp-lede { margin: 18px 0 0; font: 400 clamp(19px, 2vw, 22px)/1.55 var(--tp-prose); color: var(--muted); }
.tp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 24px 0 0; font-size: 14px; color: var(--muted); }
.tp-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 650; color: var(--text); background: var(--surface); }
.tp-badge.is-free { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }

/* ---- the video ---- */
/* the text, the drawings, the video and the lab card share one column (owner, 21 Oct 2026) */
.tp-video { max-width: var(--tp-col); margin-top: 40px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--bg-elevated); }
.tp-video__frame { position: relative; background: #000; }
/* a generated page's video (H-18): the poster until the plan is confirmed, then Bunny's player */
.tp-video__poster, .tp-video__player { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; object-fit: cover; }
/* the play icon on a locked video (Y-49; owner, 21 Oct 2026): the whole poster answers a press and goes to
   the wall; an icon, no words on the picture */
.tp-video__play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-decoration: none; }
/* a light disc on the dark film, so it reads as a button and not a hole in the picture (owner, 23 Oct 2026:
   "the play icon looks odd"); the triangle's centroid sits on the disc's centre, its corners rounded */
.tp-video__play svg { width: clamp(56px, 8vw, 76px); height: clamp(56px, 8vw, 76px); border-radius: 50%;
  background: rgba(244, 247, 251, .94); color: #0b1220; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45); transition: transform .2s ease, background-color .2s ease; }
.tp-video__play:hover svg { transform: scale(1.06); background: #fff; }
/* focus shows once, on the disc, and only for the keyboard (owner, 21 Oct 2026: one focus edge) */
.tp-video__play:focus-visible { outline: none; }
.tp-video__play:focus-visible svg { outline: 3px solid var(--focus-ring); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .tp-video__play svg { transition: none; } }
/* the plan note sits under the bar, never on the picture (owner, 21 Oct 2026) */
.tp-video__note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--muted); }
.tp-video__note a { color: var(--accent); }
/* when Bunny's player cannot be reached (H-24; static/js/bunny-watch.js) */
.tp-video .dv-video-quiet { margin: 0; padding: 12px 16px; font: 600 14px/1.5 var(--tp-ui); color: var(--text); border-top: 1px solid var(--line); }
/* no ring on the frame: the player's own controls draw their focus inside it, and a ring here showed on a
   mouse press too, a blue box round the whole film (owner, 23 Oct 2026) */
.tp-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.tp-video__bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.tp-video__bar h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.tp-video__bar p { margin: 0; font-size: 14px; color: var(--muted); }
/* Y-33: the topic's check, under the lesson page's video (backend/functions/_lib/lessons.js shellCheck) */
.tp-check { display: inline-block; margin: 14px 0 0; font-size: 14.5px; font-weight: 600; color: var(--accent, currentColor); text-underline-offset: 3px; }
.tp-check:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
.tp-video__bar .tp-badge { margin-left: auto; }
.tp-video__end { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center;
  background: var(--stage); color: var(--stage-ink); }
.tp-video__end[hidden] { display: none; }
.tp-video__end-k { margin: 0; font-size: 13px; letter-spacing: .08em; color: var(--stage-metal); }
.tp-video__end-t { margin: 0; max-width: 26em; font: 400 clamp(20px, 2.6vw, 28px)/1.3 var(--tp-prose); color: var(--stage-white); }
.tp-video__end-a { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0 0; }

/* ---- buttons ---- */
.tp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font: 700 15px/1 var(--tp-ui); color: #06100c; background: var(--accent); cursor: pointer; text-decoration: none; }
html[data-theme="light"] .tp-btn { color: #fff; }
.tp-btn:hover { filter: brightness(1.06); }
.tp-btn.is-quiet { color: inherit; background: transparent; border-color: currentColor; }
.tp-video__end .tp-btn { color: var(--stage-cta-ink); background: linear-gradient(180deg, var(--stage-cta-hi), var(--stage-cta)); }
.tp-video__end .tp-btn.is-quiet { color: var(--stage-ink); background: transparent; border-color: color-mix(in srgb, var(--stage-white) 35%, transparent); }

/* ---- the searches this page answers (SEO plan step 3): short answers above the lesson ---- */
.tp-answers { max-width: var(--tp-col); margin-top: 52px; padding: 26px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tp-answers h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; letter-spacing: -.015em; }
.tp-answers h3 { margin: 22px 0 6px; font-size: 18px; line-height: 1.3; }
.tp-answers p { margin: 0 0 18px; font: 400 17px/1.62 var(--tp-prose); color: var(--text); }
.tp-answers__go { font: 500 15px/1.4 var(--tp-ui); color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.tp-answers__go:hover, .tp-answers__go:focus-visible { text-decoration-color: currentColor; }

/* ---- the lesson's public text ---- */
.tp-text { max-width: var(--tp-col); margin-top: 64px; }
.tp-section + .tp-section { margin-top: 64px; padding-top: 52px; border-top: 1px solid var(--line); }
.tp-section h2 { margin: 0 0 22px; font-size: clamp(25px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
/* a lesson drawing (G-28): both themes in the page, the reader's own shown. It fills the column and
   shrinks with it: nothing on the page scrolls sideways (owner, 21 Oct 2026) */
.tp-fig { width: 100%; margin: 30px 0; }
.tp-fig__img { display: block; width: 100%; height: auto; border-radius: 12px; }
.tp-fig__img.is-dark { display: none; }
html[data-theme="dark"] .tp-fig__img.is-light { display: none; }
html[data-theme="dark"] .tp-fig__img.is-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .tp-fig__img.is-light { display: none; }
  html:not([data-theme]) .tp-fig__img.is-dark { display: block; }
}
/* what an interactive drawing says in the state it is shown in */
.tp-fig__cap { margin: 10px 2px 0; font: 400 15px/1.55 var(--tp-prose); color: var(--muted); }
/* a lesson step-through, one numbered picture per step, each with the words of that step */
/* one step at a time with Previous and Next (topic.js); without the script the steps stack.
   Never a sideways strip (owner, 21 Oct 2026) */
.tp-section .tp-steps__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.tp-section .tp-steps__item { margin: 0; }
.tp-section .tp-steps__item + .tp-steps__item { margin-top: 0; }
.tp-steps.is-stepper .tp-steps__item[hidden] { display: none; }
.tp-steps.is-stepper .tp-steps__n { display: none; }
.tp-steps__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.tp-steps__nav button { min-height: 40px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 14px/1 var(--tp-ui); cursor: pointer; }
.tp-steps__nav button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); }
.tp-steps__nav button:disabled { opacity: .4; cursor: default; }
.tp-steps__count { font: 600 14px/1 var(--tp-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.tp-section .tp-steps__cap { margin: 10px 2px 0; font: 400 15.5px/1.55 var(--tp-prose); color: var(--text); }
.tp-steps__n { font-weight: 650; margin-right: 4px; }
/* the byline on the new topic pages (A-67): who wrote it and when it last changed */
.tp-by { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.tp-by a { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.tp-by a:hover, .tp-by a:focus-visible { border-bottom-color: currentColor; }
.tp-section h3 { margin: 34px 0 14px; font-size: 19px; line-height: 1.3; }
.tp-section p, .tp-section li, .tp-section dd { font: 400 18.5px/1.68 var(--tp-prose); color: var(--text); }
.tp-section p { margin: 0 0 1.1em; }
.tp-section ul, .tp-section ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.tp-section li + li { margin-top: .35em; }
.tp-section b { font-weight: 650; }
.tp-section code { font: 500 .82em/1 var(--tp-mono); padding: .12em .32em; border-radius: 5px; background: var(--surface-strong); }
.tp-section blockquote { margin: 0 0 1.2em; padding-left: 18px; border-left: 3px solid var(--line-strong); font: italic 400 19px/1.6 var(--tp-prose); color: var(--muted); }
.tp-term { margin: 4px 0 26px; padding: 18px 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elevated);
  font: 400 13.5px/1.62 var(--tp-mono); color: var(--text); white-space: pre; tab-size: 4; }
.tp-table { margin: 4px 0 26px; overflow-x: auto; }
.tp-table table { border-collapse: collapse; min-width: 60%; font-size: 15.5px; }
.tp-table th, .tp-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tp-table th { font-size: 13px; font-weight: 700; color: var(--muted); }
.tp-section dl { margin: 0 0 1.2em; }
.tp-section dt { font-weight: 700; margin-top: .8em; }
.tp-section dd { margin: .2em 0 0; }

/* the free text above the wall dissolves into it (decorative; the text is all there for readers and crawlers) */
.tp-text.is-cut { position: relative; }
.tp-text.is-cut::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg)); }
.tp.is-open .tp-text.is-cut::after { display: none; }

/* ---- continue into the lesson (readers whose plan holds it) ---- */
.tp-continue { max-width: var(--tp-col); margin-top: 48px; padding: 28px 30px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 16px; background: var(--surface-soft); }
.tp-continue[hidden] { display: none; }
.tp-continue h2 { margin: 0; font-size: 22px; letter-spacing: -.015em; }
.tp-continue p { margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
.tp-continue .tp-btn { margin-top: 8px; }

/* ---- the wall ---- */
.tp-gate { position: relative; width: 100vw; max-width: none; margin: 24px calc(50% - 50vw) 0; padding: 120px 20px 120px; overflow: hidden; isolation: isolate;
  color: var(--stage-ink); background: linear-gradient(180deg, var(--bg) 0, var(--stage) 150px, var(--stage) calc(100% - 150px), var(--bg) 100%); }
.tp-gate[hidden] { display: none; }
.tp-gate::before { content: ""; position: absolute; left: 50%; top: 220px; width: 1500px; height: 900px; margin-left: -750px; border-radius: 50%; filter: blur(70px); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--stage-glow) 18%, transparent), transparent); }
.tp-gate__in { max-width: 1200px; margin: 0 auto; display: grid; justify-items: center; text-align: center; }
.tp-gate .kicker { margin: 0; font: 500 13px/1.3 var(--tp-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--stage-metal); }
.tp-gate h2, .tp-gate--screen h1 { margin: 26px 0 0; max-width: 13em; font: 400 clamp(38px, 6.4vw, 82px)/1.02 var(--tp-prose); letter-spacing: -.025em; color: var(--stage-white); text-wrap: balance; }
/* the lock screens (D-65): the wall as a page of its own, its heading the page's h1 */
.tp--screen { padding-top: 0; }
.tp--screen .tp-gate { margin-top: 0; }
.tp-gate h2 i { font-weight: 300; background: var(--stage-foil); background-size: 230% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.tp-gate .rule { width: min(460px, 70%); height: 1px; margin: 38px 0 30px; background: linear-gradient(90deg, transparent, var(--stage-metal), transparent); }
.tp-gate .hook { margin: 0; max-width: 33em; font: 300 clamp(17px, 2vw, 21px)/1.55 var(--tp-ui); color: var(--stage-ink-2); text-wrap: pretty; }
.tp-gate .hook b { font-weight: 500; color: var(--stage-ink); }

.tp-film { position: relative; width: 100%; margin-top: 64px; }
.tp-film__frame { position: relative; border-radius: 18px; overflow: hidden; background: var(--stage); box-shadow: var(--stage-film-shadow); }
.tp-film video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
/* above the picture, never on it: laid on the film it covered the film's own opening words (owner's rule,
   21 Oct 2026: no text on a video or picture; found on phones in the W-18 run, 22 Oct) */
.tp-film__tag { display: flex; align-items: center; gap: 9px; padding: 13px 18px; border-bottom: 1px solid color-mix(in srgb, var(--stage-white) 8%, transparent);
  font: 500 11px/1 var(--tp-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--stage-ink-2); }
.tp-film__tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--stage-metal-hi); }
.tp-film__ctl { position: absolute; right: 16px; bottom: 18px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: color-mix(in srgb, var(--stage) 62%, transparent); border: 1px solid color-mix(in srgb, var(--stage-white) 14%, transparent); color: var(--stage-ink); }
.tp-film__say { margin: 26px auto 0; max-width: 34em; font: 300 clamp(15px, 1.7vw, 18px)/1.45 var(--tp-ui); color: var(--stage-muted); }
.tp-film__say b { font-weight: 500; color: var(--stage-ink); }

.tp-offer { position: relative; width: 100%; max-width: 1080px; margin-top: 92px; text-align: left; border-radius: 26px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--stage-glass-a) 82%, transparent), color-mix(in srgb, var(--stage-glass-b) 90%, transparent) 62%);
  box-shadow: var(--stage-shadow); }
.tp-offer__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); padding: 64px 68px; }
.tp-offer__l { padding-right: 58px; }
.tp-offer__r { padding-left: 58px; border-left: 1px solid color-mix(in srgb, var(--stage-white) 8%, transparent); }
.tp-offer .mark { margin: 0; display: flex; align-items: center; gap: 16px; font: 700 12px/1 var(--tp-ui); letter-spacing: .42em; color: var(--stage-ink); }
.tp-offer .mark::after { content: ""; width: 34px; height: 1px; background: var(--stage-card-metal); }
.tp-offer .tier { margin: 26px 0 20px -.04em; font: 300 clamp(56px, 8vw, 104px)/.92 var(--tp-prose); letter-spacing: -.035em; color: var(--stage-white); }
.tp-offer .tracks { margin: 0; font: 600 12px/1.7 var(--tp-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--stage-card-metal); }
.tp-offer .k { margin: 44px 0 0; font: 600 11.5px/1 var(--tp-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--stage-faint); }
.tp-offer__r .k { margin-top: 0; }
.tp-offer ul { list-style: none; margin: 14px 0 0; padding: 0; }
.tp-offer li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-top: 1px solid color-mix(in srgb, var(--stage-white) 7%, transparent); font-size: 15.5px; color: var(--stage-ink); }
.tp-offer li .v { flex: none; font: 400 12.5px/1 var(--tp-mono); color: var(--stage-muted); }
.tp-offer li.all { color: var(--stage-muted); }
.tp-offer dl { margin: 20px 0 0; }
.tp-offer dl div { display: flex; align-items: baseline; gap: 12px; padding: 11px 0; }
.tp-offer dt { flex: 1; display: flex; align-items: baseline; gap: 12px; min-width: 0; font-size: 15.5px; color: var(--stage-muted); }
.tp-offer dt::after { content: ""; flex: 1; min-width: 18px; border-bottom: 1px dotted color-mix(in srgb, var(--stage-white) 20%, transparent); transform: translateY(-.28em); }
.tp-offer dd { margin: 0; font: 400 21px/1 var(--tp-prose); font-variant-numeric: lining-nums tabular-nums; color: var(--stage-ink-2); }
/* the measured figures, in place of 'waiting in this lesson' */
.tp-offer ul.stats { margin: 40px 0 0; display: grid; gap: 0; }
.tp-offer ul.stats li { justify-content: flex-start; align-items: baseline; gap: 16px; padding: 14px 0; }
.tp-offer ul.stats b { min-width: 3.2em; font: 400 34px/1 var(--tp-prose); letter-spacing: -.02em; background: var(--stage-foil); background-size: 230% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tp-offer ul.stats span { font-size: 16px; color: var(--stage-ink); }
/* what one plan gets you: a short ticked list above the price */
.tp-offer ul.gets { margin: 18px 0 8px; }
.tp-offer ul.gets li { justify-content: flex-start; align-items: flex-start; gap: 12px; padding: 9px 0; border-top: 0; font-size: 15.5px; color: var(--stage-ink); }
.tp-offer ul.gets li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%;
  background: var(--stage-metal-hi) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-4.9' fill='none' stroke='%231a1406' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
/* a plain check in the price's gold, no filled disc, in both themes (owner, 18 Oct 2026) */
.tp-offer ul.gets li::before { border-radius: 0; background: var(--stage-metal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.6l3.6 3.6 7.4-8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.6l3.6 3.6 7.4-8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.tp-offer .ours { margin-top: 14px; padding-top: 26px; border-top: 1px solid color-mix(in srgb, var(--stage-card-metal) 40%, transparent); }
.tp-offer__r .k + dl .ours:first-child, .tp-offer__r > dl:first-child .ours { margin-top: 0; padding-top: 0; border-top: 0; }
.tp-offer .ours dt { font-size: 17px; color: var(--stage-white); }
.tp-offer .ours dd { font: 300 clamp(54px, 6.4vw, 78px)/.9 var(--tp-prose); letter-spacing: -.03em; background: var(--stage-foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tp-offer .per { margin: 6px 0 0; text-align: right; font-size: 14.5px; color: var(--stage-muted); }
.tp-gate__act { width: min(360px, 100%); margin: 8px 0 0; }
.tp-offer .go, .tp-gate__act .go { display: block; width: 100%; margin-top: 30px; padding: 18px 22px; border-radius: 12px; font: 650 16.5px/1.2 var(--tp-ui); text-align: center; text-decoration: none;
  color: var(--stage-cta-ink); background: linear-gradient(180deg, var(--stage-cta-hi), var(--stage-cta)); box-shadow: 0 16px 40px -10px color-mix(in srgb, var(--stage-cta) 55%, transparent); }
.tp-offer .go:hover, .tp-gate__act .go:hover { transform: translateY(-1px); }
.tp-offer .alt { display: block; width: max-content; margin: 14px auto 0; padding: 6px; font: 500 15px/1.2 var(--tp-ui); color: var(--stage-ink-2); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--stage-card-metal) 50%, transparent); text-underline-offset: 5px; }
.tp-offer .signin, .tp-offer .also { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--stage-muted); }
.tp-offer .signin a { color: var(--stage-ink); text-decoration: underline; text-underline-offset: 4px; }
.tp-offer .signin[hidden] { display: none; }
.tp-offer .note { margin: 22px 0 0; text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--stage-faint); }
.tp-quote { margin: 104px auto 0; max-width: 46em; display: grid; justify-items: center; gap: 22px; }
.tp-quote blockquote { margin: 0; font: 300 italic clamp(21px, 2.9vw, 31px)/1.38 var(--tp-prose); color: var(--stage-ink); text-wrap: balance; }
.tp-quote figcaption { font: 600 11.5px/1 var(--tp-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--stage-faint); }
.tp-gate :focus-visible { outline: 2px solid var(--stage-metal-hi); outline-offset: 3px; }

/* ---- the lab ---- */
.tp-lab { max-width: var(--tp-col); margin-top: 56px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elevated); }
/* under the video, the same width: the pair in the owner's pictures */
.tp-video + .tp-lab { max-width: var(--tp-col); margin-top: 16px; }
.tp-lab__card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 22px 24px; }
.tp-lab__icon { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--surface-strong); fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tp-lab__kicker { margin: 0; font-size: 13px; font-weight: 650; color: var(--accent); }
.tp-lab h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.015em; }
.tp-lab__when { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.tp-lab__state { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 650; color: var(--muted); }
.tp-lab__more { border-top: 1px solid var(--line); }
.tp-lab__more summary { padding: 15px 24px; cursor: pointer; font-size: 15px; font-weight: 650; color: var(--text); }
.tp-lab__more summary:hover { color: var(--accent); }
.tp-lab__body { padding: 0 24px 24px; }
.tp-lab__body p, .tp-lab__body li { font-size: 16px; line-height: 1.65; color: var(--muted); }
.tp-lab__body h3 { margin: 22px 0 8px; font-size: 16px; }
.tp-lab__body ol { margin: 0; padding-left: 1.3em; }
.tp-lab__go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 22px 0 0; }
.tp-lab__go[hidden] { display: none; }
.tp-lab__go span { font-size: 14px; color: var(--muted); }

/* ---- next ---- */
.tp-next { max-width: var(--tp-col); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 18px 32px; margin-top: 48px; padding: 22px 0 80px; border-top: 1px solid var(--line); }
.tp-next p { margin: 0; display: flex; flex-direction: column; gap: 6px; max-width: 46%; }
.tp-next .tp-next__next { margin-left: auto; text-align: right; }
@media (max-width: 640px) { .tp-next p { max-width: 100%; } .tp-next .tp-next__next { text-align: left; margin-left: 0; } }
.tp-next span { font-size: 13px; color: var(--muted); }
.tp-next a { font-size: 18px; font-weight: 650; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.tp-lab:last-child { margin-bottom: 96px; }

@media (max-width: 900px) {
  .tp-offer__in { grid-template-columns: minmax(0, 1fr); padding: 48px 40px; }
  .tp-offer__l { padding-right: 0; }
  .tp-offer__r { padding-left: 0; border-left: 0; border-top: 1px solid color-mix(in srgb, var(--stage-white) 8%, transparent); margin-top: 40px; padding-top: 40px; }
}
@media (max-width: 640px) {
  .tp-section p, .tp-section li { font-size: 17px; }
  .tp-gate { padding: 96px 16px 80px; }
  .tp-film { margin: 40px -16px 0; width: calc(100% + 32px); }
  .tp-film__frame { border-radius: 0; }
  .tp-offer { margin-top: 64px; border-radius: 20px; }
  .tp-offer__in { padding: 38px 24px; }
  .tp-lab__card { grid-template-columns: minmax(0, 1fr) auto; }
  .tp-lab__icon { display: none; }
  .tp-video__bar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .tp-offer .go:hover, .tp-gate__act .go:hover { transform: none; } }

/* Y-08: the chapter's contents at the foot of a topic page; this topic marked, the others linked */
.tp-chapter { margin: 48px 0 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; }
.tp-chapter h2 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.tp-chapter h2 span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.tp-chapter__count { margin: 6px 0 14px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.tp-chapter ol { margin: 0; padding: 0 0 0 1.4em; display: grid; gap: 6px; }
.tp-chapter li { padding-left: 4px; line-height: 1.45; }
.tp-chapter li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.tp-chapter a { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); text-underline-offset: 3px; }
.tp-chapter a:hover { text-decoration-color: currentColor; }
.tp-chapter a:focus-visible { outline: 2px solid var(--focus-ring, #74f0cf); outline-offset: 2px; border-radius: 3px; }
.tp-chapter li[aria-current="page"] span { font-weight: 700; }
.tp-chapter li[aria-current="page"]::marker { color: var(--text); }

/* Y-19: a lab's own page (python/daveth_ui/labs_pages.py) */
.lab-ov__tasks { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.lab-ov__tasks li { padding-left: 4px; line-height: 1.5; }
.lab-ov__tasks li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.lab-ov__fresh { margin: 16px 0 0; color: var(--muted); font-size: .92rem; }
.lab-ov__after ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }
/* the lessons are links, marked as the chapter list marks its own (owner, 4 Nov 2026: they read as plain text) */
.lab-ov__after a { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); text-underline-offset: 3px; }
.lab-ov__after a:hover { text-decoration-color: currentColor; }
.lab-ov__after a:focus-visible { outline: 2px solid var(--focus-ring, #74f0cf); outline-offset: 2px; border-radius: 3px; }
.lab-ov__go { margin-top: 40px; }
/* the page ends on its button: room before the footer's line, which sat on it (owner, 4 Nov 2026) */
.tp.lab-ov { padding-bottom: clamp(64px, 9vw, 112px); }

/* ---- the lesson inside the site's own page (owner, 21 Oct 2026; functions/_lib/lessons.js lessonShellPage) ---- */
.ls { width: min(1080px, calc(100vw - 32px)); margin: 0 auto; padding: 18px 0 64px; }
.ls-bar { position: sticky; top: var(--navkit-h, 64px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  margin: 0 0 22px; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.ls-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 14px; color: var(--muted); }
.ls-crumb a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.ls-tools { display: flex; align-items: center; gap: 8px; }
.ls-arrow, .ls-toc > summary { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  font: 600 14px/1 var(--tp-ui, inherit); color: var(--text); text-decoration: none; background: var(--surface); cursor: pointer; }
.ls-arrow:hover, .ls-toc > summary:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); }
.ls-toc { position: relative; }
.ls-toc > summary { list-style: none; gap: 10px; }
.ls-toc > summary::-webkit-details-marker { display: none; }
.ls-toc[open] > summary { border-color: var(--accent); }
.ls-n { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ls-toc__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(440px, calc(100vw - 32px)); max-height: min(70vh, 640px); overflow: auto;
  padding: 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg-elevated, var(--bg)); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .45); }
.ls-toc__chapter > summary { padding: 9px 10px; font-weight: 650; font-size: 14px; color: var(--text); cursor: pointer; border-radius: 8px; }
.ls-toc__chapter > summary:hover { background: var(--surface); }
.ls-toc__chapter ol { list-style: none; margin: 0 0 6px; padding: 0; }
.ls-toc__chapter li a, .ls-toc__here { display: flex; gap: 10px; padding: 7px 10px 7px 18px; border-radius: 8px; font-size: 14px; line-height: 1.4; color: var(--text); text-decoration: none; }
.ls-toc__chapter li a:hover { background: var(--surface); }
.ls-toc__here { color: var(--accent); font-weight: 650; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ls-toc__chapter b { min-width: 2.2em; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ls-toc__all { display: block; margin-top: 6px; padding: 10px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
.ls-video { max-width: none; margin: 0 0 26px; }
.ls-doc { display: block; width: 100%; min-height: 70vh; border: 0; background: transparent; }
/* 'Mark complete' (A-64, 25 Oct 2026) */
.ls-done { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 36px; }
.ls-done__btn { font: inherit; font-weight: 650; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; }
.ls-done__btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.ls-done__btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.ls-done__btn[aria-pressed="true"]::before { content: "\2713\00a0"; }
.ls-done__btn:disabled { opacity: .6; cursor: progress; }
.ls-done__note { font-size: 14px; color: var(--muted); }
.ls-end { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.ls-step { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; background: var(--surface-soft, transparent); }
a.ls-step:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.ls-step small { font-size: 13px; color: var(--muted); }
.ls-step span { font-weight: 650; }
.ls-step--next { text-align: right; }
span.ls-step { border: 0; background: none; }
.ls-after { margin: 14px 0 0; text-align: right; font-size: 14px; }
.ls-after a { color: var(--text); }
/* the bar, the video and the lessons at the end on the lesson's own column: its text and drawings run 880px
   wide, centred in the frame, never closer than its gutter (32px; 20px once the frame is 720px or narrower) */
.ls { --ls-gut: 32px; }
.ls > :not(.ls-doc) { margin-left: max(var(--ls-gut), calc((100% - 880px) / 2)); margin-right: max(var(--ls-gut), calc((100% - 880px) / 2)); }
@media (max-width: 752px) { .ls { --ls-gut: 20px; } }
@media (max-width: 700px) {
  .ls-bar { position: static; }
  .ls-tools { width: 100%; justify-content: space-between; }
  .ls-n__word { display: none; }
  .ls-arrow, .ls-toc > summary { white-space: nowrap; }
  .ls-toc__panel { right: auto; left: 50%; transform: translateX(-50%); }
  .ls-end { grid-template-columns: 1fr; }
  .ls-step--next { text-align: left; }
}
