/* Nos souvenirs : feuille de style v3, fidèle aux maquettes Figma (Fondations, Mobile parents, Dashboard admin).
   Polices : Newsreader (titres), Plus Jakarta Sans (interface), Literata (livre imprimé), embarquées dans fonts/. */
@import url("../fonts/fonts.css");

:root {
  --fond: #F5EEE3; --fond-profond: #EDE2D1; --papier: #FFFCF7; --creux: #F8F1E7; --ligne: #E8DCCB;
  --encre: #2B1F17; --encre-2: #5A4637; --discret: #8A7563;
  --accent: #C25E37; --accent-fort: #A54A27; --accent-doux: #F7E3D5;
  --papa: #C25E37; --papa-doux: #F7E3D5; --maman: #A8507A; --maman-doux: #F4E1EA;
  --or: #D3A042; --or-doux: #F8EBCF; --sauge: #6F8752; --sauge-doux: #E6EDDB;
  --blanc: #FFFFFF; --rec: #C43D2B; --wa: #E2F4E7; --wa-fg: #16723A; --sms-fg: #7A5512;
  --r-s: 12px; --r-m: 16px; --r-l: 24px; --r-xl: 32px; --r-rond: 999px;
  --sh-douce: 0 1px 2px rgba(74, 52, 32, .05), 0 8px 24px rgba(74, 52, 32, .07);
  --sh-elevee: 0 2px 6px rgba(74, 52, 32, .06), 0 18px 40px rgba(74, 52, 32, .14);
  --sh-accent: 0 10px 24px rgba(194, 94, 55, .30);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --livre: "Literata", Georgia, serif;
  /* couleur de la personne connectée (Papa : terre cuite, Maman : rose prune) */
  --moi: var(--papa); --moi-doux: var(--papa-doux);
}
body[data-me="maman"] { --moi: var(--maman); --moi-doux: var(--maman-doux); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 19px/28px var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent-fort); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill, svg.filled { fill: currentColor; }
[hidden] { display: none !important; }
.loading { text-align: center; padding: 40vh 0; color: var(--discret); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Typographie (styles Figma) ---------- */
.t-display { font: 500 40px/46px var(--serif); letter-spacing: -0.015em; margin: 0; }
.t-titre-l, h1 { font: 500 32px/38px var(--serif); letter-spacing: -0.01em; margin: 0; }
.t-question { font: 500 28px/36px var(--serif); letter-spacing: -0.005em; margin: 0; }
.t-titre-m, h2, h3 { font: 600 22px/28px var(--serif); letter-spacing: -0.005em; margin: 0; }
.t-accroche { font: italic 400 20px/28px var(--serif); color: var(--discret); margin: 0; }
.t-corps-l { font: 400 19px/28px var(--sans); margin: 0; }
.t-corps-m { font: 400 17px/26px var(--sans); margin: 0; }
.t-libelle { font: 600 16px/22px var(--sans); margin: 0; }
.t-legende { font: 500 15px/20px var(--sans); margin: 0; }
.t-surtitre { font: 700 13px/16px var(--sans); letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.muted { color: var(--discret); }
.ink2 { color: var(--encre-2); }
.center { text-align: center; }

/* ---------- Écran mobile ---------- */
.screen { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 8px 24px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }
.screen > .grow { flex: 1; }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 8px 0 0; margin: 0 -4px; }
.topbar .tb-title { flex: 1; text-align: center; font: 600 17px/22px var(--sans); color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .tb-spacer { width: 56px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); flex: 1; min-width: 0; }
.brand-tile { width: 40px; height: 40px; border-radius: var(--r-s); background: var(--moi-doux); color: var(--moi); display: grid; place-items: center; flex: none; }
.brand-tile svg { width: 22px; height: 22px; }
.brand span { font: 600 21px/28px var(--serif); letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 56px; height: 56px; border-radius: var(--r-rond); background: var(--papier); border: 1px solid rgba(232, 220, 203, .8); box-shadow: var(--sh-douce); display: grid; place-items: center; color: var(--encre); text-decoration: none; flex: none; padding: 0; }
.icon-btn.sm { width: 48px; height: 48px; }
.icon-btn:active { transform: scale(.96); }

/* Points d'étape (onboarding) */
.dots { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--ligne); transition: width .3s, background .3s; }
.dots i.done { background: var(--accent); }
.dots i.on { width: 28px; background: var(--accent); }

/* ---------- Boutons (64 px) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 18px 28px; border-radius: var(--r-rond); border: 0; font: 600 19px/24px var(--sans); text-decoration: none; text-align: center; cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--blanc); box-shadow: var(--sh-accent); }
.btn-primary:hover { background: #b65431; }
.btn-secondary { background: var(--papier); color: var(--encre); border: 1.5px solid var(--ligne); box-shadow: var(--sh-douce); }
.btn-ghost { background: transparent; color: var(--accent-fort); box-shadow: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 10px 18px; font: 600 15px/20px var(--sans); gap: 8px; }
.btn-sm svg { width: 18px; height: 18px; }
.btn-danger { color: var(--rec); }
.link-btn { background: none; border: 0; color: var(--accent-fort); font: 600 16px/22px var(--sans); padding: 12px; text-decoration: underline; text-underline-offset: 3px; }
.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }

/* ---------- Cartes, puces, avatars ---------- */
.card { background: var(--papier); border: 1px solid rgba(232, 220, 203, .7); border-radius: var(--r-l); box-shadow: var(--sh-douce); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card.tinted { background: var(--moi-doux); border-color: transparent; box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--r-rond); font: 500 14px/20px var(--sans); background: var(--accent-doux); color: var(--accent-fort); white-space: nowrap; text-decoration: none; }
.pill svg { width: 16px; height: 16px; }
.pill.sauge { background: var(--sauge-doux); color: var(--sauge); }
.pill.maman { background: var(--maman-doux); color: var(--maman); }
.pill.papa { background: var(--papa-doux); color: var(--papa); }
.pill.or { background: var(--or-doux); color: var(--accent-fort); }
.pill.neutre { background: var(--creux); color: var(--encre-2); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--blanc); font: 600 22px/1 var(--serif); border: 3px solid var(--papier); box-shadow: var(--sh-douce); flex: none; background: var(--papa); }
.avatar.av-maman { background: var(--maman); }
.avatar.av-admin { background: var(--encre); font-family: var(--sans); font-size: 16px; }
.avatar.lg { width: 64px; height: 64px; font-size: 30px; }
.avatar.xl { width: 72px; height: 72px; font-size: 34px; }
.avatar.sm { width: 36px; height: 36px; font-size: 17px; border-width: 2px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-m); background: var(--creux); font: 500 15px/20px var(--sans); color: var(--encre-2); }
.notice svg { width: 20px; height: 20px; margin-top: 1px; color: var(--encre-2); }
.notice.sauge { background: var(--sauge-doux); }
.notice.sauge svg { color: var(--sauge); }
.notice.or { background: var(--or-doux); }
.notice.or svg { color: var(--accent-fort); }
.notice .btn { margin-top: 10px; }
.notice-col { display: flex; flex-direction: column; }

/* ---------- Anneaux et barres ---------- */
.ring { position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; }
.ring .track { stroke: rgba(232, 220, 203, .8); }
.ring .arc { stroke: var(--c, var(--papa)); stroke-linecap: butt; transition: stroke-dashoffset 1s cubic-bezier(.2, .7, .2, 1); }
.ring .ring-txt { position: absolute; inset: 0; display: grid; place-items: center; font: 500 34px/1 var(--serif); }
.ring.small .ring-txt { font: 600 16px/1 var(--sans); }
.ring.c-maman { --c: var(--maman); }
.bar { height: 10px; border-radius: var(--r-rond); background: var(--ligne); overflow: hidden; flex: 1; min-width: 60px; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--papa)); min-width: 10px; transition: width .6s; }
.bar.c-maman { --c: var(--maman); }
.bar.c-sauge { --c: var(--sauge); }
.bar.zero > span { min-width: 10px; }

/* ---------- Onboarding ---------- */
.ob-head { display: flex; align-items: center; gap: 12px; min-height: 64px; padding-top: 8px; }
.lang-card { display: flex; align-items: center; gap: 20px; padding: 20px 22px; border-radius: var(--r-l); background: var(--papier); border: 1px solid var(--ligne); box-shadow: var(--sh-douce); text-align: left; width: 100%; }
.lang-card.on { border: 2px solid var(--accent); padding: 19px 21px; }
.lang-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--creux); font: 500 17px/1 var(--sans); color: var(--encre-2); flex: none; }
.lang-card.on .lang-badge { background: var(--accent-doux); color: var(--accent-fort); }
.lang-card .lc-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lang-card .lc-text strong { font: 600 22px/28px var(--serif); }
.lang-card .lc-text span { font: 500 15px/20px var(--sans); color: var(--discret); }
.radio { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ligne); display: grid; place-items: center; flex: none; color: transparent; }
.lang-card.on .radio { background: var(--accent); border-color: var(--accent); color: var(--blanc); }
.radio svg { width: 22px; height: 22px; stroke-width: 3; }
.gift-card { background: linear-gradient(160deg, var(--accent-doux), #F4DCCB); border-radius: var(--r-xl); padding: 28px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.gift-card .pill { background: rgba(255, 252, 247, .75); color: var(--encre-2); font-size: 15px; }
.feature { display: flex; gap: 18px; align-items: flex-start; }
.feature .ftile { width: 56px; height: 56px; border-radius: var(--r-m); background: var(--papier); border: 1px solid var(--ligne); display: grid; place-items: center; color: var(--accent-fort); flex: none; }
.feature strong { display: block; font: 600 18px/24px var(--sans); }
.feature span { display: block; font: 500 16px/22px var(--sans); color: var(--discret); }
.verse-line { font: italic 400 19px/28px var(--serif); color: var(--discret); text-align: center; margin: 0; }
.demo-card { align-items: center; padding: 24px; }
.demo-transcript { width: 100%; background: var(--creux); border-radius: var(--r-m); padding: 16px 18px; font: 400 18px/28px var(--sans); color: var(--encre-2); min-height: 92px; }
.steps { display: flex; flex-direction: column; gap: 16px; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps .num { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--blanc); display: grid; place-items: center; font: 600 18px/1 var(--sans); flex: none; }
.steps strong { display: block; font: 600 18px/24px var(--sans); }
.steps span { display: block; font: 500 16px/22px var(--sans); color: var(--discret); }
.perm-dialog { background: var(--papier); border-radius: var(--r-l); box-shadow: var(--sh-elevee); padding: 24px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.perm-dialog strong { font: 600 18px/24px var(--sans); }
.perm-dialog .opt { padding: 12px; border-radius: var(--r-rond); font: 500 16px/22px var(--sans); color: var(--encre-2); }
.perm-dialog .opt.on { background: var(--accent-doux); color: var(--accent-fort); border: 2px solid var(--accent); display: flex; gap: 8px; justify-content: center; align-items: center; }
.phone-mock { background: #3B2A20; border-radius: var(--r-xl); padding: 26px 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 10px; }
.phone-mock div { display: flex; flex-direction: column; align-items: center; gap: 8px; font: 500 12px/14px var(--sans); color: rgba(255, 255, 255, .7); }
.phone-mock i { width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .55); display: grid; place-items: center; }
.phone-mock .me i { background: var(--accent); color: var(--blanc); box-shadow: 0 0 0 6px rgba(194, 94, 55, .25); }
.phone-mock .me { color: var(--blanc); font-weight: 700; }
.step-cards { display: flex; flex-direction: column; gap: 12px; }
.step-card { display: flex; gap: 16px; align-items: flex-start; background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r-m); padding: 16px 18px; font: 400 18px/26px var(--sans); }
.step-card b { font: 600 24px/26px var(--serif); color: var(--accent); }

/* ---------- Connexion ---------- */
.who-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.who-tile { background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r-l); box-shadow: var(--sh-douce); padding: 22px 12px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.who-tile strong { font: 600 22px/28px var(--serif); }
.who-tile.on { border: 2px solid var(--accent); padding: 21px 11px 17px; }
.who-tile.on.maman { border-color: var(--maman); }
.who-tile .pill { background: var(--creux); color: var(--encre-2); }
.who-tile.on .pill { background: var(--accent-doux); color: var(--accent-fort); }
.who-tile.on.maman .pill { background: var(--maman-doux); color: var(--maman); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .field-label { font: 600 16px/22px var(--sans); color: var(--encre-2); }
.input { width: 100%; height: 64px; padding: 0 20px; border-radius: var(--r-m); background: var(--papier); border: 1.5px solid var(--ligne); font: 400 22px/1 var(--sans); outline: none; }
.input:focus { border: 2px solid var(--accent); padding: 0 19.5px; }
.input.code { letter-spacing: .5em; font-size: 26px; }
.toggle-row { display: flex; align-items: center; gap: 16px; background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r-m); padding: 14px 16px; cursor: pointer; }
.toggle-row .tr-text { flex: 1; }
.toggle-row strong { display: block; font: 600 16px/22px var(--sans); }
.toggle-row span { display: block; font: 500 15px/20px var(--sans); color: var(--discret); }
.switch { appearance: none; -webkit-appearance: none; width: 60px; height: 36px; border-radius: var(--r-rond); background: var(--ligne); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--blanc); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch:checked { background: var(--sauge); }
.switch:checked::after { transform: translateX(24px); }
.switch.sm { width: 44px; height: 26px; }
.switch.sm::after { width: 20px; height: 20px; top: 3px; left: 3px; }
.switch.sm:checked::after { transform: translateX(18px); }
.form-err { color: var(--rec); font: 600 16px/22px var(--sans); margin: 0; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.footnote { font: 500 15px/20px var(--sans); color: var(--discret); text-align: center; margin: 0; }

/* ---------- Accueil ---------- */
.greet h1 { margin-bottom: 4px; }
.prog-card .pc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prog-card .pc-rings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prog-card .pc-ring { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--encre); }
.prog-card .pc-ring strong { font: 600 17px/22px var(--sans); margin-top: 8px; }
.prog-card .pc-ring > span { font: 500 15px/20px var(--sans); color: var(--discret); }
.next-card { background: var(--moi-doux); border-radius: var(--r-l); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--sh-douce); }
.next-card .t-surtitre { color: var(--moi); }
body[data-me="papa"] .next-card .t-surtitre { color: var(--accent-fort); }
.tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile { background: var(--papier); border: 1px solid rgba(232, 220, 203, .7); border-radius: var(--r-l); box-shadow: var(--sh-douce); padding: 14px 16px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--encre); font: 600 17px/22px var(--sans); min-height: 68px; }
.tile i { width: 44px; height: 44px; border-radius: var(--r-s); background: var(--moi-doux); color: var(--moi); display: grid; place-items: center; flex: none; }
body[data-me="papa"] .tile i { color: var(--accent-fort); }

/* ---------- Chapitres ---------- */
.chap-head { display: flex; align-items: center; gap: 16px; }
.chap-head > div { flex: 1; }
.chap-row { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--papier); border: 1px solid rgba(232, 220, 203, .7); border-radius: var(--r-l); box-shadow: var(--sh-douce); text-decoration: none; color: var(--encre); }
.chap-row.current { border: 1.5px solid var(--accent); }
.chap-row .pastille { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--creux); color: var(--discret); font: 600 22px/1 var(--serif); flex: none; }
.chap-row.done .pastille { background: var(--sauge-doux); color: var(--sauge); }
.chap-row.done .pastille svg { stroke-width: 2.5; width: 26px; height: 26px; }
.chap-row.current .pastille { background: var(--accent-doux); color: var(--accent-fort); }
.chap-row .cr-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chap-row .cr-text strong { font: 600 20px/26px var(--serif); }
.chap-row .cr-text span { font: 500 15px/20px var(--sans); color: var(--discret); }
.chap-row.current .cr-text span { color: var(--accent-fort); }
.chap-row > svg { color: var(--discret); width: 22px; height: 22px; }
.chap-list { display: flex; flex-direction: column; gap: 12px; }
.verse-box { background: var(--or-doux); border-radius: var(--r-l); padding: 20px 22px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.verse-box p { font: italic 400 19px/28px var(--serif); color: var(--encre-2); margin: 0; }
.verse-box cite { font: 500 15px/20px var(--sans); color: var(--discret); font-style: normal; }
.q-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--papier); border: 1px solid rgba(232, 220, 203, .7); border-radius: var(--r-m); text-decoration: none; color: var(--encre); font: 400 17px/24px var(--sans); }
.q-row .qn { width: 36px; height: 36px; border-radius: 50%; background: var(--creux); color: var(--discret); display: grid; place-items: center; font: 600 15px/1 var(--sans); flex: none; }
.q-row.ok .qn { background: var(--sauge-doux); color: var(--sauge); }
.q-row.ok .qn svg { width: 18px; height: 18px; stroke-width: 2.5; }

/* ---------- Question ---------- */
.q-prog { display: flex; align-items: center; gap: 16px; font: 500 15px/20px var(--sans); color: var(--discret); white-space: nowrap; }
.q-prog .bar { --c: var(--moi); }
.qtext.small { font: 600 22px/28px var(--serif); }
.mic-card { align-items: center; text-align: center; padding: 24px 20px 20px; gap: 10px; }
.mic { position: relative; width: 184px; height: 184px; border: 0; background: none; padding: 0; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.mic .h1, .mic .h2 { position: absolute; border-radius: 50%; inset: 0; background: rgba(194, 94, 55, .07); transition: transform .12s; }
.mic .h2 { inset: 16px; background: rgba(194, 94, 55, .12); }
.mic .core { position: relative; width: 120px; height: 120px; border-radius: 50%; background: var(--accent); color: var(--blanc); display: grid; place-items: center; box-shadow: var(--sh-accent); transition: background .2s; }
.mic .core svg { width: 48px; height: 48px; }
.mic .core .i-stop { display: none; width: 44px; height: 44px; }
.mic.on .h1 { background: none; border: 2px solid rgba(196, 61, 43, .25); transform: scale(calc(1 + var(--lvl, 0) * .08)); animation: pulse 2s infinite; }
.mic.on .h2 { background: rgba(196, 61, 43, .10); border: 2px solid rgba(196, 61, 43, .45); transform: scale(calc(1 + var(--lvl, 0) * .12)); }
.mic.on .core { background: var(--rec); box-shadow: 0 10px 24px rgba(196, 61, 43, .35); }
.mic.on .core .i-mic { display: none; }
.mic.on .core .i-stop { display: block; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.mic-status { font: 600 18px/24px var(--sans); display: flex; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 0; }
.mic-status .rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rec); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.mic-sub { font: 500 16px/22px var(--sans); color: var(--discret); margin: 0; }
.live { width: 100%; text-align: left; background: var(--creux); border-radius: var(--r-m); padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.live .t-surtitre { color: var(--accent-fort); display: flex; gap: 8px; align-items: center; }
.live .t-surtitre svg { width: 16px; height: 16px; }
.live p { margin: 0; }
.live .live-text { font: 400 18px/26px var(--sans); }
.live .interim { color: var(--discret); }
.mic-msg { font: 500 15px/20px var(--sans); color: var(--accent-fort); margin: 0; }
.answer-card .ac-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.saved-state { font: 500 15px/20px var(--sans); color: var(--sauge); display: flex; gap: 6px; align-items: center; margin: 0; }
.saved-state svg { width: 18px; height: 18px; }
.answer-box { border: 1.5px solid var(--accent); border-radius: var(--r-m); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--papier); }
.answer-box.empty { border-color: var(--ligne); }
.answer-box textarea { border: 0; outline: none; resize: none; background: transparent; font: 400 19px/30px var(--sans); color: var(--encre); width: 100%; min-height: 120px; padding: 0; }
.answer-box textarea::placeholder { color: var(--discret); }
.answer-box .edit-hint { font: 500 15px/20px var(--sans); color: var(--accent-fort); display: flex; gap: 6px; align-items: center; margin: 0; }
.answer-box .edit-hint svg { width: 16px; height: 16px; }
.mode-chip { align-self: center; }
.actions2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions2 .btn { padding: 14px 12px; font-size: 17px; }
.qnav { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-top: auto; padding-top: 8px; }
.qnav .btn-ghost { padding-left: 28px; padding-right: 28px; }
.qnav .next { min-width: 176px; justify-self: end; }

/* Lecteur audio (la voix originale, toujours gardée) */
.player { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: var(--r-m); background: var(--creux); border: 1px solid var(--ligne); }
.player .play { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--blanc); border: 0; display: grid; place-items: center; flex: none; padding: 0; }
.player .play svg { width: 22px; height: 22px; fill: currentColor; }
.player .pl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.player .wave { display: flex; align-items: center; gap: 3px; height: 36px; overflow: hidden; cursor: pointer; }
.player .wave b { width: 4px; border-radius: 2px; background: rgba(138, 117, 99, .35); flex: none; }
.player .wave b.on { background: var(--accent); }
.player .pl-meta { display: flex; justify-content: space-between; gap: 8px; font: 500 13px/18px var(--sans); color: var(--encre-2); }
.player .pl-meta span:last-child { color: var(--discret); }
.player .del { background: none; border: 0; color: var(--discret); padding: 6px; }
.player .del svg { width: 20px; height: 20px; }
.clips { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Photos ---------- */
.ph-count { display: flex; justify-content: space-between; align-items: center; gap: 16px; font: 600 16px/22px var(--sans); }
.ph-count .bar { max-width: 120px; --c: var(--moi); }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ph-grid figure { margin: 0; aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden; position: relative; background: #C9A27E; cursor: pointer; }
.ph-grid figure img { width: 100%; height: 100%; object-fit: cover; }
.ph-grid figure.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.ph-add { aspect-ratio: 1; border-radius: var(--r-m); border: 1.5px dashed var(--accent); background: rgba(247, 227, 213, .5); color: var(--accent-fort); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 500 15px/20px var(--sans); cursor: pointer; }
.ph-add svg { width: 28px; height: 28px; }
.ph-add.ghost { opacity: .45; }
.caption-card input { border: 0; outline: none; background: transparent; font: 400 19px/28px var(--sans); padding: 0; width: 100%; }

/* ---------- Lecture seule ---------- */
.reader-head { background: var(--maman-doux); border-radius: var(--r-l); padding: 16px 18px; display: flex; gap: 16px; align-items: center; }
.reader-head.papa { background: var(--papa-doux); }
.reader-head .rh-sub { font: 500 15px/20px var(--sans); color: var(--maman); display: flex; gap: 6px; align-items: center; }
.reader-head.papa .rh-sub { color: var(--accent-fort); }
.reader-head .rh-sub svg { width: 18px; height: 18px; }
.chips { display: flex; gap: 10px; overflow-x: auto; margin: 0 -24px; padding: 2px 24px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 12px 18px; border-radius: var(--r-rond); border: 1px solid var(--ligne); background: var(--papier); font: 600 16px/22px var(--sans); color: var(--encre); text-decoration: none; white-space: nowrap; }
.chip.on { background: var(--maman); border-color: var(--maman); color: var(--blanc); }
.chip.on.papa { background: var(--papa); border-color: var(--papa); }
.read-qa .t-surtitre { color: var(--maman); }
.read-qa.papa .t-surtitre { color: var(--accent-fort); }
.answer-text { font: 400 17px/26px var(--sans); color: var(--encre-2); white-space: pre-wrap; margin: 0; }

/* ---------- Fin de chapitre, célébration ---------- */
.interstitial { text-align: center; align-items: center; position: relative; overflow: hidden; }
.interstitial > * { position: relative; z-index: 1; }
.interstitial .close { align-self: flex-end; margin-top: 8px; }
.medal { width: 120px; height: 120px; border-radius: 50%; background: var(--sauge-doux); color: var(--sauge); display: grid; place-items: center; border: 8px solid var(--papier); box-shadow: var(--sh-douce); }
.medal svg { width: 52px; height: 52px; stroke-width: 3; }
.pop { animation: pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; padding: 16px 8px; }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats strong { font: 600 22px/28px var(--serif); }
.stats span { font: 500 15px/20px var(--sans); color: var(--discret); }
.confetti { position: absolute !important; inset: 0 0 auto 0; height: 300px; pointer-events: none; z-index: 0 !important; }
.confetti i { position: absolute; left: var(--x); top: var(--y); width: 12px; height: 5px; border-radius: 3px; background: var(--c); transform: rotate(var(--r)); opacity: .8; animation: fall 3s ease-out both; animation-delay: var(--d); }
.confetti i.dot { width: 7px; height: 7px; border-radius: 50%; }
@keyframes fall { from { transform: translateY(-60px) rotate(0); opacity: 0; } to { transform: translateY(0) rotate(var(--r)); opacity: .8; } }
.cover { width: 156px; height: 208px; border-radius: 6px 10px 10px 6px; background: var(--accent-fort); color: #F8E7D8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; box-shadow: var(--sh-elevee), inset 6px 0 0 rgba(0, 0, 0, .12); margin-top: 24px; }
.cover svg { width: 24px; height: 24px; stroke-width: 1.5; }
.cover strong { font: 600 20px/24px var(--serif); color: var(--blanc); }
.cover hr { width: 40px; border: 0; border-top: 1.5px solid rgba(248, 231, 216, .7); margin: 2px 0; }
.cover em { font: italic 400 17px/22px var(--serif); }
.truck-card { flex-direction: row; text-align: left; align-items: flex-start; }
.truck-card i { width: 52px; height: 52px; border-radius: var(--r-m); background: var(--accent-doux); color: var(--accent-fort); display: grid; place-items: center; flex: none; }
.truck-card strong { display: block; font: 600 17px/22px var(--sans); }
.truck-card span { display: block; font: 500 15px/20px var(--sans); color: var(--discret); }

/* ---------- Réglages ---------- */
.set-card h2 { font: 600 17px/22px var(--sans); display: flex; gap: 10px; align-items: center; }
.set-card h2 svg { width: 20px; height: 20px; }
.seg { display: flex; background: var(--creux); border: 1px solid var(--ligne); border-radius: var(--r-rond); padding: 4px; gap: 4px; }
.seg > * { flex: 1; min-height: 56px; border: 0; background: none; border-radius: var(--r-rond); font: 600 17px/22px var(--sans); color: var(--discret); text-decoration: none; display: grid; place-items: center; padding: 0 10px; text-align: center; }
.seg > .on { background: var(--papier); color: var(--encre); box-shadow: var(--sh-douce); }
.seg.sm > * { min-height: 36px; font-size: 14px; }
.account-row { display: flex; gap: 14px; align-items: center; }
.account-row strong { display: block; font: 600 17px/22px var(--sans); }
.account-row span { display: block; font: 500 15px/20px var(--sans); color: var(--discret); }
details.debug summary { font: 600 15px/20px var(--sans); color: var(--discret); cursor: pointer; }
details.debug .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--encre); color: var(--blanc); padding: 12px 20px; border-radius: var(--r-rond); font: 600 15px/20px var(--sans); z-index: 100; box-shadow: var(--sh-elevee); transition: opacity .4s; }
.toast.out { opacity: 0; }

/* =================== Tableau de bord (ordinateur) =================== */
body.is-admin { font: 400 15px/22px var(--sans); }
.adm { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.adm-side { background: var(--papier); border-right: 1px solid var(--ligne); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.adm-brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--encre); padding: 0 8px; }
.adm-brand .brand-tile { background: var(--accent-doux); color: var(--accent-fort); }
.adm-brand strong { display: block; font: 600 22px/26px var(--serif); }
.adm-brand small { display: block; font: 500 13px/18px var(--sans); color: var(--discret); }
.adm-nav { display: flex; flex-direction: column; gap: 4px; }
.adm-nav a { display: flex; gap: 12px; align-items: center; height: 44px; padding: 0 14px; border-radius: var(--r-s); text-decoration: none; color: var(--encre-2); font: 600 15px/22px var(--sans); }
.adm-nav a svg { width: 20px; height: 20px; }
.adm-nav a.on { background: var(--accent-doux); color: var(--accent-fort); }
.adm-nav a:hover:not(.on) { background: var(--creux); }
.adm-nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--or); margin-left: auto; }
.adm-me { margin-top: auto; display: flex; gap: 12px; align-items: center; background: var(--creux); border-radius: var(--r-m); padding: 12px; }
.adm-me .avatar { border: 0; box-shadow: none; width: 36px; height: 36px; font-size: 15px; }
.adm-me div { flex: 1; }
.adm-me strong { display: block; font: 600 15px/20px var(--sans); }
.adm-me small { display: block; font: 500 13px/18px var(--sans); color: var(--discret); }
.adm-me a { color: var(--encre-2); }
.adm-me a svg { width: 18px; height: 18px; }
.adm-main { padding: 28px 40px 40px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.adm-head h1 { font: 500 34px/40px var(--serif); letter-spacing: -0.01em; }
.adm-head p { margin: 4px 0 0; font: 500 13px/18px var(--sans); color: var(--discret); }
.adm-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.abtn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-rond); font: 600 15px/20px var(--sans); text-decoration: none; border: 1px solid var(--ligne); background: var(--papier); color: var(--encre); cursor: pointer; white-space: nowrap; }
.abtn svg { width: 18px; height: 18px; }
.abtn.p { background: var(--accent); color: var(--blanc); border-color: var(--accent); box-shadow: var(--sh-accent); }
.abtn.g { background: none; border-color: transparent; color: var(--accent-fort); }
.abtn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.abtn.wa { background: var(--wa); color: var(--wa-fg); border-color: var(--wa); }
.abtn.sms { background: var(--or-doux); color: var(--sms-fg); border-color: var(--or-doux); }
.abtn.copied { background: var(--sauge-doux); color: var(--sauge); border-color: var(--sauge-doux); }
.abtn[disabled] { opacity: .5; cursor: default; }
.acard { background: var(--papier); border: 1px solid rgba(232, 220, 203, .7); border-radius: var(--r-l); box-shadow: var(--sh-douce); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.acard h2 { font: 600 22px/28px var(--serif); letter-spacing: -0.005em; }
.a-surtitre { font: 700 11px/14px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--discret); margin: 0; }
.a-small { font: 500 13px/18px var(--sans); color: var(--discret); margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.kpi { flex-direction: row; align-items: center; gap: 14px; }
.kpi .kv { font: 500 30px/36px var(--serif); letter-spacing: -0.01em; margin: 2px 0; }
.kpi-tile { width: 56px; height: 56px; border-radius: var(--r-m); background: var(--or-doux); color: var(--accent-fort); display: grid; place-items: center; flex: none; }
.cols { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.legend { display: flex; gap: 14px; font: 500 13px/18px var(--sans); color: var(--encre-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--papa); margin-right: 6px; }
.legend i.m { background: var(--maman); }
.prow { display: grid; grid-template-columns: 28px 230px 1fr 92px; gap: 16px; align-items: center; padding: 8px 0; font: 400 15px/22px var(--sans); }
.prow .n { font: 600 15px/22px var(--sans); color: var(--discret); }
.prow .bars { display: flex; flex-direction: column; gap: 6px; }
.prow .bars .bar { height: 8px; flex: none; }
.prow .r { text-align: right; font: 500 13px/18px var(--sans); color: var(--discret); }
.act { display: flex; gap: 12px; align-items: flex-start; }
.act .avatar { border: 0; box-shadow: none; }
.act p { margin: 0; }
.todo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-m); background: var(--creux); text-decoration: none; color: var(--encre); }
.todo span { flex: 1; }
.tabs { display: flex; gap: 4px; background: var(--creux); border: 1px solid var(--ligne); border-radius: var(--r-rond); padding: 4px; }
.tabs > * { height: 36px; padding: 0 14px; border-radius: var(--r-rond); display: grid; place-items: center; font: 500 14px/18px var(--sans); color: var(--encre-2); text-decoration: none; border: 0; background: none; white-space: nowrap; cursor: pointer; }
.tabs > .on { background: var(--papier); color: var(--encre); font-weight: 600; box-shadow: var(--sh-douce); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.aselect { height: 44px; border-radius: var(--r-rond); border: 1px solid var(--ligne); background: var(--papier); padding: 0 16px; font: 600 14px/20px var(--sans); }
.qrows { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.qrow { display: grid; grid-template-columns: 20px 74px 92px 1fr 40px; gap: 12px; align-items: flex-start; padding: 16px; background: var(--papier); border: 1px solid rgba(232, 220, 203, .7); border-radius: var(--r-m); box-shadow: var(--sh-douce); }
.qrow.sel { background: #FBEBDF; border: 1.5px solid var(--accent); }
.qrow.dragging { opacity: .5; }
.qrow.drop { box-shadow: 0 -3px 0 var(--accent); }
.qrow .grip { color: var(--discret); cursor: grab; padding-top: 2px; }
.qrow .grip svg, .qrow .edit svg { width: 18px; height: 18px; }
.qrow .code { font: 600 14px/20px var(--sans); color: var(--encre-2); padding-top: 2px; }
.qrow .qt p { margin: 0; font: 400 15px/22px var(--sans); }
.qrow .qt p.pl { font: 400 13px/18px var(--sans); color: var(--discret); margin-top: 4px; }
.qrow .edit { background: none; border: 0; color: var(--encre-2); padding: 4px; }
.qrow .moves { display: flex; flex-direction: column; }
.qrow .moves button { background: none; border: 0; color: var(--discret); padding: 0; height: 18px; }
.qrow .moves svg { width: 16px; height: 16px; }
.tag { display: inline-flex; padding: 5px 12px; border-radius: var(--r-rond); font: 500 13px/18px var(--sans); background: var(--creux); color: var(--encre-2); justify-self: start; white-space: nowrap; }
.tag.both { background: var(--sauge-doux); color: var(--sauge); }
.tag.papa { background: var(--papa-doux); color: var(--accent-fort); }
.tag.maman { background: var(--maman-doux); color: var(--maman); }
.tag.or { background: var(--or-doux); color: var(--accent-fort); }
.tag.ok { background: var(--sauge-doux); color: var(--sauge); }
.side-panel { position: sticky; top: 20px; }
.side-panel .sp-head { display: flex; justify-content: space-between; align-items: center; }
.afield { display: flex; flex-direction: column; gap: 8px; }
.afield > span { font: 600 15px/22px var(--sans); display: flex; justify-content: space-between; align-items: center; }
.afield textarea, .afield input, .ainput { width: 100%; border: 1px solid var(--ligne); border-radius: var(--r-s); padding: 12px 14px; background: var(--papier); font: 400 15px/22px var(--sans); resize: vertical; outline: none; }
.afield textarea:focus, .afield input:focus, .ainput:focus { border-color: var(--accent); }
.info-line { display: flex; gap: 10px; align-items: center; background: var(--creux); border-radius: var(--r-s); padding: 10px 14px; font: 500 13px/18px var(--sans); color: var(--encre-2); }
.info-line svg { width: 16px; height: 16px; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.search { display: flex; gap: 10px; align-items: center; height: 44px; padding: 0 14px; border-radius: var(--r-rond); border: 1px solid var(--ligne); background: var(--papier); }
.search svg { width: 18px; height: 18px; color: var(--discret); }
.search input { border: 0; outline: none; background: none; flex: 1; font: 400 15px/22px var(--sans); }
.alist { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 220px); overflow: auto; padding: 2px; }
.aitem { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r-m); text-decoration: none; color: var(--encre); border: 1.5px solid transparent; }
.aitem:hover { background: var(--creux); }
.aitem.sel { background: var(--papier); border-color: var(--accent); box-shadow: var(--sh-douce); }
.aitem .ai-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.aitem p { margin: 0; font: 400 14px/20px var(--sans); }
.ans-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.ans-card { min-height: 440px; }
.ans-card .ah { display: flex; gap: 12px; align-items: center; }
.ans-card .ah > div { flex: 1; }
.ans-card .ah strong { display: block; font: 600 15px/20px var(--sans); }
.transcript { background: var(--creux); border-radius: var(--r-s); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.transcript p { margin: 0; font: 400 15px/24px var(--sans); white-space: pre-wrap; }
.transcript textarea { width: 100%; min-height: 160px; border: 1px solid var(--accent); border-radius: var(--r-s); padding: 10px 12px; font: 400 15px/24px var(--sans); background: var(--papier); resize: vertical; outline: none; }
.ans-card .acts { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.ph-sections { display: flex; flex-direction: column; gap: 22px; }
.ph-sec h2 { font: 600 22px/28px var(--serif); display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ph-thumbs { display: flex; flex-wrap: wrap; gap: 14px; }
.ph-thumb { width: 124px; height: 124px; border-radius: var(--r-m); overflow: hidden; position: relative; border: 0; padding: 0; background: #C9A27E; cursor: pointer; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-thumb .avatar { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; font-size: 12px; border-width: 2px; }
.ph-thumb.sel { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph-thumb.hidden-in-book img { opacity: .4; }
.ph-detail img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-m); }
.toggle-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--creux); font: 400 15px/22px var(--sans); }
.book-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.book-stage { background: var(--fond-profond); border-radius: var(--r-l); padding: 40px 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 20px; min-height: 620px; }
.spread-wrap { width: calc(2 * var(--pw)); height: var(--ph); overflow: hidden; box-shadow: var(--sh-elevee); background: #FFFDF8; position: relative; }
.spread-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--pw) - 1px); width: 2px; background: linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,.01)); }
.spread { width: 296mm; height: 210mm; column-width: 148mm; column-gap: 0; column-fill: auto; transform-origin: 0 0; transition: transform .35s ease; }
.pager { display: flex; align-items: center; gap: 18px; font: 500 15px/20px var(--sans); color: var(--encre-2); }
.title-opts { display: flex; flex-direction: column; gap: 8px; }
.title-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--ligne); cursor: pointer; }
.title-opt.on { border-color: var(--accent); background: #FBEBDF; }
.title-opt input[type=radio] { margin-top: 4px; accent-color: var(--accent); }
.title-opt b { display: block; font: 600 16px/22px var(--serif); }
.title-opt small { display: block; font: 400 13px/18px var(--sans); color: var(--discret); }
.title-opt .ainput { padding: 8px 10px; margin-top: 4px; }
.inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.acc-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.acc-card .inv-head { width: 100%; }
.inv-head { display: flex; gap: 12px; align-items: center; }
.inv-head > div { flex: 1; }
.inv-head h2 { font: 600 22px/28px var(--serif); }
.linkbox { display: flex; gap: 10px; align-items: center; background: var(--creux); border: 1px solid var(--ligne); border-radius: var(--r-s); padding: 6px 6px 6px 14px; font: 600 14px/20px var(--sans); }
.linkbox svg { width: 16px; height: 16px; color: var(--discret); }
.linkbox span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbox button { width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--papier); display: grid; place-items: center; }
.msg-head { display: flex; justify-content: space-between; align-items: center; }
.msg-head button { background: none; border: 0; color: var(--accent-fort); font: 500 13px/18px var(--sans); }
.msgbox { background: #EAF5EC; border-radius: var(--r-m); padding: 14px 16px; font: 400 14px/22px var(--sans); white-space: pre-wrap; border: 1px solid transparent; width: 100%; resize: vertical; min-height: 120px; outline: none; }
.msgbox[readonly] { cursor: default; }
.msgbox:not([readonly]) { border-color: var(--accent); background: var(--papier); }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; }
.apk-card .ac-top { display: flex; gap: 16px; align-items: center; }
.apk-card .ac-top > div { flex: 1; }
.apk-card .ac-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; }
.big-tile { width: 56px; height: 56px; border-radius: var(--r-m); background: var(--accent-doux); color: var(--accent-fort); display: grid; place-items: center; }
.adm .notice { font-size: 14px; }

/* =================== Livre (aperçu et impression A5) =================== */
.bookview .book-controls { display: flex; flex-direction: column; gap: 14px; }
.book { font-family: var(--livre); color: #2E2118; }
.book .b-page, .book .b-chapter, .book .b-photos { background: #FFFDF8; }
.bookview .book > section { box-shadow: var(--sh-douce); margin: 0 auto 24px; width: 100%; max-width: 148mm; padding: 16mm 14mm; }
.b-title { min-height: 180mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.b-title h1 { font: 500 30pt/1.15 var(--serif); letter-spacing: -0.01em; }
.b-sub { font: italic 400 14pt/1.4 var(--serif); color: #6B5443; margin: 0; }
.b-rule { width: 36px; height: 1.5px; background: #C25E37; margin: 10px 0; }
.b-by, .b-year { font: 500 9pt/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #9C7A58; margin: 0; }
.b-orn { width: 22px; height: 30px; position: relative; margin-bottom: 14px; }
.b-orn::before, .b-orn::after { content: ""; position: absolute; background: #C25E37; }
.b-orn::before { left: 10px; top: 0; width: 1.5px; height: 30px; }
.b-orn::after { left: 3px; top: 9px; width: 16px; height: 1.5px; }
.b-toc h2 { font: 500 20pt/1.2 var(--serif); margin-bottom: 14px; }
.b-toc ol { list-style: none; padding: 0; margin: 0 0 20px; font: 400 11pt/2 var(--livre); }
.b-toc li span { display: inline-block; width: 2.4em; color: #9C7A58; }
.b-note { font: italic 400 9pt/1.5 var(--livre); color: #8A7461; }
.b-chap-head { margin-bottom: 16px; }
.b-num { font: 700 8pt/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #9C7A58; margin: 0 0 8px; }
.b-chapter h2 { font: 500 22pt/1.15 var(--serif); letter-spacing: -0.01em; margin: 0 0 12px; }
.b-chap-head .b-rule { margin: 0 0 12px; }
.b-chapter blockquote { font: italic 400 10pt/1.5 var(--serif); color: #6B5443; margin: 0 0 18px; }
.b-chapter blockquote cite { font-style: normal; font-size: 9pt; color: #9C7A58; margin-left: 6px; }
.b-qa { margin: 0 0 14px; }
.b-qa h3 { font: italic 600 10.5pt/1.45 var(--livre); color: #8A4B2C; margin: 0 0 5px; }
.b-ans { font: 400 10pt/1.6 var(--livre); margin: 0 0 6px; text-align: justify; hyphens: auto; }
.b-audio { font-style: italic; color: #8A7461; }
.b-who, .b-for { font: 700 7.5pt/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #9C7A58; margin: 8px 0 4px; }
.b-keep { break-inside: avoid; }
.b-photos { text-align: center; }
.b-photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-top: 6mm; }
.b-photos.n1 .b-photo-grid { grid-template-columns: 1fr; }
.b-photo-grid figure { margin: 0; }
.b-photo-grid img { width: 100%; max-height: 70mm; object-fit: cover; border-radius: 2px; }
.b-photos.n1 .b-photo-grid img { max-height: 120mm; }
.b-photo-grid figcaption { font: italic 400 8.5pt/1.4 var(--livre); color: #8A7461; margin-top: 2mm; }
.b-end { min-height: 120mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.b-end p { font: italic 400 13pt/1.5 var(--serif); max-width: 90mm; margin: 0 0 8px; }
.b-end cite { font: 500 9pt/1 var(--sans); color: #9C7A58; font-style: normal; }
/* Aperçu en double page dans le tableau de bord (colonnes = pages A5 réelles, réduites) */
.spread .book > section { -webkit-box-decoration-break: clone; box-decoration-break: clone; box-shadow: none; margin: 0; padding: 16mm 14mm 18mm; break-before: column; max-width: none; width: auto; min-height: 0; }
.spread .b-title, .spread .b-end { height: 210mm; min-height: 0; }
.spread .b-photo-grid img { max-height: 60mm; }
.ph-thumb .ph-img, .ph-detail .ph-big { display: block; width: 100%; height: 100%; background: #D9BFA4; }
.ph-detail .ph-big { aspect-ratio: 1; border-radius: var(--r-m); height: auto; }
.btn.disabled { opacity: .5; pointer-events: none; }
@page { size: A5; margin: 16mm 14mm 18mm; }
@media print {
  body { background: #fff; }
  .no-print, .topbar, .toast { display: none !important; }
  .screen { padding: 0; max-width: none; min-height: 0; display: block; }
  .bookview .book > section { box-shadow: none; margin: 0; padding: 0; max-width: none; width: auto; background: none; }
  .b-page, .b-chapter, .b-photos { break-before: page; }
  .b-title { break-before: auto; min-height: 170mm; }
  .b-photos { break-inside: avoid; }
  .b-qa h3 { break-after: avoid; }
}

/* ---------- Grands écrans (aperçu mobile centré) ---------- */
@media (min-width: 700px) {
  body:not(.is-admin) { background: var(--fond-profond); }
  body:not(.is-admin) .screen { background: var(--fond); box-shadow: var(--sh-douce); }
  body.bookmode .screen { max-width: 760px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Connexion neutre : identifiant + mot de passe */
.login-lang { align-self: flex-end; width: 200px; margin-top: -8px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 72px; }
.pw-wrap .input:focus { padding-right: 71.5px; }
.pw-eye { position: absolute; right: 6px; top: 6px; width: 52px; height: 52px; border: 0; border-radius: var(--r-m); background: none; color: var(--discret); display: grid; place-items: center; }
.pw-eye svg { width: 26px; height: 26px; }
.pw-eye.on { color: var(--accent-fort); background: var(--accent-doux); }
