/* Poulpito : styles. Couleurs reprises des maquettes V2, toujours avec le même sens. */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --fond: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #E9ECEF;
  --texte: #16202A;
  --discret: #5B6673;
  --trait: #E3E6EA;
  --trait-leger: #F0F2F4;
  --action: #0F766E;          /* sarcelle = action */
  --action-texte: #FFFFFF;
  --action-doux: #CCFBF1;
  --alex: #2563EB;            /* bleu Alex */
  --camille: #C2410C;         /* orange Camille */
  --petit: #15803D;           /* vert le petit */
  --framboise: #BE185D;       /* anniversaires */
  --framboise-doux: #FCE7F3;
  --ambre: #78350F;           /* alerte, à vérifier */
  --ambre-doux: #FEF3C7;
  --violet: #5B21B6;          /* vacances */
  --violet-doux: #EDE9FE;
  --erreur: #B91C1C;
  --erreur-doux: #FEE2E2;
  --ombre: 0 1px 2px rgba(22, 32, 42, 0.06);
  --rayon: 16px;
  --titre: 'Space Grotesk', system-ui, sans-serif;
  --barre: 84px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0E1318;
    --surface: #18202A;
    --surface-2: #232C37;
    --texte: #E7EBEF;
    --discret: #9AA4AF;
    --trait: #2A333E;
    --trait-leger: #222A34;
    --action: #2DD4BF;
    --action-texte: #04201D;
    --action-doux: #134E4A;
    --alex: #60A5FA;
    --camille: #FB923C;
    --petit: #4ADE80;
    --framboise: #F472B6;
    --framboise-doux: #4A1530;
    --ambre: #FCD34D;
    --ambre-doux: #3B2A0B;
    --violet: #C4B5FD;
    --violet-doux: #2E1F55;
    --erreur: #FCA5A5;
    --erreur-doux: #451A1A;
    --ombre: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--texte);
  font: 400 15px/1.45 'Inter', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--action); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.cache-visuel {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Mise en page ---------- */

.ecran {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 40px) 20px calc(var(--barre) + 32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ecran--seul { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.entete__sur { font-size: 13px; color: var(--discret); }
.titre { font-family: var(--titre); font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 2px; }
.titre--moyen { font-size: 22px; }
.chapo { font-size: 14px; color: var(--discret); }

.carte {
  background: var(--surface);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.carte--liste { padding: 0; gap: 0; }
.rubrique {
  font-size: 12px; font-weight: 600; color: var(--discret);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.rubrique-ligne { display: flex; justify-content: space-between; align-items: center; margin: 0 4px; min-height: 24px; }

.ligne {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 16px;
  border-bottom: 1px solid var(--trait-leger);
}
.ligne:last-child { border-bottom: none; }
.ligne__corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ligne__titre { font-size: 15px; }
.ligne__detail { font-size: 12px; color: var(--discret); }

.pastille {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  color: #FFFFFF; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pastille--petite { width: 26px; height: 26px; }
.pastille--alex { background: var(--alex); }
.pastille--camille { background: var(--camille); }
@media (prefers-color-scheme: dark) { .pastille { color: #0E1318; } }

.puce {
  font-size: 12px; font-weight: 600; border-radius: 8px; padding: 3px 8px; white-space: nowrap;
  background: var(--surface-2); color: var(--discret);
}
.puce--violet { background: var(--violet-doux); color: var(--violet); }
.puce--ambre { background: var(--ambre-doux); color: var(--ambre); }

.bandeau {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 12px; padding: 12px 14px; font-size: 14px;
  background: var(--ambre-doux); color: var(--ambre);
}
.bandeau--erreur { background: var(--erreur-doux); color: var(--erreur); }
.bandeau--info { background: var(--action-doux); color: var(--texte); }
.bandeau svg { flex: none; margin-top: 1px; }

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

.champ { display: flex; flex-direction: column; gap: 6px; }
.champ__libelle { font-size: 13px; font-weight: 600; }
.champ__aide { font-size: 12px; color: var(--discret); }
.saisie {
  min-height: 52px; width: 100%;
  border: 2px solid var(--trait); border-radius: 14px;
  padding: 0 14px; font-size: 17px;
  background: var(--surface);
}
textarea.saisie { padding: 12px 14px; min-height: 120px; resize: vertical; line-height: 1.5; }
.saisie:focus { outline: none; border-color: var(--action); }
.saisie[aria-invalid="true"] { border-color: var(--erreur); }

.segments { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.segments__bouton {
  flex: 1; min-height: 44px; border-radius: 9px; border: none; background: transparent;
  font-size: 15px; color: var(--discret); cursor: pointer;
}
.segments__bouton[aria-pressed="true"] {
  background: var(--surface); color: var(--texte); font-weight: 600;
  box-shadow: 0 1px 2px rgba(22, 32, 42, 0.1);
}

.case { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.case input { width: 22px; height: 22px; accent-color: var(--action); margin: 0; flex: none; }
.case__texte { display: flex; flex-direction: column; }
.case__aide { font-size: 12px; color: var(--discret); }

.bouton {
  min-height: 52px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--action); color: var(--action-texte);
  font-size: 16px; font-weight: 600; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.bouton:disabled { opacity: 0.55; cursor: default; }
.bouton--secondaire { background: var(--surface); color: var(--action); border: 1px solid var(--action); }
.bouton--discret {
  background: transparent; color: var(--action); min-height: 44px; font-size: 14px; padding: 0 8px;
}
.bouton--danger { background: transparent; color: var(--erreur); border: 1px solid var(--erreur); }
.bouton--petit { min-height: 36px; border-radius: 18px; font-size: 13px; padding: 0 14px; }
.bouton--icone {
  width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 22px;
  background: var(--surface); color: var(--texte); box-shadow: var(--ombre);
}
.pile { display: flex; flex-direction: column; gap: 18px; }
.rangee { display: flex; gap: 10px; align-items: center; }

.marque {
  width: 72px; height: 72px; border-radius: 20px; overflow: hidden;
  background: #FFFFFF; box-shadow: var(--ombre);
}
.marque img { width: 100%; height: 100%; display: block; }

.attente { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--discret); }
.attente::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--trait); border-top-color: var(--action);
  animation: tourne 0.8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .attente::before { animation-duration: 3s; } }

/* ---------- Clé de secours ---------- */

.mots {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  counter-reset: mot;
}
.mots li {
  counter-increment: mot;
  background: var(--surface-2); border-radius: 10px; padding: 8px 10px;
  font-size: 15px; font-weight: 600; font-variant-ligatures: none;
}
.mots li::before { content: counter(mot) '. '; color: var(--discret); font-weight: 400; font-size: 12px; }
.code-invitation {
  font-family: var(--titre); font-size: 22px; font-weight: 600; line-height: 1.4;
  text-align: center; padding: 14px; border-radius: 14px; background: var(--surface-2);
}

/* ---------- Barre d'onglets ---------- */

.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--barre) + env(safe-area-inset-bottom));
  padding: 8px 0 env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--trait);
  display: flex; justify-content: space-around; align-items: flex-start;
}
.onglet {
  width: 74px; min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; color: var(--discret); text-decoration: none;
}
.onglet[aria-current="page"] { color: var(--action); font-weight: 600; }
.onglet--plus { margin-top: -26px; }
.onglet--plus span {
  width: 60px; height: 60px; border-radius: 34px; background: var(--action); color: var(--action-texte);
  border: 4px solid var(--fond); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

/* Indicateur discret hors ligne ou synchronisation */
.indicateur {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top) + 8px);
  font-size: 12px; font-weight: 600; border-radius: 12px; padding: 4px 10px;
  background: var(--surface-2); color: var(--discret); box-shadow: var(--ombre);
}
.indicateur--erreur { background: var(--erreur-doux); color: var(--erreur); }

/* Message bref en bas d'écran (avec annulation possible) */
.toast {
  position: fixed; z-index: 30; left: 16px; right: 16px; max-width: 528px; margin: 0 auto;
  bottom: calc(var(--barre) + 16px + env(safe-area-inset-bottom));
  background: var(--texte); color: var(--fond); border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px;
}
.toast button { background: none; border: none; color: var(--action-doux); font-weight: 700; min-height: 36px; cursor: pointer; }

.vide { text-align: center; color: var(--discret); font-size: 14px; padding: 24px 16px; }

/* ---------- Listes ---------- */

.pile--serree { gap: 8px; }
.ecran--saisie { padding-bottom: calc(var(--barre) + 120px + env(safe-area-inset-bottom)); }
.segments__bouton { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.segments__bouton[aria-current="page"] {
  background: var(--surface); color: var(--texte); font-weight: 600;
  box-shadow: 0 1px 2px rgba(22, 32, 42, 0.1);
}
a.bandeau { text-decoration: none; }
.bouton--gauche { align-self: flex-start; }

/* Rangées de puces : magasins, habituels, suggestions (défilent sur le côté) */
.puces {
  display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none;
  margin: 0 -20px; padding: 2px 20px;
}
.puces::-webkit-scrollbar { display: none; }
.puces--retour { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.puces__titre { font-size: 12px; font-weight: 600; color: var(--discret); flex: none; margin-right: 2px; }
.puce-bouton {
  min-height: 40px; padding: 0 14px; border-radius: 20px; flex: none; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--trait); background: var(--surface); font-size: 14px;
}
.puce-bouton[aria-pressed="true"] { background: var(--texte); color: var(--fond); border-color: var(--texte); font-weight: 600; }
.puce-bouton--habituel { border-style: dashed; min-height: 36px; font-size: 13px; }

/* Lignes cochables : tout le texte est la zone de tap (44 px et plus) */
.ligne--course, .ligne--tache { padding: 0 4px 0 0; gap: 0; min-height: 52px; }
.ligne__cocher {
  flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 4px 8px 4px 14px; border: none; background: transparent; text-align: left; cursor: pointer;
}
.case-a-cocher {
  width: 24px; height: 24px; flex: none; border-radius: 6px; border: 2px solid var(--discret);
  display: flex; align-items: center; justify-content: center;
}
.ligne--cochee .case-a-cocher { background: var(--action); border-color: var(--action); color: var(--action-texte); }
.ligne--cochee .ligne__titre { text-decoration: line-through; color: var(--discret); }
.ligne__quantite { font-size: 14px; font-weight: 600; color: var(--discret); flex: none; }
.ligne__modifier {
  width: 44px; height: 44px; flex: none; border: none; background: transparent; color: var(--discret);
  display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 22px;
}
.ligne--nouveau { background: var(--ambre-doux); }
.ligne__detail--alex { color: var(--alex); font-weight: 600; }
.ligne__detail--camille { color: var(--camille); font-weight: 600; }
.ligne__detail--retard { color: var(--erreur); font-weight: 600; }

.ligne__rond {
  width: 48px; height: 52px; flex: none; border: none; background: transparent; padding: 0 0 0 4px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.rond {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--discret);
  display: flex; align-items: center; justify-content: center;
}
.ligne--cochee .rond { background: var(--action); border-color: var(--action); color: var(--action-texte); }
.ligne__corps--bouton {
  min-height: 52px; justify-content: center; border: none; background: transparent; text-align: left;
  padding: 4px 8px 4px 2px; cursor: pointer;
}
.ligne--tache .pastille { margin-right: 10px; }

.carte--lien {
  flex-direction: row; align-items: center; gap: 12px; text-decoration: none; color: var(--texte);
}
.carte--lien > svg { color: var(--action); flex: none; }

/* Champ de saisie fixé en bas, au-dessus des onglets */
.composer {
  position: fixed; z-index: 11; left: 12px; right: 12px; max-width: 536px; margin: 0 auto;
  bottom: calc(var(--barre) + 12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
.composer .puces { margin: 0; padding: 0; }
.composer__ligne {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; padding: 6px;
  box-shadow: 0 4px 14px rgba(22, 32, 42, 0.08);
}
.composer__champ {
  flex: 1; min-width: 0; min-height: 44px; border: none; outline: none; background: transparent;
  font-size: 16px; padding: 0 8px;
}
.composer__bouton {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: none; cursor: pointer;
  background: var(--action); color: var(--action-texte); display: flex; align-items: center; justify-content: center;
}
.puces--suggestions .puce-bouton { box-shadow: 0 2px 8px rgba(22, 32, 42, 0.12); }

/* Sur les listes, le message passe au-dessus du champ de saisie */
body:has(.composer) .toast { bottom: calc(var(--barre) + 84px + env(safe-area-inset-bottom)); }

/* Fenêtre (modifier un article, une tâche) */
.fenetre {
  border: none; border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 24px));
  background: var(--surface); color: var(--texte); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.fenetre::backdrop { background: rgba(14, 19, 24, 0.45); }
.fenetre__corps { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Agenda ---------- */

.rangee--serree { gap: 6px; flex-wrap: wrap; }
.legende { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--discret); }
.legende__item { display: flex; align-items: center; gap: 5px; }
.legende__point { width: 9px; height: 9px; border-radius: 5px; }
.legende__point--alex { background: var(--alex); }
.legende__point--camille { background: var(--camille); }
.legende__point--petit { background: var(--petit); }

.jour {
  display: flex; gap: 10px; min-height: 52px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: var(--texte);
  background: var(--surface); border: 1px solid var(--trait);
}
.jour--aujourdhui { border: 2px solid var(--action); }
.jour--aujourdhui .jour__num { color: var(--action); }
.jour--vacances { background: var(--violet-doux); border-color: transparent; }
.jour__date { width: 38px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.jour__nom { font-size: 11px; color: var(--discret); text-transform: uppercase; }
.jour__num { font-size: 17px; font-weight: 700; }
.jour__puces { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-content: center; }

.puce-ev { font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 8px; white-space: nowrap; background: var(--surface-2); color: var(--texte); }
.puce-ev--alex { background: #DBEAFE; color: #1E3A8A; }
.puce-ev--camille { background: #FFEDD5; color: #7C2D12; }
.puce-ev--petit { background: #DCFCE7; color: #14532D; }
.puce-ev--gris { background: var(--surface-2); color: var(--discret); }
.puce-ev--lien { text-decoration: none; align-self: flex-start; }
.puce-ev--violet { background: var(--violet-doux); color: var(--violet); }
.puce-ev--ambre { background: var(--ambre-doux); color: var(--ambre); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .puce-ev--alex { background: #1E3A8A; color: #DBEAFE; }
  .puce-ev--camille { background: #7C2D12; color: #FFEDD5; }
  .puce-ev--petit { background: #14532D; color: #DCFCE7; }
}
.bandeau--violet { background: var(--violet-doux); color: var(--violet); align-items: center; }

.ligne--bouton { width: 100%; border: none; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.ligne__heure { width: 52px; flex: none; font-weight: 600; font-size: 14px; }
.ligne__icone { color: var(--action); display: flex; }
.pastilles { display: flex; gap: 4px; }
.pastille--petit { background: var(--petit); }
.pastille--autre { background: var(--discret); }
.segments--alerte { background: var(--ambre-doux); }
.segments--petits .segments__bouton { font-size: 13px; min-height: 40px; padding: 0 4px; }
.champ--moitie { flex: 1; min-width: 0; }
.bouton--large { flex: 1; }
.puce-bouton--jour { min-width: 52px; }
.case--compacte { min-height: 40px; gap: 8px; }
.saisie--heure { width: auto; min-height: 44px; font-size: 16px; padding: 0 8px; }

/* Bouton + : tuiles de types */
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tuile {
  min-height: 84px; border-radius: 14px; border: 1px solid var(--trait); background: var(--surface); color: var(--texte);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.tuile svg { color: var(--action); }

/* Aujourd'hui : qui fait quoi, alerte de garde, demain */
.qui { display: flex; align-items: center; gap: 12px; }
.qui__corps { flex: 1; min-width: 0; }
.qui__titre { font-size: 15px; font-weight: 600; }
.qui__detail { font-size: 13px; color: var(--discret); }
.alerte-garde {
  display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 10px 12px;
  background: var(--ambre-doux); color: var(--ambre);
}
.alerte-garde__titre { font-size: 14px; font-weight: 600; }
.alerte-garde__detail { font-size: 12px; }
.bouton--alerte { background: var(--ambre); color: var(--ambre-doux); flex: none; }
.demain { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--discret); text-decoration: none; margin: 0 4px; }
.puce--violet { flex: none; }

/* ---------- Annuaire ---------- */

.puce--gris { background: var(--surface-2); color: var(--discret); }
.puce--vert { flex: none; }
.ligne--fiche { padding: 6px 8px 6px 14px; min-height: 62px; }
.ligne__lien { text-decoration: none; color: inherit; align-items: flex-start; }
.ligne__titre--fort { font-weight: 600; }
.ligne__etat { margin-top: 4px; }
.action-ronde {
  width: 44px; height: 44px; flex: none; border-radius: 22px; background: var(--surface-2); color: var(--texte);
  display: flex; align-items: center; justify-content: center;
}
.action-ronde--appel { background: var(--action-doux); color: var(--action); }
.entete__espace { flex: 1; }
.bouton-retour[aria-pressed="true"] svg { fill: currentColor; color: #D97706; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.action {
  min-height: 62px; border-radius: 14px; border: 1px solid var(--trait); background: var(--surface); color: var(--texte);
  font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.action--principale { background: var(--action); color: var(--action-texte); border-color: var(--action); }
.carte--horaires { padding-top: 10px; }
.carte__haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 16px 6px; }
.carte__pied { padding: 6px 16px 10px; justify-content: space-between; }
.horaire {
  display: flex; justify-content: space-between; gap: 12px; min-height: 32px; align-items: center;
  padding: 0 16px; font-size: 14px; border-bottom: 1px solid var(--trait-leger);
}
.horaire--aujourdhui { font-weight: 700; }
.horaire--manque { color: var(--ambre); }
.info { display: flex; flex-direction: column; padding: 8px 16px; border-bottom: 1px solid var(--trait-leger); }
.info:last-child { border-bottom: none; }
.info__cle { font-size: 12px; color: var(--discret); }
.info__valeur { font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.horaire-saisie { display: flex; align-items: center; gap: 10px; }
.horaire-saisie > span { width: 84px; flex: none; font-size: 14px; }
.saisie--horaire { min-height: 44px; font-size: 16px; }

/* Anniversaires (framboise) */
.puce-ev--framboise { background: var(--framboise); color: #FFFFFF; }
.carte-anniv { display: flex; align-items: center; gap: 12px; background: var(--framboise-doux); border-radius: 16px; padding: 12px 14px; }
.carte-anniv__lien { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.carte-anniv__icone {
  width: 44px; height: 44px; flex: none; border-radius: 22px; background: var(--framboise); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
}
.carte-anniv > svg { color: var(--framboise); flex: none; }
.carte-anniv__titre { display: block; font-size: 15px; font-weight: 700; color: var(--framboise); }
.carte-anniv__detail { display: block; font-size: 13px; color: var(--framboise); }
.bouton--framboise { background: var(--framboise); color: #FFFFFF; flex: none; }

/* ---------- Bouton + ---------- */

.apercu-phrase:empty { display: none; }
.apercu-phrase__texte { font-size: 16px; }
.tuiles--apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tuiles--apps .tuile { min-height: 76px; font-size: 13px; text-align: center; }
.tuiles--essentiels .tuile { min-height: 104px; font-size: 15px; text-align: center; }
.tuiles--huit { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tuiles--huit .tuile { min-height: 74px; font-size: 12px; padding: 4px; text-align: center; }

/* ---------- Maison ---------- */

.puce--erreur { background: var(--erreur-doux); color: var(--erreur); }
.puce--ambre { flex: none; }
.actions--trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ligne__corps--piece { flex-direction: row; align-items: center; gap: 10px; }
.vignette { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.vignette--icone { display: flex; align-items: center; justify-content: center; color: var(--discret); }
.info--lien { text-decoration: none; color: inherit; }
.info--lien .info__valeur { color: var(--action); }
.carte__haut--nu { padding: 0; }

/* ---------- Accès d'urgence ---------- */

/* Masque la saisie sans en faire un champ « mot de passe » : aucun gestionnaire ne propose de l'enregistrer. */
.saisie--masquee { -webkit-text-security: disc; text-security: disc; font-family: inherit; letter-spacing: 0.1em; }
.coffre__mdp { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 17px; overflow-wrap: anywhere; }
.rangee--entre { justify-content: space-between; }
.lien-discret { display: block; text-align: center; font-size: 12px; color: var(--discret); padding: 12px; text-decoration: none; }

/* ---------- Cartes de fidélité ---------- */

.entete--retour { justify-content: flex-start; align-items: center; gap: 2px; margin-left: -12px; }
.entete--retour .titre { flex: 1; }
.bouton-retour {
  width: 44px; height: 44px; flex: none; border: none; background: transparent; color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 22px;
}
.puce--vert { background: #DCFCE7; color: #14532D; }
@media (prefers-color-scheme: dark) { .puce--vert { background: #14532D; color: #DCFCE7; } }
.rangee--centre { justify-content: center; flex-wrap: wrap; }

.recherche {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; color: var(--discret);
}
.recherche__champ { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 16px; color: var(--texte); }

.grille-cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grille-cartes__plein { grid-column: 1 / -1; }
.tuile-carte {
  height: 100px; border-radius: 14px; padding: 14px; color: #FFFFFF; text-decoration: none;
  display: flex; flex-direction: column; justify-content: space-between; background: #334155;
}
.tuile-carte__nom { font-family: var(--titre); font-size: 18px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.tuile-carte__bas { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.92; }
.tuile-carte--ajout {
  background: var(--surface); color: var(--texte); border: 1.5px dashed var(--discret); cursor: pointer;
  align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600;
}
.tuile-carte--ajout svg { color: var(--action); }

.apercu-photo:empty { display: none; }
.apercu-photo img { width: 100%; max-height: 180px; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
.saisie--chiffres { font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.nuancier { display: flex; flex-wrap: wrap; gap: 10px; }
.nuancier__pastille {
  width: 44px; height: 44px; border-radius: 22px; border: 3px solid transparent; cursor: pointer; color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
}
.nuancier__pastille[aria-checked="true"] { border-color: var(--texte); }

/* Écran de caisse : toujours blanc, quel que soit le thème, pour les lecteurs optiques */
.caisse {
  min-height: 100dvh; background: #FFFFFF; color: #16202A; color-scheme: light;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 24px);
}
.caisse__haut { display: flex; align-items: center; justify-content: space-between; }
.caisse__allume { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #5B6673; }
.caisse__centre {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 0 16px;
}
.caisse__titre { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.caisse__titre .chapo { color: #5B6673; }
.caisse__pastille { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 8px; }
.caisse__code {
  width: 100%; max-width: 420px; border: 1px solid #E3E6EA; border-radius: 16px; padding: 24px 16px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; background: #FFFFFF;
}
.code-barres { width: 100%; height: 130px; }
.code-qr { width: 72%; max-width: 260px; height: auto; }
.caisse__numero {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 18px; letter-spacing: 2px;
  text-align: center; overflow-wrap: anywhere; color: #16202A;
}
.caisse__photo { width: 100%; border-radius: 10px; }
.segments--clair { background: #F0F2F4; }
.segments--clair .segments__bouton { min-width: 120px; padding: 0 12px; white-space: nowrap; }
.segments--clair .segments__bouton { color: #5B6673; }
.segments--clair .segments__bouton[aria-pressed="true"] { background: #FFFFFF; color: #16202A; }
.caisse__astuce { text-align: center; font-size: 13px; color: #5B6673; }
.caisse .bouton-retour { color: #16202A; }

/* ---------- Impression de la clé de secours ---------- */

@media print {
  body { background: #FFFFFF; color: #000000; }
  .onglets, .indicateur, .toast, .non-imprime { display: none !important; }
  .ecran { padding: 0; max-width: none; }
  .mots li { background: none; border: 1px solid #999999; }
}
