/* Lunoo — styles. Pensé pour une tablette, utilisable au doigt par un enfant. */
@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url('../fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('../fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url('../fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url('../fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url('../fonts/nunito-latin-800-normal.woff2') format('woff2'); }

:root {
  --navy: #1F2250; --navy2: #2E3270; --cream: #FBF6EE; --ink: #1F2250; --muted: #5B5E7A;
  --moon: #F5C451; --lav: #8C84D9; --lav-l: #E6E3FA; --line: #ECE7DD; --green: #3BA776;
  --red: #E2574C; --white: #FFFFFF;
  --r: 24px;
  --display: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--navy); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.45; }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, select, textarea { -webkit-user-select: text; user-select: text; }
#app { min-height: 100vh; min-height: 100dvh; }
h1, h2, .h2 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.15; }
h1 { font-size: max(28px, min(4vw, 44px)); font-size: clamp(28px, 4vw, 44px); }
.h2 { font-size: 24px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--moon); outline-offset: 3px; }
.grow { flex: 1 1 auto; }
.muted { color: var(--muted); }
.muted-light { color: #A7A2D6; }
.muted-warm { color: #B9A3C8; font-weight: 700; }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.lead { font-size: 18px; margin: 0; }
.pad { padding: 24px 0; text-align: center; }
.label { font-weight: 800; }
hr { border: 0; border-top: 2px solid var(--line); margin: 6px 0; width: 100%; }

.screen { position: relative; min-height: 100vh; min-height: 100dvh; width: 100%; overflow: hidden; display: flex; flex-direction: column; }
.center-msg { align-items: center; justify-content: center; text-align: center; color: var(--cream); gap: 12px; padding: 40px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px; border-radius: 999px; border: 0; font-weight: 800; font-size: 18px; }
.btn.primary { background: var(--navy); color: var(--cream); }
.btn.ghost { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn.ghost-dark { background: rgba(255,255,255,.12); color: inherit; border: 2px solid rgba(255,255,255,.35); }
.btn.danger { background: var(--red); color: #fff; }
.btn.sm { min-height: 46px; padding: 0 18px; font-size: 15px; }
.btn.xl { min-height: 72px; padding: 0 52px; font-size: 24px; font-family: var(--display); font-weight: 600; }
.link-btn { background: none; border: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-weight: 800; color: inherit; padding: 0 4px; }
.link-btn.small { font-size: 15px; min-height: 40px; text-decoration: underline; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #D9D4EC; background: var(--cream); font-size: 30px; font-weight: 800; line-height: 1; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.round.sm { width: 48px; height: 48px; font-size: 24px; }
.round-btn { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.round-btn.dark { width: 52px; height: 52px; background: #1E2046; color: #ECEAF8; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #D9D4EC; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex: none; }
.icon-btn.in { background: var(--navy); color: #fff; border-color: var(--navy); }
.pair { display: flex; gap: 12px; align-items: center; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper .round { width: 46px; height: 46px; font-size: 22px; border-width: 2px; }
.stepper-val { min-width: 76px; text-align: center; font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.chip.sel { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.chip.dashed { border-style: dashed; border-color: #C9C3F2; color: #6A62C4; background: transparent; }
.chips.big .chip { min-height: 72px; min-width: 96px; font-family: var(--display); font-weight: 500; font-size: 22px; border-width: 3px; border-radius: 22px; justify-content: center; }
.chips.static .chip { background: #fff; border-color: #fff; }

.switch { width: 68px; height: 40px; border-radius: 20px; border: 0; background: #C9C6D6; position: relative; padding: 0; flex: none; transition: background .2s; }
.switch span { position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch.on { background: var(--green); }
.switch.on span { left: 32px; }

.input { height: 60px; border-radius: 18px; border: 2px solid #D9D4EC; padding: 0 18px; font: inherit; font-size: 20px; color: var(--ink); background: #fff; width: 100%; }
.input.big { height: 84px; border: 3px solid var(--navy); font-family: var(--display); font-size: 36px; border-radius: 24px; padding: 0 28px; }
select.input { padding: 0 12px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.wide { width: min(560px, 100%); }
.field.center { align-items: center; text-align: center; }
.field-row { display: flex; gap: 16px; }
.grow2 { flex: 2 1 0; }

.card { background: #fff; border-radius: var(--r); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; border: 0; text-align: left; color: var(--ink); }
.card.center { align-items: center; text-align: center; }
.card.inline { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; }
.card.list { padding: 4px 22px; gap: 0; }
.card.dark { background: var(--navy); color: var(--cream); flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.card.dark span { display: block; color: #D9D6F2; font-size: 15px; }
.card.nap-on { box-shadow: inset 0 0 0 3px #BFE5D2; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-row > div { display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; }
.link-card { cursor: pointer; }
.edit { color: #6A62C4; font-weight: 800; font-size: 15px; }
.span2 { grid-column: 1 / -1; }
.time-big { font-family: var(--display); font-size: 58px; line-height: 1; font-weight: 500; }
.time-mid { font-family: var(--display); font-size: 38px; line-height: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; width: 100%; }
.grid5.small { gap: 10px; }
.split { display: flex; gap: 24px; align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 16px; flex: 1 1 auto; min-width: 0; }

.check { display: flex; align-items: center; gap: 16px; border-radius: 22px; padding: 16px 22px; }
.check > div { display: flex; flex-direction: column; text-align: left; }
.check span { font-size: 15px; }
.check.ok { background: #D7EFE3; color: #1F5C3F; }
.check.warn { background: #FFE0CC; color: #6B3410; }
.ok-txt { color: #2C7A55; font-weight: 700; }
.warn-txt { color: #A85A1E; font-weight: 700; }
.warn-box { background: #FFE7D6; color: #5C3410; border-radius: 20px; padding: 16px 20px; }
.tag { font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--line); color: #4A4D6A; align-self: flex-start; }
.tag.fam { background: #FCEBC0; color: #6B4A10; }
.tag.good { background: #D7EFE3; color: #1F5C3F; }
.tag.bad { background: #FFE2DF; color: #A23A30; }

.row-setting { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 2px solid #F3EFE7; }
.row-setting:last-child { border-bottom: 0; }
.row-text { display: flex; flex-direction: column; }
.row-title { font-weight: 800; }
.row-desc { font-size: 14px; color: var(--muted); }

/* ---------- Animations des animaux ---------- */
.animal { display: block; max-width: 100%; height: auto; }
.animal .zz { font-family: var(--display); animation: zz 3s ease-in-out infinite; }
.animal .zz2 { animation-delay: 1.2s; }
@keyframes zz { 0%, 100% { opacity: .2; transform: translateY(4px); } 50% { opacity: 1; transform: translateY(-4px); } }
.bob { animation: bob 4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-10px) scale(1.025); } }
.hop { animation: hop 1.4s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-26px) rotate(-3deg); } 60% { transform: translateY(-20px) rotate(3deg); } }
.breathe { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.stretch { animation: stretch 3s ease-in-out 2; }
@keyframes stretch { 0%, 100% { transform: scale(1, 1); } 40% { transform: scale(1.08, .92); } 70% { transform: scale(.95, 1.07); } }
.animal.awake .eyes { animation: blink 6s infinite; transform-origin: 100px 106px; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
/* Vie des personnages (jour) : entrée en rebond, écrasement au toucher, étoiles, sélection qui pulse. */
.home-animal { animation: arrive .9s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes arrive { from { transform: translateY(60px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.animal.squash { animation: squash .6s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes squash { 0% { transform: scale(1, 1); } 25% { transform: scale(1.12, .86); } 55% { transform: scale(.94, 1.07); } 80% { transform: scale(1.03, .98); } 100% { transform: scale(1, 1); } }
.story-card.sel .thumb .animal { animation: selpulse 1.6s ease-in-out infinite; }
@keyframes selpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
.fx-star { position: fixed; z-index: 150; pointer-events: none; font-size: 40px; line-height: 1; color: var(--c, #F5C451); transform: translate(-50%, -50%); animation: burst .9s ease-out forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(.4); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--r) * -1)) scale(1.3); } }
.night-glow { animation: glow 9s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .12; } 50% { opacity: .24; } }
/* Mouvements propres à chaque moment (animal + décor) */
.moment-animal { position: relative; }
.ch-animal .scene, .moment-animal .scene { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; }
.scene span { position: absolute; display: block; }
.animal.wiggle { animation: wiggle 1.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.animal.sway { animation: sway 3.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.animal.chew { animation: chew 1.2s ease-in-out infinite; }
@keyframes chew { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.03, .97); } 60% { transform: scale(1, 1.01); } }
/* Bulles (bain) */
.scene-bulles .bulle { bottom: -10%; left: 0; width: var(--s); height: var(--s); border-radius: 50%; border: 3px solid rgba(255,255,255,.9); background: rgba(255,255,255,.28); box-shadow: inset 4px 4px 0 rgba(255,255,255,.5); animation: bubble-up 4s ease-in infinite; }
@keyframes bubble-up { 0% { transform: translateY(0) scale(.7); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-360px) scale(1.15); opacity: 0; } }
/* Gouttes (douche) */
.scene-gouttes .goutte { top: -8%; width: 16px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #6FA8DC; animation: drop-fall 2s linear infinite; }
@keyframes drop-fall { 0% { transform: translateY(0) rotate(-45deg); opacity: 0; } 10% { opacity: .95; } 100% { transform: translateY(380px) rotate(-45deg); opacity: 0; } }
/* Il mange : une pomme arrive à la bouche */
.scene-manger .miette { left: 50%; top: 60%; margin: -24px 0 0 -24px; font-size: 48px; line-height: 1; animation: eat 2.4s ease-in infinite; }
@keyframes eat { 0% { transform: translate(150px, -130px) scale(1); opacity: 0; } 20% { opacity: 1; } 60% { transform: translate(0, 0) scale(.9); opacity: 1; } 70%, 100% { transform: translate(0, 0) scale(.1); opacity: 0; } }
/* Étoiles (dents, temps calme) */
.scene-etoiles .etoile { color: #F5C451; font-size: 26px; animation: twinkle 2.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.5); } 50% { opacity: 1; transform: scale(1.2); } }
/* Feuilles (dehors) */
.scene-feuilles .feuille { top: -8%; font-size: 30px; animation: leaf 5s ease-in-out infinite; }
@keyframes leaf { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translate(40px, 170px) rotate(120deg); } 100% { transform: translate(-30px, 340px) rotate(260deg); opacity: 0; } }
/* Notes de musique (jeu, histoire) */
.scene-notes .note { font-family: var(--display); font-size: 34px; color: var(--navy); opacity: 0; animation: note-up 3.2s ease-out infinite; }
@keyframes note-up { 0% { transform: translateY(0) rotate(-10deg); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-190px) rotate(10deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scene { display: none; } .animal.wiggle, .animal.sway, .animal.chew { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { .bob, .hop, .breathe, .stretch, .animal .zz, .pulse, .home-animal, .animal.squash, .story-card.sel .thumb .animal, .night-glow, .ds.now { animation: none !important; } .fx-star { display: none; } }

/* ---------- Coin parent (appui long) ---------- */
.parent-corner { position: absolute; z-index: 20; width: 76px; height: 76px; border-radius: 50%; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; touch-action: none; }
.corner-hd { top: 10px; right: 10px; } .corner-hg { top: 10px; left: 10px; }
.corner-bd { bottom: 10px; right: 10px; } .corner-bg { bottom: 10px; left: 10px; }
.hold-ring { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: var(--moon); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 214; stroke-dashoffset: 214; }
.parent-corner.holding { opacity: 1 !important; }
.parent-corner.holding .hold-ring circle { animation: ring var(--hold, 3s) linear forwards; }
@keyframes ring { to { stroke-dashoffset: 0; } }

/* ---------- Premier lancement ---------- */
.onb { background: var(--cream); padding: 32px 52px; gap: 12px; }
.onb-welcome { background: var(--navy); color: var(--cream); align-items: center; justify-content: center; gap: 24px; text-align: center; }
.brand-big { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 600; font-size: 56px; }
.onb-welcome h1 { max-width: 760px; }
.animal-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.animal-tile { width: 104px; height: 104px; border-radius: 30px; background: var(--navy2); display: flex; align-items: center; justify-content: center; }
.install-tip { max-width: 720px; background: #2E3270; border: 2px solid var(--moon); border-radius: 22px; padding: 14px 20px; display: flex; flex-direction: column; gap: 4px; color: #E6E3FA; font-size: 15px; }
.install-tip strong { color: var(--moon); font-size: 17px; }
.onb-welcome .btn.primary { background: var(--moon); color: var(--navy); }
.ticks { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; color: #C9C3F2; font-weight: 700; }
.ticks span { display: flex; align-items: center; gap: 8px; }
.ticks svg { color: #7ED3A8; }
.onb-head { display: flex; align-items: center; justify-content: space-between; }
.progress { display: flex; gap: 8px; }
.progress span { width: 56px; height: 8px; border-radius: 4px; background: #D9D4EC; }
.progress span.done { background: var(--navy); }
.step-n { width: 90px; text-align: right; font-weight: 700; }
.onb-body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center; }
.onb-body.row { flex-direction: row; text-align: left; gap: 48px; }
.onb-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.onb-foot.end { justify-content: flex-end; }
.pick-card { position: relative; border-radius: 34px; background: #fff; border: 4px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px 8px; min-height: 260px; }
.pick-card.sel { border-color: var(--navy); }
.pick-card.sm { min-height: 104px; padding: 8px 4px; border-width: 3px; border-radius: 20px; gap: 2px; font-weight: 800; font-size: 14px; }
.pick-label { font-family: var(--display); font-size: 26px; }
.check-badge { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: none; align-items: center; justify-content: center; }
.pick-card.sel .check-badge { display: flex; }
.preview { width: min(460px, 42vw); aspect-ratio: 480 / 560; border-radius: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; flex: none; }
.preview.sm { width: 300px; aspect-ratio: auto; height: 330px; border: 10px solid var(--navy); border-radius: 28px; }
.preview-hi { font-family: var(--display); font-size: 30px; }
.color-card { height: 120px; border-radius: 28px; background: #fff; border: 4px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 18px; }
.color-card.sel { border-color: var(--navy); }
.dot { width: 52px; height: 52px; border-radius: 50%; display: block; }
.hours { width: 100%; }
.ready { flex-direction: row; align-items: center; gap: 48px; }
.ready .col { gap: 18px; }
.ready-animal { flex: none; }
.row-card { flex-direction: row; align-items: center; gap: 20px; }
.row-card > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.mini-tablet { position: relative; flex: none; width: 150px; height: 104px; border-radius: 16px; border: 6px solid var(--navy); background: var(--cream); }
.mini-moon { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 0 6px rgba(226,87,76,.35); }
.mini-moon.corner-hd { top: 6px; right: 6px; } .mini-moon.corner-hg { top: 6px; left: 6px; }
.mini-moon.corner-bd { bottom: 6px; right: 6px; } .mini-moon.corner-bg { bottom: 6px; left: 6px; }

/* ---------- Côté enfant ---------- */
.child { padding: 36px 52px; color: var(--ink); }
.hello { font-size: max(34px, min(4.5vw, 48px)); font-size: clamp(34px, 4.5vw, 48px); }
.home-main { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 56px; flex-wrap: wrap; }
.home-animal .animal { width: min(340px, 38vw); height: auto; }
.home-actions { display: flex; flex-direction: column; gap: 20px; }
.big-btn { width: 380px; max-width: 80vw; min-height: 132px; border-radius: 40px; border: 0; display: flex; align-items: center; gap: 22px; padding: 0 28px; font-family: var(--display); font-weight: 500; font-size: 32px; text-align: left; }
.big-btn.light { background: #fff; color: var(--ink); box-shadow: 0 6px 0 #EBD3C3; }
.big-btn.dark { background: var(--navy); color: var(--cream); box-shadow: 0 6px 0 #0E1030; }
.big-btn.nap { background: #D7EFE3; color: #1F5C3F; box-shadow: 0 6px 0 #A9D6C0; min-height: 100px; font-size: 28px; }
.big-btn:active { transform: translateY(4px); box-shadow: none; }
.big-ico { width: 84px; height: 84px; border-radius: 26px; display: flex; align-items: center; justify-content: center; flex: none; }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.ritual-strip { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.strip-label { font-weight: 800; color: #8A5A3C; margin-right: 6px; }
.strip-step { padding: 10px 18px; border-radius: 999px; font-weight: 800; }
.strip-arrow { color: #C9A58D; display: flex; }

.pick { gap: 16px; padding: 26px 40px; }
.pick-head { display: flex; align-items: center; gap: 20px; padding-right: 70px; }
.pick-head h1 { flex: 1 1 auto; font-size: max(28px, min(3.6vw, 40px)); font-size: clamp(28px, 3.6vw, 40px); }
.slots { display: flex; align-items: center; gap: 10px; background: #fff; padding: 12px 20px; border-radius: 999px; }
.slots span { width: 18px; height: 18px; border-radius: 50%; background: var(--line); }
.tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.tab { min-height: 60px; padding: 0 26px; border-radius: 999px; border: 3px solid #fff; background: #fff; font-family: var(--display); font-size: 20px; color: var(--ink); }
.tab.sel { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.story-grid { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; align-content: start; overflow-y: auto; padding: 4px; }
.story-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 30px; background: #fff; border: 5px solid #fff; text-align: left; }
.thumb { position: relative; height: 170px; border-radius: 22px; display: flex; align-items: center; justify-content: center; }
.thumb.sm { height: 100px; border-radius: 16px; }
.order { position: absolute; top: 10px; right: 10px; width: 46px; height: 46px; border-radius: 50%; color: #fff; font-family: var(--display); font-size: 24px; display: flex; align-items: center; justify-content: center; }
.voice-tag { position: absolute; bottom: 10px; left: 12px; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.92); color: var(--ink); font-weight: 800; font-size: 14px; padding: 4px 10px; border-radius: 999px; }
.story-title { font-family: var(--display); font-weight: 500; font-size: 21px; padding: 0 4px; line-height: 1.2; color: var(--ink); }
.story-title.sm { font-family: var(--body); font-weight: 800; font-size: 15px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 20px; padding: 40px; }
.pick-foot { display: flex; justify-content: flex-end; }
.go-btn { background: var(--navy); }

.player { background: #221A30; color: #F3E6D8; flex-direction: row; align-items: center; gap: 56px; padding: 56px 72px; }
.player.fading { animation: dimdown 600s linear forwards; }
@keyframes dimdown { to { filter: brightness(.45); } }
.player-art { flex: none; width: min(480px, 40vw); aspect-ratio: 1; border-radius: 48px; background: #2E2850; display: flex; align-items: center; justify-content: center; }
.player-art .animal { width: 64%; opacity: .85; }
.player-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 22px; }
.player-info h1 { font-size: max(30px, min(4vw, 46px)); font-size: clamp(30px, 4vw, 46px); }
.voice-line { display: flex; align-items: center; gap: 10px; font-size: 19px; color: #D8C6B6; }
.bar { height: 12px; border-radius: 6px; background: #3A3150; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: #D9A93F; border-radius: 6px; transition: width .4s; }
.player-ctl { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.play-btn { width: 120px; height: 120px; border-radius: 50%; border: 0; background: #D9A93F; display: flex; align-items: center; justify-content: center; }
.next-up { display: flex; flex-direction: column; background: #2E2850; border-radius: 22px; padding: 12px 18px; }

.moment { align-items: center; justify-content: center; text-align: center; gap: 14px; }
.moment.dark { color: var(--cream); }
.moment-step { position: absolute; top: 30px; left: 40px; font-weight: 800; opacity: .7; }
.moment-animal .animal { width: min(320px, 40vh); }
.moment-time { font-family: var(--display); font-size: 26px; opacity: .8; }

.night { background: #000; align-items: center; justify-content: center; }
.night-animal { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; opacity: var(--lvl, 0); transition: opacity 2s; }
.night-animal.touched { opacity: max(var(--lvl, 0), .45); transition: opacity .6s; }
.night-glow { position: absolute; top: 20px; width: 300px; height: 300px; border-radius: 50%; opacity: .18; filter: blur(30px); }
.night-animal .animal { position: relative; }
.night-text { position: relative; margin: 0; font-family: var(--display); font-size: 30px; color: #8A6A55; }
.soon { background: #3B2F4F; color: #F0D9C4; align-items: center; justify-content: center; }
.soon-inner, .wake-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.soon-inner p, .wake-inner p { margin: 0; font-size: 22px; font-weight: 700; }
.sun { position: absolute; left: 50%; width: 760px; height: 760px; margin-left: -380px; border-radius: 50%; }
.sun.low { background: #C9834F; bottom: -640px; }
.sun.rise { background: var(--moon); bottom: -420px; animation: rise 8s ease-out; }
@keyframes rise { from { bottom: -700px; } }
.wake { align-items: center; justify-content: center; }
.wake-inner h1 { font-size: 48px; }

/* ---------- Code parent ---------- */
.pin-screen { background: var(--navy); align-items: center; justify-content: center; }
.pin-box { width: 440px; max-width: 92vw; background: var(--cream); border-radius: 40px; padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.pin-box h1 { font-size: 28px; text-align: center; }
.pin-dots { display: flex; gap: 18px; }
.pin-dots span { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--navy); }
.pin-dots span.on { background: var(--navy); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.key { height: 76px; border-radius: 24px; border: 3px solid var(--line); background: #fff; font-family: var(--display); font-size: 32px; color: var(--ink); }
.key.bare { border: 0; background: transparent; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

/* ---------- Espace parent ---------- */
.parent { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--cream); }
.pnav { width: 260px; flex: none; background: var(--navy); color: var(--cream); display: flex; flex-direction: column; gap: 4px; padding: 24px 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.pnav-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font-family: var(--display); font-weight: 600; font-size: 22px; }
.pnav-item { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 16px; border: 0; background: transparent; color: #D9D6F2; font-weight: 800; font-size: 16px; text-align: left; }
.pnav-item.active { background: var(--cream); color: var(--navy); }
.pnav-exit { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 18px; border: 0; background: var(--moon); color: var(--navy); font-weight: 800; font-size: 15px; padding: 0 12px; text-align: left; }
.pmain { flex: 1 1 auto; min-width: 0; padding: 30px 40px 40px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; height: 100vh; height: 100dvh; }
.ptitle { font-size: 32px; }
.ph-head { display: flex; align-items: center; gap: 14px; }
.ph-head > div { display: flex; flex-direction: column; }
.avatar { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; flex: none; }
.alert-card { flex-direction: row; align-items: center; gap: 14px; background: #2E3270; color: var(--cream); }
.alert-card > div { flex: 1 1 auto; display: flex; flex-direction: column; }
.alert-card .muted { color: #C9C3F2; }
.alert-card .btn.ghost { border-color: var(--cream); color: var(--cream); }
.launch { border: 0; border-radius: 28px; padding: 22px 26px; display: flex; align-items: center; gap: 18px; text-align: left; }
.launch > span:last-child { display: flex; flex-direction: column; }
.launch strong { font-family: var(--display); font-weight: 500; font-size: 23px; }
.launch.dark { background: var(--navy); color: var(--cream); }
.launch.dark span span { color: #C9C3F2; font-size: 15px; }
.launch.green { background: #D7EFE3; color: var(--ink); }
.launch.green span span { color: #2C5E47; font-size: 15px; }
.launch-ico { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--moon); }
.launch.green .launch-ico { background: var(--green); }
.mini-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-chip { padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.times { display: flex; gap: 26px; }
.times span { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); }
.times b { font-family: var(--display); font-weight: 500; font-size: 34px; color: var(--ink); }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 56px; height: 56px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--line); }
.swatch.sel { box-shadow: 0 0 0 3px var(--navy); }
.side-preview { width: 300px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.seg { display: inline-flex; align-self: flex-start; background: var(--line); border-radius: 999px; padding: 5px; }
.seg button { min-height: 48px; padding: 0 26px; border-radius: 999px; border: 0; background: transparent; font-weight: 800; color: var(--ink); }
.seg button.sel { background: var(--navy); color: var(--cream); }
.ritual-list { display: flex; flex-direction: column; gap: 10px; }
.ritual-row { display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 22px; padding: 10px 18px 10px 10px; }
.ritual-row.off { opacity: .55; }
.updown { display: flex; flex-direction: column; gap: 4px; }
.updown .icon-btn { width: 36px; height: 30px; border-radius: 10px; border: 0; color: var(--muted); }
.r-dot { width: 48px; height: 48px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; }
.r-name { display: flex; flex-direction: column; flex: 1 1 auto; }
.r-dur { width: 186px; text-align: center; }
.r-sw { width: 68px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pstory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pstory { background: #fff; border-radius: 22px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pstory-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px; }
.pstory-actions { display: flex; gap: 6px; padding: 0 4px 4px; }
.mini-btn { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: var(--ink); }
.mini-btn.rec { color: #A23A30; border-color: #F6C9C3; flex: 1 1 auto; justify-content: center; }
.aside { width: 310px; flex: none; background: #fff; border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.pl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pl-list li { display: flex; align-items: center; gap: 8px; background: var(--cream); border-radius: 16px; padding: 6px 8px 6px 12px; font-weight: 700; font-size: 15px; }
.pl-list .n { font-weight: 800; width: 18px; }
.pl-list .icon-btn { width: 34px; height: 34px; }
.pl-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 24px; background: #fff; border: 4px solid var(--line); text-align: left; }
.mode-card.sel { border-color: var(--navy); }
.mode-preview { width: 100%; height: 96px; border-radius: 16px; background: #000; display: flex; align-items: center; justify-content: center; }
.mode-preview span { width: 60px; height: 60px; border-radius: 50%; display: block; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.sound-card { height: 110px; border-radius: 22px; background: #fff; border: 3px solid #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--ink); }
.sound-card.sel { background: var(--lav-l); border-color: var(--navy); }
.vol-row { display: flex; align-items: center; gap: 16px; }
.vol-track { position: relative; flex: 1 1 auto; height: 14px; border-radius: 7px; background: var(--line); }
.vol-fill { height: 100%; border-radius: 7px; background: #6A62C4; }
.vol-cap { position: absolute; top: -10px; width: 3px; height: 34px; background: var(--navy); border-radius: 2px; }
.corner-pick { position: relative; height: 180px; border-radius: 18px; border: 8px solid var(--navy); background: #FDEEE4; }
.cp { position: absolute; width: 56px; height: 56px; border-radius: 50%; border: 3px dashed #C9A58D; background: #fff; }
.cp.corner-hd { top: 6px; right: 6px; } .cp.corner-hg { top: 6px; left: 6px; } .cp.corner-bd { bottom: 6px; right: 6px; } .cp.corner-bg { bottom: 6px; left: 6px; }
.cp.sel { background: var(--moon); border: 4px solid var(--navy); }

/* ---------- Studio voix ---------- */
.studio { background: #12132B; color: #ECEAF8; }
.studio-top { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid #262852; }
.studio-top .grow { display: flex; flex-direction: column; }
.studio-kicker { font-size: 13px; font-weight: 800; color: #F08A80; letter-spacing: 1.5px; text-transform: uppercase; }
.studio-title { font-family: var(--display); font-size: 24px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #1E2046; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 800; border: 0; color: inherit; min-height: 44px; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: #5BD39A; }
.studio-main { flex: 1 1 auto; display: flex; min-height: 0; }
.pages { width: 190px; flex: none; border-right: 1px solid #262852; padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.page-btn { min-height: 54px; border-radius: 14px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; background: #1A1C3D; border: 2px solid transparent; color: inherit; font-weight: 800; font-size: 15px; }
.page-btn.cur { background: #2A2D63; border-color: var(--moon); }
.page-btn .ok { color: #5BD39A; }
.prompter { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 56px; font-family: var(--display); }
.prompter p { margin: 0; line-height: 1.45; }
.prompter .prev, .prompter .next { font-size: 22px; color: #5F6194; }
.prompter .cur { font-size: max(26px, min(3.4vw, 38px)); font-size: clamp(26px, 3.4vw, 38px); color: #fff; }
.m-name { background: var(--moon); color: #12132B; padding: 0 8px; border-radius: 10px; }
.vu { width: 70px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.vu-bars { display: flex; flex-direction: column-reverse; gap: 4px; }
.vu-bars span { width: 26px; height: 12px; border-radius: 3px; background: #262852; }
.vu-bars span.g { background: #5BD39A; } .vu-bars span.y { background: var(--moon); } .vu-bars span.r { background: var(--red); }
.studio-bottom { border-top: 1px solid #262852; padding: 14px 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.wave { width: 100%; height: 54px; background: #1A1C3D; border-radius: 14px; display: block; }
.transport { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.timer { font-family: var(--display); font-size: 30px; width: 90px; }
.rec-status { font-weight: 800; color: #A7A2D6; }
.rec-status.live { color: #F08A80; }
.btn.studio-ghost { background: transparent; border: 2px solid #3A3D78; color: #ECEAF8; }
.studio .btn.primary { background: var(--moon); color: #12132B; }
.rec-btn { width: 88px; height: 88px; border-radius: 50%; border: 5px solid #3A3D78; background: #12132B; display: flex; align-items: center; justify-content: center; flex: none; }
.rec-btn span { display: block; width: 56px; height: 56px; border-radius: 50%; background: var(--red); transition: all .2s; }
.rec-btn.on { border-color: #F08A80; box-shadow: 0 0 0 8px rgba(226,87,76,.25); }
.rec-btn.on span { width: 30px; height: 30px; border-radius: 8px; }

/* ---------- Fenêtres et messages ---------- */
.modal-wrap { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(18,19,43,.6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { width: min(480px, 100%); background: var(--cream); color: var(--ink); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.modal-q { font-weight: 800; font-size: 20px; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 140%); background: var(--navy); color: var(--cream); padding: 14px 22px; border-radius: 999px; font-weight: 800; z-index: 120; transition: transform .3s; max-width: 90vw; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#toast.show { transform: translate(-50%, 0); }


/* ---------- Horloge intelligente (accueil enfant) ---------- */
.clockhome { padding: 30px 48px 26px; gap: 10px; transition: background 1.5s; }
.clockhome.dark { color: var(--cream); }
.ch-main { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 56px; flex-wrap: wrap; }
.ch-animal { position: relative; flex: none; }
.ch-animal .animal { width: min(320px, 34vw); height: auto; }
.act-badge { position: absolute; right: -18px; bottom: 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(31,34,80,.18); }
.ch-side { display: flex; flex-direction: column; gap: 22px; width: min(460px, 90vw); }
.ch-say { font-family: var(--display); font-weight: 600; font-size: max(34px, min(4.4vw, 52px)); font-size: clamp(34px, 4.4vw, 52px); line-height: 1.1; }
.ch-next { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.75); color: var(--ink); border-radius: 26px; padding: 14px 18px; }
.ch-next-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--cream); display: flex; align-items: center; justify-content: center; flex: none; }
.ch-next-label { font-weight: 800; font-size: 18px; display: block; margin-bottom: 8px; }
.ch-bar { height: 12px; border-radius: 6px; background: rgba(31,34,80,.12); overflow: hidden; }
.ch-bar span { display: block; height: 100%; border-radius: 6px; background: var(--navy); transition: width 1s; }
.ch-next-time { font-family: var(--display); font-size: 24px; }
.ch-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.mid-btn { min-height: 84px; border-radius: 30px; border: 0; padding: 0 26px; display: inline-flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 500; font-size: 24px; }
.mid-btn.light { background: #fff; color: var(--ink); box-shadow: 0 5px 0 rgba(31,34,80,.12); }
.mid-btn.dark { background: var(--navy); color: var(--cream); box-shadow: 0 5px 0 #0E1030; }
.mid-btn.dark svg { color: var(--moon); }
.mid-btn.nap { background: var(--green); color: #fff; box-shadow: 0 5px 0 #2A7F58; }
.mid-btn:active { transform: translateY(3px); box-shadow: none; }
.day-strip { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ds { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 18px; min-width: 64px; color: var(--ink); border: 3px solid transparent; }
.ds-t { font-weight: 800; font-size: 13px; }
.ds.past { opacity: .35; }
.ds.now { border-color: var(--navy); transform: scale(1.12); box-shadow: 0 6px 16px rgba(31,34,80,.2); animation: nowpulse 2.4s ease-in-out infinite; }
@keyframes nowpulse { 0%, 100% { transform: scale(1.12); } 50% { transform: scale(1.2); } }
.clockhome.dark .ds.now { border-color: var(--moon); }
.night-sub { position: relative; margin: 0; font-size: 19px; color: #6E5646; font-weight: 700; }
.night-track { position: relative; display: flex; align-items: center; gap: 12px; color: #6E5646; margin-top: 10px; }
.nt-bar { width: 260px; height: 10px; border-radius: 5px; background: #24170F; overflow: hidden; }
.nt-bar span { display: block; height: 100%; background: #6E5646; border-radius: 5px; }

/* ---------- Horloge (réglages) ---------- */
.ck-list { display: flex; flex-direction: column; gap: 8px; }
.ck-row { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 22px; padding: 8px 14px 8px 10px; border: 3px solid transparent; }
.ck-row.now { border-color: var(--green); }
.ck-time { font-family: var(--display); font-size: 24px; min-width: 70px; text-align: center; }
.ck-ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.ck-label { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.ck-del { width: 40px; flex: none; }
.input.sm { height: 48px; font-size: 17px; font-weight: 700; max-width: 240px; }
.preview-say { font-family: var(--display); font-size: 22px; text-align: center; padding: 0 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Petits écrans (téléphone, tablette en portrait) ---------- */
@media (max-width: 900px) {
  .onb, .child { padding: 24px; }
  .grid5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid3, .grid2 { grid-template-columns: 1fr; }
  .onb-body.row, .ready, .player, .split { flex-direction: column; }
  .player { padding: 32px 24px; gap: 24px; }
  .parent { flex-direction: column; }
  .pnav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .pnav-brand { width: 100%; padding-bottom: 6px; }
  .pnav .grow { display: none; }
  .pmain { height: auto; padding: 20px; }
  .aside, .side-preview { width: 100%; position: static; }
  .sound-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pages { display: none; }
  .prompter { padding: 20px; }
  .r-dur { width: auto; }
}

/* ---------- Animaux : mouvements supplémentaires ---------- */
.animal.cheer { animation: cheer 1s cubic-bezier(.3, 1.4, .5, 1) infinite; }
@keyframes cheer { 0%, 100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-40px) scale(1.06, .96) rotate(-4deg); } 65% { transform: translateY(-30px) rotate(4deg); } }
.animal.brushing { animation: brushing .35s ease-in-out infinite; }
@keyframes brushing { 0%, 100% { transform: translateX(-4px) rotate(-1.5deg); } 50% { transform: translateX(4px) rotate(1.5deg); } }
.scene-rayons .rayons { left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(245,196,81,.45) 0 10deg, transparent 10deg 30deg); animation: spin 30s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); }
@keyframes spin { to { transform: rotate(360deg); } }
.ch-animal, .moment-animal { isolation: isolate; }

/* ---------- Horloge à aiguilles ---------- */
.ch-sayrow { display: flex; align-items: center; gap: 18px; }
.clockface { flex: none; filter: drop-shadow(0 6px 14px rgba(31,34,80,.15)); }
.clockface .cf-bg { fill: #fff; stroke: #1F2250; stroke-width: 4; }
.clockface .cf-ticks line { stroke: #1F2250; stroke-width: 3; stroke-linecap: round; }
.clockface .cf-wedge { opacity: .9; stroke: #1F2250; stroke-width: 1.5; }
.clockface .cf-h { stroke: #1F2250; stroke-width: 7; stroke-linecap: round; }
.clockface .cf-m { stroke: #E8875B; stroke-width: 4.5; stroke-linecap: round; }
.clockface .cf-dot { fill: #1F2250; }
.clockface.dark .cf-bg { fill: #2E3270; stroke: #F5C451; }
.clockface.dark .cf-ticks line, .clockface.dark .cf-h { stroke: #F5C451; }
.clockface.dark .cf-dot { fill: #F5C451; }

/* ---------- « C'est fait ! » ---------- */
.done-btn { align-self: flex-start; min-height: 92px; border-radius: 32px; border: 0; padding: 0 30px; display: inline-flex; align-items: center; gap: 14px;
  background: var(--green); color: #fff; font-family: var(--display); font-weight: 600; font-size: 28px; box-shadow: 0 6px 0 #2A7F58; animation: pulse 2.4s ease-in-out infinite; }
.done-btn:active { transform: translateY(4px); box-shadow: none; }
.done-chip { align-self: flex-start; background: #FFF3CC; color: #6B4A10; border: 3px solid var(--moon); border-radius: 999px; padding: 12px 22px; font-family: var(--display); font-size: 22px; }
.ds { position: relative; }
.ds-star { position: absolute; top: -12px; right: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--moon); color: #fff; font-size: 18px; line-height: 28px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.mini-chip.rw { color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.mini-chip.rw.ok { box-shadow: inset 0 0 0 2px var(--moon); }

.celebrate { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 200; background: rgba(251,246,238,.94); display: flex; align-items: center; justify-content: center; overflow: hidden; animation: fadein .3s; }
.celebrate.out { animation: fadeout .4s forwards; }
@keyframes fadein { from { opacity: 0; } } @keyframes fadeout { to { opacity: 0; } }
.cel-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px; max-width: 760px; }
.cel-animal { position: relative; }
.cel-title { font-size: max(40px, min(6vw, 64px)); font-size: clamp(40px, 6vw, 64px); color: var(--navy); animation: popin .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes popin { from { transform: scale(.3); opacity: 0; } }
.cel-line { margin: 0; font-family: var(--display); font-size: max(24px, min(3.2vw, 34px)); font-size: clamp(24px, 3.2vw, 34px); color: var(--ink); }
.cel-close { margin: 0; font-size: 20px; font-weight: 700; color: var(--muted); }
.cel-extra span { position: absolute; left: 50%; top: 45%; font-size: 40px; color: var(--moon); animation: burst2 1.4s ease-out infinite; }
@keyframes burst2 { 0% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(-170px) scale(1.2); opacity: 0; } }
.confetti-wrap { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; }
.confetti { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: confetti 3s ease-in forwards; }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 110vh) rotate(var(--rot)); opacity: .9; } }
.celebrate.adult .cel-title { font-size: 44px; }
.hold-adult { position: relative; overflow: hidden; }
.hold-adult .hold-fill { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 0; background: var(--green); }
.hold-adult.holding .hold-fill { animation: holdfill 2s linear forwards; }
.hold-adult .hold-txt { position: relative; }
@keyframes holdfill { to { width: 100%; } }

/* ---------- Minuteur de brossage ---------- */
.brush { padding: 30px 48px; }
.brush-later { position: absolute; top: 20px; left: 24px; z-index: 5; }
.brush-main { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 56px; flex-wrap: wrap; }
.brush-side { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.brush-ring { width: 240px; height: 240px; transform: rotate(-90deg); }
.brush-ring circle { fill: none; stroke-width: 12; }
.brush-ring .bg { stroke: #fff; } .brush-ring .fg { stroke: #4FA3E8; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.brush-time { position: absolute; top: 88px; font-family: var(--display); font-size: 52px; color: var(--navy); }
.brush-zone { font-family: var(--display); font-size: 32px; color: var(--navy); }

/* ---------- Durée des histoires ---------- */
.moons { display: inline-flex; gap: 3px; vertical-align: middle; }
.moons i { width: 12px; height: 12px; border-radius: 50%; background: var(--moon); box-shadow: inset -4px -2px 0 rgba(31,34,80,.25); }
.tab .moons { margin-right: 6px; }
.len-tag { position: absolute; top: 10px; left: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(31,34,80,.85); color: #fff; font-size: 14px; padding: 5px 10px; border-radius: 999px; }

/* ---------- Animations (espace parent) ---------- */
.anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.anim-tile { border: 0; border-radius: 24px; padding: 10px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); text-align: center; }
.anim-stage { position: relative; width: 150px; height: 150px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.anim-stage .scene { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; }
.anim-stage .scene span { position: absolute; display: block; }
.anim-stage .rayons { width: 260px !important; height: 260px !important; margin: -130px 0 0 -130px !important; }
.preview-host { position: relative; min-height: 100vh; min-height: 100dvh; }
.preview-bar { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; align-items: center; gap: 12px; background: #fff; color: var(--ink); padding: 8px 10px 8px 16px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.preview-host .parent-corner { display: none; }

@media (prefers-reduced-motion: reduce) {
  .animal.cheer, .animal.brushing, .done-btn, .scene-rayons .rayons, .cel-title, .cel-extra span, .confetti { animation: none !important; }
}
.ch-clock { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.ch-digital { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1; background: rgba(255,255,255,.8); color: var(--navy); padding: 6px 16px; border-radius: 999px; }
.clockhome.dark .ch-digital { background: rgba(46,50,112,.9); color: var(--moon); }
.ln-story { border: 4px solid #fff; text-align: left; cursor: pointer; }
.ln-story.sel { border-color: var(--navy); }
.ln-story .thumb { position: relative; }
.ln-story .order { width: 34px; height: 34px; font-size: 18px; top: 6px; right: 6px; }
.launch-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 26px; padding: 14px 16px 14px 22px; box-shadow: 0 -6px 24px rgba(31,34,80,.12); }
.launch-bar > div { flex: 1 1 auto; display: flex; flex-direction: column; }

/* ---------- Accueil parent simplifié ---------- */
.subnav { margin-top: -6px; }
.home-big { display: flex; align-items: center; gap: 22px; width: 100%; min-height: 130px; border: 0; border-radius: 32px; padding: 0 32px; background: var(--navy); color: var(--cream); text-align: left; box-shadow: 0 6px 0 #0E1030; }
.home-big svg { color: var(--moon); flex: none; }
.home-big > span { display: flex; flex-direction: column; gap: 4px; }
.home-big strong { font-family: var(--display); font-weight: 600; font-size: 34px; }
.home-big > span > span { color: #C9C3F2; font-size: 17px; }
.home-big:active { transform: translateY(4px); box-shadow: none; }
.home-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.home-act { min-height: 120px; border: 0; border-radius: 28px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; color: var(--ink); box-shadow: 0 4px 0 var(--line); }
.home-act strong { font-family: var(--display); font-weight: 500; font-size: 22px; text-align: center; }
.home-act.warn { color: #A23A30; }
.home-act:active { transform: translateY(3px); box-shadow: none; }
.big-status { display: flex; align-items: center; gap: 18px; background: #2E3270; color: var(--cream); border-radius: 28px; padding: 22px 26px; }
.big-status svg { color: var(--moon); flex: none; }
.big-status > div { display: flex; flex-direction: column; }
.big-status strong { font-family: var(--display); font-size: 28px; font-weight: 500; }
.big-status span { color: #C9C3F2; }
.home-now { display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 22px; padding: 16px 20px; }
.home-now summary { cursor: pointer; font-weight: 800; color: #6A62C4; min-height: 40px; display: flex; align-items: center; }
.home-now details .chips { margin-top: 6px; }
/* Écran de l'enfant : lisible sans savoir lire */
.ch-animal[data-act="say"] { cursor: pointer; }
.ch-next-ico { width: 64px; height: 64px; border-radius: 20px; overflow: hidden; }
.ch-next-ico .animal { width: 56px; height: 56px; }
.ds { min-width: 58px; padding: 10px; }
.ds.past { opacity: .3; }
.modal.qs { gap: 12px; }
.qs-btn { min-height: 72px; border-radius: 22px; border: 0; background: var(--navy); color: var(--cream); display: flex; align-items: center; gap: 14px; padding: 0 22px; font-family: var(--display); font-size: 22px; text-align: left; }
.qs-btn svg { color: var(--moon); flex: none; }
.qs-btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); font-size: 19px; }
.qs-btn.ghost svg { color: var(--muted); }
.ch-say small { display: block; font-family: var(--body); font-weight: 800; font-size: 22px; opacity: .7; margin-top: 8px; }
.amb-btn { min-height: 56px; border-radius: 999px; border: 2px solid #4A3F66; background: transparent; color: #8E7FA8; display: inline-flex; align-items: center; gap: 10px; padding: 0 18px; font-weight: 800; font-size: 15px; }
.amb-btn.on { background: #3A3150; color: #F3E6D8; border-color: #D9A93F; }

/* ---------- Corrections de l'audit UX ---------- */
/* Choix des histoires : le bouton « C'est parti » reste toujours visible */
.screen.pick { height: 100vh; height: 100dvh; min-height: 0; }
.pick .story-grid { min-height: 0; }
.pick-foot { padding-top: 4px; }
/* Moment du rituel : une barre qui se vide montre le temps qui reste */
.moment-bar { width: min(420px, 70vw); height: 16px; border-radius: 8px; background: rgba(255,255,255,.6); overflow: hidden; }
.moment-bar span { display: block; height: 100%; width: 100%; background: var(--navy); border-radius: 8px; transition: width 1s linear; }
.moment.dark .moment-bar span { background: var(--moon); }
/* Frise de la journée : une seule ligne */
.day-strip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 14px 6px 6px; }
.day-strip::-webkit-scrollbar { display: none; }
.ds { flex: none; }
/* Tablette en portrait */
@media (orientation: portrait) {
  .clockhome { padding: 24px 24px 20px; }
  .ch-main { flex-direction: column; gap: 28px; }
  .ch-animal .animal { width: min(300px, 46vh, 70vw); }
  .ch-side { align-items: center; text-align: center; }
  .ch-sayrow { justify-content: center; }
  .done-btn, .done-chip { align-self: center; }
  .ds { min-width: 50px; padding: 8px; }
  .player { flex-direction: column; justify-content: center; text-align: center; gap: 28px; padding: 40px 32px; }
  .player-info { align-items: center; flex: 0 0 auto; width: min(560px, 100%); }
  .player-info .bar { width: 100%; }
  .player-ctl { justify-content: center; }
  .brush-main { flex-direction: column; gap: 24px; }
}
@media (max-width: 900px) { .pmain { overflow: visible; } }
.player-skip { display: flex; gap: 12px; flex-wrap: wrap; }
.hold-btn { position: relative; overflow: hidden; min-height: 56px; border-radius: 999px; border: 2px solid #4A3F66; background: #2E2850; color: #F3E6D8; display: inline-flex; align-items: center; gap: 10px; padding: 0 20px; font-weight: 800; font-size: 16px; touch-action: none; -webkit-user-select: none; user-select: none; }
.hold-btn svg { color: #D9A93F; position: relative; }
.hold-btn span { position: relative; }
.hold-btn > * { pointer-events: none; }
.hold-btn { -webkit-touch-callout: none; }
.hold-btn .hold-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(217,169,63,.35); }
.hold-btn.holding .hold-bar { animation: holdfill 1.5s linear forwards; }
@media (orientation: portrait) { .player-skip { justify-content: center; } }
/* Respiration lente de l'animal la nuit (environ 10 respirations par minute) */
.animal.sleep-breath { animation: sleepbreath 6s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes sleepbreath { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.045, 1.06); } }
@media (prefers-reduced-motion: reduce) { .animal.sleep-breath { animation: none; } }
.ln-section { background: #fff; border-radius: 26px; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.ln-h { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.ln-h svg { color: #6A62C4; }
.ln-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ln-row > span:first-child { font-weight: 800; min-width: 80px; }
.ln-section .pstory { background: var(--cream); }
.ln-section .ln-story { border-color: var(--cream); }
.ln-section .ln-story.sel { border-color: var(--navy); }
.ln-section .pstory-grid { grid-auto-flow: column; grid-auto-columns: 170px; grid-template-columns: none; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.ln-section .pstory { scroll-snap-align: start; }

/* ---------- Premier lancement : le geste de la lune ---------- */
.onb-moon { position: relative; }
.parent-corner.practice { opacity: 1; animation: pulse-moon 1.6s ease-in-out infinite; }
.parent-corner.practice.holding { animation: none; }
@keyframes pulse-moon { 50% { transform: scale(1.12); } }
.practice-hint { font-family: var(--display); font-weight: 600; font-size: 24px; color: #6A62C4; }
.big-tick { width: 110px; height: 110px; border-radius: 50%; background: #D7EFE3; color: #1F5C3F; display: flex; align-items: center; justify-content: center; }
.ready .tips summary { cursor: pointer; font-weight: 800; min-height: 40px; display: flex; align-items: center; }
@media (prefers-reduced-motion: reduce) { .parent-corner.practice { animation: none; } }

/* ---------- Espace parent : guide « Premiers pas » ---------- */
.guide { background: #fff; border-radius: 22px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; border: 3px solid var(--moon); }
.guide-head { display: flex; align-items: center; gap: 12px; }
.guide-head strong { font-family: var(--display); font-size: 22px; }
.guide-head .link-btn { margin-left: auto; }
.guide-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; border: 0; border-radius: 16px; background: var(--cream); padding: 8px 14px; text-align: left; color: var(--ink); }
.guide-item.next { background: #FCEBC0; }
.guide-item.done { opacity: .6; }
.guide-item.done strong { text-decoration: line-through; }
.guide-n { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.guide-item.done .guide-n { background: #3E9B6E; }
.guide-t { flex: 1; display: flex; flex-direction: column; }
.guide-t span { font-size: 14px; color: #6b6780; }
.onb-moon .step-n { visibility: hidden; }

/* ---------- Lancer la nuit : assistant pas à pas ---------- */
.modal.wizard { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; gap: 14px; padding: 22px 26px 26px; }
.wz-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.wz-q { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 0; text-align: center; }
.wz-sub { text-align: center; margin: -6px 0 0; }
.wz-grid { display: grid; gap: 14px; }
.wz-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.wz-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.wz-tile { min-height: 150px; border: 3px solid transparent; border-radius: 24px; background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; box-shadow: 0 4px 0 var(--line); }
.wz-tile.sm { min-height: 116px; width: 100%; }
.wz-tile svg { color: #6A62C4; }
.wz-tile strong { font-family: var(--display); font-weight: 600; font-size: 20px; }
.wz-tile span { font-size: 15px; color: #6b6780; }
.wz-tile .big-n { font-size: 52px; line-height: 1; }
.wz-tile.sel { border-color: var(--navy); background: #F1EEFF; }
.wz-tile:active { transform: translateY(3px); box-shadow: none; }
.wz-snd { position: relative; }
.wz-play { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cream); color: var(--navy); display: flex; align-items: center; justify-content: center; }
.wz-play.on { background: var(--navy); color: var(--moon); }
.wz-light { width: 64px; height: 44px; border-radius: 10px; background: #0b0c1d; border: 3px solid #2E3270; }
.wz-light.l-faible { box-shadow: inset 0 0 18px rgba(245, 196, 81, .35); }
.wz-light.l-on { background: #3a2f12; box-shadow: inset 0 0 22px rgba(245, 196, 81, .9); }
.wz-stories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wz-story { display: flex; align-items: center; gap: 12px; border: 3px solid transparent; border-radius: 18px; background: #fff; padding: 8px; text-align: left; color: var(--ink); }
.wz-story .thumb.sm { width: 84px; height: 72px; flex: none; }
.wz-story .order { width: 32px; height: 32px; font-size: 17px; top: 4px; right: 4px; background: var(--navy); }
.wz-story.sel { border-color: var(--navy); background: #F1EEFF; }
.wz-st { display: flex; flex-direction: column; gap: 2px; }
.wz-st span { font-size: 14px; color: #6b6780; }
.wz-foot { display: flex; justify-content: flex-end; }
.wz-recap { display: flex; flex-direction: column; gap: 10px; }
.wz-line { display: flex; align-items: center; gap: 16px; min-height: 66px; border: 0; border-radius: 18px; background: #fff; padding: 0 20px; text-align: left; color: var(--ink); font-size: 19px; font-weight: 700; }
.wz-line > span { flex: 1; }
.wz-line svg:first-child { color: #6A62C4; }
.wz-line.static { background: transparent; font-weight: 600; color: #6b6780; }
.wz-go { width: 100%; justify-content: center; }
@media (max-width: 700px) { .wz-grid.g3, .wz-grid.g4, .wz-stories { grid-template-columns: 1fr 1fr; } .wz-q { font-size: 24px; } }
.wz-foot { position: sticky; bottom: -26px; background: var(--cream); padding: 12px 0 4px; margin-bottom: -4px; }

/* Appui long sur un moment de la frise */
.ds[data-jump] { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ds[data-jump]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(245, 196, 81, .6); border-radius: inherit; pointer-events: none; }
.ds[data-jump].holding::after { animation: jumpfill var(--hold, 1.5s) linear forwards; }
.ds[data-jump].holding { transform: scale(1.08); }
@keyframes jumpfill { to { height: 100%; } }

/* Onboarding : sa journée */
.day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: min(900px, 100%); }
.day-tile { position: relative; min-height: 104px; border-radius: 22px; border: 3px dashed #CFC8EA; background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; font-size: 17px; }
.day-tile svg { opacity: .55; }
.day-tile.sel { border: 3px solid var(--navy); }
.day-tile.sel svg, .day-tile.fixed svg { opacity: 1; }
.day-tile.fixed { border: 3px solid transparent; }
.day-tile.fixed span { font-size: 13px; opacity: .7; }
.day-check { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--cream); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #6A62C4; }
.day-tile.sel .day-check { background: var(--navy); color: #fff; }
.onb-body.top { justify-content: flex-start; padding-top: 10px; }
.onb-times { width: min(620px, 100%); text-align: left; }
.onb-times .ck-row { grid-template-columns: auto 1fr auto; }
@media (max-width: 700px) { .day-grid { grid-template-columns: repeat(2, 1fr); } }

/* À l'heure du dodo : bouton à maintenir pour lancer la nuit */
.night-hold { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; min-height: 84px; border-radius: 999px; border: 3px solid #4B4F92; background: #2E3270; color: #FBF6EE; padding: 0 30px 0 24px; text-align: left; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.night-hold > * { position: relative; pointer-events: none; }
.night-hold svg { color: var(--moon); flex: none; }
.night-hold span { display: flex; flex-direction: column; }
.night-hold strong { font-family: var(--display); font-weight: 600; font-size: 24px; }
.night-hold small { font-size: 14px; color: #C9C3F2; }
.night-hold .nh-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(245, 196, 81, .4); }
.night-hold.holding .nh-bar { animation: holdfill var(--hold, 3s) linear forwards; }

/* Choix des histoires : filtres, voix, total */
.wz-filters { display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 18px; padding: 12px 14px; }
.wz-frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wz-frow .label { width: 70px; flex: none; margin: 0; }
.wz-frow .chips { gap: 6px; }
.wz-frow .chip { min-height: 38px; font-size: 14px; padding: 0 12px; }
.wz-hint { padding-left: 80px; }
.wz-st > span { display: inline-flex; align-items: center; gap: 4px; }
.wz-voice { color: #8a86a0; }
.wz-voice.fam { color: #B0553A; font-weight: 800; }
.wz-total { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 17px; }
.wz-foot { align-items: center; gap: 12px; }

/* Son de la nuit : tous les sons, volume, écoute */
.wz-grid.g5 { grid-template-columns: repeat(5, 1fr); gap: 10px; }
.wz-tile.xs { min-height: 92px; padding: 8px; gap: 4px; border-radius: 18px; }
.wz-tile.xs strong { font-size: 15px; }
.wz-onair { font-size: 12px !important; color: #6A62C4 !important; font-weight: 800; }
.wz-vol { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 10px 14px; flex-wrap: wrap; }
.wz-vol .label { margin: 0; }
.wz-vol .vol-track { flex: 1; min-width: 140px; }
.wz-volv { min-width: 52px; text-align: right; }
.wz-listen { min-width: 140px; justify-content: center; }
.center { text-align: center; }
@media (max-width: 700px) { .wz-grid.g5 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- La journée : glisser-déposer et moments personnalisés ---------- */
.drag-handle { width: 44px; height: 56px; flex: none; border: 0; background: transparent; color: #8C88AA; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.drag-handle svg { stroke-width: 3.6; }
.drag-handle:hover { background: var(--lav-l); color: var(--navy); }
.drag-handle.off { cursor: default; }
.drag-handle.off:hover { background: transparent; }
.ck-list.sorting .ck-row:not(.dragging) { transition: transform .18s ease; }
.ck-row.dragging { position: relative; z-index: 5; box-shadow: 0 14px 30px rgba(31,34,80,.25); border-color: var(--lav); cursor: grabbing; }
.ck-row.dragging .drag-handle { cursor: grabbing; color: var(--navy); }
.ck-row.just-moved { animation: just-moved .9s ease; }
@keyframes just-moved { 0% { background: var(--lav-l); } 100% { background: #fff; } }
.ck-row { padding-left: 4px; }
.ck-name { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 0; text-align: left; font-size: 18px; min-height: 36px; }
.ck-name svg { color: #8C88AA; flex: none; }
.ck-name:hover svg { color: var(--navy); }
.ck-say { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-type { margin-top: 4px; height: 40px; font-size: 15px; max-width: 240px; }
.chip.dashed.strong { border-color: var(--navy); color: var(--navy); }
.day-tile.other { border-style: dashed; border-color: var(--navy); color: var(--navy); }
.day-tile.other svg { opacity: 1; }
.day-tile.other span { font-size: 13px; opacity: .75; }
.garde-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; }

.modal.medit { width: min(640px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; gap: 14px; padding: 24px 26px; }
.me-preview { position: relative; display: flex; align-items: center; gap: 16px; border-radius: 22px; padding: 12px 18px; }
.me-preview > svg { flex: none; }
.me-badge { position: absolute; left: 84px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--navy); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.me-ptext { display: flex; flex-direction: column; min-width: 0; padding-left: 14px; }
.me-ptext strong { font-family: var(--display); font-size: 26px; font-weight: 600; }
.me-ptext span { font-size: 16px; opacity: .85; }
.me-field { display: flex; flex-direction: column; gap: 4px; }
.me-set { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.me-grid { display: grid; gap: 8px; }
.me-grid.picto { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.me-grid.animals { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.me-grid.colors { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.me-opt { min-height: 52px; border-radius: 16px; border: 2px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); padding: 4px; }
.me-opt.ani span { font-size: 13px; font-weight: 800; }
.me-opt.sel, .me-swatch.sel { border: 3px solid var(--navy); box-shadow: 0 0 0 2px #fff inset; }
.me-swatch { height: 48px; border-radius: 14px; border: 2px solid rgba(31,34,80,.12); }
.me-actions { flex-wrap: wrap; align-items: center; }
.danger-txt { color: var(--red); display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 700px) { .ck-type { max-width: 100%; } .me-badge { left: 76px; } }
.ck-name { max-width: 100%; min-width: 0; }
.ck-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Vieilles tablettes (Safari < 15 : pas d'aspect-ratio) ---------- */
@supports not (aspect-ratio: 1) {
  .preview { height: min(536px, 49vw); }
  .preview.sm { height: 330px; }
  .player-art { height: min(480px, 40vw); }
}

/* ---------- Voix d'un proche (tablette) ---------- */
.voix-steps { display: flex; flex-direction: column; gap: 16px; }
.voix-step { display: flex; gap: 18px; align-items: flex-start; background: #fff; border-radius: var(--r); padding: 20px 22px; }
.voix-n { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--moon); font-family: var(--display); font-size: 24px; display: flex; align-items: center; justify-content: center; }
.voix-step-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.voix-step-body > strong { font-family: var(--display); font-weight: 600; font-size: 22px; }
.voix-link { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.voix-link-txt { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.qr { flex: none; border-radius: 16px; border: 2px solid var(--line); }

/* ---------- Mode enregistreur (téléphone du proche) ---------- */
.rv { background: var(--cream); }
.rv-head { display: flex; align-items: center; gap: 8px; padding: 14px 20px; }
.rv-brand { font-family: var(--display); font-weight: 600; font-size: 24px; color: var(--navy); }
.rv-step { font-weight: 800; color: var(--muted); font-size: 15px; }
.rv-body { flex: 1 1 auto; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 22px 32px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.rv-body.top { justify-content: flex-start; }
.rv-body h1 { font-size: 30px; }
.rv-body .btn.xl { width: 100%; padding: 0 20px; }
.rv-body .input { width: 100%; font-size: 20px; }
.rv-hero { align-self: center; width: 130px; height: 130px; border-radius: 50%; background: var(--navy); display: flex; align-items: center; justify-content: center; }
.rv-hero.ok { background: var(--green); color: #fff; }
.rv-list { display: flex; flex-direction: column; gap: 10px; }
.rv-story { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; background: #fff; border: 2px solid var(--line); border-radius: 20px; text-align: left; min-height: 84px; }
.rv-story .thumb { flex: none; width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.rv-story-txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.rv-story-txt strong { font-family: var(--display); font-weight: 600; font-size: 19px; }
.rv-help { gap: 8px; }

/* Studio sur un petit écran de téléphone */
@media (max-width: 600px) {
  .studio-top { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .studio-title { font-size: 19px; }
  #mic-state { display: none; }
  .vu { display: none; }
  .prompter { padding: 16px 18px; gap: 14px; }
  .prompter .prev { display: none; }
  .prompter .next { font-size: 17px; }
  .studio-bottom { padding: 10px 12px 16px; }
  .transport { justify-content: center; gap: 12px; }
  .transport .grow { display: none; }
  .transport .timer, .transport .rec-status { flex: 1 1 40%; }
  .transport .rec-status { text-align: right; }
}

/* ---------- Tablettes de 768 à 1180 px (iPad mini, iPad, iPad Air) ---------- */
/* Paysage : barre latérale plus étroite, et les volets latéraux passent sous le contenu. */
@media (min-width: 901px) and (max-width: 1180px) {
  .pnav { width: 210px; padding: 20px 10px; }
  .pnav-brand { font-size: 19px; padding-bottom: 14px; }
  .pnav-item { padding: 0 12px; gap: 10px; }
  .pnav-exit { font-size: 14px; }
  .pmain { padding: 24px 28px 32px; }
  .split { flex-direction: column; align-items: stretch; }
  .aside { width: 100%; position: static; }
  .side-preview { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .side-preview > * { flex: 1 1 260px; }
  .side-preview > .label { flex-basis: 100%; }
  .side-preview .preview.sm { flex: none; }
}
/* Écrans peu hauts (iPad en paysage avec les barres de Safari) */
@media (orientation: landscape) and (max-height: 800px) {
  .onb { padding-top: 20px; padding-bottom: 20px; }
  .day-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .day-tile { min-height: 86px; }
  .onb-body { gap: 18px; }
  .ch-animal .animal { width: min(300px, 34vw, 46vh); }
  .moment-animal .animal { width: min(280px, 38vh); }
}
/* Portrait : tout s'empile et se centre, l'animal prend la place libre. */
@media (orientation: portrait) {
  .ch-animal .animal { width: min(380px, 38vh, 72vw); }
  .ch-sayrow { flex-direction: column; gap: 14px; }
  .ch-say { font-size: max(40px, min(6vw, 56px)); }
  .ch-side { width: min(560px, 92vw); }
  .ready { flex-direction: column; text-align: center; gap: 24px; }
  .ready .col { align-items: center; width: min(620px, 100%); }
  .ready .col .chips { justify-content: center; }
  .home-animal .animal { width: min(340px, 34vh, 60vw); }
  .onb-body.row { flex-direction: column; text-align: center; gap: 28px; }
  .anim-preview .ch-sayrow, .preview-host .ch-sayrow { flex-direction: column; }
}

/* Boîte aux lettres des voix (voix d'un proche) */
.inbox.has-mail { box-shadow: inset 0 0 0 3px #F6C9C3; }
.inbox > .btn { align-self: flex-start; }
.inbox-item { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.inbox-item .thumb.sm { flex: none; width: 64px; height: 64px; }
.inbox-item .grow { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-item .grow strong { font-family: var(--display); font-weight: 600; font-size: 19px; }
.inbox-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.inbox-acts .mini-btn.rec { flex: 0 0 auto; }
.home-mail { width: 100%; display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 16px; border: 0; border-radius: var(--r); background: #FDE7E3; color: #A23A30; text-align: left; }
.home-mail > span { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.home-mail strong { font-family: var(--display); font-weight: 600; font-size: 20px; }
.home-mail span span { color: var(--ink); font-size: 15px; }
.rv-progress { width: 100%; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rv-progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s; }
