/* Another Story: the "Apricot" design system (chosen 26 Oct 2026). Soft, cosy and gently playful.
   Rules: design/design-system.md. Mobile first. Dark ("bedtime") when theme.js puts .night on <html>.
   Text and icons on apricot, mint, lilac and butter are always cocoa (--on-color), never white. */

/* =====================================================================
   Tokens
   ===================================================================== */
:root {
  /* Surfaces */
  --bg: #FFF3E8;            /* peach cream page */
  --surface: #FFFFFF;       /* cards, fields */
  --surface-2: #FFE8D6;     /* sunken areas, disabled */
  --line: #F1DCCB;          /* hairlines, dividers (decorative only) */
  --field-line: #9C8378;    /* input borders: 3.5:1 on white */

  /* Text */
  --ink: #2A1E1A;           /* cocoa: all main text. 14.8:1 on --bg */
  --ink-2: #6B5A52;         /* secondary text. 6.0:1 on --bg */
  --link: #9A3D12;          /* links and quiet buttons. 6.3:1 on --bg */
  --on-color: #2A1E1A;      /* text and icons on every colour fill below (light AND dark) */

  /* Brand colours (fills; always carry --on-color text/icons) */
  --apricot: #FF8A4C;       /* main action + "Record". 6.9:1 with --on-color */
  --apricot-press: #F2733A;
  --apricot-deep: #E8692B;  /* apricot for thin shapes (wave, progress): 3.2:1 on white */
  --apricot-soft: #FFE1CF;
  --mint: #9FDFC0;          /* "Tell a memory" */
  --mint-soft: #E1F5EA;
  --lilac: #CBB8FF;         /* "Make one up" */
  --lilac-soft: #EEE8FF;
  --butter: #FFD46B;        /* family: invites, thank-yous, grandparents */
  --butter-soft: #FFF1C9;

  /* Status (text colour on its soft background) */
  --success: #1E6B47;  --success-soft: #E1F5EA;
  --info: #4B3A99;     --info-soft: #EEE8FF;
  --warn: #2A1E1A;     --warn-soft: #FFF1C9;   /* warning = ink on butter, with an icon */
  --error: #A8261B;    --error-soft: #FDE4DF;
  --rec: #D9452F;      /* the "Recording" dot only, always next to the word */

  /* Player bar / toasts (inverted) */
  --inverse: #2A1E1A;
  --inverse-ink: #FFF3E8;
  --inverse-ink-2: #D9C8BD;
  --inverse-track: #4A3A34;

  --focus: #2A1E1A;         /* 3px focus ring */

  /* Type */
  --font-display: "Fredoka", "Avenir Next Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
  --fs-display: clamp(2.75rem, 11vw, 3.5rem);  /* 44–56px  "Hello Nani!" */
  --fs-h1: clamp(2rem, 7.5vw, 2.5rem);         /* 32–40px */
  --fs-h2: 1.5rem;                             /* 24px */
  --fs-h3: 1.25rem;                            /* 20px */
  --fs-body-lg: 1.25rem;                       /* 20px  grandparent pages */
  --fs-body: 1.125rem;                         /* 18px  default */
  --fs-small: 0.9375rem;                       /* 15px  meta only, never instructions */
  --fs-button: 1.25rem;                        /* 20px */
  --lh-tight: 1.05; --lh-head: 1.15; --lh-body: 1.5;

  /* Spacing (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px; --sp-10: 80px;
  --gutter: 20px;

  /* Radius */
  --r-sm: 14px;   /* chips, small tiles */
  --r-md: 20px;   /* fields, notices, toasts */
  --r-lg: 26px;   /* cards, story rows */
  --r-xl: 32px;   /* big choice cards */
  --r-pill: 999px;/* every button */
  --r-blob: 58% 42% 55% 45% / 52% 60% 40% 48%;   /* pebble shape: logo, avatars, decoration */
  --r-blob-2: 45% 55% 40% 60% / 55% 45% 60% 40%;

  /* Sizes */
  --tap: 48px;        /* minimum tap target everywhere */
  --tap-big: 64px;    /* main buttons on grandparent pages */
  --rec-size: 96px;   /* record button */
  --max-calm: 560px;  /* grandparent pages, forms */
  --max-wide: 980px;  /* parent home */

  --shadow: 0 6px 20px rgba(42, 30, 26, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

/* Bedtime / dark: warm cocoa, never pure black. theme.js adds .night. The bedtime player is always dark. */
html.night, .bedtime {
  --bg: #1C1411;
  --surface: #2A201C;
  --surface-2: #352924;
  --line: #4A3A33;
  --field-line: #8C7368;

  --ink: #FFF3E8;
  --ink-2: #CDB8AC;
  --link: #FFB38A;
  --on-color: #2A1E1A;

  --apricot: #FF9A62;
  --apricot-press: #FF8A4C;
  --apricot-deep: #FF9A62;
  --apricot-soft: #4A2A1C;
  --mint: #8ED9B8;    --mint-soft: #1D3A2E;
  --lilac: #B9A6FF;   --lilac-soft: #2F2748;
  --butter: #FFD46B;  --butter-soft: #3D3218;

  --success: #9FE3C2; --success-soft: #1D3A2E;
  --info: #CFC2FF;    --info-soft: #2F2748;
  --warn: #FFF3E8;    --warn-soft: #3D3218;
  --error: #FFA89C;   --error-soft: #4A1F1A;
  --rec: #FF6B55;

  --inverse: #352924;
  --inverse-ink: #FFF3E8;
  --inverse-ink-2: #CDB8AC;
  --inverse-track: #4A3A33;

  --focus: #FFF3E8;
  --shadow: none;
  color-scheme: dark;
}

/* Fonts, self-hosted (both Open Font License): no visitor data goes to Google. */
@font-face { font-family: "Fredoka"; src: url(/fonts/fredoka.woff2) format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/fonts/atkinson-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/fonts/atkinson-700.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/fonts/atkinson-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body { margin: 0; font: 400 var(--fs-body)/var(--lh-body) var(--font-body); background: var(--bg); color: var(--ink); }
img, svg { display: block; max-width: 100%; }
input, textarea, select, button { font-family: inherit; }
a { color: var(--link); text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, .h2, .h3, .btn, .brand { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }
h1, h2, h3 { margin: 0 0 .5em; }
h1 { font-size: var(--fs-h1); line-height: 1.1; }
h2, .h2 { font-size: var(--fs-h2); line-height: 1.2; }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.25; }
h1.h2 { font-size: var(--fs-h1); line-height: 1.1; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-small); }
.serif { font-family: var(--font-body); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; background: var(--inverse); color: var(--inverse-ink); padding: 12px 16px; border-radius: var(--r-md); z-index: 50; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
.nowrap { white-space: nowrap; }
.eyebrow { display: inline-block; font-size: var(--fs-small); font-weight: 700; color: var(--ink-2); margin: 0 0 6px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 32px; height: 32px; flex: none; }
@media (max-width: 360px) {
  .brand { gap: 8px; font-size: 18px; }
  .brand svg { width: 26px; height: 26px; }
  .site-header .btn-sm { padding-inline: 12px; }
}
.who { font-size: var(--fs-small); color: var(--ink-2); display: flex; gap: 12px; align-items: center; min-width: 0; }
.who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-links { display: none; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); text-decoration: none; }
@media (min-width: 860px) { .nav-links { display: flex; } }

/* Page containers */
.maker { max-width: var(--max-calm); margin: 0 auto; padding-top: 20px; padding-bottom: 64px; }
.home-page { max-width: var(--max-wide); }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px;
  border-radius: var(--r-pill); border: 0; font: 600 var(--fs-button)/1 var(--font-display); text-decoration: none; text-align: center;
  cursor: pointer; transition: transform .08s var(--ease), background .15s; }
.btn:active { transform: scale(.98); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-primary { background: var(--apricot); color: var(--on-color); }
.btn-primary:hover { background: var(--apricot-press); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 48px; padding: 0 20px; font-size: 17px; }
.btn[disabled] { background: var(--surface-2); color: var(--ink-2); box-shadow: none; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row .btn { flex: 1 1 220px; }
@media (min-width: 720px) { .btn-row .btn { flex: 0 0 auto; } }
.btn-row.spaced { margin: 20px 0; }
.btn.wide, .btn-col .btn { width: 100%; }
.btn-col { display: grid; gap: 12px; margin: 16px 0; }
.danger { color: var(--error); box-shadow: inset 0 0 0 2px var(--error); background: transparent; }
/* Quiet button: underlined link style, still a 48px target */
.cell-link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; }

/* Continue with Google: Google's own colours (don't recolour). Dark by day on the cream page, white at night. */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; width: 100%; padding: 0 20px;
  margin: 4px 0 14px; background: #131314; color: #E3E3E3; border: 1px solid #8E918F; border-radius: var(--r-pill);
  font-family: Roboto, Arial, sans-serif; font-size: 17px; font-weight: 500; text-decoration: none; }
.google-btn svg { width: 22px; height: 22px; flex: none; background: #fff; border-radius: 50%; padding: 3px; box-sizing: content-box; }
.google-btn:hover { background: #2a2a2c; }
html.night .google-btn { background: #fff; color: #1F1F1F; border-color: #747775; }
html.night .google-btn:hover { background: #f2f2f2; }
.signin-or { color: var(--ink-2); margin: 0 0 8px; }

/* =====================================================================
   Forms
   ===================================================================== */
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 20px; }
@media (min-width: 720px) { .panel { padding: 28px; } }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
label, legend { font-weight: 700; font-size: 17px; }
.hint { font-size: 16px; color: var(--ink-2); margin: 0; font-weight: 400; }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; min-height: 56px; padding: 0 16px; font: inherit; font-size: 18px; color: var(--ink);
  background: var(--surface); border: 2px solid var(--field-line); border-radius: var(--r-md); }
textarea { min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: 3px solid var(--focus); outline-offset: 2px; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
::placeholder { color: var(--ink-2); opacity: .8; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: var(--r-pill);
  border: 2px solid var(--field-line); background: var(--surface); font-weight: 700; font-size: 17px; line-height: 1.2; }
.chip input:checked + span { background: var(--apricot); border-color: var(--apricot); color: var(--on-color); }
.chip input:checked + span::before { content: "✓"; font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chips.age .chip span { min-width: 52px; justify-content: center; padding: 0 10px; }
.chips.age .chip input:checked + span::before { content: none; }
.chip i.child-name { font-style: normal; }
.check { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; font-weight: 400; font-size: 17px; }
.check input { width: 30px; height: 30px; margin: 0; accent-color: var(--apricot-deep); }
p.error { color: var(--error); font-weight: 700; display: flex; gap: 10px; align-items: flex-start; }
p.error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
  background: var(--error); color: var(--surface); font: 700 15px/1 var(--font-body); }
.panel p.error { margin: 0 0 16px; }
.ok { color: var(--success); font-weight: 700; }
.panel .btn-primary[type="submit"] { width: 100%; }

/* =====================================================================
   Messages
   ===================================================================== */
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--info-soft); color: var(--ink); margin-bottom: 20px; }
.notice svg { width: 24px; height: 24px; color: var(--info); flex: none; }
.notice.warn { background: var(--warn-soft); }
.notice.ok { background: var(--success-soft); }
.notice.err { background: var(--error-soft); }
.pending { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-lg); background: var(--surface); }
.pending p { margin: 0; }
.spinner { width: 40px; height: 40px; background: var(--apricot); border-radius: var(--r-blob); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.coach { background: var(--surface-2); border-radius: var(--r-md); padding: 14px 16px; }
.coach p { margin: 0 0 8px; }
.coach ol { margin: 0 0 8px; padding-left: 22px; }
.coach li { margin-bottom: 6px; }
#coach { width: 100%; text-align: left; }
#coach .btn { width: 100%; }

dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100vw - 32px)); max-height: 92vh; overflow-y: auto;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(42, 30, 26, .45); }
.dialog-body { padding: 24px; }
.dialog-body h2 { font-size: var(--fs-h2); }
.dialog-body .panel { padding: 0; margin: 12px 0; }
@media (max-width: 600px) { .dialog-body .btn-row .btn { flex: 1 1 100%; } }

/* Progress dots + "Step 2 of 3" (common.js adds the dots) */
.stepbar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-weight: 700; font-size: 16px; color: var(--ink-2); }
.stepdots { display: inline-flex; gap: 6px; }
.stepdots i { width: 28px; height: 10px; border-radius: var(--r-pill); background: var(--line); }
.stepdots i.on { background: var(--apricot-deep); }

/* =====================================================================
   Player and reading
   ===================================================================== */
.player { background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
.player-top { display: flex; align-items: center; gap: 14px; }
.play { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 0; background: var(--apricot); color: var(--on-color); display: grid; place-items: center; cursor: pointer; }
.play svg { width: 26px; height: 26px; }
.play .i-play { margin-left: 3px; }
.play .i-pause, .player.playing .play .i-play { display: none; }
.player.playing .play .i-pause { display: block; }
.player-meta { min-width: 0; }
.player-title { font-weight: 700; line-height: 1.3; margin: 0; }
.player-sub { margin: 2px 0 0; font-size: var(--fs-small); color: var(--ink-2); }
.seek { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: var(--fs-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.seek input, .bt-seek input { flex: 1; width: 100%; height: 28px; margin: 0; accent-color: var(--apricot-deep); }
.read-aloud { background: var(--surface); border-radius: var(--r-lg); padding: 20px; font-size: 1.2rem; line-height: 1.7; }
.read-aloud h2 { font-size: var(--fs-h2); }
.read-aloud.large { font-size: 1.45rem; }
#script-text p { margin: 0 0 1em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin: 28px 0 12px; }
.toolbar h2 { margin: 0; }

/* Make up a story: progress */
.progress-steps { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 14px; }
.progress-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: center; color: var(--ink-2); }
.progress-steps .dot { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); display: grid; place-items: center; }
.progress-steps .dot svg { width: 16px; height: 16px; display: none; }
.progress-steps li.active { color: var(--ink); font-weight: 700; }
.progress-steps li.active .dot { border-color: var(--apricot-deep); animation: breathe 1.6s ease-in-out infinite; }
.progress-steps li.done { color: var(--ink); }
.progress-steps li.done .dot { background: var(--apricot); border-color: var(--apricot); color: var(--on-color); }
.progress-steps li.done .dot svg { display: block; }
.bar { height: 10px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--apricot-deep); border-radius: inherit; transition: width .8s ease; }
.surprise { display: grid; gap: 4px; justify-items: start; padding: 20px; margin-bottom: 16px; border-radius: var(--r-lg); background: var(--lilac); color: var(--on-color); }
.surprise .h3 { margin: 0; }
.surprise p { margin: 0 0 10px; }
.surprise .muted { color: var(--on-color); }
.surprise .btn-primary { background: var(--surface); color: var(--ink); }
#or-choose { margin: 0 0 10px; }

/* Interview chat (Tell a memory) */
.chat { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.bubble { max-width: 88%; padding: 12px 16px; line-height: 1.5; }
.bubble.q { background: var(--mint-soft); border-radius: 20px 20px 20px 6px; justify-self: start; }
.bubble.a { background: var(--surface); border-radius: 20px 20px 6px 20px; justify-self: end; }
.answer { padding: 14px; position: sticky; bottom: 12px; box-shadow: var(--shadow); }
.answer textarea { min-height: 80px; }
.answer-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.answer .small:not(:empty) { margin: 10px 0 0; }
.mic.live { background: var(--apricot); color: var(--on-color); box-shadow: none; }
#finish { margin-top: 16px; width: 100%; }
.spaced-block { margin: 16px 0 24px; }

/* "What this is" intro with numbered steps */
.intro { margin: 0 0 14px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--apricot-soft); color: var(--ink);
  display: grid; place-items: center; font: 600 16px/1 var(--font-display); }

/* =====================================================================
   Grandparent pages (.big-ui): one step per screen, large type, 64px buttons
   ===================================================================== */
.big-ui { font-size: var(--fs-body-lg); }
.big-ui p { line-height: 1.45; }
.big-ui .btn { min-height: var(--tap-big); width: 100%; }
.big-ui .btn-sm { min-height: 48px; width: auto; font-size: 17px; }
.big-ui .small, .big-ui .hint { font-size: 16px; }
.big-ui .chip span { min-height: 52px; }
.hello { font-size: var(--fs-display) !important; line-height: var(--lh-tight); margin: 0 0 8px; }
.hello-sub { font-size: var(--fs-body-lg); margin: 0 0 24px; }
/* Two pebbles in their own row above the hello, so they never sit behind any letters (decoration only) */
.hello-deco { position: relative; height: 56px; margin: 4px 0 0; }
.hello-deco::before, .hello-deco::after { content: ""; position: absolute; top: 0; }
.hello-deco::before { right: 0; width: 64px; height: 56px; background: var(--butter); border-radius: var(--r-blob); }
.hello-deco::after { right: 56px; top: 22px; width: 36px; height: 32px; background: var(--lilac); border-radius: var(--r-blob-2); }

.choices { display: grid; gap: 14px; margin: 0 0 24px; }
.choice { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 22px 20px; border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; transition: transform .08s var(--ease); }
.choice:first-child { background: var(--apricot); color: var(--on-color); }
.choice:active { transform: scale(.98); }
.choice-icon { flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--on-color); }
.choice:first-child .choice-icon { background: var(--bg); color: var(--ink); }
.choice-icon svg { width: 30px; height: 30px; }
.choice-text { display: block; min-width: 0; }
.choice strong { display: block; font: 600 25px/1.15 var(--font-display); margin-bottom: 4px; }
.choice-text > span { display: block; font-size: 18px; line-height: 1.4; color: var(--ink-2); }
.choice:first-child .choice-text > span { color: var(--on-color); }

/* Thank-you notes at the top of the invite page: white pill rows */
.thanks-banner { display: grid; gap: 10px; margin: 8px 0 8px; }
.thanks-note { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 8px 18px 8px 8px; border-radius: var(--r-pill);
  background: var(--surface); }
.thanks-note p { margin: 0; font-size: 17px; line-height: 1.35; }
.thanks-note .play-sm { order: -1; background: var(--butter); color: var(--on-color); box-shadow: none; min-width: 0; padding: 0 16px; }
@media (max-width: 420px) { .thanks-note { border-radius: var(--r-lg); padding: 10px 14px 10px 10px; } }

/* "Your stories" on the invite page: story rows */
.story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.story-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); }
.story-row-text { display: grid; gap: 2px; min-width: 0; }
.story-row-text strong { font-size: 18px; overflow-wrap: anywhere; }
.listened { font-size: 16px; color: var(--ink-2); }
.listened.yes { color: var(--success); font-weight: 700; }
.thanks-row { background: var(--butter-soft); }
.thanks-row .play-sm { background: var(--butter); }
.big-ui .play-sm, .play-sm { min-height: 48px; min-width: 96px; padding: 0 16px; font-size: 17px; white-space: nowrap; width: auto;
  background: var(--apricot); color: var(--on-color); box-shadow: none; }

.help-card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; margin: 24px 0 8px; }
.help-card h2 { margin: 0 0 6px; }
.help-card p { margin: 0; }
.privacy-line { text-align: center; margin: 16px 0 32px; }

/* =====================================================================
   Recorder (recpanel.js): ready → recording → paused → done
   ===================================================================== */
.recorder-box { padding: 20px 16px !important; text-align: center; margin: 16px 0; }
.recpanel { display: grid; justify-items: center; gap: 12px; }
.rec-intro { margin: 0; color: var(--ink-2); font-size: 18px; }
.rec-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; border-radius: var(--r-pill); background: var(--surface-2);
  font-weight: 700; font-size: 16px; }
.rec-pill::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--rec); }
.recpanel.paused .rec-pill::before { display: none; }
/* The halo: a white disc on two soft pebbles, with the timer and the wave inside */
.rec-halo { position: relative; width: 200px; height: 200px; display: grid; place-items: center; align-content: center; gap: 6px; margin: 10px 0; isolation: isolate; }
.rec-halo::before, .rec-halo::after { content: ""; position: absolute; z-index: -2; }
.rec-halo::before { inset: -14px 6px 10px -16px; background: var(--butter); opacity: .55; border-radius: var(--r-blob); }
.rec-halo::after { inset: 8px -16px -12px 10px; background: var(--lilac); opacity: .7; border-radius: var(--r-blob-2); }
.rec-disc { position: absolute; inset: 0; z-index: -1; border-radius: 50%; background: var(--surface); }
.recpanel .rec-time { font: 600 34px/1 var(--font-display); margin: 0; font-variant-numeric: tabular-nums; }
.recpanel .rec-time .muted { font-size: 16px; font-family: var(--font-display); font-weight: 500; }
.recpanel.counting .rec-time { font-size: 30px; }
.recpanel .wave { width: 150px; height: 56px; }
.recpanel.paused .wave { opacity: .4; }
.recpanel .hearing { min-height: 1.5em; margin: 0; font-weight: 700; font-size: 18px; color: var(--success); }
.recpanel .hearing.quiet { font-weight: 400; color: var(--ink-2); }
.rec-btn { width: var(--rec-size); height: var(--rec-size); border-radius: 50%; border: 0; background: var(--apricot); color: var(--on-color);
  display: grid; place-items: center; cursor: pointer; box-shadow: none; transition: transform .08s var(--ease); }
.rec-btn:active { transform: scale(.96); }
.rec-btn svg { width: 42px; height: 42px; }
.recpanel.counting .rec-btn { outline: 3px dashed var(--apricot-deep); outline-offset: 5px; }
.rec-label { font: 600 20px/1.2 var(--font-display) !important; margin: 0; }
.rec-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.rec-controls .btn { width: 100%; padding: 0 10px; font-size: 18px; white-space: nowrap; }
@media (max-width: 359px) { .rec-controls { grid-template-columns: 1fr; } }
.rec-controls svg { width: 20px; height: 20px; }
.rec-status { margin: 0; }
/* Ready state shows the button; recording and paused show the halo */
.recpanel:not(.recording):not(.paused):not(.counting) .rec-halo,
.recpanel:not(.recording):not(.paused) .rec-pill,
.recpanel:not(.recording):not(.paused) .hearing { display: none; }
.recpanel.counting .rec-halo { display: grid; }
.recpanel.counting .wave { visibility: hidden; }
.mic-guide { width: 100%; background: var(--surface-2); border-radius: var(--r-md); padding: 14px; text-align: left; }
.mic-guide-title { margin: 0 0 8px; }
.mic-guide-pic svg { width: 100%; max-width: 320px; display: block; margin: 0 auto 6px; }

/* Celebrate: floating pebbles (no emoji) */
.celebrate { display: flex; justify-content: center; align-items: flex-end; gap: 14px; height: 56px; margin: 10px 0 0; }
.celebrate span { display: inline-block; font-size: 0; border-radius: var(--r-blob); animation: float-up 2.4s ease-in-out infinite; }
.celebrate span:nth-child(1) { width: 22px; height: 20px; background: var(--apricot); }
.celebrate span:nth-child(2) { width: 16px; height: 16px; background: var(--butter); animation-delay: .3s; border-radius: var(--r-blob-2); }
.celebrate span:nth-child(3) { width: 28px; height: 25px; background: var(--lilac); animation-delay: .6s; }
.celebrate span:nth-child(4) { width: 18px; height: 17px; background: var(--mint); animation-delay: .9s; border-radius: var(--r-blob-2); }
.celebrate span:nth-child(5) { width: 24px; height: 22px; background: var(--apricot); animation-delay: 1.2s; }
@keyframes float-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* Record: "write it down first" */
#write-panel { margin-bottom: 16px; }
#write-panel textarea { min-height: 240px; font-size: 18px; line-height: 1.6; }
#polish-status:not(:empty) { margin: 8px 0 0; }

/* =====================================================================
   Parent home (.calm)
   ===================================================================== */
.home-page > #home > section { margin: 0 0 36px; }
.section-title { font-size: var(--fs-h2); margin: 0 0 12px; }
#signin { max-width: var(--max-calm); }
#signin-error:not([hidden]) { margin: 0 0 12px; }
#signin .help-card { margin: 0 0 16px; }

/* Tonight's story */
.tonight { background: var(--surface); border-radius: var(--r-lg); padding: 24px 20px; margin-top: 4px; }
.tonight .eyebrow { color: var(--ink-2); }
.tonight-title { font-size: var(--fs-h1); margin: 0 0 6px; }
.tonight-meta { color: var(--ink-2); margin: 0 0 18px; }
.tonight-actions { display: grid; gap: 12px; }
@media (min-width: 600px) { .tonight-actions { grid-template-columns: auto auto; justify-content: start; } }
.btn-big { min-height: 64px; }

/* Family row */
.family-row { display: flex; gap: 16px; overflow-x: auto; padding: 6px 4px 8px; }
.person { flex: none; display: grid; justify-items: center; gap: 4px; width: 84px; background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; padding: 0; }
.avatar { display: inline-grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: var(--r-blob); background: var(--butter);
  color: var(--on-color); font: 600 22px/1 var(--font-display); }
.person.fresh .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--apricot-deep); }
.person-name { font-weight: 700; font-size: 15px; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 13px; color: var(--ink-2); }
.person-new, .new-dot { display: inline-block; background: var(--apricot); color: var(--on-color); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); }
.new-dot { margin-right: 8px; vertical-align: 2px; }

/* Make a story: coloured tiles, one colour per job */
.make-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 860px) { .make-tiles { grid-template-columns: repeat(4, 1fr); } }
.make-tile { display: grid; align-content: start; gap: 6px; min-height: 140px; padding: 16px; text-align: left; text-decoration: none; border: 0; border-radius: var(--r-lg);
  background: var(--butter); color: var(--on-color); font: inherit; cursor: pointer; transition: transform .08s var(--ease); }
.make-tile:active { transform: scale(.98); }
.make-tile.t-record { background: var(--apricot); }
.make-tile.t-memory { background: var(--mint); }
.make-tile.t-make { background: var(--lilac); }
.make-tile .tile-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; margin-bottom: 6px; }
html.night .make-tile .tile-icon { background: var(--bg); }
.make-tile .tile-icon svg { width: 26px; height: 26px; }
.make-tile strong { font: 600 18px/1.2 var(--font-display); }
.make-tile span:not(.tile-icon) { font-size: 15px; line-height: 1.35; color: var(--on-color); }

.notify-card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; }
.notify-card p { margin: 4px 0 12px; }

/* Library: filter chips and story rows */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 6px; }
.filter { flex: none; min-height: 44px; padding: 0 18px; border: 2px solid var(--field-line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font: 700 15px/1 var(--font-body); cursor: pointer; }
.filter.on { background: var(--apricot); border-color: var(--apricot); color: var(--on-color); }
.lib-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lib-card { display: grid; grid-template-columns: 48px 1fr 48px; gap: 12px; align-items: start; padding: 12px 14px; background: var(--surface); border-radius: var(--r-lg); }
.lib-card.fresh { box-shadow: inset 0 0 0 2px var(--apricot-deep); }
.lib-card .avatar { width: 48px; height: 48px; font-size: 18px; margin-top: 2px; }
.avatar.c-ai { background: var(--lilac); }
.avatar.c-memory { background: var(--mint); }
.avatar.c-family { background: var(--butter); }
.avatar.c-own { background: var(--apricot); }
.card-play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--apricot); color: var(--on-color); border: 0; cursor: pointer; }
.card-play svg { width: 22px; height: 22px; margin-left: 2px; }
.card-play.idle { background: var(--surface-2); color: var(--ink-2); }
.card-play.idle svg { margin: 0; }
.card-body { min-width: 0; }
.card-title { font-weight: 700; font-size: 17px; margin: 2px 0; line-height: 1.3; overflow-wrap: anywhere; }
.card-meta { color: var(--ink-2); font-size: var(--fs-small); margin: 0 0 4px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0 16px; font-size: 15px; }
.card-more summary { list-style: none; cursor: pointer; color: var(--link); text-decoration: underline; text-underline-offset: 4px; min-height: 44px; display: flex; align-items: center; }
.card-more summary::-webkit-details-marker { display: none; }
.card-more[open] .card-more-menu { display: grid; }
.card-more-menu { display: none; justify-items: start; padding: 2px 0 6px; }
.danger-link { color: var(--error); }
.card-error { color: var(--error); font-weight: 700; }
.card-text { margin-top: 8px; line-height: 1.6; }
.card-text p { margin: 0 0 10px; }
#lib-empty { margin: 8px 0; }

/* Family circle */
.circle { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .circle { grid-template-columns: 1fr 1fr; } }
.circle-card { padding: 16px; background: var(--surface); border-radius: var(--r-lg); display: grid; gap: 12px; }
.circle-card.fresh { box-shadow: inset 0 0 0 2px var(--apricot-deep); }
.circle-head { display: flex; gap: 12px; align-items: center; }
.circle-head .avatar { width: 48px; height: 48px; font-size: 18px; }
.circle-head strong { display: block; font-size: 18px; }
.steps3 { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; font-size: 14px; color: var(--ink-2); }
.steps3 li { position: relative; padding-top: 18px; text-align: center; }
.steps3 li::before { content: ""; position: absolute; top: 0; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--field-line); z-index: 1; }
.steps3 li + li::after { content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 3px; background: var(--line); }
.steps3 li.done { color: var(--ink); font-weight: 700; }
.steps3 li.done::before { background: var(--apricot-deep); border-color: var(--apricot-deep); }
.steps3 li.done + li.done::after { background: var(--apricot-deep); }
.circle-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 15px; }

/* =====================================================================
   Bedtime player: always the warm dark palette (see the token block)
   ===================================================================== */
dialog.bedtime { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; background: var(--bg); color: var(--ink); padding: 0; overflow-y: auto; box-shadow: none; }
dialog.bedtime::backdrop { background: #1C1411; }
.bt-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; position: sticky; top: 0; background: var(--bg); }
.bt-link { background: none; border: 0; color: var(--ink); font: 700 16px/1 var(--font-body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; min-height: 48px; padding: 0 4px; }
#bt-lock { text-decoration: none; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 2px var(--inverse-ink-2); }
.bt-main { max-width: 520px; margin: 0 auto; padding: 12px 20px 40px; text-align: center; }
.bt-who { color: var(--ink-2); margin: 12px 0 4px; }
.bt-title { font-size: var(--fs-h1); margin: 0 0 28px; color: var(--ink); }
.bt-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 22px; }
.bt-play { width: 120px; height: 120px; border-radius: 50%; background: var(--apricot); color: var(--on-color); border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.bt-play svg { width: 48px; height: 48px; }
.bt-play .i-play { margin-left: 6px; }
.bt-play .i-pause, .bedtime.playing .bt-play .i-play { display: none; }
.bedtime.playing .bt-play .i-pause { display: block; }
.bt-skip { width: 64px; height: 64px; border-radius: 50%; background: transparent; color: var(--ink); border: 2px solid var(--inverse-ink-2); font: 600 17px/1 var(--font-display); cursor: pointer; }
.bt-seek { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; color: var(--ink-2); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.bt-repeat { display: inline-flex; align-items: center; gap: 8px; margin: 22px auto 0; min-height: 48px; padding: 0 20px; background: transparent; color: var(--ink);
  border: 0; box-shadow: inset 0 0 0 2px var(--inverse-ink-2); border-radius: var(--r-pill); font: 600 17px/1 var(--font-display); cursor: pointer; }
.bt-repeat[aria-pressed="true"] { background: var(--apricot); color: var(--on-color); box-shadow: none; }
.bt-timer { border: 0; padding: 0; margin: 28px 0 0; }
.bt-timer legend { color: var(--ink-2); font-size: 15px; margin: 0 auto 10px; float: none; }
.bt-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bt-chips label { position: relative; }
.bt-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.bt-chips span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 2px var(--inverse-ink-2); color: var(--ink); font-size: 16px; font-weight: 700; }
.bt-chips input:checked + span { background: var(--apricot); color: var(--on-color); box-shadow: none; }
.bt-chips input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.bt-timer-left { color: var(--ink-2); min-height: 1.4em; margin: 10px 0 0; font-size: 15px; }
.bt-queue-wrap { margin-top: 28px; text-align: left; border-top: 1px solid var(--line); padding-top: 16px; }
.bt-queue-wrap h3 { font-size: 18px; }
.bt-queue { margin: 0; padding-left: 22px; }
.bt-queue li { padding: 4px 0; }
.bt-queue li span { margin-right: 10px; }
.bt-queue .bt-link { color: var(--ink-2); font-size: 15px; min-height: 44px; }
/* Child lock: a dark screen that ignores taps; hold 3 s to unlock */
.bt-lock { position: fixed; inset: 0; background: #1C1411; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 24px calc(48px + env(safe-area-inset-bottom)); color: var(--ink-2); text-align: center; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.bt-lock p { margin: 4px 0; font-size: 15px; }
.bt-lock.holding .bt-unlock { color: var(--ink); }

/* =====================================================================
   Landing page (/welcome, not linked from the app)
   ===================================================================== */
section { padding: 56px 0; }
@media (min-width: 720px) { section { padding: 88px 0; } }
.section-head { max-width: 640px; margin-bottom: 32px; }
.hero { padding-top: 32px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; } }
.hero .lede { font-size: 1.25rem; color: var(--ink-2); max-width: 34em; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 20px 0 0; list-style: none; color: var(--ink-2); }
.pill-list li { display: flex; align-items: center; gap: 6px; }
.pill-list svg { width: 18px; height: 18px; }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 24px; }
a.card { text-decoration: none; color: inherit; }
.card p:last-child { margin-bottom: 0; }
.card.featured { box-shadow: inset 0 0 0 2px var(--apricot-deep); }
.grid-3, .grid-2 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; } .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
ol.grid-3 { list-style: none; padding: 0; margin: 0; }
.icon-badge { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--apricot-soft); color: var(--ink); margin-bottom: 16px; }
.icon-badge svg { width: 24px; height: 24px; }
.icon-badge.sage { background: var(--mint-soft); }
.step-num { font-size: var(--fs-small); font-weight: 700; color: var(--link); }
.cover { aspect-ratio: 4 / 3; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 18px; display: grid; place-items: center; overflow: hidden; }
.cover svg { width: 100%; height: 100%; }
.f-bg { fill: var(--surface-2); } .f-accent { fill: var(--apricot); } .f-ink2 { fill: var(--ink-2); } .f-sage { fill: var(--mint); }
.channels { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .channels { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.channel { padding: 18px; }
.channel h3 { margin: 10px 0 2px; font-size: 1rem; }
.channel .icon-badge { margin: 0; width: 40px; height: 40px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); background: var(--mint-soft); color: var(--ink); }
.tag.soon { background: var(--surface-2); color: var(--ink-2); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
.checks svg { width: 22px; height: 22px; color: var(--success); margin-top: 2px; }
.band { background: var(--surface-2); }
.price { font: 600 2.4rem/1.1 var(--font-display); margin: 8px 0 0; }
.price small { font-size: 1rem; color: var(--ink-2); }
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 36px 20px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { color: var(--ink-2); }
.signup { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 720px) { .signup { grid-template-columns: 1fr 220px auto; align-items: end; } .signup .field { margin: 0; } }
.cta { background: var(--inverse); color: var(--inverse-ink); border-radius: var(--r-xl); padding: 40px 24px; }
@media (min-width: 720px) { .cta { padding: 64px; } }
.cta h2, .cta label { color: var(--inverse-ink); }
.cta p, .cta .hint, .cta .ok { color: var(--inverse-ink-2); }
.site-footer { padding: 40px 0 56px; color: var(--ink-2); font-size: var(--fs-small); }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 24px; }
.footer-row a { color: var(--ink-2); }
section[id] { scroll-margin-top: 64px; }
/* App pages: sections take their spacing from their own class (zero-specificity, so cards keep their padding) */
:where(.maker) section { padding: 0; }
:where(.maker) > section, :where(.maker) > div > section { margin-top: 28px; }

.bt-ic { width: 20px; height: 20px; flex: none; }
#bt-lock { display: inline-flex; align-items: center; gap: 8px; }

/* Numbers (times, dates, durations) in Fredoka: Atkinson's slashed zero reads like "Ø" */
.num, time, .rec-time, .seek span, .bt-seek span, .card-meta, .tonight-meta, .listened, .story-row-text .muted,
.player-sub, .person-sub, .steps3, .bt-timer-left { font-family: var(--font-display); font-weight: 500; }
.rec-time { font-weight: 600; }
/* Thank-yous are family: butter, not apricot */
.big-ui .thanks-note .play-sm, .big-ui .thanks-row .play-sm { background: var(--butter); color: var(--on-color); }

/* Light / dark button in the header (theme.js) */
.theme-toggle { margin-left: auto; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 2px solid var(--line); padding: 0; }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon, html.night .theme-toggle .i-sun { display: none; }
html.night .theme-toggle .i-moon { display: block; }
.nav { gap: 12px; }
.who { flex: 0 1 auto; }
#sign-out { white-space: nowrap; }
@media (max-width: 480px) { #who-email { display: none; } }

/* Plan card on the parents' home */
.plan-card { background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 10px; }
.plan-card.empty { box-shadow: inset 0 0 0 2px var(--apricot-deep); }
.plan-line { margin: 0; }
.plan-line b { font-family: var(--font-display); font-weight: 600; margin-right: 6px; }
#plan-left { color: var(--ink-2); font-family: var(--font-display); font-weight: 500; }
.plan-bar { height: 10px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.plan-bar span { display: block; height: 100%; width: 0; background: var(--apricot-deep); border-radius: inherit; }
.plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
#upgraded:not([hidden]) { margin: 0 0 16px; }
.limit-note { display: grid; gap: 10px; justify-items: start; margin: 8px 0 16px; }
.limit-note p { margin: 0; }

/* Sign-in: one centred card on a soft apricot wash (layout after the Headspace login) */
body.signing-in { background:
  radial-gradient(60% 45% at 12% 18%, var(--butter-soft) 0, transparent 70%),
  radial-gradient(55% 50% at 92% 30%, var(--lilac-soft) 0, transparent 70%),
  radial-gradient(70% 55% at 50% 105%, var(--apricot-soft) 0, transparent 70%),
  var(--bg); background-attachment: fixed; }
body.signing-in .site-header { background: transparent; border-bottom-color: transparent; }
.signin { max-width: 480px !important; margin: 24px auto 56px; }
.signin-card { background: var(--surface); border-radius: var(--r-xl); padding: clamp(28px, 6vw, 44px) clamp(20px, 5vw, 40px); box-shadow: var(--shadow);
  display: grid; gap: 14px; text-align: center; }
.signin-card h1 { margin: 0; font-size: var(--fs-h1); }
.signin-sub { margin: 0 0 6px; }
.signin-sub a { color: var(--link); font-weight: 700; }
.signin-card .google-btn { margin: 4px 0 0; min-height: 56px; }
.signin-card p.error { justify-content: center; text-align: left; margin: 0; }
.signin-card .help-card { text-align: left; margin: 0; background: var(--bg); }
.signin-legal { margin: 0; font-size: var(--fs-small); color: var(--ink-2); }
.signin-legal a { color: var(--link); }
.signin-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; color: var(--ink); font: 600 1.125rem/1.3 var(--font-display); }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin-moments { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 15px; line-height: 1.3; }
.signin-moments li { display: grid; justify-items: center; gap: 8px; }
.moment { width: 64px; height: 64px; border-radius: var(--r-blob); display: grid; place-items: center; color: var(--on-color); }
.moment svg { width: 28px; height: 28px; }
.moment.c-apricot { background: var(--apricot); } .moment.c-mint { background: var(--mint); } .moment.c-lilac { background: var(--lilac); }

/* =====================================================================
   Parents: smaller, calmer type than the grandparents' pages
   (.calm = the parents' home; .parent = Make / Record / Memory when a parent uses them)
   ===================================================================== */
.calm, .parent {
  --fs-display: 2.25rem; --fs-h1: clamp(1.6rem, 6vw, 2rem); --fs-h2: 1.25rem; --fs-h3: 1.0625rem;
  --fs-body: 1rem; --fs-body-lg: 1.0625rem; --fs-small: .875rem; --fs-button: 1.0625rem;
  font-size: var(--fs-body);
}
.calm .btn, .parent .btn { min-height: 48px; padding: 0 22px; }
.calm .btn-sm, .parent .btn-sm { min-height: 40px; font-size: 15px; padding: 0 16px; }
.calm .btn-big { min-height: 52px; }
.calm .section-title { margin-bottom: 10px; }
.calm .card-title { font-size: 16px; }
.calm .card-meta, .calm .card-actions { font-size: 14px; }
.calm .tonight { padding: 20px 18px; }
.calm .tonight-title { margin-bottom: 4px; }
.calm .tonight-meta { margin-bottom: 14px; font-size: 15px; }
.parent label, .parent legend { font-size: 15px; }
.parent .chip span { min-height: 44px; font-size: 15px; padding: 0 14px; }
.parent input[type="text"], .parent input[type="email"], .parent textarea, .parent select { min-height: 48px; font-size: 16px; }
.parent .rec-btn { width: 84px; height: 84px; }
.parent .choice { padding: 16px; }
.parent .choice strong { font-size: 20px; }
.parent .choice-text > span { font-size: 15px; }
.parent .choice-icon { width: 52px; height: 52px; }

/* Make a story: one compact row of four */
.make-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.make-chip { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: var(--r-lg); background: var(--surface);
  color: var(--ink); text-decoration: none; font: 600 14px/1.2 var(--font-display); cursor: pointer; }
.make-chip .tile-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--on-color); }
.make-chip .tile-icon svg { width: 24px; height: 24px; }
.make-chip.t-record .tile-icon { background: var(--apricot); }
.make-chip.t-memory .tile-icon { background: var(--mint); }
.make-chip.t-make .tile-icon { background: var(--lilac); }
.make-chip.t-family .tile-icon { background: var(--butter); }
.make-chip:active { transform: scale(.97); }

/* Library search */
.lib-search { width: 100%; min-height: 48px; margin: 0 0 10px; padding: 0 18px; border-radius: var(--r-pill); border: 2px solid var(--field-line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }

/* Tabs: a floating bar at the bottom, Home · Library · Family */
.home-page { padding-bottom: 120px; }
.tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: 0 8px 28px rgba(42, 30, 26, .14); }
.tab { position: relative; display: grid; justify-items: center; gap: 2px; padding: 7px 0 6px; border-radius: var(--r-pill); color: var(--ink-2);
  text-decoration: none; font: 600 13px/1 var(--font-display); }
.tab svg { width: 22px; height: 22px; }
.tab.on { background: var(--apricot); color: var(--on-color); }
.tab-dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 2px var(--surface); }
.tab-pane > section { margin: 0 0 28px; }

/* Story rows: storyteller, length and "More" on one line */
.card-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.card-line .card-meta { margin: 0; }
.card-line .card-actions { display: contents; }
.card-line .card-more { flex-basis: auto; }
.card-line .card-more[open] { flex-basis: 100%; }
.calm .card-more summary, .calm .card-line .cell-link { min-height: 36px; }
.calm .lib-card { align-items: center; padding: 10px 12px; }
.make-chip small { display: block; font: 400 12px/1.25 var(--font-body); color: var(--ink-2); text-align: center; }
.make-chip { align-content: start; }

/* Grandparent recording consent (invite page) */
.consent-card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; margin: 0 0 24px; display: grid; gap: 12px;
  box-shadow: inset 0 0 0 2px var(--butter); }
.consent-card h2, .consent-card p { margin: 0; }
.consent-card a { color: var(--link); }

/* Deleting: one relative's stories, or the whole family */
.data-card { background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 6px; justify-items: start; }
.data-card h2, .data-card > p { margin: 0; }
.danger-box { width: 100%; display: grid; gap: 10px; padding: 14px; margin-top: 6px; border-radius: var(--r-md); background: var(--error-soft); }
.danger-box p { margin: 0; }
.danger-box input { max-width: 260px; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: var(--error); filter: brightness(.95); }
.btn-danger[disabled] { background: var(--surface-2); color: var(--ink-2); }
html.night .btn-danger:not([disabled]) { color: #2A1E1A; }
.gift-back { margin: 8px 0 16px; }
.gift-back a { color: var(--link); font-weight: 700; }
