/* ═══════════════════════════════════════════════════════════════════════════
   MoonMitten
   A night-lit page for a grown-up who is about to have a hard conversation.
   The warmth lives in the artwork; the interface stays quiet around it.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* The page is lit by one warm source, so shadows go violet and highlights gold. */
  --ink: #10143a;
  --ink-deep: #0a0d28;
  --ink-soft: #1b2150;
  --ink-line: #2b3468;

  --wool: #f6efe2;
  --wool-deep: #ebdfc9;
  --wool-line: #ddcfb5;

  --moon: #f3c46a;
  --rose: #e8836f;
  /* Between the moon and the rose: running low is a warning, not a failure. */
  --amber: #e0a24d;
  --sage: #8fb6a4;

  --on-night: #f6efe2;
  --on-night-soft: #b9bedd;
  --on-day: #171a35;
  --on-day-soft: #55597c;

  --display: 'Petrona', Georgia, 'Times New Roman', serif;
  --body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.4vw, 1.42rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.75vw, 1.95rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.5vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.7rem + 2.9vw, 4.4rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --band: clamp(4rem, 9vw, 8rem);
  --radius: 1.25rem;
  --radius-sm: 0.7rem;

  --ease: cubic-bezier(0.32, 0.72, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

/* Same-origin navigations cross-fade instead of flashing; the glass bar keeps
   its own name so it holds still while the page changes beneath it. Browsers
   without view transitions simply navigate as before. */
@view-transition { navigation: auto; }

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--on-day);
  background: var(--wool);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

/* A class that sets `display` outranks the hidden attribute's UA rule, which
   would leave the progress overlay and the photo preview permanently on screen. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -3rem; left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--moon);
  color: var(--ink-deep);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--moon);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─── Value bands ──────────────────────────────────────────────────────────
   The page walks through a night: it opens dark, lightens for the practical
   middle, and returns to dark for the safeguards and the closing. */

.night {
  background: var(--ink);
  color: var(--on-night);
}
/* The bar sits above the first band, so the page itself must start dark or the
   cream nav text lands on the cream body. */
.page-landing { background: var(--ink); }
.night-deep { background: var(--ink-deep); }
.day {
  background: var(--wool);
  color: var(--on-day);
}

.wrap {
  width: min(72rem, 100% - var(--gutter) * 2);
  margin-inline: auto;
}
.wrap-narrow { width: min(46rem, 100% - var(--gutter) * 2); }

/* ─── The running stitch ───────────────────────────────────────────────────
   Knitwear is the brand's material, so rules are sewn rather than drawn. */

.stitch {
  height: 2px;
  margin-block: clamp(2rem, 5vw, 3.5rem);
  background-image: linear-gradient(90deg, currentColor 0 14px, transparent 14px 26px);
  background-size: 26px 2px;
  opacity: 0.28;
}

/* ─── Type ─────────────────────────────────────────────────────────────────*/

.eyebrow {
  margin: 0 0 1rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-day-soft);
}
.eyebrow-light { color: var(--moon); }

.section-title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.section-lead {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  max-width: 44ch;
  font-size: var(--step-1);
  color: var(--on-day-soft);
}
.night .section-lead { color: var(--on-night-soft); }

.section-body {
  margin: 0;
  max-width: 46ch;
  color: var(--on-day-soft);
}

.page-title {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.1;
}
.page-lead {
  margin: 0;
  color: var(--on-night-soft);
  max-width: 46ch;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────*/

.button {
  --button-bg: transparent;
  --button-fg: currentColor;
  --button-border: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1.5px solid var(--button-border);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-fg);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  /* Double-tap zoom would add ~300ms before every press registers. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
    color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.button:hover { transform: translateY(-1px); }
/* The scale is the only press feedback on touch, where there is no hover lift
   to undo — kept at 0.98 so it stays under the perception threshold. The press
   itself lands faster than the release: feedback belongs on the way down. */
.button:active { transform: translateY(0) scale(0.98); transition-duration: 0.1s; }

.button-primary {
  --button-bg: var(--moon);
  --button-fg: var(--ink-deep);
  --button-border: var(--moon);
}
.button-primary:hover { --button-bg: #f8d492; --button-border: #f8d492; }

.button-quiet {
  --button-border: color-mix(in srgb, currentColor 35%, transparent);
}
.button-quiet:hover {
  --button-bg: color-mix(in srgb, currentColor 10%, transparent);
  --button-border: color-mix(in srgb, currentColor 55%, transparent);
}

.button-danger { --button-border: color-mix(in srgb, var(--rose) 55%, transparent); color: var(--rose); }
.button-danger:hover { --button-bg: color-mix(in srgb, var(--rose) 14%, transparent); }

.button-small { padding: 0.5rem 1rem; font-size: var(--step--1); }
.button-large { padding: 1rem 2rem; font-size: var(--step-1); }
.button-block { width: 100%; }
.button.is-on { --button-bg: var(--moon); --button-fg: var(--ink-deep); --button-border: var(--moon); }

/* ─── Top bar ──────────────────────────────────────────────────────────────
   The bar is glass: the page scrolls beneath it and stays faintly visible, so
   the chrome reads as a floating material rather than a wall. Every page opens
   on ink, so the tint holds whichever band is passing under it. */

.topbar-shell {
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  view-transition-name: topbar;
}
/* On a phone the nav wraps to several rows; pinning those would spend too much
   of the viewport on chrome. */
@media (min-width: 52rem) {
  .topbar-shell { position: sticky; top: 0; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar-shell { background: var(--ink); }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar-shell {
    background: var(--ink);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-contrast: more) {
  .topbar-shell {
    background: var(--ink-deep);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: 1px solid var(--on-night);
  }
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  width: min(72rem, 100% - var(--gutter) * 2);
  margin-inline: auto;
  padding-block: 0.9rem;
  color: var(--on-night);
}
.page-reader .topbar,
.page-shelf .topbar { color: var(--on-night); }

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}
.brandmark-word {
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brandmark-icon { width: 2.4rem; height: 2.4rem; display: block; }

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.35rem;
  align-items: center;
  font-size: var(--step--1);
  font-weight: 500;
}
.topnav-link {
  color: color-mix(in srgb, currentColor 78%, transparent);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1.5px solid transparent;
}
.topnav-link:hover { color: currentColor; }
.topnav-link.is-current { color: currentColor; border-bottom-color: var(--moon); }
.topnav-lang { font-variant-caps: all-small-caps; letter-spacing: 0.06em; }

/* ─── Hero ─────────────────────────────────────────────────────────────────
   The one place the page raises its voice. */

.hero { padding-block: clamp(2.5rem, 6vw, 5rem) 0; }

.hero-wrap {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 62rem) {
  .hero-wrap { grid-template-columns: 1.05fr 0.95fr; }
}

.hero-title {
  margin: 0 0 1.4rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero-lead {
  margin: 0 0 2.2rem;
  max-width: 40ch;
  font-size: var(--step-1);
  color: var(--on-night-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.4rem;
  align-items: center;
}
.hero-note {
  margin: 0;
  font-size: var(--step--1);
  color: color-mix(in srgb, var(--on-night-soft) 82%, transparent);
}

.hero-art {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  /* Lamplight from the artwork spilling onto the page. */
  box-shadow: 0 2rem 5rem -1.5rem rgba(243, 196, 106, 0.28),
    0 1rem 3rem -1rem rgba(0, 0, 0, 0.55);
}
.hero-art img { width: 100%; }

/* ─── The transformation device ────────────────────────────────────────────
   The signature. What a parent types, becoming what a child hears. */

.transform { padding-block: var(--band); }

.device {
  position: relative;
  margin-top: 0.5rem;
}

.pairs {
  display: grid;
  /* All four pairs share one cell so they can crossfade. Without an explicit
     minmax the track is sized to max-content and pushes past the viewport. */
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pair {
  grid-area: 1 / 1;
  min-width: 0;
  display: grid;
  gap: 1rem;
  align-items: stretch;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.6rem);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), visibility 0.55s;
}
.pair.is-active { opacity: 1; visibility: visible; transform: none; }

@media (min-width: 48rem) {
  /* The output side is given more room — it is the thing worth reading. */
  .pair { grid-template-columns: 0.82fr auto 1.18fr; gap: 0; }
}

.pair-side {
  min-width: 0;
  padding: clamp(1.4rem, 3vw, 2.1rem);
  border-radius: var(--radius);
  border: 1px solid var(--ink-line);
  background: color-mix(in srgb, var(--ink-soft) 55%, transparent);
}
.pair-out {
  border-color: color-mix(in srgb, var(--moon) 38%, transparent);
  background: color-mix(in srgb, var(--moon) 8%, var(--ink-soft));
}

.pair-label {
  margin: 0 0 0.8rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-night-soft);
}
.pair-out .pair-label { color: var(--moon); }

.pair-text {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.5;
}
.pair-in .pair-text {
  color: var(--on-night-soft);
  font-style: italic;
}
.pair-out .pair-text {
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.34;
  color: var(--on-night);
}

/* The thread that carries one side into the other. */
.pair-thread {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding-inline: 1.1rem;
}
.pair-thread::before {
  content: '';
  position: absolute;
  inset-inline: 0.4rem;
  height: 2px;
  background-image: linear-gradient(90deg, var(--ink-line) 0 9px, transparent 9px 17px);
  background-size: 17px 2px;
}
.pair-thread span {
  position: relative;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--moon) 16%, transparent);
}
@media (max-width: 47.99rem) {
  .pair-thread { min-height: 1.8rem; }
  .pair-thread::before {
    inset-inline: auto;
    inset-block: 0.2rem;
    width: 2px; height: auto;
    background-image: linear-gradient(180deg, var(--ink-line) 0 9px, transparent 9px 17px);
    background-size: 2px 17px;
  }
}

.device-controls {
  display: flex;
  justify-content: center;
  margin-top: 1.8rem;
}
.dots { display: flex; gap: 0.55rem; }
.dot {
  width: 2.2rem;
  height: 0.4rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ink-line);
  cursor: pointer;
  transition: background-color 0.25s var(--ease);
}
.dot:hover { background: color-mix(in srgb, var(--moon) 50%, var(--ink-line)); }
.dot.is-active { background: var(--moon); }

/* ─── Steps ────────────────────────────────────────────────────────────────
   These are a real sequence, so a thread runs through them. */

.steps { padding-block: var(--band); }

.steps-list {
  display: grid;
  gap: clamp(2.5rem, 5vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
@media (min-width: 52rem) {
  .steps-list { grid-template-columns: repeat(3, 1fr); }
}

.step { position: relative; }

/* The thread linking one step to the next. */
@media (min-width: 52rem) {
  .step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 5rem;
    left: calc(100% + 0.4rem);
    width: clamp(2rem, 5vw, 3rem);
    height: 2px;
    background-image: linear-gradient(90deg, var(--wool-line) 0 8px, transparent 8px 16px);
    background-size: 16px 2px;
    transform: translateX(-50%);
  }
}

.step-art {
  margin-bottom: 1.3rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--wool-deep);
  aspect-ratio: 4 / 3;
}
.step-art img { width: 100%; height: 100%; object-fit: cover; }

.step-title {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.15;
}
.step-body { margin: 0; color: var(--on-day-soft); }

/* ─── Companion ────────────────────────────────────────────────────────────*/

.companion { padding-bottom: var(--band); }
.companion .stitch { color: var(--on-day); }

.companion-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 58rem) {
  .companion-grid { grid-template-columns: 0.9fr 1.1fr; }
}

.companion-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
  margin: 0;
}

.companion-shot { margin: 0; }
.companion-shot img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}
.companion-shot-before img {
  border: 1px solid var(--wool-line);
  filter: saturate(0.92);
}
.companion-shot-after img {
  box-shadow: 0 1.2rem 2.5rem -1rem rgba(16, 20, 58, 0.3);
}
.companion-shot figcaption {
  margin-top: 0.7rem;
  font-size: var(--step--1);
  color: var(--on-day-soft);
  text-align: center;
}

.companion-arrow {
  position: relative;
  width: 2.2rem;
  height: 2px;
  background-image: linear-gradient(90deg, var(--wool-line) 0 7px, transparent 7px 14px);
  background-size: 14px 2px;
  align-self: center;
  margin-bottom: 2rem;
}
.companion-arrow::after {
  content: '';
  position: absolute;
  right: -1px; top: 50%;
  width: 0.5rem; height: 0.5rem;
  border-top: 2px solid var(--wool-line);
  border-right: 2px solid var(--wool-line);
  transform: translateY(-50%) rotate(45deg);
}

/* ─── The front door ───────────────────────────────────────────────────────
   The first thing a visitor sees: choose home or school, then land on the
   matching page. Each door also offers a shortcut straight into the studio. */

.choose {
  padding-block: clamp(2rem, 6vw, 4rem) var(--band);
  text-align: center;
}
.choose-title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.1;
}
.choose-lead {
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  max-width: 52ch;
  color: var(--on-night-soft);
  font-size: var(--step-1);
}

.doors {
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  text-align: left;
}
@media (min-width: 52rem) {
  .doors { grid-template-columns: 1fr 1fr; }
}

.door {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  justify-items: start;
  padding: clamp(1.1rem, 2.5vw, 1.6rem);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 38%, transparent);
  transition: border-color 0.25s var(--ease);
}
.door:hover { border-color: color-mix(in srgb, var(--moon) 45%, var(--ink-line)); }

.door-art {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ink-deep);
}
.door-art img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}
.door:hover .door-art img { transform: scale(1.03); }

.door-title {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.15;
}
.door-body { margin: 0; color: var(--on-night-soft); }
.door-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.3rem;
  margin-top: 0.5rem;
}
.door-start {
  color: var(--moon);
  font-size: var(--step--1);
  text-underline-offset: 0.2em;
}

/* The write-now button, made impossible to miss. */
.button-glow {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--moon) 45%, transparent),
    0 0.6rem 2.2rem -0.6rem color-mix(in srgb, var(--moon) 65%, transparent);
}
.button-glow:hover {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--moon) 65%, transparent),
    0 0.8rem 2.6rem -0.6rem color-mix(in srgb, var(--moon) 80%, transparent);
}

.cta-band {
  padding-bottom: var(--band);
  text-align: center;
}

.topnav-cta { margin-inline-start: 0.3rem; }

/* ─── At home and at school ────────────────────────────────────────────────
   Two doors into the studio: the family one and the classroom one. */

.audiences { padding-bottom: var(--band); }

.audiences-grid {
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  align-items: stretch;
}
@media (min-width: 52rem) {
  .audiences-grid { grid-template-columns: 1fr 1fr; }
}

.audience {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  justify-items: start;
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  border-radius: var(--radius);
  border: 1px solid var(--wool-line);
  background: var(--wool-deep);
}
.audience-classroom {
  border-color: color-mix(in srgb, var(--moon) 45%, var(--wool-line));
}
.audience-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.15;
}
.audience-body { margin: 0; color: var(--on-day-soft); }
.audience-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  color: var(--on-day-soft);
  font-size: var(--step--1);
}
.audience-points li {
  position: relative;
  padding-left: 1.1rem;
}
.audience-points li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.5em;
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--moon);
}
.audience .button { margin-top: 0.4rem; align-self: end; }

/* ─── Bilingual band ───────────────────────────────────────────────────────*/

.bilingual { padding-bottom: var(--band); }
.bilingual-inner {
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding: clamp(1.8rem, 4vw, 2.8rem);
  border-radius: var(--radius);
  background: var(--wool-deep);
  border: 1px solid var(--wool-line);
}
.bilingual-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.15;
}
.bilingual-body { margin: 0; max-width: 58ch; color: var(--on-day-soft); }

/* ─── Safeguards ───────────────────────────────────────────────────────────
   The most serious section on the page, so it is the plainest. */

.safeguards { padding-block: var(--band); }

.guards {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink-line);
}
.guard {
  display: grid;
  gap: 0.4rem 2.5rem;
  padding-block: clamp(1.4rem, 3vw, 2rem);
  border-bottom: 1px solid var(--ink-line);
}
@media (min-width: 52rem) {
  .guard { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
}

.guard-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.25;
  color: var(--on-night);
}
.guard-body { margin: 0; color: var(--on-night-soft); }

/* ─── Closing ──────────────────────────────────────────────────────────────*/

.closing {
  padding-bottom: var(--band);
  text-align: center;
}
.closing-title {
  margin: 0 0 0.8rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.1;
}
.closing-body {
  margin: 0 auto 2rem;
  max-width: 44ch;
  color: var(--on-night-soft);
  font-size: var(--step-1);
}

/* ─── Footer ───────────────────────────────────────────────────────────────*/

.sitefoot {
  background: var(--ink-deep);
  color: var(--on-night-soft);
  padding-bottom: 3rem;
  font-size: var(--step--1);
}
.sitefoot .stitch { color: var(--on-night); margin-top: 0; }
.sitefoot-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}
@media (min-width: 52rem) {
  .sitefoot-grid { grid-template-columns: auto 1fr 1fr; gap: 2.5rem; }
}
.sitefoot-brand { display: block; }
.sitefoot-logo { display: block; width: min(13rem, 100%); height: auto; }
.sitefoot-note { margin: 0; max-width: 44ch; }
.sitefoot-credits { margin: 2rem 0 0; }
.sitefoot-credits a {
  color: var(--on-night);
  text-decoration-color: var(--on-night-soft);
  text-underline-offset: 0.2em;
}
.sitefoot-credits a:hover { text-decoration-color: currentColor; }

/* ─── Sign in ──────────────────────────────────────────────────────────────*/

.page-gate { background: var(--ink); color: var(--on-night); min-height: 100vh; }
.gate {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 8vh, 6rem) var(--gutter);
}
.gate-card {
  width: min(26rem, 100%);
  padding: clamp(1.8rem, 5vw, 2.8rem);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 55%, transparent);
  text-align: center;
}
.gate-mark { width: 3rem; height: 3rem; margin: 0 auto 1.2rem; color: var(--on-night); }
.gate-title {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-2);
}
.gate-lead { margin: 0 0 1.8rem; color: var(--on-night-soft); font-size: var(--step--1); }
.gate-form { display: grid; gap: 1.1rem; text-align: left; }

/* ─── Forms ────────────────────────────────────────────────────────────────*/

.field { display: grid; gap: 0.4rem; }
.field-label { font-size: var(--step--1); font-weight: 600; }
.field-hint { font-size: var(--step--1); color: var(--on-night-soft); }
.day .field-hint { color: var(--on-day-soft); }
.field-error { margin: 0; color: var(--rose); font-size: var(--step--1); }

/* What this subject usually wants, said while the choice is still free. It is
   advice and not an error, so it sits at the weight of a hint with the fix
   beside it rather than dressed up as a warning. */
.length-advice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0.55rem 0 0;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.day .length-advice { color: var(--on-day-soft); }

.input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-deep) 55%, transparent);
  color: var(--on-night);
  font: inherit;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.input:hover { border-color: color-mix(in srgb, var(--moon) 30%, var(--ink-line)); }
.input:focus { border-color: var(--moon); outline: none; background: var(--ink-deep); }
.input::placeholder { color: color-mix(in srgb, var(--on-night-soft) 65%, transparent); }
.textarea { resize: vertical; min-height: 8rem; line-height: 1.55; }

select.input {
  appearance: none;
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 1.05rem center, right 0.75rem center;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

.studio { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.studio-head { margin-bottom: clamp(2rem, 4vw, 3rem); }

.form { display: grid; gap: clamp(1.8rem, 3.5vw, 2.6rem); }

.fieldset {
  margin: 0;
  padding: clamp(1.3rem, 3vw, 1.9rem);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 38%, transparent);
  display: grid;
  gap: 1.2rem;
}
.legend {
  padding-inline: 0.6rem;
  margin-inline-start: -0.6rem;
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 600;
}

.field-row {
  display: grid;
  gap: 1.2rem;
}
@media (min-width: 34rem) {
  .field-row { grid-template-columns: 1fr auto auto; align-items: start; }
  .field-narrow { min-width: 7rem; }
}

/* A short value does not need the full column; the hint below still gets it. */
.field-compact .input { max-width: 12rem; }

.choices { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.choice:hover { border-color: color-mix(in srgb, var(--moon) 40%, var(--ink-line)); }
.choice:has(input:checked) {
  border-color: var(--moon);
  background: color-mix(in srgb, var(--moon) 12%, transparent);
}
.choice input { accent-color: var(--moon); }

/* A single pill rather than a row of them, so it takes its own width instead
   of stretching across the field the way a group would. */
.choice-inline { align-self: start; width: fit-content; }
.voice-choice { gap: 0.55rem; }

/* A choice that changes the shape of the story earns more than a pill. */
.choices-stacked { flex-direction: column; align-items: stretch; }
.choice-rich {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
}
.choice-rich input { margin-top: 0.3rem; flex: none; }
.choice-body { display: grid; gap: 0.15rem; }
.choice-title { font-weight: 600; }
.choice-hint { font-size: var(--step--1); color: var(--on-night-soft); }

.tag {
  display: inline-block;
  margin-inline-start: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-night-soft);
  vertical-align: 0.15em;
}

.upload {
  display: grid;
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem;
  border: 1.5px dashed var(--ink-line);
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.upload.is-dragging { border-color: var(--moon); background: color-mix(in srgb, var(--moon) 8%, transparent); }
.upload.has-file { border-style: solid; }
@media (min-width: 34rem) {
  .upload.has-file { grid-template-columns: auto 1fr; }
}

.upload-preview { width: 8rem; }
.upload-preview img {
  width: 8rem; height: 8rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.upload-label { margin: 0 0 0.25rem; font-weight: 600; }
.upload-hint { margin: 0 0 0.9rem; font-size: var(--step--1); color: var(--on-night-soft); }

/* Classroom mode: the age range sits as one control, the grade beside it. */
@media (min-width: 34rem) {
  .field-row-class { grid-template-columns: auto 1fr; }
}
.age-range {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.age-range .input { width: auto; min-width: 4.6rem; }
.age-range-to { color: var(--on-night-soft); font-size: var(--step--1); }

.textarea-short { min-height: 5rem; }

/* Photos of the school: small tiles, each with its own way out. */
.place-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}
.place-preview { position: relative; }
.place-preview img {
  display: block;
  width: 6.5rem; height: 6.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.place-remove {
  position: absolute;
  top: -0.5rem; right: -0.5rem;
  width: 1.5rem; height: 1.5rem;
  padding: 0;
  border: 1px solid var(--ink-line);
  border-radius: 50%;
  background: var(--ink-deep);
  color: var(--on-night);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.place-remove:hover { border-color: var(--moon); }

/* Only the tile that was just added enters; the others are rebuilt in place
   and re-animating them would make one upload look like three. */
.upload-preview.is-new,
.place-preview.is-new {
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
@starting-style {
  .upload-preview.is-new,
  .place-preview.is-new { opacity: 0; transform: scale(0.95); }
}

.form-error {
  margin: 0;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--rose) 45%, transparent);
  background: color-mix(in srgb, var(--rose) 12%, transparent);
  color: #ffd9d0;
}

/* Informational, not alarming: the "nothing changed" message. */
.form-notice {
  margin: 0;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--moon) 40%, transparent);
  background: color-mix(in srgb, var(--moon) 10%, transparent);
  color: var(--on-night);
}

/* Banner shown when the form was opened from a saved story. */
.editing-banner {
  margin-bottom: clamp(1.4rem, 3vw, 2rem);
  padding: 1rem 1.2rem;
  border-inline-start: 3px solid var(--moon);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--moon) 8%, transparent);
}
.editing-title {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
}
.editing-body { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }

.form-actions { display: flex; justify-content: flex-start; }

/* ─── Working overlay ──────────────────────────────────────────────────────*/

.working {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: color-mix(in srgb, var(--ink-deep) 90%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  /* The blur ramps up with the fade so the scrim arrives as a material
     thickening, not a flat wash. */
  transition: opacity 0.3s var(--ease), -webkit-backdrop-filter 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
}
.working-card {
  width: min(24rem, 100%);
  padding: 2.2rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: var(--ink);
  text-align: center;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
/* Entry only. On error the overlay is re-hidden instantly — a failure message
   should not wait for a fade. */
@starting-style {
  .working {
    opacity: 0;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
  }
  .working-card { opacity: 0; transform: translateY(0.4rem) scale(0.97); }
}
.working-moon { display: flex; justify-content: center; gap: 0.45rem; margin-bottom: 1.4rem; }
.working-moon span {
  width: 0.6rem; height: 0.6rem;
  border-radius: 50%;
  background: var(--moon);
  animation: breathe 1.6s var(--ease) infinite;
}
.working-moon span:nth-child(2) { animation-delay: 0.2s; }
.working-moon span:nth-child(3) { animation-delay: 0.4s; }
@keyframes breathe {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-0.3rem); }
}

.working-stage { margin: 0 0 1.1rem; font-family: var(--display); font-size: var(--step-1); }
.working-track {
  height: 4px;
  border-radius: 999px;
  background: var(--ink-line);
  overflow: hidden;
}
.working-bar {
  height: 100%;
  width: 8%;
  border-radius: 999px;
  background: var(--moon);
  transition: width 0.5s var(--ease);
}
.working-note { margin: 1.1rem 0 0; font-size: var(--step--1); color: var(--on-night-soft); }

/* ─── Shelf ────────────────────────────────────────────────────────────────*/

.page-shelf { background: var(--ink); color: var(--on-night); min-height: 100vh; }
.shelf { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.shelf-head { margin-bottom: clamp(2rem, 4vw, 3rem); }

.cards {
  display: grid;
  gap: 1.6rem;
  margin: 0; padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.card-link {
  display: grid;
  gap: 1rem;
  height: 100%;
  color: inherit;
  text-decoration: none;
  padding: 0.8rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
  align-content: start;
  touch-action: manipulation;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.card-link:hover {
  border-color: color-mix(in srgb, var(--moon) 45%, transparent);
  transform: translateY(-2px);
  /* Lifting without a shadow reads as sliding; the shadow makes it depth. */
  box-shadow: 0 1rem 2.4rem -1.2rem rgba(0, 0, 0, 0.55);
}
.card-link:active { transform: translateY(0) scale(0.99); transition-duration: 0.1s; }
.card-art { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4 / 3; background: var(--ink-deep); }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art-empty { width: 100%; height: 100%; background: linear-gradient(160deg, var(--ink-soft), var(--ink-deep)); }
.card-body { padding: 0 0.4rem 0.4rem; }
.card-topic {
  margin: 0 0 0.25rem;
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--moon);
}
.card-title {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.2;
}
.card-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.card-kept { color: var(--moon); }
/* Whose book this is, on an organization's shelf. Quieter than the topic
   above it: useful when you look for it, invisible when you are not. */
.card-byline { color: color-mix(in srgb, var(--on-night-soft) 80%, transparent); }

/* An organization's shelf is two shelves — the school's books, then your own.
   The gap does the separating; a rule between them would fence off work that
   belongs to the same person. */
.shelf-section + .shelf-section { margin-top: clamp(2.5rem, 5vw, 4rem); }
.shelf-section-title {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
}
.shelf-section-lead {
  margin: 0 0 1.4rem;
  max-width: 48ch;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}

.empty { text-align: center; padding-block: 4rem; display: grid; gap: 1.4rem; justify-items: center; }
.empty-line { margin: 0; color: var(--on-night-soft); font-size: var(--step-1); }

/* ─── Reader ───────────────────────────────────────────────────────────────
   Reading happens on paper, so the book sits on wool even at night. */

.page-reader { background: var(--ink); color: var(--on-night); }
.reader { padding-bottom: var(--band); }
.reader-head { padding-block: clamp(1.5rem, 4vw, 2.5rem); text-align: center; }
.reader-topic {
  margin: 0 0 0.5rem;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moon);
}
.reader-title {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.08;
  text-wrap: balance;
}
.reader-meta { margin: 0; color: var(--on-night-soft); font-size: var(--step--1); }

.book {
  width: min(56rem, 100% - var(--gutter) * 2);
  margin-inline: auto;
}

/* Same stacked-cell arrangement as the pairs, and the same constraint. The
   perspective is what makes a turning page read as paper rather than a wipe. */
.leaves {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  perspective: 2600px;
}

/* ─── The turning sheet, spread layout ─────────────────────────────────────
   In a bound book only the right-hand page turns, and the back of that sheet
   becomes the next left-hand page. The turner is that single sheet: its front
   is the words you were reading, its back the picture you are about to see. */

.turner {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  right: 0;
  z-index: 5;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
  /* No `filter` here: a filter forces preserve-3d to flatten, which stops the
     back face from ever showing and leaves the front mirrored instead. The
     shadow lives on the faces so it travels with them through the turn. */
}

.turner-face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  overflow: hidden;
  background: var(--wool);
  color: var(--on-day);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: -0.8rem 0.6rem 2.2rem rgba(0, 0, 0, 0.38);
}
.turner-front { border-radius: 0 var(--radius) var(--radius) 0; }
.turner-back {
  transform: rotateY(180deg);
  border-radius: var(--radius) 0 0 var(--radius);
  /* The plate has to fill this face; centring would collapse it to its content. */
  align-content: stretch;
  grid-template-rows: 1fr;
}
.turner-back .leaf-plate { height: 100%; aspect-ratio: auto; }

/* While the sheet is mid-air the page it came from still shows its other half. */
.leaf.is-under {
  opacity: 1;
  visibility: visible;
  z-index: 2;
  transition: none;
}
.leaf.is-clip-left { clip-path: inset(0 50% 0 0); }
.leaf.is-clip-right { clip-path: inset(0 0 0 50%); }

.leaf {
  grid-area: 1 / 1;
  position: relative;
  min-width: 0;
  /* Turns are hinged at the left edge, where the spine would be. */
  transform-origin: left center;
  transform-style: preserve-3d;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.leaf.is-active { opacity: 1; visibility: visible; }

/* The sheet mid-turn sits above whatever it is uncovering, and casts onto it. */
.leaf.is-turning {
  opacity: 1;
  visibility: visible;
  z-index: 3;
  transition: none;
  will-change: transform;
  /* See the note on .turner — a filter here would flatten the sheet's two faces
     into one and the paper back would never appear. */
}

.leaf-face {
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.leaf-front {
  position: relative;
  display: grid;
  gap: 0;
  /* Pages without an illustration are stretched to match the tallest page, so
     their text sits in the middle rather than pinned to the top. */
  align-content: center;
  min-height: 100%;
  overflow: hidden;
  background: var(--wool);
  color: var(--on-day);
  box-shadow: 0 1.5rem 4rem -1.5rem rgba(0, 0, 0, 0.6);
}

/* The reverse of the sheet: blank paper, lit from the spine side. */
.leaf-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background:
    linear-gradient(95deg, var(--wool-deep) 0%, var(--wool) 22%, var(--wool) 78%, var(--wool-deep) 100%);
  box-shadow: inset 0 0 5rem rgba(16, 20, 58, 0.09);
}

.leaf-art { background: var(--wool-deep); aspect-ratio: 4 / 3; }
.leaf-art img { width: 100%; height: 100%; object-fit: cover; }

.leaf-text { padding: clamp(1.5rem, 4vw, 2.6rem); }
.leaf-count {
  margin: 0 0 0.8rem;
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-day-soft);
}
.leaf-body {
  margin: 0;
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.5;
  text-wrap: pretty;
}

/* Every page in a picture book is the same size, so an unillustrated page is
   stretched to match. Give its words the room instead of leaving it empty. */
.leaf-front:not(:has(.leaf-art)) .leaf-text { text-align: center; padding-inline: clamp(1.5rem, 8vw, 5rem); }
.leaf-front:not(:has(.leaf-art)) .leaf-body { font-size: var(--step-3); line-height: 1.4; }
.leaf-front:not(:has(.leaf-art)) .leaf-count { letter-spacing: 0.16em; }

.book-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.4rem;
}
.turn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  background: none;
  color: var(--on-night);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), opacity 0.18s var(--ease);
}
.turn:hover:not(:disabled) { border-color: var(--moon); }
.turn:active:not(:disabled) { transform: scale(0.96); }
.turn:disabled { opacity: 0.35; cursor: default; }

/* The reader's small controls answer a finger the way the buttons do. */
.turn, .pip, .dot, .place-remove, .account-trigger, .account-link-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pips { display: flex; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.pip {
  width: 0.55rem; height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-line);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.pip:hover { background: color-mix(in srgb, var(--moon) 55%, var(--ink-line)); }
.pip.is-active { background: var(--moon); transform: scale(1.25); }

/* Five identical outlined pills in a row give a reader nothing to aim at, so
   the row has an order now: the narrator leads as a filled button, the two
   ways of reading sit beside it, and anything that leaves the page trails
   after a gap. */
.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  margin-top: 2.5rem;
}

/* The narrator: filled, because it is the offer. */
.button-voice {
  --button-bg: color-mix(in srgb, var(--moon) 16%, transparent);
  --button-border: color-mix(in srgb, var(--moon) 55%, transparent);
  --button-fg: var(--on-night);
  gap: 0.55rem;
  font-weight: 600;
}
.day .button-voice { --button-fg: var(--on-day); }
.button-voice:hover {
  --button-bg: color-mix(in srgb, var(--moon) 26%, transparent);
  --button-border: var(--moon);
}
.voice-icon { width: 1.05rem; height: 1.05rem; flex: none; opacity: 0.9; }

/* A breath between reading this book and doing something else. It collapses on
   a narrow screen, where the row is already stacking. */
.reader-actions-split { width: 1.25rem; }
@media (max-width: 34rem) { .reader-actions-split { display: none; } }

/* Which voice, inside the button it belongs to rather than floating beside it
   as a pill that looked pressable and was not. */
.button-note {
  padding-inline-start: 0.55rem;
  margin-inline-start: 0.1rem;
  border-inline-start: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--moon);
}
.reader .stitch { color: var(--on-night); }

/* The narrator is announced, not offered, until it can actually speak. */
.narrator-soon { opacity: 0.55; cursor: default; }

/* ─── Read it alone first ──────────────────────────────────────────────────*/

.preread {
  margin: 0 auto 1.6rem;
  max-width: 38rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--moon) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--moon) 32%, transparent);
  font-size: var(--step--1);
}
.preread-title {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--moon);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.preread-body { margin: 0; color: var(--on-night-soft); }

/* ─── Shared story banner ──────────────────────────────────────────────────*/

.shared-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  margin: 1.6rem 0 0;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-line);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
  font-size: var(--step--1);
}
.shared-note { margin: 0; color: var(--on-night-soft); }

/* ─── Teaser: two pages, then the door in ──────────────────────────────────*/

.teaser-lock {
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid color-mix(in srgb, var(--moon) 35%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--moon) 8%, transparent);
  text-align: center;
}
.teaser-title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-2);
  color: var(--moon);
}
.teaser-body {
  max-width: 34rem;
  margin: 0 auto 1.4rem;
  color: var(--on-night-soft);
}
.teaser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  align-items: center;
}

/* ─── Comments ─────────────────────────────────────────────────────────────*/

.comments { margin-top: 1.6rem; }
.comment-list { display: grid; gap: 1rem; margin-bottom: 1.6rem; }
.comment {
  padding: 0.8rem 1rem;
  border-inline-start: 2px solid color-mix(in srgb, var(--on-night-soft) 45%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--ink-deep) 45%, transparent);
}
.comment-enter {
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
@starting-style {
  .comment-enter { opacity: 0; transform: translateY(0.4rem); }
}

.comment-meta {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  color: var(--on-night-soft);
  letter-spacing: 0.04em;
}
.comment-author { font-weight: 600; color: var(--on-night); }
.comment-body { margin: 0; color: var(--on-night); overflow-wrap: anywhere; }

.comment-form { display: grid; gap: 0.6rem; justify-items: start; }
.comment-form .textarea { width: 100%; }
.comment-hint { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.comment-form .form-error.is-ok { color: var(--sage); }

/* ─── Note for the grown-up ────────────────────────────────────────────────*/

.note {
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
}
.note-title {
  margin: 0 0 1.6rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-2);
}
.note-block { margin-bottom: 1.8rem; }
.note-block:last-child { margin-bottom: 0; }
.note-heading {
  margin: 0 0 0.6rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moon);
}
.note-body { margin: 0; color: var(--on-night-soft); }
.note-concept {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: var(--step-1);
  color: var(--on-night);
}

.note-refrain {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-size: var(--step-2);
  font-style: italic;
  line-height: 1.3;
  color: var(--moon);
}

.map { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.map th {
  text-align: left;
  padding: 0.5rem 0.8rem 0.5rem 0;
  border-bottom: 1px solid var(--ink-line);
  font-weight: 600;
  color: var(--on-night-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.map td {
  padding: 0.7rem 0.8rem 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink-line) 55%, transparent);
  vertical-align: top;
}
.map-story { color: var(--on-night); width: 45%; }
.map-life { color: var(--on-night-soft); }

.qa { margin-bottom: 1.1rem; }
.qa:last-child { margin-bottom: 0; }
.qa-q { margin: 0 0 0.25rem; font-weight: 600; color: var(--on-night); }
.qa-a { margin: 0; color: var(--on-night-soft); }

.phrases { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.phrase {
  padding: 0.7rem 1rem;
  border-inline-start: 2px solid var(--moon);
  background: color-mix(in srgb, var(--moon) 7%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--display);
  font-size: var(--step-1);
}

/* ─── How this story was made ──────────────────────────────────────────────*/

.made { margin-top: 1.6rem; }

.made-situation {
  margin: 0;
  padding: 0.9rem 1.1rem;
  border-inline-start: 2px solid color-mix(in srgb, var(--on-night-soft) 45%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--ink-deep) 45%, transparent);
  color: var(--on-night-soft);
  font-style: italic;
  white-space: pre-wrap;
}

.made-grid { display: flex; gap: 1.2rem; align-items: flex-start; }
.made-photo {
  width: 6.5rem;
  height: 6.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex: none;
}
.made-rows { display: grid; gap: 0.45rem; min-width: 0; }
.made-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.8rem;
  font-size: var(--step--1);
}
@media (max-width: 34rem) {
  .made-row { grid-template-columns: 1fr; gap: 0.1rem; }
}
.made-label {
  color: var(--on-night-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding-top: 0.15rem;
}
.made-value { color: var(--on-night); }

.note-support {
  margin: 1.6rem 0 0;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--sage) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--sage) 35%, transparent);
  color: color-mix(in srgb, var(--sage) 55%, var(--on-night));
  font-size: var(--step--1);
}

/* ─── Full screen reading ──────────────────────────────────────────────────
   Real fullscreen where the browser allows it, and an identical fixed overlay
   where it does not — iOS Safari will not put an arbitrary element fullscreen,
   and reading in bed on a phone is exactly when this matters. */

.immersive-exit {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--on-night) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-deep) 72%, transparent);
  color: var(--on-night);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.immersive-exit:hover { border-color: var(--moon); }

.is-immersive { overflow: hidden; }
.is-immersive .topbar-shell,
.is-immersive .sitefoot,
.is-immersive .reader-head,
.is-immersive .reader-actions,
.is-immersive .note,
.is-immersive .preread,
.is-immersive .shared-banner,
.is-immersive .teaser-lock,
.is-immersive .comments,
.is-immersive .reader .stitch { display: none; }

.is-immersive .reader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: radial-gradient(125% 95% at 50% 38%, var(--ink) 0%, var(--ink-deep) 72%);
  overflow: auto;
}

.is-immersive .book { width: min(100%, 76rem); }
.is-immersive .leaf-front { height: min(76vh, 44rem); }
.is-immersive .leaf-body { font-size: clamp(1.25rem, 1.9vw, 1.95rem); }
.is-immersive .book-controls { margin-top: 1.6rem; }

/* A quiet left-hand page for the parts that carry no illustration. The stitched
   frame is the same motif as the dividers elsewhere. */
.leaf-quiet { display: none; }

/* Wide enough for a spread: picture on the left page, words on the right, with
   the gutter shaded the way a bound book shades. */
@media (min-width: 60rem) {
  .is-immersive .leaf-front {
    grid-template-columns: 1fr 1fr;
    align-content: stretch;
  }
  .is-immersive .leaf-plate { aspect-ratio: auto; height: 100%; }
  /* Just paper. A framed panel reads as a picture that failed to load, whereas
     a blank left-hand page is something every printed book already has. The
     small stitched ornament is the printer's device, not a placeholder. */
  .is-immersive .leaf-quiet {
    display: block;
    position: relative;
    background: var(--wool);
  }
  .is-immersive .leaf-quiet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4.5rem;
    height: 2px;
    transform: translate(-50%, -50%);
    background-image: linear-gradient(90deg, var(--on-day) 0 10px, transparent 10px 20px);
    background-size: 20px 2px;
    opacity: 0.16;
  }

  .is-immersive .leaf-text { align-self: center; }
  /* Half a spread is not the place for the oversized single-page treatment. */
  .is-immersive .leaf-front:not(:has(.leaf-art)) .leaf-text {
    text-align: left;
    padding-inline: clamp(1.5rem, 3vw, 2.6rem);
  }
  .is-immersive .leaf-front:not(:has(.leaf-art)) .leaf-body {
    font-size: clamp(1.25rem, 1.9vw, 1.95rem);
  }

  .is-immersive .leaf-front::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3rem;
    transform: translateX(-50%);
    background: linear-gradient(
      90deg,
      rgba(16, 20, 58, 0) 0%,
      rgba(16, 20, 58, 0.09) 40%,
      rgba(16, 20, 58, 0.17) 50%,
      rgba(16, 20, 58, 0.09) 60%,
      rgba(16, 20, 58, 0) 100%
    );
    pointer-events: none;
  }
}

/* ─── Saying it instead of typing it ───────────────────────────────────────*/

/* Sits under the field it fills, at the weight of a hint. Speaking is an
   easier way in, not the intended way in, and a loud control here would push
   people toward a microphone at 11pm in a house where a child is asleep. */
.dictate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin: 0.6rem 0 0;
}

/* Beside a short field rather than under the long one. The glyph alone, sitting
   closer and lighter: the same sentence repeated down nine fields is noise, not
   discoverability, and the one field that needs explaining already has it. */
.dictate-compact {
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.dictate-compact .dictate-button {
  padding: 0.4rem 0.55rem;
  opacity: 0.75;
}
.dictate-compact .dictate-button:hover,
.dictate-compact .dictate-button:focus-visible,
.dictate-compact .dictate-button.is-recording { opacity: 1; }
.dictate-compact .dictate-icon { margin-inline-end: 0; }

/* A field inside a grid row cannot grow a sibling — the row counts its
   children — so the two share one cell. */
.field-say { display: grid; gap: 0.4rem; align-content: start; }
.dictate-status,
.dictate-hint {
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.day .dictate-status,
.day .dictate-hint { color: var(--on-day-soft); }

/* The glyph carries the meaning: the label was being read as one more link
   under the field, and people who wanted to talk never found it. */
.dictate-icon {
  display: inline-flex;
  margin-inline-end: -0.15rem;
  opacity: 0.85;
}

/* Recording is a state worth being unmistakable about — a microphone that is
   open without anybody realising is the one outcome here with a cost. */
.dictate-button.is-recording {
  --button-bg: color-mix(in srgb, var(--rose) 16%, transparent);
  --button-border: color-mix(in srgb, var(--rose) 70%, transparent);
  color: var(--rose);
}
.dictate-button.is-recording:hover {
  --button-bg: color-mix(in srgb, var(--rose) 24%, transparent);
}
.dictate-button.is-recording .dictate-icon {
  opacity: 1;
  animation: dictate-pulse 1.6s ease-in-out infinite;
}
@keyframes dictate-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Five bars riding the live input level. This is the part that answers the
   question asked two seconds in — is it actually hearing me? — which a running
   counter alone never does. */
.dictate-meter {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  height: 1.1rem;
}
.dictate-meter i {
  display: block;
  width: 0.2rem;
  height: 1.1rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rose) 75%, transparent);
  transform: scaleY(0.15);
  transform-origin: center;
  transition: transform 0.08s linear;
}

@media (prefers-reduced-motion: reduce) {
  .dictate-button.is-recording .dictate-icon { animation: none; }
  /* The level still reads, it just stops being motion: no easing to chase. */
  .dictate-meter i { transition: none; }
}

/* ─── Talking the form through ─────────────────────────────────────────────*/

/* The way out of the form, at the top of it.
   It was a quiet bordered panel, on the theory that an alternative to what
   somebody came for should not shout. It was too quiet to be seen as a
   control at all: a 1px border and a rounded corner above a form made of 1px
   borders and rounded corners is a fieldset, and people read it as one — a
   heading with a hint under it, and no reason to press anything.

   So it is built out of the interactive family instead. The lit surface says
   it is a control rather than a region; the glyph says which control; the
   chevron says it leads somewhere; and it lifts, presses and settles on the
   same curve and the same 0.98 as every button on the site, because things
   that behave the same should look the same. */
.talk-door {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: clamp(1.4rem, 3vw, 2rem);
  padding: 1rem 1.15rem;
  border: 1.5px solid color-mix(in srgb, var(--moon) 45%, transparent);
  border-radius: var(--radius);
  /* Lighter than the fieldsets it sits above, which are a structural material
     at 38% ink. A control should come forward, not recede into the page. */
  background: color-mix(in srgb, var(--moon) 9%, transparent);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.talk-door:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--moon) 75%, transparent);
  background: color-mix(in srgb, var(--moon) 15%, transparent);
}
/* Feedback belongs on the way down, and faster than the release. */
.talk-door:active { transform: translateY(0) scale(0.98); transition-duration: 0.1s; }

/* The moon disc is the loudest thing in the row, deliberately: it is what
   somebody's eye lands on, and it says "voice" before a word is read. */
.talk-door-badge {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--moon);
  color: var(--ink-deep);
}
.talk-door-text { display: grid; gap: 0.15rem; }
.talk-door-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-0);
  /* Display type reads loose as it grows; the fieldset legends do the same. */
  letter-spacing: -0.005em;
}
.talk-door-hint { font-size: var(--step--1); color: var(--on-night-soft); }

.talk-door-go {
  display: grid;
  place-items: center;
  color: var(--moon);
  transition: transform 0.18s var(--ease);
}
/* Leaning the way it is about to go. Two pixels: enough to be felt, not
   enough to be watched. */
.talk-door:hover .talk-door-go { transform: translateX(2px); }

@media (prefers-reduced-motion: reduce) {
  .talk-door,
  .talk-door-go { transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease); }
  .talk-door:hover,
  .talk-door:active,
  .talk-door:hover .talk-door-go { transform: none; }
}
/* A frosted surface is not what carries this — the fill is — but somebody who
   has asked for solid colours should still get a control that reads as one. */
@media (prefers-contrast: more) {
  .talk-door { border-color: var(--moon); background: color-mix(in srgb, var(--moon) 18%, transparent); }
}

/* The conversation. One question, one button, and a great deal of nothing —
   this page is listened to rather than read, and anything else on it is
   something to look at instead of answering. */
.talk-stage {
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) 0;
  padding: clamp(1.4rem, 4vw, 2.2rem) 1.2rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--moon) 6%, transparent);
  text-align: center;
}

/* Sized like something being said, not like a form label. */
.talk-say {
  margin: 0;
  min-height: 3.2em;
  max-width: 34ch;
  font-family: var(--display);
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.talk-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.talk-button.is-recording {
  --button-bg: color-mix(in srgb, var(--rose) 16%, transparent);
  --button-border: color-mix(in srgb, var(--rose) 70%, transparent);
  color: var(--rose);
}
.talk-button.is-recording .dictate-icon {
  opacity: 1;
  animation: dictate-pulse 1.6s ease-in-out infinite;
}
.talk-meter { height: 1.4rem; }
.talk-meter i { height: 1.4rem; }

/* Thinking. A turn is a transcription and a model call or two — a couple of
   seconds in which nothing moves and somebody presses again, which is not a
   second answer but the same one sent twice. So the button stops looking like
   a button: the microphone gives way to a turning ring, and the press is
   refused in the markup as well as in the script. */
.talk-button.is-thinking {
  cursor: progress;
  opacity: 0.8;
}
.talk-button.is-thinking .dictate-icon { display: none; }
.talk-button.is-thinking::before {
  content: '';
  width: 1.05rem;
  height: 1.05rem;
  margin-inline-end: 0.15rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: talk-thinking 0.7s linear infinite;
}
@keyframes talk-thinking { to { transform: rotate(1turn); } }

/* The status line is the other half of the answer to "is it doing anything?",
   and it is the half a screen reader gets. */
.talk-stage.is-thinking .talk-status { color: var(--moon); }
.talk-status {
  margin: 0;
  min-height: 1.2em;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}

/* The form filling in. The whole argument of the page is that this is visible
   the entire way down: what is being built is never a surprise, and leaving
   early is never a loss. */
.talk-draft {
  padding: 1.1rem 1.2rem;
  border-inline-start: 3px solid var(--moon);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--moon) 8%, transparent);
}
.talk-draft-title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 600;
}
.talk-draft-empty { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.talk-draft-list {
  display: grid;
  grid-template-columns: minmax(6rem, auto) 1fr;
  gap: 0.35rem 0.9rem;
  margin: 0;
  font-size: var(--step--1);
}
.talk-draft-list dt { color: var(--on-night-soft); }
.talk-draft-list dd { margin: 0; }
.talk-draft-warning {
  margin: 0.8rem 0 0;
  font-size: var(--step--1);
  color: var(--rose);
}

.talk-actions { display: grid; gap: 0.5rem; justify-items: start; margin-top: 1.6rem; }
.talk-escape { margin-top: 1.2rem; font-size: var(--step--1); }

@media (max-width: 30rem) {
  .talk-draft-list { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .talk-draft-list dd { margin-bottom: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .talk-button.is-recording .dictate-icon { animation: none; }
  /* The ring still says "working", it just stops turning. */
  .talk-button.is-thinking::before { animation: none; opacity: 0.6; }
}

/* ─── Did it help? ─────────────────────────────────────────────────────────*/

/* A quiet moment of its own, directly under the last page.
   Centred, because everything else on this axis is — the book, the pips, the
   row of actions — and a left-aligned block sitting under the page controls
   read as a fourth thing bolted to the navigation rather than the end of the
   book. Separated by space rather than a rule: the page already carries enough
   lines, and whitespace says "new thought" without drawing anything. */
.rating {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  margin: 2.75rem 0 0;
  text-align: center;
}

.rating-question {
  margin: 0;
  font-family: var(--display);
  font-size: var(--step-1);
  /* Display type reads too loose as it grows. */
  letter-spacing: -0.01em;
}

.rating-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }

/* The press feedback is the house button's — instant, on pointer-down. What
   is added here is the settled state: the answer you gave should be plainly
   the answer you gave, from across the room. */
.rating-choice { transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease); }
.rating-choice.is-chosen {
  border-color: var(--moon);
  background: color-mix(in srgb, var(--moon) 16%, transparent);
  color: var(--on-night);
}
.day .rating-choice.is-chosen { color: var(--on-day); }
/* A tap is not a flick, so the thumb settles rather than bouncing. */
.rating-thumb {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  transition: transform 0.22s var(--ease);
}
.rating-choice.is-chosen .rating-thumb { transform: scale(1.12); }

/* Inherits the centring rather than reverting to a left-aligned form: one
   field in a centred block reads as part of the question it follows, where a
   left-aligned label under centred buttons reads as a seam. */
.rating-reason {
  width: 100%;
  max-width: 30rem;
  margin-top: 0.5rem;
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}
.rating-reason .field { width: 100%; }
.rating-reason .input { text-align: center; }

.rating-thanks {
  margin: 0;
  font-size: var(--step--1);
  color: var(--moon);
}
.rating-note {
  margin: 0;
  max-width: 32rem;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--on-night-soft);
  text-wrap: pretty;
}
.day .rating-note { color: var(--on-day-soft); }

/* Never part of the book on paper, and never part of a shared page. */
@media print { .rating { display: none !important; } }

/* ─── Books whose pages carry more words ───────────────────────────────────*/

/* A page holds more than it used to, and the immersive spread is a fixed height
   that hides whatever will not fit. So the type is set down a step — for the
   whole book at once, decided by its longest page in views/reader.js. Sizing
   page by page would be worse than clipping: words that change size between one
   page and the next read as a printing fault. */

.book.is-set-small .leaf-body { font-size: var(--step-1); }
.book.is-set-smaller .leaf-body { font-size: var(--step-0); }

.book.is-set-small .leaf-front:not(:has(.leaf-art)) .leaf-body { font-size: var(--step-2); }
.book.is-set-smaller .leaf-front:not(:has(.leaf-art)) .leaf-body { font-size: var(--step-1); }

.is-immersive .book.is-set-small .leaf-body { font-size: clamp(1.05rem, 1.5vw, 1.55rem); }
.is-immersive .book.is-set-smaller .leaf-body { font-size: clamp(1rem, 1.25vw, 1.3rem); }

@media (min-width: 60rem) {
  .is-immersive .book.is-set-small .leaf-front:not(:has(.leaf-art)) .leaf-body {
    font-size: clamp(1.05rem, 1.5vw, 1.55rem);
  }
  .is-immersive .book.is-set-smaller .leaf-front:not(:has(.leaf-art)) .leaf-body {
    font-size: clamp(1rem, 1.25vw, 1.3rem);
  }
}

/* ─── Motion and print ─────────────────────────────────────────────────────*/

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .button:hover, .card-link:hover { transform: none; box-shadow: none; }

  /* Reduced motion means gentler, not gone: the changes that carry meaning —
     which page is open, whether the overlay is up, what just arrived — stay
     legible as short fades, with all travel and scale removed. */
  .pair, .leaf {
    transition-duration: 0.3s !important;
    transition-property: opacity, visibility;
  }
  .pair { transform: none; }
  .working, .working-card, .comment-enter,
  .upload-preview.is-new, .place-preview.is-new {
    transition-duration: 0.25s !important;
    transition-property: opacity;
  }
  /* The bar's width is status itself; freezing it would hide progress. */
  .working-bar { transition-duration: 0.5s !important; }
}

@media print {
  /* The made-from section holds the parent's own words about the situation —
     it must never ride along when the book is printed for the child. */
  .topbar-shell, .sitefoot, .book-controls, .reader-actions, .skip-link,
  .immersive-exit, .leaf-back, .made, .preread, .shared-banner,
  .teaser-lock, .comments { display: none !important; }

  body { background: #fff; color: #000; }
  .page-reader { background: #fff; }

  .reader-title, .reader-topic, .reader-meta { color: #000; }

  .leaves { display: block; perspective: none; }
  .leaf {
    grid-area: auto;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: none !important;
    transform-style: flat;
    break-after: page;
    page-break-after: always;
    margin-bottom: 1rem;
  }
  .leaf-front {
    height: auto !important;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  .leaf:last-of-type { break-after: auto; page-break-after: auto; }

  .note {
    background: #fff;
    border: 1px solid #ccc;
    break-before: page;
    page-break-before: always;
  }
  .note-body, .qa-a, .map-life { color: #333; }
  .note-heading, .card-topic { color: #666; }
  .note-concept, .qa-q, .map-story { color: #000; }
  .phrase { background: #f5f5f5; border-inline-start-color: #999; }
}

/* ─── Admin dashboard ──────────────────────────────────────────────────────*/

.page-admin { color: var(--on-night); }
.admin { padding-block: clamp(2rem, 5vw, 3.5rem) var(--band, 4rem); }
.admin-head { margin-bottom: 2rem; }
.admin-head .page-lead { color: var(--on-night-soft); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.admin-stat {
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
}
.admin-stat-value {
  font-size: var(--step-3, 2rem);
  font-weight: 600;
  color: var(--moon);
}
.admin-stat-label { color: var(--on-night-soft); font-size: var(--step--1, 0.9rem); }
.admin-stat-note { color: var(--on-night-soft); font-size: var(--step--1, 0.8rem); }

.admin-section-title {
  font-size: var(--step-1, 1.2rem);
  margin: 2.25rem 0 1rem;
}
.admin-hint {
  font-size: var(--step--1, 0.85rem);
  font-weight: 400;
  color: var(--on-night-soft);
  margin-inline-start: 0.5rem;
}

.admin-scroll { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1, 0.9rem);
}
.admin-table th,
.admin-table td {
  text-align: start;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  vertical-align: top;
}
.admin-table thead th {
  color: var(--on-night-soft);
  font-weight: 500;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
}
.admin-table a { color: var(--moon); }
.admin-config th { width: 14rem; color: var(--on-night-soft); font-weight: 500; }
.admin-detail { color: var(--on-night-soft); }

.admin-usage { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.admin-usage li { padding-block: 0.3rem; color: var(--on-night-soft); }
.admin-usage code, .admin-table code { font-size: 0.85em; word-break: break-all; }

.admin-empty { color: var(--on-night-soft); margin-block: 0.75rem 1.5rem; }

.admin-users code { display: block; margin-top: 0.2rem; color: var(--on-night-soft); }
.admin-limit {
  width: 5.5rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-deep) 55%, transparent);
  color: var(--on-night);
  font: inherit;
  font-size: var(--step--1);
}
.admin-limit:focus { border-color: var(--moon); outline: none; background: var(--ink-deep); }
.admin-limit::placeholder { color: color-mix(in srgb, var(--on-night-soft) 65%, transparent); }
.admin-user-actions { white-space: nowrap; }
.admin-user-actions .button + .button { margin-left: 0.4rem; }
.admin-user-locked > td:first-child { opacity: 0.75; }
.admin-lock-flag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--rose) 55%, transparent);
  color: var(--rose);
  font-size: var(--step--1);
}

/* ─── Organisation ─────────────────────────────────────────────────────────
   The page a head teacher opens to set their staff up, and the only way in
   or out of an organisation. Plain and administrative on purpose: nothing
   here is being sold, it is being run. */

.page-org { background: var(--ink); color: var(--on-night); min-height: 100vh; }
.org { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.org-head { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }

.org-flash,
.org-error {
  margin: 0 0 1.6rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-line);
  font-size: var(--step--1);
}
.org-flash { border-color: color-mix(in srgb, var(--moon) 45%, transparent); color: var(--moon); }
.org-error { border-color: color-mix(in srgb, var(--rose) 50%, transparent); color: var(--rose); }

/* The two doors sit side by side where there is room, and stack where there
   is not. Creating and joining are equal choices, so neither is made louder. */
.org-doors {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.org-door {
  padding: 1.4rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
}
.org-door-title { margin: 0 0 0.5rem; font-family: var(--display); font-weight: 600; font-size: var(--step-1); }
.org-door-body { margin: 0 0 1.2rem; font-size: var(--step--1); color: var(--on-night-soft); }

.org-form { display: grid; gap: 1rem; justify-items: start; }
.org-form-inline { margin-bottom: 1.4rem; }

/* A code is typed by someone reading it off a sticky note, so the field is
   monospaced and spaced out — a mistyped character should look wrong. */
.org-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--step-1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  max-width: 12rem;
}

.org-block { margin-top: clamp(2rem, 4vw, 3rem); }
.org-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}
.org-block-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--step-1); }
.org-block-lead { margin: 0.4rem 0 1.2rem; max-width: 52ch; font-size: var(--step--1); color: var(--on-night-soft); }
.org-seats { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.org-note { margin: 1.2rem 0 0; max-width: 52ch; font-size: var(--step--1); color: var(--on-night-soft); }
.org-empty { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }

.org-members { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.org-member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-soft) 35%, transparent);
}
.org-member-name { margin: 0 0 0.2rem; font-weight: 600; }
.org-member-you { font-weight: 400; color: var(--on-night-soft); }
.org-member-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.org-role-owner { color: var(--moon); }
.org-member-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.org-invites { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.org-invite {
  padding: 1.1rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-soft) 35%, transparent);
  display: grid;
  gap: 0.5rem;
  justify-items: start;
}
/* Big enough to read aloud across a staff room without walking over. */
.org-invite-code {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--step-2);
  letter-spacing: 0.18em;
  color: var(--moon);
  user-select: all;
}
.org-invite-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.org-invite-link { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.org-invite-link code { user-select: all; overflow-wrap: anywhere; }

.org-subtitle { margin: 1.6rem 0 0.6rem; font-weight: 600; font-size: var(--step-0); }
.org-usage { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.org-usage li { font-size: var(--step-0); }
.org-usage-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; max-width: 26rem; }
.org-usage-members li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink-line) 60%, transparent);
  font-size: var(--step--1);
}
.org-usage-count { color: var(--moon); font-variant-numeric: tabular-nums; }

/* ─── Starting points ──────────────────────────────────────────────────────
   Drafted situations above the hardest field on the page. They are offered,
   never imposed: nothing is preselected, and the strip is quiet enough that
   an empty studio still reads as a perfectly good way to begin. */

.templates { margin-bottom: 1.6rem; }
.templates-title { margin: 0 0 0.25rem; font-size: var(--step--1); font-weight: 600; }
.templates-hint {
  margin: 0 0 1rem;
  max-width: 56ch;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.template-set {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}
.template-card {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-deep) 45%, transparent);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease),
    transform 0.18s var(--ease);
}
.template-card:hover {
  border-color: color-mix(in srgb, var(--moon) 45%, transparent);
  background: var(--ink-deep);
  transform: translateY(-1px);
}
.template-card:active { transform: translateY(0); transition-duration: 0.08s; }
.template-card:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; }
.template-card-label { font-weight: 600; font-size: var(--step--1); }
.template-card-blurb { font-size: var(--step--1); color: var(--on-night-soft); line-height: 1.4; }
/* Said on the card itself, because a writer should understand the choice
   rather than just receive it. */
.template-card-note {
  margin-top: 0.2rem;
  font-size: var(--step--1);
  line-height: 1.45;
  color: color-mix(in srgb, var(--moon) 80%, var(--on-night-soft));
}

@media (prefers-reduced-motion: reduce) {
  .template-card { transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease); }
  .template-card:hover, .template-card:active { transform: none; }
}

/* ─── Repairing one page ───────────────────────────────────────────────────
   The control sits on the picture it acts on, and stays out of the way until
   the page is hovered or the button is focused — a book being read aloud
   should not have editing furniture on every spread. */

.leaf-art { position: relative; }
.leaf-repair {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}
.leaf.is-active:hover .leaf-repair,
.leaf-repair:focus-within { opacity: 1; }
/* Touch has no hover, so on a coarse pointer the control is simply there. */
@media (pointer: coarse) {
  .leaf-repair { opacity: 1; }
}
.leaf-repair .button {
  background: color-mix(in srgb, var(--ink-deep) 82%, transparent);
  backdrop-filter: blur(6px);
}
/* The drawing is being replaced, so it dims rather than disappearing — the
   spread keeps its shape while the new picture is made. */
.leaf-art img.is-redrawing { opacity: 0.45; filter: saturate(0.6); }
.leaf-art img { transition: opacity 0.25s var(--ease), filter 0.25s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .leaf-repair { transition: none; }
  .leaf-art img { transition: none; }
}

/* Editing furniture is never part of the book on paper. */
@media print {
  .leaf-repair { display: none !important; }
}

/* The rewrite controls sit under the words they change, and stay quiet until
   the page is hovered.
   The hover target is the open page, not the block of words. In the full-screen
   spread the words are centred in their half, so a short page is a small box
   adrift in a large one — tying the control to the text alone made it appear on
   some pages and not others, depending on where the cursor happened to land. */
.leaf-rewrite {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}
.leaf.is-active:hover .leaf-rewrite,
.leaf-rewrite:focus-within { opacity: 1; }
@media (pointer: coarse) { .leaf-rewrite { opacity: 1; } }

.leaf-steer { flex: 1 1 16rem; display: grid; gap: 0.6rem; }
.leaf-steer-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.leaf-repair-error {
  flex: 1 1 100%;
  margin: 0;
  font-size: var(--step--1);
  color: var(--rose);
}
/* The words are being replaced, so they dim rather than vanishing — the page
   keeps its shape while the new ones are written. */
.leaf-body.is-rewriting { opacity: 0.45; }
.leaf-body { transition: opacity 0.25s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .leaf-rewrite, .leaf-body { transition: none; }
}
@media print {
  .leaf-rewrite { display: none !important; }
}

/* The features and staffroom bands borrow the safeguards list, but they sit
   on the day half of the page rather than the night one, so the light-ground
   colours have to be restored. */
.features { background: transparent; color: inherit; }
.features .section-title,
.features .guard-title { color: inherit; }
.features .section-lead,
.features .guard-body { color: var(--on-day-soft); }
.features-action { margin: 2rem 0 0; }

/* ─── Pricing ──────────────────────────────────────────────────────────────
   Plain and legible. Nobody is being persuaded here — they are checking a
   number they already half expect. */

.page-pricing { background: var(--ink); color: var(--on-night); min-height: 100vh; }
.pricing { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.pricing-head { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.pricing-balance { margin: 0.8rem 0 0; font-size: var(--step--1); color: var(--moon); }
.pricing-block { margin-top: clamp(2rem, 4vw, 3rem); }
.pricing-block .section-lead { max-width: 52ch; color: var(--on-night-soft); }

.price-cards {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.price-card {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding: 1.3rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
}
.price-name { margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--step-0); }
.price-figure {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--moon);
}
.price-note { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.price-body { margin: 0.3rem 0 0.8rem; font-size: var(--step--1); color: var(--on-night-soft); }
.price-card .button { justify-self: start; }

.pricing-off,
.pricing-invoice {
  margin-top: 1.6rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-soft) 30%, transparent);
}
.pricing-off { margin: 0 0 2rem; border-color: color-mix(in srgb, var(--moon) 40%, transparent); }
.shelf-credits { margin: 0.6rem 0 0; font-size: var(--step--1); color: var(--on-night-soft); }
.shelf-credits a { color: var(--moon); }
.admin-credit-balance { font-weight: 600; }

/* ─── Top bar ──────────────────────────────────────────────────────────────
   Three destinations on the left, identity on the right. The bar used to
   carry ten equal links and never said who was signed in; a row of ten equal
   things has no hierarchy at all. Everything rare now lives one level deeper,
   anchored to the person it belongs to. */

.topbar-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  /* Never squeezed out: identity is the one control that must always be
     reachable, so it keeps its size while everything else gives way. */
  flex: 0 0 auto;
}
/* The destinations take the slack, which pushes the balance and the account
   to the right edge without either of them needing a margin of their own. */
.topnav { margin-right: auto; }

/* The balance. A number you glance at, not a place you go — so it is quieter
   than a destination, but still a link, because what you do about a low
   number is buy more. */
.topnav-count {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--moon) 35%, transparent);
  color: var(--moon);
  font-size: var(--step--1);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease);
}
.topnav-count:hover { background: color-mix(in srgb, var(--moon) 12%, transparent); }

/* ─── Account ──────────────────────────────────────────────────────────── */

.account { position: relative; }
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.35rem 0.2rem 0.2rem;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  color: inherit;
  /* Feedback belongs on the press, and it is instant. */
  transition: background-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger:hover { background: color-mix(in srgb, var(--on-night) 10%, transparent); }
.account-trigger:active { transform: scale(0.97); transition-duration: 0.08s; }
.account-trigger:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; }

.account-avatar {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--moon) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--moon) 45%, transparent);
  color: var(--on-night);
  font-size: var(--step--1);
  font-weight: 600;
  /* Small type over a translucent ground wants a touch more tracking. */
  letter-spacing: 0.02em;
}
.account-chevron { width: 0.75rem; height: 0.75rem; opacity: 0.7; }
.account[open] .account-chevron { transform: rotate(180deg); }
.account-chevron { transition: transform 0.2s var(--ease); }

.account-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  min-width: 15rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  /* The bar above is already a translucent layer, and stacking one light
     material on another destroys legibility — so the menu is nearly solid. */
  background: color-mix(in srgb, var(--ink-deep) 94%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--ink-line);
  box-shadow: 0 1.2rem 2.6rem -0.8rem rgba(0, 0, 0, 0.65);
  /* It belongs to the button it came from, so it grows out of it. */
  transform-origin: top right;
  animation: account-in 0.22s var(--ease);
}
/* A material arriving, not a rectangle fading: blur and scale together. */
@keyframes account-in {
  from { opacity: 0; transform: scale(0.94) translateY(-0.25rem); filter: blur(2px); }
  to   { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

.account-who {
  padding: 0.5rem 0.6rem 0.7rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink-line) 70%, transparent);
}
/* Vibrancy: over a translucent ground, gray text loses. Weight and contrast
   carry it instead. */
.account-name { margin: 0; font-weight: 600; font-size: var(--step-0); }
.account-email,
.account-org {
  margin: 0.15rem 0 0;
  font-size: var(--step--1);
  color: var(--on-night-soft);
  overflow-wrap: anywhere;
}
.account-org { color: var(--moon); }

.account-links { display: grid; padding-top: 0.35rem; }
.account-signout {
  display: grid;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid color-mix(in srgb, var(--ink-line) 70%, transparent);
}
.account-link {
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  color: inherit;
  font-size: var(--step--1);
  text-decoration: none;
  transition: background-color 0.14s var(--ease);
}
.account-link:hover { background: color-mix(in srgb, var(--on-night) 10%, transparent); }
.account-link:focus-visible { outline: 2px solid var(--moon); outline-offset: -2px; }
.account-link-button {
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  /* Gentler, not absent: the menu still appears, it just does not travel. */
  .account-menu { animation: account-fade 0.15s var(--ease); }
  @keyframes account-fade { from { opacity: 0; } to { opacity: 1; } }
  .account-trigger:active { transform: none; }
  .account-chevron { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .account-menu {
    background: var(--ink-deep);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-contrast: more) {
  .account-menu { background: var(--ink-deep); border-color: var(--on-night); }
  .topnav-count { border-color: var(--moon); }
}

/* On a phone the top row keeps the brand and the account — who you are stays
   reachable at every width — and the destinations sit beneath with the balance
   among them, rather than being hidden behind another control.

   A grid rather than wrapped flex: the account must never be the thing that
   overflows, and explicit rows say that outright instead of depending on what
   happens to fit. */
@media (max-width: 38rem) {
  .topbar {
    display: grid;
    /* minmax(0, 1fr), not 1fr: a bare 1fr track refuses to shrink below its
       content's intrinsic width, so the brand would push the account off the
       right edge on a narrow phone rather than giving way itself. */
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem 0.75rem;
  }
  .brandmark { grid-column: 1; grid-row: 1; min-width: 0; }
  .topbar-end { grid-column: 2; grid-row: 1; justify-self: end; }
  .topnav {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-right: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
  }
  .topnav-count { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
}

/* Every member of an organisation, with the lever beside them. */
.org-usage-table { width: 100%; border-collapse: collapse; margin: 0; font-size: var(--step--1); }
.org-usage-table th {
  text-align: left;
  padding: 0 0.6rem 0.5rem 0;
  font-weight: 600;
  color: var(--on-night-soft);
}
.org-usage-table td {
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-top: 1px solid color-mix(in srgb, var(--ink-line) 60%, transparent);
  vertical-align: middle;
}
.org-cap-form { display: flex; gap: 0.4rem; align-items: center; }
.org-cap-input { max-width: 6rem; }

/* ─── Usage ────────────────────────────────────────────────────────────────
   How you are doing, and only then how to fix it. The count leads; the meter
   supports it. A bar on its own makes somebody do arithmetic to learn a
   number that could simply have been written down. */

.page-usage { background: var(--ink); color: var(--on-night); min-height: 100vh; }
.usage { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.usage-head { margin-bottom: clamp(1.2rem, 3vw, 2rem); }

.usage-hero {
  padding: clamp(1.4rem, 4vw, 2rem);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
}
/* Large text wants tight leading and negative tracking; the number is the
   answer, so it gets the display face and the room. */
.usage-count {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--moon);
}
.usage-count.is-low { color: var(--amber); }
.usage-count.is-empty { color: var(--rose); }
.usage-unit { margin: 0.3rem 0 0; color: var(--on-night-soft); }
.usage-org-name {
  margin: 0;
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.usage-meters { display: grid; gap: 1.1rem; margin-top: 1.6rem; }

.meter { display: grid; gap: 0.4rem; }
.meter-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--step--1);
}
.meter-label { font-weight: 600; }
.meter-value { color: var(--on-night-soft); font-variant-numeric: tabular-nums; }
.meter-track {
  height: 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-deep) 80%, transparent);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: var(--fill, 0%);
  border-radius: inherit;
  background: var(--moon);
  /* Fills from empty on load: critically damped, no overshoot — a meter that
     bounced past its value would be lying for a moment. */
  animation: meter-fill 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes meter-fill { from { width: 0; } to { width: var(--fill, 0%); } }
.meter-low .meter-fill { background: var(--amber); }
.meter-empty .meter-fill { background: var(--rose); }

/* Status, not alarm. Amber while there is still something left; red is kept
   for zero, because a product about hard conversations should not shout at
   somebody who can still write a story. */
.notice {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-line);
  background: color-mix(in srgb, var(--ink-soft) 30%, transparent);
}
.notice-low { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.notice-empty { border-color: color-mix(in srgb, var(--rose) 45%, transparent); }
.notice-title { margin: 0 0 0.25rem; font-weight: 600; }
.notice-low .notice-title { color: var(--amber); }
.notice-empty .notice-title { color: var(--rose); }
.notice-body { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }

.usage-block { margin-top: clamp(1.8rem, 4vw, 2.6rem); }
.usage-h2 { margin: 0 0 0.3rem; font-family: var(--display); font-weight: 600; font-size: var(--step-1); }
.usage-lead { margin: 0 0 1.2rem; max-width: 52ch; font-size: var(--step--1); color: var(--on-night-soft); }
.usage-note { margin: 0.9rem 0 0; font-size: var(--step--1); color: var(--on-night-soft); }
.usage-more { margin: 1.2rem 0 0; font-size: var(--step--1); }
.usage-more a { color: var(--moon); }
.usage-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }

/* The way to fix it sits directly under the thing that showed the shortage. */
.buy-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.buy-card {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  padding: 1.1rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink-soft) 35%, transparent);
}
.buy-card-best { border-color: color-mix(in srgb, var(--moon) 40%, transparent); }
.buy-name { margin: 0; font-weight: 600; font-size: var(--step--1); }
.buy-price {
  margin: 0;
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--moon);
  letter-spacing: -0.01em;
}
.buy-note { margin: 0 0 0.5rem; font-size: var(--step--1); color: var(--on-night-soft); }
.buy-card .button { justify-self: start; }

@media (prefers-reduced-motion: reduce) {
  /* Drawn at its value, with no travel. */
  .meter-fill { animation: none; }
}
@media (prefers-contrast: more) {
  .meter-track { border: 1px solid var(--on-night); }
  .notice { border-color: var(--on-night); }
}

/* ─── Admin: what families said ────────────────────────────────────────────*/

.admin-verdicts { white-space: nowrap; }
.admin-up { color: var(--moon); }
.admin-down { color: var(--rose); margin-inline-start: 0.6rem; }
.admin-empty-cell { opacity: 0.5; }
.admin-reasons { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.admin-reasons li { max-width: 40rem; }
.admin-reason-when {
  display: block;
  font-size: var(--step--1);
  opacity: 0.6;
}

/* ─── Folded-away parts of the studio ──────────────────────────────────────*/

/* Optional refinements, one press away rather than in the way. Styled as a
   quiet line rather than a control, so the form reads as short and the folds
   read as offers. */
.fold { margin-top: 0.4rem; }
.fold-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0;
  font-size: var(--step--1);
  color: var(--on-night-soft);
  cursor: pointer;
  list-style: none;
  transition: color 0.16s var(--ease);
}
.day .fold-summary { color: var(--on-day-soft); }
.fold-summary::-webkit-details-marker { display: none; }
/* The triangle is drawn rather than inherited, so it turns with the fold. */
.fold-summary::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s var(--ease);
}
.fold[open] > .fold-summary::before { transform: rotate(45deg); }
.fold-summary:hover { color: var(--moon); }
.fold-body { padding-top: 0.6rem; }

/* The storyteller voice, marked where it is used rather than sold at the door. */
.tag-voice {
  border-color: color-mix(in srgb, var(--moon) 45%, transparent);
  color: var(--moon);
}

/* ─── The sample book on the landing ───────────────────────────────────────*/

/* Sits under the hero, so the evidence for the promise is the next thing read
   rather than four sections down. Centred and quiet: the book is the argument,
   and the copy only has to get out of its way. */
.sample {
  padding-block: clamp(3rem, 7vw, 5rem);
  text-align: center;
}
.sample-wrap {
  display: grid;
  justify-items: center;
  gap: 1rem;
}
/* The lead reads as one held thought rather than a paragraph running the full
   width of a wide screen. */
.sample-lead { max-width: 34rem; margin: 0; text-wrap: pretty; }
/* The book itself, sitting in the page. The reader's own styles do the work;
   this only gives it room and keeps the reader's page furniture off it. */
.sample-book { margin: 2.5rem 0 1rem; }

/* On the landing this is a demonstration, not somebody's library. What goes:
   the story's own title block, the pre-read banner, the "shared by a family"
   notice — which says again what the section above it just said, and sat
   against the top of the book — and the made-from panel.

   What stays: the row under the book. It holds full screen, print, and the
   narrator, which are the features worth showing and were the whole reason for
   putting a real book here rather than a picture of one. Hiding that row is
   how the narrator disappeared. */
.sample-book .reader-head,
.sample-book .preread,
.sample-book .shared-banner,
.sample-book .made { display: none; }

/* Not the exit. It ships hidden and is revealed only in full screen, so it
   costs the landing nothing — and hiding it left somebody who pressed "read
   full screen" with no way back but the Escape key. */

/* The row is the demonstration's controls, so it gets the room it needs rather
   than sitting against the page turn above it. */
.sample-book .reader-actions {
  margin-top: 1.75rem;
  justify-content: center;
}
/* The reader's own page puts a stitched divider here; on the landing the
   section below provides the separation. */
.sample-book .wrap > .stitch:first-child { display: none; }

.sample-note {
  margin: 0;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.day .sample-note { color: var(--on-day-soft); }

/* ─── The children a parent writes for ─────────────────────────────────────
   A short list of people, not a table of records. Each card leads with the
   toy's photo and the child's name, because that is how a parent recognises
   which one is which — long before they read an age. Everything that changes
   a profile is folded away behind it: the page is for looking at, and editing
   is the occasional thing. */

.page-children { background: var(--ink); color: var(--on-night); min-height: 100vh; }
.children { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }

/* Said plainly, near the top, because who else can read this is the question
   a parent has before they type a child's name into anything. */
.children-privacy {
  margin: 0 0 1.8rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--ink-line);
  border-left: 2px solid color-mix(in srgb, var(--sage) 70%, transparent);
  border-radius: var(--radius-sm);
  font-size: var(--step--1);
  color: var(--on-night-soft);
}

.child-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.child-card {
  padding: 1.2rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
}

.child-head { display: flex; gap: 1.1rem; align-items: flex-start; }

/* Round, small, and the same size whether or not there is a photo — a card
   that changes shape when a toy is added reads as two different cards. */
/* The two faces. The child's is the one the card leads with; the companion's
   sits beside its own name, smaller, because it is the second character and
   not the subject. Both are links to the whole drawing — a circle this size
   is for recognising somebody, not for judging whether a likeness is right. */
.child-face {
  flex: none;
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--ink-line);
  /* Avatars are drawn on a pale ground; without this the transparent edges
     of a plate would show the page's night blue through the circle. */
  background: var(--wool);
  transition: border-color 0.16s var(--ease);
}
a.child-face:hover { border-color: var(--moon); }
.child-face-small { width: 2.1rem; height: 2.1rem; }
.child-face img,
.child-face-empty {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The figure stands in the middle of a tall plate, so a circular crop has
     to favour the top of it or every avatar is a picture of a pair of shoes. */
  object-position: 50% 22%;
}
.child-face-empty {
  background: color-mix(in srgb, var(--ink-deep) 60%, transparent);
  object-position: initial;
}

.child-companion { display: flex; align-items: center; gap: 0.55rem; }
.child-companion .child-line { margin: 0; }

.child-who { min-width: 0; }
.child-name { margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--step-1); }
.child-meta { margin: 0.15rem 0 0.5rem; font-size: var(--step--1); color: var(--moon); }
.child-line { margin: 0 0 0.25rem; font-size: var(--step--1); color: var(--on-night-soft); }

.child-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.2rem;
}
.child-fold, .child-danger { margin-top: 0; }
.child-fold > .fold-body { padding-top: 1rem; }
/* Removing is a real loss, so its summary carries the warning colour rather
   than a button somewhere waiting to be pressed by accident. */
.child-danger > .fold-summary { color: color-mix(in srgb, var(--rose) 80%, var(--on-night-soft)); }
.child-danger > .fold-summary:hover { color: var(--rose); }

.child-add { margin-top: 1.4rem; }
.form-actions-inline { margin-top: 1.1rem; }

.input-file {
  padding: 0.55rem;
  font-size: var(--step--1);
  color: var(--on-night-soft);
}

/* ─── Picking a saved child, in the studio ─────────────────────────────────
   Chips rather than a select, because there are at most a dozen and a parent
   should see the names without opening anything. */

.child-picker { margin-bottom: 1.1rem; }
.child-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.45rem; }
.child-chip {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  font-size: var(--step--1);
  color: var(--on-night-soft);
  text-decoration: none;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.child-chip:hover { border-color: color-mix(in srgb, var(--moon) 55%, transparent); color: var(--moon); }
.child-chip.is-current {
  border-color: var(--moon);
  color: var(--ink);
  background: var(--moon);
}
.child-chip-new { font-style: italic; }

/* A chip with a face on it is a person rather than a word. */
.child-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.child-chip.has-face { padding-left: 0.3rem; }
.child-chip-face {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  background: var(--wool);
}

/* Who the book is going to be about, while it is being written. */
.picked-faces { display: flex; gap: 0.5rem; margin: 0.1rem 0 0.5rem; }
.picked-face {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 1px solid var(--ink-line);
  background: var(--wool);
}

.text-link { color: var(--moon); }

.remember-child { margin-top: 0.9rem; }

/* The likeness the next book is drawn against. Shown at a size a parent can
   actually judge — a thumbnail of a face is no use for deciding whether it
   still looks like their child — with the explanation beside it. */
.child-reference {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-line);
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}
.child-reference-art {
  flex: none;
  width: 9rem;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-line);
}
.child-reference-text { min-width: 0; display: grid; gap: 0.35rem; justify-items: start; }
.child-reference-title { margin: 0; font-size: var(--step--1); color: var(--on-night); }
.child-reference-text .field-hint { margin: 0; }

@media (max-width: 34rem) {
  .child-reference { flex-direction: column; }
  .child-reference-art { width: 100%; max-width: 14rem; }
}

/* The pair of avatars. Side by side where there is room, because the whole
   point of them is that they are two separate figures rather than a scene. */
.child-avatars {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-line);
  display: grid;
  gap: 0.5rem;
  justify-items: start;
}
.avatar-pair { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0.2rem 0 0.4rem; }
.avatar { margin: 0; display: grid; gap: 0.35rem; justify-items: center; }
.avatar-art {
  width: 7.5rem;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-line);
  /* The avatars are drawn on a pale ground, so they need a light plate
     behind them rather than the page's night blue showing through. */
  background: var(--wool);
}
.avatar-label { font-size: var(--step--1); color: var(--on-night-soft); }
.child-avatar-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.child-avatars form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* ─── Setting up the companion app ───────────────────────────────────────────
   Numbered steps down one column. A step that is satisfied says so with a
   tick; the code is printed large because it is read across a kitchen. */
.setup { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.setup-step {
  padding: 1.2rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
  display: grid;
  /* One column that may never grow past the card: with start-aligned items,
     an auto column sizes to the longest line of text and runs off a phone. */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  justify-items: start;
}
.setup-step-quiet { background: transparent; }
.setup-step-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--step-1);
}
.setup-step-n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--ink-line);
  font-size: var(--step--1);
  color: var(--on-night-soft);
}
.setup-step-n.is-done { background: var(--moon); border-color: var(--moon); color: #1b1f3a; }
.setup-step-n.is-todo { border-color: var(--moon); color: var(--moon); }
.setup-line { margin: 0; color: var(--on-night-soft); max-width: 100%; }
.setup-warning {
  padding: 0.7rem 0.9rem;
  border-left: 2px solid color-mix(in srgb, var(--sage) 70%, transparent);
  border-radius: var(--radius-sm);
  font-size: var(--step--1);
}

.setup-children { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; width: 100%; }
.setup-child {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s var(--ease);
}
.setup-child:hover, .setup-child.is-chosen { border-color: var(--moon); }
.setup-child-name { font-weight: 600; }
.setup-child-meta { grid-column: 1; font-size: var(--step--1); color: var(--on-night-soft); }
.setup-child-pick { grid-column: 2; grid-row: 1 / span 2; font-size: var(--step--1); color: var(--moon); }

.setup-code {
  width: 100%;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  text-align: center;
  padding: 1.2rem 1rem;
  border: 1px dashed var(--moon);
  border-radius: var(--radius);
}
.setup-code-label { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.setup-code-value {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--moon);
  font-variant-numeric: tabular-nums;
}
.setup-status { margin: 0; font-weight: 600; }
.setup-code.is-done { border-style: solid; border-color: var(--sage); }
.setup-code.is-done .setup-status { color: var(--sage); }
.setup-code.is-expired .setup-code-value { opacity: 0.35; text-decoration: line-through; }

/* A child's paired devices: one line each, the remove button at the end.
   Shared by the setup page and the fold on the children page. */
.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; width: 100%; }
.device-list > li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.1rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--ink-line);
}
.device-list > li:last-child { border-bottom: 0; }
.device-list > li > span:first-child { font-weight: 600; }
.device-list > li > .field-hint { grid-column: 1; margin: 0; }
.device-list > li > form { grid-column: 2; grid-row: 1 / span 2; margin: 0; }

/* The grown-up's controls under the setup steps: the PIN the app asks for and
   every device on the account. Set apart from the numbered steps, since they
   are for later as much as for now. */
.setup-grown-up { margin-top: clamp(2rem, 5vw, 3rem); display: grid; gap: 1rem; scroll-margin-top: 5rem; }
.setup-section-title { margin: 0; font-size: var(--step-2); }
.pin-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.8rem 1rem; width: 100%; }
.pin-form .field { flex: 0 1 9rem; margin: 0; }
.pin-input { letter-spacing: 0.5em; font-variant-numeric: tabular-nums; text-align: center; }

/* What the companion answers in: four choices, one line each. */
.speaks-form { display: grid; gap: 0.9rem; width: 100%; justify-items: start; }
.speaks-choices { border: 0; margin: 0; padding: 0; display: grid; gap: 0.5rem; width: 100%; }
.speaks-choice {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.16s var(--ease);
}
.speaks-choice:hover, .speaks-choice:has(input:checked) { border-color: var(--moon); }
.speaks-choice input { accent-color: var(--moon); margin: 0; }

/* The moment the phone pairs: the code gives way to a tick that draws itself.
   Drawn once, quickly, and not at all for anybody who has asked for less
   motion — it is a confirmation, not a show. */
.setup-success { display: grid; justify-items: center; gap: 0.6rem; padding-block: 0.4rem; }
.setup-success[hidden] { display: none; }
.setup-success-mark { width: 4.5rem; height: 4.5rem; }
.setup-success-ring { stroke: var(--sage); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; }
.setup-success-tick {
  stroke: var(--sage); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 36; stroke-dashoffset: 36;
}
.is-done .setup-success-ring { animation: setup-draw 0.5s var(--ease) forwards; }
.is-done .setup-success-tick { animation: setup-draw 0.35s var(--ease) 0.4s forwards; }
.is-done .setup-success-mark { animation: setup-pop 0.35s var(--ease) 0.7s both; }
.setup-success-title { margin: 0; font-size: var(--step-2, 1.7rem); font-weight: 700; color: var(--sage); }
@keyframes setup-draw { to { stroke-dashoffset: 0; } }
@keyframes setup-pop { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .setup-success-ring, .setup-success-tick { stroke-dashoffset: 0; animation: none !important; }
  .is-done .setup-success-mark { animation: none; }
}

/* ─── What they talked about: the parent's conversations ──────────────────
   The list, one child at a time, with how it has been going across their
   conversations and the books that could come of it; then one conversation,
   every word, set out as the exchange it was. Every state a record can be in
   is said in words and coloured to match, and the loudest thing on the page
   is always a tier a parent has to act on. */
.ctalk-parent { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.ctalk-parent .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
.ctalk-parent .page-title { margin-bottom: 0; }
.ctalk-parent .hint { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.ctalk-parent .section-title { margin: 0 0 0.6rem; font-size: var(--step-1); }
.ctalk-parent .section-lead { margin: -0.3rem 0 0.8rem; font-size: var(--step--1); }
.ctalk-parent .empty { color: var(--on-night-soft); }

.ctalk-kids { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ctalk-kid {
  padding: 0.45rem 1rem;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  color: var(--on-night-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--step--1);
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.ctalk-kid:hover { border-color: var(--moon); color: var(--on-night); }
.ctalk-kid.is-current { background: var(--moon); border-color: var(--moon); color: #1b1f3a; }

.ctalk-over, .ctalk-themes, .ctalk-ideas, .ctalk-block {
  padding: 1.2rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
}
.ctalk-over { border-color: color-mix(in srgb, var(--moon) 45%, var(--ink-line)); }
.ctalk-over-text { margin: 0 0 0.8rem; line-height: 1.6; }
.ctalk-shifts { margin: 0 0 0.8rem; padding-left: 1.1rem; display: grid; gap: 0.35rem; color: var(--on-night-soft); }

.ctalk-idea-list { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 0.8rem; }
.ctalk-idea {
  display: grid; gap: 0.5rem; justify-items: start;
  padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--moon) 55%, transparent);
  border-radius: var(--radius-sm);
}
.ctalk-idea p { margin: 0; color: var(--on-night-soft); font-size: var(--step--1); }
.ctalk-idea-title { margin: 0; font-size: var(--step-0); color: var(--moon); }

.ctalk-theme-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.ctalk-theme-count { margin-left: 0.5rem; font-size: var(--step--1); color: var(--on-night-soft); }
.ctalk-theme-times { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.3rem; font-size: var(--step--1); }
.ctalk-theme-times a { color: var(--moon); margin-right: 0.4rem; }
.ctalk-theme-times q { color: var(--on-night-soft); font-style: italic; }

.ctalk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.ctalk-row {
  padding: 1rem 1.1rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  display: grid; gap: 0.45rem;
  transition: border-color 0.16s var(--ease);
}
.ctalk-row:has(.ctalk-row-link:hover) { border-color: var(--moon); }
.ctalk-row p { margin: 0; }
.ctalk-row-link {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem;
  color: inherit; text-decoration: none;
}
.ctalk-row-when { font-weight: 700; }
.ctalk-row-kid {
  padding: 0.1rem 0.6rem; border-radius: 999px; font-size: var(--step--1); font-weight: 600;
  background: color-mix(in srgb, var(--moon) 18%, transparent); color: var(--moon);
}
.ctalk-row-story { color: var(--on-night-soft); font-size: var(--step--1); }
.ctalk-row-state { margin-left: auto; font-size: var(--step--1); color: var(--on-night-soft); }
.ctalk-row-gist { color: var(--on-night-soft); font-size: var(--step--1); line-height: 1.55; }
.ctalk-row-silent { border-style: dashed; color: var(--on-night-soft); font-size: var(--step--1); }
.ctalk-row-loud { border-color: color-mix(in srgb, var(--rose) 60%, transparent); }

.ctalk-tier { margin: 0; font-weight: 700; font-size: var(--step--1); }
.ctalk-tier-1 { color: var(--sage); }
.ctalk-tier-2 { color: var(--amber); }
.ctalk-tier-3 {
  color: var(--rose); padding: 0.6rem 0.8rem; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--rose) 14%, transparent);
}
.ctalk-expiring { margin: 0; font-size: var(--step--1); color: var(--amber); }

.ctalk-crumb { margin: 0; font-size: var(--step--1); }
.ctalk-crumb a { color: var(--moon); }
.ctalk-state { margin: 0; font-weight: 600; }
.ctalk-state-complete { color: var(--sage); }
.ctalk-state-incomplete, .ctalk-state-gapped { color: var(--amber); }
.ctalk-gap { margin: 0; color: var(--on-night-soft); font-size: var(--step--1); }
.ctalk-block > p { margin: 0 0 0.6rem; line-height: 1.6; }
.ctalk-new, .ctalk-back { font-size: var(--step--1); color: var(--on-night-soft); }
.ctalk-quotes { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.ctalk-quotes q {
  display: block; padding-left: 0.8rem; font-style: italic;
  border-left: 2px solid var(--moon);
}
.ctalk-suggest { display: grid; gap: 0.7rem; justify-items: start; border-style: dashed; border-color: var(--moon); }
.ctalk-suggest p { margin: 0; }
.ctalk-keep { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.ctalk-ask { margin: 0.2rem 0 0.6rem; }
.ctalk-writing {
  margin: 0 0 0.6rem; font-weight: 600; color: var(--moon);
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.ctalk-live { display: grid; gap: 1.4rem; }
.ctalk-live:empty { display: none; }

/* Something is being written: a ring that turns, so the page never looks
   stuck. For anybody who asked for less motion it breathes instead. */
.spinner {
  flex: none;
  width: 1.1rem; height: 1.1rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--moon) 25%, transparent);
  border-top-color: var(--moon);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinner-breathe { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: spinner-breathe 1.6s ease-in-out infinite; border-top-color: color-mix(in srgb, var(--moon) 25%, transparent); background: var(--moon); }
}

/* A button whose press is on its way: the ring replaces its words' place
   beside them, and it cannot be pressed twice. */
.button.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.button.is-busy::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(27, 31, 58, 0.25);
  border-top-color: #1b1f3a;
  animation: spin 0.8s linear infinite;
}
.button-quiet.is-busy::after, .button:not(.button-primary).is-busy::after {
  border-color: color-mix(in srgb, var(--moon) 25%, transparent);
  border-top-color: var(--moon);
}
@media (prefers-reduced-motion: reduce) {
  .button.is-busy::after { animation: spinner-breathe 1.6s ease-in-out infinite; }
}
.ctalk-askbox {
  padding: 1.2rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
  display: grid; gap: 0.7rem;
}
.ctalk-askbox .section-title { margin-bottom: 0; }
.ctalk-ask-form { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ctalk-ask-form .input { flex: 1 1 16rem; min-width: 0; }
.ctalk-answer {
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--moon);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--moon) 8%, transparent);
  line-height: 1.6;
}
.ctalk-answer p { margin: 0 0 0.5rem; }
.ctalk-answer p:last-child { margin-bottom: 0; }
.ctalk-answer ul { margin: 0 0 0.5rem; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.ctalk-answer ul:last-child { margin-bottom: 0; }
.ctalk-cite {
  display: inline-grid; place-items: center;
  width: 1.3rem; height: 1.3rem; margin: 0 0.15rem;
  border-radius: 50%;
  font-size: 0.72rem; text-decoration: none; vertical-align: 0.1em;
  background: color-mix(in srgb, var(--moon) 22%, transparent); color: var(--moon);
}
.ctalk-cite:hover { background: var(--moon); color: #1b1f3a; }
/* The line a citation opened, shown for a moment so the eye lands on it. */
.ctalk-turn:target { outline: 2px solid var(--moon); outline-offset: 3px; scroll-margin-top: 6rem; }
.ctalk-auto {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
}
.ctalk-auto .hint { flex: 1 1 18rem; }

/* The transcript as the exchange it was: the child on one side, the
   companion on the other, so a parent reads who said what at a glance. */
.ctalk-transcript { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.ctalk-turn {
  max-width: min(34rem, 88%);
  padding: 0.7rem 0.95rem;
  border-radius: 1rem;
  display: grid; gap: 0.2rem;
}
.ctalk-turn p { margin: 0; line-height: 1.5; }
.ctalk-turn-who { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }
.ctalk-turn time { font-size: 0.72rem; opacity: 0.6; justify-self: end; }
.ctalk-turn-child {
  justify-self: end;
  background: var(--moon); color: #1b1f3a;
  border-bottom-right-radius: 0.3rem;
}
.ctalk-turn-companion {
  justify-self: start;
  background: var(--ink-soft); color: var(--on-night);
  border: 1px solid var(--ink-line);
  border-bottom-left-radius: 0.3rem;
}
.ctalk-turn-loud { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ─── Privacy, terms, help, and deleting an account ────────────────────────
   Long reading on the night page, set for reading rather than scanning: one
   narrow column, generous leading, and headings that anchor for the links
   the documents make to each other. */
.page-legal { background: var(--ink); color: var(--on-night); min-height: 100vh; }
.legal { padding-block: clamp(1.5rem, 4vw, 3rem) var(--band); }
.legal-head { margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.legal-updated { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.legal p, .legal li { line-height: 1.65; color: var(--on-night-soft); }
.legal-intro p:first-child { font-size: var(--step-1); color: var(--on-night); }
.legal a { color: var(--moon); text-underline-offset: 0.18em; }
.legal-toc {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 40%, transparent);
}
.legal-toc-title {
  margin: 0 0 0.5rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-night-soft);
}
.legal-toc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
.legal-section { margin-top: clamp(1.75rem, 3.5vw, 2.5rem); scroll-margin-top: 5rem; }
.legal-title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.2;
  color: var(--on-night);
}
.legal-sub {
  margin: 1.4rem 0 0.4rem;
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--on-night);
}
.legal-list { margin: 0.4rem 0 1rem; padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.legal-company {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--ink-line);
  font-size: var(--step--1);
}
.legal-remove { margin-top: 2rem; display: grid; gap: 1rem; justify-items: start; }
.legal-check { display: flex; gap: 0.7rem; align-items: flex-start; cursor: pointer; }
.legal-check input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--rose); flex: none; }
.legal-notice {
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--amber);
  background: color-mix(in srgb, var(--ink-soft) 55%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* The footer's links to them. */
.sitefoot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.sitefoot-links a { color: inherit; text-underline-offset: 0.18em; }
.sitefoot-company { margin: 0.4rem 0 0; font-size: var(--step--1); opacity: 0.8; }

/* The companion's permission step, before any pairing code. */
.consent { display: grid; gap: 0.9rem; padding: 1.2rem 1.3rem; border: 1px solid var(--ink-line); border-radius: var(--radius); background: color-mix(in srgb, var(--ink-soft) 45%, transparent); }
.consent-title { margin: 0; font-family: var(--display); font-weight: 500; font-size: var(--step-1); }
.consent-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.45rem; line-height: 1.55; }
.consent a { color: var(--moon); }
.consent-given { margin: 0.2rem 0 0; font-size: var(--step--1); opacity: 0.75; }

/* ─── The companion app, coming soon ───────────────────────────────────────
   A night band between the redrawn toy and the languages: the same toy, now
   standing in the app. The phone is only a rounded frame around a real
   screenshot; no device chrome to date it. */
.app-soon { padding-block: var(--band); color: var(--on-night); }
.app-soon-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}
.app-soon-body { margin: 0 0 1.4rem; max-width: 50ch; font-size: var(--step-1); color: var(--on-night-soft); }
.app-soon-points { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: 1rem; }
.app-soon-points li { display: grid; gap: 0.2rem; padding-left: 1.1rem; border-left: 2px solid var(--moon); }
.app-soon-points strong { font-family: var(--display); font-weight: 600; font-size: var(--step-1); color: var(--on-night); }
.app-soon-points span { color: var(--on-night-soft); max-width: 52ch; }
.app-soon-note { margin: 0 0 1.4rem; font-size: var(--step--1); color: var(--on-night-soft); max-width: 52ch; }
.app-soon-stores {
  display: inline-flex; align-items: center; gap: 0.6rem; margin: 0;
  padding: 0.55rem 1rem; border: 1px solid var(--ink-line); border-radius: 999px;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.02em; color: var(--on-night);
  background: color-mix(in srgb, var(--ink-soft) 60%, transparent);
}
.app-soon-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--moon); box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--moon) 25%, transparent); }
.app-soon-phone {
  margin: 0; justify-self: center; width: min(19rem, 100%);
  padding: 0.55rem; border-radius: 2.6rem;
  background: var(--ink-deep); border: 1px solid var(--ink-line);
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.45), 0 0 5rem color-mix(in srgb, var(--moon) 12%, transparent);
}
.app-soon-phone img { display: block; width: 100%; height: auto; border-radius: 2.1rem; }
@media (max-width: 52rem) {
  .app-soon-grid { grid-template-columns: minmax(0, 1fr); }
  .app-soon-phone { width: min(16rem, 80%); }
}

/* The companion-app plans on the pricing page: two cards, the fuller one lit,
   each ending in "coming soon" where a buy button will go. */
.price-cards-plans { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.price-card-plan.is-lead { border-color: color-mix(in srgb, var(--moon) 55%, var(--ink-line)); }
.price-list { margin: 0.4rem 0 0.6rem; padding-left: 1.1rem; display: grid; gap: 0.4rem; font-size: var(--step--1); color: var(--on-night-soft); line-height: 1.5; }
.price-soon {
  justify-self: start; margin: 0.4rem 0 0; padding: 0.35rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--ink-line); font-size: var(--step--1); font-weight: 600; color: var(--moon);
}
.price-currency { margin-top: 0.8rem; }
.app-soon-price { margin: 0 0 1rem; color: var(--on-night); font-weight: 600; }
.app-soon-price a { margin-left: 0.5rem; color: var(--moon); font-weight: 500; text-underline-offset: 0.18em; }

/* ─── /app: the companion app, shown properly ──────────────────────────────
   Night throughout, like the book reader it shows. Real screenshots sit in a
   plain rounded frame; the features alternate sides so the eye zigzags down
   the page, and the tablet spread runs wide because it is the one picture
   that only a large screen can make. */
.app-soon-more { margin: 1rem 0 0; }
.page-app .night { color: var(--on-night); }
.ap-hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem); }
.ap-hero-grid, .ap-feature-grid {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}
.ap-chips { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ap-chips li {
  padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid var(--ink-line);
  font-size: var(--step--1); color: var(--on-night-soft); background: color-mix(in srgb, var(--ink-soft) 50%, transparent);
}
.ap-hero-actions { margin-top: 1.8rem; display: grid; gap: 0.9rem; justify-items: start; }
.ap-price { margin: 0; color: var(--on-night); font-weight: 600; }
.ap-price a, .ap-safe-link a { color: var(--moon); font-weight: 500; text-underline-offset: 0.18em; margin-left: 0.4rem; }
.ap-safe-link a { margin-left: 0; }

.ap-phone {
  margin: 0; justify-self: center; width: min(17rem, 100%);
  padding: 0.5rem; border-radius: 2.4rem;
  background: var(--ink-deep); border: 1px solid var(--ink-line);
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.45), 0 0 5rem color-mix(in srgb, var(--moon) 10%, transparent);
}
.ap-phone img { display: block; width: 100%; height: auto; border-radius: 1.95rem; }
.ap-phone.is-hero { width: min(19rem, 100%); }
.ap-phones { display: flex; justify-content: center; align-items: flex-start; gap: clamp(0.8rem, 2vw, 1.5rem); }
.ap-phones-2 .ap-phone { width: min(14.5rem, 48%); }
.ap-phones-2 .ap-phone.is-raised { margin-top: 3rem; }

.ap-how { padding-block: clamp(2rem, 5vw, 3.5rem); }
.ap-steps { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); counter-reset: step; }
.ap-steps li {
  counter-increment: step; display: grid; gap: 0.35rem; padding: 1.2rem 1.3rem 1.3rem;
  border: 1px solid var(--ink-line); border-radius: var(--radius); background: color-mix(in srgb, var(--ink-soft) 45%, transparent);
}
.ap-steps li::before { content: counter(step); font-family: var(--display); font-size: var(--step-2); color: var(--moon); line-height: 1; }
.ap-steps strong { font-family: var(--display); font-weight: 600; font-size: var(--step-1); color: var(--on-night); }
.ap-steps span { color: var(--on-night-soft); }

.ap-feature { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.ap-feature.is-flipped .ap-feature-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.ap-feature.is-flipped .ap-feature-copy { order: 2; }
.ap-body { margin: 0 0 1.3rem; max-width: 50ch; font-size: var(--step-1); color: var(--on-night-soft); }
.ap-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.ap-points li { padding-left: 1.1rem; border-left: 2px solid var(--moon); color: var(--on-night-soft); max-width: 54ch; }

.ap-spread { padding-block: 0 clamp(2rem, 5vw, 3.5rem); }
.ap-tablet { margin: 0 auto; max-width: 56rem; padding: 0.7rem; border-radius: 1.8rem; background: var(--ink-deep); border: 1px solid var(--ink-line); box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.45); }
.ap-tablet img { display: block; width: 100%; height: auto; border-radius: 1.2rem; }
.ap-tablet figcaption { margin: 0.8rem 0.3rem 0.1rem; text-align: center; font-size: var(--step--1); color: var(--on-night-soft); }

.ap-safe { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); }
.ap-safe-list { list-style: none; margin: 1.4rem 0 1.2rem; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.ap-safe-list li { padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--ink-line); color: var(--on-night); background: color-mix(in srgb, var(--ink-soft) 45%, transparent); }
.ap-safe-link { margin: 0; }

.ap-plans { padding-block: clamp(1.5rem, 4vw, 3rem); }
.ap-plans-inner { display: grid; justify-items: start; gap: 0.2rem; }

.ap-closing { padding-block: clamp(2.5rem, 6vw, 5rem) var(--band); }
.ap-closing-inner { display: grid; justify-items: center; gap: 1.4rem; text-align: center; }
.ap-closing-line { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; font-family: var(--display); font-size: var(--step-2); color: var(--on-night); }

@media (max-width: 52rem) {
  .ap-hero-grid, .ap-feature-grid, .ap-feature.is-flipped .ap-feature-grid { grid-template-columns: minmax(0, 1fr); }
  .ap-feature.is-flipped .ap-feature-copy { order: 0; }
  .ap-phone, .ap-phone.is-hero { width: min(15rem, 78%); }
  .ap-phones-2 .ap-phone.is-raised { margin-top: 1.5rem; }
}
.price-card-plan.is-mine { border-color: var(--moon); }
.price-yours { margin: 0.4rem 0 0; font-weight: 600; color: var(--moon); }
.ctalk-plan-note { margin: 0.4rem 0 1.2rem; padding: 0.8rem 1rem; border-radius: var(--radius); border: 1px solid var(--ink-line); color: var(--on-night-soft); background: color-mix(in srgb, var(--ink-soft) 45%, transparent); }
.ctalk-plan-note a { color: var(--moon); margin-left: 0.3rem; text-underline-offset: 0.18em; }
