/* Vokalyse: shared foundation, loaded by every page.
   1. Design tokens (the charter, see docs/design-charter.md)
   2. Base and typography
   3. Site chrome: top bar and footer
   4. Shared components: buttons, fields, cards, chips, messages, avatars, illustrations, book pages
   5. Motion and print
   Page layouts live in marketing.css (landing) and site.css (story app and voice studio).
   Rule: no raw colour, radius, shadow or font size below the token block. */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;

  /* Palette: picture-book gouache. Use the role tokens below in rules, not these. */
  --navy: #1f3a5f;
  --night-deep: #15294a;
  --night-glow: #2c4f7c;
  --paper: #f6efe2;
  --paper-2: #efe5d2;
  --cream: #fff7e6;
  --teal: #6fa3a8;
  --terra: #b34a35;
  --terra-dark: #973c2a;
  --mustard: #e0aa45;
  --day-sky: #cfe6ef;
  --day-sky-2: #fbeed3;
  --sun: #f2c35b;
  --cloud: #fffaf0;
  --black: #000;

  /* Colour roles */
  --bg: var(--paper);
  --bg-alt: var(--paper-2);
  --surface: #fffaf0;
  --surface-sunk: #fbf3e2;
  --field: #fff;
  --ink: var(--navy);
  --muted: #4d6584;
  --on-dark: var(--cream);
  --on-dark-muted: #c9d5e3;
  --scrim: rgba(5, 15, 35, .72); /* veil behind a dialog over the story */
  --screen-off: var(--black); /* "Écouter": a black screen gives off almost no light */
  --accent: var(--terra);
  --accent-hover: var(--terra-dark);
  --on-accent: var(--cream);
  --highlight: var(--mustard);
  --line: #e3d6bd;
  --line-strong: #d8c7a3;
  --line-on-dark: rgba(255, 247, 230, .7);

  /* Status: soft = message background, strong = badge/dot fill, line = border, ink = text */
  --ok-soft: #eef4e2;
  --ok: #dbe9c6;
  --ok-line: #8aab63;
  --ok-ink: #3e6446;
  --warn-soft: #fbf0d4;
  --warn: #f6e1a8;
  --warn-line: var(--mustard);
  --bad-soft: #fbe7e1;
  --bad: #f2c3b6;
  --bad-line: var(--terra);
  --bad-ink: var(--terra);

  /* Tiles: the four pastel washes that rotate on passion and choice tiles */
  --tile-rose: #f2d0c4;
  --tile-teal: #cfe3e1;
  --tile-sage: #dde7c8;
  --tile-mustard: #f3dfae;

  /* Voice colours: white initials on them pass 4.5:1. Same set as the studio's colour picker. */
  --voice-rose: #c2405f;
  --voice-green: #16796f;
  --voice-violet: #6249c4;
  --maman: var(--voice-rose);
  --papa: var(--voice-green);
  --mamie: var(--voice-violet);

  /* Print */
  --print-ink: #14213d;
  --print-muted: #4a5878;

  /* Type */
  --display: "Newsreader", Georgia, serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 13px;
  --fs-sm: 15px;
  --fs-md: 18px;
  --fs-lg: 20px;
  --fs-h3: 24px;
  --fs-h2: clamp(30px, 3.4vw, 42px);
  --fs-h1: clamp(36px, 4.6vw, 56px);
  --fs-display: clamp(44px, 6.2vw, 80px);
  --lh-tight: 1.02;
  --lh-heading: 1.12;
  --lh-body: 1.55;

  /* Spacing: one 4px-based scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;
  --band-y: clamp(56px, 8vw, 104px);
  --gutter: clamp(16px, 4vw, 40px);
  --card-pad: clamp(22px, 3vw, 40px);
  --max: 1180px;

  /* Radii */
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  /* Shadows: warm paper shadows; lg only on dark grounds */
  --shadow-sm: 0 4px 10px rgba(60, 50, 30, .14);
  --shadow-md: 0 10px 24px rgba(60, 50, 30, .14);
  --shadow-lg: 0 30px 60px rgba(5, 15, 35, .45);
  --shadow-bar: 0 -6px 16px rgba(60, 50, 30, .08);

  /* Controls */
  --tap: 48px;
  --btn-h: 56px;
  --focus: var(--ink);

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .34 0 0 0 0 .2 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100%;
  color: var(--ink); font: 600 var(--fs-md) / var(--lh-body) var(--body);
  background-color: var(--bg);
  background-image: var(--noise), radial-gradient(circle, rgba(150, 120, 70, .10) 1px, transparent 1.5px);
  background-size: 160px 160px, 14px 14px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--ink); letter-spacing: -.01em; line-height: var(--lh-heading); text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); margin: 0 0 var(--sp-3); }
h2 { font-size: var(--fs-h2); margin: 0 0 var(--sp-3); }
h3 { font-size: var(--fs-h3); margin: 0 0 var(--sp-2); }
p { margin: 0 0 var(--sp-3); }
a { color: inherit; }
.sub { margin: 0; color: var(--muted); font-size: var(--fs-md); }
.hint { color: var(--muted); font-size: var(--fs-sm); }
.lead { max-width: 60ch; margin: 0 0 var(--sp-6); color: var(--muted); font-size: var(--fs-lg); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.row { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-5); }

/* Dark grounds switch the focus ring to mustard so it stays visible */
.sitefoot, .night { --focus: var(--highlight); }

/* ---------- 3. Chrome: top bar (light paper bar, navy ink) ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--surface); color: var(--ink); border-bottom: 2px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: var(--sp-5); max-width: var(--max); margin: 0 auto; padding: var(--sp-3) var(--gutter); }
.topbar .brand { display: flex; align-items: flex-end; gap: 0; margin-right: auto; color: var(--ink); text-decoration: none; font: 600 var(--fs-h3) / 1 var(--display); }
.topbar .brand img { width: 54px; height: 54px; margin: 0 0 -6px 0; }
.topbar nav { display: flex; gap: var(--sp-5); }
.topbar nav a { padding: var(--sp-1) 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--highlight); }
@media (max-width: 900px) { .topbar nav { display: none; } }
@media (max-width: 420px) { .topbar .brand span { display: none; } }

/* ---------- 3. Chrome: footer ---------- */
.sitefoot { background: var(--night-deep); color: var(--on-dark-muted); }
.sitefoot-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-6); max-width: var(--max); margin: 0 auto; padding: var(--sp-7) var(--gutter) var(--sp-6); }
.sitefoot h3 { margin: 0 0 var(--sp-3); color: var(--on-dark); font-size: var(--fs-md); }
.sitefoot p { max-width: 42ch; margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.sitefoot ul { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.sitefoot a { color: var(--on-dark-muted); font-size: var(--fs-sm); text-decoration: none; }
.sitefoot a:hover { color: var(--on-dark); text-decoration: underline; }
.sitefoot .legal { grid-column: 1 / -1; max-width: none; margin: 0; padding-top: var(--sp-5); border-top: 1px solid rgba(255, 255, 255, .12); font-size: var(--fs-xs); }
@media (max-width: 700px) { .sitefoot-in { grid-template-columns: 1fr 1fr; } .sitefoot-in > div:first-child { grid-column: 1 / -1; } }

/* ---------- 4. Icons ---------- */
.ic { display: block; flex: none; width: 40px; height: 40px; stroke: var(--ink); stroke-width: 2.4; }

/* ---------- 4. Buttons: primary (.btn), secondary (.btn.ghost), size modifier (.small) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--btn-h); padding: var(--sp-2) var(--sp-5);
  border: 2px solid var(--accent); border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
  font: 600 var(--fs-lg) / 1.2 var(--display); text-align: center; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .08s, background-color .15s, box-shadow .08s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn .ic { width: 28px; height: 28px; stroke: var(--on-accent); }
.btn small { font-family: var(--body); }
.btn.ghost { border-color: var(--ink); background: var(--surface); color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-sunk); }
.btn.ghost .ic { stroke: var(--ink); }
.btn.small { min-height: var(--tap); padding: var(--sp-1) var(--sp-4); font-size: var(--fs-md); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost:disabled:hover { background: var(--surface); border-color: var(--ink); }
.btn:active:not(:disabled) { transform: scale(.97); box-shadow: none; }
/* Secondary on dark grounds: outline in cream */
.night .btn.ghost { border-color: var(--line-on-dark); background: transparent; color: var(--on-dark); }
.night .btn.ghost:hover { background: rgba(255, 255, 255, .08); }

/* Option tile: a big pressable choice (mood, mode). Selected = accent fill with a mustard ring. */
.btn.opt { flex-direction: column; gap: var(--sp-1); min-height: 120px; border-radius: var(--r-lg); }
.btn.opt .ic { width: 56px; height: 56px; }
.btn.opt small { font-size: var(--fs-sm); font-weight: 700; }
.btn.opt.ghost { border-color: var(--line); background: var(--surface-sunk); }
.btn.opt.ghost:hover { border-color: var(--line-strong); }
.btn.opt[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--highlight), var(--shadow-sm); }

/* File picker dressed as a button */
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- 4. Form fields ---------- */
label.field { display: block; margin: 0 0 var(--sp-4); }
label.field span { display: block; margin-bottom: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); font-weight: 800; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
  width: 100%; min-height: var(--btn-h); padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--field); color: var(--ink);
  font: 700 var(--fs-lg) var(--body);
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="date"]:focus, select:focus { border-color: var(--ink); }
input[type="checkbox"] { accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-3); }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 4. Cards: leaf corners and a vine under the title ---------- */
.card {
  position: relative; padding: var(--card-pad);
  border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  background: var(--noise) var(--surface);
}
.card + .card { margin-top: var(--sp-5); }
.card::before, .card::after { content: ""; position: absolute; width: 46px; height: 46px; background: no-repeat center / contain; pointer-events: none; }
.card::before { top: -14px; right: 14px; transform: rotate(8deg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M6 42Q16 10 42 6Q36 34 6 42Z' fill='%236b8f4e'/%3E%3Cpath d='M8 40Q20 24 38 10' stroke='%23fffaf0' stroke-width='1.6' fill='none' opacity='.6'/%3E%3C/svg%3E"); }
.card::after { bottom: -12px; left: 16px; transform: rotate(-70deg) scaleX(-1); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M6 42Q16 10 42 6Q36 34 6 42Z' fill='%23e0aa45'/%3E%3Cpath d='M8 40Q20 24 38 10' stroke='%23fffaf0' stroke-width='1.6' fill='none' opacity='.6'/%3E%3C/svg%3E"); }
.card > h2:first-child::after, .card > p.hint + h2::after {
  content: ""; display: block; width: 96px; height: 12px; margin-top: var(--sp-2);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M2 8Q20 0 40 8T80 8T118 6' fill='none' stroke='%236b8f4e' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M30 7q4-7 9-5-2 6-9 5zM70 9q4 6 9 4-2-6-9-4z' fill='%238aab63'/%3E%3Ccircle cx='100' cy='7' r='3' fill='%23c4553f'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Centred titles carry a centred vine (the centring comes from an inline style in the JS templates) */
.card > p.hint + h2, .card > h2[style*="center"] { text-align: center; }
.card > p.hint + h2::after, .card > h2[style*="center"]::after { margin-inline: auto; }
.card > p.hint { margin: 0 0 var(--sp-1); }
h2.mini { margin: var(--sp-5) 0 var(--sp-3); font-size: var(--fs-h3); }

/* Rows inside a card (a child, a voice, a consent block): sunk surface, medium radius */
.kid, .voice, .voicecard, .consent {
  border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunk);
}

/* ---------- 4. Chips and swatches ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-3) 0 var(--sp-4); }
.chip { min-height: var(--tap); padding: var(--sp-2) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 800 var(--fs-sm) var(--body); cursor: pointer; }
.chip:hover { border-color: var(--line-strong); }
.chip.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chips.big .chip { min-height: var(--btn-h); font-size: var(--fs-md); }
.swatch { width: var(--tap); height: var(--tap); border: 3px solid var(--surface); border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- 4. Messages: banner (page level), verdict (inline result), badge (quality) ---------- */
.banner { margin: var(--sp-3) 0; padding: var(--sp-3) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-sm); }
.banner.ok { border-color: var(--ok-line); background: var(--ok-soft); }
.banner.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.banner.bad { border-color: var(--bad-line); background: var(--bad-soft); }
.banner code { padding: 1px var(--sp-1); border-radius: 6px; background: rgba(31, 58, 95, .08); font-size: var(--fs-xs); }
.verdict { margin: var(--sp-3) 0 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 700; }
.verdict.ok { background: var(--ok-soft); }
.verdict.warn { background: var(--warn-soft); }
.verdict.bad { background: var(--bad-soft); }
.warn-text { display: block; color: var(--bad-ink); }
.badge { padding: 2px var(--sp-3); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 800; }
.badge.ok { background: var(--ok); }
.badge.warn { background: var(--warn); }
.badge.bad { background: var(--bad); }
.tag { padding: 2px var(--sp-3); border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font: 800 var(--fs-xs) var(--body); }

/* ---------- 4. Avatars: .av (a child, pastel + navy initial), .avatar (a voice, strong colour + white initial) ---------- */
.av {
  display: grid; place-items: center; width: 60px; height: 60px;
  border: 2px solid var(--surface); border-radius: 50%; background: var(--c) center / cover no-repeat; box-shadow: var(--shadow-sm);
  color: var(--ink); font: 800 var(--fs-h3) var(--display);
}
.avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-1); }
.avatars .av { width: 56px; height: 56px; }
.avatar {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 2px solid var(--surface); border-radius: 50%; background: var(--c); box-shadow: var(--shadow-sm);
  color: #fff; font: 800 var(--fs-lg) var(--display);
}

/* ---------- 4. Illustrations: framed, gouache displacement filter, paper texture on top ---------- */
.scene { position: relative; overflow: hidden; border: 4px solid var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 2px var(--line), var(--shadow-md); }
.scene svg { display: block; width: 100%; height: auto; border-radius: calc(var(--r-lg) - 4px); filter: url(#gou); }
/* Clean cartoon scenes: no paint wobble, no paper grain. */
.scene svg.toon { filter: none; }
.scene:has(> svg.toon)::after { display: none; }
.scene::after { content: ""; position: absolute; inset: 0; border-radius: calc(var(--r-lg) - 6px); background-image: var(--noise); mix-blend-mode: multiply; opacity: .9; pointer-events: none; }

/* ---------- 4. Story line: one spoken line with its speaker ---------- */
.line {
  padding: var(--sp-3) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunk);
  font-size: var(--fs-lg); line-height: 1.45; opacity: .55; transition: opacity .2s;
}
.line.on { opacity: 1; }
.line .who { margin-bottom: 2px; color: var(--accent); font: 800 var(--fs-sm) var(--body); }

/* ---------- 4. Book and colouring pages (also printed) ---------- */
.pages { display: grid; gap: var(--sp-4); margin-top: var(--sp-4); }
.printpages { display: none; }
.page {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4);
  border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-md);
  color: var(--print-ink); -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.page h3 { color: var(--print-ink); }
.page .scene { border-width: 3px; box-shadow: none; }
.page .scene svg { border-radius: var(--r-sm); }
.page .ptext p { margin: 0 0 var(--sp-2); font: 700 var(--fs-lg) / 1.5 var(--body); }
.page .choice-note { padding-top: var(--sp-2); border-top: 2px dashed #b8c1d6; color: var(--print-muted); font: 700 var(--fs-xs) var(--body) !important; }
.page .cap { margin: 0; color: var(--print-muted); font: 700 var(--fs-sm) var(--body); }
.page .pnum { color: var(--print-muted); font: 800 var(--fs-sm) var(--display); text-align: center; }
.page.cover { align-items: center; text-align: center; }
.page.cover h3 { margin: var(--sp-2) 0 0; font-size: var(--fs-h2); line-height: 1.05; }
.page.cover .cs { margin: 0; color: var(--print-muted); font-weight: 700; }
.page.cover .scene { width: 100%; }
.page .avatars .av, .gift .avatars .av { border-color: var(--print-ink); }
.page .qr svg { width: 150px; height: 150px; }
.page .bookqr { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); text-align: left; }
.page .bookqr svg { width: 96px; height: 96px; flex: none; }
.page .bookqr .cs { font-size: var(--fs-xs); }
.face { width: 64px; height: 64px; border: 3px dashed var(--print-ink); border-radius: 50%; }

/* Colouring version: white shapes, dark outlines, no photos, no paint effects */
.color rect, .color circle, .color ellipse, .color path, .color polygon { fill: #fff; fill-opacity: 1; opacity: 1; stroke: var(--print-ink); stroke-width: 1.6; stroke-linejoin: round; }
.color [fill="none"] { fill: none; }
.color image { display: none; }
.color text { fill: var(--print-ink); stroke: none; }
.scene svg.color { filter: none; }
.scene:has(> svg.color)::after { display: none; }

/* ---------- 5. Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 5. Print: only the book or colouring pages ---------- */
@media print {
  html, body { background: #fff; color: #000; }
  body { background-image: none; }
  .noprint, .card::before, .card::after { display: none !important; }
  .pages, .printpages { display: block !important; margin: 0; }
  .page { min-height: 96vh; border: 0; border-radius: 0; box-shadow: none; break-after: page; }
  .scene svg { filter: none !important; }
  .scene::after { display: none; }
}

/* ---------- 3. Chrome: phone menu (no script: a disclosure) ---------- */
.topbar .menu { display: none; position: relative; }
.topbar .menu summary { list-style: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-sm); cursor: pointer; color: var(--ink); }
.topbar .menu summary::-webkit-details-marker { display: none; }
.topbar .menu summary svg { width: 26px; height: 26px; }
.topbar .menu[open] summary { background: var(--surface-sunk); }
.topbar .menu .menu-panel { position: absolute; right: 0; top: calc(100% + var(--sp-2)); display: grid; min-width: 230px; padding: var(--sp-2); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-md); }
.topbar .menu .menu-panel a { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); color: var(--ink); font-weight: 700; text-decoration: none; }
.topbar .menu .menu-panel a:hover, .topbar .menu .menu-panel a[aria-current="page"] { background: var(--surface-sunk); }
@media (max-width: 900px) { .topbar .menu { display: block; } }


/* Header: hide the main button on the page it leads to; phone menu sits on the far right */
.topbar .btn.small[aria-current="page"] { display: none; }
@media (max-width: 900px) { .topbar .brand { margin-right: auto; } .topbar .menu { order: 2; } }

/* Signed-in / visitor links in the header */
.topbar [data-auth][hidden] { display: none; }

/* Kouti signs the footer of every page */
.sitefoot-in > div:first-child h3 { display: flex; align-items: center; gap: var(--sp-2); }
.sitefoot-in > div:first-child h3::before { content: ""; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--on-dark-muted); background: url(/img/mascotte-rond.webp) center / cover no-repeat; }

/* Production pass: visible focus on file buttons, anchors clear the sticky header */
.filebtn:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
[id] { scroll-margin-top: calc(74px + var(--sp-3)); }

/* Keyboard users can jump straight to the page's content */
.skip { position: absolute; left: var(--sp-3); top: -100px; z-index: 100; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: var(--ink); color: var(--surface); font-weight: 800; text-decoration: none; }
.skip:focus { top: var(--sp-3); }
main:focus { outline: none; }

/* Voice recording: the reassuring summary above the microphone, and the sentence read to prove the
   speaker is really there (public/js/consent.js). */
.voicesafe { margin: 0 0 var(--sp-4); padding: var(--sp-4); border: 1px solid var(--ok-line); border-radius: var(--r-md); background: var(--ok-soft); color: var(--ink); font-size: var(--fs-sm); }
.voicesafe b { display: block; margin-bottom: var(--sp-2); color: var(--ok-ink); }
.voicesafe ul { margin: 0 0 var(--sp-2); padding-left: 1.2em; }
.voicesafe li { margin-bottom: var(--sp-1); }
.script.phrase, .tv-read.tv-phrase { padding: var(--sp-3) var(--sp-4); border-left: 4px solid var(--accent); border-radius: var(--r-sm); background: var(--highlight); }
.script.phrase span, .tv-read.tv-phrase span { display: block; margin-bottom: var(--sp-1); color: var(--muted); font: 400 var(--fs-sm) / 1.4 var(--body); }
.consent a { color: inherit; text-decoration: underline; }
.ai-note { color: var(--on-dark-muted); font-size: var(--fs-xs); }

/* "Une image ne va pas ?": the parent picks a drawn page to report. */
.artreport { margin-top: var(--sp-4); }
.artreport summary { cursor: pointer; font-weight: 800; color: var(--muted); min-height: var(--tap); display: flex; align-items: center; }
.artthumbs.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); }
.thumbpick { padding: 0; border: 2px solid var(--line); border-radius: var(--r-sm, 8px); background: var(--surface); cursor: pointer; overflow: hidden; }
.thumbpick:hover, .thumbpick:focus-visible { border-color: var(--accent); }
.thumbpick img { display: block; width: 100%; height: auto; }
