/* Learner portal styles. Tokens come from the public site (tokens.css,
 * copied by scripts/sync-assets.mjs). Same world, turned up: the navy felt
 * board, white notices held by cyan pins and tape, dashed perforations, the
 * verdict stamp. The portal adds three working colours a classroom board
 * would have: highlighter yellow, a red flag, and marking washes.
 * Floors: 18px body, 16px minimum, 7:1 text, 44px targets, nothing
 * tappable moves, no script. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --marker: #ffe45c; /* highlighter: graphic behind ink text, 11.9:1 with ink */
  --marker-soft: #fff1b8;
  --ok-wash: #dff3e4; /* a right answer: ink text stays 12:1 */
  --no-wash: #fde4e4; /* a wrong answer */
  --flag: #c8102e; /* the red flag: graphics only */
  --flag-ink: #a50e26; /* red that carries text: 7.9:1 on paper */
  --stamp-ease: cubic-bezier(0.16, 1, 0.3, 1);
  accent-color: var(--ink);
  scrollbar-color: var(--pin) var(--board-deep);
}

*, *::before, *::after { box-sizing: border-box; }
::selection { background: var(--lit); color: var(--board-deep); }

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--board);
  background-image: radial-gradient(rgb(255 255 255 / 0.06) 1px, transparent 1.2px);
  background-size: 6px 6px;
  color: var(--ink-on-board);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
}

h1, h2, h3 { overflow-wrap: anywhere; font-family: var(--font-display); font-weight: var(--weight-bold); line-height: var(--leading-tight); letter-spacing: -0.03em; text-wrap: balance; margin: 0 0 var(--space-4); }
h1 { font-size: clamp(2.25rem, 8vw, 3.25rem); }
h2 { font-size: var(--size-h2); margin-top: var(--space-7); }
h3 { font-size: var(--size-h3); }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }

a { color: var(--lit); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus-ring-offset); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-ring); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: var(--space-4); top: -100px; padding: var(--space-3) var(--space-4); background: var(--paper); color: var(--ink); z-index: 10; }
.skip-link:focus { top: var(--space-4); }

/* ---------- Header: same brand tag as the public site ---------- */
.site-header { background: var(--board-deep); border-bottom: 3px solid var(--pin); }
.header-inner {
  min-width: 0; max-width: var(--board-width); margin: 0 auto; padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
}
.brand { min-width: 0; max-width: 100%; display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--target-min); color: var(--ink-on-board); text-decoration: none; }
.brand-tag {
  display: inline-flex; align-items: center; padding: 0.2rem 0.5rem; background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: var(--weight-bold); font-size: 1.125rem; letter-spacing: 0.02em;
  border-radius: 2px; box-shadow: var(--sheet-shadow);
}
.brand-lock {
  position: relative; display: inline-block; width: 0.62em; height: 0.56em; margin: 0.22em 0.06em 0;
  border-radius: 0.1em; background: var(--pin);
}
.brand-lock::before {
  content: ''; position: absolute; left: 50%; bottom: 100%; width: 0.42em; height: 0.36em; transform: translateX(-50%);
  border: 0.09em solid var(--pin); border-bottom: 0; border-radius: 0.3em 0.3em 0 0;
}
.brand-text { min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; line-height: 1.2; }
.brand-full { font-weight: var(--weight-bold); font-size: var(--size-fine); }
.brand-portal { color: var(--ink-on-board-quiet); font-size: var(--size-fine); }
.language-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); max-width: 100%; font-size: var(--size-fine); }
.current-language { color: var(--ink-on-board-quiet); }
.language-nav a {
  display: inline-flex; align-items: center; min-height: var(--target-primary); padding: 0 var(--space-4);
  border: var(--border-width) solid var(--ink-on-board); border-radius: 999px; color: var(--ink-on-board); font-weight: var(--weight-bold); text-decoration: none;
}
.language-nav a:hover { background: var(--ink-on-board); color: var(--board); }

/* ---------- Page frame ---------- */
main { overflow-wrap: anywhere; flex: 1; width: 100%; max-width: 48rem; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); }
main.wide { max-width: var(--board-width); }
main > * + * { margin-top: var(--space-8); }

/* A notice: paper on felt, held by a pin (default) or a strip of tape. */
.sheet {
  position: relative; padding: var(--space-6) var(--space-5); background: var(--paper); color: var(--ink);
  border-radius: 2px; box-shadow: var(--sheet-shadow);
}
.sheet::before {
  content: ''; position: absolute; top: -10px; left: 50%; width: 20px; height: 20px; margin-left: -10px;
  border-radius: 50%; background: var(--pin); box-shadow: inset -3px -3px 0 var(--pin-deep), 0 3px 4px rgb(2 10 24 / 0.5);
}
.sheet.taped::before, .activity::before, .path-card::before {
  top: -0.8rem; width: 6.5rem; height: 1.6rem; margin-left: -3.25rem; border-radius: 0; background: var(--tape); box-shadow: none; transform: rotate(-2deg);
}
.sheet.cool { background: var(--paper-cool); }
.sheet a:not(.button) { color: var(--link); }
.lead { font-size: var(--size-body-lg); }
.safe-note { padding: var(--space-3) var(--space-4); background: var(--paper); border: 2px dashed var(--boundary); border-radius: var(--radius); }
.sheet:not(.cool) .safe-note { background: var(--paper-cool); }

/* ---------- Buttons: one family, nothing moves ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; min-height: 3.25rem;
  max-width: 100%; padding: 0.65rem 1.4rem; border: var(--border-width) solid var(--ink); border-radius: var(--radius);
  overflow-wrap: break-word;
  font: inherit; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-body-lg); line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.button-primary { background: var(--ink); color: var(--paper); box-shadow: inset 0 -4px 0 var(--pin); }
.button-primary:hover { background: var(--board-deep); box-shadow: inset 0 -6px 0 var(--pin); }
.button-primary:active { box-shadow: inset 0 0 0 var(--pin); }
.button-quiet { background: var(--paper); color: var(--ink); }
.button-quiet:hover, .button-answer:hover { background: var(--marker-soft); }
.button-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); box-shadow: inset 0 -4px 0 var(--pin), var(--sheet-shadow); }
.button-paper:hover { background: var(--paper-cool); box-shadow: inset 0 -6px 0 var(--pin), var(--sheet-shadow); }
/* a drawn arrow on buttons that move the learner forward */
.button-go::after {
  content: ''; flex: none; width: 0.55em; height: 0.55em; border-top: 0.18em solid currentColor; border-right: 0.18em solid currentColor; transform: rotate(45deg); margin-left: -0.1em;
}
.button-answer { flex: 1 1 12rem; background: var(--paper); color: var(--ink); font-size: var(--size-h3); min-height: 4rem; border-width: 3px; }
.button-answer:active { background: var(--marker); }

.answers { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* ---------- Dashboard ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: center; padding-top: var(--space-4); }
.hero h1 { font-size: clamp(2.5rem, 10vw, 4.25rem); max-width: 12ch; margin-bottom: var(--space-5); }
.hero .lead { font-size: var(--size-h3); line-height: 1.4; }
.hero p { color: var(--ink-on-board); }
.hero .button { margin-top: var(--space-3); }
.anim { display: block; }
.anim img { display: block; width: 100%; height: auto; border-radius: 4px; }
.hero-anim img { box-shadow: 0 0 0 2px rgb(127 220 240 / 0.35), 0 22px 44px -14px rgb(2 10 24 / 0.9); }

.band-title { margin-top: 0; color: var(--ink-on-board); font-size: clamp(1.9rem, 6vw, 2.75rem); }
.path-list, .alert-list, .section-list { margin: 0; padding: 0; list-style: none; }
.path-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7) var(--space-5); margin-top: var(--space-6); }
.path-card {
  position: relative; display: flex; flex-direction: column; padding: var(--space-6) var(--space-5) var(--space-5); background: var(--paper); color: var(--ink);
  border-radius: 2px; box-shadow: var(--sheet-shadow);
}
.path-card::before { content: ''; position: absolute; left: 50%; }
.path-card h3 { font-size: var(--size-h2); margin-bottom: var(--space-3); }
.path-card.is-soon { background: var(--paper-cool); }
.path-foot { margin-top: auto; padding-top: var(--space-4); border-top: 2px dashed var(--boundary); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.path-meta { margin: 0; color: var(--ink-quiet); font-weight: var(--weight-bold); }
.soon-stamp {
  align-self: flex-start; margin: 0 0 var(--space-4); padding: 0.1rem 0.6rem; border: 4px double var(--ink); border-radius: var(--radius); transform: rotate(-4deg);
  font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-body-lg); letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink);
}

/* The alerts bulletin: a framed panel on the board, like the pledge. */
.bulletin { padding: var(--space-6) var(--space-5); background: var(--board-deep); border: 2px solid var(--ink-on-board); outline: 2px solid var(--ink-on-board); outline-offset: 5px; margin-inline: 7px; }
.bulletin p { color: var(--ink-on-board); }
.alert-list { margin: var(--space-5) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.alert-card { display: flex; align-items: center; gap: var(--space-4); padding-bottom: var(--space-4); border-bottom: 2px dashed rgb(201 214 230 / 0.5); }
.alert-list.on-paper .alert-card { border-bottom-color: var(--boundary); }
.alert-card h3 { margin: 0; font-size: var(--size-h3); min-width: 0; }
.alert-card h3 a { display: inline-flex; min-height: var(--target-min); align-items: center; }
.bulletin .alert-card h3 a { color: var(--ink-on-board); }
.date-tile { flex: none; width: 4.25rem; background: var(--paper); color: var(--ink); border-radius: 2px; box-shadow: var(--sheet-shadow); text-align: center; overflow: hidden; transform: rotate(-2deg); }
.date-month { display: block; padding: 0.15rem 0; background: var(--board); border-bottom: 3px solid var(--pin); color: var(--ink-on-board); font-size: var(--size-fine); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: 0.06em; }
.date-day { display: block; padding: 0.1rem 0 0.25rem; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: 1.9rem; line-height: 1.1; }
.alert-list.on-paper .date-tile { box-shadow: 0 0 0 2px var(--ink); }
.alert-date { color: var(--ink-quiet); font-weight: var(--weight-bold); margin-bottom: var(--space-2); }

.quick { max-width: 44rem; margin-inline: auto; }
.section-title { margin-top: 0; }

@media (min-width: 48em) {
  .path-list { grid-template-columns: 1fr 1fr; }
  .bulletin { padding: var(--space-7) var(--space-6); }
}
@media (min-width: 60em) {
  .hero { grid-template-columns: 1fr 1.05fr; gap: var(--space-7); padding-block: var(--space-6); }
  .hero-anim { transform: rotate(1.2deg); }
}

/* ---------- Breadcrumbs ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-4); padding: 0; list-style: none; font-size: var(--size-body); }
.crumbs li { display: inline-flex; align-items: center; gap: var(--space-3); min-width: 0; }
.crumbs li + li::before { content: ''; flex: none; width: 0.5em; height: 0.5em; border-top: 2px solid var(--ink-quiet); border-right: 2px solid var(--ink-quiet); transform: rotate(45deg); }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--target-min); font-weight: var(--weight-bold); }
.crumbs [aria-current] { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--ink-quiet); }

/* ---------- A path and its sections ---------- */
.section-list { margin-top: var(--space-4); }
.section-row { display: flex; gap: var(--space-4); align-items: center; padding: var(--space-3) 0 var(--space-3) 6px; border-bottom: 2px dashed var(--boundary); }
.section-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--ink); color: var(--paper); box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--pin);
  font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3);
}
.section-body { display: flex; flex-direction: column; min-width: 0; }
.section-body a, .section-name { display: inline-flex; align-items: center; min-height: var(--target-min); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); line-height: var(--leading-tight); }
.section-meta, .lesson-step { color: var(--ink-quiet); font-size: var(--size-body); font-weight: var(--weight-bold); }
.section-list + .button { margin-top: var(--space-6); }

/* ---------- A lesson ---------- */
.lesson h1, .take-home h1 { margin-bottom: var(--space-2); }
.lesson-step { margin-bottom: var(--space-5); }
.lesson-anim { position: relative; margin: var(--space-6) 0 0; }
.lesson-anim::before { content: ''; position: absolute; z-index: 1; top: -0.7rem; left: 50%; width: 6.5rem; height: 1.6rem; margin-left: -3.25rem; background: var(--tape); transform: rotate(-2deg); }
.lesson-anim img { box-shadow: var(--sheet-shadow); }

/* Phone-shaped video (9:16), centred; it never grows past a phone's width. */
.video-frame, .video-slot { width: min(100%, 22rem); margin: 0 auto var(--space-4); }
.video-frame video { display: block; width: 100%; aspect-ratio: 9 / 16; background: var(--board); border-radius: 14px; box-shadow: 0 0 0 3px var(--ink); }
.video-slot { display: flex; flex-direction: column; justify-content: center; min-height: 11rem; padding: var(--space-5); border: 3px dashed var(--boundary); border-radius: 14px; background: var(--paper-cool); text-align: center; }
.video-slot p { margin-inline: auto; }
.video-slot p:last-child { margin-bottom: 0; }
.video-soon-title { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); }

.reading > p { max-width: var(--measure); font-size: var(--size-body-lg); }
.key-points { margin: 0; padding: 0; list-style: none; }
.key-points li { position: relative; max-width: var(--measure); padding: var(--space-2) 0 var(--space-2) 2.4rem; }
.key-points li::before { content: ''; position: absolute; left: 0.2rem; top: 0.95rem; width: 1.5rem; height: 0.7rem; background: var(--marker); border-radius: 3px; transform: rotate(-3deg); }
.next-section { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 2px dashed var(--boundary); }
.next-section a { display: inline-flex; align-items: center; min-height: var(--target-min); font-weight: var(--weight-bold); }

/* ---------- Progress ---------- */
.progress { margin-bottom: var(--space-5); }
.progress-text { margin: 0 0 var(--space-2); color: var(--ink); font-size: var(--size-body); font-weight: var(--weight-bold); }
.progress-track {
  appearance: none; display: block; width: 100%; height: 1rem; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--pin); overflow: hidden;
}
.progress-track::-webkit-progress-bar { background: var(--paper); }
.progress-track::-webkit-progress-value { background: var(--pin); border-right: 2px solid var(--ink); }
.progress-track::-moz-progress-bar { background: var(--pin); }

/* ---------- The practice message: a phone, or an email window ---------- */
.message { margin: 0; border: 3px solid var(--ink); border-radius: 22px; background: var(--paper-cool); overflow: hidden; overflow-wrap: anywhere; }
.message p { max-width: none; }
.channel-label { margin: 0; padding: var(--space-2) var(--space-4); background: var(--ink); color: var(--paper); font-size: var(--size-body); font-weight: var(--weight-bold); text-align: center; }
.message-text { padding: 0 0 var(--space-4); }
.message-text > :not(.channel-label) { margin-inline: var(--space-4); }
.text-sender { margin-top: var(--space-3); margin-bottom: 0; font-weight: var(--weight-bold); text-align: center; }
.bubble { margin-top: var(--space-3); max-width: 30rem; padding: var(--space-3) var(--space-4); border-radius: 18px 18px 18px 4px; background: var(--paper); border: 2px solid var(--boundary); font-size: var(--size-body-lg); }
.bubble p { font-size: inherit; }
.bubble p:last-child { margin-bottom: 0; }

.message-email { border-radius: 12px; }
.email-head { padding: 0 0 var(--space-3); border-bottom: 2px dashed var(--boundary); }
.email-head > :not(.channel-label) { margin-inline: var(--space-4); }
.email-subject { margin-top: var(--space-3); margin-bottom: var(--space-2); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); line-height: var(--leading-tight); }
.email-from { margin-bottom: 0; }
.email-label { color: var(--ink-quiet); margin-right: var(--space-1); }
.email-body { padding: var(--space-4); background: var(--paper); }
.email-body p:last-child { margin-bottom: 0; }

/* Links inside a message look like links but are plain text. */
.fake-link { color: var(--link); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 0.15em; }
.removed { display: inline-block; padding: 0 0.3em; border: 1px dashed var(--boundary); border-radius: var(--radius); color: var(--ink-quiet); font-style: italic; }
.original-note { margin: 0 0 var(--space-2); color: var(--ink-quiet); font-style: italic; }
.msg-note { color: var(--ink-quiet); font-style: italic; }

/* Warning signs: highlighter over the phrase, numbered like the list below. */
mark.flag { padding: 0.05em 0.2em; background: var(--marker); color: var(--ink); border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.flag-num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.5em; margin-right: 0.25em;
  border-radius: 50%; background: var(--flag-ink); color: var(--paper); font-size: var(--size-fine); font-weight: var(--weight-bold); line-height: 1;
  vertical-align: 0.1em;
}
.flags { margin: 0; padding: 0; list-style: none; counter-reset: flag; }
.flags li { counter-increment: flag; position: relative; max-width: var(--measure); padding: var(--space-2) 0 var(--space-2) 2.75rem; }
.flags li::before { content: counter(flag); position: absolute; left: 0; top: 0.5rem; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--flag-ink); color: var(--paper); font-weight: var(--weight-bold); }

/* ---------- Verdict: a drawn mark by the heading, a stamp on the message ---------- */
.verdict { display: flex; align-items: flex-start; gap: var(--space-3); }
.verdict-text { min-width: 0; }
.verdict-mark, .row-mark { position: relative; flex: none; display: inline-block; width: 1.15em; height: 1.15em; margin-top: 0.02em; border-radius: 50%; }
.is-right .verdict-mark, .is-right .row-mark { background: var(--ink); }
.is-right .verdict-mark::before, .is-right .row-mark::before { content: ''; position: absolute; left: 36%; top: 17%; width: 30%; height: 52%; border-right: 0.16em solid var(--paper); border-bottom: 0.16em solid var(--paper); transform: rotate(40deg); }
.is-wrong .verdict-mark, .is-wrong .row-mark { background: var(--paper); box-shadow: inset 0 0 0 0.13em var(--ink); }
.is-wrong .verdict-mark::before, .is-wrong .verdict-mark::after, .is-wrong .row-mark::before, .is-wrong .row-mark::after { content: ''; position: absolute; left: 24%; right: 24%; top: calc(50% - 0.07em); height: 0.14em; background: var(--ink); transform: rotate(45deg); }
.is-wrong .verdict-mark::after, .is-wrong .row-mark::after { transform: rotate(-45deg); }

.stamped { position: relative; margin-bottom: var(--space-7); }
.stamp {
  position: absolute; right: var(--space-2); bottom: -1.9rem; padding: 0.05rem 0.7rem; background: var(--paper); border: 5px double currentColor; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: var(--weight-bold); font-size: clamp(2rem, 9vw, 2.75rem); letter-spacing: 0.03em; line-height: 1.05;
  transform: rotate(-7deg); box-shadow: 0 2px 6px rgb(2 10 24 / 0.18);
}
.stamp-scam { color: var(--flag-ink); }
.stamp-safe { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: stamp-land 0.42s var(--stamp-ease) 0.25s backwards; }
}
@keyframes stamp-land { from { opacity: 0; transform: rotate(-7deg) scale(2.2); filter: blur(6px); } }

/* What to do: a framed panel, the pledge frame brought into the lesson. */
.todo { margin: var(--space-6) 7px 0; padding: var(--space-5); background: var(--board-deep); color: var(--ink-on-board); box-shadow: inset 0 0 0 2px var(--ink-on-board), 0 0 0 5px var(--board-deep), 0 0 0 7px var(--ink); }
.todo h2 { margin-top: 0; color: var(--ink-on-board); }
.todo p:last-child { margin-bottom: 0; }
.todo .key-points li::before { background: var(--pin); }
.source { margin-top: var(--space-6); color: var(--ink-quiet); font-size: var(--size-body); }

/* ---------- Summary ---------- */
.score { display: inline; padding: 0.05em 0.25em; background: var(--marker); border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h2); line-height: 1.5; }
.score + * { margin-top: var(--space-5); }
.answers-list { margin: 0; padding: 0; list-style: none; }
.answers-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) 0; border-bottom: 2px dashed var(--boundary); }
.row-title { flex: 1 1 12rem; }
.row-result { font-weight: var(--weight-bold); }
.answers-list a { display: inline-flex; align-items: center; min-height: var(--target-min); }

/* ---------- Quiz ---------- */
.quiz-question { margin: 0; padding: 0; border: 0; min-width: 0; }
.quiz-question legend { padding: 0; margin-bottom: var(--space-5); }
.quiz-question legend h1 { font-size: var(--size-h2); margin: 0; }
.options { margin: 0 0 var(--space-5); padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.option, .choice-opt { display: flex; align-items: flex-start; gap: var(--space-3); min-height: 3.5rem; padding: var(--space-3) var(--space-4); border: 3px solid var(--ink); border-radius: var(--radius); background: var(--paper); cursor: pointer; font-size: var(--size-body-lg); }
.option input, .choice-opt input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0.2rem 0 0; accent-color: var(--ink); }
.option:hover, .choice-opt:hover { background: var(--marker-soft); }
.option:has(input:checked) { background: var(--marker); }
.quiz-asked { color: var(--ink-quiet); }
.quiz-answer { padding: var(--space-3) var(--space-4); background: var(--ok-wash); border: 2px solid var(--ink); border-radius: var(--radius); }

/* ---------- Take-home sheet ---------- */
.takeaway { margin: var(--space-5) 0 var(--space-6); padding: 0; list-style: none; }
.takeaway li { padding: var(--space-3) 0 var(--space-3) 2.6rem; border-bottom: 2px dashed var(--boundary); font-size: var(--size-body-lg); font-weight: var(--weight-bold); position: relative; }
.takeaway li::before { content: ''; position: absolute; left: 0; top: 0.85rem; width: 1.5rem; height: 1.5rem; border: 3px solid var(--ink); border-radius: 3px; }
.sheet-help { padding: var(--space-4); border: 3px solid var(--ink); border-radius: var(--radius); }
.sheet-help .help-title { margin-bottom: var(--space-2); }
.sheet-help p { margin-bottom: var(--space-2); }
.sheet-help strong { display: inline-block; font-family: var(--font-display); font-size: var(--size-h3); }
.print-tip { margin-top: var(--space-5); color: var(--ink-quiet); }

/* ---------- In-lesson activities: worksheets taped into the lesson ---------- */
.activity { position: relative; margin: var(--space-7) 0; padding: var(--space-7) var(--space-4) var(--space-5); border: 3px solid var(--ink); border-radius: var(--radius); background: var(--paper-cool); min-width: 0; }
.activity::before { content: ''; position: absolute; left: 50%; }
fieldset.activity > legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--space-4); }
fieldset.activity > legend + * { clear: both; }
/* the activity's name, as a label tab on the worksheet's top edge */
.act-kind { position: absolute; top: -3px; left: -3px; margin: 0; padding: 0.15rem 0.7rem; background: var(--ink); color: var(--paper); border-radius: var(--radius) 0 var(--radius) 0; font-size: var(--size-body); font-weight: var(--weight-bold); max-width: none; }
.act-prompt { display: block; margin: 0 0 var(--space-4); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); line-height: var(--leading-tight); letter-spacing: -0.02em; max-width: none; }
fieldset.activity .act-prompt { margin-bottom: 0; }

/* drawn tick and dash used in feedback */
.row-ok::before, .all-right::before, .v-flag::before, .note-flag::before {
  content: ''; display: inline-block; width: 0.42em; height: 0.8em; margin: 0 0.55em 0.05em 0.2em; border-right: 0.18em solid currentColor; border-bottom: 0.18em solid currentColor; transform: rotate(40deg);
}
.row-no::before { content: ''; display: inline-block; width: 0.8em; height: 0.18em; margin: 0 0.4em 0.28em 0; background: currentColor; }

/* Quick check */
.choice-list { margin: 0 0 var(--space-3); padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.choice-fb { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--paper); border: 2px solid var(--ink); }
.choice-fb p { margin: 0; }
@supports selector(:has(*)) {
  .choice-fb { display: none; }
  .act-choice:has(input[value="0"]:checked) .fb-0,
  .act-choice:has(input[value="1"]:checked) .fb-1,
  .act-choice:has(input[value="2"]:checked) .fb-2,
  .act-choice:has(input[value="3"]:checked) .fb-3 { display: block; }
  .choice-opt.is-right:has(input:checked) { background: var(--ok-wash); box-shadow: inset 0 0 0 2px var(--ink); }
  .choice-opt.is-wrong:has(input:checked) { border-style: dashed; background: var(--no-wash); }
}

/* Match it and put in order: one <select> per row */
.match-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding: var(--space-3) 0; border-bottom: 2px dashed var(--boundary); }
.match-item { font-weight: var(--weight-bold); font-size: var(--size-body-lg); }
.match-row select { width: 100%; min-height: 3.25rem; padding: 0 var(--space-3); border: 3px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; font-weight: var(--weight-bold); }
.row-ok, .row-no, .all-right { display: none; font-weight: var(--weight-bold); }
.all-right { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); background: var(--ok-wash); border: 2px solid var(--ink); border-radius: var(--radius); font-family: var(--font-display); font-size: var(--size-body-lg); }
@supports selector(:has(*)) {
  .match-row:has(option.is-right:checked) .row-ok { display: block; }
  .match-row:has(option.is-wrong:checked) .row-no { display: block; }
  .match-row:has(option.is-right:checked) select { background: var(--ok-wash); }
  .match-row:has(option.is-wrong:checked) select { background: var(--no-wash); border-style: dashed; }
  .act-select:not(:has(option.placeholder:checked)):not(:has(option.is-wrong:checked)) .all-right { display: block; }
}
@media (min-width: 40em) {
  .match-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; }
  .row-ok, .row-no { grid-column: 2; }
}

/* Tap the red flags */
.act-tap { counter-reset: found; }
.act-reveal { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.act-tap .message p { line-height: 2.2; }
.tap { cursor: pointer; padding: 0.2em 0.15em; border-radius: 3px; box-shadow: inset 0 -3px 0 var(--pin-deep); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tap:hover { background: var(--marker-soft); }
.tap-box { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tap:has(.tap-box:checked) { background: var(--marker); box-shadow: inset 0 -3px 0 var(--ink); }
.tap:has(.tap-box:focus-visible), .act-tap:has(.act-reveal:focus-visible) .act-reveal-btn { outline: 3px solid var(--focus-ring-offset); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-ring); }
.tap-v, .when-shown, .tap-answers { display: none; }
.act-reveal-btn { margin-top: var(--space-4); }
.tap.is-flag:has(.tap-box:checked) { counter-increment: found; }
.tap-count::before { content: counter(found); }
.act-tap:has(.act-reveal:checked) .when-hidden { display: none; }
.act-tap:has(.act-reveal:checked) .when-shown { display: inline; }
.act-tap:has(.act-reveal:checked) .tap-answers { display: block; margin-top: var(--space-4); }
.act-tap:has(.act-reveal:checked) .tap.is-flag { background: var(--ok-wash); box-shadow: inset 0 -3px 0 var(--ink); }
.act-tap:has(.act-reveal:checked) .tap.is-flag:has(.tap-box:checked) .v-flag,
.act-tap:has(.act-reveal:checked) .tap.is-flag:not(:has(.tap-box:checked)) .v-missed,
.act-tap:has(.act-reveal:checked) .tap.is-decoy:has(.tap-box:checked) .v-decoy { display: inline; margin-left: 0.3em; padding: 0.1em 0.4em; border-radius: 3px; background: var(--ink); color: var(--paper); font-size: var(--size-body); font-weight: var(--weight-bold); white-space: nowrap; }
.act-tap:has(.act-reveal:checked) .tap.is-flag:not(:has(.tap-box:checked)) .v-missed { background: var(--flag-ink); }
.act-tap:has(.act-reveal:checked) .tap.is-flag:not(:has(.tap-box:checked)) { outline: 2px dashed var(--flag-ink); }
.act-tap:has(.act-reveal:checked) .tap.is-decoy:has(.tap-box:checked) { background: var(--no-wash); }
.tap-score { display: inline-block; padding: 0.05em 0.3em; background: var(--marker); border-radius: 4px; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); }
.tap-notes { margin: 0; padding: 0; list-style: none; }
.tap-notes li { padding: var(--space-2) 0; border-bottom: 2px dashed var(--boundary); }
.note-quote { font-weight: var(--weight-bold); }
.note-decoy { color: var(--ink-quiet); }
@supports not selector(:has(*)) {
  .tap-answers { display: block; }
  .act-reveal-btn { display: none; }
}

/* ---------- Footer: both help lines on every page ---------- */
.site-footer { background: var(--board-deep); border-top: 3px solid var(--pin); }
.footer-inner { overflow-wrap: anywhere; max-width: 48rem; margin: 0 auto; padding: var(--space-6) var(--space-4); }
.help-title { margin-bottom: var(--space-3); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); }
.hotlines { display: grid; gap: var(--space-3); }
.hotline {
  display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); min-height: 4.75rem;
  background: var(--board); box-shadow: inset 0 0 0 2px var(--ink-on-board-quiet); border-radius: var(--radius); color: var(--ink-on-board); text-decoration: none;
}
.hotline:hover { background: var(--board-deep); }
.hotline-label { font-size: var(--size-fine); font-weight: var(--weight-bold); }
.hotline strong { color: var(--lit); font-family: var(--font-display); font-size: var(--size-number); line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgb(127 220 240 / 0.35); }
.footer-note { margin: var(--space-5) 0 0; color: var(--ink-on-board-quiet); font-size: var(--size-body); }

@media (min-width: 40em) {
  .hotlines { grid-template-columns: 1fr 1fr; }
  .sheet { padding: var(--space-7) var(--space-6); }
  .activity { padding-inline: var(--space-5); }
}

@media (prefers-contrast: more) {
  .sheet, .path-card { box-shadow: none; border: 3px solid var(--ink); }
  .hero-anim, .date-tile, .soon-stamp, .stamp { transform: none; }
}

@media (forced-colors: active) {
  .brand-lock, .brand-lock::before { background: CanvasText; border-color: CanvasText; }
  mark.flag, .tap:has(.tap-box:checked) { outline: 2px solid Highlight; }
  .sheet::before, .lesson-anim::before, .activity::before, .path-card::before { display: none; }
}

@media print {
  .site-header, .site-footer, .answers, .button, .crumbs, .print-tip, .hero-anim { display: none; }
  body { background: #fff; color: #000; }
  .sheet { box-shadow: none; }
  .take-home { padding: 0; }
  .takeaway li { font-size: 16pt; }
}

/* Text on highlighter stays ink; the stamp's landing never widens the page. */
mark.flag .fake-link, .tap .fake-link { color: var(--ink); }
.sheet.practice { overflow-x: clip; }

/* Path cards: the animation fills the top of the notice and is a link to the path. */
.path-card { overflow: visible; }
.path-anim { display: block; margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-5)) var(--space-5); border-bottom: 3px solid var(--pin); }
.path-anim img { display: block; width: 100%; height: auto; border-radius: 2px 2px 0 0; }
.path-anim:hover { border-bottom-color: var(--marker); }
.path-anim:focus-visible { outline-offset: -3px; }
.path-card::before { display: none; } /* the animation carries its own pin or tape */
@media print { .path-anim { display: none; } }

/* ---------- Lesson visuals: flows, extra information, facts, memory lines ---------- */
.info, .fact, .flow, .remember { margin: var(--space-6) 0; }
.info h3 { margin-bottom: var(--space-3); }
.info p { max-width: var(--measure); font-size: var(--size-body-lg); }
.info p:last-child { margin-bottom: 0; }
.info { padding: var(--space-5) var(--space-4); background: var(--paper-cool); border-radius: var(--radius); }

.fact { padding: var(--space-4); border-block: 2px dashed var(--boundary); }
.fact p { margin: 0; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); line-height: 1.25; letter-spacing: -0.02em; max-width: 30rem; }
.fact .fact-source { margin-top: var(--space-2); font-family: var(--font-body); font-weight: var(--weight-normal); font-size: var(--size-body); letter-spacing: 0; color: var(--ink-quiet); }
.fact-source a { display: inline-flex; align-items: center; min-height: var(--target-min); font-weight: var(--weight-bold); }

/* A flow: boxes joined by arrows, read top to bottom. */
.flow { padding: 0; }
.flow figcaption { margin-bottom: var(--space-4); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); line-height: var(--leading-tight); letter-spacing: -0.02em; }
.flow ol { margin: 0; padding: 0; list-style: none; counter-reset: flow; }
.flow li { position: relative; counter-increment: flow; margin-bottom: 2.4rem; }
.flow p { margin: 0; max-width: none; }
/* the arrow between boxes */
.flow li::after { content: ''; position: absolute; left: 1.6rem; bottom: -2.1rem; width: 4px; height: 1.6rem; background: var(--ink); }
.flow li::before { content: ''; position: absolute; left: calc(1.6rem - 0.4rem + 2px); bottom: -2.2rem; width: 0.8rem; height: 0.8rem; border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: rotate(45deg); }
.flow-text, .flow-ask { position: relative; padding: var(--space-3) var(--space-4) var(--space-3) 3.6rem; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--paper); font-weight: var(--weight-bold); font-size: var(--size-body-lg); }
.flow-text::before, .flow-ask::before { content: counter(flow); position: absolute; left: 0.7rem; top: 0.65rem; display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--font-display); }
.flow-ask { background: var(--marker-soft); }
.flow-ask::before { content: '?'; }
/* the way out: a side note hanging off the step */
.flow-stop, .flow-yes { position: relative; margin: var(--space-2) 0 0 2.2rem; padding: var(--space-3) var(--space-4); background: var(--ok-wash); border: 2px solid var(--ink); border-radius: var(--radius); }
.flow-stop::before, .flow-yes::before { content: ''; position: absolute; left: -1.1rem; top: 1.1rem; width: 1.1rem; height: 4px; background: var(--ink); }
.flow-yes { background: var(--paper); }
.flow-no { margin-top: var(--space-2); padding-left: 3rem; color: var(--ink-quiet); font-weight: var(--weight-bold); }
.flow-end { padding: var(--space-4); border-radius: var(--radius); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-body-lg); }
.flow-end.is-bad { background: var(--flag-ink); color: var(--paper); }
.flow-end.is-good { background: var(--ink); color: var(--paper); }

/* The line to remember: a taped note in highlighter. */
.remember { position: relative; padding: var(--space-5) var(--space-4); background: var(--marker); border-radius: 2px; box-shadow: var(--sheet-shadow); transform: rotate(-1deg); }
.remember::before { content: ''; position: absolute; top: -0.7rem; left: 50%; width: 6.5rem; height: 1.6rem; margin-left: -3.25rem; background: var(--tape); transform: rotate(-2deg); }
.remember p { margin: 0; max-width: none; }
.remember-label { display: block; font-weight: var(--weight-bold); }
.remember strong { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 6.5vw, 2.25rem); line-height: 1.15; letter-spacing: -0.03em; }
@media (prefers-contrast: more) { .remember { transform: none; border: 3px solid var(--ink); } }
@media (min-width: 40em) { .info { padding-inline: var(--space-5); } }
@media print { .flow li { break-inside: avoid; } }

/* ---------- Roomier pages: a wider notice and a wider reading column ---------- */
:root { --measure: 44rem; }
main { max-width: 62rem; }
.footer-inner { max-width: 62rem; }
.lesson-anim { max-width: 44rem; }
.flow, .info, .fact, .activity, .todo, .stamped { max-width: 50rem; }
.fact p { max-width: 40rem; }
.quick { max-width: 50rem; }
/* phones: give the words more of the screen */
@media (max-width: 39.99em) {
  main { padding-inline: var(--space-3); }
  .sheet { padding-inline: var(--space-4); }
  .activity, .info { padding-inline: var(--space-3); }
}
@media (min-width: 60em) {
  .sheet { padding: var(--space-7) var(--space-8); }
}

/* ---------- Keeping going: goal, recap, map, plan, completion ---------- */
.can-do, .can-now { padding: var(--space-3) var(--space-4); background: var(--marker-soft); border-radius: var(--radius); font-size: var(--size-body-lg); }
.can-now { font-size: var(--size-h3); line-height: 1.35; background: var(--marker); }
.recap-lead { color: var(--ink-quiet); font-weight: var(--weight-bold); }
.act-recap { margin-top: var(--space-4); background: var(--paper); border-style: dashed; }
.act-recap::before { display: none; }
.next-section p { margin-bottom: var(--space-2); }

/* The path map: numbered dots on a line; where you are, not how well you did. */
.path-map { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.path-map li { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-quiet); }
.map-dot { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 3px solid var(--boundary); border-radius: 50%; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-body); }
.map-name { display: none; }
.path-map .is-done .map-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--pin); }
.path-map .is-here .map-dot { border-color: var(--ink); color: var(--ink); background: var(--marker); }
.path-map [aria-current] .map-name { color: var(--ink); font-weight: var(--weight-bold); }

.humble { color: var(--ink-quiet); }
.tell-card, .next-up { margin: var(--space-5) 0; padding: var(--space-4); border: 2px dashed var(--boundary); border-radius: var(--radius); max-width: 50rem; }
.tell-card h2, .next-up h2 { margin-top: 0; font-size: var(--size-h3); }
.tell-card p:last-child, .next-up p:last-child { margin-bottom: 0; }
.review-line { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 2px dashed var(--boundary); color: var(--ink-quiet); }
.review-line .score { display: inline; padding: 0; background: none; font: inherit; }
.review-line a { display: inline-flex; align-items: center; min-height: var(--target-min); font-weight: var(--weight-bold); }

/* Take-home sheet and completion page */
.plan { margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.plan li { position: relative; padding: var(--space-3) 0 var(--space-3) 2.4rem; border-bottom: 2px dashed var(--boundary); font-size: var(--size-body-lg); font-weight: var(--weight-bold); }
.plan li::before { content: ''; position: absolute; left: 0.2rem; top: 1.2rem; width: 1.5rem; height: 0.7rem; background: var(--marker); border-radius: 3px; transform: rotate(-3deg); }
.tell { padding: var(--space-3) var(--space-4); background: var(--paper-cool); border-radius: var(--radius); }
.where { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-top: var(--space-4); max-width: none; }
.blank { flex: 1 1 8rem; min-width: 8rem; height: 1.6rem; border-bottom: 3px solid var(--ink); }
.certificate { border: 3px double var(--ink); }
.cert-motto { display: inline-block; margin-bottom: var(--space-4); padding: 0.1rem 0.7rem; border: 5px double var(--ink); border-radius: var(--radius); transform: rotate(-4deg); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: clamp(1.6rem, 6vw, 2.25rem); letter-spacing: 0.02em; }
.cert-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); max-width: 34rem; font-weight: var(--weight-bold); }
@media (min-width: 48em) { .map-name { display: inline; } .path-map li { flex: 1 1 0; flex-direction: column; text-align: center; } }
@media (prefers-contrast: more) { .cert-motto { transform: none; } }
@media print { .path-map, .review-line, .actions { display: none; } }

/* ---------- Scam Bingo: caller sheet and printable cards (English only) ---------- */
.bingo-how { max-width: var(--measure); padding-left: 1.4em; font-size: var(--size-body-lg); }
.bingo-how li + li { margin-top: var(--space-3); }
.bingo h2, .bingo-cards h2 { margin-top: var(--space-7); }
.bingo-calls { margin: 0; padding: 0; list-style: none; }
.bingo-call { display: grid; grid-template-columns: 3.4rem 1fr; gap: var(--space-3); padding: var(--space-4) 0; border-top: 2px dashed var(--boundary); break-inside: avoid; }
.bingo-num { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); font-variant-numeric: tabular-nums; }
.bingo-call.is-habit .bingo-num { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); }
.bingo-call h3 { margin: 0 0 var(--space-2); }
.bingo-call p { margin: 0 0 var(--space-2); max-width: var(--measure); }
.bingo-call p:last-child { margin-bottom: 0; }
.bingo-do { padding: var(--space-2) var(--space-3); background: var(--ok-wash); border-radius: var(--radius); }
.bingo-local { color: var(--ink-quiet); font-weight: var(--weight-bold); }
.bingo-credit { margin-top: var(--space-5); max-width: var(--measure); color: var(--ink-quiet); font-weight: var(--weight-bold); }
.bingo-slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr)); margin: var(--space-4) 0 0; padding: 0; list-style: none; border-top: 2px dashed var(--ink); border-left: 2px dashed var(--ink); }
.bingo-slips li { display: flex; align-items: center; gap: var(--space-2); min-height: 3.2rem; padding: var(--space-2) var(--space-3); border-right: 2px dashed var(--ink); border-bottom: 2px dashed var(--ink); break-inside: avoid; }
.bingo-slips strong { flex: none; white-space: nowrap; overflow-wrap: normal; font-family: var(--font-display); font-size: var(--size-h3); font-variant-numeric: tabular-nums; }

.bingo-card { margin-top: var(--space-8); }
.bingo-card h2 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); }
.bingo-cardno { font-family: var(--font-body); font-size: var(--size-body); color: var(--ink-quiet); }
/* On a small screen the card keeps its shape and scrolls inside its own frame. */
.bingo-scroll { overflow-x: auto; }
.bingo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-width: 40rem; margin: 0; padding: 0; list-style: none; border: 3px solid var(--ink); background: var(--paper); }
.bingo-grid li { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1, 0.25rem); aspect-ratio: 1; padding: var(--space-2); border: 1.5px solid var(--ink); text-align: center; overflow-wrap: normal; hyphens: none; }
.bingo-n { font-family: var(--font-display); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; color: var(--ink-quiet); }
.bingo-name { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-body); line-height: 1.15; letter-spacing: -0.01em; }
.bingo-grid .is-habit { background: var(--ok-wash); }
.bingo-grid .is-free { background: var(--marker); }
.bingo-grid .is-free .bingo-name { font-size: var(--size-h3); }
.bingo-grid .is-free .bingo-n { color: var(--ink); font-family: var(--font-body); font-size: var(--size-fine); }
.bingo-foot { margin: var(--space-3) 0 0; max-width: none; font-weight: var(--weight-bold); }

/* Marking a square on screen: the whole square is one checkbox. */
.bingo-grid li { position: relative; padding: 0; }
.bingo-grid label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); width: 100%; height: 100%; padding: var(--space-2); cursor: pointer; }
.bingo-grid input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bingo-clear { margin-top: var(--space-3); }
@media screen {
  .bingo-grid li:has(:checked) { background: var(--ink); }
  .bingo-grid li:has(:checked) .bingo-name, .bingo-grid li:has(:checked) .bingo-n { color: var(--paper); }
  .bingo-grid li:has(:checked)::after { content: '✓'; position: absolute; top: 0.2rem; right: 0.45rem; color: var(--marker); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-h3); line-height: 1; pointer-events: none; }
  .bingo-grid li:has(:focus-visible) { outline: 3px solid var(--pin-deep); outline-offset: -6px; }
  .bingo-grid li:has(:checked:focus-visible) { outline-color: var(--marker); }
  .bingo-grid li:hover:not(:has(:checked)) { box-shadow: inset 0 0 0 4px var(--pin); }
}
@media (forced-colors: active) { .bingo-grid li:has(:checked) { outline: 4px solid Highlight; outline-offset: -6px; } }

/* Printing. Each card fills one upright US Letter page: the page size and
   margins are set here, so the card comes out the same size whatever the print
   dialog was last left on. The page stops being a flex column, because
   browsers ignore page breaks inside one. Marks made on screen are not printed. */
@page bingo-card { size: 8.5in 11in; margin: 0.5in; }
@media print {
  body:has(.bingo, .bingo-cards), body:has(.bingo, .bingo-cards) main { display: block; min-height: 0; }
  body:has(.bingo, .bingo-cards) main { max-width: none; padding: 0; }
  .bingo, .bingo-cards { padding: 0; border: 0; }
  .bingo::before, .bingo::after, .bingo-cards::before, .bingo-cards::after { display: none; }
  .bingo-cards > * + * { margin-top: 0; }
  .bingo-break { break-before: page; page-break-before: always; }
  .bingo-call, .bingo-slips li { break-inside: avoid; page-break-inside: avoid; }
  .bingo-intro { display: none; }
  .bingo-credit { font-size: 11pt; }
  /* The caller sheet: tighter, so it takes fewer sheets of paper. */
  .bingo h1 { margin-bottom: 0.08in; font-size: 26pt; }
  .bingo h2 { margin-top: 0.16in; margin-bottom: 0.06in; font-size: 17pt; }
  .bingo h2.bingo-break { margin-top: 0; }
  .bingo .lead, .bingo-how, .bingo > p { margin-bottom: 0.08in; font-size: 11.5pt; line-height: 1.32; }
  .bingo-how { max-width: none; }
  .bingo-how li + li { margin-top: 0.03in; }
  .bingo .sheet-help { margin-top: 0.1in; padding: 0.08in 0.15in; break-inside: avoid; page-break-inside: avoid; }
  .bingo .sheet-help p { font-size: 12pt; }
  .bingo-credit { margin-top: 0.08in; }
  .bingo .sheet-help p { margin: 0.03in 0; }
  .bingo-call { grid-template-columns: 0.5in 1fr; gap: 0.12in; padding: 0.11in 0; }
  .bingo-num { width: 0.42in; height: 0.42in; font-size: 14pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .bingo-call h3 { margin-bottom: 0.03in; font-size: 14pt; }
  .bingo-call p { margin-bottom: 0.04in; max-width: none; font-size: 12pt; line-height: 1.35; }
  .bingo-do { padding: 0.04in 0.08in; }
  .bingo-local { font-size: 11pt; }
  .bingo-slips { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0.15in; }
  .bingo-slips li { min-height: 0.58in; padding: 0.04in 0.1in; font-size: 12pt; line-height: 1.2; }
  .bingo-slips strong { font-size: 16pt; }
  .bingo + .bingo-cards { margin-top: 0; }
  .bingo-card { page: bingo-card; width: 7.5in; margin: 0 auto; break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid; }
  .bingo-card:last-of-type { break-after: auto; page-break-after: auto; }
  .bingo-card h2 { margin: 0 0 0.12in; font-size: 30pt; line-height: 1; }
  .bingo-cardno { font-size: 14pt; }
  .bingo-scroll { overflow: visible; }
  .bingo-grid { min-width: 0; width: 7.5in; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 1.62in; box-sizing: border-box; border-width: 2.5pt; }
  .bingo-grid li { aspect-ratio: auto; box-sizing: border-box; border-width: 1pt; }
  .bingo-grid label { padding: 4pt; gap: 4pt; }
  .bingo-grid input { display: none; }
  .bingo-name { font-size: 16pt; line-height: 1.12; }
  .bingo-n { font-size: 15pt; color: #000; }
  .bingo-grid .is-free .bingo-name { font-size: 26pt; }
  .bingo-grid .is-free .bingo-n { font-size: 11pt; }
  .bingo-foot { margin-top: 0.12in; font-size: 12pt; line-height: 1.3; }
  .bingo-do, .bingo-grid .is-habit, .bingo-grid .is-free { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Lotería de estafas (Spanish only: 4x4 tablas & illustrated deck) ---------- */
.loteria-call { grid-template-columns: 8.5rem 1fr; align-items: start; }
.loteria-call-side { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.loteria-call-art { width: 100%; max-width: 8.5rem; border: 2px solid #181009; box-shadow: 2px 2px 0 rgba(24, 16, 9, 0.18); }
.loteria-art { display: block; width: 100%; height: auto; }
.loteria-verse { font-style: italic; color: var(--ink); }

.loteria-slips { grid-template-columns: repeat(auto-fill, minmax(min(11.5rem, 100%), 1fr)); }
.loteria-slips .loteria-slip { flex-direction: column; align-items: stretch; justify-content: space-between; gap: var(--space-1); min-height: 9.5rem; padding: var(--space-2); background: #fdf6e2; text-align: center; }
.loteria-slip.is-habit { background: var(--ok-wash); }
.loteria-slip-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 0.15rem; }
.loteria-slip-title { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-fine); line-height: 1.15; text-transform: uppercase; letter-spacing: 0.02em; }

.loteria-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 36rem; background: #fdf6e2; }
.loteria-grid li { aspect-ratio: auto; min-height: 11.2rem; background: #fdf6e2; }
.loteria-grid label { justify-content: space-between; padding: 0.35rem 0.4rem; gap: 0.2rem; }
.loteria-cell-top { display: flex; width: 100%; justify-content: flex-start; line-height: 1; }
.loteria-grid .loteria-art { width: 100%; max-width: 9.6rem; margin: 0 auto; }
.loteria-grid .bingo-name { text-transform: uppercase; letter-spacing: 0.03em; font-size: 1.05rem; }
@media (max-width: 30em) {
  .loteria-call { grid-template-columns: 1fr; }
  .loteria-call-side { flex-direction: row; justify-content: flex-start; }
  .loteria-call-art { max-width: 7rem; }
}
@media print {
  .loteria-call { grid-template-columns: 1.45in 1fr; gap: 0.14in; padding: 0.09in 0; }
  .loteria-call-side { flex-direction: row; align-items: center; gap: 0.08in; }
  .loteria-call-art { width: 1in; }
  .loteria-slips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .loteria-slips .loteria-slip { min-height: 1.5in; padding: 0.04in; gap: 2pt; }
  .loteria-slips .loteria-art { max-width: 1.32in; }
  .loteria-slip-title { font-size: 11pt; }
  .loteria-grid { width: 7.5in; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 2.02in; }
  .loteria-grid li { min-height: 0; }
  .loteria-grid label { padding: 4pt 5pt; gap: 2pt; }
  .loteria-grid .bingo-n { font-size: 13pt; }
  .loteria-grid .loteria-art { max-width: 1.62in; max-height: 1.22in; }
  .loteria-grid .bingo-name { font-size: 13.5pt; line-height: 1.1; }
  .loteria-grid li, .loteria-slip, .loteria-slip.is-habit, .loteria-art { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Scenes: two neighbours talk, the learner advises ---------- */
/* Two cartoon characters in a room, with a speech bubble over the one who is
   talking. Without /scene.js the whole conversation shows as a column of
   bubbles under the picture. With it (.is-live) one step shows at a time. */
.scene [hidden] { display: none !important; }
.scene { --wall: #f6e6c6; --line: #2a1a14; }
.scene-set { display: flex; flex-direction: column; margin-top: var(--space-5); }
.scene-stage {
  position: relative; overflow: hidden; width: 100%; height: min(54vw, 22rem);
  border: 3px solid var(--ink); border-radius: var(--radius); background: var(--wall);
}
.scene-room { position: absolute; inset: 0; width: 100%; height: 100%; }
.r-panel { fill: #e6cb9d; } .r-rail { fill: #caa56c; }
.r-tile-line { fill: none; stroke: #caa56c; stroke-width: 1.5; stroke-dasharray: 8 6; opacity: 0.6; }
.r-frame { fill: #fffaf0; } .r-sill { fill: #fffaf0; stroke: #caa56c; stroke-width: 2; }
.r-sky { fill: #bfe6f2; } .r-sun { fill: var(--marker); } .r-hill-far { fill: #c9a7c9; } .r-hill { fill: #d9a066; }
.r-cactus { fill: #5fa55a; }
.r-pot { fill: #c96a4b; stroke: var(--line); stroke-width: 2; }
.r-pot-plant { fill: #5fa55a; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; }
.r-rack { fill: none; stroke: #5a3e2e; stroke-width: 3; stroke-linecap: round; }
.r-copper { fill: #d9824b; stroke: var(--line); stroke-width: 2.5; }
.r-art-frame { fill: #8c5c3c; stroke: var(--line); stroke-width: 2.5; }
.r-art-mat { fill: #fffaf0; }
.r-shelf { fill: #9e6b43; stroke: var(--line); stroke-width: 2.5; }
.r-shelf-in { fill: #6e472b; }
.r-book-a { fill: #2aa3b0; } .r-book-b { fill: #e56b55; } .r-book-c { fill: #f7cf4a; }
.r-lamp-glow { fill: #fff3b0; opacity: 0.45; }
.r-lamp-stand { fill: none; stroke: #4a3525; stroke-width: 4; stroke-linecap: round; }
.r-lamp-shade { fill: #f7cf4a; stroke: var(--line); stroke-width: 2.5; stroke-linejoin: round; }
.r-cork { fill: #d4a373; }
.r-note-a { fill: #fff9c4; } .r-note-b { fill: #dff3fb; }
.r-arch { fill: #e3be8e; stroke: #caa56c; stroke-width: 2; }
.r-bloom { fill: #e05a7a; }
.room-living { background: #f3e1c0; }
.room-study { background: #efe0be; }
.room-sunroom { background: #f8ebd0; }

/* Live speakerphone banner on stage when the offstage caller speaks */
.stage-call {
  display: none; position: absolute; top: 0.65rem; left: 50%; transform: translateX(-50%); z-index: 2;
  align-items: center; gap: 0.45rem; padding: 0.25rem 0.85rem;
  background: var(--board-deep); color: var(--ink-on-board); border: 2px solid var(--lit); border-radius: 999px;
  font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-fine); white-space: nowrap;
  box-shadow: 0 4px 12px rgb(2 10 24 / 0.45);
}
.scene.is-phone-call .stage-call { display: inline-flex; }
.call-wave {
  width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--lit);
  box-shadow: 0 0 0 3px rgb(127 220 240 / 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  .scene.is-phone-call .call-wave { animation: call-pulse 0.9s ease-in-out infinite alternate; }
}
@keyframes call-pulse { to { transform: scale(1.35); box-shadow: 0 0 0 6px rgb(127 220 240 / 0.15); } }

.actor { position: absolute; bottom: -1%; height: 99%; aspect-ratio: 240 / 300; margin: 0; transform-origin: 50% 100%; }
.actor-a { left: 0; } .actor-b { right: 0; }
.actor svg { display: block; width: 100%; height: 100%; overflow: visible; }
.actor figcaption {
  position: absolute; left: 50%; bottom: 0.5rem; transform: translateX(-50%); white-space: nowrap; padding: 0.1rem 0.7rem;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: var(--weight-bold);
}
.is-live .actor figcaption { display: none; } /* the bubble carries the name */
.is-live .actor { transition: transform 0.22s ease-out, filter 0.22s ease-out; }
.is-live .actor.is-talking { transform: scale(1.045); z-index: 1; filter: drop-shadow(0 4px 10px rgb(42 26 20 / 0.18)); }
.is-live .actor.is-listening { transform: scale(0.95); }

/* when PixiJS paints the stage, its canvas covers the plain drawings */
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-stage.is-drawn .scene-room, .scene-stage.is-drawn .actor svg { visibility: hidden; }

/* the drawn characters */
.c-line { fill: none; stroke: var(--line); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.c-thin { stroke-width: 3; }
.c-skin, .c-cloth, .c-hair { stroke: var(--line); stroke-width: 4.5; stroke-linejoin: round; }
.c-flat, .c-patch { stroke: none; }
.c-shade { fill: #40180a; opacity: 0.16; }
.c-blush { fill: #e5574f; opacity: 0.22; }
.c-white { fill: #fff; stroke: var(--line); stroke-width: 3.5; }
.c-pupil { fill: #1b100c; }
.c-spark { fill: #fff; }
.c-crease { stroke-width: 2; opacity: 0.35; }
.c-shine { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: 0.6; }
.c-shine.h-shade { stroke: #c9ced6; opacity: 1; fill: none; }
.c-glass { fill: rgb(255 255 255 / 0.22); stroke: var(--line); stroke-width: 5; }
.c-gem { fill: var(--marker); stroke: var(--line); stroke-width: 3; }
.c-turq { fill: #2ec4b6; stroke: var(--line); stroke-width: 3; }
.c-dot { fill: var(--line); opacity: 0.7; }
.c-inside { fill: #7c1f24; stroke: var(--line); stroke-width: 4.5; stroke-linejoin: round; }
.c-tongue { fill: #f08a86; }
.c-teeth { fill: #fff; }
.c-sweat { fill: #9fd8ee; stroke: var(--line); stroke-width: 3; display: none; }
.l-out { fill: none; stroke: var(--line); stroke-width: 31; stroke-linecap: round; stroke-linejoin: round; }
.l-out.l-cuff { stroke-width: 34; }
.l-in { fill: none; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.l-in.l-cuff, .l-cuff + .l-in { stroke-width: 25; }
.s-a { fill: #c88c61; } .s-b { fill: #f8d3b6; } .s-c { fill: #b87a50; } .s-d { fill: #e3ab84; }
.s-e { fill: #d4966a; } .s-f { fill: #c98e63; } .s-g { fill: #9c623e; } .s-h { fill: #bc7e52; }
.l-in.s-a { stroke: #c88c61; fill: none; } .l-in.s-b { stroke: #f8d3b6; fill: none; } .l-in.s-c { stroke: #b87a50; fill: none; } .l-in.s-d { stroke: #e3ab84; fill: none; }
.l-in.s-e { stroke: #d4966a; fill: none; } .l-in.s-f { stroke: #c98e63; fill: none; } .l-in.s-g { stroke: #9c623e; fill: none; } .l-in.s-h { stroke: #bc7e52; fill: none; }
.h-grey { fill: #b3bac4; } .h-white { fill: #f6f7f8; } .h-dark { fill: #55565f; }
.k-teal { fill: #2aa3b0; } .k-white { fill: #fdfcf8; } .k-yellow { fill: #f7cf4a; } .k-yellow-deep { fill: #e4b632; }
.k-sky { fill: #9fd0ee; } .k-rose { fill: #f49aa0; } .k-plum { fill: #9a5fa0; }
.k-coral { fill: #e77c5a; } .k-sage { fill: #76b08a; } .k-sage-deep { fill: #558f69; }
.k-amber { fill: #e09f41; } .k-lavender { fill: #b196d4; }
.k-cap { fill: #c4a478; } .k-cap-brim { fill: #9e7f56; }
.l-in.k-teal { stroke: #2aa3b0; fill: none; } .l-in.k-yellow { stroke: #f7cf4a; fill: none; } .l-in.k-sky { stroke: #9fd0ee; fill: none; } .l-in.k-rose { stroke: #f49aa0; fill: none; }
.l-in.k-coral { stroke: #e77c5a; fill: none; } .l-in.k-sage { stroke: #76b08a; fill: none; } .l-in.k-amber { stroke: #e09f41; fill: none; } .l-in.k-lavender { stroke: #b196d4; fill: none; }
.c-brow { stroke: var(--line); stroke-width: 3; stroke-linejoin: round; }
.b-grey { fill: #8d96a2; } .b-white { fill: #f6f7f8; } .b-dark { fill: #2a1a14; }

/* one drawing: four faces (mood-*) and ten arm poses (pose-*) */
.c-mouth > *, .c-eyes-happy, .c-pose { display: none; }
.mood-worried .m-worried, .mood-calm .m-calm, .mood-thinking .m-thinking, .mood-relieved .m-relieved,
.pose-explain .g-explain, .pose-cheek .g-cheek, .pose-chin .g-chin, .pose-cheer .g-cheer, .pose-phone .g-phone,
.pose-stop .g-stop, .pose-shrug .g-shrug, .pose-point .g-point, .pose-heart .g-heart, .pose-down .g-down { display: inline; }
.p-body { fill: #2f3440; stroke: var(--line); stroke-width: 4; }
.p-screen { fill: #dff3fb; }
.p-text { fill: none; stroke: #6b7a8c; stroke-width: 3; stroke-linecap: round; }
.mood-relieved .c-eyes-open { display: none; }
.mood-relieved .c-eyes-happy { display: inline; }
.mood-worried .c-sweat { display: inline; }
.c-brow, .c-mouth, .c-pupil { transform-box: fill-box; transform-origin: center; }
.mood-worried .c-brow-l { transform: rotate(-22deg) translateY(-3px); }
.mood-worried .c-brow-r { transform: rotate(22deg) translateY(-3px); }
.mood-worried .c-pupil { transform: translateY(3px) scale(0.85); }
.mood-thinking .c-brow-l { transform: rotate(8deg) translateY(2px); }
.mood-thinking .c-brow-r { transform: translateY(-7px) rotate(-6deg); }
.mood-thinking .c-pupil { transform: translate(6px, -8px); }
.mood-relieved .c-brow { transform: translateY(-6px); }

/* a line of the conversation: a speech bubble */
.line {
  position: relative; margin: var(--space-5) 0 0; padding: var(--space-4);
  background: #fff; color: var(--ink); border: 4px solid var(--line); border-radius: 26px;
  box-shadow: 0 4px 0 rgb(42 26 20 / 0.12);
}
.line::before {
  content: ''; position: absolute; top: -13px; left: 3rem; width: 20px; height: 20px;
  background: #fff; border-left: 4px solid var(--line); border-top: 4px solid var(--line); transform: rotate(45deg);
}
.line.from-b::before { left: auto; right: 3rem; }
.line p { margin: 0; max-width: none; }
.line .who { font-family: var(--font-display); font-weight: var(--weight-bold); color: var(--link); }
.line .say { font-size: var(--size-body-lg); }
.scene:not(.is-live) .line.from-a { margin-right: 8%; }
.scene:not(.is-live) .line.from-b { margin-left: 8%; }

/* with the script: one room; the bubble floats over the speaker's head */
.is-live .scene-set { overflow: hidden; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--wall); box-shadow: 0 6px 18px rgb(2 10 24 / 0.14); }
.is-live .scene-stage { order: 1; border: 0; border-radius: 0; background: none; }
.is-live .scene-steps { order: 0; display: flex; flex-direction: column; justify-content: flex-end; min-height: 11rem; padding: var(--space-4) var(--space-3) 0; }
.is-live .line { margin: 0 0 16px; }
.is-live .line::before {
  top: auto; bottom: -14px; left: 22%;
  border: 0; border-right: 4px solid var(--line); border-bottom: 4px solid var(--line);
}
.is-live .line.from-b::before { left: auto; right: 22%; }
/* the learner's turn and the ending sit under the picture, on paper */

.scene-end { margin-top: var(--space-6); }
.end-badge { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.end-badge .stamp { position: static; transform: rotate(-4deg); font-size: clamp(1.5rem, 6vw, 2rem); }
.end-badge h2 { margin: 0; }
.scene-end:focus-visible, .scene-ask:focus-visible { outline: 3px solid var(--focus-ring-offset); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-ring); }

/* Story-beat progress rail and controls */
.scene-controls { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-5); }
.scene-rail { display: flex; gap: 0.35rem; width: 100%; align-items: center; }
.rail-dot {
  flex: 1 1 0; height: 0.65rem; border-radius: 999px; background: var(--paper-cool);
  border: 2px solid var(--ink); transition: background-color 0.2s ease, transform 0.2s ease;
}
.rail-dot.rail-ask, .rail-dot.rail-look { height: 0.85rem; }
.rail-dot.is-done { background: var(--ink); }
.rail-dot.is-current { background: var(--marker); transform: scaleY(1.25); }
.rail-dot.is-branch { background: var(--no-wash); border-style: dashed; }
.scene-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; }
.scene-count { margin: 0; color: var(--ink-quiet); font-weight: var(--weight-bold); }

/* the narrator: where you are and what you see */
.narration { margin: var(--space-5) 0 0; padding: var(--space-3) var(--space-4); background: var(--marker-soft); border: 3px solid var(--line); border-radius: var(--radius); }
.narration p { margin: 0; max-width: none; font-size: var(--size-body-lg); font-style: italic; }
.is-live .narration { margin: 0 0 var(--space-4); }

/* a voice on the phone: no one in the room, so no tail */
.line.from-phone { background: var(--paper-cool); border-style: dashed; }
.line.from-phone::before { display: none; }
.line.from-phone .who::before { content: '\260E\00a0'; }
.scene:not(.is-live) .line.from-phone { margin-inline: 4%; }

.is-live .scene-look { margin-top: var(--space-6); }

/* Sort the mail: each message with its own Real or Scam choice */
.is-live .scene-sort { margin-top: var(--space-6); }
.sort-item { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 3px dashed var(--boundary); }
.sort-item:first-of-type { border-top: 0; padding-top: 0; }
.sort-pick.activity { margin: var(--space-3) 0 0; padding: var(--space-4) var(--space-3) var(--space-3); background: var(--paper); }
.sort-pick.activity::before { display: none; }
.sort-pick .act-kind { display: none; }
.sort-pick .choice-list { grid-template-columns: 1fr 1fr; }
.scene-sort:focus-visible { outline: 3px solid var(--focus-ring-offset); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-ring); }

/* Spot the difference: a genuine message above the one in question */
.spot-tag { margin: var(--space-4) 0 var(--space-2); font-family: var(--font-display); font-weight: var(--weight-bold); max-width: none; }
.spot-real { padding: var(--space-3); background: var(--ok-wash); border: 3px solid var(--ink); border-radius: var(--radius); }
.spot-real .spot-tag { margin-top: 0; }

/* Phone duty: the phone rings before the choice */
.phone-ring { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); max-width: none; background: var(--marker-soft); border: 3px solid var(--ink); border-radius: var(--radius); }
.phone-icon { display: inline-block; font-size: 2rem; line-height: 1; }
@media (prefers-reduced-motion: no-preference) { .is-live .phone-icon { animation: phone-shake 0.5s ease-in-out 6; } }
@keyframes phone-shake { 25% { transform: rotate(-16deg); } 75% { transform: rotate(16deg); } }

/* a branch: what happens next after a less helpful answer, then the way back */
.branch { display: none; margin-top: var(--space-4); }
.act-choice:has(input[value="0"]:checked) .br-0, .act-choice:has(input[value="1"]:checked) .br-1,
.act-choice:has(input[value="2"]:checked) .br-2, .act-choice:has(input[value="3"]:checked) .br-3,
.is-live .branch { display: block; }
.is-live .branch { margin-top: 0; }
.rewind { margin-top: var(--space-5); padding: var(--space-4); background: var(--no-wash); border: 3px dashed var(--ink); border-radius: var(--radius); }
.rewind p { margin: 0 0 var(--space-4); max-width: none; font-size: var(--size-body-lg); }
.rewind p:last-child { margin-bottom: 0; }
.rewind:focus-visible, .scene-look:focus-visible { outline: 3px solid var(--focus-ring-offset); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-ring); }

/* words that type themselves out: space is kept, so the bubble never jumps */
.is-live .line .word { visibility: hidden; }
.is-live .line .word.is-out { visibility: visible; }
.scene-sound { min-height: 2.75rem; padding-block: 0.3rem; font-size: var(--size-body); }

/* the town from above: a street grid drawn from data, with a figure who walks */
.town-hud { margin-top: var(--space-5); padding: var(--space-4); background: var(--paper-cool); border: 3px solid var(--ink); border-radius: var(--radius); }
.town-hud .town-count { margin: 0 0 var(--space-3); font-size: var(--size-h3); }
.town-tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(10.5rem, 100%), 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.town-token {
  display: flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.6rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  font-size: var(--size-fine); font-weight: var(--weight-bold);
}
.town-token.is-done { background: var(--ok-wash); }
.token-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.55rem; height: 1.55rem; border-radius: 50%; background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-size: 0.95rem;
}
.token-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-mark { flex: none; font-family: var(--font-display); font-weight: 800; color: var(--ink); }
.town-champion { margin-top: var(--space-6); transform: none; }
.town-champion h2 { margin-top: 0; font-size: var(--size-h2); }
.champion-rules { margin: var(--space-3) 0 0; padding-left: 1.3rem; }
.champion-rules li + li { margin-top: var(--space-2); }

.town-hint { margin-top: var(--space-4); }
.town-zoom { margin-bottom: var(--space-3); }
.town-view { overflow: auto; max-height: 78vh; border: 3px solid var(--ink); border-radius: var(--radius); background: #e9d6a8; overscroll-behavior: contain; box-shadow: inset 0 2px 8px rgb(42 26 20 / 0.15); }
/* when Phaser draws the town, its canvas takes the place of the plain map */
/* The town page is the one place the portal goes nearly full width, so the
   map is big enough to read. On a phone it leaves room to scroll past it. */
main:has(.town) { max-width: min(96vw, 100rem); }
.town-view.is-game { overflow: hidden; height: min(84vh, 56rem); max-height: none; background: #e9d6a8; }
@media (max-width: 40rem) { .town-view.is-game { height: 72vh; } }
.town-view.is-game .town-map { display: none; }
.town-view.is-game canvas { display: block; }
.town-view:focus-visible { outline: 3px solid var(--focus-ring-offset); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-ring); }
.town-map { display: block; width: max(100%, 66rem); height: auto; cursor: pointer; }
.town-view.is-whole .town-map { width: 100%; }
.m-ground { fill: #e9d6a8; }
.m-road-edge { fill: none; stroke: #9d8b6c; stroke-width: 66; }
.m-road { fill: none; stroke: #b9a888; stroke-width: 60; }
.m-road-line { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 14 14; opacity: 0.85; }
.m-cross { fill: none; stroke: #fff; stroke-width: 8; stroke-dasharray: 4 5; opacity: 0.65; }
.m-lot-curb { fill: #dfd0ad; }
.m-lot { fill: #f4e8c8; stroke: var(--line); stroke-width: 3; } .m-lot.m-green { fill: #cfe3a8; }
.m-path { fill: #d8c7a2; }
.m-tree { fill: #5fa55a; } .m-leaf { fill: #8fcf7e; } .m-palm { fill: #6fb565; } .m-trunk { fill: #7a4a2e; }
.m-cactus { fill: #4d9449; } .m-flower { fill: #f7cf4a; stroke: #c96a4b; stroke-width: 1.5; }
.m-water { fill: #9fd8ee; } .m-ripple { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 8 6; opacity: 0.7; }
.m-plaza { fill: #f1e2c2; } .m-bench { fill: #c98a6a; }
.m-label { font-family: var(--font-display); font-weight: 800; font-size: 23px; fill: var(--ink); stroke: #fff; stroke-width: 7; stroke-linejoin: round; paint-order: stroke; pointer-events: none; }
.m-small { font-size: 18px; }
.m-hit { fill: transparent; }
.m-stop:hover .m-hit, .m-stop:focus-visible .m-hit { fill: rgb(255 228 92 / 0.35); stroke: var(--ink); stroke-width: 5; }
.m-stop:focus-visible { outline: none; }
.m-later { opacity: 0.92; }
.m-done { fill: #2e8b57; stroke: var(--line); stroke-width: 3; } .m-tick { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.m-call-bg { fill: var(--marker); stroke: var(--line); stroke-width: 3; }
.m-call-mark { fill: none; stroke: var(--line); stroke-width: 4.5; stroke-linecap: round; }
.m-call-dot { fill: var(--line); }
.m-num-bg { fill: var(--ink); stroke: #fff; stroke-width: 2.5; }
.m-num { font-family: var(--font-display); font-weight: 800; font-size: 16px; fill: #fff; pointer-events: none; }
.m-footprint { fill: rgb(42 26 20 / 0.25); pointer-events: none; }
.m-body { fill: var(--pin); } .m-head { fill: #e3ab84; } .m-hat { fill: var(--marker); } .m-eye { fill: var(--line); } .m-shadow { fill: rgb(0 0 0 / 0.22); }
.m-you { pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .m-you.is-walking .m-fig { animation: town-step 0.26s ease-in-out infinite alternate; }
}
@keyframes town-step { to { transform: translateY(-6px); } }

/* the town: a road with houses to visit */
.town { --line: #2a1a14; }
.town-count { margin-top: var(--space-5); }
.town-road { position: relative; margin: var(--space-5) 0 0; padding: var(--space-4) 0 var(--space-4); list-style: none; display: grid; gap: var(--space-5); }
.town-road::before { /* the road, with a dashed centre line */
  content: ''; position: absolute; top: 0; bottom: 0; left: 1.75rem; width: 3.5rem; border-radius: 1.75rem;
  background: linear-gradient(90deg, transparent 46%, #fff 46% 54%, transparent 54%) 0 0 / 100% 2.2rem, #c9b28a;
  -webkit-mask: linear-gradient(#000, #000); border: 3px solid var(--line);
}
.stop { position: relative; display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--space-4); align-items: center; }
.stop-illus { position: relative; width: 7.5rem; }
.town-art { display: block; width: 7.5rem; height: auto; }
.stop-cameo {
  position: absolute; right: -0.35rem; bottom: -0.35rem; width: 3.2rem; height: 3.2rem;
  border-radius: 50%; background: var(--wall, #f6e6c6); border: 2.5px solid var(--ink); overflow: hidden;
  box-shadow: 0 2px 6px rgb(2 10 24 / 0.25);
}
.stop-cameo svg { display: block; width: 100%; height: 135%; transform: translateY(4%); }
.stop-cameo .c-pose { display: none !important; }
.stop-cameo .m-calm { display: inline; }
.t-line { stroke: var(--line); stroke-width: 4; stroke-linejoin: round; }
.t-roof { fill: #b9553f; } .t-roof-shade { fill: rgb(42 26 20 / 0.15); }
.t-roof-tile { fill: none; stroke: rgb(42 26 20 / 0.25); stroke-width: 2; stroke-linecap: round; }
.t-chimney { fill: #c98a6a; } .t-door { fill: #7a4a2e; } .t-step { fill: #c4b59b; }
.t-knob { fill: var(--marker); } .t-pane { fill: #dff3fb; }
.t-pane-cross { fill: none; stroke: var(--line); stroke-width: 2; }
.t-box { fill: #c96a4b; } .t-pediment { fill: #c8d1dc; } .t-clock { fill: #fffaf0; }
.hs-teal { fill: #2aa3b0; } .hs-sky { fill: #9fd0ee; } .hs-yellow { fill: #f7cf4a; } .hs-rose { fill: #f49aa0; }
.hs-coral { fill: #e77c5a; } .hs-sage { fill: #76b08a; } .hs-amber { fill: #e09f41; } .hs-lavender { fill: #b196d4; }
.t-soon { fill: #d9dee5; } .t-soon-deep { fill: #b9c1cc; }
.stop-text { padding: var(--space-4); background: var(--paper-cool); border: 3px solid var(--ink); border-radius: var(--radius); }
.stop-head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-1); }
.stop-order { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--size-body); color: var(--ink-quiet); }
.stop-text h2, .stop-text h3 { margin: 0 0 var(--space-2); font-size: var(--size-h3); }
.stop-text p { margin: 0 0 var(--space-3); max-width: none; }
.stop-rule { padding: var(--space-2) var(--space-3); background: var(--paper); border-left: 4px solid var(--ink); border-radius: 2px; font-size: var(--size-body); }
.need-mark { color: var(--ink); font-weight: var(--weight-bold); }
.stop-soon .stop-text { background: var(--paper); border-style: dashed; }
.stop-soon .stop-text p { margin: 0; }
.stop.is-visited .stop-text { background: var(--ok-wash); }
.town-more { margin-top: var(--space-7); font-size: var(--size-h3); }
@media (max-width: 24rem) {
  .stop { grid-template-columns: 5.25rem 1fr; gap: var(--space-3); }
  .stop-illus, .town-art { width: 5.25rem; }
  .stop-cameo { width: 2.35rem; height: 2.35rem; }
  .town-road::before { left: 0.75rem; }
}

@media (prefers-reduced-motion: no-preference) {
  /* the speaker's mouth moves for about two seconds, then rests */
  .is-live .actor.is-talking .c-mouth { animation: scene-talk 0.42s ease-in-out 5; }
  .is-live .line { animation: scene-pop 0.18s ease-out; transform-origin: 50% 100%; }
}
@media (prefers-reduced-motion: reduce) { .is-live .actor { transition: none; } }
@keyframes scene-talk { 50% { transform: scaleY(0.45); } }
/* movement only: the words are at full contrast from the first frame */
@keyframes scene-pop { from { transform: scale(0.94); } }
@media print { .scene-controls, .town-hud { display: none; } }

/* ---------- The scene as one game screen ----------
   With the script, the picture, the speech and the questions all live inside
   one frame of a fixed size, and the buttons sit under it. Nothing grows or
   shrinks from step to step, so Continue stays where it is and the page never
   has to scroll. Long things (a message to read, mail to sort) scroll inside
   the frame. */
.is-live .scene-set {
  position: relative; display: block; overflow: hidden; scroll-margin-top: 0.5rem;
  height: clamp(24rem, calc(100svh - 13rem), 48rem);
  border: 3px solid var(--ink); border-radius: var(--radius); background: var(--wall);
}
.is-live .scene-stage { position: absolute; inset: 0; height: auto; border: 0; border-radius: 0; background: var(--wall); }
/* the plain drawings, when PixiJS is not painting: kept clear of the edges so
   an arm held out is not cut off */
.is-live .actor { height: min(46%, 20rem, 52vw); }
.is-live .actor-a { left: 5%; } .is-live .actor-b { right: 5%; }
.scene:not(.is-live) .actor-a { left: 5%; } .scene:not(.is-live) .actor-b { right: 5%; }
.is-live .scene-steps {
  position: absolute; inset: 0; order: 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start;
  padding: var(--space-3); overflow-y: auto; overscroll-behavior: contain; pointer-events: none; background: none; border: 0;
}
.is-live .scene-steps > * { flex: none; pointer-events: auto; }
.is-live .line { margin: 0; width: min(100%, 34rem); box-shadow: 0 6px 0 rgb(0 0 0 / 0.12); }
.is-live .line.from-a { align-self: flex-start; } .is-live .line.from-b { align-self: flex-end; } .is-live .line.from-phone { align-self: center; }
.is-live .narration { margin: 0; align-self: center; width: min(100%, 34rem); box-shadow: 0 6px 0 rgb(0 0 0 / 0.12); }
/* questions, messages and endings are panels laid over the picture */
.is-live .scene-ask, .is-live .scene-look, .is-live .scene-sort, .is-live .scene-end, .is-live .rewind {
  margin: 0 auto; width: min(100%, 38rem); background: rgb(255 255 255 / 0.96); border: 4px solid var(--line); border-radius: 18px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.28);
}
.is-live .scene-end, .is-live .rewind { padding: var(--space-4); }
.is-live .scene-ask::before, .is-live .scene-look::before, .is-live .scene-sort::before { display: none; }
.is-live .scene-ask .act-kind, .is-live .scene-look .act-kind, .is-live .scene-sort .act-kind { border-radius: 14px 0 14px 0; background: var(--line); }
/* each answer is a big card with a letter on it; the whole card is the button */
.is-live .scene-ask .choice-list { counter-reset: answer; gap: var(--space-3); }
.is-live .scene-ask .choice-opt {
  position: relative; align-items: center; min-height: 4rem; padding: var(--space-3) var(--space-4) var(--space-3) 4rem;
  border: 4px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 5px 0 var(--line); font-weight: 600;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.is-live .scene-ask .choice-opt::before {
  counter-increment: answer; content: counter(answer, upper-alpha); position: absolute; left: 0.8rem; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 3px solid var(--line); border-radius: 50%;
  background: var(--marker); font-family: var(--font-display); font-weight: 800;
}
.is-live .scene-ask .choice-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.is-live .scene-ask .choice-opt:hover { background: var(--marker-soft); }
.is-live .scene-ask .choice-opt:active, .is-live .scene-ask .choice-opt:has(input:checked) { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.is-live .scene-ask .choice-opt:has(input:focus-visible) { outline: 3px solid var(--focus-ring-offset); outline-offset: 2px; }
.is-live .scene-ask .choice-opt.is-right:has(input:checked) { background: var(--ok-wash); }
.is-live .scene-ask .choice-opt.is-right:has(input:checked)::before { content: '\2713'; background: #2e8b57; color: #fff; }
.is-live .scene-ask .choice-opt.is-wrong:has(input:checked) { background: var(--no-wash); border-style: dashed; }
.is-live .sort-pick .choice-opt { padding-left: var(--space-4); min-height: 3.25rem; box-shadow: none; }
.is-live .sort-pick .choice-opt::before { display: none; }
/* the buttons keep their places even when one is not needed */
.scene .scene-controls [data-next][hidden], .scene .scene-controls [data-back][hidden] { display: inline-flex !important; visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .is-live .scene-ask, .is-live .scene-look, .is-live .scene-sort, .is-live .rewind, .is-live .scene-end { animation: scene-pop 0.2s ease-out; transform-origin: 50% 0; }
}

/* ---------- Accounts: sign-in, setup, the dashboard strip and /admin ---------- */
.account-bar { background: var(--board-deep); border-bottom: 2px dashed rgb(201 214 230 / 0.5); }
.account-inner {
  max-width: var(--board-width); margin: 0 auto; padding: var(--space-2) var(--space-4);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2) var(--space-4);
}
.account-inner form { margin: 0; }
.account-who { margin: 0; max-width: none; color: var(--ink-on-board-quiet); }
.account-who strong { color: var(--ink-on-board); }
.account-link {
  display: inline-flex; align-items: center; min-height: var(--target-min); padding: 0 var(--space-3);
  background: none; border: 0; border-radius: var(--radius); color: var(--lit);
  font: inherit; font-weight: var(--weight-bold); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 2px; cursor: pointer;
}
.account-link:hover { background: var(--board); }

/* Where you left off: a count and a way back, under the dashboard's hero. */
.points { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-5); padding-bottom: var(--space-5); border-bottom: 2px dashed var(--boundary); }
.points-tally { display: flex; align-items: center; gap: var(--space-3); margin: 0; font-weight: var(--weight-bold); }
.points-number { min-width: 4.25rem; padding: 0.1rem 0.8rem; background: var(--marker); border-radius: 2px; box-shadow: var(--sheet-shadow); transform: rotate(-2deg); font-family: var(--font-display); font-size: var(--size-h1); line-height: 1.2; text-align: center; }
.points-rule { flex: 1 1 16rem; margin: 0; color: var(--ink-quiet); }
.group-points { margin-top: var(--space-5); }
.progress-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--space-5); }
.progress-row h3 { margin-bottom: var(--space-2); }
.progress-row p { margin-bottom: var(--space-3); font-weight: var(--weight-bold); }
.progress-note { margin: var(--space-5) 0 0; color: var(--ink-quiet); }
.section-done { display: inline-block; margin-left: var(--space-2); padding: 0 0.6rem; background: var(--ok-wash); border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); font-size: var(--size-fine); }

.account-form { margin-top: var(--space-5); max-width: 28rem; }
.field + .field { margin-top: var(--space-5); }
.field label { display: block; font-weight: var(--weight-bold); font-size: var(--size-body-lg); }
.field-hint { margin: var(--space-1) 0 0; color: var(--ink-quiet); }
.field input {
  display: block; width: 100%; min-height: 3.25rem; margin-top: var(--space-2); padding: 0.5rem 0.75rem;
  background: var(--paper); color: var(--ink); border: var(--border-width) solid var(--ink); border-radius: var(--radius);
  font: inherit; font-size: var(--size-body-lg);
}
.field-small input { max-width: 8rem; }
.form-error { margin: var(--space-5) 0 0; padding: var(--space-3) var(--space-4); max-width: 28rem; background: var(--no-wash); border-left: 6px solid var(--flag); border-radius: var(--radius); }
.form-note { padding: var(--space-3) var(--space-4); max-width: 28rem; background: var(--ok-wash); border-radius: var(--radius); }
.form-aside { margin: var(--space-5) 0 0; color: var(--ink-quiet); }
.form-aside + .form-aside { margin-top: var(--space-3); }

.table-scroll { margin-top: var(--space-5); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: var(--space-3); border-bottom: 2px dashed var(--boundary); text-align: left; vertical-align: top; }
.admin-table thead th { border-bottom: 3px solid var(--ink); font-size: var(--size-fine); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: var(--weight-bold); letter-spacing: 0.04em; white-space: nowrap; }
.state { display: inline-block; padding: 0 0.5rem; border: 2px solid var(--ink); border-radius: 999px; font-size: var(--size-fine); font-weight: var(--weight-bold); }
.state-ready { background: var(--ok-wash); }
.row-options summary { min-height: var(--target-min); display: inline-flex; align-items: center; color: var(--link); font-weight: var(--weight-bold); text-decoration: underline; cursor: pointer; }
.row-options form { margin: var(--space-2) 0 0; }
.group-remove { margin-top: var(--space-6); }
.row-options .button { min-height: var(--target-min); font-size: var(--size-fine); }

/* The cards: two across on paper, cut along the dashed lines. */
.setup-cards { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0; }
.setup-card { padding: var(--space-4); border: 2px dashed var(--boundary); break-inside: avoid; }
.setup-card p, .setup-card ol { max-width: none; }
.card-brand { margin: 0 0 var(--space-2); font-family: var(--font-display); font-weight: var(--weight-bold); }
.setup-card dl { margin: 0 0 var(--space-3); }
.setup-card dt { font-size: var(--size-fine); color: var(--ink-quiet); }
.setup-card dd { margin: 0 0 var(--space-2); font-size: var(--size-h2); line-height: 1.2; }
.setup-card ol { margin: 0 0 var(--space-1); padding-left: 1.4em; }
.card-keep { margin: 0 0 var(--space-3); color: var(--ink-quiet); }
@media print {
  .account-bar, .cards-sheet h1 { display: none; }
  .cards-sheet { padding: 0; }
  .setup-cards { grid-template-columns: 1fr 1fr; margin-top: 0; }
  .setup-card { border-color: #000; }
  .setup-card dt, .card-keep { color: #000; }
}
