/*
 * Point d'entrée des styles. En dev, le navigateur suit les @import ; au
 * build, scripts/build.mjs les remplace par le contenu des fichiers (un
 * seul app.css). Ordre : jetons, base, coque, composants, puis un fichier
 * par écran, rangé avec l'écran dans src/features/.
 */
/*
 * Jetons de la charte, repris de la v117 (dégradé, fond, fontes) et
 * corrigés pour l'accessibilité : le texte secondaire passe de #A5A0AE
 * (2,18:1, audit § 4) à #5E5A66 (5,6:1 sur le fond, 6,4:1 sur blanc).
 * Seule source des couleurs et des rayons : les autres fichiers s'y réfèrent.
 * Thème clair seulement, quel que soit le réglage du téléphone.
 */
:root {
  --red: #E53D40;
  --magenta: #8B2F6C;
  --violet: #5B2C82;
  --tint-red: #FCF1F1;
  --tint-magenta: #FAF2F6;
  --tint-violet: #F4F0FA;
  --grad: linear-gradient(115deg, #E53D40 0%, #8B2F6C 52%, #5B2C82 100%);

  --bg: #EFECF4;
  --surface: #FFFFFF;
  --recap: #E5E0EC;
  --ink: #16151A;
  --black: #000000;
  --muted: #5E5A66;
  --line: #D9D3E2;
  --line-strong: #BDB5C9;
  --night: #16151A;
  --night-2: #221F2A;
  --on-night: #FFFFFF;
  --on-night-muted: #CBC5D6;
  /* La couleur de chaque proche : six teintes de la charte, toutes lisibles en blanc (initiale en gras). */
  --tone-0: #E53D40;
  --tone-1: #5B2C82;
  --tone-2: #A3417B;
  --tone-3: #C13A52;
  --tone-4: #7446A8;
  --tone-5: #8B2F6C;

  /* La matière sombre de la v117 : une aurore (rouge en haut à droite, violet en bas à gauche) et un grain fin. */
  --aurora:
    radial-gradient(86% 58% at 88% -6%, rgba(229, 61, 64, .34) 0%, rgba(20, 17, 24, 0) 64%),
    radial-gradient(74% 56% at 6% 102%, rgba(91, 44, 130, .5) 0%, rgba(20, 17, 24, 0) 66%),
    radial-gradient(130% 92% at 70% 34%, rgba(139, 47, 108, .18) 0%, rgba(20, 17, 24, 0) 72%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.5'/%3E%3C/svg%3E");

  --good: #23704A;
  --good-tint: #ECF6F0;
  --danger: #B3261E;
  --danger-tint: #FCEEEE;

  --font-title: "Bricolage", system-ui, sans-serif;
  --font-text: "InterV", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 12px;
  --r: 22px;
  --r-lg: 32px;
  --pill: 999px;

  --shadow-1: 0 0 0 1px rgba(91, 44, 130, .07), 0 1px 2px rgba(91, 44, 130, .05);
  --shadow-2: 0 0 0 1px rgba(91, 44, 130, .08), 0 1px 2px rgba(91, 44, 130, .06), 0 6px 16px -8px rgba(91, 44, 130, .18);
  --shadow-3: 0 14px 40px -12px rgba(22, 21, 26, .35);

  --gutter: 16px;
  --max: 480px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Le rebond : ce qui apparaît ou répond au doigt dépasse un peu, puis se pose. */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
/* Fontes embarquées : rien ne se charge depuis internet. */
@font-face { font-family: "Bricolage"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../assets/fonts/bricolage-grotesque-variable.woff2") format("woff2"); }
@font-face { font-family: "InterV"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/inter-variable.woff2") format("woff2"); }
@font-face { font-family: "InterV"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/inter-variable-italic.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; background: var(--bg); overflow-x: hidden; }
/* Pas de mot seul sur la dernière ligne d'un paragraphe. */
p, li, dd, .bubble, .say-bubble, .option-text { text-wrap: pretty; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
/* Un prénom ou un mot très long ne fait jamais déborder l'écran. */
h1, h2, h3, p, blockquote, .bubble, .chip, .relative-name, .profile-name, .topbar-title, .section-title { overflow-wrap: anywhere; min-width: 0; }
body[data-theme="dark"] { background: var(--night); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-family: var(--font-title); letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
b, strong { font-weight: 650; }

:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { padding: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
/* La coque : une colonne de téléphone, centrée sur un grand écran. */
.app { max-width: var(--max); margin: 0 auto; min-height: 100dvh; position: relative; overflow-x: clip; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + 8px) 8px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar-title { font-size: 17px; font-weight: 650; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-side { display: flex; justify-content: flex-end; }
.topbar-home {
  display: flex; justify-content: space-between; padding-left: var(--gutter); padding-right: var(--gutter);
  position: absolute; left: 0; right: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--on-night);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-title); font-weight: 700; font-size: 19px; letter-spacing: -.02em; min-height: 44px; }
.brand img { border-radius: 8px; }
.topbar-actions { display: flex; gap: 4px; }
.topbar-home .icon-btn { color: var(--on-night); background: rgba(255, 255, 255, .08); }

/*
 * Barre d'un écran à bandeau sombre : transparente sur le bandeau (qui passe dessous, voir .night-under),
 * teintée dès qu'on défile, puis claire avec son titre une fois le bandeau dépassé.
 */
.topbar-night { background: transparent; color: var(--on-night); backdrop-filter: none; -webkit-backdrop-filter: none; transition: background-color .2s, color .2s; }
.topbar-night.is-scrolled { background: rgba(22, 21, 26, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.night-under { --bar: calc(var(--safe-top) + 60px); margin-top: calc(-1 * var(--bar)); padding-top: var(--bar); }
.topbar-night .icon-btn { color: inherit; }
.topbar-night .icon-btn:active { background: rgba(255, 255, 255, .1); }
.topbar-night .topbar-title { opacity: 0; transition: opacity .2s; }
.topbar-night.is-past { background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--ink); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.topbar-night.is-past .topbar-title { opacity: 1; }

/* La matière sombre (accueil, fiche d'un proche, prise en main) : aurore et grain, comme la v117. */
.night { position: relative; isolation: isolate; overflow: hidden; background: var(--night); color: var(--on-night); }
.night::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--aurora); pointer-events: none; }
.night::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); background-size: 140px 140px; opacity: .16; mix-blend-mode: overlay; pointer-events: none; }
.night-band { border-radius: 0 0 var(--r-lg) var(--r-lg); }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--pill); background: transparent; color: var(--ink);
}
.icon-btn:active { background: rgba(22, 21, 26, .06); }

.view { outline: none; }
.view-enter { animation: view-in .28s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page { padding: 8px var(--gutter) 40px; display: flex; flex-direction: column; gap: 16px; }
.page-title { font-size: 26px; font-weight: 700; }
.section { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-text); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.section-dash { width: 14px; height: 2px; border-radius: 2px; background: var(--grad); opacity: .8; flex: none; }
.section-aside { margin-left: auto; letter-spacing: .04em; font-weight: 650; }

/* La barre d'actions du bas, au-dessus de la zone de geste du téléphone. */
.action-bar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 15;
  width: 100%; max-width: var(--max);
  display: flex; gap: 10px; padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.action-bar .btn-primary { flex: 1; }
.page-relative { padding-bottom: 120px; }

/* Le bouton de la bibliothèque, nommé, dans la barre de l'accueil. */
.topbar-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--pill); background: rgba(255, 255, 255, .08); color: var(--on-night); font-size: 14px; font-weight: 650; }
.topbar-pill:active { background: rgba(255, 255, 255, .14); }
/* ---------- Boutons : un seul noir par écran, l'action principale ; les autres bordés ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: var(--pill); border: 1.5px solid transparent;
  font-weight: 650; font-size: 16px; letter-spacing: -.005em; white-space: nowrap; text-align: center;
  transition: transform .22s var(--spring), background-color .15s, border-color .15s, opacity .15s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.95); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14.5px; align-self: flex-start; }
.btn-primary { background: var(--black); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-light { background: #fff; color: var(--black); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, white); }
.btn-link { background: none; border: 0; color: var(--muted); min-height: 44px; font-weight: 550; text-decoration: underline; text-underline-offset: 3px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--violet); min-height: 44px; }
.button-stack { display: flex; flex-direction: column; gap: 10px; }
.button-stack .btn { width: 100%; }

/* ---------- Cartes : action en blanc, récapitulatif en gris sans bordure ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-2); display: block; }
.recap { background: var(--recap); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.recap-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.recap-row p { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hint { color: var(--muted); font-size: 14.5px; }
.empty { color: var(--muted); font-size: 15px; }
.source { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* ---------- Statuts : contour quand on attend, noir plein quand c'est accompli ---------- */
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--pill); border: 1.5px solid var(--line-strong); font-size: 12.5px; font-weight: 650; white-space: nowrap; color: var(--ink); background: var(--surface); }
.status-done { background: var(--black); border-color: var(--black); color: #fff; }
.status-muted { color: var(--muted); border-color: var(--line); background: transparent; align-self: flex-start; }

/* ---------- Puces ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-center { justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px;
  border-radius: var(--pill); font-size: 14.5px; font-weight: 550; line-height: 1.25;
  background: var(--surface); border: 1.5px solid var(--line);
}
.chip-choice { min-height: 44px; min-width: 56px; justify-content: center; }
.chip-choice.is-on { background: var(--tint-violet); border-color: var(--violet); color: var(--violet); }
.chip-choice.is-on::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
/* Ce qui compte pour un proche : des puces blanches, un point de couleur par sorte (sujet, situation, ce qui le fait réagir). Un fond teinté de rouge se lisait comme une erreur. */
.chip-priority, .chip-situation, .chip-frame, .chip-sensitivity, .chip-objection { background: var(--surface); border-color: var(--line); color: var(--ink); }
.chip-priority::before, .chip-situation::before, .chip-frame::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip-priority::before { background: var(--red); }
.chip-situation::before { background: var(--violet); }
.chip-frame::before { background: transparent; box-shadow: inset 0 0 0 2px var(--magenta); width: 8px; height: 8px; }
.chip-x { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -6px -10px -6px -2px; border: 0; background: transparent; color: inherit; border-radius: var(--pill); }
.chip-x::after { content: ""; position: absolute; inset: -8px; }
.chip-x:active { background: rgba(0, 0, 0, .06); }
.chip.is-new { animation: pop .45s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }
.chip-choice { transition: transform .2s var(--spring), background-color .15s, border-color .15s; }
.chip-choice:active { transform: scale(.94); }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14.5px; font-weight: 650; }
.field-optional { font-weight: 450; color: var(--muted); margin-left: 4px; }
.input {
  width: 100%; min-height: 52px; padding: 14px 16px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px var(--tint-violet); }
.textarea { resize: none; field-sizing: content; min-height: 120px; }
.input::placeholder { color: #716B7B; }

/* ---------- Choix en cartes (posture, issue d'une conversation, quiz) ---------- */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  padding: 14px 16px; min-height: 60px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line);
  transition: border-color .15s, background-color .15s;
}
.option-label { font-weight: 650; font-size: 16px; }
.option-text { color: var(--muted); font-size: 14.5px; }
.option.is-on { border-color: var(--violet); background: var(--tint-violet); box-shadow: inset 0 0 0 1px var(--violet); }
/* Un choix qui se coche (où en est un proche) : la place de la coche est gardée, le texte ne bouge pas. */
.option[aria-pressed] { position: relative; padding-right: 46px; }
.option.is-on::after { content: ""; position: absolute; top: 14px; right: 16px; width: 18px; height: 18px; background: var(--violet);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.option { transition: transform .2s var(--spring), border-color .15s, background-color .15s; }
.option:active:not(:disabled) { transform: scale(.97); }
.option-row { flex-direction: row; align-items: center; gap: 14px; }
.option-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-violet); color: var(--violet); }
.option-row.is-on .option-icon { background: var(--violet); color: #fff; }
.option-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option.is-good { border-color: var(--good); background: var(--good-tint); }
.option.is-bad { border-color: var(--danger); background: var(--danger-tint); }
.option:disabled { cursor: default; }
.option-note { margin-top: 8px; font-size: 14.5px; color: var(--ink); }

/* ---------- Progression d'un formulaire, compteur ---------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 8px 0; }
.stepper-btn { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--pill); border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 26px; line-height: 1; }
.stepper-btn:disabled { opacity: .35; }
.stepper-value { min-width: 2ch; text-align: center; font: 700 72px/1 var(--font-title); letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stepper-sm { gap: 12px; padding: 0; }
.stepper-sm .stepper-btn { width: 44px; height: 44px; font-size: 22px; }
.stepper-sm .stepper-value { font-size: 30px; }
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }

/* ---------- La tortue et sa bulle ---------- */
.turtle { display: flex; align-items: flex-end; gap: 10px; }
/* Toutes les poses ont la même hauteur : la tortue garde sa taille quand elle change de geste. */
.turtle-img { flex: none; width: auto; filter: drop-shadow(0 8px 14px rgba(91, 44, 130, .18)); }
.turtle-sm .turtle-img { height: 68px; }
.turtle-md .turtle-img { height: 96px; }
.turtle-lg .turtle-img { height: 136px; }
.turtle-xl { flex-direction: column; align-items: center; }
.turtle-xl .turtle-img { height: 200px; }
.bubble {
  position: relative; flex: 1; padding: 11px 14px; border-radius: 18px 18px 18px 6px;
  background: var(--surface); box-shadow: var(--shadow-1); font-size: 15.5px; line-height: 1.45; font-weight: 500;
  margin-bottom: 10px;
}
.turtle-dark .bubble { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: var(--on-night); }
.turtle-dark .turtle-img { filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .45)); }
/* La tortue vit : elle se balance doucement, et sa bulle arrive en rebond à l'ouverture d'un écran. */
.turtle-img { transform-origin: 50% 100%; animation: sway 4.5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(0); } 30% { transform: translateY(-3px) rotate(-3deg); } 60% { transform: rotate(2deg); } }
.view-enter .bubble { animation: bubble-in .5s var(--spring) .12s both; transform-origin: 0 100%; }
@keyframes bubble-in { from { opacity: 0; transform: scale(.7) translateY(8px); } }

/* ---------- Pastille d'un proche : son initiale sur sa couleur ---------- */
.avatar {
  position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: var(--tone, var(--violet)); color: #fff; font: 700 18px/1 var(--font-title); letter-spacing: -.02em;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14), inset 0 2px 0 rgba(255, 255, 255, .18);
}
.avatar-sm { width: 34px; height: 34px; font-size: 15px; }
.avatar-md { width: 46px; height: 46px; font-size: 19px; }
.avatar-lg { width: 56px; height: 56px; font-size: 24px; }
.avatar-xl { width: 80px; height: 80px; font-size: 34px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .14), inset 0 3px 0 rgba(255, 255, 255, .2); }
.tone-0 { --tone: var(--tone-0); }
.tone-1 { --tone: var(--tone-1); }
.tone-2 { --tone: var(--tone-2); }
.tone-3 { --tone: var(--tone-3); }
.tone-4 { --tone: var(--tone-4); }
.tone-5 { --tone: var(--tone-5); }
.avatar.is-paused { filter: grayscale(1); opacity: .55; }
.avatar-badge { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--black); color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.avatar-sm .avatar-badge { width: 16px; height: 16px; right: -4px; bottom: -4px; }
.avatar-sm .avatar-badge .icon { width: 11px; height: 11px; }
.night .avatar-badge { box-shadow: 0 0 0 2px var(--night); }

/* ---------- L'avancée (core/progress.js) : l'anneau d'un proche, un trait fin pour l'objectif ---------- */
@property --p { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
.ring {
  --p: 0%; --ring-track: var(--line); --ring-gap: var(--surface);
  display: inline-grid; place-items: center; flex: none; padding: 6px; border-radius: 50%;
  background: conic-gradient(var(--red) 0, var(--magenta) calc(var(--p) * .5), var(--violet) var(--p), var(--ring-track) var(--p));
  transition: --p 1s var(--ease);
}
.ring > .avatar { box-shadow: 0 0 0 2.5px var(--ring-gap), inset 0 -3px 0 rgba(0, 0, 0, .14), inset 0 2px 0 rgba(255, 255, 255, .18); }
.ring-sm { padding: 4.5px; }
.ring-sm > .avatar { box-shadow: 0 0 0 2px var(--ring-gap); }
.ring-xl { padding: 8px; }
.ring-xl > .avatar { box-shadow: 0 0 0 3.5px var(--ring-gap), inset 0 -4px 0 rgba(0, 0, 0, .14), inset 0 3px 0 rgba(255, 255, 255, .2); }
.night .ring { --ring-track: rgba(255, 255, 255, .16); --ring-gap: var(--night); }
.recap .ring { --ring-gap: var(--recap); }
.ring.is-filling > .avatar { animation: hop .5s var(--spring) .7s; }
@keyframes hop { 40% { transform: scale(1.08); } }

/* Son étape, en texte. */
.stage-line { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.stage-name { font-weight: 650; }
.stage-count { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.night .stage-count { color: var(--on-night-muted); }

/* Un trait fin au dégradé : l'objectif, les étapes d'un formulaire. */
.bar { --value: 0; position: relative; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--value) * 100%); border-radius: inherit; background: var(--grad); transition: width .8s var(--ease); }
.night .bar { background: rgba(255, 255, 255, .14); }
.night .bar-fill { filter: brightness(1.35) saturate(1.1); }

/* ---------- « Creuser » : l'essentiel à l'écran, le détail à déplier ---------- */
.dig > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; margin-top: 2px;
  border-radius: var(--pill); border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: 14px; font-weight: 650; color: var(--ink); transition: transform .2s var(--spring);
}
.dig > summary:active { transform: scale(.95); }
.dig-sign { position: relative; width: 16px; height: 16px; flex: none; }
.dig-sign::before, .dig-sign::after { content: ""; position: absolute; left: 2px; right: 2px; top: 7px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--spring); }
.dig-sign::after { transform: rotate(90deg); }
.dig[open] .dig-sign::after { transform: rotate(0); }
.dig-less, .dig[open] .dig-more { display: none; }
.dig[open] .dig-less { display: inline; }
.dig-body { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; animation: dig-in .32s var(--ease); }
@keyframes dig-in { from { opacity: 0; transform: translateY(-6px); } }


/* ---------- Confettis, quand un proche est convaincu ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confetti span { position: absolute; top: -20px; left: var(--x); width: 9px; height: 14px; border-radius: 3px; background: var(--c);
  transform: rotate(var(--r)); animation: fall var(--t) cubic-bezier(.3, .6, .5, 1) var(--d) both; }
@keyframes fall { to { transform: translate(var(--drift), 105dvh) rotate(calc(var(--r) + 540deg)); } }

/* ---------- Onglets, recherche, listes ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--recap); }
.tab { display: grid; place-items: center; min-height: 44px; border-radius: var(--pill); font-size: 14px; font-weight: 650; color: var(--muted); }
.tab.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tab-panel { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 52px; border-radius: var(--pill); background: var(--surface); box-shadow: var(--shadow-1); color: var(--muted); }
.search-input { flex: 1; border: 0; background: none; font-size: 16.5px; min-height: 50px; color: var(--ink); }
.search-input:focus { outline: none; }
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--violet), 0 0 0 4px var(--tint-violet); }

.link-list, .result-list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.link-list > li + li, .result-list > li + li { border-top: 1px solid var(--line); }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 12px 16px; font-size: 15.5px; font-weight: 550; }
.link-row-tall { justify-content: flex-start; }
.link-main { display: flex; flex-direction: column; }
.link-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.link-figure { flex: none; font: 700 15px/1 var(--font-title); color: var(--magenta); }
.list-group { font-size: 15px; font-weight: 700; margin: 6px 0 -2px; }
.result { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; min-height: 54px; }
.result-type { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.result-title { font-size: 15px; font-weight: 550; }

/* ---------- Tiroir du bas, message bref ---------- */
.sheet-layer { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(22, 21, 26, .45); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 50%; bottom: 0; width: 100%; max-width: var(--max); max-height: 86dvh; overflow: auto; outline: none;
  transform: translate(-50%, 100%); transition: transform .26s var(--ease);
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 6px var(--gutter) calc(20px + var(--safe-bottom));
}
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.sheet-layer.is-open .sheet { transform: translate(-50%, 0); }
.sheet-layer.is-leaving .sheet-backdrop { opacity: 0; }
.sheet-layer.is-leaving .sheet { transform: translate(-50%, 100%); }
.sheet-head { position: sticky; top: -6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 8px; background: var(--bg); z-index: 1; }
.sheet-title { font-size: 20px; font-weight: 700; }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-text { font-size: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.menu { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border: 0; background: none; text-align: left; font-weight: 600; font-size: 16px; }
.menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-danger { color: var(--danger); }
.picker { display: flex; flex-direction: column; gap: 10px; }
.picker-group { font-size: 14px; font-weight: 700; margin-top: 6px; }
.pick-list { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.pick-list li + li { border-top: 1px solid var(--line); }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; background: none; text-align: left; font-weight: 550; }
.pick-muted { color: var(--muted); }
.pick-hint { font-size: 13px; font-weight: 650; color: var(--violet); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 60;
  max-width: calc(min(var(--max), 100vw) - 32px); padding: 12px 18px; border-radius: var(--pill);
  background: var(--black); color: #fff; font-weight: 600; font-size: 14.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Détails dépliables ---------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.reveal { margin-top: 10px; }
.reveal > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-weight: 650; color: var(--violet); }
.reveal > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.reveal[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.reveal > :not(summary) { margin-top: 8px; }
.bullets { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; list-style: disc; }

/* ---------- Une mesure du programme (fiche d'un proche, bibliothèque) ---------- */
.measure { display: flex; flex-direction: column; gap: 6px; }
.measure-theme { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.key-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.key-value { font: 700 38px/1 var(--font-title); letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.key-label { font-size: 14px; color: var(--muted); font-weight: 550; }
.measure-title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.measure-rows { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.measure-rows > div { display: flex; flex-direction: column; gap: 2px; }
.measure-rows dt { font-size: 13px; font-weight: 650; color: var(--muted); }
.measure-rows dd { margin: 0; font-size: 15px; }
.reasons { margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--violet); }
.reasons span { color: var(--muted); font-weight: 550; }
.rebuttal-short { font-size: 15.5px; }
.rebuttal-way { font-size: 14.5px; color: var(--muted); }

/* ---------- Un réflexe à apprendre (fiche, débrief) ---------- */
.lesson-card { display: flex; flex-direction: column; gap: 4px; }
.lesson-kicker { font-size: 11.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); }
.lesson-title { font: 700 20px/1.2 var(--font-title); letter-spacing: -.02em; }
.lesson-skill { color: var(--muted); font-size: 14.5px; }
.lesson-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: 650; color: var(--violet); }

/* ---------- Entrées en scène : ce qui arrive monte et se pose, une fois, à l'ouverture d'un écran ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.95); } }

/* ---------- La conversation avec la tortue ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.say { display: flex; align-items: flex-start; gap: 8px; max-width: 94%; }
/* Sa tête sur fond blanc, agrandie pour que le visage remplisse le rond (lavande sur lavande se lisait comme un fantôme). */
.face { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.face img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); transform-origin: 50% 30%; }
/* La tête sur la première réplique d'une suite, en haut, d'où part la bulle : la tortue ne se répète pas. */
.say + .say .face { visibility: hidden; }
.say-bubble { position: relative; padding: 11px 14px; border-radius: 6px 18px 18px 18px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 15.5px; line-height: 1.42; font-weight: 500; }
.say-bubble .chips { margin-top: 8px; gap: 6px; }
.say-bubble .chip { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.me { display: flex; justify-content: flex-end; }
.me-bubble { max-width: 84%; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--violet); color: #fff; font-size: 15px; font-weight: 550; line-height: 1.4; }
.dock { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
/* Le bouton qui valide une réplique prend le même écart que dans .form-actions. */
.dock > .btn-block { margin-top: 8px; }
.dock-label { font-size: 14px; font-weight: 650; }
.night .say-bubble { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: #fff; }
.night .face { background: rgba(255, 255, 255, .14); box-shadow: none; }

/* Elle écrit : trois points, puis sa phrase ; la zone de réponse arrive ensuite. Seulement à l'ouverture de l'écran. */
.say-dots { display: none; }
.view-enter .say.is-fresh .say-bubble { animation: bubble-in .45s var(--spring) both; transform-origin: 0 0; }
.view-enter .say.is-fresh .say-dots { position: absolute; left: 14px; top: 50%; display: flex; gap: 4px; transform: translateY(-50%); animation: fade-out .15s ease .7s both; }
.say-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1s ease-in-out infinite; }
.say-dots i:nth-child(2) { animation-delay: .15s; }
.say-dots i:nth-child(3) { animation-delay: .3s; }
.night .say-dots i { background: #fff; }
.view-enter .say.is-fresh .say-text { animation: fade-in .25s ease .72s both; }
.view-enter .dock { animation: rise .45s var(--spring) .8s both; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; visibility: hidden; } }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- La coche ronde : vide quand c'est à faire, noire quand c'est fait (défis, prêt à voter) ---------- */
.check { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); color: #fff; transition: background-color .2s, border-color .2s; }
.is-done .check, [aria-pressed="true"] > .check { background: var(--black); border-color: var(--black); }

/* L'étape suivante, sous l'étape d'un proche. */
.stage-next { margin-top: 2px; font-size: 13px; color: var(--muted); }
.night .stage-next { color: var(--on-night-muted); }

/* Une conversation : la zone de réponse descend sous le pouce. */
.page-chat { min-height: calc(100dvh - 60px - var(--safe-top)); }
.page-chat > .dock { margin-top: auto; }

/* Les noms très longs tiennent en deux lignes. */
.profile-name, .person-name, .done-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* La recherche : la croix du navigateur, bleue, n'a pas sa place. */
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
/* L'accueil de la tortue : plein écran sur la matière sombre, comme le salut de la v117. */
.welcome {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 18px; text-align: center;
  padding: calc(var(--safe-top) + 48px) 24px calc(var(--safe-bottom) + 28px);
}
.welcome .turtle { margin-bottom: 4px; animation: float 5s ease-in-out infinite; }
.welcome-title { font-size: 32px; font-weight: 700; letter-spacing: -.035em; line-height: 1.08; max-width: 14ch; }
.how { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-top: 6px; }
.how-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: rise .6s var(--spring) both; animation-delay: calc(.25s + var(--i) * .12s); }
.how-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #2A2533; color: #fff; }
/* Un pointillé entre deux ronds, à 8 px de chacun. */
.how-step + .how-step::before { content: ''; position: absolute; top: 23px; right: calc(50% + 32px); width: calc(100% - 56px); height: 2px; background: repeating-linear-gradient(to right, rgba(255, 255, 255, .35) 0 5px, transparent 5px 10px); }
.how-label { font-size: 13.5px; font-weight: 650; line-height: 1.25; color: var(--on-night-muted); }
.welcome-actions { width: 100%; display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.welcome-note { display: inline-flex; justify-content: center; align-items: center; gap: 6px; font-size: 14px; color: var(--on-night-muted); }

/* L'objectif : quatre réponses, en grille. */
.goal-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.goal-choice { align-items: center; justify-content: center; min-height: 96px; text-align: center; }
.goal-choice-n { font: 700 34px/1 var(--font-title); letter-spacing: -.03em; }
.goal-choice-label { font-size: 14px; color: var(--muted); font-weight: 550; }

/* Les écrans de formulaire (prise en main, ajout d'un proche, débrief). */
.page-form { gap: 20px; padding-top: 12px; padding-bottom: calc(32px + var(--safe-bottom)); }
.form-title { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.12; }
.form-subtitle { font-size: 18px; font-weight: 700; margin-top: 6px; }
.form-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; }
.form-actions-row { flex-direction: row; }
.form-actions-row .btn { flex: 1; }
.who-head { display: flex; align-items: center; gap: 12px; }
.who-head .input { flex: 1; min-width: 0; }
.view-enter .who-head .avatar { animation: pop .55s var(--spring) both; }
.understood { min-height: 28px; display: flex; flex-direction: column; gap: 8px; }
.understood-label { font-size: 13px; font-weight: 650; color: var(--muted); }
.understood-empty { color: var(--muted); font-size: 14.5px; font-style: italic; }
/* Le haut de l'accueil : la tortue, le chemin des proches et l'objectif, l'action du moment. */
.hero { display: flex; flex-direction: column; gap: 12px; padding: calc(var(--safe-top) + 70px) var(--gutter) 22px; }
.hero .turtle { margin-bottom: 4px; }
/* L'objectif : convaincus sur objectif, et sa barre. */
.goal { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 4px; }
.goal-line { display: flex; align-items: baseline; gap: 10px; }
.goal-count { font: 700 44px/.9 var(--font-title); letter-spacing: -.05em; }
.goal-done { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: brightness(1.5) saturate(1.1); }
.goal-total { margin-left: 3px; color: var(--on-night-muted); font-size: 24px; letter-spacing: -.02em; }
.goal-label { font-size: 15px; font-weight: 650; color: var(--on-night-muted); }

/* Les défis de la semaine : une liste à cocher. */
.quests { display: flex; flex-direction: column; padding: 4px 16px; }
.quests li + li { border-top: 1px solid var(--line); }
.quests-done { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.quest { display: flex; align-items: center; gap: 12px; min-height: 52px; font-size: 15px; font-weight: 600; }
.quest > .icon { margin-left: auto; color: var(--muted); flex: none; }
.quest.is-done .quest-title { color: var(--muted); }
.view-enter .quest.is-done .check { animation: pop .45s var(--spring) both; }

/* Ton cercle : une carte par proche, les places libres en pointillé. */
.circle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.circle > li { display: flex; min-width: 0; }
.person {
  position: relative; flex: 1; min-width: 0; min-height: 172px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 14px 14px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-2);
  transition: transform .25s var(--spring);
}
.person:active { transform: scale(.96) rotate(-.8deg); }
.person .ring { margin-bottom: 8px; }
.person-name { font: 700 18px/1.15 var(--font-title); letter-spacing: -.02em; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.person-about { font-size: 13px; font-weight: 550; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person-progress { margin-top: auto; padding-top: 10px; }
.person-next { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 650; color: var(--violet); }
.person.is-paused { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }

.slot { justify-content: center; align-items: center; text-align: center; gap: 6px; background: transparent; box-shadow: none; border: 2px dashed var(--line-strong); color: var(--muted); }
.slot-add { border-color: color-mix(in srgb, var(--violet) 55%, var(--line-strong)); color: var(--ink); }
.slot-plus { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--violet); box-shadow: var(--shadow-2); }
.slot-add:active .slot-plus { transform: rotate(90deg); }
.slot-plus { transition: transform .35s var(--spring); }
.slot-label { font-weight: 700; font-size: 16px; }

.view-enter .circle > li { animation: rise .55s var(--spring) both; }
.view-enter .circle > li:nth-child(2) { animation-delay: .05s; }
.view-enter .circle > li:nth-child(3) { animation-delay: .1s; }
.view-enter .circle > li:nth-child(4) { animation-delay: .15s; }
.view-enter .circle > li:nth-child(n + 5) { animation-delay: .2s; }

/* La méthode : sept réflexes, gagnés en conversation. */
.method-card { display: flex; align-items: center; gap: 14px; }
.method-dots { display: grid; grid-template-columns: repeat(4, 12px); gap: 6px; flex: none; }
.method-dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); }
.method-dots .is-seen { border-color: var(--violet); background: var(--tint-violet); }
.method-dots .is-practiced { border-color: var(--black); background: var(--black); }
.method-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.method-title { font-weight: 650; }
.method-line { font-size: 13.5px; color: var(--muted); }

/* Les boutons du haut : l'action de la tortue, et parfois « Reporter ». */
.hero-actions { display: flex; gap: 10px; }
.hero-actions .btn-light { flex: 1; }
.hero-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
/* La fiche d'un proche : son profil sur la matière sombre, puis son plan. */
.profile-head { display: flex; flex-direction: column; gap: 16px; padding-left: var(--gutter); padding-right: var(--gutter); padding-bottom: 20px; }
.profile-head > :first-child { margin-top: 6px; }
.profile-id { display: flex; align-items: center; gap: 16px; }
.profile-who { min-width: 0; }
.profile-name { font: 700 30px/1.05 var(--font-title); letter-spacing: -.035em; }
.profile-meta { margin-top: 4px; font-size: 14.5px; color: var(--on-night-muted); }
.view-enter .profile-head .ring { animation: pop .55s var(--spring) both; }
.profile-about .chip { min-height: 32px; padding: 4px 12px; font-size: 13.5px; background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.profile-about .chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.profile-about .chip-priority::before { background: #FF7F81; }
.profile-about .chip-situation::before { background: #C4A3EC; }
.profile-empty { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--pill); border: 1.5px dashed rgba(255, 255, 255, .45); font-size: 14px; font-weight: 650; }
.profile-next { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .1); font-size: 14px; font-weight: 650; }
.profile-who .stage-line { margin-top: 8px; font-size: 15px; }
.profile-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.profile-foot:empty { display: none; }
.profile-brief { margin-left: auto; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }

/* Le plan : quatre étapes sur un fil, l'essentiel visible, le détail sous « Creuser ». */
.plan { display: flex; flex-direction: column; gap: 16px; }
.plan-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.plan-step:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 52px; bottom: -22px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 5px, transparent 5px 10px); }
.plan-num { width: 34px; height: 34px; margin-top: 14px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 2px var(--magenta); color: var(--magenta); font: 750 16px/1 var(--font-title); }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plan-kicker { font-size: 11.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); }
.plan-quote { margin: 0; font: 650 21px/1.25 var(--font-title); letter-spacing: -.02em; }
.plan-note { font-size: 14.5px; color: var(--muted); }
.view-enter .plan-step { animation: rise .55s var(--spring) both; }
.view-enter .plan-step:nth-child(2) { animation-delay: .06s; }
.view-enter .plan-step:nth-child(3) { animation-delay: .12s; }
.view-enter .plan-step:nth-child(4) { animation-delay: .18s; }

.plan-moves { display: flex; flex-direction: column; gap: 10px; }
.plan-move { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.plan-move .move-title { font-weight: 700; }
.plan-move .move-how { font-size: 14.5px; font-style: italic; }
.plan-move .move-why { font-size: 14.5px; color: var(--muted); }
.avoid { font-size: 14.5px; color: var(--muted); }
.avoid b { color: var(--ink); }

/* La mesure : son chiffre, son titre, pourquoi elle est là, et tout son programme. */
.measure-lead { padding-top: 22px; }
.measure-lead .measure-title { font-size: 20px; }
.chips-tight { gap: 6px; }
.chip-reason { min-height: 28px; padding: 3px 10px; font-size: 13px; font-weight: 650; background: var(--tint-violet); border-color: transparent; color: var(--violet); }
.program-count { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 4px; padding: 0 14px; border-radius: 16px; border: 1.5px solid var(--line-strong); font-size: 14.5px; font-weight: 650; }
.program-count[hidden] { display: none; }
.program-count b { margin-left: auto; font: 700 19px/1 var(--font-title); color: var(--magenta); }
.program-count .icon:first-child { color: var(--magenta); }
.dig-title { margin-top: 6px; font-size: 14px; font-weight: 650; }
.mini-list { border-radius: 16px; background: var(--bg); overflow: hidden; }
.mini-list li + li { border-top: 1px solid var(--line); }
.mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px; font-size: 15px; font-weight: 600; }
.mini-figure { flex: none; font: 700 15px/1 var(--font-title); color: var(--magenta); }
/* Sous « Creuser », les mesures du programme complet tiennent en trois lignes ; la page « Tout son programme » les donne en entier. */
.dig .program-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Ce qu'il risque de dire : la phrase visible, la réponse en la touchant. */
.claims { display: flex; flex-direction: column; gap: 8px; }
.claim { border-radius: 16px; background: var(--bg); }
.claim > summary { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 12px 12px 12px 14px; }
.claim-text { flex: 1; min-width: 0; font: 650 16.5px/1.3 var(--font-title); letter-spacing: -.01em; }
.claim-sign { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--magenta); font: 750 16px/1 var(--font-title); box-shadow: var(--shadow-1); transition: transform .35s var(--spring); }
.claim-sign::before { content: "?"; }
.claim[open] .claim-sign { transform: rotate(360deg); background: var(--magenta); color: #fff; }
.claim[open] .claim-sign::before { content: "!"; }
.claim-body { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 14px; animation: dig-in .3s var(--ease); }
.claim-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.plan-card.lesson-card { gap: 4px; transition: transform .25s var(--spring); }
.plan-card.lesson-card:active { transform: scale(.97); }
.lesson-meta { font-size: 13px; font-weight: 650; color: var(--muted); }

/* Vos échanges, tes notes. */
.notes { font-size: 15px; white-space: pre-line; }
.timeline { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline-item { position: relative; padding: 0 0 16px 18px; }
.timeline-item::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--magenta); }
.timeline-date { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.timeline-title { font-weight: 650; }
.timeline-text { font-size: 14.5px; color: var(--muted); font-style: italic; }
.page-relative { padding-top: 20px; }
.page-relative > .dig { margin-top: 4px; }

/* S'entraîner, le message. */
.training { display: flex; flex-direction: column; gap: 10px; }
.training-count { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.training-who { font-weight: 600; color: var(--muted); }
.training-claim { font: 650 22px/1.25 var(--font-title); letter-spacing: -.02em; }
.training-answer { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border-radius: var(--r); padding: 16px; animation: dig-in .3s var(--ease); }
.training-answer .label { font-size: 13px; font-weight: 650; color: var(--muted); margin-top: 6px; }
.training-answer .label:first-child { margin-top: 0; }
.message-text { font-size: 16px; min-height: 340px; }

/* Prêt à voter : une liste à cocher, chaque ligne avec son lien officiel. */
.vote-list { display: flex; flex-direction: column; padding: 4px 16px; }
.vote-item { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.vote-item + .vote-item { border-top: 1px solid var(--line); }
.vote-check { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0; border: 0; background: none; text-align: left; }
.vote-text { display: flex; flex-direction: column; gap: 1px; }
.vote-label { font-weight: 600; }
.vote-hint { font-size: 13px; color: var(--muted); }
.vote-item.is-done .vote-label { color: var(--muted); }
.vote-item .btn-sm { flex: none; align-self: center; min-height: 40px; min-width: 88px; }
/* « Préparer » : une carte plein écran à la fois, sur la matière sombre, comme une story. */
.brief { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 12px) var(--gutter) calc(var(--safe-bottom) + 16px); }
.brief-top { display: flex; flex-direction: column; gap: 8px; }
.brief-bars { display: flex; gap: 4px; }
.brief-bars span { position: relative; flex: 1; height: 3px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .22); }
.brief-bars span.is-done { background: #fff; }
.brief-bars span.is-current::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; animation: bar-fill .6s var(--ease) both; }
@keyframes bar-fill { from { transform: scaleX(0); } }
.brief-head { display: flex; align-items: center; justify-content: space-between; }
.brief-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.brief-head .icon-btn { color: #fff; }

.brief-card { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 18px; padding: 10vh 0 8vh; cursor: pointer; -webkit-user-select: none; user-select: none; }
.view-enter .brief-kicker, .view-enter .brief-body { animation: rise .55s var(--spring) both; }
.view-enter .brief-kicker { animation-delay: .1s; }
.view-enter .brief-body { animation-delay: .18s; }
.brief-kicker { margin-top: 8px; font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.brief-body { display: flex; flex-direction: column; gap: 14px; }
.brief-quote { margin: 0; font: 700 30px/1.15 var(--font-title); letter-spacing: -.03em; }
.brief-claim { font-size: 27px; }
.brief-figure { font: 700 88px/.9 var(--font-title); letter-spacing: -.05em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: brightness(1.55) saturate(1.1); }
.brief-figure-label { margin-top: -6px; font-size: 16px; font-weight: 600; color: var(--on-night-muted); }
.brief-title { font: 700 26px/1.15 var(--font-title); letter-spacing: -.025em; }
.brief-how { font-size: 20px; line-height: 1.35; font-style: italic; color: var(--on-night-muted); }
.brief-avoid { font-size: 15px; color: var(--on-night-muted); }
.brief-avoid b { color: #fff; }
.brief .chip-reason { background: rgba(255, 255, 255, .12); color: #fff; }
.brief-reveal { align-self: flex-start; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.brief-answer { padding: 16px 18px; border-radius: 20px; background: rgba(255, 255, 255, .1); font-size: 17px; line-height: 1.45; animation: pop .45s var(--spring) both; }
.brief .status { margin-top: 10px; color: var(--on-night-muted); border-color: transparent; background: rgba(255, 255, 255, .12); }
.brief-way { font-size: 16px; line-height: 1.45; color: var(--on-night-muted); }
.brief-way b { color: #fff; }
.brief-change { font-size: 17px; line-height: 1.45; color: var(--on-night-muted); }
.brief-change b { color: #fff; }
.brief-card .turtle-md .turtle-img { height: 112px; }
.brief-ready .brief-card { align-items: center; justify-content: center; text-align: center; }
.brief-ready .turtle { animation: float 4s ease-in-out infinite; }
.brief-ready .turtle-xl .turtle-img { height: 180px; }
.brief-ready .bubble { font-size: 18px; max-width: none; align-self: stretch; border-radius: 18px; }

.brief-nav { display: flex; gap: 10px; }
.brief-prev { width: 52px; padding: 0; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.brief-nav .btn-light { flex: 1; }
/* Le débrief. La conversation et les confettis sont dans styles/components.css. */
.page-chat { gap: 14px; }
.debrief-progress { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.debrief-progress .stage-line { font-size: 16px; }

/* L'écran de fin : sa pastille dont l'anneau se remplit, un titre, la tortue, le récapitulatif. */
.page-done { gap: 18px; }
.done-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 12px; }
.view-enter .done-hero .ring { animation: pop .55s var(--spring) both; }
.done-title { font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.done-hero .stage-line { font-size: 15px; }
.page-celebrate .done-hero, .page-celebrate .form-actions { position: relative; z-index: 31; }
/* Un réflexe, carte par carte. */
.lesson { gap: 14px; padding-bottom: calc(110px + var(--safe-bottom)); }
.lesson-progress { display: flex; gap: 4px; }
.lesson-progress span { flex: 1; height: 3px; border-radius: 3px; background: var(--line); }
.lesson-progress span.is-done { background: var(--black); }
.lesson-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 20px; font-size: 16px; line-height: 1.55; }
.lesson-h { font-size: 23px; font-weight: 700; letter-spacing: -.025em; }
.lesson-lead { font-size: 17px; font-weight: 500; }
.lesson-figure { font: 700 58px/1 var(--font-title); letter-spacing: -.05em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lesson-figure-label { font: 650 18px/1.3 var(--font-title); margin-top: -4px; }
.lesson-skill-big { font: 650 19px/1.3 var(--font-title); }
.lesson-nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: var(--max); z-index: 15;
  display: flex; gap: 10px; padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.lesson-nav .btn-secondary { width: 52px; padding: 0; }
.lesson-nav .btn-primary { flex: 1; }
.exchange { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--bg); }
.exchange-title { font-weight: 700; }
.exchange-note { font-size: 14.5px; color: var(--muted); }
.line { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface); max-width: 92%; font-size: 15px; }
.line span { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.line-me { align-self: flex-end; background: var(--violet); color: #fff; }
.line-me span { color: rgba(255, 255, 255, .72); }
.gestures { display: flex; flex-direction: column; gap: 12px; counter-reset: g; }
.gestures li { counter-increment: g; position: relative; padding-left: 38px; }
.gestures li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--black); color: #fff; display: grid; place-items: center; font: 700 13px/1 var(--font-title); }
.gestures p { font-size: 15px; color: var(--muted); }
/* La bibliothèque. */
.reflex-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); font: 700 13px/1 var(--font-title); color: var(--muted); }
.reflex-num.is-seen { border-color: var(--violet); color: var(--violet); }
.reflex-num.is-practiced { background: var(--black); border-color: var(--black); color: #fff; }
.program-list { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.program-list li { padding: 12px 16px 12px 30px; position: relative; font-size: 15px; }
.program-list li::before { content: ""; position: absolute; left: 14px; top: 21px; width: 6px; height: 6px; border-radius: 50%; background: var(--magenta); }
.program-list li + li { border-top: 1px solid var(--line); }
.program-list li.is-target { background: var(--tint-violet); }
.program-list a { display: flex; flex-direction: column; gap: 2px; }
.program-chapter { font-size: 12px; font-weight: 650; color: var(--muted); }

/* Les mouvements de la méthode, dépliables. */
.moves { display: flex; flex-direction: column; gap: 8px; }
.move details { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-1); padding: 12px 16px; }
.move summary { display: flex; flex-direction: column; gap: 2px; min-height: 40px; padding-right: 24px; position: relative; }
.move summary::after { content: ""; position: absolute; right: 2px; top: 10px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.move details[open] summary::after { transform: rotate(-135deg); top: 14px; }
.move-title { font-weight: 650; }
.move-how { font-size: 14.5px; color: var(--muted); }
.move details > p { margin-top: 10px; font-size: 15px; }
.move details > .source { margin-top: 6px; }

/* Une mesure et une riposte en entier. */
.measure-full { gap: 10px; }
.measure-full .measure-title { font-size: 24px; }
.rebuttal-claim { font: 650 18px/1.3 var(--font-title); letter-spacing: -.015em; }
.rebuttal-full { display: flex; flex-direction: column; gap: 10px; }
.rebuttal-full .rebuttal-claim { font-size: 24px; }
.ways { display: flex; flex-direction: column; gap: 12px; }
.ways li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.facts { display: flex; flex-direction: column; gap: 12px; }
