/**
 * ============================================================
 * PLATYPUS PENSÉES — une pensée par jour, une question
 * Même système que Flow et Memento :
 * jetons, en-tête, splash, cartes, boutons et liens secondaires repris tels quels.
 * ============================================================
 */

:root {
  --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);
}

*, *::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, textarea { font: inherit; color: inherit; }
::selection { background: rgba(196,113,74,0.22); }
input, textarea { caret-color: var(--terracotta-dk); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible + label, [tabindex]:focus-visible {
  outline: 2px solid var(--terracotta); outline-offset: 2px;
}

/* ============================================================
   SPLASH (comme Flow et Memento, sur un fond de crépuscule en papier)
   ============================================================ */
#splash {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 62%, rgba(212,135,106,0.38), transparent 70%),
    linear-gradient(170deg, #1a2010 0%, #2a2418 55%, #3b2a1a 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  padding: 0 1.5rem;
  z-index: 2000; cursor: pointer;
}
.splash-emblem {
  width: 96px; height: 96px; border-radius: 22px; overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}
.splash-emblem .vignette { width: 100%; height: 100%; border-radius: 0; }
.splash-title { font-family: var(--ff-display); font-size: clamp(2rem, 7vw, 3rem); font-weight: 300; letter-spacing: 0.05em; color: var(--cream); text-align: center; }
.splash-title em { font-style: italic; color: var(--terracotta-lt); }
.splash-sub { 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; 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 et Memento)
   ============================================================ */
.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: rgba(247,242,234,0.93);
  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; min-width: 44px; min-height: 44px; 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; }
.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; }
.header-back {
  font-size: var(--fs-meta); color: var(--text-muted); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; 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
   ============================================================ */
#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); }
.pile { display: flex; flex-direction: column; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================================================
   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);
}

.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; }

.vignette { display: block; flex-shrink: 0; width: 56px; height: 56px; border-radius: 9px; transition: transform 0.4s var(--ease-out-expo); }
.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; }
.source-note { margin-top: 8px; text-align: center; font-size: var(--fs-caps); line-height: 1.45; color: var(--text-muted); }

.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); font-weight: 400; 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, opacity 0.2s;
}
.icon-btn:hover { border-color: var(--terracotta); color: var(--terracotta-dk); }
.icon-btn:disabled { opacity: 0.3; cursor: default; border-color: rgba(74,55,40,0.2); color: var(--brown); }

.lien-discret {
  background: none; border: none; cursor: pointer; min-height: 44px; padding: 0 6px;
  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; }

.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);
}
.vide { text-align: center; }

/* ============================================================
   BIENVENUE (l'esprit, comme Memento)
   ============================================================ */
.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-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; }

/* ============================================================
   LE MOMENT DU JOUR
   ============================================================ */
.jour-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; }
.jour-date { text-align: center; display: flex; flex-direction: column; gap: 2px; }
#jour-date { font-size: var(--fs-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.jour-themes { font-family: var(--ff-display); font-style: italic; font-size: 1.05rem; color: var(--terracotta-dk); }

.citation {
  position: relative; text-align: center;
  padding: 26px 8px 8px;
  animation: eclore 1.2s var(--ease-silk);
}
@keyframes eclore { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.citation { touch-action: pan-y; transition: transform 0.3s var(--ease-silk), opacity 0.3s var(--ease-silk); }
.citation.depuis-droite { animation: glisser-d 0.6s var(--ease-silk); }
.citation.depuis-gauche { animation: glisser-g 0.6s var(--ease-silk); }
@keyframes glisser-d { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes glisser-g { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
.citation .vignette { width: 64px; height: 64px; border-radius: 12px; margin: 0 auto 22px; box-shadow: 0 8px 22px rgba(74,55,40,0.14); }
.citation blockquote {
  font-family: var(--ff-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 6.2vw, 1.85rem); line-height: 1.35;
  color: var(--brown); text-wrap: balance;
}
.citation blockquote.longue { font-size: clamp(1.3rem, 5.2vw, 1.5rem); }
.citation blockquote::before, .citation blockquote::after { color: var(--terracotta); font-style: normal; }
.citation blockquote::before { content: '«\202F'; }
.citation blockquote::after { content: '\202F»'; }
.citation blockquote.fait { font-style: normal; font-size: clamp(1.25rem, 5vw, 1.45rem); line-height: 1.45; text-wrap: pretty; }
.citation blockquote.fait::before, .citation blockquote.fait::after { content: none; }
.c-titre { font-family: var(--ff-display); font-size: 1.6rem; font-weight: 400; line-height: 1.25; color: var(--brown); margin: -6px 0 14px; text-wrap: balance; }
.citation blockquote.recit { max-width: 34em; margin: 0 auto; text-align: left; font-size: clamp(1.15rem, 4.6vw, 1.3rem); line-height: 1.55; hyphens: auto; }
.citation blockquote:lang(en)::before { content: '“'; }
.citation blockquote:lang(en)::after { content: '”'; }
.c-orig { margin-top: 10px; font-family: var(--ff-display); font-style: italic; font-size: 1.05rem; color: var(--text-muted); }
.citation figcaption { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#c-auteur { font-size: var(--fs-caps); letter-spacing: 0.18em; text-transform: uppercase; color: var(--terracotta-dk); }
#c-auteur::before { content: ''; display: block; width: 28px; height: 1px; background: var(--terracotta); margin: 0 auto 10px; opacity: 0.6; }
#c-oeuvre { font-family: var(--ff-display); font-style: italic; font-size: 1.1rem; color: var(--text-muted); text-wrap: balance; }
.c-eclairage { max-width: 34ch; margin: 16px auto 0; font-size: var(--fs-meta); line-height: 1.55; color: var(--text-muted); text-wrap: pretty; }
.c-eclairage::before { content: ''; display: block; width: 5px; height: 5px; margin: 0 auto 12px; border-radius: 50%; background: var(--sage); opacity: 0.75; }

.c-outils { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 2px; margin: 2px 0 2px; }
.outil {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 9px; white-space: nowrap;
  background: transparent; border: 1px solid transparent; border-radius: 20px; cursor: pointer;
  font-size: var(--fs-meta); color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.outil .icon { width: 16px; height: 16px; color: var(--terracotta); }
.outil:hover { color: var(--terracotta-dk); border-color: var(--sand); }
#btn-favori[aria-pressed="true"] { color: var(--terracotta-dk); }
#btn-favori[aria-pressed="true"] .icon { fill: var(--terracotta); }

/* D'où vient cette pensée ? */
.source { border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand); }
.source summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  font-family: var(--ff-display); font-style: italic; font-size: 1.1rem; color: var(--text-muted);
}
.source summary::-webkit-details-marker { display: none; }
.source summary .icon { color: var(--terracotta); width: 16px; height: 16px; }
.source summary:hover { color: var(--terracotta-dk); }
.source dl { padding: 4px 4px 14px; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: var(--fs-meta); line-height: 1.5; }
.source dt { color: var(--text-muted); letter-spacing: 0.04em; }
.source dd { color: var(--text); }
.source dd.note { grid-column: 1 / -1; font-family: var(--ff-display); font-style: italic; font-size: 1.05rem; line-height: 1.4; color: var(--brown); padding-top: 4px; border-top: 1px dashed var(--sand); }
.verif { display: inline-flex; align-items: center; gap: 6px; color: var(--sage-dk); }
.verif .icon { width: 14px; height: 14px; }

/* La question */
.question { margin-top: 8px; text-align: center; background: rgba(247,242,234,0.85); }
.question-texte {
  margin: 4px 0 4px;
  font-family: var(--ff-display); font-size: 1.45rem; line-height: 1.35; color: var(--brown); text-wrap: balance;
  transition: opacity 0.4s var(--ease-silk);
}
.question-texte.cache { opacity: 0; }
.note-field { text-align: left; margin: 14px 0 0; }
.field { display: flex; flex-direction: column; }
.field label { display: block; margin-bottom: 6px; font-size: var(--fs-meta); letter-spacing: 0.04em; color: var(--text-muted); }
.facultatif { opacity: 0.8; }
.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(255,253,249,0.7); 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; }
.field-hint { font-size: var(--fs-meta); color: var(--text-muted); margin-top: 6px; line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Écrire, puis garder : le geste qui clôt le moment */
.note-pied { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note-pied .field-hint { flex: 1; }
.note-garder {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  min-height: 44px; margin-top: 6px; padding: 0 16px;
  background: var(--brown); color: var(--cream); border: none; border-radius: 22px; cursor: pointer;
  font-family: var(--ff-display); font-size: 1.08rem; letter-spacing: 0.02em;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-out-expo);
  animation: apparaitre 0.4s var(--ease-out-expo);
}
.note-garder .icon { width: 16px; height: 16px; }
.note-garder:hover { background: var(--terracotta-dk); box-shadow: 0 4px 16px rgba(163,90,56,0.25); }
.note-garder:active { transform: scale(0.97); }
@keyframes apparaitre { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.note-posee { margin: 14px 0 0; padding: 18px 8px 4px; text-align: center; border-top: 1px solid var(--sand); animation: poser 0.7s var(--ease-out-expo); }
.note-posee-texte { font-family: var(--ff-display); font-style: italic; font-size: 1.2rem; line-height: 1.5; color: var(--brown); white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; }
.note-posee-etat { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: var(--fs-meta); color: var(--sage-dk); }
.note-posee-etat .icon { width: 15px; height: 15px; }
.note-posee-actions { display: flex; justify-content: center; gap: 14px; margin-top: 2px; }
@keyframes poser { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@media (max-width: 380px) {
  .note-pied { flex-direction: column; align-items: stretch; gap: 4px; }
  .note-garder { justify-content: center; }
}

.au-revoir { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 18px 0 6px; text-align: center; animation: poser 0.9s var(--ease-out-expo); }
.au-revoir .vignette { width: 48px; height: 48px; margin-bottom: 10px; box-shadow: 0 6px 16px rgba(74,55,40,0.16); }
.au-revoir-merci { font-family: var(--ff-display); font-size: 1.45rem; line-height: 1.3; color: var(--brown); }
.au-revoir-demain { font-family: var(--ff-display); font-style: italic; font-size: var(--fs-voice); color: var(--text-muted); }

/* Outils et source : une rangée discrète, après la question */
.apres-moment { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.apres-moment .c-outils { margin: 0; }
#btn-langue { opacity: 0.85; }

.astuce { text-align: center; font-size: var(--fs-meta); color: var(--text-muted); margin: -2px 0 0; animation: apparaitre 0.6s var(--ease-out-expo); }
#moment.premier-jour .jour-nav .icon-btn { visibility: hidden; }

.repli > summary { list-style: none; cursor: pointer; display: flex; justify-content: center; align-items: center; min-height: 44px; font-family: var(--ff-display); font-style: italic; font-size: 1.1rem; color: var(--terracotta-dk); }
.repli > summary::-webkit-details-marker { display: none; }
.repli > summary::after { content: ''; width: 7px; height: 7px; margin-left: 10px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.25s var(--ease-silk); }
.repli[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.repli[open] > .pile { margin-top: 6px; }

.reset-confirmer { text-align: center; animation: apparaitre 0.4s var(--ease-out-expo); }
.reset-confirmer > p { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-ui); color: var(--text); line-height: 1.5; }
.reset-actions { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 12px; }
.reset-oui { background: var(--terracotta-dk); margin-top: 0; }
.reset-oui:hover { background: var(--brown); }

.entree-statique { cursor: default; }
.entree-statique:hover { border-color: var(--sand); background: rgba(247,242,234,0.7); }
.entree-oeuvre { display: block; margin-top: 2px; font-family: var(--ff-display); font-style: italic; font-size: 1rem; color: var(--text-muted); }

/* ============================================================
   CARNET
   ============================================================ */
.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; line-height: 1.15; 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); }

.entree {
  display: block; width: 100%; text-align: left; cursor: pointer; color: inherit;
  background: rgba(237,228,212,0.6); border: 1px solid var(--sand); border-radius: 2px;
  padding: 14px 16px; transition: border-color 0.2s, background 0.2s;
}
.entree:hover { border-color: var(--terracotta); background: rgba(237,228,212,0.85); }
.entree-date { display: block; font-size: var(--fs-caps); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.entree-citation { display: block; margin-top: 6px; font-family: var(--ff-display); font-style: italic; font-size: 1.15rem; line-height: 1.35; color: var(--brown); }
.entree-citation.fait { font-style: normal; font-size: 1.05rem; }
.source dd a { color: var(--terracotta-dk); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.entree-auteur { display: block; margin-top: 4px; font-size: var(--fs-meta); color: var(--terracotta-dk); }
.entree-note { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--sand); font-size: var(--fs-ui); line-height: 1.55; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.entree-q { display: block; font-size: var(--fs-meta); color: var(--text-muted); margin-bottom: 4px; }

/* ============================================================
   RÉGLAGES
   ============================================================ */
.reglage { border: 1px solid var(--sand); min-width: 0; }
.reglage-titre { font-family: var(--ff-display); font-size: var(--fs-title); font-weight: 400; color: var(--brown); line-height: 1.3; padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.reglage-titre + * { clear: both; }
.card > p.reglage-aide, .reglage-aide { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-meta); line-height: 1.5; color: var(--text-muted); margin: 2px 0 12px; }
.segment + .reglage-aide { margin: 10px 0 0; }
.reglage-compte { min-height: 1.4em; margin-top: 10px; text-align: center; font-size: var(--fs-meta); color: var(--text-muted); }

.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.theme label {
  display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 10px;
  background: rgba(247,242,234,0.7); border: 1px solid var(--sand); border-radius: 2px;
  font-family: var(--ff-display); font-size: 1.08rem; line-height: 1.15; color: var(--text-muted);
  cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
}
.theme .vignette { width: 34px; height: 34px; border-radius: 7px; opacity: 0.55; filter: grayscale(0.5); transition: opacity 0.2s, filter 0.2s; }
.theme label:hover { border-color: var(--terracotta-lt); color: var(--brown); }
.theme input:checked + label { border-color: var(--terracotta); background: rgba(196,113,74,0.1); color: var(--brown); }
.theme input:checked + label .vignette { opacity: 1; filter: none; }
.theme input:focus-visible + label { outline: 2px solid var(--terracotta); outline-offset: 2px; }

.rappel-ligne { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin-bottom: 8px; }
.rappel-ligne label { font-family: var(--ff-display); font-size: 1.15rem; color: var(--brown); }
.rappel-ligne input {
  min-height: 44px; width: 100%;
  font-family: var(--ff-body); font-size: 1.1rem; color: var(--text); font-variant-numeric: tabular-nums;
  background: rgba(247,242,234,0.75); border: none; border-bottom: 1px solid #BBA98F; border-radius: 0; padding: 6px;
}
.rappel-ligne input:focus { outline: none; border-bottom-color: var(--terracotta-dk); background: #FEFCF8; box-shadow: 0 0 0 2px var(--terracotta-dk); border-radius: 2px; }
.rappel-etat { min-height: 1.4em; margin: 4px 0 12px; font-size: var(--fs-meta); line-height: 1.5; color: var(--sage-dk); }
.encart-ios {
  margin-bottom: 12px; padding: 10px 12px;
  border: 1px solid rgba(196,113,74,0.35); border-radius: 2px; background: rgba(196,113,74,0.06);
  font-size: var(--fs-meta); line-height: 1.55; color: var(--text);
}

/* ============================================================
   SOURCES
   ============================================================ */
.texte-long > p { font-family: var(--ff-body); font-style: normal; font-size: var(--fs-ui); line-height: 1.6; color: var(--text); margin-bottom: 10px; }
.texte-long h3, .sous-titre { font-family: var(--ff-display); font-size: 1.25rem; font-weight: 400; color: var(--brown); margin: 14px 0 6px; }
.sous-titre { text-align: center; margin: 16px 0 2px; text-wrap: balance; }
.niveaux { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-ui); line-height: 1.55; }
.niveaux strong { font-weight: 500; color: var(--sage-dk); }
.ecartee { padding: 14px 16px; border: 1px solid var(--sand); border-radius: 2px; background: rgba(247,242,234,0.7); }
.ecartee-texte { font-family: var(--ff-display); font-style: italic; font-size: 1.15rem; line-height: 1.35; color: var(--brown); }
.ecartee-texte s { text-decoration-color: rgba(148,80,47,0.5); }
.ecartee-attribuee { display: block; margin-top: 4px; font-size: var(--fs-meta); color: var(--terracotta-dk); }
.ecartee-verdict { margin-top: 8px; font-size: var(--fs-meta); line-height: 1.55; color: var(--text); }

/* ============================================================
   RESPIRATION (comme Memento)
   ============================================================ */
.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:
    radial-gradient(ellipse 70% 45% at 50% 50%, rgba(212,135,106,0.22), transparent 70%),
    linear-gradient(170deg, #1a2010 0%, #2a2418 55%, #3b2a1a 100%);
  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-meta); letter-spacing: 0.18em; text-transform: uppercase; color: rgba(247,242,234,0.78);
  border: 1px solid rgba(247,242,234,0.28); border-radius: 22px; padding: 0 20px;
}
.souffle-passer:hover { color: var(--cream); }

/* ============================================================
   PETITS ÉCRANS / MOUVEMENT
   ============================================================ */
@media (max-width: 380px) {
  .segment-3 label { font-size: 1rem; }
  .theme label { grid-template-columns: 28px 1fr; gap: 8px; padding: 8px; font-size: 1rem; }
  .theme .vignette { width: 28px; height: 28px; }
}
@media (max-width: 330px) {
  .themes { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .view, .toast, .citation, .citation.depuis-droite, .citation.depuis-gauche { animation: none; }
  .ring { display: none; }
  #splash.splash-out, .souffle { transition-duration: 0.01s; }
  .bubble { transition: transform 4s linear; }
  .question-texte { transition: none; }
  .note-garder, .note-posee, .au-revoir, .astuce, .reset-confirmer { animation: none; }
}
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}
