/* Product pages: the story app (/app/) and the voice studio (/voix/).
   Built on the tokens and components of styles.css; no raw values here.
   1. Page frame shared by both pages
   2. Story app: stepper, screen + aside, action bar, one block per step
   3. Voice studio: wizard, voice list, recording, tuning */

/* ---------- 1. Page frame: content aligned with the top bar ---------- */
.flow, .studioframe { max-width: var(--max); margin: 0 auto; padding: clamp(24px, 4vw, 48px) var(--gutter) var(--sp-8); }
.studioframe .wrap { max-width: 760px; }
.pagehead { margin-bottom: var(--sp-5); }
.pagehead h1 { margin: 0 0 var(--sp-2); }
.pagehead .sub { font-size: var(--fs-lg); }

/* Steppers (app stepper, studio wizard): numbered, because both flows are real sequences.
   States: done = sage tick, current = accent, to do = outlined. */
.stepper { border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.stepper ol { display: flex; gap: var(--sp-1); max-width: var(--max); margin: 0 auto; padding: var(--sp-3) var(--gutter); overflow-x: auto; list-style: none; scrollbar-width: none; }
.stepper li { position: relative; flex: 1 1 0; min-width: 0; }
.stepper li + li::before { content: ""; position: absolute; left: -2px; top: 22px; width: 4px; height: 2px; background: var(--line); }
.stepper button { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--tap); padding: 0 var(--sp-2) 0 0; border: 0; background: none; color: var(--muted); font: 800 var(--fs-sm) var(--body); text-align: left; cursor: pointer; }
.stepper .l { white-space: nowrap; }
.stepper .n, .wizard li::before {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  border: 2px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font: 600 var(--fs-md) var(--display);
}
.stepper li.done .n, .wizard li.done::before { border-color: var(--ok-line); background: var(--ok); color: var(--ok-ink); }
.stepper li.cur .n, .wizard li[aria-current="step"]::before { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.stepper li.done button, .stepper li.cur button { color: var(--ink); }
@media (max-width: 700px) {
  .stepper li { flex: 0 0 auto; }
  .stepper li.cur { flex: 1 0 auto; }
  .stepper li:not(.cur) .l { display: none; }
  .stepper button { gap: var(--sp-2); padding-right: 0; }
  .stepper .n { width: 34px; height: 34px; font-size: var(--fs-sm); }
  .stepper li + li::before { top: 19px; }
}

/* ---------- 2. Story app: screen + illustrated aside ---------- */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 4vw, 56px); align-items: start; }
body[data-layout="wide"] .flow { grid-template-columns: minmax(0, 1fr); }
body[data-layout="wide"] .flow-side { display: none; }
.flow-side { position: sticky; top: 96px; display: grid; gap: var(--sp-5); }
.sidepay .plans { gap: var(--sp-4); }
.sidepay .plan { grid-template-columns: 1fr; }
.sidepay .paywall { margin: 0; }
body[data-pay] .flow-aside { display: none; }
#app { min-width: 0; }
.flow-aside { padding: var(--sp-5); border-radius: var(--r-lg); background: var(--teal); color: var(--night-deep); }
.flow-aside .aside-art { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; margin: 0 0 var(--sp-3); border-radius: var(--r-md); }
.flow-aside p { margin: 0; font-size: var(--fs-md); font-weight: 700; }
@media (max-width: 900px) {
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-side { display: contents; }
  #sidepay { order: 1; }
  .flow-aside { order: -1; display: grid; grid-template-columns: 110px 1fr; gap: var(--sp-4); align-items: center; padding: var(--sp-4); }
  .flow-aside .aside-art { margin: 0; }
  .flow-aside p { font-size: var(--fs-sm); }
}

/* One animal per step in the aside illustration */
.scene-hero .an { display: none; transform: translateY(-14px); }
body[data-step="0"] .a0, body[data-step="1"] .a1, body[data-step="6"] .a2,
body[data-step="3"] .a3, body[data-step="4"] .a4, body[data-step="7"] .a4, body[data-step="5"] .a5 { display: inline; }
.bfly { transform-box: fill-box; transform-origin: center; animation: flutter 3.2s ease-in-out infinite; }
@keyframes flutter { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 50% { transform: translate(14px, -10px) rotate(10deg); } }

/* Action bar at the bottom of each screen: back on the left, next on the right */
.actions { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 2px solid var(--line); }
@media (max-width: 700px) {
  .actions {
    position: sticky; bottom: 0; z-index: 5;
    margin: var(--sp-5) calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad));
    padding: var(--sp-3) var(--card-pad) calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
    border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--surface); box-shadow: var(--shadow-bar);
  }
}

/* Small inline icon lines ("pass the phone", mood and mode summary) */
.phonehint, .modeline { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); }
.phonehint { margin: 0 0 var(--sp-2); }
.modeline { flex-wrap: wrap; }
.phonehint .ic, .modeline .ic { width: 30px; height: 30px; }

/* Step: children */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-1); }
.kid { padding: var(--sp-4); }
.kid-top { display: grid; grid-template-columns: 60px 1fr; gap: var(--sp-3); align-items: start; }
.kid-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-3); }

/* Step: tonight (mood and mode) */
.optgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-4); }
.optgrid .btn.opt small { opacity: .85; }
@media (max-width: 460px) { .optgrid { grid-template-columns: 1fr; } }

/* Step: voices */
.voices { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); margin: var(--sp-4) 0; }
.voice { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3); }
@media (max-width: 420px) { .voice { gap: var(--sp-2); padding: var(--sp-3) var(--sp-2); } .toggle input { width: 26px; height: 26px; } }
.voice small { display: block; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.toggle { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); font-size: var(--fs-sm); font-weight: 800; cursor: pointer; }
.toggle input { width: 32px; height: 32px; }
.roles { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }

/* Step: passion picker (child-facing: very large targets) */
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin: var(--sp-4) 0; }
.pick {
  display: grid; justify-items: center; align-content: center; gap: var(--sp-2);
  min-height: 160px; padding: var(--sp-3) var(--sp-2);
  border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  color: var(--ink); font: 800 var(--fs-lg) / 1.15 var(--body); text-align: center; cursor: pointer;
  transition: transform .08s, box-shadow .08s; animation: pop .35s ease backwards;
}
.pick svg { width: 104px; height: 104px; }
.pick .passion-ico { width: 96px; height: auto; border-radius: 50%; box-shadow: var(--shadow-sm); }
.pick:active, .choice:active, .plan:active { transform: scale(.97); box-shadow: none; }
.pick:nth-child(4n+1), .choice:nth-child(odd) { background: var(--tile-rose); }
.pick:nth-child(4n+2), .choice:nth-child(even) { background: var(--tile-teal); }
.pick:nth-child(4n+3) { background: var(--tile-sage); }
.pick:nth-child(4n+4) { background: var(--tile-mustard); }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@media (min-width: 960px) { body[data-step="6"] .picks { grid-template-columns: repeat(4, 1fr); } }

/* Step: story. The spread: illustration on the left page, text on the right page. */
.stage { display: flex; flex-direction: column; gap: var(--sp-3); }
.card.stage::before, .card.stage::after { display: none; }
.dodo .scene svg { filter: brightness(.88) saturate(.9); }
@media (min-width: 960px) {
  .card.stage { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--sp-6); align-items: start; }
  .card.stage > .scene { position: sticky; top: 96px; }
}

/* Story choices: two large illustrated buttons; the one the narrator is naming is lit (.speaking) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-2); }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-4);
  border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  color: var(--ink); font: 800 var(--fs-lg) / 1.2 var(--body); text-align: center; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.choice .ic { width: 52px; height: 52px; }
.choice-art { display: block; width: 100%; aspect-ratio: 360 / 220; overflow: hidden; border-radius: var(--r-sm); background: var(--surface); }
.choice-art svg { display: block; width: 100%; height: 100%; }
.choice-art.icon { display: grid; place-items: center; }
.choice-art.icon .ic { width: 58%; height: 58%; }
.choice.speaking { transform: scale(1.03); box-shadow: 0 0 0 4px var(--highlight), var(--shadow-md); }
@media (max-width: 380px) { .choices { grid-template-columns: 1fr; } }

/* Paywall (simulated payment) */
.paywall { margin-top: var(--sp-4); padding: var(--sp-4); border-radius: var(--r-md); background: var(--tile-mustard); box-shadow: var(--shadow-sm); }
.paywall::before { content: "\2605"; display: block; margin-bottom: 2px; color: var(--accent); font-size: var(--fs-h3); }
.paywall h3 { margin: 0 0 var(--sp-1); }
.plans { display: grid; gap: var(--sp-4); }
.plan {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-3);
  min-height: 76px; padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm);
  color: var(--ink); font: 800 var(--fs-md) var(--body); text-align: left; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.plan .pp { color: var(--accent); font: 600 var(--fs-h3) var(--display); }
.plan .pd { grid-column: 1 / -1; color: var(--muted); font: 700 var(--fs-xs) var(--body); }
.plan.best { border-color: var(--highlight); }
.checkout .recap { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.checkout .recap small { display: block; color: var(--muted); font: 700 var(--fs-xs) var(--body); }
.checkout .recap .pp { color: var(--accent); font: 600 var(--fs-h3) var(--display); white-space: nowrap; }
.checkout .paymethod { margin-bottom: var(--sp-4); }
.plan.best::after { content: "Recommandé"; position: absolute; top: -14px; right: 14px; padding: 1px var(--sp-3); border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font: 800 var(--fs-xs) var(--body); }

/* Gift card */
.gift {
  display: grid; place-items: center; padding: var(--sp-5) var(--sp-4);
  border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-md);
  color: var(--print-ink); text-align: center;
}
.gift h3 { margin: 0 0 var(--sp-1); color: var(--print-ink); }
.gift svg { width: 180px; height: 180px; margin: var(--sp-3) 0 var(--sp-2); }
.gift small { color: var(--print-muted); font-weight: 700; }
.locked { display: grid; place-items: center; gap: var(--sp-2); width: 180px; height: 180px; margin: var(--sp-3) 0 var(--sp-2); border: 2px dashed var(--line-strong); border-radius: var(--r-md); font: 800 var(--fs-md) var(--display); }

/* ---------- 3. Voice studio ---------- */
.wizard { display: flex; gap: var(--sp-4); margin: 0 0 var(--sp-5); padding: 0; list-style: none; counter-reset: s; }
.wizard li { display: flex; flex: 1; align-items: center; gap: var(--sp-2); min-width: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 800; counter-increment: s; }
.wizard li::before { content: counter(s); }
.wizard li.done::before { content: "\2713"; }
.wizard li.done, .wizard li[aria-current="step"] { color: var(--ink); }
@media (max-width: 560px) { .wizard li:not([aria-current="step"]) { flex: 0 0 auto; font-size: 0; } }

.voicelist { display: grid; gap: var(--sp-3); margin: var(--sp-4) 0; }
.voicecard { display: grid; grid-template-columns: 48px 1fr; gap: var(--sp-1) var(--sp-3); align-items: center; padding: var(--sp-3); }
.voicecard small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.voicecard .row { grid-column: 1 / -1; align-items: center; margin-top: var(--sp-2); }
.checklist, .tips { margin: var(--sp-2) 0 var(--sp-4); padding-left: var(--sp-5); }
.checklist li, .tips li { margin: var(--sp-2) 0; }
.consent { margin-top: var(--sp-3); padding: var(--sp-4); border-style: dashed; border-color: var(--line-strong); color: var(--muted); font-size: var(--fs-sm); }
.consent label { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-3); cursor: pointer; }
.consent label:last-child { margin-bottom: 0; }
.consent input { flex: none; width: 32px; height: 32px; margin: 0; }
details.more { margin-top: var(--sp-4); }
details.more summary { min-height: var(--tap); display: flex; align-items: center; color: var(--ink); font-weight: 800; cursor: pointer; }
details.more summary::before { content: "\25B8"; margin-right: var(--sp-2); }
details.more[open] summary::before { content: "\25BE"; }
details.more[open] summary { margin-bottom: var(--sp-3); }

/* Level meter and progress bars */
.meter, .progress { position: relative; overflow: hidden; border-radius: var(--r-pill); background: var(--line); }
.meter { height: 18px; margin: var(--sp-3) 0; }
.meter span { position: absolute; inset: 0 auto 0 0; width: var(--lvl, 0%); background: var(--ok-line); transition: width .05s linear; }
.meter[data-zone="low"] span { background: var(--line-strong); }
.meter[data-zone="hot"] span { background: var(--accent); }
.progress { height: 12px; margin: var(--sp-4) 0 var(--sp-2); }
.progress div { height: 100%; background: var(--ok-line); transition: width .3s; }
.progress.indet div { width: 40%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* Reading: one text at a time, numbered dots coloured by take quality (ok / warn / bad) */
.take.live { box-shadow: 0 0 0 3px var(--accent), var(--shadow-md); }
.takedots { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-1) 0 var(--sp-4); padding: 0; list-style: none; }
.dot { width: var(--tap); height: var(--tap); border: 2px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font: 800 var(--fs-sm) var(--body); cursor: pointer; }
.dot.ok { border-color: var(--ok-line); background: var(--ok); }
.dot.warn { border-color: var(--warn-line); background: var(--warn); }
.dot.bad { border-color: var(--bad-line); background: var(--bad); }
.dot.cur { box-shadow: 0 0 0 3px var(--ink); }
.dot:disabled { opacity: .6; cursor: not-allowed; }
.script { margin: var(--sp-2) 0 var(--sp-3); color: var(--ink); font: 500 var(--fs-h3) / 1.5 var(--display); }
.takeinfo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.issues { margin: var(--sp-2) 0; padding-left: var(--sp-5); font-size: var(--fs-sm); }
.take audio { width: 100%; margin-top: var(--sp-3); }

/* Tuning: test sentences reuse the choice tile, left aligned */
.tests { display: grid; gap: var(--sp-3); margin-top: var(--sp-3); }
.tests .choice { align-items: stretch; justify-content: center; min-height: 72px; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-md); text-align: left; }
.tests .choice small { font-size: var(--fs-sm); font-weight: 600; }
.tunegrid { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* Pronunciation lexicon */
.lexrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-3); padding: var(--sp-3) 0; border-top: 2px solid var(--line); }
.lexrow .row { grid-column: 1 / -1; margin-top: 0; }
.lexrow label.field { margin: 0; }
@media (max-width: 420px) { .lexrow { grid-template-columns: 1fr; } }

/* ---------- 4. End of story: keepsakes ---------- */
#app > .card + .card { margin-top: var(--sp-6); }
.keepgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); margin-top: var(--sp-4); }
.keepitem h3 { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-h3); }
.keepitem .hint { margin: 0 0 var(--sp-3); }
.keepitem .thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; padding: var(--sp-3); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.keepitem .thumb .scene { width: 100%; }
.keepitem .thumb > svg { max-width: 70%; max-height: 100%; }
@media (max-width: 760px) { .keepgrid { grid-template-columns: 1fr; } }

/* ---------- 5. Studio on desktop: screen + guide rail, like the story app ---------- */
.studioframe .wrap { max-width: none; }
.studio-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.studio-cols #studio { min-width: 0; max-width: 760px; }
.studio-rail { position: sticky; top: 96px; padding: var(--sp-5); border-radius: var(--r-lg); background: var(--teal); color: var(--night-deep); }
.studio-rail h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-h3); color: var(--night-deep); }
.studio-rail ul { margin: 0; padding-left: 20px; }
.studio-rail li { margin: var(--sp-2) 0; font-weight: 700; }
@media (max-width: 900px) {
  .studio-cols { grid-template-columns: minmax(0, 1fr); }
  .studio-rail { position: static; }
}

/* ---------- 6. Personal messages and listening stats ---------- */
.line.message { border-color: var(--highlight); border-style: dashed; font-style: italic; }
.voicecard .listens { color: var(--ink); }
.voicecard .listens b { font-weight: 800; }

/* ---------- 7. Gift pages: choose a voice, a product, the card ---------- */
.voicecard.pickable { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.voicecard.pickable.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.productgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-5); }
.product { display: grid; gap: var(--sp-1); padding: var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.product.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.product .pname { font: 600 var(--fs-h3) var(--display); }
.product .pprice { font: 600 var(--fs-lg) var(--display); color: var(--accent); }
.product .pdesc { color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 560px) { .productgrid { grid-template-columns: 1fr; } }
textarea { width: 100%; padding: var(--sp-3) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--field); color: var(--ink); font: 600 var(--fs-md) / var(--lh-body) var(--body); resize: vertical; }
textarea:focus { border-color: var(--ink); }
.recap { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-5); margin: var(--sp-4) 0; }
.recap dt { color: var(--muted); font-weight: 700; }
.recap dd { margin: 0; font-weight: 700; }
.recap .total { font: 600 var(--fs-h3) var(--display); color: var(--accent); }

/* The gift card: a keepsake that prints on its own */
.giftcard { max-width: 640px; margin-top: var(--sp-6); padding: var(--sp-6); border-radius: var(--r-lg); background: var(--night-deep); color: var(--on-dark); box-shadow: var(--shadow-lg); }
.giftcard h3 { margin: 0; color: var(--on-dark); font-size: var(--fs-h2); line-height: var(--lh-heading); }
.gc-for { margin: 0 0 var(--sp-2); color: var(--highlight); font-weight: 800; }
.gc-msg { margin: var(--sp-5) 0; padding-left: var(--sp-4); border-left: 3px solid var(--highlight); font: 500 var(--fs-lg) / 1.5 var(--display); font-style: italic; }
.gc-foot { display: grid; grid-template-columns: 120px 1fr; gap: var(--sp-5); align-items: center; margin-top: var(--sp-5); }
.gc-qr { padding: var(--sp-2); border-radius: var(--r-sm); background: #fff; }
.gc-qr svg { display: block; width: 100%; height: auto; }
.gc-how { margin: 0 0 var(--sp-2); }
.gc-code { margin: 0; font: 600 28px var(--display); letter-spacing: .06em; color: var(--highlight); }
.giftcard .gc-note { margin: var(--sp-2) 0 0; color: var(--on-dark-muted); word-break: break-all; }
.giftreveal .gc-msg { border-left-color: var(--accent); }
.giftreveal h2 { text-align: left; }
@media print {
  .giftcard { margin: 0 auto; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pagehead, .studio-rail { display: none !important; }
}

/* ---------- 8. The child's thank-you ---------- */
.thanks-rec { display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-4) 0; }
.micbtn { flex: none; display: grid; place-items: center; width: 88px; height: 88px; border: 0; border-radius: 50%; background: var(--accent); box-shadow: var(--shadow-md); cursor: pointer; }
.micbtn .ic { width: 48px; height: 48px; stroke: var(--on-accent); }
.micbtn.live { animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179, 74, 53, .45); } 50% { box-shadow: 0 0 0 14px rgba(179, 74, 53, 0); } }
@media (prefers-reduced-motion: reduce) { .micbtn.live { animation: none; outline: 4px solid var(--highlight); } }
section.thanks audio { width: 100%; }
.thankslist { display: grid; gap: var(--sp-3); margin: var(--sp-4) 0; }
.thanksitem { padding: var(--sp-3) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.thanksitem.fresh { border-color: var(--highlight); }
.thanksitem p { margin: 0 0 var(--sp-2); }
.thanksitem audio { width: 100%; }

/* ---------- 9. Inviting a relative to record their voice ---------- */
.invform { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 2px solid var(--line); }
.sharebox { grid-column: 1 / -1; margin-top: var(--sp-3); padding-top: var(--sp-4); border-top: 2px dashed var(--line-strong); }
.sharebox .verdict { margin: 0 0 var(--sp-4); }
.sharebox input[readonly] { font-size: var(--fs-sm); }
.sharegrid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.sharegrid > :only-child { grid-column: 1 / -1; }
.qrbox { display: grid; gap: var(--sp-2); justify-items: center; text-align: center; }
.qrbox svg { width: 180px; height: 180px; padding: var(--sp-2); border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--field); }
.qrbox small { color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 560px) { .sharegrid { grid-template-columns: 1fr; } }

/* The guest page (the invited relative, mostly on a phone): content first, advice after. */
.guestpage .topbar .brand { margin-right: 0; }
.guest .lead { margin-bottom: var(--sp-5); color: var(--ink); }
.invnote { margin: 0 0 var(--sp-5); padding: var(--sp-4) var(--sp-5); border-left: 4px solid var(--accent); border-radius: var(--r-sm); background: var(--surface-sunk); font: 500 var(--fs-lg) / var(--lh-body) var(--display); }
.invnote cite { display: block; margin-top: var(--sp-2); color: var(--muted); font: 700 var(--fs-sm) var(--body); font-style: normal; }
.invnote cite::before { content: "— "; }
.guesthow { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-4); padding: 0; list-style: none; counter-reset: how; }
.guesthow li { display: grid; grid-template-columns: 40px 1fr; gap: 0 var(--sp-3); align-items: center; counter-increment: how; }
.guesthow li::before { content: counter(how); grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 600 var(--fs-md) var(--display); }
.guesthow span { color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 900px) { .guestpage .studio-rail { order: 0; } }
@media (max-width: 420px) { .guestpage .topbar .brand span { display: inline; } }

/* ---------- 10. Account page ---------- */
.authcard { max-width: 560px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--sp-1); margin: 0 0 var(--sp-5); padding: var(--sp-1); border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface-sunk); }
.segmented button { min-height: var(--tap); border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font: 700 var(--fs-sm) var(--body); cursor: pointer; }
.segmented button.on { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
label.field .pwfield { display: flex; gap: var(--sp-2); align-items: center; margin: 0 !important; }
.pwfield input { flex: 1; min-width: 0; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

/* Girl / boy choice under each child's name */
.kid-gender { margin: var(--sp-3) 0 0; }

/* Girl / boy choice under each child's name */
.kid-gender { margin: var(--sp-3) 0 0; }

/* Print step: book preview, a horizontal strip of pages (cover first) */
.bookpreview { display: grid; grid-auto-flow: column; grid-auto-columns: min(340px, 82%); gap: var(--sp-4); margin: var(--sp-4) 0; padding: var(--sp-2) var(--sp-1) var(--sp-4); overflow-x: auto; scroll-snap-type: x mandatory; }
.bookpreview .page { scroll-snap-align: start; margin: 0; }

/* Waiting screen: the fox reads while the story is prepared */
.card.waiting { max-width: 640px; margin-inline: auto; text-align: center; }
.wait-art { position: relative; width: min(260px, 72%); margin: 0 auto var(--sp-4); }
.wait-art img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-md); animation: bob 2.6s ease-in-out infinite; }
.wait-art .spark { position: absolute; color: var(--highlight); font-size: var(--fs-h3); animation: twinkle 1.8s ease-in-out infinite; }
.wait-art .s1 { top: -6%; left: -8%; }
.wait-art .s2 { top: 18%; right: -10%; animation-delay: .6s; }
.wait-art .s3 { bottom: 8%; left: -12%; animation-delay: 1.2s; }
.waiting .dots span { animation: blink 1.4s infinite; }
.waiting .dots span:nth-child(2) { animation-delay: .2s; }
.waiting .dots span:nth-child(3) { animation-delay: .4s; }
.waiting .progress div { transition: width .9s ease; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wait-art img, .wait-art .spark, .waiting .dots span { animation: none; } }

/* Gift with a printed book: preview strip after the postal address */
.bp-title { margin: var(--sp-5) 0 var(--sp-1); }
.giftbook .scene img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.giftbook .dedic { justify-content: center; }
.giftbook .dedic .msg { margin: 0; font: italic 500 var(--fs-lg) / 1.5 var(--display); }

/* Account: tabs, subscription state, library and gifts lists */
.acctabs { margin: 0 0 var(--sp-4); }
.acctabs button { padding: 0 var(--sp-2); }
.planstate { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.planstate.ok { border-color: var(--ok-line); }
.planstate small { display: block; color: var(--muted); font: 700 var(--fs-xs) var(--body); }
.tag.ok { background: var(--ok); color: var(--ok-ink); }
.tag.off { background: var(--surface-sunk); color: var(--muted); }
.liblist { display: grid; gap: var(--sp-3); margin: var(--sp-4) 0; padding: 0; list-style: none; }
.libitem { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.libitem > img { width: 56px; height: 64px; object-fit: cover; border-radius: var(--r-sm); }
.libbody b { display: block; }
.libbody small { display: block; color: var(--muted); font: 700 var(--fs-xs) var(--body); margin-bottom: var(--sp-1); }
.libbody .tag { display: inline-block; }
.libbody .hint { margin: var(--sp-1) 0 0; }
.libitem.paused > img { filter: grayscale(1); opacity: .6; }
.libitem.paused .libbody b { color: var(--muted); }
@media (max-width: 520px) { .libitem { grid-template-columns: auto minmax(0, 1fr); } .libact { grid-column: 1 / -1; } .acctabs button { font-size: var(--fs-xs); } }
.libline { margin: var(--sp-2) auto 0; width: fit-content; padding: 2px var(--sp-3); border-radius: var(--r-pill); background: var(--ok); color: var(--ok-ink); font: 800 var(--fs-xs) var(--body); text-align: center; }
.libline.off { background: var(--surface-sunk); color: var(--muted); }

/* ---------- Telling the story: mode picker, "Lire ensemble" (full-screen pages), "Écouter" (black screen) ---------- */
.modepick { margin-bottom: var(--sp-4); }
.lockhelp { margin: 0 auto var(--sp-4); max-width: 560px; 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-sm); }
.lockhelp summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.lockhelp ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); }
.lockhelp li + li { margin-top: var(--sp-2); }

body[data-reader] { overflow: hidden; overscroll-behavior: none; }
body[data-reader] .topbar, body[data-reader] .stepper, body[data-reader] .sitefoot, body[data-reader] .flow-side { display: none; }

/* Hold to leave: the bar fills in 3 seconds, letting go cancels. */
.holdexit { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.holdexit .hold-bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.holdexit.holding .hold-bar { transform: scaleX(1); transition: transform 3s linear; }

.reader {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--sp-3);
  padding: max(var(--sp-3), env(safe-area-inset-top)) var(--gutter) max(var(--sp-3), env(safe-area-inset-bottom));
  background: var(--bg); color: var(--ink); touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.reader-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.reader-auto { margin: 0; }
.reader-page { display: grid; gap: var(--sp-4); align-content: center; min-height: 0; overflow: auto; max-width: var(--max); width: 100%; margin: 0 auto; }
.reader-page .scene { cursor: pointer; max-height: 58vh; }
.reader-page .scene svg { max-height: calc(58vh - 8px); object-fit: contain; }
.reader-text { display: grid; gap: var(--sp-2); }
.rline { margin: 0; font: 500 var(--fs-h3) / 1.4 var(--display); opacity: .5; transition: opacity .4s; }
.rline.on { opacity: 1; }
.rline b { font-family: var(--body); color: var(--accent); }
.flip-hint { margin: var(--sp-2) 0 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.reader-nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); }
.reader-nav .navbtn { width: calc(var(--btn-h) * 1.5); padding: 0; }
.reader-nav .navbtn .ic { width: 32px; height: 32px; }
.reader.waiting .navbtn.next { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.reader .choices { margin-top: var(--sp-2); }
@media (min-width: 900px) and (min-aspect-ratio: 4/3) {
  .reader-page { grid-template-columns: 1.3fr 1fr; align-items: center; gap: var(--sp-6); }
  .reader-page .scene, .reader-page .scene svg { max-height: 74vh; }
}
@media (max-width: 520px) { .rline { font-size: var(--fs-lg); } .reader-page .scene { max-height: 46vh; } }
/* Night story read together: deep blue, softer picture, warm text. */
.reader.dodo { background: var(--night-deep); color: var(--on-dark); }
.reader.dodo .scene svg { filter: brightness(.8) saturate(.85); }
.reader.dodo .rline b { color: var(--highlight); }
.reader.dodo .flip-hint, .reader.dodo .toggle { color: var(--on-dark-muted); }
.reader.dodo .btn.ghost { background: transparent; border-color: var(--line-on-dark); color: var(--on-dark); }
.reader.dodo .btn.ghost .ic { stroke: var(--on-dark); }

/* "Quitter l'histoire ?": a small confirmation over the story. */
.quitask { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: var(--sp-3); padding: var(--gutter); background: var(--scrim); color: var(--on-dark); text-align: center; }
.quitask[hidden] { display: none; }
/* Phone held upright: ask to turn it. */
.turnphone { display: none; position: absolute; inset: 0; z-index: 3; place-content: center; justify-items: center; gap: var(--sp-2); padding: var(--gutter); background: var(--scrim); color: var(--on-dark); text-align: center; }
.turnphone-icon svg { width: 72px; height: 72px; animation: turnphone 2.4s ease-in-out infinite; }
.turnphone-title { margin: var(--sp-3) 0 0; font: 600 var(--fs-h3) var(--display); }
.turnphone-text { margin: 0 0 var(--sp-4); color: var(--on-dark-muted); }
.turnphone .linkbtn { color: var(--on-dark); }
@keyframes turnphone { 0%, 25% { transform: rotate(0); } 50%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (orientation: portrait) and (max-width: 820px) { .night .turnphone { display: grid; } .night.portrait-ok .turnphone { display: none; } }
@media (prefers-reduced-motion: reduce) { .turnphone-icon svg { animation: none; transform: rotate(-90deg); } }
.quitask p { margin: 0; font: 600 var(--fs-h3) var(--display); }
.quitask .btn.ghost { background: transparent; border-color: var(--line-on-dark); color: var(--on-dark); }
/* ---------- "Écouter": the illustration fills the screen, the text runs as subtitles ---------- */
.night { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: var(--screen-off); color: var(--on-dark); cursor: default; }
/* Each page is a slide: a blurred copy fills the screen, the whole picture sits on top. The next one fades in. */
.night-scene { position: absolute; inset: 0; transition: opacity 1s ease; }
.night.nopics .night-scene { opacity: 0; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.slide.in { opacity: 1; }
.slide svg { display: block; width: 100%; height: 100%; }
.slide-bg { position: absolute; inset: 0; overflow: hidden; }
.slide-bg svg { filter: blur(28px) brightness(.4) saturate(.9); transform: scale(1.2); }
.slide-fg { position: absolute; inset: 0 0 var(--sub-h, 30vh); display: grid; place-items: center; }
.slide-fg svg { filter: brightness(.85) saturate(.92); animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.05); } }
@media (min-aspect-ratio: 4/3) { .slide-fg { bottom: 0; } }

/* Subtitles: who speaks, the line, the word being read lights up; the page dots underneath. */
.subs {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; gap: var(--sp-2);
  padding: var(--sp-7) var(--gutter) max(var(--sp-4), env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--scrim) 40%); text-align: center;
}
.sub-who { color: var(--highlight); font: 800 var(--fs-sm) var(--body); }
.sub-line { margin: 0; max-width: 34ch; font: 500 var(--fs-h3) / 1.35 var(--display); text-wrap: balance; animation: lineIn .5s ease; }
@keyframes lineIn { from { opacity: 0; transform: translateY(6px); } }
.sub-line .w { opacity: .45; transition: opacity .15s, color .15s; }
.sub-line .w.said { opacity: 1; }
.sub-line .w.now { color: var(--highlight); }
.night-end { margin: 0; font: 500 var(--fs-h3) / 1.35 var(--display); }
.pagedots { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.pagedots i { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--line-on-dark); opacity: .4; }
.pagedots i.on { opacity: 1; background: var(--highlight); }
@media (max-width: 520px) { .sub-line, .night-end { font-size: var(--fs-lg); } }

/* The buttons sit on top and fade away by themselves; a touch brings them back. */
.night-ui {
  position: absolute; top: 0; left: 0; right: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: max(var(--sp-3), env(safe-area-inset-top)) var(--gutter) var(--sp-5); background: linear-gradient(to top, transparent, var(--scrim)); transition: opacity 1.5s ease;
}
.night.asleep .night-ui { opacity: 0; pointer-events: none; }
.night-row { margin: 0; }
.night-pics { margin: 0; color: var(--on-dark-muted); }
.night .btn.ghost { background: transparent; border-color: var(--line-on-dark); color: var(--on-dark); }
.night .holdexit .hold-bar { background: var(--on-dark-muted); }
@media (prefers-reduced-motion: reduce) { .slide, .night-ui { transition: none; } .slide-fg svg, .sub-line { animation: none; } }
@media (prefers-reduced-motion: reduce) { .reader.waiting .navbtn.next { animation: none; } }
/* "Lire ensemble" on the same full screen: tap the picture or swipe to turn; arrows around the dots. */
.night.lire .night-scene { cursor: pointer; }
.pagenav { display: flex; align-items: center; gap: var(--sp-4); margin-top: var(--sp-1); }
.pagenav .pagedots { margin: 0; }
.pagenav .navbtn { width: var(--btn-h); min-height: var(--btn-h); padding: 0; }
.pagenav .navbtn .ic { width: 26px; height: 26px; }
.night .pagenav .btn.ghost .ic { stroke: var(--on-dark); }
.night.waiting .navbtn.next { animation: nudge 1.4s ease-in-out infinite; }
.subs .flip-hint { margin: 0; color: var(--on-dark-muted); font-size: var(--fs-sm); font-weight: 700; }
.subs .hint { color: var(--on-dark-muted); }
.subs .choices { width: min(100%, 560px); }
@media (prefers-reduced-motion: reduce) { .night.waiting .navbtn.next { animation: none; } }
/* Story screen: the settings the parent checks last, just above "Lire l'histoire". */
.storyset { display: grid; gap: var(--sp-2); max-width: 560px; margin: var(--sp-4) auto; }
.setrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunk); }
.setlabel { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-weight: 700; }
.setlabel .ic { flex: none; }
.setlabel .ic { width: 28px; height: 28px; }
.setseg { margin: 0; min-width: 160px; }
/* Player switches; without the voice, the whole page's text is shown for the parent to read aloud. */
.night-switches { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.sub-page { display: grid; gap: var(--sp-2); max-width: 40ch; }
.sub-page .sub-line { max-width: none; font-size: var(--fs-lg); animation: none; }
.sub-page .sub-who { margin-right: var(--sp-1); }
.night.novoice .subs { padding-top: var(--sp-5); }
@media (max-aspect-ratio: 4/3) { .night.novoice .slide-fg { bottom: 52vh; top: var(--sp-7); } }
.night.novoice .subs > .hint { display: none; }
.setnote { margin: calc(var(--sp-2) * -1) 0 var(--sp-2); text-align: center; font-size: var(--fs-sm); }
/* Resume where the story stopped. */
.resume { max-width: 560px; margin: var(--sp-4) auto; padding: var(--sp-4); border: 2px solid var(--highlight); border-radius: var(--r-md); background: var(--warn-soft); text-align: center; }
.resume p { margin: 0 0 var(--sp-2); }
.resume .row { justify-content: center; margin: 0; }
/* End of a night story: the picture slowly darkens, only "Bonne nuit" stays. */
.night .slide { transition: opacity 1.4s ease, filter 20s ease; }
.night.goodnight .slide { filter: brightness(.25); }
.night.goodnight .subs .sub-who, .night.goodnight .subs .sub-line, .night.goodnight .pagenav, .night.goodnight .subs > .hint { opacity: 0; transition: opacity 6s ease; }
.goodnight-word { font-size: var(--fs-h2); }
/* Phone turned sideways: the picture on the left, the text read beside it on the right, like an open book. */
@media (orientation: landscape) and (max-height: 560px) {
  .night .slide-fg { inset: 0 40% 0 0; }
  .night.novoice .slide-fg { inset: 0 40% 0 0; }
  .subs {
    left: 60%; top: 0; align-content: center; padding: var(--sp-6) max(var(--sp-4), env(safe-area-inset-right)) var(--sp-3) var(--sp-4);
    background: linear-gradient(to right, transparent, var(--scrim) 18%);
  }
  .sub-line, .night-end { font-size: var(--fs-lg); }
  .sub-page .sub-line { font-size: var(--fs-md); }
  .subs .hint { font-size: var(--fs-sm); }
  .pagenav { gap: var(--sp-2); }
  .night-ui { padding-bottom: var(--sp-3); }
}

/* ---------- Mes histoires: the library shelf ---------- */
.shelfpage { max-width: var(--max); }
.shelf-sum { margin: 0 0 var(--sp-5); font-size: var(--fs-lg); color: var(--muted); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-5); margin: 0 0 var(--sp-6); padding: 0; list-style: none; }
.shelf-item { display: flex; flex-direction: column; overflow: hidden; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.shelf-cover { position: relative; aspect-ratio: 16 / 10; background: var(--surface-sunk); }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No story picture yet: the univers icon sits as a medallion on a soft sky. */
.shelf-cover:has(.is-icon) { background: linear-gradient(180deg, var(--day-sky), var(--day-sky-2)); }
.shelf-cover img.is-icon { position: absolute; inset: 0; margin: auto; width: auto; height: 80%; aspect-ratio: 360 / 400; object-fit: cover; border-radius: 50%; border: 4px solid var(--surface); box-shadow: var(--shadow-md); }
.shelf-time { position: absolute; left: var(--sp-2); bottom: var(--sp-2); padding: 2px var(--sp-2); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 700 var(--fs-xs) var(--body); }
.shelf-body { flex: 1; padding: var(--sp-4) var(--sp-4) 0; }
.shelf-body h3 { margin: 0 0 var(--sp-1); font-size: var(--fs-h3); }
.shelf-body p { margin: 0 0 var(--sp-2); color: var(--muted); font-size: var(--fs-sm); }
.shelf-act { padding: var(--sp-4); }
.shelf-act .btn { width: 100%; justify-content: center; }
.shelf-item.paused img { filter: grayscale(1); opacity: .6; }
.shelf-new { border-style: dashed; background: var(--surface-sunk); box-shadow: none; }
.shelf-new a { display: grid; flex: 1; place-content: center; justify-items: center; gap: var(--sp-2); min-height: 260px; padding: var(--sp-5); color: var(--ink); text-align: center; text-decoration: none; }
.shelf-new .plus { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--surface); font: 700 32px / 1 var(--body); }
.shelf-new small { color: var(--muted); }
.shelf-new a:hover .plus { box-shadow: var(--shadow-md); }
.offers h2 { margin: 0 0 var(--sp-4); }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-5); }
.offer { display: flex; flex-direction: column; padding: var(--sp-5); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.offer.best { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.offer h3 { margin: 0; }
.offer .amount { margin: var(--sp-2) 0; color: var(--ink); font: 600 var(--fs-h3) / 1.1 var(--display); }
.offer .amount small { color: var(--muted); font-size: var(--fs-md); }
.offer p { flex: 1; margin: 0 0 var(--sp-4); color: var(--muted); }
.offer .btn { align-self: flex-start; }

/* ---------- Referral card ---------- */
.refcard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: center; margin: 0 0 var(--sp-6); padding: var(--sp-5); border: 2px solid var(--accent); border-radius: var(--r-md); background: var(--surface); }
.refcard h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-h3); }
.refcard p { margin: 0; color: var(--muted); }
.refcard .refcount { margin-top: var(--sp-2); color: var(--ink); font-weight: 700; }
.reflink { display: flex; gap: var(--sp-2); }
.reflink input { flex: 1; min-width: 0; min-height: var(--tap); padding: 0 var(--sp-3); border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface-sunk); color: var(--ink); font: 600 var(--fs-sm) var(--body); }
.refcard .hint { grid-column: 2; margin: 0; min-height: 0; }
.refcard .hint:empty { display: none; }
@media (max-width: 760px) { .refcard { grid-template-columns: 1fr; } .refcard .hint { grid-column: 1; } }

/* Offrir: reminder of the chosen gift */
.giftsum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface); border: 2px solid var(--line); color: var(--ink); font-size: var(--fs-sm); }

/* Library: the mascot on the "new story" tile */
.shelf-new .shelf-mascot { width: 120px; height: 120px; margin-bottom: var(--sp-3); object-fit: cover; border-radius: 50%; border: 4px solid var(--surface); box-shadow: var(--shadow-sm); }

/* Mascot on app pages (empty states) */
.mascot-sm { display: block; width: 160px; height: auto; margin: 0 auto var(--sp-2); mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.shelf-new .shelf-mascot { border: 0; border-radius: 0; box-shadow: none; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }

/* Kouti's tip in the creation steps */
.kouti-tip { display: grid; grid-template-columns: 56px 1fr; gap: var(--sp-3); align-items: start; }
.kouti-tip[hidden] { display: none; }
.kouti-tip img { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: var(--shadow-sm); object-fit: cover; }
.kouti-tip b { display: block; margin-bottom: var(--sp-1); font-family: var(--display); font-size: var(--fs-md); }

/* Kouti above every advice rail, like on the home page: soft halo, speech bubble, gentle bob */
.studio-rail { position: relative; top: auto; margin-top: 230px; }
.studio-rail::before { content: ""; position: absolute; top: -236px; left: 50%; margin-left: -120px; width: 240px; height: 240px; background: url(/img/mascotte.webp) center / cover no-repeat; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); animation: rail-kouti-bob 3s ease-in-out infinite; }
.studio-rail::after { content: "Coucou, moi c'est Kouti ! Voici mes conseils."; position: absolute; top: -226px; left: -12px; max-width: 150px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 700; line-height: 1.35; box-shadow: var(--shadow-md); }
@keyframes rail-kouti-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .studio-rail::before { animation: none; } }

/* The offer strip under the creation steps: which plan, what is left this month */
.planbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.planbar[hidden] { display: none; }
.planbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4); max-width: var(--max); margin: 0 auto; padding: var(--sp-2) var(--gutter); font-size: var(--fs-sm); color: var(--muted); }
.planbar .pb-name { color: var(--ink); }
.planbar .pb-item { position: relative; padding-left: var(--sp-4); }
.planbar .pb-item::before { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: var(--line); }
.planbar .pb-link { margin-left: auto; color: var(--accent); font-weight: 800; }
/* Voices screen: what the offer includes */
.offernote { margin: 0 0 var(--sp-4); padding: var(--sp-4); border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.offernote p { margin: var(--sp-1) 0 var(--sp-3); color: var(--muted); font-size: var(--fs-sm); }
.voice.is-locked { opacity: .7; }
.voice-lock { padding: 2px var(--sp-3); border-radius: var(--r-pill); background: var(--surface-sunk); color: var(--muted); font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }
/* Mon compte: upgrade from Une voix */
.upsell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: var(--sp-3) 0; padding: var(--sp-3) var(--sp-4); border: 2px dashed var(--line); border-radius: var(--r-md); }
.upsell small { display: block; color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 640px) { .planbar .pb-item { display: none; } .planbar-in { flex-wrap: nowrap; justify-content: space-between; } .planbar .pb-link { white-space: nowrap; } }
/* Story setup: how to show the story on the TV */
.tvhelp summary .ic { width: 26px; height: 26px; margin-right: var(--sp-2); flex: none; }

/* Production pass: Kouti's bubble stays on screen; the creation tip comes after the task on phones */
@media (max-width: 900px) { .studio-rail::after { left: 0; } .flow-aside { order: 0; } }
/* Kouti's bubble sits above his head, centred, so it never covers him whatever the column width */
.studio-rail { margin-top: 290px; }
.studio-rail::after { top: -292px; left: 50%; right: auto; max-width: 230px; width: max-content; transform: translateX(-50%); text-align: center; }
@media (max-width: 900px) { .studio-rail::after { left: 50%; } }
/* Creation steps: Kouti himself above the tip, like the other advice rails (no step illustration) */
.flow-aside.studio-rail .kouti-tip { display: block; }
@media (max-width: 900px) { .flow-aside.studio-rail { display: block; margin-top: 290px; } }
/* In the creation steps, Kouti's bubble changes with each step */
.flow-aside.studio-rail[data-bubble]::after { content: attr(data-bubble); }

/* ---------- Mes histoires: story cards (NFC) ---------- */
.nfc { margin: var(--sp-7) 0 0; padding: var(--card-pad); border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.nfc h2 { margin: 0 0 var(--sp-2); }
.nfc > p { margin: 0 0 var(--sp-4); color: var(--muted); }
.nfc-new { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }
.nfc-new .field { flex: 1 1 240px; margin: 0; }
.nfc-list { display: grid; gap: var(--sp-3); margin: var(--sp-5) 0 0; padding: 0; list-style: none; }
.nfc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-sunk); }
.nfc-row > div:first-child { flex: 1 1 260px; display: grid; gap: var(--sp-1); }
.nfc-row input { width: 100%; font-size: var(--fs-xs); }
.nfc-act { display: flex; gap: var(--sp-2); }
.nfc-help { margin: var(--sp-4) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.nfc-help summary { cursor: pointer; font-weight: 800; color: var(--ink); }

/* ---------- Story start: the child painted into the pictures ---------- */
.artcard { margin: var(--sp-5) 0; padding: var(--card-pad); border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--surface-sunk); }
.artcard h2 { margin: 0 0 var(--sp-2); text-align: left; }
.artcard .hint { margin: 0 0 var(--sp-3); }
.artcard .progress { margin: var(--sp-2) 0 0; }
.artconsent { display: flex; align-items: flex-start; gap: var(--sp-3); margin: 0 0 var(--sp-3); color: var(--muted); font-size: var(--fs-sm); cursor: pointer; }
.artconsent input { margin-top: 3px; flex: none; }
.arthero { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 0 var(--sp-3); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.progress.indeterminate div { animation: art-wait 1.4s ease-in-out infinite alternate; }
@keyframes art-wait { from { margin-left: 0; } to { margin-left: 65%; } }
@media (prefers-reduced-motion: reduce) { .progress.indeterminate div { animation: none; } }

/* Made-to-measure: the pages just drawn, side by side while the next ones are painted. */
.artthumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); margin: var(--sp-2) 0; }
.artthumbs img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-sm); }
