/* lesson.css — the single layout for every lesson page.
   Visual language borrowed from the novel-writing deck (serif display type, dark chapter
   bands alternating with light paper sections, paired white cards, one vermillion punchline
   per section), rebuilt as a normally scrolling document. Colour tokens come from site.css. */

:root {
  --band: #1f1b16;        /* chapter band: dark in both themes */
  --band-ink: #f6f1e7;
  --band-muted: #bdb3a2;
  --band-edge: transparent;
  --measure: 40em;        /* reading column */
  --measure-wide: 52em;   /* tables, card grids, transcripts */
  /* Height of the sticky top bar. lesson.js keeps this in step with the real bar
     (it differs between phone and desktop); the value here is the first paint's guess,
     used for a hash that lands before the script runs. */
  --top-h: 58px;
}
/* On a dark page the band would blend into the background, so lift it slightly
   and draw vermillion hairlines to keep the divider readable. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --band: #272018; --band-edge: var(--accent); }
}
:root[data-theme="dark"] { --band: #272018; --band-edge: var(--accent); }

/* ---------- shared inner column ---------- */
.inner { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .inner { padding: 0 32px; } }
.inner > * { max-width: var(--measure); }
.inner > .wide { max-width: var(--measure-wide); }

/* ---------- sticky top bar: brand flips up into the article title ---------- */
/* The lesson page reuses .top from site.css — sticky and frosted there — and only adds
   the flipper and a shorter bar. */
.top.lesson-top .wrap { gap: 10px; height: 56px; }
.top.lesson-top .brand { flex: none; gap: 0; }
.top.lesson-top .brand svg { width: 26px; height: 26px; }

/* Two lines stacked in a 26px window; scrolling past the title slides the window up one line. */
.flip { flex: 1 1 auto; min-width: 0; height: 26px; overflow: hidden; }
.flip-track { display: block; transition: transform .36s cubic-bezier(.4, 0, .2, 1); }
.flip.on .flip-track { transform: translateY(-26px); }
.flip b, .flip i {
  display: block; height: 26px; line-height: 26px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flip b { font-family: var(--serif); font-weight: 900; font-size: 18px; }
.flip i { font-style: normal; font-size: 15px; font-weight: 500; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .flip-track { transition: none; } }

/* Reading progress, drawn on the bar's bottom edge. Replaces the old chapter bar. */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- lesson header ---------- */
.lesson-head { padding-top: 40px; padding-bottom: 36px; }
.lesson-head .eyebrow { margin-bottom: 12px; }
.lesson-head h1 {
  font-family: var(--serif); font-weight: 900; font-size: clamp(32px, 7.4vw, 60px);
  line-height: 1.25; margin: 0 0 24px; max-width: 18em; text-wrap: balance;
}

/* byline: avatar, guide's name, date, reading time */
.byline { display: flex; align-items: center; gap: 12px; margin: 0 0 28px; max-width: var(--measure); }
.byline img {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  object-fit: cover; background: var(--paper-2);
}
.byline .who { min-width: 0; }
.byline .name { display: block; font-weight: 700; font-size: 15px; line-height: 1.5; }
.byline .meta { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.byline .meta time { font-variant-numeric: tabular-nums; }
.byline .dot { padding: 0 6px; opacity: .5; }

.ask {
  margin: 0 0 20px; padding: 14px 20px; background: var(--paper-2);
  border-left: 4px solid var(--accent); font-size: 17px; max-width: var(--measure);
}
.ask small { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.lesson-head .lead { margin: 0; color: var(--muted); font-size: 17px; max-width: var(--measure); }

/* ---------- anchor landing ----------
   Jump targets must come to rest under the bar's bottom edge, not under the viewport's
   top edge, or the sticky bar covers the heading you just jumped to. The heading itself
   carries the id, so the margin belongs on the heading — putting it only on the section
   was the bug CYC hit. 16px of air keeps it from touching the bar. */
.prose h2[id], .prose [id], .comments, #comments { scroll-margin-top: calc(var(--top-h) + 16px); }

/* ---------- prose ---------- */
.prose { font-size: 17px; }
.prose section { padding: 56px 0; }
@media (min-width: 720px) { .prose section { padding: 88px 0; } }
.prose section + section:not(.chapter) { border-top: 1px solid var(--line); }
.prose section.opening { padding-bottom: 0; border: 0; }

.prose .eyebrow { font-size: 13px; letter-spacing: .18em; color: var(--accent); font-weight: 500; margin: 0 0 10px; }
.prose h2 {
  font-family: var(--serif); font-weight: 900; font-size: clamp(27px, 5.4vw, 40px);
  line-height: 1.35; margin: 0 0 24px; text-wrap: balance;
}
.prose h2 .num {
  display: block; font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: .22em; color: var(--muted); margin-bottom: 10px;
}
.prose h3 { font-family: var(--serif); font-weight: 900; font-size: 20px; line-height: 1.5; margin: 36px 0 10px; }
.prose p { margin: 0 0 18px; line-height: 1.9; }
.prose .lead { font-size: 18px; }
.prose .note { color: var(--muted); font-size: 15px; }
.prose strong { font-weight: 700; }
.prose a[href^="http"] { color: var(--accent); text-underline-offset: 3px; }
.prose mark { background: none; color: inherit; box-shadow: inset 0 -.5em 0 rgba(184, 67, 47, .18); padding: 0 .1em; }
.prose .hl { box-shadow: inset 0 -.5em 0 rgba(184, 67, 47, .18); padding: 0 .1em; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose mark,
  :root:not([data-theme="light"]) .prose .hl { box-shadow: inset 0 -.5em 0 rgba(224, 118, 95, .32); }
}
:root[data-theme="dark"] .prose mark,
:root[data-theme="dark"] .prose .hl { box-shadow: inset 0 -.5em 0 rgba(224, 118, 95, .32); }

/* one vermillion takeaway per section */
.prose .punch {
  font-family: var(--serif); font-weight: 900; font-size: clamp(19px, 3.6vw, 24px);
  line-height: 1.7; color: var(--accent); margin: 28px 0 0;
}
.prose .punch + .note { margin-top: 12px; }

/* ---------- chapter divider: full-bleed dark band ---------- */
.prose section.chapter {
  background: var(--band); color: var(--band-ink);
  border: 0; border-top: 1px solid var(--band-edge); border-bottom: 1px solid var(--band-edge);
  padding: clamp(72px, 16vh, 140px) 0;
}
.prose section.chapter .kicker {
  font-size: 14px; letter-spacing: .22em; color: var(--accent); font-weight: 500; margin: 0 0 14px;
}
.prose section.chapter h2 {
  font-size: clamp(36px, 9vw, 68px); line-height: 1.2; margin: 0 0 18px; color: var(--band-ink);
}
.prose section.chapter h2 .num { color: var(--band-muted); }
.prose section.chapter p { color: var(--band-muted); font-size: clamp(17px, 2.6vw, 21px); margin: 0; }

/* ---------- lists ---------- */
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 1.4em; }
.prose li { margin: 8px 0; line-height: 1.9; }
.prose ul.bullets { list-style: none; padding-left: 0; }
.prose ul.bullets li { padding-left: 1.3em; position: relative; }
.prose ul.bullets li::before {
  content: ""; position: absolute; left: 0; top: .78em;
  width: .44em; height: .44em; border-radius: 50%; background: var(--accent);
}
.prose ol.steps { list-style: none; padding-left: 0; counter-reset: st; display: grid; gap: 14px; }
.prose ol.steps li {
  counter-increment: st; position: relative; margin: 0;
  background: var(--paper-2); border-left: 3px solid var(--accent);
  padding: 14px 16px 14px calc(16px + 30.8px + 14px);
}
/* The number sits in the left padding, not in a grid column: as a grid, every inline tag
   inside a step (<code>, <a>, <strong>) became its own grid item and dropped onto a new row
   (2026-10-21, "在 Terminal 裡打 claude" broke into three lines). */
.prose ol.steps li::before {
  content: counter(st); position: absolute; left: 16px; top: 14px;
  width: 30.8px; height: 30.8px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.prose ol.steps b { display: block; font-weight: 700; }
.prose ol.steps span { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }
.prose ul.check { list-style: none; padding-left: 0; }
.prose ul.check li { display: grid; grid-template-columns: 1.3em minmax(0, 1fr); gap: 12px; align-items: start; }
.prose ul.check li::before {
  content: ""; width: .95em; height: .95em; border: 2px solid var(--ink);
  border-radius: 3px; transform: translateY(.45em);
}

/* ---------- paired white cards ---------- */
.prose .boxes { display: grid; gap: 16px; margin: 0 0 24px; }
@media (min-width: 640px) {
  .prose .boxes.two, .prose .boxes.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 860px) {
  .prose .boxes.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.prose .box {
  background: var(--card); border: 1.5px solid var(--ink); box-shadow: var(--shadow);
  padding: 18px 20px;
}
.prose .box h3 { margin: 0 0 8px; font-size: 18px; }
.prose .box p, .prose .box li { color: var(--muted); font-size: 15px; }
.prose .box p:last-child, .prose .box ul:last-child { margin-bottom: 0; }
.prose .box.key { border-color: var(--accent); }
.prose .box.warn { border-color: var(--accent); background: var(--paper-2); }
.prose .box .then { color: var(--accent); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.prose .box .fill-line { color: var(--ink); }

/* ---------- ladder rows ---------- */
.prose .ladder { display: grid; gap: 12px; margin: 0 0 24px; }
.prose .ladder div {
  display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 16px;
  padding: 14px 18px; background: var(--card); border: 1.5px solid var(--line);
}
.prose .ladder .n { font-weight: 700; color: var(--accent); }
.prose .ladder .fix { color: var(--accent); font-weight: 500; }
@media (max-width: 560px) { .prose .ladder div { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- stat figure ---------- */
.prose .stat { display: flex; align-items: baseline; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.prose .stat b {
  font-family: var(--serif); font-weight: 900; font-size: clamp(40px, 10vw, 64px);
  line-height: 1.1; color: var(--accent);
}
.prose .stat span { color: var(--muted); font-size: 16px; }

/* ---------- tables ---------- */
.prose .tw { overflow-x: auto; margin: 0 0 24px; -webkit-overflow-scrolling: touch; }
/* Narrow screens: say that the table scrolls sideways, so nothing looks cut off. */
@media (max-width: 700px) {
  .prose .tw::after {
    content: "左右滑動看完整表格"; display: block; position: sticky; left: 0;
    margin-top: 8px; font-size: 13px; color: var(--muted);
  }
}
.prose table { border-collapse: collapse; width: 100%; min-width: 34em; font-size: 15px; background: var(--card); }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; line-height: 1.75; }
.prose thead th { background: var(--paper-2); font-weight: 700; }
.prose tbody th { background: var(--paper-2); font-weight: 700; white-space: nowrap; }

/* ---------- transcript + red-pen corrections ---------- */
.prose .transcript {
  background: var(--card); border: 1.5px solid var(--line); padding: 18px 20px;
  margin: 0 0 14px; line-height: 2.8; font-size: 16px;
}
.prose .transcript .ts { color: var(--accent); font-weight: 700; font-size: 14px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.prose ruby { ruby-position: over; }
.prose ruby s { color: var(--accent); text-decoration-thickness: 2px; }
.prose ruby rt { font-size: .6em; font-weight: 700; color: var(--accent); letter-spacing: .04em; }

/* ---------- fill-in sentence ---------- */
.prose .sentence { font-family: var(--serif); font-weight: 900; font-size: clamp(19px, 4vw, 26px); line-height: 2.4; }
.prose .blank { display: inline-block; min-width: 3em; border-bottom: 3px solid var(--accent); margin: 0 .15em; }
.prose .fill {
  font: inherit; font-family: var(--sans); font-size: .68em; font-weight: 700; color: var(--accent);
  background: transparent; border: 0; border-bottom: 3px solid var(--accent);
  width: 6.5em; max-width: 100%; padding: 0 .2em; margin: 0 .15em; text-align: center;
}
.prose .fill::placeholder { color: var(--muted); opacity: .6; }
.prose .fill:focus { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- chips ---------- */
.prose .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.prose .chips li { margin: 0; border: 1.5px solid var(--line); background: var(--card); padding: 3px 14px; font-size: 15px; }

/* ---------- speaker notes ---------- */
.prose .notes { margin: 0 0 22px; border: 1.5px dashed var(--line); background: var(--paper-2); }
.prose .notes summary { cursor: pointer; padding: 10px 16px; font-size: 14px; color: var(--accent); font-weight: 500; }
.prose .notes > *:not(summary) { padding: 0 16px 14px; margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- references ---------- */
.prose .refs { list-style: none; padding-left: 0; }
.prose .refs li { margin: 14px 0; font-size: 16px; }
.prose .refs .src { display: block; color: var(--muted); font-size: 14px; }

/* ---------- end of lesson ---------- */
.lesson-end { padding-top: 40px; padding-bottom: 64px; }
.lesson-end a { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; text-decoration: none; }
.lesson-end a svg { width: 18px; height: 18px; }
.lesson-end a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- bottom action bar: 目錄 / 拍拍手 / 留言 ---------- */
/* Fixed to the bottom on phones — the thumb lives down there. On wide screens it
   becomes a floating pill so it never sits across the reading column. */
/* Same frosted treatment as the top bar: this is the page's other floating layer, and the
   two should read as the same kind of object. It also does real work here — the article
   scrolls underneath, so a solid strip looks like the page ends there. */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 18px rgba(31, 27, 22, .10);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .actions {
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
  }
}
.actions .bar {
  display: flex; align-items: center; justify-content: space-around;
  gap: 4px; height: 56px; max-width: 460px; margin: 0 auto; padding: 0 8px;
}
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0;
  border-radius: 999px; cursor: pointer; text-decoration: none;
  padding: 8px 12px; min-height: 44px;
}
.act svg { width: 21px; height: 21px; flex: none; }
.act:hover, .act:focus-visible { color: var(--ink); outline: none; }
.act:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.act .n { font-variant-numeric: tabular-nums; min-width: 1ch; }
.act[aria-expanded="true"] { color: var(--accent); }

/* 鼓勵: no chrome until you press it. Resting state is just icon + word + count;
   pressed state is a filled vermillion pill. The thumb swaps outline → solid with it. */
.act.cheer { border: 0; background: none; color: var(--muted); padding: 8px 12px; }
.act.cheer:hover, .act.cheer:focus-visible { color: var(--ink); }
.act.cheer .i-on { display: none; }
.act.cheer[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink);
}
.act.cheer[aria-pressed="true"] .i-out { display: none; }
.act.cheer[aria-pressed="true"] .i-on { display: inline; }
.act.cheer .n:not(:empty)::before { content: "·"; padding: 0 6px; opacity: .5; }
.act.cheer.kick svg { animation: cheer-kick .28s ease; }
@keyframes cheer-kick { 40% { transform: scale(1.24) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .act.cheer.kick svg { animation: none; } }
/* API down: the button still reads, it just has no number to show. */
.act.cheer.off { opacity: .55; cursor: default; }

/* On a wide screen a full-width strip would be all chrome and no page, so it shrinks to a
   pill parked bottom-right — clear of the reading column, which sits left of centre. */
@media (min-width: 900px) {
  .actions {
    left: auto; right: 24px; bottom: 24px; border-top: 0;
    border: 1.5px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow);
    background: var(--card);
  }
  /* The pill keeps its hard offset shadow — that block shadow is the house style and says
     "this is a solid control", which a floating button should. Only the fill goes glassy. */
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .actions { background: var(--glass-strong); }
  }
  .actions .bar { height: 52px; padding: 0 10px; gap: 2px; }
}
/* keep the footer clear of the fixed bar */
body.lesson-page { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body.lesson-page { padding-bottom: 104px; } }

/* ---------- table of contents: bottom sheet ---------- */
.toc[hidden] { display: none; }
.toc { position: fixed; inset: 0; z-index: 60; }
.toc .scrim { position: absolute; inset: 0; background: rgba(20, 16, 12, .55); }
.toc .sheet {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column;
  max-height: 76vh; background: var(--card); border-top: 1.5px solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 899px) {
  .toc .sheet { animation: sheet-up .24s cubic-bezier(.4, 0, .2, 1); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) { .toc .sheet { animation: none; } }
@media (min-width: 900px) {
  .toc .sheet {
    left: 50%; right: auto; transform: translateX(-50%); width: min(560px, 92vw);
    bottom: 96px; border: 1.5px solid var(--ink); box-shadow: var(--shadow);
  }
}
.toc .sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px 12px; border-bottom: 1px solid var(--line);
}
.toc .sheet-head b { font-family: var(--serif); font-weight: 900; font-size: 17px; }
.toc .sheet-head button {
  font: inherit; font-size: 14px; color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; cursor: pointer;
}
.toc .sheet-head button:hover { color: var(--ink); border-color: var(--ink); }
.toc ol { list-style: none; margin: 0; padding: 10px 14px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.toc a {
  display: block; padding: 8px 0 8px 14px; text-decoration: none; color: var(--muted);
  font-size: 15px; line-height: 1.6; border-left: 2px solid var(--line);
}
.toc a:hover, .toc a.on { color: var(--ink); border-left-color: var(--accent); }
.toc .c > a {
  font-family: var(--serif); font-weight: 900; font-size: 17px; color: var(--ink);
  border-left-color: var(--accent); margin-top: 10px;
}
.toc li:first-child > a { margin-top: 0; }

/* ---------- comments ---------- */
.comments { padding-top: 48px; padding-bottom: 8px; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.comments h2 { font-family: var(--serif); font-weight: 900; font-size: 26px; margin: 0 0 8px; }
.comments .rule { margin: 0 0 24px; color: var(--muted); font-size: 15px; max-width: var(--measure); }
.comments .rule b { color: var(--ink); font-weight: 500; }

.c-list { list-style: none; margin: 0 0 24px; padding: 0; max-width: var(--measure); }
.c-list:empty { margin: 0; }
.c-list li { padding: 16px 0; border-top: 1px solid var(--line); }
.c-list li:last-child { border-bottom: 1px solid var(--line); }
.c-list .c-who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.c-list .c-name { font-weight: 700; font-size: 15px; }
.c-list .c-when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.c-list .c-body { margin: 0; line-height: 1.9; white-space: pre-wrap; }
.c-empty { color: var(--muted); font-size: 15px; margin: 0 0 24px; }

/* your own comment, still waiting for CYC — shown so it does not feel like it vanished */
.c-list li.pending { border-left: 3px solid var(--accent); padding-left: 14px; background: var(--paper-2); }
.c-list .tag {
  font-size: 13px; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 1px 10px; line-height: 1.7;
}
.c-list .c-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* 編輯 / 收回, on your own comments only */
.c-acts { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.c-acts button {
  font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0;
  padding: 0; cursor: pointer;
}
.c-acts button:hover, .c-acts button:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.c-acts button:disabled { opacity: .5; cursor: default; text-decoration: none; }
.c-acts .sep { color: var(--muted); font-size: 14px; opacity: .6; }
.c-confirm { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.c-confirm button {
  font: inherit; font-size: 14px; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); text-decoration: underline; text-underline-offset: 4px;
}
.c-confirm button[data-act="cancel"] { color: var(--muted); }
.c-confirm .c-fail { color: var(--accent); font-size: 13px; flex-basis: 100%; }
.c-edit { margin-top: 4px; }
.c-edit .c-edit-t {
  width: 100%; font: inherit; font-size: 16px; line-height: 1.8; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); padding: 10px 12px; min-height: 96px; resize: vertical;
}
.c-edit .c-edit-t:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.c-edit .c-warn { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.c-edit .err { margin: 8px 0 0; color: var(--accent); font-size: 14px; }
.c-edit .err[hidden] { display: none; }

/* the composer, folded to one quiet line until you click it */
.c-peek {
  width: 100%; max-width: var(--measure); display: block; text-align: left; cursor: text;
  font: inherit; font-size: 16px; color: var(--muted);
  background: var(--card); border: 1.5px solid var(--line); padding: 12px 14px;
}
.c-peek:hover { border-color: var(--ink); }
.c-peek:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.c-peek[hidden] { display: none; }
.c-fields[hidden] { display: none; }
.c-fields { display: grid; gap: 16px; }

.c-form { max-width: var(--measure); display: grid; gap: 16px; }
.c-form .f > label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 8px; }
.c-form .hint { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 4px; }
.c-form textarea, .c-form input[type="email"], .c-form input[type="text"] {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); padding: 10px 12px; border-radius: 0;
}
.c-form textarea { min-height: 110px; line-height: 1.8; resize: vertical; }
.c-form textarea:focus, .c-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.c-form .err { margin: 8px 0 0; color: var(--accent); font-size: 14px; }
.c-form .err[hidden] { display: none; }
.c-form .bad { border-color: var(--accent); }
.c-form .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.7; cursor: pointer; }
.c-form .consent input { accent-color: var(--accent); margin: .35em 0 0; flex: none; width: 18px; height: 18px; }
.c-form .c-more { border: 0; margin: 0; padding: 0; }
.c-form .c-more summary { cursor: pointer; font-size: 14px; color: var(--muted); width: max-content; }
.c-form .c-more summary:hover { color: var(--ink); }
.c-form .c-more > *:not(summary) { margin-top: 14px; }
.c-form .row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.c-form .send {
  font: inherit; font-size: 16px; font-weight: 500; cursor: pointer;
  color: var(--accent-ink); background: var(--accent); border: 1.5px solid var(--accent);
  padding: 10px 26px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.c-form .send:hover:not(:disabled) { transform: translate(-3px, -3px); box-shadow: var(--shadow-hover); }
.c-form .send:disabled { opacity: .5; cursor: default; box-shadow: none; }
.c-form .cancel { font: inherit; font-size: 15px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 4px; }
.c-form .cancel:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.c-form .say { margin: 0; font-size: 15px; line-height: 1.8; }
.c-form .say:empty { display: none; }
.c-form .say.bad { color: var(--accent); }

/* ---------- homework: the partner's file, framed + prompts to copy ---------- */
/* The original runs sandboxed in its own opaque origin (see _headers); it scrolls inside
   the frame so the feedback below stays one scroll away. */
.prose .embed { border: 1.5px solid var(--ink); box-shadow: var(--shadow); background: #fff; margin: 0 0 14px; }
.prose .embed iframe { display: block; width: 100%; height: min(72vh, 680px); border: 0; }
.prose .prompt { position: relative; background: var(--card); border: 1.5px solid var(--line); margin: 0 0 14px; }
.prose .prompt pre { margin: 0; padding: 18px 20px 20px; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 15px; line-height: 1.9; }
.prose .prompt .copy { position: sticky; top: 72px; float: right; margin: 10px 10px 0 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; padding: 6px 14px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); }
.prose .prompt .copy.ok { background: var(--ink); color: var(--paper); }

/* ---------- demo timeline: file contents, screenshots, live versions ---------- */
.prose .file { background: #1f1c18; color: #efe9df; border: 1.5px solid var(--ink); margin: 0 0 14px; }
.prose .file pre { margin: 0; padding: 16px 18px; white-space: pre-wrap; word-break: break-word; font: 14px/1.8 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.prose .file.tall pre { max-height: 460px; overflow: auto; }
.prose .file del { color: #a89f92; }
.prose .shot { margin: 0 0 14px; }
.prose .shot img { display: block; width: 100%; height: auto; border: 1.5px solid var(--ink); box-shadow: var(--shadow); }
.prose .shot figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }
.prose .embed.demo iframe { height: min(56vh, 440px); }
