/**
 * ============================================================
 * PLATYPUS MEMENTO — Memento Mori & Vivere
 * Même système que Platypus Flow (flow.platypus-coaching.fr) :
 * jetons, en-tête, splash, cartes, boutons et liens secondaires repris tels quels.
 * ============================================================
 */

:root {
  /* Jetons de Flow. Les deux teintes utilisées en TEXTE (terracotta foncé, brun secondaire)
     sont un peu assombries pour rester lisibles (contraste ≥ 4,5:1) aussi sur les cartes beiges. */
  --brown: #4A3728;
  --terracotta: #C4714A;
  --terracotta-lt: #d4876a;
  --terracotta-dk: #94502F;
  --cream: #F7F2EA;
  --beige: #EDE4D4;
  --sand: #D9CCBA;
  --sage: #7A8C6E;
  --sage-dk: #56664B;
  --text: #2C1F14;
  --text-muted: #5C4C3D;
  --night: #1a2010;

  --fs-display: 2.25rem;
  --fs-title: 1.375rem;
  --fs-voice: 1.22rem;
  --fs-ui: 1rem;
  --fs-meta: 0.8125rem;
  --fs-caps: 0.75rem;

  --ff-display: 'Cormorant Garamond', serif;
  --ff-body: 'DM Sans', sans-serif;
  --ease-silk: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Grille : une couleur par état, partout (grille, légende, image partagée) */
  --g-past:    var(--sage);
  --g-present: var(--terracotta-dk);
  --g-future:  rgba(196,113,74,0.16);
  --g-future-line: rgba(163,90,56,0.28);
  --g-after:   rgba(122,140,110,0.10);
  --g-after-line: rgba(94,110,83,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body {
  background-color: var(--cream);
  color: var(--text);
  font-family: var(--ff-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
::selection { background: rgba(196,113,74,0.22); }
input { caret-color: var(--terracotta-dk); }
.card:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible + label, #grid:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--terracotta); outline-offset: 2px;
}

/* ============================================================
   SPLASH (comme Flow)
   ============================================================ */
#splash {
  position: fixed; inset: 0;
  background: url('img/fond-memento.jpg') center / cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  z-index: 2000; cursor: pointer;
}
#splash-overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(26,32,16,0.82) 0%, rgba(26,32,16,0.65) 100%); }
.splash-emblem {
  position: relative; z-index: 2;
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(247,242,234,0.3);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}
.splash-emblem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.splash-title { position: relative; z-index: 2; font-family: var(--ff-display); font-size: clamp(2rem, 7vw, 3rem); font-weight: 300; letter-spacing: 0.05em; color: var(--cream); }
.splash-title em { font-style: italic; color: var(--terracotta-lt); }
.splash-sub { position: relative; z-index: 2; text-align: center; line-height: 1.4; font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); color: rgba(247,242,234,0.65); letter-spacing: 0.03em; }
.splash-hint {
  position: absolute; z-index: 2; bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1rem));
  font-size: var(--fs-caps); color: rgba(247,242,234,0.7); letter-spacing: 0.2em; text-transform: uppercase;
}
#splash.splash-out { opacity: 0; pointer-events: none; transition: opacity 0.9s var(--ease-silk); }

/* ============================================================
   EN-TÊTE (identique à Flow)
   ============================================================ */
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(0.9rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) 0.9rem max(1.5rem, env(safe-area-inset-left));
  background: linear-gradient(rgba(247,242,234,0.93), rgba(247,242,234,0.93)), url('img/fond-memento.jpg') center / cover no-repeat;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(196,113,74,0.15);
  position: sticky; top: 0; z-index: 100;
}
.header-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.header-logo img { height: 26px; width: auto; }
.header-logo-name { font-family: var(--ff-display); font-size: 1.15rem; font-weight: 400; letter-spacing: 0.03em; color: var(--brown); }
.header-logo-name span { color: var(--terracotta-dk); }
.header-center { text-align: center; flex: 1; }
.header-center h1 { font-family: var(--ff-display); font-size: clamp(1.1rem, 3vw, 1.6rem); font-weight: 300; color: var(--brown); line-height: 1.1; transition: opacity 0.5s var(--ease-silk); }
.header-center h1 em { font-style: italic; color: var(--terracotta-dk); }
.header-center p { font-size: var(--fs-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.1rem; transition: opacity 0.5s var(--ease-silk); }
.header-center .fondu { opacity: 0; }
.header-back {
  font-size: var(--fs-meta); color: var(--text-muted); text-decoration: none;
  padding: 0.5rem 0; border-bottom: 1px solid transparent; white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.header-back:hover { color: var(--terracotta); border-color: var(--terracotta); }
@media (max-width: 380px) { .header-back { display: none; } }
@media (max-width: 600px) {
  .app-header { padding: max(0.7rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.7rem max(1rem, env(safe-area-inset-left)); }
  .header-logo-name { display: none; }
  .header-center h1 { font-size: 1.25rem; }
}

/* ============================================================
   COLONNE (comme Flow, un peu plus large pour la grille)
   ============================================================ */
#app { width: 100%; display: flex; flex-direction: column; align-items: center; }
.app-card { width: 90%; max-width: 440px; padding: 1.5rem 0 max(2.5rem, env(safe-area-inset-bottom)); }
.view { display: flex; flex-direction: column; gap: 10px; animation: fadeIn 0.4s var(--ease-silk); }
#vivere-contenu, #vivere-resultats, #resultats, .formulaire { display: flex; flex-direction: column; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.status {
  font-family: var(--ff-display); font-style: italic; color: var(--text-muted);
  font-size: var(--fs-voice); letter-spacing: 0.04em; text-align: center; margin-bottom: 8px;
}

/* ============================================================
   CARTES, ENCADRÉS, BOUTONS (Flow)
   ============================================================ */
.card {
  background: rgba(237,228,212,0.6);
  border: 1px solid var(--sand);
  border-radius: 2px;
  padding: 15px 18px;
  text-align: left;
}
.card h2, .program-title {
  font-family: var(--ff-display); font-size: var(--fs-title); font-weight: 400;
  letter-spacing: 0.02em; color: var(--brown); line-height: 1.3; margin-bottom: 4px;
}
.card > p { font-family: var(--ff-display); font-style: italic; color: var(--text-muted); font-size: var(--fs-voice); line-height: 1.4; }

.program {
  text-align: left;
  padding: 18px 18px 16px;
  border: 1px solid rgba(196,113,74,0.45);
  border-radius: 2px;
  background: rgba(247,242,234,0.7);
}
.program-text { font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); line-height: 1.45; color: var(--text-muted); margin: 8px 0 14px; }

.primary-btn {
  display: block; width: 100%;
  background: var(--brown); color: var(--cream);
  border: none; border-radius: 2px; padding: 14px;
  font-family: var(--ff-display); font-size: 1.15rem; font-weight: 400; letter-spacing: 0.03em;
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.primary-btn:hover { background: var(--terracotta-dk); box-shadow: 0 4px 20px rgba(163,90,56,0.28); }
.primary-btn:disabled { background: var(--sand); color: var(--brown); cursor: not-allowed; box-shadow: none; }

/* Vignettes papier découpé (comme les cartes d'exercices de Flow) */
.vignette { display: block; flex-shrink: 0; width: 56px; height: 56px; border-radius: 9px; transition: transform 0.4s var(--ease-out-expo); }

.card-suite {
  position: relative;
  display: grid; grid-template-columns: 56px 1fr 18px; column-gap: 14px; align-items: center;
  width: 100%; cursor: pointer; color: inherit; font: inherit;
  border-color: rgba(196,113,74,0.45);
  transition: border-color 0.25s, background 0.25s, transform 0.2s;
}
.card-suite .vignette { grid-row: 1 / span 2; }
.card-suite h2 { grid-column: 2; align-self: end; margin: 0; }
.card-suite p { grid-column: 2; align-self: start; font-family: var(--ff-display); font-style: italic; color: var(--text-muted); font-size: 1.1rem; line-height: 1.35; }
.card-fleche { grid-column: 3; grid-row: 1 / span 2; color: var(--terracotta); }
.card-suite:hover { border-color: var(--terracotta); background: rgba(237,228,212,0.85); }
.card-suite:hover .vignette { transform: scale(1.04); }
.card-suite:active { transform: scale(0.98); }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.secondary-links { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.reminder-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 10px;
  background: transparent; border: none;
  color: var(--text-muted);
  font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); letter-spacing: 0.03em;
  cursor: pointer; transition: color 0.2s;
}
.reminder-link .icon { width: 17px; height: 17px; color: var(--terracotta); }
.reminder-link:hover { color: var(--terracotta-dk); }
.note-confid { text-align: center; font-size: var(--fs-meta); color: var(--text-muted); margin-top: 4px; }

.view-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 8px; }
.view-head-title { font-family: var(--ff-display); font-size: var(--fs-title); color: var(--brown); line-height: 1.3; text-align: center; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(74,55,40,0.2);
  color: var(--brown); cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--terracotta); color: var(--terracotta-dk); }

.toast {
  position: fixed; left: 50%; bottom: max(1.2rem, calc(env(safe-area-inset-bottom) + 0.6rem));
  transform: translateX(-50%); z-index: 3000;
  width: max-content; max-width: calc(100% - 32px);
  padding: 10px 16px;
  background: var(--brown); color: var(--cream); border-radius: 2px;
  font-size: var(--fs-meta); line-height: 1.45;
  box-shadow: 0 6px 24px rgba(44,31,20,0.25);
  animation: fadeIn 0.4s var(--ease-silk);
}

/* ============================================================
   PRINCIPES
   ============================================================ */
.principes-devise {
  font-family: var(--ff-display); font-style: italic; font-size: 1.35rem; line-height: 1.35;
  color: var(--terracotta-dk); margin: 6px 0 16px;
}
.principes-liste { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-bottom: 14px; counter-reset: esprit; }
.principes-liste li { position: relative; padding-left: 34px; font-size: var(--fs-ui); line-height: 1.55; color: var(--text); counter-increment: esprit; }
.principes-liste li::before {
  content: counter(esprit); position: absolute; left: 0; top: 2px;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-caps); color: var(--cream); background: var(--terracotta-dk);
}
.principes-mot { display: block; font-size: var(--fs-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--terracotta-dk); margin-bottom: 2px; }
.principes-liste strong { display: block; font-family: var(--ff-display); font-size: 1.25rem; font-weight: 400; line-height: 1.3; color: var(--brown); margin-bottom: 2px; }
.principes-note { font-size: var(--fs-meta); line-height: 1.5; color: var(--text-muted); margin-bottom: 12px; }
.principes-soin {
  font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); line-height: 1.4;
  color: var(--terracotta-dk); text-align: center; text-wrap: balance;
  border-top: 1px solid var(--sand); padding-top: 12px; margin-bottom: 14px;
}

/* ============================================================
   FORMULAIRE
   ============================================================ */
.choix { border: none; min-width: 0; margin: 4px 0 10px; }
.choix legend, .field label {
  display: block; margin-bottom: 6px;
  font-size: var(--fs-meta); letter-spacing: 0.04em; color: var(--text-muted);
}
.formulaire > .choix legend { width: 100%; text-align: center; }
.facultatif { opacity: 0.8; }
.segment { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.segment-3 { grid-template-columns: repeat(3, 1fr); }
.segment input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segment label {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 4px 8px;
  border: 1px solid var(--sand); border-radius: 2px;
  background: rgba(247,242,234,0.7);
  font-family: var(--ff-display); font-size: 1.1rem; color: var(--text-muted); text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.segment label:hover { border-color: var(--terracotta-lt); color: var(--brown); }
.segment input:checked + label { border-color: var(--terracotta); background: rgba(196,113,74,0.1); color: var(--terracotta-dk); }
.segment-mini label { min-height: 36px; font-family: var(--ff-body); font-size: var(--fs-meta); padding: 2px 10px; }

.personne h2 { margin-bottom: 10px; }
.field { display: flex; flex-direction: column; margin-bottom: 12px; }
.field input {
  width: 100%; min-height: 44px;
  font-family: var(--ff-body); font-size: var(--fs-ui); color: var(--text);
  background: rgba(247,242,234,0.75);
  border: none; border-bottom: 1px solid #BBA98F; border-radius: 0;
  padding: 8px 6px;
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s, background 0.2s;
}
.field input:focus { outline: none; border-bottom-color: var(--terracotta-dk); background: #FEFCF8; box-shadow: 0 1px 0 0 var(--terracotta-dk); }
.field input::placeholder { color: var(--text-muted); opacity: 0.9; font-style: italic; }
.field input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; cursor: pointer; }
.field input[aria-invalid="true"] { border-bottom-color: var(--terracotta-dk); box-shadow: 0 1px 0 0 var(--terracotta-dk); }
.field-hint { font-size: var(--fs-meta); color: var(--text-muted); margin-top: 4px; }
.form-error {
  padding: 10px 14px; border: 1px solid rgba(163,90,56,0.45); border-radius: 2px;
  background: rgba(196,113,74,0.08); color: var(--terracotta-dk);
  font-size: var(--fs-ui); line-height: 1.45;
}

/* ============================================================
   RÉSULTATS (bilan de Flow)
   ============================================================ */
.bilan-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 12px 0; text-align: center;
  border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand);
}
.bilan-stats p { font-size: var(--fs-meta); line-height: 1.35; color: var(--text-muted); }
.bilan-stats strong {
  display: block;
  font-family: var(--ff-display); font-weight: 400; font-size: var(--fs-display); line-height: 1.1;
  color: var(--terracotta-dk); font-variant-numeric: lining-nums tabular-nums;
}
.temps-reel { text-align: center; font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); color: var(--text-muted); margin: 2px 0 4px; }
#stat-pct { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-ui); color: var(--terracotta-dk); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============================================================
   GRILLE
   ============================================================ */
.grille-carte { padding: 15px 14px 12px; }
.grille-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grille-tete h2 { margin: 0; }
.grille-aide { font-family: var(--ff-display); font-style: italic; color: var(--text-muted); font-size: 1.1rem; line-height: 1.35; margin: 8px 0 10px; }

.grille {
  --cols: 52;
  display: grid;
  grid-template-columns: 1.4rem repeat(var(--cols), minmax(0, 1fr));
  gap: 1px;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
  cursor: crosshair;
}
.grille.annees { --cols: 10; gap: 4px; max-width: 340px; margin: 0 auto; grid-template-columns: 1.8rem repeat(var(--cols), minmax(0, 1fr)); }
.grille .lbl {
  font-size: 0.6875rem; line-height: 0; align-self: center;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
  text-align: right; padding-right: 0.3rem; white-space: nowrap;
}
.grille.annees .lbl { line-height: 1; }
.c { aspect-ratio: 1; min-width: 0; }
.grille.annees .c { border-radius: 1px; }
.c.past    { background: var(--g-past); }
.c.present { background: var(--g-present); box-shadow: 0 0 0 1px var(--cream), 0 0 0 2px var(--g-present); position: relative; z-index: 1; animation: maintenant 2.4s ease-in-out infinite; }
.c.future  { background: var(--g-future); box-shadow: inset 0 0 0 0.5px var(--g-future-line); }
.c.after   { background: var(--g-after); box-shadow: inset 0 0 0 0.5px var(--g-after-line); }
.c.vise    { outline: 2px solid var(--brown); outline-offset: 1px; position: relative; z-index: 2; }
@keyframes maintenant { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.grille-lecture { min-height: 2.9em; margin-top: 10px; text-align: center; font-family: var(--ff-display); font-size: 1.15rem; line-height: 1.3; color: var(--brown); text-wrap: balance; }
.grille-lecture small { display: block; font-family: var(--ff-body); font-size: var(--fs-meta); color: var(--text-muted); margin-top: 2px; }
.legende {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--sand);
  font-size: var(--fs-meta); color: var(--text-muted);
}
.source-note, .card > p.source-note { font-family: var(--ff-body); font-style: normal; margin-top: 8px; text-align: center; font-size: var(--fs-caps); line-height: 1.45; color: var(--text-muted); }
.duo-seul { display: none; }
body.duo .duo-seul { display: inline; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { display: inline-block; width: 10px; height: 10px; }
.legende .past    { background: var(--g-past); }
.legende .present { background: var(--g-present); }
.legende .future  { background: var(--g-future); box-shadow: inset 0 0 0 1px var(--g-future-line); }
.legende .after   { background: var(--g-after); box-shadow: inset 0 0 0 1px var(--g-after-line); }

/* ============================================================
   VIVERE
   ============================================================ */
.vide { text-align: center; }
.vide p { margin-bottom: 14px; }
.citation { text-align: center; padding: 10px 6px 4px; }
.citation blockquote { font-family: var(--ff-display); font-style: italic; font-size: 1.45rem; line-height: 1.4; color: var(--brown); text-wrap: balance; }
.citation figcaption { margin-top: 8px; font-size: var(--fs-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.horizon { text-align: center; font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); color: var(--text-muted); margin-bottom: 6px; text-wrap: balance; }
.horizon strong { font-style: normal; font-weight: 400; color: var(--terracotta-dk); }

.domaine { border: none; min-width: 0; margin-top: 16px; }
.domaine legend { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-family: var(--ff-display); font-size: 1.25rem; color: var(--brown); }
.domaine legend .vignette { width: 44px; height: 44px; border-radius: 8px; }
.select-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.select-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.select-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  min-height: 46px; padding: 10px 14px;
  background: rgba(237,228,212,0.6); border: 1px solid var(--sand); border-radius: 2px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.select-label:hover { border-color: var(--terracotta-lt); }
.select-title { font-family: var(--ff-display); font-size: 1.15rem; color: var(--brown); }
.select-sub { font-size: var(--fs-meta); color: var(--text-muted); text-align: right; }
.select-input:checked + .select-label { border-color: var(--terracotta); background: rgba(196,113,74,0.1); }
.select-input:checked + .select-label .select-title { color: var(--terracotta-dk); }
.select-input:focus-visible + .select-label { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.reste-a-choisir { min-height: 1.4em; margin: 14px 0 8px; text-align: center; font-size: var(--fs-meta); color: var(--text-muted); }

.avertissement { font-size: var(--fs-meta) !important; font-family: var(--ff-body) !important; font-style: normal !important; line-height: 1.5 !important; margin: 4px 0 6px; }

/* Leviers */
.levier { display: grid; grid-template-columns: 48px 1fr; gap: 0 14px; padding: 14px 0; border-bottom: 1px solid var(--sand); }
.levier:last-child { border-bottom: none; padding-bottom: 2px; }
.levier > .vignette { width: 48px; height: 48px; border-radius: 8px; margin-top: 2px; }
.levier-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.levier-nom { font-family: var(--ff-display); font-size: 1.2rem; font-weight: 400; color: var(--brown); }
.statut { font-size: var(--fs-meta); letter-spacing: 0.06em; white-space: nowrap; }
.statut.weak { color: var(--terracotta-dk); }
.statut.medium { color: var(--brown); }
.statut.good, .statut.optimal { color: var(--sage-dk); }
.levier-niveau { font-family: var(--ff-display); font-style: italic; color: var(--text-muted); font-size: 1.1rem; }
.levier-texte { margin-top: 4px; font-size: var(--fs-ui); line-height: 1.55; color: var(--text); }
.levier-science { margin-top: 6px; font-size: var(--fs-meta); line-height: 1.5; color: var(--text-muted); }

/* Questions */
.q-bloc { padding: 12px 0 14px; border-bottom: 1px solid var(--sand); }
.q-bloc:last-child { border-bottom: none; padding-bottom: 2px; }
.q-domaine { display: flex; align-items: center; gap: 8px; color: var(--terracotta-dk); font-size: var(--fs-meta); letter-spacing: 0.06em; }
.q-domaine .vignette { width: 28px; height: 28px; border-radius: 6px; }
.q { margin-top: 10px; }
.q-type { display: block; font-size: var(--fs-meta); letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 2px; }
.q-texte { font-family: var(--ff-display); font-size: 1.25rem; line-height: 1.35; color: var(--brown); text-wrap: pretty; }
.q-action { margin-top: 6px; padding: 8px 12px; background: rgba(247,242,234,0.8); border-radius: 2px; font-size: var(--fs-ui); line-height: 1.5; color: var(--text); }
.q-universelle { text-align: center; }
.q-universelle .q-texte { font-style: italic; color: var(--terracotta-dk); text-wrap: balance; }

/* Portrait */
.resume-intro { font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); line-height: 1.45; color: var(--text-muted); margin: 8px 0 12px; }
.resume-bloc { margin-top: 12px; }
.resume-label { display: block; font-size: var(--fs-meta); letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 4px; }
.resume-etes { display: block; font-family: var(--ff-display); font-size: var(--fs-display); line-height: 1.1; color: var(--terracotta-dk); font-variant-numeric: lining-nums tabular-nums; }
.resume-etes + span { font-family: var(--ff-display); font-style: italic; color: var(--text-muted); font-size: 1.1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 2px; font-size: var(--fs-meta); border: 1px solid var(--sand); background: rgba(247,242,234,0.8); }
.tag .icon { width: 15px; height: 15px; }
.tag.priorite { color: var(--terracotta-dk); border-color: rgba(196,113,74,0.45); }
.tag.force { color: var(--sage-dk); border-color: rgba(122,140,110,0.5); }
.resume-fin { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sand); font-family: var(--ff-display); font-style: italic; font-size: 1.15rem; line-height: 1.4; color: var(--text-muted); }
.cta .primary-btn { margin-top: 12px; }
/* Paragraphe long : en romain, plus lisible que l'italique fin */
.card.cta > p { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-ui); line-height: 1.6; color: var(--text); }

/* Citations : une par visite sur l'accueil de Vivere, une par porte, une sur la grille */
.citation-porte { text-align: center; padding: 4px 8px 2px; }
.citation-porte blockquote { font-family: var(--ff-display); font-style: italic; font-size: 1.2rem; line-height: 1.4; color: var(--brown); text-wrap: balance; }
.citation-porte figcaption { margin-top: 6px; font-size: var(--fs-caps); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.citation-porte cite, .citation cite { font-style: italic; text-transform: none; letter-spacing: 0.02em; }

/* ============================================================
   VIVERE — ACCUEIL ET PORTES
   ============================================================ */
.pile { display: flex; flex-direction: column; gap: 10px; }
.portes { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 6px; }
.pivot {
  text-align: center; font-family: var(--ff-display); font-size: 1.4rem; line-height: 1.35;
  color: var(--brown); text-wrap: balance; margin: 2px 0 8px;
}
.pivot strong { font-weight: 400; color: var(--terracotta-dk); }
.reste-ecrire { white-space: nowrap; }
#stat-reste { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-ui); color: var(--sage-dk); font-variant-numeric: tabular-nums; }

.checkin .program-text { margin-bottom: 12px; }
.checkin-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.lien-discret {
  background: none; border: none; cursor: pointer; min-height: 36px; padding: 0 4px;
  font-size: var(--fs-meta); color: var(--text-muted); text-decoration: underline; text-decoration-color: var(--sand); text-underline-offset: 0.2em;
}
.lien-discret:hover { color: var(--terracotta-dk); text-decoration-color: currentColor; }

/* Ceux que j'aime */
.proche-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.proche-tete h2 { margin: 0; }
.card > p.proche-chiffre { font-family: var(--ff-display); font-style: normal; font-size: 1.35rem; color: var(--brown); margin-top: 4px; }
.proche-chiffre strong { font-weight: 400; font-size: var(--fs-display); color: var(--terracotta-dk); font-variant-numeric: lining-nums tabular-nums; }
.card > p.proche-detail { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-meta); line-height: 1.5; color: var(--text-muted); margin-top: 2px; }
.card > p.proche-plus { font-size: 1.1rem; margin: 8px 0 12px; }
.proche-plus strong { font-style: normal; font-weight: 400; color: var(--sage-dk); }
.frequence { display: grid; grid-template-columns: 64px auto 1fr; align-items: center; gap: 8px; }
.frequence > input {
  min-height: 44px; width: 100%; text-align: center;
  font-family: var(--ff-body); font-size: var(--fs-ui);
  background: rgba(247,242,234,0.75); border: none; border-bottom: 1px solid #BBA98F; border-radius: 0;
}
.frequence > input:focus { outline: none; border-bottom-color: var(--terracotta-dk); background: #FEFCF8; }
.frequence > span { font-size: var(--fs-meta); color: var(--text-muted); }
.frequence .segment { grid-column: 1 / -1; }
.frequence .segment label { font-size: 1rem; padding: 4px; }

/* Ce qui me fait vibrer */
.prochaine { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin: 0 0 10px; }
.prochaine label { font-size: var(--fs-meta); color: var(--text-muted); }
.prochaine input {
  min-height: 44px; width: 100%;
  font-family: var(--ff-body); font-size: var(--fs-ui); color: var(--text);
  background: rgba(247,242,234,0.75); border: none; border-bottom: 1px solid #BBA98F; border-radius: 0; padding: 6px;
}
.prochaine input:focus { outline: none; border-bottom-color: var(--terracotta-dk); background: #FEFCF8; }
.card > p.prochaine-note { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-meta); color: var(--sage-dk); margin: -4px 0 10px; }

/* Mori : la fierté */
.fierte .program-text { margin-bottom: 4px; }
.fierte .reminder-link { padding-left: 0; }
.fierte .resume-texte { margin-top: 2px; }
.fierte-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: var(--fs-meta); color: var(--text-muted); }
.fierte .field { margin-top: 8px; }
.fierte input[type="month"] {
  width: 100%; min-height: 44px;
  font-family: var(--ff-body); font-size: var(--fs-ui); color: var(--text);
  background: rgba(247,242,234,0.75); border: none; border-bottom: 1px solid #BBA98F; border-radius: 0; padding: 8px 6px;
}
.c.fier { background: var(--brown); box-shadow: 0 0 0 1px var(--cream), 0 0 0 2px var(--brown); position: relative; z-index: 1; }
.legende .fier { background: var(--brown); }

/* Ce qui me pèse */
.field textarea {
  width: 100%; resize: vertical; min-height: 88px;
  font-family: var(--ff-display); font-size: 1.15rem; line-height: 1.45; color: var(--text);
  background: rgba(247,242,234,0.75); border: 1px solid #BBA98F; border-radius: 2px; padding: 10px 12px;
}
.field textarea:focus { outline: none; border-color: var(--terracotta-dk); background: #FEFCF8; box-shadow: 0 0 0 1px var(--terracotta-dk); }
.field textarea::placeholder { color: var(--text-muted); opacity: 0.9; font-style: italic; }
.perspective canvas { display: block; width: 100%; height: auto; margin-top: 10px; }
.card > p.q-intro { margin-bottom: 6px; }
.dix { list-style: none; counter-reset: dix; display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.dix li { counter-increment: dix; position: relative; padding-left: 30px; font-family: var(--ff-display); font-size: 1.25rem; line-height: 1.3; color: var(--brown); }
.dix li::before {
  content: counter(dix); position: absolute; left: 0; top: 0.1em;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--ff-body); font-size: var(--fs-caps); color: var(--cream); background: var(--terracotta);
}
.dix strong { font-weight: 400; color: var(--terracotta-dk); }
.poids { list-style: none; margin-top: 4px; }
.poids li { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--sand); }
.poids li:last-child { border-bottom: none; padding-bottom: 0; }
.poids-date { font-size: var(--fs-meta); color: var(--text-muted); white-space: nowrap; }
.poids-texte { font-family: var(--ff-display); font-style: italic; font-size: 1.15rem; color: var(--brown); overflow-wrap: anywhere; }
.poids li > button, .poids-etat { grid-column: 2; justify-self: start; }
.poids-etat { font-size: var(--fs-meta); color: var(--sage-dk); }
.poids li.passe .poids-texte { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(107,91,74,0.4); }

/* Ce que je choisis */
.choix-legende { font-size: var(--fs-meta); color: var(--text-muted); margin: 2px 0 8px; }
.idees { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.idee {
  min-height: 40px; padding: 6px 12px;
  background: rgba(247,242,234,0.8); border: 1px solid var(--sand); border-radius: 2px; cursor: pointer;
  font-family: var(--ff-display); font-size: 1.05rem; color: var(--brown); text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.idee:hover { border-color: var(--terracotta); background: rgba(196,113,74,0.08); }

/* Portrait */
.resume-liste { list-style: none; }
.resume-liste li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--sand); font-family: var(--ff-display); font-size: 1.15rem; color: var(--brown); }
.resume-liste li:last-child { border-bottom: none; }
.resume-liste li span:last-child { font-family: var(--ff-body); font-size: var(--fs-meta); color: var(--terracotta-dk); white-space: nowrap; font-variant-numeric: tabular-nums; }
.resume-texte { font-family: var(--ff-display); font-style: italic; font-size: 1.15rem; line-height: 1.4; color: var(--brown); }
.resume-note { font-size: var(--fs-meta); color: var(--sage-dk); margin-top: 4px; }

/* ============================================================
   RESPIRATION (couleurs du splash de Flow)
   ============================================================ */
.souffle {
  --s-text: #F2EADD; --s-bubble: var(--terracotta-lt); --s-ring: rgba(242,234,221,0.18);
  position: fixed; inset: 0; z-index: 1500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem;
  padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
  background: linear-gradient(160deg, rgba(26,32,16,0.82) 0%, rgba(26,32,16,0.65) 100%), var(--night) url('img/fond-memento.jpg') center / cover no-repeat;
  color: var(--s-text);
  opacity: 0; transition: opacity 0.9s var(--ease-silk);
}
.souffle.visible { opacity: 1; }
.visualizer { position: relative; width: min(66vw, 280px); aspect-ratio: 1; display: grid; place-items: center; }
.visualizer > * { grid-area: 1 / 1; }
.ring { border-radius: 50%; border: 1px solid var(--s-ring); }
.r1 { width: 40%; height: 40%; }
.r2 { width: 62%; height: 62%; opacity: 0.7; }
.r3 { width: 84%; height: 84%; opacity: 0.45; }
.bubble {
  width: 26%; height: 26%; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #ecc2a8 0%, var(--s-bubble) 62%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: transform 4s ease-in-out;
}
.bubble.inspire { transform: scale(2.6); }
.phase { font-family: var(--ff-display); font-style: italic; font-size: clamp(1.6rem, 6vw, 2.1rem); min-height: 1.5em; text-align: center; transition: opacity 0.8s var(--ease-silk); }
.phase.cache { opacity: 0; }
.souffle-passer {
  margin-top: 1rem; min-height: 44px; padding: 0 12px;
  background: none; border: none; cursor: pointer;
  font-size: var(--fs-caps); letter-spacing: 0.2em; text-transform: uppercase; color: rgba(247,242,234,0.7);
}
.souffle-passer:hover { color: var(--cream); }

/* ============================================================
   PETITS ÉCRANS / MOUVEMENT
   ============================================================ */
@media (max-width: 380px) {
  .bilan-stats strong { font-size: 1.8rem; }
  .segment-3 label { font-size: 1rem; }
  .grille { grid-template-columns: 1.2rem repeat(var(--cols), minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .view, .toast { animation: none; }
  .c.present { animation: none; }
  .ring { display: none; }
  #splash.splash-out, .souffle { transition-duration: 0.01s; }
  .bubble { transition: transform 4s linear; }
}
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}
