/* Entre nous : feuille de style
   Direction : courrier par avion. Encre marine, papier froid,
   liseré rouge et bleu réservé aux lettres (question et réponses). */

:root {
  --ink: #1c2a4a;
  --paper: #f3f5f8;
  --sheet: #ffffff;
  --muted: #58647a;
  --line: #d5dbe5;
  --air-red: #c63b3b;
  --air-blue: #2d5da8;
  --focus: #2d5da8;
  --danger: #a62c2c;
  /* Fond des boutons qui n'engagent rien encore. */
  --doux: #dfe7f4;

  /* Accusé de lecture, quand l'autre a lu sans réagir. */
  --vert-lu: #1d6b3a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6eaf2;
    --paper: #111827;
    --sheet: #1a2335;
    --muted: #a3adbf;
    --line: #2d3850;
    --air-red: #d65252;
    --air-blue: #5b8ad6;
    --focus: #8fb2ea;
    --danger: #e27b7b;
    --doux: #27344d;
    /* Éclairci pour garder le même contraste que sur papier clair. */
    --vert-lu: #5fb584;
  }
}

*, *::before, *::after { box-sizing: inherit; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ---------- En-tête ---------- */

.top {
  margin-bottom: 2rem;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* « Réglages », en haut de chaque écran d'usage. */
.btn-reglages {
  flex: none;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-reglages:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.brand {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0;
}

.brand-home { display: inline-block; border-radius: 8px; }
.brand-home:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.brand-stamp {
  display: block;
  width: 146px;
  height: auto;
  margin: 0 0 0.9rem;
  transform: rotate(-4deg);
}

.signature {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 3rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--muted);
}

.heart-mini { width: 14px; height: auto; flex: none; }

.top .btn-link { white-space: nowrap; }

/* Le pigeon-timbre des écrans d'accueil, posé légèrement de biais. */
.hero-lien {
  display: block;
  width: 128px;
  margin: 0 0 1.25rem;
  border-radius: 8px;
  transform: rotate(-3deg);
}
.hero-lien:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.hero {
  display: block;
  width: 128px;
  height: auto;
}

.brand-with {
  display: block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted);
}

/* ---------- Titres et textes ---------- */

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.5rem; }

p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }

/* ---------- Liseré par avion ---------- */

.airmail {
  padding: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--air-red) 0 12px,
    var(--sheet) 12px 18px,
    var(--air-blue) 18px 30px,
    var(--sheet) 30px 36px
  );
  border-radius: 6px;
}

.sheet {
  background: var(--sheet);
  border-radius: 3px;
  padding: 1.5rem 1.25rem;
}

/* ---------- Carte question ---------- */

.question-meta {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.question {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 0 0 1.25rem;
}

.question-done { margin: 0; }

/* La catégorie, en étiquette : on la remarque, et elle aide à comprendre la question. */
.question-etiquette {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin: 0 0 1rem;
  background: var(--air-blue);
  color: #fff;
}

.question-qui { font-weight: 700; }

.status {
  margin: 0;
  color: var(--muted);
}

/* .status n'a pas de marge basse : sans ça le bouton qui le suit colle au
   texte, sur l'écran de lecture comme ailleurs. */
.sheet .status + p { margin-top: 1rem; }

/* ---------- Formulaires ---------- */

.stack > * + * { margin-top: 1rem; }

label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"], input[type="password"], input[type="email"], input[type="date"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
}

textarea {
  min-height: 9rem;
  resize: vertical;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
}

.hint { font-size: 0.875rem; color: var(--muted); margin-top: 0.35rem; }

.error {
  color: var(--danger);
  font-size: 0.9375rem;
  margin: 0.75rem 0 0;
}

.error:empty { display: none; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper);
}

.btn[disabled] { opacity: 0.55; cursor: progress; }
/* Un lien habillé en bouton ne doit pas garder son soulignement. */
a.btn { text-decoration: none; }

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.btn-light { background: #ffffff; color: #1c2a4a; }

/* Proposer de passer n'engage rien tant que l'autre n'a pas répondu : le
   bouton pèse donc moins que celui qui envoie la lettre, sans changer de
   taille. */
.btn-doux { background: var(--doux); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Onglets connexion ---------- */

.tabs { display: flex; gap: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }

.tab {
  background: none;
  border: 0;
  font: inherit;
  color: var(--muted);
  padding: 0.5rem 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* ---------- Code d'invitation ---------- */

.invite-mail { margin-bottom: 1.5rem; }

.bonus-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.bonus-list li {
  border-left: 3px solid var(--line);
  padding: 0.35rem 0 0.35rem 0.8rem;
  margin-bottom: 0.5rem;
  font-family: var(--serif);
}
.bonus-list .btn-link { font-family: var(--sans); }

#bonus-text { min-height: 4.5rem; font-size: 1rem; }

.notice {
  border-left: 3px solid var(--air-red);
  padding: 0.5rem 0 0.5rem 0.9rem;
  color: var(--ink);
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400;
}
.check input { flex: 0 0 auto; margin-top: 0.3rem; }
.check span { flex: 1 1 auto; min-width: 0; }

/* Champ mot de passe avec son petit œil */
.pw { position: relative; }
.pw input { padding-right: 3rem; }
.eye {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.eye:hover { color: var(--ink); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.offscreen {
  position: fixed;
  left: -9999px;
  top: 0;
}

.code {
  font-family: var(--serif);
  font-size: 1.75rem;
  letter-spacing: 0.08em;
  user-select: all;
  margin: 0.5rem 0 1rem;
}

/* ---------- Progression ---------- */

.progress {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.settings {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.settings h2 { font-size: 1.125rem; }

.with-icon {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.with-icon img { width: 34px; height: 34px; flex: none; }

select {
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.pigeons {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Adresses mal tapées ---------- */

/* La suggestion de correction, sous le champ. Elle ne bloque rien : le
   formulaire part même si on l'ignore. */
.suggestion {
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--doux);
}

.suggestion button {
  display: block;
  margin-top: 0.3rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--air-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: left;
  cursor: pointer;
}

/* L'autre pigeon n'a pas confirmé : de quoi le débloquer sans passer par la
   base. Ce bloc disparaît dès qu'il a confirmé. */
.attente {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.attente p { margin: 0 0 0.6rem; font-size: 0.9375rem; color: var(--muted); }

.attente .adresse {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.attente .boutons { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* ---------- Le joker, au bas de la feuille de la question ---------- */

.joker {
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

/* Remonté sous la question, quand c'est l'autre qui propose : le filet passe
   en dessous, sinon le bloc ressemble à un pied de feuille égaré en haut. */
.joker--haut {
  margin: 0 0 1.25rem;
  padding: 0 0 0.9rem;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

/* Un simple message remonté n'a pas besoin de son filet : le cadre du champ
   de saisie, juste dessous, marque déjà la séparation. */
.joker--nu { border-bottom: 0; padding-bottom: 0; }

.joker-ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9375rem;
}

.joker-reste { color: var(--muted); }

.joker-epuise {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Pas de font-size sur le conteneur : .btn tient sa taille du contexte
   (font: inherit), donc la réduire ici rapetisserait aussi les boutons. */
.joker-panneau p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.joker-panneau .alerte { color: var(--danger); }

/* L'explication se lit après le bouton, pas avant. */
.joker-panneau .apres { margin: 0.75rem 0 0; }

.joker-boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9375rem;
}

progress {
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--air-blue); }
progress::-moz-progress-bar { background: var(--air-blue); }

.together {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 1.25rem;
}

.together {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Le cœur reste aligné sur la première ligne quand le texte passe à la ligne. */
.together .heart { margin-top: 0.3em; }

/* Petit cœur qui bat doucement de temps en temps. */
.heart {
  width: 22px;
  height: auto;
  flex: none;
  animation: heartbeat 4s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 70%, 100% { transform: scale(1); }
  76% { transform: scale(1.18); }
  82% { transform: scale(1); }
  88% { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .heart { animation: none; }
}

.together.is-anniversary {
  color: var(--air-red);
  font-weight: 600;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 2rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: end;
  margin-top: 1rem;
}
.inline-form > div { flex: 1; }

/* ---------- Révélation ---------- */

.reveal {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  background: #1c2a4a;
  color: #ffffff;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

.reveal[hidden] { display: none; }

.reveal-inner {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.reveal-q {
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.35;
  margin-bottom: 1.75rem;
}

.letter .sheet { color: #1c2a4a; background: #ffffff; padding: 1.75rem 1.5rem; }
.letter.airmail {
  background: repeating-linear-gradient(-45deg, #c63b3b 0 12px, #fff 12px 18px, #2d5da8 18px 30px, #fff 30px 36px);
}

.letter-from {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #58647a;
  margin: 0 0 0.6rem;
}

.letter-text {
  font-family: var(--serif);
  font-size: 1.3125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

.reactions { margin: 1.5rem 0 0; }
.reactions-label { color: #c9d2e3; font-size: 0.9375rem; margin: 0 0 0.6rem; }
.reaction-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: #ffffff; color: #1c2a4a; font-weight: 600; }

.reaction-received .heart-mini,
.reaction-banner .heart-mini { margin-top: 0.35em; }
.reaction-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--air-red);
  background: var(--sheet);
  border-radius: 0 6px 6px 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}
.reaction-received {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}

/* La coche de l'accusé de lecture. Dessinée en masque et non en image, pour
   que sa couleur vienne de la palette et suive le mode sombre. */
.lecture-faite::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 0.3em;
  background: var(--vert-lu);
  -webkit-mask: url("icon-check.svg") center / contain no-repeat;
  mask: url("icon-check.svg") center / contain no-repeat;
}

.reveal-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.6rem; }
.reveal-actions .btn { width: 100%; text-align: center; }
.btn-contour {
  background: transparent; color: #ffffff; border: 2px solid #ffffff;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
}
.btn-contour:focus-visible, .keep-back:focus-visible { outline: 2px solid #ffffff; outline-offset: 4px; }
.keep {
  position: fixed; inset: 0; z-index: 11; overflow-y: auto;
  background: #1c2a4a; color: #ffffff;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.keep[hidden] { display: none; }
.keep-inner { max-width: 34rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.keep-title { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 0 1.25rem; color: #ffffff; }
.keep-canvas { display: block; width: 100%; height: auto; max-width: 22rem; margin: 0 auto 1.5rem; border-radius: 6px; }
.keep-back { display: block; margin: 0 auto; color: #ffffff; min-height: 44px; }
.reveal-note { color: #c9d2e3; font-size: 0.9375rem; margin: 1.5rem 0 1rem; }
.reveal-auto { margin: 1rem 0 0; text-align: center; }

/* Le moment fort : la lettre arrive et se pose, légèrement de biais. */
.reveal.is-open .letter { animation: arrive 800ms cubic-bezier(.2,.8,.2,1) both; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(35vh) rotate(-6deg); }
  to   { opacity: 1; transform: rotate(-1deg); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal.is-open .letter { animation: none; }
}

/* Champ piège à robots : invisible, mais pas pour un programme */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Lien secondaire isolé sous une action principale */
.quiet-line { margin-top: 1.75rem; }

/* Correction de l'adresse email sur l'écran « Confirme ton adresse » */
.fix-line { margin: 1.25rem 0 0; }
.fix-link { color: var(--air-blue); font-weight: 600; }
.fix-email {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pending-email { font-size: 0.9375rem; border-left-color: var(--air-blue); }
.pending-email p { margin: 0.25rem 0; }
.fix-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 0.9rem; }

/* Action destructrice : rouge, mais sobre */
.btn-danger { background: var(--air-red); }
.btn-danger:hover { background: #a82f2f; }
/* Liens juridiques accessibles depuis les Réglages. */
.app-legal-links { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 1.5rem 0; font-size: .875rem; }
.app-legal-links a { color: var(--ink); text-underline-offset: .2em; }

/* Choix des thèmes : des pastilles à cocher, lisibles au pouce. */
.theme-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.theme {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.8rem; min-height: 44px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--sheet); cursor: pointer;
  font-size: 0.9375rem; line-height: 1.2;
}
.theme:has(input:checked) { border-color: var(--air-blue); box-shadow: inset 0 0 0 1px var(--air-blue); }
.theme:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme input { flex: 0 0 auto; margin: 0; }

/* Carnet de timbres : le solde se lit d'un coup d'œil, l'alerte se voit
   sans crier. Les couleurs viennent de la palette, donc elles suivent le
   thème sombre toutes seules. */
.stamps-low { color: var(--air-red); }
.stamps-low strong,
.stamps-empty { color: var(--air-red); font-weight: 700; }

/* Fuseau du pigeonnier : heure d'arrivée de la question chez chacun. */
.tz-preview { padding: 0.75rem 0.9rem; background: #eef2f8; border-radius: 6px; font-size: 0.9375rem; }
.tz-preview p { margin: 0; }
.tz-preview .tz-title { font-weight: 600; margin-bottom: 0.25rem; }
.tz-preview[hidden] { display: none; }

/* ---------- Réglages rangés : chapitres et fiches repliées ---------- */
.chapitre { display: flex; align-items: center; gap: 0.6rem; margin: 1.75rem 0 0.25rem; }
.chapitre::after { content: ""; flex: 1; border-top: 2px dotted var(--line); }
.chapitre-num { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--air-red); }
.chapitre-nom { margin: 0; font-family: var(--serif); font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; }
.chapitre-note { margin: 0 0 0.75rem; font-size: 0.875rem; color: var(--muted); }
.chapitre + .fiches { margin-top: 0.75rem; }

.fiches { display: flex; flex-direction: column; gap: 0.5rem; }
.fiche { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; }
.fiche.is-open { border-color: var(--ink); }
.fiche-head {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 3.75rem;
  padding: 0.625rem 0.875rem; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; cursor: pointer;
}
.fiche-head:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.fiche-head img { width: 34px; height: 34px; flex: none; }
.fiche-texte { flex: 1; min-width: 0; }
.fiche-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.0625rem; }
.fiche-sum { display: block; font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }
.fiche-chev { flex: none; display: flex; color: var(--muted); transition: transform 0.15s; }
.fiche.is-open .fiche-chev { transform: rotate(90deg); color: var(--ink); }
.fiche-body { border-top: 2px dotted var(--line); padding: 0.875rem 0.875rem 1rem; }
.fiche-body > * + * { margin-top: 0.875rem; }
.fiche-body > .hint:first-child { margin-top: 0; }

.deconnexion { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 2px dotted var(--line); }
.deconnexion .hint { margin: 0.75rem 0 0; }

/* Packs de questions */
.pack-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; font-size: 0.9375rem; }
.theme-list.compact { gap: 0.375rem; }
.theme-list.compact .theme { min-height: 36px; padding: 0.3rem 0.7rem 0.3rem 0.6rem; font-size: 0.875rem; font-weight: 600; }
.packs-facultatifs { display: flex; flex-direction: column; gap: 0.625rem; padding: 0.875rem; border: 2px dashed var(--line); border-radius: 6px; background: var(--paper); }
.packs-facultatifs > * { margin: 0; }
.packs-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.packs-tete h3 { margin: 0; font-family: var(--serif); font-size: 1.125rem; }
.pack-count { font-size: 0.875rem; font-weight: 700; color: var(--air-red); white-space: nowrap; }
.pack { display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0.5rem 0.75rem; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.pack:has(input:checked) { border-color: var(--air-blue); box-shadow: inset 0 0 0 1px var(--air-blue); }
.pack:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pack input { flex: none; width: 1.375rem; height: 1.375rem; margin: 0; }
.pack-nom { display: block; font-weight: 700; }
.pack-aide { display: block; font-size: 0.875rem; color: var(--muted); }
.pack-aide { font-weight: 400; }
.pack-ligne .btn-link { white-space: nowrap; }
.pack-ligne strong { font-size: 0.875rem; }

/* ---------- Ajouter l'app sur l'écran d'accueil ---------- */
/* Bannière sous la question, une seule fois, et fiche dans les Réglages. */
.ajout {
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  background: var(--doux);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.ajout-tete { display: flex; gap: 0.7rem; align-items: flex-start; }
.ajout-tete img { width: 34px; height: 34px; flex: none; }
.ajout-tete > div { min-width: 0; }
.ajout-titre {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}
.ajout-raison { font-size: 0.9375rem; margin: 0.25rem 0 0; }
.ajout-boutons { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.ajout-boutons .btn { min-width: 11rem; text-align: center; }

/* Les trois gestes de l'iPhone. */
.gestes {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.gestes li { display: flex; gap: 0.75rem; align-items: flex-start; }
.chiffre {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.geste-txt { line-height: 1.5; padding-top: 0.15rem; }
.glyphe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  vertical-align: -0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--sheet);
  color: var(--air-blue);
}
.hint--safari { margin-top: 1.1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.keep .btn { width: 100%; }

/* Mes achats (Réglages) */
.achats .achat { border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 0.9rem; background: var(--paper); }
.achats .achat + .achat { margin-top: 0.75rem; }
.achat-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.achat-nom { font-family: var(--serif); font-weight: 700; }
.achat-prix { font-weight: 700; white-space: nowrap; }
.achat-date { font-size: 0.875rem; color: var(--muted); margin: 0.15rem 0 0; }
.achat-etat { font-size: 0.9rem; margin: 0.6rem 0 0.1rem; }
.achat-ok { color: var(--vert-lu); }
.achat-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-top: 0.6rem; }
.lien-facture { color: var(--ink); font-size: 0.9rem; text-underline-offset: 0.2em; }
.fiche-body a:not(.btn) { color: var(--ink); text-underline-offset: 0.2em; }

/* ---------- Inviter un couple ---------- */

/* Au-dessus de la création de compte, quand on arrive par le lien d'un ami. */
.bandeau {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.25rem;
}
.bandeau strong { font-family: var(--serif); }
.bandeau-pct {
  flex: none;
  background: #c63b3b;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
}
.bandeau-texte { font-size: 0.9375rem; }

/* Le lien à copier, dans la fiche. */
.lien-etiquette { display: block; font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.35rem; }
.lien-box {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.parrainage-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1.5rem 0 0; }
.fiche-body > .parrainage-actions { margin-top: 1.5rem; }

/* Le champ de date de l'iPhone garde sa largeur d'origine et dépasse de la
   fiche : on le ramène à celle de son conteneur, comme les autres champs. */
input[type="date"] {
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: 2.9rem;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.stack > * { min-width: 0; }
