:root {
  --navy: #2c4a63;
  /* Contraste remonté le 2026-09-10 (0.6 -> 0.72) : le texte secondaire
     était trop proche du fond ("gris très proche du fond", retour
     utilisateur transmis par Rafael). Même bascule appliquée à toutes les
     valeurs rgba(44,74,99, x) utilisées comme couleur de texte dans
     src/screens/**. */
  --navy-soft: rgba(44, 74, 99, 0.8);
  --powder: #a9cbdc;
  --slate: #6f9db5;
  --bg: #eef1f3;
  --card: #f4f7f8;
  --white: #ffffff;
  --border: #e2e8ec;
  --amber: #c97b3f;
  --green: #3fa563;
  --danger: #b00020;

  /* Élévation : mêmes tons navy que le pitch deck, en beaucoup plus doux,
     pour donner de la profondeur sans jamais alourdir l'écran. */
  --shadow-sm: 0 2px 8px rgba(44, 74, 99, 0.08);
  --shadow-md: 0 8px 24px rgba(44, 74, 99, 0.12);
  --shadow-lg: 0 16px 40px rgba(44, 74, 99, 0.16);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Identité visuelle dédiée (direction "TOUJA — Direction visuelle") :
     s'ajoute aux tokens ci-dessus sans les remplacer. Utilisée d'abord sur
     l'Accueil A (voir HomeCreateV2.jsx) ; le reste de l'app garde sa
     palette --navy/--slate/--powder existante. */
  --touja-bleu-nuit: oklch(35% 0.06 230);
  --touja-bleu-ciel: oklch(70% 0.1 230);
  --touja-bleu-clair: oklch(92% 0.03 230);
  --touja-fond: oklch(98% 0.005 230);
  --touja-texte: oklch(22% 0.03 230);
}

/* Mode sombre : activé en posant la classe .dark-mode sur .touja-app
   (voir app.jsx, piloté par state.darkModeOn — Réglages > Mode sombre).
   Ne redéfinit que les tokens partagés par les composants CSS ci-dessous
   (boutons, cartes, champs, feuilles...) et l'Accueil A : la grande
   majorité des écrans du prototype utilisent des couleurs codées en dur
   dans leur JSX plutôt que ces variables, et ne changent donc pas encore
   d'apparence en mode sombre — un chantier à part, plus large. */
.touja-app.dark-mode {
  --bg: #1c1c1e;
  --card: #242426;
  --white: #2c2c2e;
  --border: rgba(255,255,255,0.12);
  --navy-soft: rgba(235,235,245,0.6);
  --touja-fond: oklch(20% 0.01 230);
  --touja-bleu-clair: oklch(28% 0.03 230);
  --touja-texte: oklch(94% 0.005 230);
}
.touja-app.dark-mode { background: #1c1c1e; }
.touja-app.dark-mode .screen { color: rgba(235,235,245,0.92); }
.touja-app.dark-mode .field-input { background: #242426; border-color: rgba(255,255,255,0.14); color: rgba(235,235,245,0.92); }
.touja-app.dark-mode .field-label { color: rgba(235,235,245,0.55); }
.touja-app.dark-mode .list-card { background: #242426; }
.touja-app.dark-mode .list-row:hover { background: #2c2c2e; }
.touja-app.dark-mode .choice-card { background: #242426; color: rgba(235,235,245,0.92); }
.touja-app.dark-mode .choice-card:hover { background: #2c2c2e; }
.touja-app.dark-mode .sheet-panel { background: #1c1c1e; color: rgba(235,235,245,0.92); }
.touja-app.dark-mode .back-btn { background: #242426; }
.touja-app.dark-mode .back-btn svg path { stroke: #fff; }

* { box-sizing: border-box; }

html, body {
  touch-action: manipulation; /* pas de double-tap pour zoomer */
  margin: 0;
  height: 100%;
  background: radial-gradient(120% 100% at 18% -10%, #f7f2fb 0%, #eef1f3 55%, #e7ebef 100%);
  font-family: 'Inter', sans-serif;
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}

#root { height: 100%; }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--slate); }

button { font-family: inherit; }

.touja-app {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  position: relative;
  overflow-x: hidden;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  box-sizing: border-box;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  animation: screen-enter 0.42s var(--ease-out) backwards;
}

.screen.no-pad-top { padding-top: env(safe-area-inset-top, 0px); }
.screen.scroll { overflow-y: auto; }

/* Transition d'entrée à chaque changement d'écran : c'est ce qui fait
   passer le prototype de "page web qui se recharge" à "appli qui navigue". */
@keyframes screen-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

.font-serif { font-family: 'Fraunces', serif; }

/* Typographie unique (décision Rafael du 10-10-2026) : Fraunces pour les
   titres, accroches et citations ; Inter pour le texte courant, l'interface,
   les légendes et les informations fonctionnelles. Ces deux classes
   historiques de l'Accueil A pointent désormais sur ces deux mêmes polices. */
.font-touja-serif { font-family: 'Fraunces', serif; }
.font-touja-sans { font-family: 'Inter', sans-serif; }

.back-btn {
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  padding: 0;
  transition: transform .15s var(--ease-out), background .15s ease;
}
.back-btn:hover { background: var(--border); }
.back-btn:active { transform: scale(0.88); }

.pill-btn {
  cursor: pointer;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  background: var(--navy);
  border: none;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), opacity .15s ease;
}
.pill-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pill-btn:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sm); }
.pill-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }
.pill-btn.secondary { background: #3f7391; }
.pill-btn.powder { background: var(--powder); color: var(--navy); }

.list-card {
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.list-row {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  position: relative;
  font-size: 15px;
  cursor: pointer;
}
.list-row:hover { background: var(--card); }
.list-row + .list-row::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 0;
  height: 0.5px;
  background: rgba(60,60,67,0.12);
}

.choice-card {
  cursor: pointer;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--card);
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
  border: 1.5px solid transparent;
  line-height: 1.4;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s ease;
}
.choice-card:hover { background: #eef3f6; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.choice-card:active { transform: translateY(0) scale(0.98); }
.choice-card.selected {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: var(--shadow-md);
}

.live-banner {
  box-shadow: 0 6px 20px rgba(44, 74, 99, 0.28);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.live-banner:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(44, 74, 99, 0.34); }
.live-banner:active { transform: translateY(0) scale(0.98); }

.home-card {
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.home-card[data-clickable="true"]:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.home-card[data-clickable="true"]:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sm); }

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.quiz-progress-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--slate);
  border-radius: 10px;
  transition: width .2s ease;
}
.quiz-progress-label {
  font-size: 11.5px;
  color: var(--navy-soft);
  flex-shrink: 0;
}

.field-input {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--navy);
  width: 100%;
  font-family: inherit;
  background: #fff;
}
.field-input:focus { outline: 2px solid var(--slate); outline-offset: 1px; }
.field-label {
  font-size: 12px;
  color: rgba(44,74,99,0.8);
  margin-bottom: 6px;
  font-weight: 600;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,30,40,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet-panel {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 26px 24px calc(env(safe-area-inset-bottom, 0px) + 30px);
  box-sizing: border-box;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto;
}

.toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background .15s ease;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left .15s ease;
}

@keyframes touja-halo { 0%, 100% { transform: scale(0.94); opacity: 0.7; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes touja-breathe { 0%, 100% { transform: scale(1); opacity: 0.92; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes touja-blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.8; } }

/* Mode appel (Appel.jsx) : logo qui pulse selon l'état de la conversation
   vocale, mêmes rythmes que le mockup visuel validé par Rafael (voir Project
   "Touja - Mode Appel"), plus deux anneaux concentriques qui respirent autour
   (.touja-call-ring), présents dans les trois états. */
@keyframes touja-call-ring { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.16); opacity: 0.12; } }
.touja-call-ring { animation: touja-call-ring 2.4s ease-in-out infinite; }
@keyframes touja-call-orb-listening { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes touja-call-orb-thinking { 0%, 100% { transform: scale(0.97) rotate(0deg); } 50% { transform: scale(1.08) rotate(6deg); } }
@keyframes touja-call-orb-speaking { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.14); } 50% { transform: scale(0.96); } 75% { transform: scale(1.1); } }
.touja-call-orb-listening { animation: touja-call-orb-listening 2.4s ease-in-out infinite; }
.touja-call-orb-thinking { animation: touja-call-orb-thinking 1.6s ease-in-out infinite; }
.touja-call-orb-speaking { animation: touja-call-orb-speaking 0.9s ease-in-out infinite; }

.no-scrollbar::-webkit-scrollbar { display: none; }

.dev-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 240px;
  background: #fff;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px;
  font-size: 12px;
  z-index: 999;
  display: none;
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .dev-nav { display: block; }
  body.dev-nav-open .touja-app { margin-right: 240px; }
}
.dev-nav-item {
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--navy);
}
.dev-nav-item:hover { background: var(--bg); }
.dev-nav-item.active { background: var(--navy); color: #fff; }
.dev-nav-group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(44,74,99,0.7);
  margin: 14px 0 4px;
  padding: 0 10px;
}

.time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 84px;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  cursor: grab;
  margin: 0;
}
.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: grab;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.time-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: grab;
}
.time-slider::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: var(--border);
}

/* Feedback à l'envoi d'un message (chat) : la bulle qu'on vient d'envoyer
   apparaît avec un léger scale-in plutôt que brute — ChatCollecte.jsx et
   ChatLive.jsx appliquent cette classe uniquement à la bulle "user" qui
   vient d'être ajoutée (jamais rejouée aux re-renders suivants puisque le
   nœud DOM, keyé par index stable, n'est pas recréé). */
@keyframes message-send {
  from { opacity: 0; transform: scale(0.96) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.message-bubble--sent { animation: message-send 150ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .message-bubble--sent { animation: none; }
}

/* Accordéon (Où vivent tes souvenirs, etc.) : chevron qui pivote à
   l'ouverture plutôt qu'un changement brut d'icône. */
.accordion-chevron { transition: transform .2s var(--ease-out); }
.accordion-chevron.open { transform: rotate(90deg); }


/* Accessibilité (QA 09-10) : focus clavier visible partout, boutons natifs
   sans habillage par défaut quand on les utilise comme zones tactiles. */
:focus-visible { outline: 3px solid #3f7391; outline-offset: 2px; border-radius: 6px; }
.field-input:focus-visible { outline: 3px solid #3f7391; }
button.reset-btn { background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Taille du texte (Réglages > Taille du texte) : zoom CSS sur toute l'app. */
.touja-app.text-large { zoom: 1.15; }
.touja-app.text-xl { zoom: 1.3; }
.touja-app.text-large, .touja-app.text-large .screen { min-height: calc(100dvh / 1.15); }
.touja-app.text-xl, .touja-app.text-xl .screen { min-height: calc(100dvh / 1.3); }

/* ───── Accueil A (refonte 2026-10-10) ─────
   Fond bleu très clair, bloc principal bleu nuit, tuiles crème / bleu clair,
   barre d'onglets en bas. Textes ≥ 4.5:1 sur leurs fonds. */
.touja-app {
  --home-bg: #f2f6fb;
  --home-text: #12304d;
  --home-sub: #4a5f78;
  --home-hero: #12304d;
  --home-cream: #fbf5ea;
  --home-blue: #e1ecf8;
  --home-pill: #ffffff;
  --home-amber: #d9962b;
  --home-line: rgba(18, 48, 77, 0.10);
  
  
}
.touja-app.dark-mode {
  --home-bg: #15191f;
  --home-text: #eef3f9;
  --home-sub: #aab8c9;
  --home-hero: #1d3a58;
  --home-cream: #2a2620;
  --home-blue: #1f2b3a;
  --home-pill: #2f3a49;
  --home-line: rgba(255,255,255,0.12);
  
  
}

button.home-roundbtn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: var(--home-blue); color: var(--home-text);
  display: flex; align-items: center; justify-content: center;
}
.home-roundbtn__dot {
  position: absolute; top: 9px; right: 10px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--home-amber); border: 2px solid var(--home-blue);
  box-sizing: content-box;
}

button.home-hero {
  position: relative; display: block; width: 100%; box-sizing: border-box;
  margin-top: 22px; padding: 20px 20px 22px; border-radius: 24px;
  background: var(--home-hero); color: #ffffff; text-align: left;
  box-shadow: 0 10px 28px rgba(18, 48, 77, 0.28);
  overflow: hidden;
}
.home-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 0 0 28px rgba(255,255,255,0.025), 0 0 0 56px rgba(255,255,255,0.02);
  pointer-events: none;
}
.home-hero__head { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.home-hero__icon {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255,255,255,0.14); display: flex; align-items: center; justify-content: center;
}
.home-hero__title { font-size: 22px; line-height: 1.2; font-weight: 600; color: #ffffff; }
.home-hero__quote {
  position: relative; z-index: 1; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 4; overflow: hidden; margin: 16px 56px 0 0;
  font-style: italic; font-weight: 400; font-size: 16px; line-height: 1.5;
  color: rgba(255,255,255,0.92);
}
.home-hero__count { position: relative; z-index: 1; display: block; margin-top: 12px; font-size: 13px; color: rgba(255,255,255,0.78); }
.home-hero__go {
  position: absolute; right: 18px; bottom: 18px; z-index: 1; width: 44px; height: 44px; border-radius: 50%;
  background: #ffffff; display: flex; align-items: center; justify-content: center;
}

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
button.home-tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  gap: 14px; box-sizing: border-box; min-height: 148px; padding: 16px 14px 14px;
  border-radius: 22px; text-align: left; color: var(--home-text);
}
button.home-tile--cream { background: var(--home-cream); }
button.home-tile--blue { background: var(--home-blue); }
.home-tile__icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--home-pill);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(18, 48, 77, 0.08);
}
.home-tile__text { display: flex; flex-direction: column; gap: 4px; padding-right: 22px; }
.home-tile__label { font-size: 17px; line-height: 1.2; font-weight: 600; color: var(--home-text); }
.home-tile__sub { font-size: 13px; line-height: 1.35; color: var(--home-sub); }
.home-tile__chev, .home-tile__lock { position: absolute; right: 12px; display: flex; color: var(--home-text); }
.home-tile__chev { bottom: 14px; }
.home-tile__lock { top: 14px; color: var(--home-sub); }

.home-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 12px 12px 12px 18px; border-radius: 20px;
  background: var(--home-cream); color: var(--home-text);
}
.home-banner__text { font-size: 15px; line-height: 1.35; font-weight: 500; min-width: 0; }
button.home-banner__btn {
  flex-shrink: 0; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--home-hero); color: #ffffff; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.dark-mode .home-banner__btn { background: #3a5f86; }


/* Chat d'accueil (ChatCollecte.jsx) : le document est figé, rien ne bouge
   quand on tire la page vers le bas, et le fond est exactement celui de
   l'écran pour que la barre d'état (et son dégradé iOS) se fonde dedans. */
html.chat-lock, html.chat-lock body {
  overflow: hidden;
  overscroll-behavior: none;
  background: #e7eef3;
}
html.chat-lock { height: var(--chat-h, 100%); }
html.chat-lock body {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--chat-h, 100%);
}
html.chat-lock .touja-app {
  height: var(--chat-h, 100%);
  min-height: 0;
  overflow: hidden;
  background: #e7eef3;
}


/* iOS 26 : l'app installée (écran d'accueil) affiche un flou/dégradé « scroll edge »
   sous la barre d'état. WebKit ne l'applique pas quand le bord haut de l'écran est
   couvert par un élément fixe, pleine largeur, de fond opaque. On pose donc une fine
   bande fixe de fond opaque mais qui ne peint rien (background-clip:text sans texte) :
   invisible, sans effet sur les clics, uniquement en mode app installée. */
#ios-top-edge { display: none; }
@media (display-mode: standalone) {
  #ios-top-edge {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 12px;
    z-index: 2147483647;
    pointer-events: none;
    background-color: #ffffff;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ===== Version web (2026-10-30) =====
   Même app, mise en page large avec menu latéral (ordinateur). Actif quand
   .touja-app porte .web-layout (voir src/app.jsx) et que la fenêtre fait au
   moins 761 px ; en dessous, retour à la colonne "app". */
.view-toggle-float { display: none; }
.view-toggle-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 22px; background: #fff; color: #2c4a63; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(44,74,99,0.18); box-shadow: 0 2px 10px rgba(44,74,99,0.12);
}
.view-toggle-btn:hover { background: #f0f5f8; }
@media (min-width: 900px) {
  .view-toggle-float { display: block; position: fixed; top: 16px; right: 20px; z-index: 60; }
}
.web-side { display: none; }
@media (min-width: 761px) {
  .touja-app.web-layout { max-width: none; margin: 0; background: #eef3f6; }
  .web-frame { display: flex; width: 100%; min-height: 100vh; min-height: 100dvh; }
  .web-side {
    display: flex; flex-direction: column; width: 270px; flex-shrink: 0; box-sizing: border-box;
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    background: #fff; color: #2c4a63; border-right: 1px solid rgba(44,74,99,0.1); padding: 22px 14px 18px;
  }
  .web-side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
  .web-side-nav { display: flex; flex-direction: column; gap: 4px; }
  .web-side-sep { height: 1px; background: rgba(44,74,99,0.1); margin: 12px 8px; }
  .web-side-item {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px;
    border: none; background: transparent; border-radius: 12px; cursor: pointer; text-align: left;
    font-family: inherit; font-size: 15px; font-weight: 500; color: #2c4a63;
  }
  .web-side-item:hover { background: rgba(44,74,99,0.07); }
  .web-side-item.active { background: rgba(44,74,99,0.12); font-weight: 600; }
  .web-side-foot { margin-top: auto; padding: 18px 4px 0; }
  .web-side-foot .view-toggle-btn { width: 100%; justify-content: center; box-shadow: none; }
  .web-main { flex: 1; min-width: 0; position: relative; }
  /* Écrans pas encore adaptés : colonne centrée à droite du menu. */
  .web-main.is-column { display: flex; justify-content: center; }
  .web-main.is-column > .screen {
    max-width: 640px; width: 100%; box-shadow: 0 0 0 1px rgba(44,74,99,0.07), 0 8px 30px rgba(44,74,99,0.06);
    padding-bottom: 40px !important;
  }
  /* Chat d'accueil : toute la hauteur et toute la largeur ; le contenu est centré. */
  .web-main.is-chat > .screen {
    max-width: none; width: 100%; height: 100vh !important; height: 100dvh !important;
    min-height: 100dvh !important; max-height: 100dvh !important; transform: none !important;
  }
  .web-layout .chat-pad { padding-left: max(16px, calc((100% - 800px) / 2)) !important; padding-right: max(16px, calc((100% - 800px) / 2)) !important; }
  .web-layout .touja-bottomnav { display: none !important; }
  html.chat-lock:has(.touja-app.web-layout), html.chat-lock:has(.touja-app.web-layout) body { height: 100% !important; }
  html.chat-lock:has(.touja-app.web-layout) body { position: static !important; overflow: auto !important; }
  html.chat-lock .touja-app.web-layout { height: auto !important; min-height: 100dvh; overflow: visible !important; background: #eef3f6; }
  .touja-app.dark-mode .web-side { background: #1c1c1e; color: rgba(235,235,245,0.92); border-right-color: rgba(255,255,255,0.1); }
  .touja-app.dark-mode .web-side-item { color: rgba(235,235,245,0.92); }
  .touja-app.dark-mode .web-side-item:hover, .touja-app.dark-mode .web-side-item.active { background: rgba(255,255,255,0.1); }
}

/* Version web : pages "Une photo, un souvenir" et "Messages pour plus tard"
   (2026-10-30). Les pages marquées .web-wide ont une colonne plus large. */
@media (min-width: 761px) {
  .web-main.is-column > .screen.web-wide { max-width: 1040px; padding-left: 40px !important; padding-right: 40px !important; }
  /* Une photo, un souvenir : photo à gauche, description et envoi à droite. */
  .web-layout .pm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
  .web-layout .pm-left > div:first-child { margin-top: 0 !important; }
  .web-layout .pm-right > div:first-child { margin-top: 12px !important; }
  .web-layout .pm-right textarea.field-input { min-height: 220px; font-size: 15px !important; padding: 14px 16px !important; border-radius: 16px !important; }
  .web-layout .pm-right select { font-size: 14px !important; padding: 8px 12px !important; }
  /* Messages pour plus tard : messages sur deux colonnes. */
  .web-layout .lw-list { display: grid !important; grid-template-columns: 1fr 1fr; gap: 14px !important; }
  .web-layout .lw-list .lw-empty { grid-column: 1 / -1; }
}

/* Version web : "Mon reflet" (Historique) et "Mes proches" (2026-10-30). */
@media (min-width: 761px) {
  .web-layout .mc-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; align-items: start; }
  .web-layout .mr-avatars { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px !important; }
  .web-layout .mr-avatars > div { width: auto !important; background: #f4f7f8; border-radius: 16px; padding: 18px 8px 14px; }
  .web-layout .mr-avatars > div > div:last-child { font-size: 14px !important; font-weight: 600; }
  .web-layout .mr-groups { display: grid !important; grid-template-columns: 1fr 1fr; gap: 14px !important; align-items: start; }
  .web-layout .mr-groups > :last-child { grid-column: 1 / -1; }
}

/* Version web : Paramètres et Notifications (2026-10-30). */
@media (min-width: 761px) {
  .web-layout .st-grid, .web-layout .nt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; align-items: start; }
  .web-layout .st-right > div:first-child, .web-layout .nt-right > div:first-child { margin-top: 0 !important; }
  .web-layout .st-left > div:first-child { margin-bottom: 20px !important; }
  .web-layout .nt-grid .nt-left > div:first-child { margin-top: 22px !important; }
  .web-layout .nt-right > div:first-child { margin-top: 22px !important; }
}

/* Version web : pages restantes (2026-10-30). */
@media (min-width: 761px) {
  /* Pages formulaire et détail : colonne centrée un peu plus large. */
  .web-main.is-column > .screen:not(.web-wide) { max-width: 700px; }
  .web-layout .hs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; align-items: start; }
  .web-layout .hs-right > div:first-child { margin-top: 22px !important; }
  .web-layout .gt-list, .web-layout .gm-list { display: grid !important; grid-template-columns: 1fr 1fr; gap: 16px !important; align-items: start; }
  .web-layout .mo-list { display: grid !important; grid-template-columns: 1fr 1fr; gap: 14px !important; }
  .web-layout .mm-grid { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 36px; align-items: start; flex: none !important; }
  .web-layout .mm-left { grid-column: 1; grid-row: 1; }
  .web-layout .mm-right { grid-column: 2; grid-row: 1 / span 2; }
  .web-layout .mm-cta { grid-column: 1; grid-row: 2; align-self: start; }
  .web-layout .mm-grid > div[style*="flex: 1"] { display: none; }
  .web-layout .mm-right > div:first-child { margin-top: 26px !important; }
}

/* ===== Frise chronologique de "Mon reflet" (2026-10-29) ===== */
.tl-switch { display: flex; gap: 4px; margin-top: 16px; padding: 4px; background: #eef3f6; border-radius: 999px; }
.tl-switch button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: rgba(44,74,99,0.78); cursor: pointer; }
.tl-switch button.on { background: #2c4a63; color: #fff; }
.tl-root { margin-top: 18px; position: relative; }
.tl-note { font-size: 14px; line-height: 1.5; color: rgba(44,74,99,0.85); padding: 6px 2px 12px; }
.tl-retry { margin-top: 8px; display: inline-block; cursor: pointer; font-weight: 600; color: #2c4a63; border: 1px solid rgba(44,74,99,0.3); border-radius: 999px; padding: 7px 14px; font-size: 12.5px; }
.tl-tray { background: #f4f7f8; border: 2px dashed rgba(44,74,99,0.22); border-radius: 14px; padding: 12px 12px 12px; }
.tl-tray.is-over { border-color: #c97b3f; background: #fbf1e8; }
.tl-tray-head { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: rgba(44,74,99,0.78); }
.tl-hint { font-size: 12.5px; line-height: 1.45; color: rgba(44,74,99,0.72); margin-top: 6px; }
.tl-tray-row { display: flex; gap: 10px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.tl-card { position: relative; background: #fff; border: 1px solid rgba(44,74,99,0.14); border-radius: 12px; padding: 11px 13px; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 1px 2px rgba(44,74,99,0.06); }
.tl-card.in-tray { flex: 0 0 200px; }
.tl-card.is-dragging { opacity: 0.35; }
.tl-card-season { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; color: #c97b3f; text-transform: uppercase; }
.tl-card-title { font-size: 14px; font-weight: 600; color: #2c4a63; line-height: 1.3; }
.tl-card-sum { font-size: 12.5px; line-height: 1.45; color: rgba(44,74,99,0.78); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-place-btn { margin-top: 8px; min-height: 36px; padding: 0 16px; border: 1px solid rgba(44,74,99,0.3); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #2c4a63; cursor: pointer; }
.tl-track { display: flex; flex-direction: column; margin-top: 20px; }
.tl-decade { position: relative; padding: 0 0 22px 22px; border-left: 2px solid rgba(44,74,99,0.2); margin-left: 6px; }
.tl-decade:last-child { border-left-color: transparent; }
.tl-decade-h { position: relative; font-size: 18px; font-weight: 700; color: #2c4a63; }
.tl-dot { position: absolute; left: -31px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #2c4a63; border: 3px solid #fff; box-sizing: border-box; }
.tl-years { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.tl-year { position: relative; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; background: #eef3f6; font-size: 13px; font-weight: 600; color: rgba(44,74,99,0.8); font-variant-numeric: tabular-nums; }
.tl-year.has { background: #dbe9f1; color: #2c4a63; }
.tl-year i { font-style: normal; font-size: 10.5px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px; background: #2c4a63; color: #fff; }
.tl-year.off { opacity: 0.35; }
.tl-year.is-over { background: #c97b3f; color: #fff; transform: scale(1.06); }
.tl-evs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.tl-ygroup { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tl-ygroup-h { font-size: 13px; font-weight: 700; color: #c97b3f; }
.tl-ghost { position: fixed; z-index: 9999; width: 160px; padding: 10px 12px; border-radius: 12px; background: #2c4a63; color: #fff; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.tl-ghost .tl-card-title { color: #fff; }
.tl-ghost-year { margin-top: 4px; font-size: 12px; font-weight: 700; color: #f6c9a3; }
.is-dragging-any, .is-dragging-any * { cursor: grabbing !important; }
.tl-year-input { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; min-height: 48px; padding: 0 14px; border: 1px solid rgba(44,74,99,0.25); border-radius: 12px; font: inherit; font-size: 18px; color: #2c4a63; background: #fff; }
.tl-seasons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tl-season { min-height: 40px; padding: 0 14px; border: 1px solid rgba(44,74,99,0.25); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: #2c4a63; cursor: pointer; }
.tl-season.on { background: #2c4a63; color: #fff; border-color: #2c4a63; }

/* Version web : frise horizontale (2026-10-29) */
.web-layout .tl-tray-row { flex-wrap: wrap; overflow-x: visible; }
.web-layout .tl-card.in-tray { flex: 0 0 240px; }
.web-layout .tl-track { flex-direction: row; overflow-x: auto; align-items: flex-start; padding-top: 14px; padding-bottom: 10px; gap: 0; }
.web-layout .tl-decade { flex: 0 0 300px; border-left: 0; border-top: 2px solid rgba(44,74,99,0.2); margin-left: 0; padding: 22px 18px 0 0; }
.web-layout .tl-decade:last-child { border-top-color: transparent; }
.web-layout .tl-dot { left: 0; top: -31px; margin-top: 0; }
.web-layout .tl-decade-h { }
.web-layout .tl-year { cursor: pointer; }
.tl-year[data-year] { cursor: pointer; }
.tl-year[data-year]:hover { background: #cfe0ea; }
.tl-text-input { display: block; width: 100%; box-sizing: border-box; margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(44,74,99,0.25); border-radius: 12px; font: inherit; font-size: 16px; line-height: 1.45; color: #2c4a63; background: #fff; resize: vertical; }

/* ===== Paiement et codes (2026-11-01) ===== */
.pay-wrap { max-width: 560px; }
.pay-apply { min-height: 48px; padding: 0 18px; border: 1px solid rgba(44,74,99,0.3); border-radius: 12px; background: #fff; font: inherit; font-size: 14.5px; font-weight: 600; color: #2c4a63; cursor: pointer; }
.pay-apply:disabled { opacity: 0.45; cursor: default; }

/* Photos / vidéos dans la frise et bouton "ne pas placer" (2026-11-01) */
.tl-thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; margin-bottom: 8px; background: #e7eef3; }
.tl-thumb img, .tl-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tl-sheet-media { width: 100%; max-height: 240px; border-radius: 12px; overflow: hidden; margin-bottom: 12px; background: #e7eef3; display: flex; justify-content: center; }
.tl-sheet-media img, .tl-sheet-media video { max-width: 100%; max-height: 240px; object-fit: contain; display: block; }
.tl-aside { margin-top: 12px; }
.tl-aside-toggle { min-height: 40px; font-size: 13.5px; font-weight: 600; color: #2c4a63; text-decoration: underline; cursor: pointer; }
.tl-aside-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(44,74,99,0.1); }
.tl-aside-title { font-size: 13.5px; color: rgba(44,74,99,0.85); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-aside-btn { flex-shrink: 0; min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; color: #2c4a63; border: 1px solid rgba(44,74,99,0.3); border-radius: 999px; cursor: pointer; }

/* ===== Pages d'accueil de début de compte en version web (2026-11-04) =====
   Écran partagé en deux : bandeau de marque à gauche, page à droite. Actif
   quand .touja-app porte .pub-web (voir src/app.jsx) et fenêtre >= 761 px. */
.pub-side { display: none; }
@media (min-width: 761px) {
  .touja-app.pub-web { max-width: none; margin: 0; background: #fff; }
  .pub-frame { display: flex; width: 100%; min-height: 100vh; min-height: 100dvh; }
  .pub-side {
    display: flex; flex-direction: column; justify-content: center; flex: 0 0 42%; max-width: 640px;
    box-sizing: border-box; padding: 56px 64px; position: sticky; top: 0; height: 100vh; height: 100dvh;
    background: #2c4a63; color: #fff;
    background-image: radial-gradient(circle at 20% 15%, rgba(169,203,220,0.22) 0%, rgba(169,203,220,0) 55%);
  }
  .pub-side-title { height: 30px; width: auto; display: block; margin-top: 22px; align-self: flex-start; }
  .pub-side-tag { font-family: 'Fraunces', Georgia, serif; font-size: 36px; line-height: 1.2; font-weight: 600; margin-top: 56px; }
  .pub-side-sub { font-size: 16px; line-height: 1.55; margin-top: 16px; max-width: 380px; color: rgba(255,255,255,0.86); }
  .pub-main { flex: 1; min-width: 0; display: flex; justify-content: center; background: #fff; }
  .pub-main > .screen { background: #fff !important; }
  .pub-main > .screen:not(.scroll) { justify-content: center; }
  .pub-main > .screen { max-width: 520px; width: 100%; padding-left: 40px !important; padding-right: 40px !important; }
}
