/*
 * Charte Youni — direction « mélange » (amendement AM-6 du 2026-09-17,
 * docs/identite.md). Couleurs du « carnet tendre », formes rondes, mode sombre
 * « veilleuse », mots manuscrits et cœur qui respire sur les écrans importants.
 * Aucune valeur en dur hors de ce fichier de tokens ; aucune police ni ressource
 * distante : les polices (SIL OFL) sont servies depuis /polices/.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('/polices/fraunces-variable.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/polices/nunito-variable.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Caveat';
  src: url('/polices/caveat-variable.woff2') format('woff2');
  font-weight: 500 600;
  font-display: swap;
}

:root {
  /* Couleurs — journée, « carnet tendre ». Contrastes AA vérifiés. */
  --fond: #FBEFEA;
  --surface: #FFF8F5;
  --texte: #4A2C3A;
  --texte-secondaire: #7A5B66;
  --action: #B84C38;
  --action-texte: #FFFFFF;
  --commun-texte: #A8432F;
  --prive-texte: #4F6A4A;
  --pastille-commun-fond: #F7D5CC;
  --pastille-commun-texte: #8E3524;
  --pastille-prive-fond: #DCE8D6;
  --pastille-prive-texte: #3E5739;
  --pastille-neutre-fond: #F1E3DE;
  --pastille-neutre-texte: #4A2C3A;
  --coeur: #D9654F;
  --ombre: 0 4px 18px rgba(74, 44, 58, 0.08);
  --separateur: rgba(74, 44, 58, 0.08);
  --fond-degrade: var(--fond);

  /* Espacements et formes : tout est rond. */
  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 20px; --space-5: 28px; --space-6: 40px;
  --radius-carte: 24px;
  --radius-pilule: 999px;
  --tabbar-height: 56px;
  --touch-target: 44px;
  --motion-fast: 120ms;
  --motion-normal: 200ms;

  --titres: 'Fraunces', Georgia, 'Times New Roman', serif;
  --texte-police: 'Nunito', system-ui, sans-serif;
  --manuscrit: 'Caveat', 'Segoe Print', cursive;
}

/* Le soir, « veilleuse » : suit le réglage du téléphone. */
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #241B2F;
    --surface: #33273F;
    --texte: #F6E9E2;
    --texte-secondaire: #BBA9B8;
    --action: #FF9A7A;
    --action-texte: #2A1B24;
    --commun-texte: #FFB199;
    --prive-texte: #C7D69C;
    --pastille-commun-fond: #4B2F38;
    --pastille-commun-texte: #FFC4B0;
    --pastille-prive-fond: #333A2A;
    --pastille-prive-texte: #D6E2B5;
    --pastille-neutre-fond: #3F3249;
    --pastille-neutre-texte: #F6E9E2;
    --coeur: #FF9A7A;
    --ombre: none;
    --separateur: rgba(246, 233, 226, 0.1);
    --fond-degrade: radial-gradient(120% 60% at 50% 0%, #3A2A45 0%, #241B2F 65%);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  background-image: var(--fond-degrade);
  background-attachment: fixed;
  color: var(--texte);
  font-family: var(--texte-police);
  font-size: 17px;
  line-height: 1.55;
}

#app {
  max-width: 32rem;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) calc(var(--tabbar-height) + var(--space-6) + var(--space-4));
  min-height: 100vh;
}

h1, h2, .titre-jour, .etat-vide, .code-recuperation { font-variation-settings: 'SOFT' 100, 'WONK' 1; }

/* En-tête : urgence à gauche, réglages à droite. */
.entete { display: flex; align-items: center; justify-content: flex-end; }
.entete button { background: none; border: 0; color: var(--texte); cursor: pointer; min-width: var(--touch-target); min-height: var(--touch-target); border-radius: var(--radius-pilule); }
.titre-jour { font-family: var(--titres); font-weight: 500; font-size: 1.9rem; line-height: 1.1; margin: var(--space-4) 0 var(--space-3); }
.sous-titre { color: var(--texte-secondaire); font-size: 0.9rem; margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.manuscrit { font-family: var(--manuscrit); font-weight: 600; font-size: 1.45rem; color: var(--commun-texte); line-height: 1.15; }

/* Champs en pilule. */
.barre-saisie { display: flex; gap: var(--space-2); }
.barre-saisie input,
.formulaire-auth input:not([type='checkbox']) {
  flex: 1; font: inherit; padding: var(--space-3) var(--space-4); min-height: var(--touch-target);
  background: var(--surface); color: var(--texte);
  border: 1px solid var(--separateur); border-radius: var(--radius-pilule);
  box-shadow: var(--ombre);
}
.formulaire-auth { display: flex; flex-direction: column; gap: var(--space-3); max-width: 24rem; margin-top: var(--space-4); }
.formulaire-auth label { display: inline-flex; align-items: center; gap: var(--space-2); }
.formulaire-auth input[type='checkbox'] { width: 22px; height: 22px; accent-color: var(--action); }
.erreur-formulaire { color: var(--texte); margin-top: var(--space-3); }

/* La journée tient dans une carte arrondie. */
#fil:not(:empty) { background: var(--surface); border-radius: var(--radius-carte); padding: var(--space-1) var(--space-4); box-shadow: var(--ombre); margin-top: var(--space-4); }
#fil .titre-jour { font-size: 1.2rem; margin: var(--space-3) 0 0; }
.ligne { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; min-height: var(--touch-target); }
.ligne + .ligne { border-top: 1px solid var(--separateur); }
.ligne .heure { color: var(--texte-secondaire); min-width: 3.2rem; font-weight: 700; font-size: 0.85rem; }
.ligne .titre { flex: 1; }

/* Pastilles en bonbon. */
.pastille { display: inline-block; border-radius: var(--radius-pilule); padding: 3px var(--space-3); font-size: 0.8rem; font-weight: 700; }
.pastille--commun { background: var(--pastille-commun-fond); color: var(--pastille-commun-texte); }
.pastille--prive { background: var(--pastille-prive-fond); color: var(--pastille-prive-texte); }
.pastille--neutre { background: var(--pastille-neutre-fond); color: var(--pastille-neutre-texte); }
button.pastille { border: 0; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 700; min-height: var(--touch-target); padding: 0 var(--space-4); }

/* Aperçu de saisie : une carte, les pastilles, « C'est noté ». */
.apercu { background: var(--surface); border-radius: var(--radius-carte); padding: var(--space-4); margin-top: var(--space-3); box-shadow: var(--ombre); display: grid; gap: var(--space-3); }
.apercu .pastilles { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.controle { padding-top: var(--space-3); border-top: 1px solid var(--separateur); }

/* États vides : une phrase, pas d'illustration. */
.etat-vide { font-family: var(--titres); font-size: 1.35rem; color: var(--texte-secondaire); margin-top: var(--space-5); }
.exemple { color: var(--texte-secondaire); margin-top: var(--space-2); }

/* Bandeau d'installation et retours : cartes douces dans le flux. */
.bandeau, .retour { background: var(--surface); border-radius: var(--radius-carte); padding: var(--space-3) var(--space-4); margin-top: var(--space-3); box-shadow: var(--ombre); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

.mention-hors-ligne { margin: 0; padding: var(--space-2); text-align: center; font-size: 0.9rem; color: var(--texte-secondaire); background: var(--surface); }
body.hors-ligne .barre-saisie,
body.hors-ligne .apercu,
body.hors-ligne .bouton-principal,
body.hors-ligne .bouton-secondaire,
body.hors-ligne button.pastille { opacity: 0.45; pointer-events: none; }

/* Boutons : l'action principale est une pilule pleine ; le secondaire, du texte. */
.bouton-principal {
  background: var(--action); color: var(--action-texte); border: 0;
  font: inherit; font-weight: 700; cursor: pointer;
  min-height: var(--touch-target); padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pilule);
  transition: transform var(--motion-fast) ease-out;
}
.bouton-principal:active { transform: scale(0.98); }
.bouton-principal:disabled { opacity: 0.5; cursor: default; }
.bouton-principal--affirme { width: 100%; }
.bouton-secondaire { background: none; border: 0; color: var(--texte-secondaire); font: inherit; cursor: pointer; min-height: var(--touch-target); padding: 0 var(--space-2); border-radius: var(--radius-pilule); }

/* Codes à recopier (récupération, secours) : grands caractères, groupes de quatre. */
.code-recuperation, .cle-secours { font-family: var(--titres); font-size: 1.5rem; letter-spacing: 0.08em; word-spacing: 0.4em; background: var(--surface); padding: var(--space-4); border-radius: var(--radius-carte); box-shadow: var(--ombre); text-align: center; margin: var(--space-4) 0; }

/* Cœur qui respire, sur les écrans importants (connexion, accueil de Marine). */
.coeur { display: block; width: 52px; height: 52px; margin: var(--space-5) auto var(--space-2); color: var(--coeur); }
@media (prefers-reduced-motion: no-preference) {
  .coeur { animation: respire 5s ease-in-out infinite; }
}
@keyframes respire { 50% { transform: scale(1.08); } }
.ecran-centre { text-align: center; }
#app.voile > * { visibility: hidden; }

/* « Nous » : ce qu'il y a à faire aujourd'hui, puis quatre groupes. */
.carte-jour {
  display: block; width: 100%; text-align: left; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--pastille-commun-fond); color: var(--pastille-commun-texte); border: 0;
  border-radius: var(--radius-carte); padding: var(--space-3) var(--space-4); margin-top: var(--space-2);
  min-height: var(--touch-target);
}
.groupes-nous { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.groupe-nous {
  display: grid; gap: 2px; text-align: left; font: inherit; color: var(--texte); cursor: pointer;
  background: var(--surface); border: 0; border-radius: var(--radius-carte); box-shadow: var(--ombre);
  padding: var(--space-3) var(--space-4); min-height: var(--touch-target);
}
.groupe-nous__titre { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 500; font-size: 1.15rem; }
.groupe-nous__invite { color: var(--texte-secondaire); font-size: 0.85rem; }
.courbe { display: block; width: 100%; height: 5rem; color: var(--action); margin: var(--space-3) 0; }
.envie-commune { background: var(--pastille-prive-fond); color: var(--pastille-prive-texte); border-radius: var(--radius-carte); padding: var(--space-3) var(--space-4); margin-top: var(--space-2); font-weight: 700; }

/* Accueil personnel (AM-7) : une lettre sur papier, puis la présentation. */
.ecran-lettre { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-6); }
.lettre { background: var(--surface); border-radius: var(--radius-carte); box-shadow: var(--ombre); padding: var(--space-5) var(--space-4); }
.lettre__texte { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-size: 1.3rem; line-height: 1.5; margin: 0; white-space: pre-line; }
.lettre__signature { text-align: right; font-size: 2rem; margin: var(--space-4) 0 0; }
.lettre__page { color: var(--texte-secondaire); font-size: 0.85rem; text-align: center; font-variant-numeric: tabular-nums; }
.presentation__texte { font-size: 1.1rem; max-width: 26rem; margin: 0 auto; }
.actions-accueil { display: grid; gap: var(--space-2); max-width: 24rem; width: 100%; margin: var(--space-3) auto 0; }
.ecran-centre .formulaire-auth { margin-left: auto; margin-right: auto; text-align: left; }

/* Barre d'onglets flottante. */
.tabbar {
  position: fixed; left: var(--space-3); right: var(--space-3);
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  max-width: 32rem; margin: 0 auto;
  display: flex; background: var(--surface); border-radius: var(--radius-pilule);
  box-shadow: 0 6px 24px rgba(74, 44, 58, 0.14);
}
.tabbar:empty { display: none; }
.tabbar button { flex: 1; background: none; border: 0; color: var(--texte-secondaire); font: inherit; font-size: 11.5px; min-height: var(--tabbar-height); cursor: pointer; border-radius: var(--radius-pilule); }
.tabbar button[aria-current='page'] { color: var(--commun-texte); font-weight: 700; }

/* Cartes de rapprochement (D17) : une rangée qui défile sous la barre de saisie. */
.zone-cartes { margin-top: var(--space-4); }
.rangee-cartes {
  display: flex; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--space-4);
  margin: 0 calc(-1 * var(--space-4)); padding: var(--space-1) var(--space-4) var(--space-3);
  scrollbar-width: none;
}
.rangee-cartes::-webkit-scrollbar { display: none; }
.carte-rapprochement {
  flex: 0 0 9.5rem; scroll-snap-align: start; min-height: 7.5rem;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2);
  text-align: left; font: inherit; color: var(--texte); cursor: pointer;
  background: var(--surface); border: 0; border-radius: var(--radius-carte);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); box-shadow: var(--ombre);
  transition: transform var(--motion-fast) ease-out;
}
.carte-rapprochement:active { transform: scale(0.97); }
.carte-rapprochement--humeur { background: var(--pastille-neutre-fond); }
.carte-rapprochement--mot { background: var(--pastille-commun-fond); color: var(--pastille-commun-texte); }
.carte-rapprochement--envie { background: var(--pastille-prive-fond); color: var(--pastille-prive-texte); }
.carte-rapprochement__titre { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 500; font-size: 1.1rem; line-height: 1.15; }
.carte-rapprochement__invite { font-size: 0.8rem; opacity: 0.85; line-height: 1.3; }
.mot-pour-toi {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; margin-bottom: var(--space-3);
  font-family: var(--manuscrit); font-weight: 600; font-size: 1.5rem; color: var(--commun-texte);
  background: var(--surface); border: 0; border-radius: var(--radius-pilule); box-shadow: var(--ombre);
  min-height: var(--touch-target); padding: var(--space-1) var(--space-4); cursor: pointer;
}
.mot-pour-toi .coeur { width: 26px; height: 26px; margin: 0; }

/* Écrire une carte. */
.composer { display: grid; gap: var(--space-3); margin-top: var(--space-2); }
.zone-texte {
  font: inherit; color: var(--texte); background: var(--surface); min-height: 6.5rem; resize: vertical;
  border: 1px solid var(--separateur); border-radius: var(--radius-carte); padding: var(--space-3) var(--space-4); box-shadow: var(--ombre);
}
.suggestions { display: grid; gap: var(--space-2); justify-items: start; }
.suggestion {
  font: inherit; text-align: left; color: var(--texte); cursor: pointer; width: 100%;
  background: var(--surface); border: 1px solid var(--separateur); border-radius: var(--radius-carte);
  min-height: var(--touch-target); padding: var(--space-2) var(--space-4);
}
.pastille[aria-pressed='true'] { background: var(--action); color: var(--action-texte); }
.envie-choisie { font-family: var(--titres); font-size: 1.3rem; line-height: 1.25; background: var(--surface); border-radius: var(--radius-carte); padding: var(--space-4); box-shadow: var(--ombre); }

/* « Nous » : les cartes échangées. */
.titre-section { font-family: var(--titres); font-weight: 500; font-size: 1.2rem; margin: var(--space-5) 0 var(--space-2); }
.carte-nous { background: var(--surface); border-radius: var(--radius-carte); padding: var(--space-3) var(--space-4); box-shadow: var(--ombre); margin-top: var(--space-3); display: grid; gap: var(--space-2); justify-items: start; }
.carte-nous--nouvelle { outline: 2px solid var(--coeur); outline-offset: -2px; }
.carte-nous__titre { font-family: var(--titres); font-weight: 500; font-size: 1.05rem; margin: 0; }
.carte-nous__date { color: var(--texte-secondaire); font-size: 0.8rem; }
.carte-nous__corps { margin: 0; font-size: 1.05rem; }
.devinette { display: grid; gap: var(--space-2); width: 100%; }
.indice { font-family: var(--manuscrit); font-weight: 600; font-size: 1.35rem; color: var(--commun-texte); line-height: 1.2; }

/* « Nous » ludique (D20, docs/identite.md §9) : des objets qu'on manipule. */
.dessin { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dessin--petit { width: 26px; height: 26px; }
.groupes-nous { grid-template-columns: 1fr 1fr; }
.groupe-nous { align-content: start; }
.groupe-nous--large { grid-column: 1 / -1; background: var(--pastille-commun-fond); }
.groupe-nous__dessin { color: var(--commun-texte); margin-bottom: var(--space-1); }

.carte-objet { perspective: 1200px; margin: var(--space-4) 0 var(--space-3); }
.carte-objet__interieur { display: grid; transform-style: preserve-3d; transition: transform 550ms cubic-bezier(.2, .7, .2, 1); }
.carte-objet--retournee .carte-objet__interieur { transform: rotateY(180deg); }
.carte-objet__face {
  grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border-radius: var(--radius-carte); box-shadow: var(--ombre);
  padding: var(--space-5) var(--space-4); min-height: 15rem; display: grid; gap: var(--space-3); align-content: center;
}
.carte-objet__face--recto {
  border: 0; font: inherit; cursor: pointer; justify-items: center; text-align: center;
  background: var(--pastille-commun-fond); color: var(--pastille-commun-texte);
}
.carte-objet__face--recto .dessin { width: 64px; height: 64px; }
.carte-objet__face--verso { transform: rotateY(180deg); }
.carte-objet__titre { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 500; font-size: 1.35rem; }
.carte-objet__phrase { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 500; font-size: 1.5rem; line-height: 1.25; margin: 0; }
.carte-objet__phrase--petite { font-size: 1.2rem; }
.carte-objet--paquet { position: relative; }
.carte-objet--paquet::before, .carte-objet--paquet::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius-carte); background: var(--pastille-commun-fond); opacity: .55; z-index: -1;
}
.carte-objet--paquet::before { transform: rotate(-3.5deg) translate(-4px, 6px); }
.carte-objet--paquet::after { transform: rotate(2.5deg) translate(5px, 3px); }
.actions-carte { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.reponse-jeu { background: var(--pastille-commun-fond); color: var(--pastille-commun-texte); border-radius: var(--radius-carte); padding: var(--space-3) var(--space-4); font-weight: 700; }
.reponse-jeu--autre { background: var(--pastille-prive-fond); color: var(--pastille-prive-texte); }

.ticket {
  margin-top: var(--space-4); background: var(--surface); border-radius: var(--radius-carte); box-shadow: var(--ombre);
  padding: var(--space-4); display: grid; gap: var(--space-3); border: 2px dashed var(--pastille-commun-fond);
}
.ticket__titre { display: flex; align-items: center; gap: var(--space-2); color: var(--commun-texte); font-weight: 700; }
.coches { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.coche {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-target); padding: 0 var(--space-2);
  font: inherit; color: var(--texte); background: none; border: 0; border-radius: var(--radius-pilule); cursor: pointer;
}
.coche--autre { cursor: default; }
.coche__rond { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--commun-texte); display: inline-grid; place-items: center; transition: background 200ms ease-out; }
.coche[aria-pressed='true'] .coche__rond, .coche[data-fait='true'] .coche__rond { background: var(--commun-texte); }
.coche[aria-pressed='true'] .coche__rond::after, .coche[data-fait='true'] .coche__rond::after {
  content: ''; width: 11px; height: 6px; border-left: 2.5px solid var(--fond); border-bottom: 2.5px solid var(--fond); transform: translateY(-1px) rotate(-45deg);
}

.roue { position: relative; width: min(20rem, 100%); aspect-ratio: 1; margin: var(--space-5) auto 0; }
.roue__disque { display: block; width: 100%; height: 100%; transition: transform 3s cubic-bezier(.12, .72, .18, 1); }
.roue__repere {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 1; width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 22px solid var(--action);
}
.roue__part { stroke: var(--commun-texte); stroke-width: 1.5; }
.roue__part--a { fill: var(--pastille-commun-fond); }
.roue__part--b { fill: var(--surface); }
.roue__texte { fill: var(--texte); font-size: 11.5px; font-weight: 700; }
.roue__resultat { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-size: 1.5rem; line-height: 1.25; color: var(--commun-texte); text-align: center; min-height: 2.5em; margin: var(--space-4) 0 var(--space-2); }

/* « Souvenirs et bons » (D20) : le bocal, les tickets, les capsules. */
.objet-nous { margin-top: var(--space-5); display: grid; gap: var(--space-3); }
.objet-nous > .titre-section { margin: 0; }
.depot { background: var(--surface); border-radius: var(--radius-carte); padding: var(--space-3) var(--space-4); box-shadow: var(--ombre); display: grid; gap: var(--space-2); }
.depot summary { cursor: pointer; font-weight: 700; color: var(--commun-texte); min-height: var(--touch-target); display: flex; align-items: center; }
.depot[open] summary { margin-bottom: var(--space-1); }
.depot:not([open]) { gap: 0; }
.depot input[type='date'] { font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--separateur); border-radius: var(--radius-pilule); padding: var(--space-2) var(--space-3); min-height: var(--touch-target); }
.case-coquin { display: flex; align-items: center; gap: var(--space-2); min-height: var(--touch-target); }
.case-coquin input { width: 22px; height: 22px; accent-color: var(--action); }

.bocal { display: grid; place-items: center; }
.bocal__dessin { width: 9rem; height: 10.5rem; fill: none; stroke: var(--commun-texte); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.bocal__couvercle { fill: var(--pastille-commun-fond); }
.bocal__verre { fill: var(--surface); }
.bocal__papier { fill: var(--pastille-prive-fond); stroke: var(--pastille-prive-texte); stroke-width: 1.4; }
.bocal--secoue .bocal__dessin { animation: secousse 600ms ease-in-out; transform-origin: 50% 90%; }
@keyframes secousse { 15% { transform: rotate(-7deg); } 35% { transform: rotate(6deg); } 55% { transform: rotate(-4deg); } 75% { transform: rotate(3deg); } 100% { transform: rotate(0); } }
.papier:empty { display: none; }
.papier { background: var(--surface); border-radius: 6px; box-shadow: var(--ombre); padding: var(--space-4); transform: rotate(-1.5deg); border-left: 4px solid var(--pastille-prive-fond); }
.papier--sorti { animation: papier-sort 450ms ease-out; }
@keyframes papier-sort { from { opacity: 0; transform: translateY(-24px) rotate(-6deg); } to { opacity: 1; transform: rotate(-1.5deg); } }
.papier__texte { font-family: var(--manuscrit); font-weight: 600; font-size: 1.55rem; line-height: 1.2; margin: 0 0 var(--space-2); color: var(--texte); }
.papier__date { color: var(--texte-secondaire); font-size: 0.85rem; }

.bon { display: flex; align-items: stretch; background: var(--pastille-commun-fond); color: var(--pastille-commun-texte); border-radius: 14px; box-shadow: var(--ombre); overflow: hidden; }
.bon__corps { flex: 1; display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); }
.bon__de { font-size: 0.8rem; font-weight: 700; opacity: .8; }
.bon__texte { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 500; font-size: 1.15rem; line-height: 1.25; }
.bon__talon {
  flex: none; width: 5.5rem; border: 0; border-left: 2px dashed var(--pastille-commun-texte); background: var(--surface); color: var(--commun-texte);
  font: inherit; font-weight: 700; cursor: pointer; writing-mode: vertical-rl; transform-origin: 0 100%; transition: transform 420ms ease-in, opacity 420ms ease-in;
}
.bon--dechire .bon__talon { transform: rotate(18deg) translate(12px, 20px); opacity: 0; }
.ligne-bon { padding: var(--space-2) 0; border-bottom: 1px solid var(--separateur); }

.capsule { position: relative; background: var(--surface); border-radius: var(--radius-carte); box-shadow: var(--ombre); padding: var(--space-4); display: grid; gap: var(--space-3); justify-items: center; text-align: center; overflow: hidden; }
.capsule::before { content: ''; position: absolute; inset: 0 0 auto; height: 45%; background: var(--pastille-commun-fond); clip-path: polygon(0 0, 100% 0, 50% 100%); opacity: .7; pointer-events: none; }
.capsule__entete { position: relative; display: grid; gap: 2px; }
.capsule__qui { font-weight: 700; color: var(--commun-texte); }
.capsule__date { color: var(--texte-secondaire); font-size: 0.85rem; }
.capsule__sceau {
  position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--action); color: var(--action-texte);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--action) 70%, black); transition: transform 350ms ease-out, opacity 350ms ease-out;
}
.capsule__sceau::after { content: ''; position: absolute; inset: 22px; border: 2px solid var(--action-texte); border-radius: 50%; opacity: .7; }
.capsule__sceau--a-briser { cursor: pointer; }
.capsule--ouverte .capsule__sceau { transform: scale(.4) rotate(40deg); opacity: 0; }
.capsule::before { transition: clip-path 450ms ease-out; }
.capsule--ouverte::before { clip-path: polygon(0 0, 100% 0, 50% 12%); }
.capsule--ouverte + .capsule__attente, .capsule--ouverte .capsule__attente { display: none; }
.capsule__attente { font-family: var(--manuscrit); font-weight: 600; font-size: 1.4rem; color: var(--commun-texte); }
.capsule__lettre { text-align: left; width: 100%; }
.capsule__texte { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-size: 1.15rem; line-height: 1.45; white-space: pre-wrap; margin: 0; }

/* Listes (Organisation G-1, G-7, G-11) : des lignes de carnet, sobres. */
.apercu > :empty { display: none; }
/* Agenda (Organisation G-5) : chaque jour dans une carte, comme le fil d’« Aujourd’hui ». */
.jour-agenda { background: var(--surface); border-radius: var(--radius-carte); padding: var(--space-1) var(--space-4); box-shadow: var(--ombre); margin-bottom: var(--space-3); }
.apercu__titre { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 500; font-size: 1.2rem; line-height: 1.25; }
.apercu__suite { font-size: 0.85rem; font-weight: 700; color: var(--commun-texte); }
.titre-jour + .pastille { display: inline-block; margin-bottom: var(--space-3); }
.lignes-listes, .lignes-articles { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.ligne-liste {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--touch-target);
  font: inherit; color: var(--texte); text-align: left; cursor: pointer;
  background: var(--surface); border: 0; border-radius: var(--radius-carte); box-shadow: var(--ombre); padding: var(--space-3) var(--space-4);
}
.ligne-liste__nom { font-family: var(--titres); font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 500; font-size: 1.15rem; }
.ligne-article {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch-target); width: 100%;
  font: inherit; color: var(--texte); text-align: left; cursor: pointer;
  background: var(--surface); border: 0; border-radius: var(--radius-pilule); padding: var(--space-2) var(--space-4);
}
.ligne-article__rond { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--commun-texte); }
.ligne-article--coche { color: var(--texte-secondaire); background: none; }
.ligne-article--coche .ligne-article__texte { text-decoration: line-through; }
.ligne-article--coche .ligne-article__rond { background: var(--commun-texte); }

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
