/* My First AI Skill, v2 design
   VOICE   A first-reader book: calm, plain, a little playful. Big type, honest copy.
   IDEA    The vague sticky note becomes a filled-in index card (the Prompt Card).
   PICTURE Sticky note, index card with coloured row flags, chat bubbles.
   COLOUR  White paper, teal ink, sticky-note yellow; one pastel flag per Prompt Card row.
   TYPE    TeX Gyre Schola (a Century Schoolbook design) is the course's voice;
           system sans is the chatbot's voice, used only for prompts and replies. */

@font-face { font-family: "Primer"; src: url("fonts/texgyreschola-regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Primer"; src: url("fonts/texgyreschola-bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Primer"; src: url("fonts/texgyreschola-italic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #0e3b3c;
  --ink-2: #3d5f5f;
  --paper: #ffffff;
  --mist: #eef4f4;
  --line: #d3dddd;
  --yellow: #ffd23f;
  --yellow-edge: #e8b923;
  --rule: #c4dbf2;
  --margin: #e06a6a;
  --f-task: #ffd23f;
  --f-context: #a9cff7;
  --f-reader: #f8b4c8;
  --f-shape: #a8e2c4;
  --f-safe: #cdbdf6;
  --f-check: #f7cba0;
  --f-extra: #e2e8e8;
  --ok: #1d7a4f;
  --serif: "Primer", "Century Schoolbook", "TeX Gyre Schola", Georgia, serif;
  --chat: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --read: 680px;
  --radius: 10px;
  --shadow: 4px 4px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 19px/1.6 var(--serif); overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
p, ul, ol, figure, blockquote { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: .35em; }
h1, h2, h3 { font-weight: 700; line-height: 1.08; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(40px, 6.4vw, 78px); letter-spacing: -.02em; }
h2 { font-size: clamp(30px, 3.8vw, 44px); }
h3 { font-size: 24px; line-height: 1.2; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--yellow-edge); }
a:hover { text-decoration-color: var(--ink); }
strong { font-weight: 700; }
small, .small { font-size: 16px; line-height: 1.5; }
.muted { color: var(--ink-2); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible { outline-color: var(--yellow); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--yellow); color: var(--ink); padding: 10px 16px; border-radius: 8px; z-index: 50; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 max(4vw, 18px); }
.read { max-width: var(--read); }
.band { padding: clamp(48px, 7vw, 96px) 0; }
.band.band-follow { padding-top: 0; }
.band .wrap > h2:not(:first-child) { margin-top: 64px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons: printed-sticker look, hard shadow */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 12px 24px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: 700 19px/1.2 var(--serif); text-decoration: none; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-primary { background: var(--yellow); }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); }
.btn-text { background: none; border: 0; box-shadow: none; padding: 8px 4px; min-height: 44px; font: 700 16px var(--serif); color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow-edge); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.btn-text:hover { transform: none; box-shadow: none; text-decoration-color: var(--ink); }
.exercise .panel > .btn-row .btn-primary { box-shadow: 4px 4px 0 #051e1f; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; white-space: nowrap; }
.brand svg { width: 38px; height: 38px; transform: rotate(-6deg); }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav li + li { margin: 0; }
.site-nav a { display: block; padding: 10px 12px; color: #fff; text-decoration: none; border-radius: 8px; font-size: 18px; }
.site-nav a:hover { background: rgba(255,255,255,.1); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--yellow); border-radius: 0; }
.menu-toggle { display: none; }
@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; min-height: 44px; padding: 8px 14px; border: 2px solid var(--yellow); background: transparent; color: #fff; border-radius: 8px; font: 700 16px var(--serif); cursor: pointer; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-top: 1px solid rgba(255,255,255,.15); padding: 8px max(4vw, 18px) 16px; }
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px 8px; }
  .site-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--yellow); padding-left: 16px; }
}

/* Sticky note */
.note { position: relative; background: var(--yellow); color: var(--ink); padding: 24px 22px 28px; width: 100%; max-width: 260px; aspect-ratio: 1 / 0.92; box-shadow: 0 14px 20px -14px rgba(14,59,60,.55), inset 0 -10px 18px -14px rgba(14,59,60,.35); transform: rotate(-4deg); font: italic 400 clamp(24px, 2.6vw, 30px)/1.2 var(--serif); display: flex; align-items: center; }
.note::before { content: ""; position: absolute; left: 50%; top: -14px; width: 92px; height: 26px; transform: translateX(-50%) rotate(2deg); background: rgba(255,255,255,.55); border: 1px solid rgba(14,59,60,.12); }
.note-caption { font-size: 16px; color: var(--ink-2); margin-top: 18px; }

/* Index card = the Prompt Card */
.card { position: relative; background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--ink); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 39px, var(--rule) 39px, var(--rule) 40px); background-position: 0 58px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; border-bottom: 2px solid var(--margin); background: var(--paper); border-radius: 6px 6px 0 0; }
.card-head h3, .card-head .card-title { margin: 0; font-size: 22px; font-weight: 700; }
.card-head .small { color: var(--ink-2); }
.card-rows { list-style: none; margin: 0; padding: 6px 0; }
.card-rows > li { margin: 0; }
.row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 10px 18px; }
.row + .row { border-top: 1px dashed var(--line); }
.flag { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 3px 10px 3px 8px; border-radius: 4px 12px 12px 4px; font: 700 15px/1.4 var(--serif); color: var(--ink); background: var(--flag, var(--f-extra)); white-space: nowrap; }
.flag .num { font-size: 13px; opacity: .8; }
[data-row="1"] { --flag: var(--f-task); }
[data-row="2"] { --flag: var(--f-context); }
[data-row="3"] { --flag: var(--f-reader); }
[data-row="4"] { --flag: var(--f-shape); }
[data-row="5"] { --flag: var(--f-safe); }
[data-row="6"] { --flag: var(--f-check); }
[data-row="x"] { --flag: var(--f-extra); }
.row-text { font: 17px/1.5 var(--chat); padding-top: 2px; }
.row-q { font-size: 16px; color: var(--ink-2); line-height: 1.45; }

/* Chat bubbles: the chatbot's voice */
.chat { display: grid; gap: 14px; font: 17px/1.5 var(--chat); }
.bubble { position: relative; max-width: 560px; padding: 14px 18px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.you { justify-self: end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot { justify-self: start; background: var(--mist); color: var(--ink); border-bottom-left-radius: 6px; }
.bubble.sample { border: 2px dashed #9fb6b6; }
.who { display: block; font: 700 13px/1.3 var(--chat); letter-spacing: .01em; margin-bottom: 6px; opacity: .8; white-space: normal; }
.bubble .copy { display: flex; width: max-content; max-width: 100%; margin-top: 12px; }
.sample-note { font: 14px/1.4 var(--chat); color: var(--ink-2); margin: -6px 0 0; justify-self: start; }
.bubble.you .btn-small { background: var(--yellow); border-color: var(--yellow); box-shadow: none; color: var(--ink); white-space: normal; }

/* Hint strip */
.hint { color: var(--ink); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--paper); border: 2px solid var(--ink); font-size: 17px; line-height: 1.45; min-height: 64px; }
.hint .flag { flex: none; }
.hint.is-good { border-color: var(--ok); }
.hint.is-good .flag { background: #c9efd9; }

/* ---------- Home ---------- */
.hero { padding: clamp(32px, 4.5vw, 64px) 0 clamp(40px, 6vw, 72px); }
.hero h1 { margin: 0; font-size: clamp(40px, 5vw, 72px); max-width: 1080px; }
.hero-side { display: grid; grid-template-columns: minmax(0, 46ch) auto; grid-template-areas: "lede btns" "fine btns"; justify-content: space-between; align-items: center; gap: 4px 40px; margin-top: 28px; }
.hero-side .lede { grid-area: lede; margin: 0; font-size: clamp(19px, 1.6vw, 21px); }
.hero-side .btn-row { grid-area: btns; flex-wrap: nowrap; }
.hero-side .fineprint { grid-area: fine; margin: 10px 0 0; }
@media (max-width: 900px) {
  .hero h1 { max-width: 15ch; }
  .hero-side { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lede" "btns" "fine"; gap: 20px; }
  .hero-side .btn-row { flex-wrap: wrap; }
}
.hero .fineprint { color: var(--ink-2); font-size: 16px; }
.continue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; margin-bottom: 28px; background: var(--mist); border-radius: 10px; font-size: 17px; max-width: 760px; }
.continue a { font-weight: 700; }
.scene { margin-top: clamp(28px, 3.5vw, 44px); display: grid; grid-template-columns: minmax(0, .8fr) 64px minmax(0, 1.25fr) 64px minmax(0, 1fr); align-items: center; gap: 8px; }
.scene .note { justify-self: center; }
.scene-arrow { color: var(--ink); justify-self: center; width: 56px; }
.scene .card { transform: rotate(1deg); }
.scene .card .row { grid-template-columns: 118px minmax(0, 1fr); padding: 8px 14px; }
.scene .card .row-text { font-size: 15px; }
.scene .bubble { font-size: 15px; transform: rotate(-1.5deg); box-shadow: 0 12px 24px -16px rgba(14,59,60,.6); }
.scene-label { display: block; font: 16px/1.4 var(--serif); color: var(--ink-2); text-align: center; margin-top: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .scene .card-rows > li { animation: fill-in .5s ease both; }
  .scene .card-rows > li:nth-child(1) { animation-delay: .5s; }
  .scene .card-rows > li:nth-child(2) { animation-delay: 1s; }
  .scene .card-rows > li:nth-child(3) { animation-delay: 1.5s; }
  .scene .card-rows > li:nth-child(4) { animation-delay: 2s; }
  .scene .reply { animation: fill-in .6s ease 2.7s both; }
}
@keyframes fill-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) {
  .scene { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; }
  .scene-arrow { transform: rotate(90deg); width: 44px; }
  .scene .note { max-width: 230px; }
  .scene .card, .scene .reply { width: 100%; max-width: 520px; }
}

/* Exercise (dark band) */
.exercise { background: var(--ink); color: #fff; }
.exercise h2 { color: #fff; }
.exercise .intro { font-size: 21px; max-width: 46ch; color: #e6efef; }
.steps { list-style: none; padding: 0; margin: 36px 0 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.steps li { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 17px; line-height: 1.3; color: #e6efef; }
.steps li::before { counter-increment: step; content: counter(step); flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 700; font-size: 20px; }
.ex-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.ex-step { margin-bottom: 36px; }
.ex-step > h3 { color: #fff; display: flex; gap: 12px; align-items: baseline; }
.exercise h3 .n { color: var(--yellow); }
.ex-vague { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px 40px; align-items: start; margin: 40px 0 48px; }
.ex-vague .chat { margin-top: 4px; background: var(--paper); border-radius: 14px; padding: 18px; color: var(--ink); }
.ex-vague .after { color: #e6efef; margin-top: 14px; font-size: 18px; }
@media (max-width: 980px) { .ex-vague { grid-template-columns: minmax(0, 1fr); } }
.ex-step .chat { background: var(--paper); border-radius: 14px; padding: 18px; color: var(--ink); }
.ex-step .after { color: #e6efef; margin-top: 14px; font-size: 18px; }
.builder.card { color: var(--ink); }
.builder .row { grid-template-columns: minmax(0, 1fr); padding: 14px 18px 16px; }
.builder label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 17px; line-height: 1.35; }
.builder textarea { width: 100%; min-height: 64px; resize: vertical; margin-top: 4px; padding: 10px 12px; border: 2px solid #9fb6b6; border-radius: 8px; background: #fff; color: var(--ink); font: 17px/1.45 var(--chat); }
.builder textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--flag, var(--yellow)); }
.builder textarea::placeholder, .drill textarea::placeholder { color: #627d7d; }
.builder-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 18px 16px; border-top: 1px dashed var(--line); background: var(--paper); border-radius: 0 0 6px 6px; }
.panel { position: sticky; top: 92px; display: grid; gap: 18px; }
.panel .chat { background: var(--paper); border-radius: 14px; padding: 18px; color: var(--ink); }
.panel .bubble.you { max-width: 100%; justify-self: stretch; min-height: 120px; }
.bubble .empty { color: #b8cccc; font-style: italic; }
.open-bots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.open-bots a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; font: 700 16px var(--chat); }
.open-bots a:hover { border-color: var(--yellow); }
.panel .label { font-size: 17px; color: #e6efef; margin: 0 0 6px; }
.did { background: var(--yellow); color: var(--ink); border-radius: 14px; padding: 18px 20px; }
.did p:last-child { margin: 0; }
@media (max-width: 980px) {
  .ex-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .scene .card .row { grid-template-columns: minmax(0, 1fr); }
}

/* Plain sections */
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.split h2 { margin: 0; }
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); } }
.loop-fig { max-width: 640px; margin: 8px 0 24px; }
.loop-fig text { font-family: var(--serif); }
.split > div > h2 + p { margin-top: 18px; }
.yellow-band { background: var(--yellow); }
.yellow-band .trio { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: trio; }
.trio li { margin: 0; border-top: 3px solid var(--ink); padding-top: 14px; }
.trio li h3 { display: flex; gap: 10px; align-items: baseline; }
.trio li h3::before { counter-increment: trio; content: counter(trio) "."; }
.trio p { margin: 0; }
@media (max-width: 720px) { .yellow-band .trio { grid-template-columns: minmax(0, 1fr); } }
.stairs { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.stairs li { margin: 0; border: 2px solid var(--ink); border-radius: 8px 8px 0 0; padding: 14px 14px 16px; display: flex; flex-direction: column; justify-content: flex-start; background: var(--paper); }
.stairs li:nth-child(1) { min-height: 150px; background: var(--yellow); box-shadow: var(--shadow); }
.stairs li:nth-child(2) { min-height: 185px; }
.stairs li:nth-child(3) { min-height: 220px; }
.stairs li:nth-child(4) { min-height: 255px; }
.stairs li:nth-child(5) { min-height: 290px; }
.stairs b { font-size: 21px; line-height: 1.2; }
.stairs .what { font-size: 16px; line-height: 1.45; margin-top: 6px; }
.stairs .status { margin-top: auto; padding-top: 12px; font: 700 14px/1.3 var(--chat); color: var(--ink-2); }
.stairs li:nth-child(1) .status { color: var(--ink); }
@media (max-width: 820px) {
  .stairs { grid-template-columns: minmax(0, 1fr); }
  .stairs li, .stairs li:nth-child(n) { min-height: 0; border-radius: 8px; margin-left: calc(var(--i, 0) * 14px); }
}
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 12px; }
.facts p { font-size: 17px; margin: 0; }
@media (max-width: 820px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.site-foot { background: var(--ink); color: #dfeaea; padding: 48px 0 56px; font-size: 16px; }
.site-foot p { max-width: 70ch; }
.site-foot nav ul { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot nav li + li { margin: 0; }
.site-foot a { color: #fff; }

/* ---------- Lesson ---------- */
.lesson-head { padding: clamp(28px, 4vw, 48px) 0 24px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: 16px; margin-bottom: 14px; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.lesson-head h1 { font-size: clamp(36px, 5vw, 60px); max-width: 20ch; }
.lesson-meta { font-size: 18px; color: var(--ink-2); margin-bottom: 18px; max-width: 60ch; }
.meter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font: 15px/1.3 var(--chat); color: var(--ink-2); max-width: 560px; }
.meter .bar { flex: 1 1 160px; height: 10px; border-radius: 999px; background: var(--mist); overflow: hidden; border: 1px solid var(--line); }
.meter .bar span { display: block; height: 100%; width: var(--pct, 0%); background: var(--yellow-edge); }
.lesson-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding-top: 36px; padding-bottom: 72px; }
.rail { position: sticky; top: 92px; align-self: start; }
.rail ol { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--mist); }
.rail li { margin: 0; }
.rail a { display: block; padding: 8px 12px; margin-left: -3px; border-left: 3px solid transparent; text-decoration: none; font-size: 17px; line-height: 1.3; color: var(--ink-2); }
.rail a.is-active { border-left-color: var(--yellow-edge); color: var(--ink); font-weight: 700; }
.rail .rail-title { font-size: 15px; color: var(--ink-2); margin: 0 0 10px 15px; }
.stepbar { display: none; }
@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .rail { display: none; }
  .stepbar { display: flex; position: sticky; top: 68px; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px max(4vw, 18px); font: 15px/1.3 var(--chat); color: var(--ink); gap: 12px; align-items: center; }
  .stepbar .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--mist); overflow: hidden; }
  .stepbar .bar span { display: block; height: 100%; width: var(--pct, 14%); background: var(--yellow-edge); transition: width .2s ease; }
}
.lesson-main { max-width: var(--read); }
.step { padding-bottom: 56px; margin-bottom: 56px; border-bottom: 1px solid var(--line); }
.step:last-of-type { border-bottom: 0; }
.step > h2 { display: flex; gap: 14px; align-items: baseline; font-size: clamp(30px, 3.4vw, 40px); }
.step > h2 .n { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); font-size: 22px; transform: translateY(-4px); }
.hook { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: center; margin: 8px 0 24px; }
.hook .note { max-width: 190px; font-size: 34px; justify-content: center; }
@media (max-width: 560px) { .hook { grid-template-columns: minmax(0, 1fr); } .hook .note { margin: 12px auto 8px; } }
.tryit { border: 2px solid var(--ink); border-radius: 14px; padding: 20px; margin: 24px 0; box-shadow: var(--shadow); background: var(--paper); }
.tryit > h3 { margin-bottom: 8px; }
.tryit .chat { margin-top: 16px; }
.look { background: var(--mist); border-radius: 10px; padding: 14px 16px; font-size: 18px; }
.look p:last-child { margin: 0; }
.notes-list { list-style: none; padding: 0; }
.notes-list li { padding-left: 16px; border-left: 4px solid var(--f-task); margin-bottom: 12px; }
.notes-list li.r-x { border-left-color: var(--f-extra); }
.drill textarea { width: 100%; min-height: 96px; padding: 12px; border: 2px solid #9fb6b6; border-radius: 10px; font: 17px/1.45 var(--chat); color: var(--ink); resize: vertical; }
.drill textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--f-task); }
.drill .btn-row { margin: 14px 0; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.level { border: 2px solid var(--ink); border-radius: 10px; padding: 14px; background: var(--paper); }
.level .score { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); font-weight: 700; margin-bottom: 8px; }
.level:nth-child(3) { background: var(--f-task); box-shadow: var(--shadow); }
.level p { font-size: 17px; margin: 0 0 6px; }
.level .eg { font: 15px/1.45 var(--chat); color: var(--ink-2); margin: 0; }
@media (max-width: 720px) { .levels { grid-template-columns: minmax(0, 1fr); } }
details.panel-more { border: 2px solid var(--ink); border-radius: 14px; margin: 16px 0; background: var(--paper); }
details.panel-more > summary { cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 700; font-size: 21px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; }
details.panel-more > summary::-webkit-details-marker { display: none; }
details.panel-more > summary::after { content: "+"; font-size: 30px; line-height: 1; }
details.panel-more[open] > summary::after { content: "\2212"; }
details.panel-more > .inner { padding: 0 20px 20px; }
details.panel-more h3 { margin-top: 1.2em; }
details.reveal { margin: 10px 0 18px; }
details.reveal > summary { cursor: pointer; font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; text-decoration: underline; text-decoration-color: var(--yellow-edge); text-decoration-thickness: 2px; text-underline-offset: 3px; }
details.reveal > div { margin-top: 8px; padding: 12px 16px; border-left: 4px solid var(--yellow); background: #fffbea; }
.toolnotes li { font-size: 17px; }

/* Quiz */
.q { margin: 0 0 32px; }
.q > p { font-weight: 700; margin-bottom: 10px; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink); font: 17px/1.45 var(--chat); cursor: pointer; }
.choice .key { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); font: 700 14px var(--serif); }
.choice:hover { background: #fffbea; }
.choice.is-right { background: #e3f6ea; border-color: var(--ok); }
.choice.is-right .key { background: var(--ok); color: #fff; border-color: var(--ok); }
.choice.is-wrong { background: #fdecef; border-style: dashed; }
.feedback { margin-top: 10px; font-size: 17px; min-height: 1.5em; }
.feedback.is-right { color: var(--ok); }

/* Audio player */
.player { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--mist); margin: 16px 0; }
.player .p-title { grid-column: 2; font-weight: 700; font-size: 17px; line-height: 1.3; }
.player .p-title .small { font-weight: 400; color: var(--ink-2); }
.player .play { grid-row: 1 / span 2; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); cursor: pointer; display: grid; place-items: center; box-shadow: 3px 3px 0 var(--ink); }
.player .play svg { width: 20px; height: 20px; }
.player .controls { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font: 14px var(--chat); color: var(--ink-2); }
.player input[type="range"] { flex: 1 1 140px; accent-color: var(--ink); min-height: 32px; }
.player .rate { min-height: 36px; padding: 4px 10px; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; font: 700 13px var(--chat); color: var(--ink); cursor: pointer; }
.player.is-missing .play, .player.is-missing .controls { display: none; }
.player.is-missing { grid-template-columns: minmax(0, 1fr); }
.player.is-missing .p-title { grid-column: 1; }
.player .missing-note { grid-column: 1 / -1; font: 15px/1.4 var(--chat); color: var(--ink-2); display: none; }
.player.is-missing .missing-note { display: block; }
.player .fallback { grid-column: 2; font-size: 16px; }
.transcript { margin: -6px 0 16px; }
.transcript > summary { font-size: 16px; }
.transcript > div { font-size: 17px; }

/* River (recorded) */
.river { border-radius: 16px; background: var(--ink); color: #fff; padding: 22px; margin: 20px 0; }
.river h3 { color: #fff; }
.river p { color: #e6efef; }
.river .player { background: rgba(255,255,255,.08); color: #fff; }
.river .player .p-title .small, .river .player .controls, .river .player .missing-note { color: #cfe0e0; }
.river details.reveal > summary { color: #fff; }
.river details.reveal > div { background: rgba(255,255,255,.06); color: #fff; border-left-color: var(--yellow); }

/* Lesson end */
.finish { display: grid; gap: 16px; padding: 24px; border-radius: 16px; background: var(--f-task); box-shadow: var(--shadow); border: 2px solid var(--ink); margin-top: 24px; }
.finish p { margin: 0; }
.btn[aria-pressed="true"] { background: var(--ok); color: #fff; border-color: var(--ink); }
.next-card { display: block; text-decoration: none; border: 2px solid var(--ink); border-radius: 14px; padding: 18px 20px; background: var(--paper); }
.next-card b { display: block; font-size: 22px; line-height: 1.25; }
.next-card span { color: var(--ink-2); font-size: 16px; }
.sources-title { font-size: 18px; margin-top: 40px; }
.sources { font-size: 16px; color: var(--ink-2); }
.sources li { overflow-wrap: anywhere; }

/* ---------- Prompt Card page ---------- */
.pc-hero { padding: clamp(36px, 5vw, 64px) 0 12px; }
.pc-hero h1 { font-size: clamp(40px, 6vw, 72px); }
.pc-card { max-width: 860px; margin: 24px 0 40px; }
.pc-card .row { grid-template-columns: 190px minmax(0, 1fr) minmax(0, .9fr); align-items: start; }
.pc-card .row-q { color: var(--ink); font-size: 18px; }
.pc-card .row-eg { font: 16px/1.45 var(--chat); color: var(--ink-2); }
@media (max-width: 760px) { .pc-card .row { grid-template-columns: minmax(0, 1fr); } }
.memory { font: italic 400 clamp(22px, 2.4vw, 28px)/1.4 var(--serif); max-width: 34ch; }
.when { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 40px; }
.when div { border-top: 3px solid var(--ink); padding-top: 12px; }
.when b { display: block; margin-bottom: 6px; }
.when .flags { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 720px) { .when { grid-template-columns: minmax(0, 1fr); } }
.template { max-width: 860px; }
.template .row { grid-template-columns: 54px minmax(0, 1fr); align-items: start; }
.template .flag { padding: 3px 9px; }
.template .row-text { white-space: pre-wrap; }
.template-tools { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0 8px; }

/* ---------- Text pages (Terms) ---------- */
.page-hero { padding: clamp(36px, 5vw, 64px) 0 12px; }
.page-hero h1 { font-size: clamp(40px, 6vw, 72px); }
.terms { max-width: var(--read); }
.terms h2 { font-size: clamp(26px, 2.8vw, 32px); margin: 44px 0 12px; }
.terms ul { padding-left: 1.1em; }
.terms li + li { margin-top: 8px; }
.needs { border: 2px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow); background: var(--paper); padding: 20px 24px 22px; margin: 4px 0 8px; }
.needs h2 { margin: 0 0 10px; }
.needs ul { margin: 0; }

/* Preview-only banner */
.preview-banner { background: #fff4c2; color: var(--ink); font: 15px/1.4 var(--chat); padding: 10px max(4vw, 18px); border-bottom: 1px solid var(--yellow-edge); }

@media print {
  .site-head, .site-foot, .template-tools, .skip, .preview-banner, .pc-actions { display: none !important; }
  body { font-size: 12pt; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
