@font-face {
  font-family: "Google Sans Flex";
  src: url("../fonts/google-sans-flex.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F4EFE4;
  --card: #FFFDF8;
  --ink: #1E2A24;
  --muted: #5B655D;
  --line: #E4DCCB;
  --soft: #F1ECE2;
  --green: #1F4A3A;
  --green-ink: #F7F2E8;
  --repas: #8A5212; --repas-bg: #F5E4C8;
  --sommeil: #4A4190; --sommeil-bg: #E6E2F5;
  --couche: #1F5C4F; --couche-bg: #D6ECE4;
  --pleurs: #8E3829; --pleurs-bg: #F4DDD6;
  --sante: #264F80; --sante-bg: #DAE5F2;
  --alert-bg: #F4DDD6; --alert: #8E3829;
  --ok-bg: #E3EFE8; --ok: #1F5C4F;
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: pan-y; overflow-x: hidden; overscroll-behavior-x: none; overscroll-behavior-y: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #A8661A; outline-offset: 2px; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }

.splash { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 22px; font-weight: 700; }
.splash img { border-radius: 20px; }
.noscript { padding: 24px; }

/* Mise en page des écrans */
.screen { padding: calc(18px + var(--safe-top)) 18px calc(120px + var(--pills-h, 0px) + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; }
.screen.plain { padding-bottom: calc(32px + var(--safe-bottom)); min-height: 100dvh; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.title-xl { font-size: clamp(30px, 9vw, 38px); font-weight: 700; }
.title-l { font-size: clamp(24px, 7vw, 28px); font-weight: 700; }
.title-m { font-size: 20px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.green { background: var(--green); color: var(--green-ink); }
.card.alert { background: var(--alert-bg); color: var(--alert); }
.card.ok { background: var(--ok-bg); color: var(--ok); }

.logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 8px 20px rgba(30,42,36,.18); display: block; }
.logo.s { width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }

/* Boutons */
.btn { min-height: 52px; border: 0; border-radius: 16px; padding: 0 18px; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--soft); color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--green); color: var(--green-ink); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); min-height: 44px; }
.btn.light { background: var(--green-ink); color: var(--green); }
.btn.full { width: 100%; }
.btn.small { min-height: 40px; font-size: 14px; border-radius: 12px; padding: 0 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.chip { min-height: 40px; border: 0; border-radius: 12px; padding: 0 14px; background: var(--soft); font-weight: 650; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: #EAE3D5; }
.seg button { flex: 1; min-width: 0; min-height: 40px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(30,42,36,.12); }

/* Champs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 650; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 0 14px; font-size: 16px; }
textarea.input { padding: 12px 14px; min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: transparent; }
.code-input { text-transform: uppercase; letter-spacing: 0.12em; font-size: 22px; font-weight: 700; text-align: center; }

/* Accueil */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.child-btn { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 8px; font-size: clamp(30px, 9vw, 36px); font-weight: 700; letter-spacing: -0.03em; text-align: left; min-height: 44px; max-width: 100%; }
.child-btn .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--child, #2B7262); flex: none; }
.child-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); display: inline-flex; align-items: center; justify-content: center; flex: none; }

.live { background: var(--green); color: var(--green-ink); border-radius: 26px; padding: 18px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.live .head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 14px; font-weight: 650; }
.live .head .since { font-weight: 400; color: #CFDDD4; }
.live .time { font-size: clamp(46px, 15vw, 62px); font-weight: 400; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.live .actions { display: flex; gap: 8px; }
.live .actions .btn { flex: 1; min-width: 0; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 0; text-align: left; }
.tile .k { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v { font-size: clamp(19px, 6.2vw, 24px); font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; line-height: 1.1; }
.tile .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.counts div { display: flex; flex-direction: column; min-width: 0; }
.counts b { font-size: 20px; font-weight: 700; white-space: nowrap; }
.counts span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EFE8DA; min-width: 0; }
.item:last-child { border-bottom: 0; }
.item .when { width: 46px; flex: none; font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14px; }
.item .what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item .what b { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .what span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .badge { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.item .del { width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); flex: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* Barre du bas : onglets avec une place au centre pour le bouton + */
.dock-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; pointer-events: none; }
.dock { pointer-events: auto; width: 100%; max-width: 520px; background: rgba(255,253,248,.97); border-top: 1px solid #EDE7DB; border-radius: 22px 22px 0 0; padding: 6px 8px calc(6px + var(--safe-bottom)); box-shadow: 0 -8px 24px rgba(30,42,36,.05); display: flex; align-items: stretch; }
.dock a { flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 14px; transition: color .2s ease; }
.dock a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dock a[aria-current="page"] { color: var(--green); font-weight: 700; }
.dock .fab-gap { width: 76px; flex: none; }

/* Bouton central et bulles */
.fab-root { display: none; }
.fab-root.shown { display: block; }
.fab-root .fab, .fab-root .fab-bubbles { display: none; }
.fab-root.can-write .fab, .fab-root.can-write .fab-bubbles { display: block; }
.fab { position: fixed; left: 50%; bottom: calc(26px + var(--safe-bottom)); width: 60px; height: 60px; margin-left: -30px; border-radius: 50%; border: 0; padding: 0; z-index: 47; background: var(--green); color: var(--green-ink); box-shadow: 0 10px 24px rgba(31,74,58,.38); -webkit-tap-highlight-color: transparent; transition: transform .2s ease; }
.fab:active { transform: scale(.94); }
.fab .rot { display: flex; align-items: center; justify-content: center; transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.fab-root.open .fab .rot { transform: rotate(45deg); }
.fab-bd { position: fixed; inset: 0; z-index: 44; background: rgba(244,239,228,.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.fab-root.open .fab-bd { opacity: 1; pointer-events: auto; }
.fab-q { position: fixed; left: 0; right: 0; bottom: calc(56px + 300px + var(--safe-bottom)); z-index: 45; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1); }
.fab-root.open .fab-q { opacity: 1; transform: none; }
.fab-bubbles { position: fixed; left: 50%; bottom: calc(56px + var(--safe-bottom)); width: 0; height: 0; z-index: 46; }
.bub { --x: 0px; --y: 24px; --dl: 0ms; position: absolute; left: 0; top: 0; width: 96px; border: 0; padding: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; -webkit-tap-highlight-color: transparent;
  transform: translate(calc(var(--x) - 50%), calc(var(--y) - var(--d) / 2)) scale(.3); transform-origin: 50% calc(var(--d) / 2); opacity: 0; pointer-events: none;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1) var(--dl), opacity .22s ease var(--dl); }
.bub.on { transform: translate(calc(var(--x) - 50%), calc(var(--y) - var(--d) / 2)) scale(1); opacity: 1; pointer-events: auto; }
.bub .disc { position: relative; width: var(--d); height: var(--d); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(30,42,36,.16); transition: transform .15s ease; }
.bub:active .disc { transform: scale(.92); }
.bub .disc b { font-size: 26px; font-weight: 800; }
.bub .lbl { font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.bub .sug { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); height: 18px; padding: 0 7px; border-radius: 9px; background: #A8661A; color: #fff; font-size: 10px; font-weight: 800; display: none; align-items: center; white-space: nowrap; }
.bub.is-sug .sug { display: flex; }
.bub.on.is-sug .disc { animation: gl-pulse 1.8s ease-out .6s infinite; }
.bub.c-repas .disc { background: var(--repas-bg); color: var(--repas); }
.bub.c-sommeil .disc { background: var(--sommeil-bg); color: var(--sommeil); }
.bub.c-couche .disc { background: var(--couche-bg); color: var(--couche); }
.bub.c-pleurs .disc { background: var(--pleurs-bg); color: var(--pleurs); }
.bub.c-sante .disc { background: var(--sante-bg); color: var(--sante); }
.bub.c-neutre .disc { background: var(--soft); color: #3C463F; }
html.fab-open, html.fab-open body { overflow: hidden; }

/* Pilules des activités en cours, au-dessus du bouton */
.pills { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-bottom)); z-index: 25; display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; padding: 0 14px; pointer-events: none; }
.pill { pointer-events: auto; width: 100%; max-width: 492px; height: 64px; border-radius: 22px; background: var(--green); color: var(--green-ink); display: flex; align-items: center; gap: 12px; padding: 0 8px 0 16px; box-shadow: 0 14px 30px rgba(31,74,58,.32); }
.pill.in { animation: gl-rise .55s cubic-bezier(.34,1.56,.64,1) both; }
.pill.out { animation: gl-sink .25s ease both; }
.pill .breath { width: 9px; height: 9px; border-radius: 50%; background: #B9E3C6; flex: none; animation: gl-breath 1.6s ease-in-out infinite; }
.pill .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pill .t { font-size: 12.5px; color: #CFDDD4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill .time { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.pill .acts { display: flex; gap: 6px; flex: none; }
.pill button { height: 48px; border-radius: 15px; font-weight: 800; font-size: 14px; }
.pill .swap { padding: 0 12px; border: 1px solid rgba(247,242,232,.35); background: transparent; color: var(--green-ink); display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; }
.pill .stop { padding: 0 14px; border: 0; background: var(--green-ink); color: var(--green); }
@keyframes gl-pulse { 0% { box-shadow: 0 0 0 0 rgba(168,102,26,.5); } 70% { box-shadow: 0 0 0 14px rgba(168,102,26,0); } 100% { box-shadow: 0 0 0 0 rgba(168,102,26,0); } }
@keyframes gl-breath { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes gl-rise { from { opacity: 0; transform: translateY(40px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes gl-sink { to { opacity: 0; transform: translateY(24px) scale(.95); } }
@keyframes gl-toast { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* Feuilles (saisies) */
.backdrop { --dim: 1; position: fixed; inset: 0; background: rgba(30,42,36,calc(.35 * var(--dim))); z-index: 55; display: flex; align-items: flex-end; justify-content: center; animation: gl-fade .25s ease both; }
.backdrop.closing { animation: gl-fade-out .24s ease both; pointer-events: none; }
.sheet { animation: gl-sheet-in .5s cubic-bezier(.34,1.25,.64,1); transition: transform .3s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet.dragging { transition: none; }
.backdrop.closing .sheet { animation: gl-sheet-out .24s cubic-bezier(.4,0,1,1) forwards; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #D5CCBA; align-self: center; }
.big3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.big2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bigbtn { min-height: 76px; border: 0; border-radius: 18px; font-weight: 700; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; }
.bigbtn small { font-weight: 500; font-size: 12px; opacity: .85; }
.bigbtn.repas { background: var(--repas-bg); color: var(--repas); }
.bigbtn.couche { background: var(--couche-bg); color: var(--couche); }
.bigbtn.sommeil { background: var(--sommeil-bg); color: var(--sommeil); }
.bigbtn.pleurs { background: var(--pleurs-bg); color: var(--pleurs); }
.bigbtn.sante { background: var(--sante-bg); color: var(--sante); }
.bigbtn.neutral { background: var(--card); color: var(--ink); }

/* Toast */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(100px + var(--pills-h, 0px) + var(--safe-bottom)); display: flex; justify-content: center; z-index: 60; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 12px; max-width: 480px; width: 100%; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: gl-toast .45s cubic-bezier(.34,1.56,.64,1) both; }
.toast .grow { min-width: 0; }
.toast button { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 10px; min-height: 36px; padding: 0 12px; font-weight: 700; }
.toast.err { background: var(--alert); }

/* Installation */
.steps { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); }
.steps li { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid #EFE8DA; align-items: flex-start; }
.steps li:last-child { border-bottom: 0; }
.steps .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: var(--green-ink); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.steps .t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.steps .t b { font-weight: 650; }
.steps .t span { font-size: 13px; color: var(--muted); }
.share-icon { display: inline-block; vertical-align: -3px; }

/* Famille */
.member { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #EFE8DA; }
.member:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; background: var(--green); color: var(--green-ink); }
.role { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.codebox { font-size: clamp(22px, 7vw, 28px); font-weight: 700; letter-spacing: .06em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--c); }
.colors button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Pages de texte (confidentialité, conditions) */
.doc { max-width: 680px; margin: 0 auto; line-height: 1.55; }
.doc h2 { margin-top: 8px; }
.doc ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc a.row { text-decoration: none; font-weight: 650; }

/* Frises et graphiques */
.nap { background: var(--sommeil-bg); border-radius: 26px; padding: 16px 16px 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.nap .k { font-size: 13px; font-weight: 650; color: #433B83; }
.nap .v { font-size: clamp(26px, 8.5vw, 32px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.05; color: #2A2456; }
.nap .s { font-size: 12.5px; color: #463F6E; }
.nap-btn { width: 56px; height: 56px; flex: none; border-radius: 18px; border: 0; background: #5A50A0; color: #fff; display: flex; align-items: center; justify-content: center; }

.strip { position: relative; height: 44px; }
.strip .bar { position: absolute; left: 0; right: 0; top: 12px; height: 20px; border-radius: 6px; background: var(--soft); }
.strip .seg-sleep { position: absolute; top: 12px; height: 20px; border-radius: 5px; background: #9B92D6; }
.strip .seg-sleep.on { background: #5A50A0; }
.strip .dot-feed { position: absolute; top: 1px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #A8661A; }
.strip .dot-diaper { position: absolute; bottom: 1px; width: 8px; height: 8px; margin-left: -4px; border-radius: 2px; background: #2B7262; }
.strip .now { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.strip.compact { height: 18px; flex: 1; min-width: 0; }
.strip.compact .bar, .strip.compact .seg-sleep { top: 0; height: 18px; }
.strip.compact .dot-feed { top: 6px; width: 6px; height: 6px; margin-left: -3px; }
.strip.compact .now { top: 0; bottom: 0; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: #3C463F; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; }
.l-sleep { width: 14px; height: 8px; border-radius: 3px; background: #9B92D6; }
.l-feed { width: 7px; height: 7px; border-radius: 50%; background: #A8661A; }
.l-diaper { width: 7px; height: 7px; border-radius: 2px; background: #2B7262; }

.chart { gap: 10px; }
.chart .avg { font-size: 13px; font-weight: 650; white-space: nowrap; }
.avg.sommeil, .band-l.sommeil { color: var(--sommeil); }
.avg.repas, .band-l.repas { color: var(--repas); }
.avg.couche, .band-l.couche { color: var(--couche); }
.avg.pleurs { color: var(--pleurs); }
.avg.sante { color: var(--sante); }
.bars { position: relative; height: 120px; display: flex; align-items: flex-end; gap: 8px; border-bottom: 1px solid var(--line); }
.bars .col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; z-index: 1; }
.bars .fill { width: 100%; border-radius: 5px 5px 2px 2px; }
.fill.sommeil { background: #9B92D6; }
.fill.repas { background: #C98A3B; }
.fill.couche { background: #5FA391; }
.fill.couche.low { background: #C06A58; }
.bars .band { position: absolute; left: 0; right: 0; border-radius: 4px; }
.band.sommeil { background: rgba(90,80,160,.13); }
.band.repas { background: rgba(168,102,26,.13); }
.band.couche { background: rgba(43,114,98,.13); }
.bars .band-l { position: absolute; right: 2px; margin-bottom: 2px; font-size: 10.5px; font-weight: 650; z-index: 2; background: rgba(255,253,248,.85); padding: 0 4px; border-radius: 4px; }
.bars-x { display: flex; gap: 8px; font-size: 10.5px; color: var(--muted); text-align: center; }
.bars-x span { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 4px; }
.stats div, .sum-grid div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stats b { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; }
.stats span { font-size: 11.5px; color: var(--muted); }

.rhythm { display: flex; flex-direction: column; gap: 7px; }
.rrow, .hrow { display: flex; align-items: center; gap: 8px; }
.rrow .d, .hrow .d { width: 30px; flex: none; font-size: 11px; font-weight: 650; color: #4C564F; }
.rhythm-x, .heat-x { padding-left: 38px; }
.rhythm-x .axis, .heat-x .axis { font-size: 10.5px; }
.heat { display: flex; flex-direction: column; gap: 3px; }
.heat .cells { flex: 1; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.heat .cells span { height: 13px; border-radius: 3px; background: var(--soft); }
.wchart { position: relative; height: 130px; }
.wsvg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wdot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--card); border: 2px solid #2E5D94; }
.wempty { position: absolute; left: 0; right: 0; top: 46px; text-align: center; font-size: 13px; color: var(--muted); }

/* Journal : jours et frise verticale */
.seg.mini { flex: none; }
.seg.mini button { flex: none; padding: 0 14px; min-height: 36px; font-size: 13px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days button { height: 56px; border: 0; border-radius: 16px; background: var(--card); color: #3C463F; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; }
.days button[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }
.days .w { font-size: 11px; font-weight: 650; opacity: .85; }
.days .n { font-size: 19px; font-weight: 650; line-height: 1; }
.tl { padding: 14px 12px 16px; gap: 10px; }
.tl-head { display: flex; padding-left: 40px; gap: 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding-bottom: 8px; border-bottom: 1px solid #EDE7DB; }
.tl-head span { flex: 1; min-width: 0; padding-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-head .sommeil { color: var(--sommeil); } .tl-head .repas { color: var(--repas); } .tl-head .couche { color: var(--couche); } .tl-head .pleurs { color: var(--pleurs); }
.tl-body { position: relative; margin-top: 4px; }
.tl-hour { position: absolute; left: 0; right: 0; height: 1px; background: #F1ECE2; }
.tl-hour.major { background: var(--line); }
.tl-hour span { position: absolute; left: 0; top: -7px; width: 34px; text-align: right; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--card); padding-right: 2px; }
.tl-ev { position: absolute; border-radius: 8px; box-sizing: border-box; padding: 2px 6px; overflow: hidden; font-size: 10.5px; font-weight: 700; line-height: 1.25; display: flex; align-items: flex-start; z-index: 1; }
.tl-ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-c0 { left: 40px; width: calc((100% - 40px) * .25 - 4px); }
.tl-c1 { left: calc(40px + (100% - 40px) * .25); width: calc((100% - 40px) * .25 - 4px); }
.tl-c2 { left: calc(40px + (100% - 40px) * .5); width: calc((100% - 40px) * .25 - 4px); }
.tl-c3 { left: calc(40px + (100% - 40px) * .75); width: calc((100% - 40px) * .25); }
.tl-ev.sommeil { background: var(--sommeil-bg); color: #2A2456; }
.tl-ev.sommeil.on { background: #5A50A0; color: #fff; }
.tl-ev.repas { background: var(--repas-bg); color: #5E3A0E; }
.tl-ev.couche { background: var(--couche-bg); color: #17483E; border-radius: 11px; justify-content: center; }
.tl-ev.couche.poo { background: #B9DCCF; }
.tl-ev.pleurs { background: var(--pleurs-bg); color: var(--pleurs); }
.tl-ev.sante { background: var(--sante-bg); color: var(--sante); }
.tl-ev.neutre { background: var(--soft); color: var(--ink); }
.tl-now { position: absolute; left: 36px; right: 0; height: 2px; background: var(--ink); z-index: 2; }
.tl-now span { position: absolute; left: -36px; top: -9px; background: var(--ink); color: var(--green-ink); font-size: 10px; font-weight: 700; padding: 2px 4px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.sum { gap: 12px; }
.sum .eyebrow { color: #CFDDD4; }
.sum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.sum-grid b { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.sum-grid span { font-size: 12.5px; color: #D7E3DB; }

/* ---------- Animations (v0.5.0) ---------- */
@keyframes gl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gl-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes gl-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes gl-sheet-out { to { transform: translateY(100%); } }
@keyframes gl-pop { 0% { scale: 1; } 40% { scale: 1.12; } 100% { scale: 1; } }
@keyframes gl-in-r { from { opacity: 0; translate: 28px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes gl-in-l { from { opacity: 0; translate: -28px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes gl-in-up { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes gl-grow-x { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes gl-grow-y { from { scale: 1 0; } to { scale: 1 1; } }
@keyframes gl-drop { 0% { opacity: 0; translate: 0 -14px; scale: .4; } 70% { opacity: 1; translate: 0 2px; scale: 1.1; } 100% { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes gl-dot-pop { 0% { scale: 0; } 55% { scale: 1.9; } 100% { scale: 1; } }
@keyframes gl-roll { 0% { translate: 0 110%; opacity: 0; } 100% { translate: 0 0; opacity: 1; } }
@keyframes gl-fresh { 0% { max-height: 0; opacity: 0; background: var(--repas-bg); } 35% { max-height: 90px; opacity: 1; background: var(--repas-bg); } 100% { max-height: 90px; opacity: 1; background: var(--card); } }
@keyframes gl-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes gl-ring { from { stroke-dashoffset: 100; } }
@keyframes gl-due { 0%, 100% { box-shadow: 0 0 0 0 rgba(90,80,160,0); } 50% { box-shadow: 0 0 0 9px rgba(90,80,160,.16); } }

/* 1. Changement d'onglet et trait sous l'onglet actif */
main.screen.enter-r { animation: gl-in-r .34s cubic-bezier(.2,.8,.2,1) both; }
main.screen.enter-l { animation: gl-in-l .34s cubic-bezier(.2,.8,.2,1) both; }
main.screen.enter-fade { animation: gl-fade .25s ease both; }
.dock { position: relative; }
.tab-ind { position: absolute; left: 0; bottom: calc(4px + var(--safe-bottom)); width: 20px; height: 3px; border-radius: 2px; background: var(--green); opacity: 0; transition: transform .45s cubic-bezier(.34,1.45,.64,1); pointer-events: none; }
.tab-ind.on { opacity: 1; }
.tab-ind.moving { animation: gl-stretch .38s ease; }
@keyframes gl-stretch { 50% { scale: 2.2 1; } }

/* 2. La frise se dessine */
.strip .now { animation: gl-breath 1.8s ease-in-out infinite; }
.strip.draw .seg-sleep { transform-origin: left center; animation: gl-grow-x .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(80ms + var(--i, 0) * 50ms); }
.strip.draw .dot-feed, .strip.draw .dot-diaper { animation: gl-drop .5s cubic-bezier(.34,1.4,.64,1) both; animation-delay: calc(200ms + var(--i, 0) * 40ms); }
.counts.enter > div { animation: gl-in-up .4s cubic-bezier(.2,.8,.2,1) both; }
.counts.enter > div:nth-child(2) { animation-delay: 60ms; } .counts.enter > div:nth-child(3) { animation-delay: 120ms; } .counts.enter > div:nth-child(4) { animation-delay: 180ms; }

/* 3. Saisie confirmée */
.strip .pop { animation: gl-dot-pop .6s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(250ms + var(--age, 0ms)); }
.strip .seg-sleep.pop { transform-origin: left center; animation: gl-grow-x .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(250ms + var(--age, 0ms)); }
.tile .vbox { display: block; overflow: hidden; }
.tile .v { display: block; }
.tile.roll .v { animation: gl-roll .55s cubic-bezier(.34,1.4,.64,1) both; animation-delay: calc(200ms + var(--age, 0ms)); }
.item.fresh { overflow: hidden; border-radius: 10px; animation: gl-fresh 1.4s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--age, 0ms); }

/* 4. Feuilles : rebond sur le choix */
.chip.pop, .seg button.pop, .colors button.pop { animation: gl-pop .32s cubic-bezier(.34,1.56,.64,1); }

/* 5. Glisser pour supprimer */
.swipe { position: relative; overflow: hidden; border-bottom: 1px solid #EFE8DA; transition: height .28s cubic-bezier(.2,.8,.2,1); }
.swipe:last-child { border-bottom: 0; }
.swipe .item { -webkit-user-select: none; user-select: none; position: relative; border-bottom: 0; background: var(--card); touch-action: pan-y; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.swipe.moving .item { transition: none; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px; background: #E7B5AA; color: #fff; border-radius: 10px; transition: background .15s ease; }
.swipe.armed .swipe-bg, .swipe.gone .swipe-bg { background: #B04A3A; }
.swipe.gone { height: 0 !important; border-bottom-color: transparent; }

/* 6. Tendances */
.bars.rise .fill { transform-origin: bottom center; animation: gl-grow-y .6s cubic-bezier(.34,1.3,.64,1) both; animation-delay: calc(120ms + var(--i, 0) * 55ms); }
.wchart.rise .wsvg { animation: gl-wipe 1s cubic-bezier(.4,0,.2,1) .2s both; }
.wchart.rise .wdot { animation: gl-dot-pop .45s cubic-bezier(.34,1.56,.64,1) .9s both; }
.heat.rise .hrow { animation: gl-in-up .4s ease both; animation-delay: calc(var(--i, 0) * 50ms); }

/* 7. Anneau de la prochaine sieste */
.nap-dial { position: relative; width: 72px; height: 72px; flex: none; display: flex; align-items: center; justify-content: center; }
.nap-ring { position: absolute; inset: 0; width: 72px; height: 72px; transform: rotate(-90deg); }
.nap-ring circle { fill: none; stroke-width: 5; }
.nap-track { stroke: #CFC8EE; }
.nap-prog { stroke: #5A50A0; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: var(--off, 100); transition: stroke-dashoffset .6s ease; }
.nap-ring.draw .nap-prog { animation: gl-ring 1.1s cubic-bezier(.2,.8,.2,1) .2s both; }
.nap-dial .nap-btn { width: 50px; height: 50px; border-radius: 50%; }
.nap.due { animation: gl-due 2.6s ease-in-out infinite; }

/* 8. Journal */
.days { position: relative; }
.days-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; pointer-events: none; }
.days-bg span { border-radius: 16px; background: var(--card); }
.days-ind { position: absolute; top: 0; left: 0; height: 100%; width: calc((100% - 36px) / 7); border-radius: 16px; background: var(--green); pointer-events: none; transform: translateX(calc(var(--i, 6) * (100% + 6px))); transition: transform .42s cubic-bezier(.34,1.3,.64,1); }
.days button, .days button[aria-pressed="true"] { position: relative; background: transparent; transition: color .25s ease; }
.jbody { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.jbody.enter-r { animation: gl-in-r .32s cubic-bezier(.2,.8,.2,1) both; }
.jbody.enter-l { animation: gl-in-l .32s cubic-bezier(.2,.8,.2,1) both; }

/* ---------- Agenda (v0.6.0) ---------- */
.l-appt { width: 12px; height: 8px; border-radius: 3px; background: #2E5D94; }
.add-rdv { min-height: 44px; padding: 0 14px; gap: 6px; font-size: 14.5px; }
.jnav { display: flex; align-items: center; gap: 8px; }
.jnav-l { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center; }
.jnav-l b { font-size: 17px; font-weight: 700; }
.jnav-l b::first-letter { text-transform: uppercase; }
.jnav .chip { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.icon-btn.flip svg { transform: rotate(180deg); }
.tl-appt { position: absolute; left: 40px; right: 0; z-index: 3; border: 0; border-radius: 9px; background: #264F80; color: #fff; text-align: left; padding: 4px 8px; display: flex; flex-direction: column; gap: 1px; overflow: hidden; box-shadow: 0 4px 12px rgba(38,79,128,.25); font: inherit; }
.tl-appt b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-appt span { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-row { width: 100%; border: 0; background: #E6EDF6; border-radius: 14px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 6px; text-align: left; font: inherit; color: var(--ink); }
.appt-row .when { width: 46px; flex: none; font-weight: 700; font-size: 14px; color: #264F80; font-variant-numeric: tabular-nums; }
.appt-row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appt-row .what b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-row .what span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-card { border: 0; width: 100%; text-align: left; font: inherit; color: var(--ink); background: #E6EDF6; border-radius: 22px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.appt-card .ic { width: 44px; height: 44px; border-radius: 14px; background: #264F80; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.appt-card .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.appt-card .k { font-size: 12.5px; font-weight: 650; color: #264F80; }
.appt-card b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-card .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-detail { background: #E6EDF6; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.appt-detail .k { font-size: 13px; font-weight: 650; color: #264F80; }
.appt-detail .k::first-letter { text-transform: uppercase; }
.appt-detail .t { font-size: 26px; letter-spacing: -0.02em; }
.appt-detail .n { font-size: 16px; font-weight: 650; }
.dt3 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.dt3 .input { padding: 0 10px; min-width: 0; }
.chip.kind[aria-pressed="true"] { background: #264F80; color: #fff; }
.chip.rem[aria-pressed="true"] { background: var(--ok-bg); color: var(--ok); }
.switch-row { width: 100%; border: 0; background: var(--card); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; color: var(--ink); }
.switch-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row b { font-size: 15px; }
.card .switch-row { background: var(--soft); }
.switch { width: 50px; height: 30px; border-radius: 15px; background: #D9D0BF; flex: none; position: relative; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.34,1.4,.64,1); }
.switch-row[aria-checked="true"] .switch { background: var(--green); }
.switch-row[aria-checked="true"] .switch::after { transform: translateX(20px); }
.card.soft { background: var(--soft); padding: 12px 14px; }
.btn.danger { color: var(--alert); }
/* Semaine */
.wk { padding: 12px 10px 14px; gap: 8px; }
.wk-head { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); }
.wk-d { border: 0; background: none; font: inherit; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0; min-height: 44px; }
.wk-d span { font-size: 11px; font-weight: 650; }
.wk-d b { font-size: 16px; color: var(--ink); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.wk-d.today b { background: var(--green); color: var(--green-ink); }
.wk-grid { position: relative; border-top: 1px solid #EDE7DB; }
.wk-hour { position: absolute; left: 0; right: 0; height: 1px; background: #F1ECE2; }
.wk-hour span { position: absolute; left: 0; top: -7px; width: 26px; text-align: right; font-size: 10px; color: var(--muted); background: var(--card); }
.wk-col { position: absolute; top: 0; bottom: 0; border-left: 1px solid #F4EFE6; }
.wk-col.today { background: rgba(31,74,58,.04); }
.wk-sleep { position: absolute; left: 3px; right: 10px; border-radius: 4px; background: #9B92D6; }
.wk-sleep.on { background: #5A50A0; }
.wk-feed { position: absolute; left: 1px; width: 3px; height: 9px; margin-top: -4px; border-radius: 2px; background: #A8661A; }
.wk-diaper { position: absolute; right: 2px; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #2B7262; }
.wk-appt { position: absolute; left: 1px; right: 1px; z-index: 2; border: 0; border-radius: 6px; background: #264F80; color: #fff; font: inherit; padding: 2px 3px; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.wk-appt b { font-size: 9.5px; line-height: 1.2; }
.wk-appt span { font-size: 9px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); z-index: 3; }
/* Mois */
.mo { padding: 12px 8px; gap: 6px; }
.mo-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: 11px; font-weight: 650; color: var(--muted); text-align: center; }
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mo-c { border: 0; background: none; font: inherit; color: var(--ink); min-height: 62px; padding: 4px 1px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 12px; min-width: 0; }
.mo-c b { font-size: 14.5px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 650; }
.mo-c.out { opacity: .38; }
.mo-c.today b { background: var(--green); color: var(--green-ink); }
.mo-c.sel { background: var(--soft); box-shadow: inset 0 0 0 2px var(--green); }
.mo-dots { display: flex; gap: 2px; height: 5px; }
.mo-dots i { width: 5px; height: 5px; border-radius: 50%; }
.mo-dots .s { background: #9B92D6; } .mo-dots .f { background: #A8661A; } .mo-dots .c { background: #2B7262; }
.mo-appt { max-width: 100%; box-sizing: border-box; padding: 1px 4px; border-radius: 5px; background: #264F80; color: #fff; font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-more { font-size: 9px; color: var(--muted); font-weight: 700; }

/* Pas de zoom ni de déplacement latéral de la page (v0.6.1) */
body { touch-action: pan-y; overflow-x: hidden; overscroll-behavior-x: none; }

/* ---------- v0.6.2 : écran figé, glissement entre onglets qui suit le doigt ---------- */
.peek-layer { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.peek { position: absolute; inset: 0; overflow: hidden; background: var(--bg); will-change: transform; }
.peek > main.screen { animation: none !important; }
.peek .strip *, .peek .bars *, .peek .counts * { animation: none !important; }
/* Feuilles et menus : rien ne bouge en dehors du défilement vertical voulu */
.backdrop, .fab-bd { touch-action: none; overscroll-behavior: none; }
.sheet { touch-action: pan-y; overscroll-behavior-x: none; overscroll-behavior-y: contain; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.peek-layer, .peek { touch-action: none; }
html.sheet-open, html.sheet-open body { overflow: hidden; }

/* ---------- v0.6.3 : parents connectés et synchronisation ---------- */
.who-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.mstack { display: flex; text-decoration: none; min-height: 44px; align-items: center; }
.mstack .mav { border: 2px solid var(--bg); }
.mstack .mav + .mav { margin-left: -10px; }
.mav { position: relative; }
.mav.more { background: #E4DDCF; color: #3C463F; width: 34px; height: 34px; font-size: 12px; }
.mav.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #2FA36B; border: 2px solid var(--bg); animation: gl-on 2.4s ease-in-out infinite; }
.card .mav.on::after { border-color: var(--card, #FFFFFF); }
@keyframes gl-on { 0%, 100% { box-shadow: 0 0 0 0 rgba(47,163,107,0.45); } 50% { box-shadow: 0 0 0 4px rgba(47,163,107,0); } }
.sync { font-size: 12px; color: #4C564F; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2B7262; }
.sync.wait::before { background: #A8661A; animation: gl-breath 1.2s ease-in-out infinite; }
.sync.off { color: #8E3829; }
.sync.off::before { background: #B04A3A; }
@media (prefers-reduced-motion: reduce) { .mav.on::after, .sync.wait::before { animation: none; } }

/* ---------- v0.6.3 : tableau de bord administrateur ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--ink); }
.kpi .sub { font-size: 11px; color: var(--muted); }
.spark { height: 64px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); }
.spark span { flex: 1; border-radius: 2px 2px 0 0; min-width: 0; }
.hbar { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.hbar .t { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; display: block; }
.hbar .t span { display: block; height: 100%; border-radius: 5px; }
.hbar b { font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

/* ---------- v0.6.3 : jumeaux, choisir pour qui on note ---------- */
.for-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.for-seg button .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--child); flex: none; }
.fab-who { position: fixed; left: 16px; right: 16px; bottom: calc(56px + 350px + var(--safe-bottom)); z-index: 46; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1); }
.fab-root.open.has-who .fab-who { opacity: 1; transform: none; pointer-events: auto; }
.fab-who .seg { box-shadow: 0 6px 20px rgba(30,42,36,.12); }

/* ---------- v0.6.4 : rebond en fin de page (iOS), indicateur d'onglet stable ---------- */
html, body { overscroll-behavior-y: auto; }

/* ---------- v0.6.5 : couleur et aspect des selles ---------- */
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.swatch { min-height: 64px; border: 2px solid transparent; border-radius: 14px; background: var(--soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 650; line-height: 1.15; padding: 6px 4px; text-align: center; }
.swatch .sw { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(30,42,36,.18); }
.swatch[aria-pressed="true"] { border-color: var(--green); background: var(--card, #FFFDF8); }

/* ---------- v0.6.6 : accueil en couleur, guide Safari illustré ---------- */
.screen.plain.welcome { gap: 18px; padding-top: 0; }
.whero { margin: 0 -18px; padding: calc(48px + var(--safe-top, 0px)) 24px 30px; background: var(--green); color: #F7F2E8; border-radius: 0 0 32px 32px; display: flex; flex-direction: column; gap: 10px; }
.whero .title-xl { color: #F7F2E8; margin: 6px 0 0; }
.whero p { margin: 0; font-size: 18px; line-height: 1.35; color: #E3EFE8; }
.wfeats { display: flex; flex-direction: column; gap: 14px; padding: 6px 2px 0; }
.wfeat { display: flex; align-items: center; gap: 14px; }
.wico { width: 48px; height: 48px; border-radius: 15px; display: flex; align-items: center; justify-content: center; flex: none; }
.wico.repas { background: #F5E4C8; color: #8A5212; } .wico.couche { background: #D6ECE4; color: #1F5C4F; }
.wico.sommeil { background: #E6E2F5; color: #4A4190; } .wico.sante { background: #DAE5F2; color: #264F80; }
.wtx { display: flex; flex-direction: column; gap: 1px; } .wtx b { font-size: 16px; } .wtx span { font-size: 14px; color: #4C564F; }
.steps.guide .gstep { align-items: flex-start; }
.gt { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.mock-bar { display: flex; align-items: center; gap: 8px; background: #EDE8DE; border-radius: 22px; padding: 6px 6px 6px 14px; font-size: 13px; color: #4C564F; }
.mock-url { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-dots { width: 36px; height: 36px; border-radius: 50%; background: #FFFFFF; display: flex; align-items: center; justify-content: center; color: var(--ink); box-shadow: 0 0 0 3px #2FA36B; animation: guidePulse 1.6s ease-in-out infinite; }
.mock-menu { display: flex; flex-direction: column; background: #EDE8DE; border-radius: 14px; overflow: hidden; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; border-bottom: 1px solid #E0D8C8; }
.mock-row:last-child { border-bottom: 0; }
.mock-menu .mock-row { justify-content: flex-start; }
.mock-row.hl { background: #FFFFFF; box-shadow: inset 0 0 0 2px #2FA36B; }
.mock-add { background: #EDE8DE; border-radius: 14px; overflow: hidden; }
.mock-addtop { display: flex; justify-content: space-between; padding: 10px 12px; font-size: 14px; border-bottom: 1px solid #E0D8C8; }
.mock-pulse { color: #1F6FD1; border-radius: 8px; padding: 0 4px; box-shadow: 0 0 0 2px #2FA36B; }
.mock-switch { width: 44px; height: 26px; border-radius: 13px; background: #34C759; position: relative; flex: none; }
.mock-switch::after { content: ""; position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; }
@keyframes guidePulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(47,163,107,.9); } 50% { box-shadow: 0 0 0 7px rgba(47,163,107,.25); } }
.point-down { position: fixed; right: 12px; bottom: calc(12px + var(--safe-bottom)); display: flex; align-items: center; gap: 6px; background: var(--green); color: #F7F2E8; font-size: 13px; font-weight: 750; padding: 8px 10px 8px 14px; border-radius: 16px; box-shadow: 0 8px 20px rgba(30,42,36,.25); z-index: 30; pointer-events: none; animation: pointBob 1.2s ease-in-out infinite; }
.point-down svg { transform: rotate(-90deg); }
.screen.plain:has(.point-down) { padding-bottom: calc(88px + var(--safe-bottom)); }
@keyframes pointBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .mock-dots, .point-down { animation: none; } }

/* ---------- Sons apaisants (v0.7.0) ---------- */
.linkbtn { border: 0; background: none; padding: 6px 0; font-weight: 700; font-size: 14px; color: var(--sommeil); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: gl-eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes gl-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.pill.snd { background: var(--sommeil-bg); color: var(--sommeil); box-shadow: 0 12px 26px rgba(74,65,144,.22); padding: 0 8px 0 10px; }
.pill.snd .snd-open { flex: 1; min-width: 0; height: 56px; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; text-align: left; padding: 0; font-weight: 400; }
.snd-ico { width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; background: rgba(74,65,144,.12); color: var(--sommeil); }
.snd-ico.on { background: var(--sommeil); color: #FFFFFF; }
.pill.snd .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pill.snd .t2 { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill.snd .snd-left { font-size: 12.5px; opacity: .8; }
.pill.snd .rnd { width: 44px; height: 44px; border-radius: 14px; border: 0; background: rgba(74,65,144,.12); color: var(--sommeil); display: grid; place-items: center; padding: 0; }
.snd-list { display: flex; flex-direction: column; gap: 6px; }
.snd-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 12px 8px 8px; border: 0; border-radius: 16px; background: var(--soft); text-align: left; color: var(--ink); }
.snd-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.snd-row b { font-size: 15px; }
.snd-row.on { background: var(--sommeil-bg); }
.snd-act { font-weight: 700; font-size: 13.5px; color: var(--sommeil); flex: none; }
.soothe { border: 1.5px solid var(--pleurs-bg); }
.soothe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.soothe-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 0; border-radius: 16px; background: var(--soft); font-weight: 700; font-size: 12.5px; line-height: 1.2; color: var(--ink); text-align: center; }
.soothe-btn .disc { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--pleurs-bg); color: var(--pleurs); }
.soothe-btn.on { background: var(--pleurs-bg); }
.soothe-btn.on .disc { background: var(--pleurs); color: #FFFFFF; }

/* ---------- Noter après coup (v0.8.0) ---------- */
.arc { position: relative; margin: 0 -8px; }
.arc svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: none; user-select: none; -webkit-user-select: none; }
.arc-read { position: absolute; left: 0; right: 0; bottom: 3%; text-align: center; pointer-events: none; }
.arc-read .t { font-size: clamp(21px, 6vw, 25px); font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.arc-read .d { font-size: 13px; font-weight: 700; }
.arc-hint { text-align: center; margin: 0; }
.btn:disabled { opacity: .45; }
.bub { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.fab-hint { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.pill .txt { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
html.fab-open #toast-root { visibility: hidden; }
.pill.drag { transition: none; }
