/* Notre Foyer — style doux inspiré des applis bancaires modernes :
   fond bleu-lavande clair, cartes blanches très arrondies, accent indigo unique,
   barre de navigation flottante en pilule, icônes rondes teintées. */
:root {
  /* --teinte : la couleur choisie par l'utilisateur (Réglages → Personnalisation).
     Le fond, les cartes secondaires et l'accent en sont dérivés. */
  --teinte: #5f5ff0;
  --bg: color-mix(in srgb, var(--teinte) 7%, #f6f7fb);
  --carte: #ffffff;
  --carte-2: color-mix(in srgb, var(--teinte) 5%, #f5f6fa);
  --texte: #161a2e;
  --doux: #5b6383;
  --tres-doux: #9aa2bd;
  --bord: color-mix(in srgb, var(--teinte) 8%, #e7e9f0);
  --primaire: var(--teinte);
  --primaire-doux: color-mix(in srgb, var(--teinte) 13%, #ffffff);
  --sur-primaire: var(--sur-primaire-clair, #ffffff);
  --accent-texte: var(--accent-clair, color-mix(in srgb, var(--teinte) 78%, #161a2e));  /* calculée pour rester lisible */
  --ok: #23a26d;
  --danger: #e2445c;
  --alerte: #f08a24;
  --nav-fond: rgba(255, 255, 255, .86);
  --ombre: 0 1px 2px rgba(40, 50, 110, .04), 0 6px 20px rgba(40, 50, 110, .06);
  --ombre-forte: 0 8px 28px rgba(40, 50, 110, .14);
  --rayon: 22px;
  --rayon-petit: 14px;
  --police: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --anim: .24s cubic-bezier(.2, .7, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: color-mix(in srgb, var(--teinte) 7%, #0c0e17);
    --carte: color-mix(in srgb, var(--teinte) 5%, #171a26);
    --carte-2: color-mix(in srgb, var(--teinte) 9%, #1f2331);
    --texte: #eceefa;
    --doux: #a0a7c4;
    --tres-doux: #6f7696;
    --bord: color-mix(in srgb, var(--teinte) 10%, #262a3a);
    --primaire: color-mix(in srgb, var(--teinte) 72%, #ffffff);
    --primaire-doux: color-mix(in srgb, var(--teinte) 25%, #171a26);
    --sur-primaire: #0c0e17;
    --accent-texte: var(--accent-sombre, var(--primaire));
    --ok: #3cc58a;
    --danger: #ff6b80;
    --alerte: #ffa04d;
    --nav-fond: color-mix(in srgb, var(--carte) 88%, transparent);
    --ombre: 0 1px 2px rgba(0, 0, 0, .3);
    --ombre-forte: 0 8px 28px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: color-mix(in srgb, var(--teinte) 7%, #0c0e17);
  --carte: color-mix(in srgb, var(--teinte) 5%, #171a26);
  --carte-2: color-mix(in srgb, var(--teinte) 9%, #1f2331);
  --texte: #eceefa;
  --doux: #a0a7c4;
  --tres-doux: #6f7696;
  --bord: color-mix(in srgb, var(--teinte) 10%, #262a3a);
  --primaire: color-mix(in srgb, var(--teinte) 72%, #ffffff);
  --primaire-doux: color-mix(in srgb, var(--teinte) 25%, #171a26);
  --sur-primaire: #0c0e17;
  --accent-texte: var(--accent-sombre, var(--primaire));
  --ok: #3cc58a;
  --danger: #ff6b80;
  --alerte: #ffa04d;
  --nav-fond: color-mix(in srgb, var(--carte) 88%, transparent);
  --ombre: 0 1px 2px rgba(0, 0, 0, .3);
  --ombre-forte: 0 8px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
/* Fond neutre (sans teinte) */
:root[data-fond="neutre"] { --bg: #f3f4f7; --carte-2: #f1f2f5; --bord: #e5e7ec; }
@media (prefers-color-scheme: dark) {
  :root[data-fond="neutre"]:not([data-theme="light"]) { --bg: #0d0e12; --carte: #17181d; --carte-2: #1f2026; --bord: #2a2b32; }
}
:root[data-fond="neutre"][data-theme="dark"] { --bg: #0d0e12; --carte: #17181d; --carte-2: #1f2026; --bord: #2a2b32; }
/* Texte plus grand */
:root[data-taille="grand"] { font-size: 112.5%; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--police);
  font-size: 1rem;
  background: var(--bg);
  transition: background-color .4s ease, color .4s ease;
  color: var(--texte);
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button, input, select, textarea { font-family: inherit; }
svg.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg);
}
.titres { text-align: center; min-width: 0; cursor: pointer; }
.topbar h1 { font-size: 1.3rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.sous-titre {
  font-size: .72rem; font-weight: 700; color: var(--doux); text-transform: uppercase; letter-spacing: .08em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pilule-boutons {
  display: flex; gap: 2px; background: var(--carte); border-radius: 99px; padding: 4px; box-shadow: var(--ombre);
}
.btn-icone {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: transparent; color: var(--texte); cursor: pointer; font-size: 1.2rem;
  transition: background var(--anim), transform .12s ease;
}
.btn-icone:hover { background: var(--carte-2); }
.btn-icone:active { transform: scale(.92); }
.btn-icone.seul { background: var(--carte); box-shadow: var(--ombre); }
.btn-icone.accent { background: var(--primaire); color: var(--sur-primaire); }
.btn-icone.accent:hover { background: var(--primaire); filter: brightness(1.06); }

main { max-width: 720px; margin: 0 auto; padding-block: 6px 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px; }

/* ---------- Boutons ---------- */
.btn {
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte);
  padding: 11px 18px; border-radius: 99px; cursor: pointer; font-size: .95rem; font-weight: 700;
  transition: transform .12s ease, background var(--anim), color var(--anim);
}
.btn:active { transform: scale(.96); }
.btn.primaire { background: var(--primaire); border-color: var(--primaire); color: var(--sur-primaire); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.petit { padding: 6px 12px; font-size: .85rem; }
.btn.large { width: 100%; }
.lien { background: none; border: 0; color: var(--accent-texte); font-weight: 700; cursor: pointer; padding: 4px 0; font-size: .9rem; }

/* ---------- Navigation flottante ---------- */
.navbar {
  position: fixed; z-index: 6;
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 560px; margin: 0 auto;
  display: flex; gap: 2px; padding: 6px;
  background: var(--nav-fond); border-radius: 32px; box-shadow: var(--ombre-forte);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
}
.navbar button {
  flex: 1; min-width: 0; overflow: hidden; background: none; border: 0; color: var(--doux); cursor: pointer;
  padding: 8px 2px 7px; border-radius: 26px; font-size: .68rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: background var(--anim), color var(--anim), transform .12s ease;
}
.navbar button:active { transform: scale(.94); }
.navbar button.actif { color: var(--accent-texte); background: var(--carte-2); }

/* ---------- Cartes ---------- */
.carte { background: var(--carte); border-radius: var(--rayon); padding: 16px 18px; box-shadow: var(--ombre); }
.carte h3 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.titre-section { font-size: 1.05rem; font-weight: 800; margin: 8px 2px -4px; display: flex; justify-content: space-between; align-items: baseline; }
.titre-section .lien { font-size: .85rem; }

.salut { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 2px 0; line-height: 1.15; text-wrap: balance; }
.salut-date { color: var(--doux); margin: 2px 2px 0; }
.salut-date::first-letter { text-transform: uppercase; }

/* Grand chiffre centré */
.hero { text-align: center; padding: 22px 18px; }
.hero .lib { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--doux); }
.hero .val { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.hero .sous { color: var(--doux); }
.hero .barre { margin: 14px auto 0; max-width: 320px; }

.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--carte); border-radius: var(--rayon-petit); padding: 12px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 6px; }
.stat .val { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .lib { color: var(--doux); font-size: .78rem; font-weight: 700; line-height: 1.2; }
.stat .rond { width: 34px; height: 34px; }
.stat .rond svg.ico { width: 18px; height: 18px; }
.stat[data-aller] { cursor: pointer; transition: transform var(--anim); }
.stat[data-aller]:hover { transform: translateY(-2px); }

/* Sélecteur de mois */
.mois { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mois strong { font-size: 1.15rem; font-weight: 800; }
.mois strong::first-letter { text-transform: uppercase; }
.btn-cercle {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--doux); color: var(--doux);
  background: none; display: grid; place-items: center; cursor: pointer; transition: transform .12s ease;
}
.btn-cercle svg.ico { width: 16px; height: 16px; stroke-width: 2.4; }
.btn-cercle:active { transform: scale(.9); }

/* Contrôle segmenté */
.segments {
  display: flex; gap: 2px; padding: 4px; background: var(--carte); border-radius: 99px; box-shadow: var(--ombre);
  overflow-x: auto; scrollbar-width: none;
}
.carte .segments { box-shadow: none; background: var(--carte-2); margin-top: 12px; }
.segments.six { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 20px; }
.segments.six button { padding-inline: 6px; }
.segments::-webkit-scrollbar { display: none; }
.segments button {
  flex: 1; white-space: nowrap; border: 0; background: none; color: var(--doux); cursor: pointer;
  padding: 9px 14px; border-radius: 99px; font-size: .92rem; font-weight: 700;
  transition: background var(--anim), color var(--anim);
}
.segments button.actif { background: var(--primaire); color: var(--sur-primaire); }

/* ---------- Listes ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; align-items: center; gap: 12px; padding: 11px 0; transition: opacity var(--anim); }
.liste li + li { border-top: 1px solid var(--bord); }
.liste .info { flex: 1; min-width: 0; cursor: pointer; }
.liste .info .t { font-weight: 700; overflow-wrap: anywhere; transition: color var(--anim); }
.liste .info .s { color: var(--doux); font-size: .84rem; margin-top: 1px; }
.liste li.fait { opacity: .55; }
.liste li.fait .t { text-decoration: line-through; }
.droite { text-align: right; flex-shrink: 0; }
.droite .s { color: var(--doux); font-size: .8rem; }

/* Case à cocher ronde */
.liste input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; flex-shrink: 0;
  border-radius: 50%; border: 2px solid var(--tres-doux); cursor: pointer; display: grid; place-items: center;
  transition: background var(--anim), border-color var(--anim);
}
.liste input[type=checkbox]::after {
  content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform .18s ease;
}
.liste input[type=checkbox]:checked { background: var(--ok); border-color: var(--ok); }
.liste input[type=checkbox]:checked::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }

/* Icône ronde teintée */
.rond {
  --c: var(--primaire);
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 16%, var(--carte)); color: var(--c);
}
.rond svg.ico { width: 20px; height: 20px; }

.pastille {
  --c: var(--primaire);
  display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 800; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 15%, var(--carte)); color: color-mix(in srgb, var(--c) 80%, var(--texte));
}
.montant { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.montant.neg { color: var(--texte); }
.montant.pos { color: var(--ok); }
.montant.alerte { color: var(--danger); }
.vide { color: var(--doux); text-align: center; padding: 18px 0; justify-content: center; }
.retard { color: var(--danger) !important; }

.filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtres input {
  padding: 13px 16px; border-radius: 99px; border: 0; background: var(--carte); color: var(--texte);
  box-shadow: var(--ombre); font-size: 1rem; min-width: 0;
}

.barre { height: 10px; background: var(--carte-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.barre > div { height: 100%; background: var(--primaire); border-radius: 99px; transition: width .6s ease; }
.barre.alerte > div { background: var(--danger); }

.ligne-cat { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.ligne-cat + .ligne-cat { border-top: 1px solid var(--bord); }
.ligne-cat .corps { flex: 1; min-width: 0; }
.ligne-cat .haut { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }

.jour-titre { font-weight: 800; margin: 6px 2px -6px; color: var(--doux); font-size: .86rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Fenêtres ---------- */
dialog {
  border: 0; border-radius: 26px; padding: 0;
  width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 40px);
  background: var(--carte); color: var(--texte); box-shadow: var(--ombre-forte);
}
dialog::backdrop { background: rgba(14, 17, 40, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog form, .assistant-corps { padding: 22px; }
dialog h2 { margin: 0 0 16px; font-size: 1.25rem; font-weight: 800; }
.champ { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.champ label { font-size: .84rem; font-weight: 700; color: var(--doux); }
.champ input, .champ select, .champ textarea {
  padding: 12px 14px; border-radius: var(--rayon-petit); border: 1.5px solid transparent;
  background: var(--carte-2); color: var(--texte); font-size: 1rem; transition: border-color var(--anim);
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--primaire); }
.champ.case { flex-direction: row; align-items: center; gap: 10px; }
.champ.case input { width: 22px; height: 22px; accent-color: var(--primaire); }
.modale-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.espace { flex: 1; }

/* Champs des réglages (membres, budgets) */
.liste input[type=color], .champ-couleur {
  -webkit-appearance: none; appearance: none; width: 34px; height: 34px; border: 0; padding: 0;
  border-radius: 50%; background: none; cursor: pointer; flex-shrink: 0;
}
.liste input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.liste input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.liste input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
input.btn { text-align: left; background: var(--carte-2); border-color: transparent; font-weight: 700; cursor: text; min-width: 0; }
input.btn:focus { outline: none; border-color: var(--primaire); }

/* ---------- Personnalisation ---------- */
.reglage { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.reglage + .reglage { border-top: 1px solid var(--bord); }
.reglage-titre { font-weight: 700; font-size: .92rem; }
.reglage .segments { margin-top: 0; }
.nuancier { display: flex; flex-wrap: wrap; gap: 10px; }
.pastille-couleur {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  transition: transform .15s ease, box-shadow var(--anim);
}
.pastille-couleur:active { transform: scale(.9); }
.pastille-couleur.actif { box-shadow: 0 0 0 3px var(--carte), 0 0 0 5px var(--c); }
.pastille-couleur.libre {
  background: conic-gradient(#e2445c, #f0a020, #e8d530, #23a26d, #18a8b8, #5f5ff0, #b07ad8, #e2445c);
  overflow: hidden;
}
.pastille-couleur.libre input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.apercu-perso { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--carte-2); }
.apercu-perso .t { font-weight: 800; }
.apercu-perso .s { color: var(--doux); font-size: .84rem; }

/* ---------- Foyers ---------- */
#foyers-liste li { padding: 12px; border-radius: 16px; border: 0; transition: background var(--anim); }
#foyers-liste li + li { margin-top: 4px; }
#foyers-liste li.foyer-actif { background: var(--primaire-doux); }

/* ---------- Assistant ---------- */
.aide { color: var(--doux); margin: -8px 0 14px; font-size: .92rem; }
.assistant-saisie { display: flex; gap: 8px; align-items: flex-start; }
.assistant-saisie textarea {
  flex: 1; min-width: 0; padding: 13px 14px; border-radius: 18px; border: 1.5px solid transparent;
  background: var(--carte-2); color: var(--texte); font-size: 1rem; resize: none;
}
.assistant-saisie textarea:focus { outline: none; border-color: var(--primaire); }
.btn-icone.micro { background: var(--primaire-doux); color: var(--accent-texte); width: 50px; height: 50px; }
.btn-icone.micro.ecoute { background: var(--danger); color: #fff; animation: respire 1.4s ease-in-out infinite; }
@keyframes respire { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 18%, transparent); } }
.exemples { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.puce {
  border: 0; background: var(--carte-2); color: var(--doux); font-weight: 700;
  border-radius: 99px; padding: 7px 12px; font-size: .8rem; cursor: pointer;
  transition: background var(--anim), color var(--anim);
}
.puce:hover { background: var(--primaire-doux); color: var(--accent-texte); }
.apercu {
  background: var(--primaire-doux); border-radius: 18px; padding: 14px; margin-bottom: 12px;
  line-height: 1.5; animation: monte .25s var(--anim);
}
.apercu .s { color: var(--doux); font-size: .86rem; }
.reponse { margin: 6px 0 0; padding-left: 18px; }
.reponse li { padding: 2px 0; }
.apercu p { margin: 4px 0 0; }


/* =====================================================
   Modules : calendrier, planning, repas, envies, etc.
   ===================================================== */
.segments.principal { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 68px); z-index: 4; }
.btn-icone.mini { width: 34px; height: 34px; color: var(--tres-doux); }
.btn-icone.mini svg.ico { width: 18px; height: 18px; }
.btn-icone.favori { color: #e69320; }
.btn-icone.favori svg.ico { fill: currentColor; }
.lien.retour { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; margin: -4px 0 -6px -4px; }
.lien.retour svg.ico { width: 18px; height: 18px; }
.legende { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 2px; font-size: .78rem; color: var(--doux); font-weight: 700; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i, .cal-points i, .moment i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }

/* Calendrier mois */
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.cal-entete { text-align: center; font-size: .72rem; font-weight: 800; color: var(--tres-doux); padding-bottom: 2px; }
.cal-jour {
  position: relative; aspect-ratio: 1; min-width: 0; border: 0; border-radius: 12px; background: var(--carte-2); color: var(--texte);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 5px 2px 3px;
  cursor: pointer; font-weight: 700; font-size: .9rem; transition: background var(--anim), transform .12s ease;
}
.cal-jour:active { transform: scale(.94); }
.cal-jour.we { background: color-mix(in srgb, var(--carte-2) 60%, var(--bg)); }
.cal-jour.ferie .num { color: var(--danger); }
.cal-jour.auj { box-shadow: inset 0 0 0 2px var(--primaire); }
.cal-jour.choisi { background: var(--primaire); color: var(--sur-primaire); }
.cal-jour.choisi .num { color: inherit; }
.cal-points { display: flex; gap: 2px; }
.cal-points i { width: 6px; height: 6px; }
.cal-jour.choisi .cal-points i { box-shadow: 0 0 0 1.5px var(--sur-primaire); }
.cal-mini-service, .cal-service {
  font-size: .62rem; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 5px;
  background: color-mix(in srgb, var(--c) 20%, var(--carte)); color: var(--c);
}
.cal-service { font-size: .8rem; padding: 4px 7px; border-radius: 7px; background: var(--c); color: #fff; margin-top: 2px; }
.cal-vide { aspect-ratio: 1; }

/* Calendrier année */
.annee { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; margin-top: 14px; }
@media (min-width: 560px) { .annee { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.annee-titre { border: 0; background: none; color: var(--texte); font-weight: 800; font-size: .9rem; padding: 0 0 2px; cursor: pointer; text-transform: capitalize; }
.cal-grille.mini { gap: 1px; margin-top: 4px; }
.cal-grille.mini .cal-jour { border-radius: 6px; padding: 0; font-size: .64rem; background: none; justify-content: center; gap: 0; font-weight: 600; }
.cal-grille.mini .cal-jour .cal-points { position: absolute; bottom: 1px; }
.cal-grille.mini .cal-jour .cal-points i { width: 4px; height: 4px; }
.cal-grille.mini .cal-jour.ferie { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.cal-grille.mini .cal-jour.auj { box-shadow: none; background: var(--primaire); color: var(--sur-primaire); }
.cal-grille.mini .cal-jour.auj .num { color: inherit; }
.annee-liste { display: grid; gap: 14px; }
.annee-mois-nom { font-weight: 800; text-transform: capitalize; margin-bottom: 4px; color: var(--doux); font-size: .82rem; letter-spacing: .05em; }
.moment { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .92rem; }
.moment[data-edit-evt] { cursor: pointer; }
.moment-jour { width: 22px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--doux); }
.moment-t { min-width: 0; overflow-wrap: anywhere; }

/* Planning de travail */
.palette { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pilule-service {
  border: 1.5px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 10%, var(--carte));
  color: var(--texte); border-radius: 99px; padding: 7px 12px; cursor: pointer; font-weight: 700; font-size: .86rem;
  display: inline-flex; align-items: center; gap: 6px; transition: background var(--anim), color var(--anim), transform .12s ease;
}
.pilule-service b { color: var(--c); }
.pilule-service small { color: var(--doux); font-weight: 600; }
.pilule-service svg.ico { width: 15px; height: 15px; }
.pilule-service.actif { background: var(--c); color: #fff; border-color: var(--c); }
.pilule-service.actif b, .pilule-service.actif small { color: #fff; }
.plan-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.plan-stats div { flex: 1 1 70px; background: var(--carte-2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; }
.plan-stats b { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-stats span { color: var(--doux); font-size: .78rem; font-weight: 700; }
.puces-jours { display: flex; flex-wrap: wrap; gap: 6px; }
.puce-jour { background: color-mix(in srgb, var(--ok) 14%, var(--carte)); color: var(--ok); font-weight: 800; border-radius: 99px; padding: 6px 12px; font-size: .84rem; }

/* Graphique */
.graph { width: 100%; height: auto; display: block; margin-top: 6px; }
.graph-val { font-size: 10px; font-weight: 700; fill: var(--doux); font-family: var(--police); }
.graph-lib { font-size: 11px; font-weight: 700; fill: var(--tres-doux); font-family: var(--police); text-transform: capitalize; }
.graph-lib.fort { fill: var(--texte); }

/* Cagnottes */
/* Cagnottes */
.carte.cagnotte { display: flex; flex-direction: column; gap: 10px; }
.cg-tete { display: flex; align-items: center; gap: 12px; }
.cg-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cg-titre b { font-size: 1.02rem; overflow-wrap: anywhere; }
.cg-titre small { color: var(--doux); font-size: .8rem; font-weight: 600; }
.cg-montant { display: flex; align-items: baseline; gap: 8px; }
.cg-montant span { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cg-montant small { color: var(--doux); font-weight: 600; flex: 1; }
.cg-montant b { color: var(--accent-texte); font-size: .95rem; }
.cagnotte.atteinte .cg-montant b { color: #22a06b; }
.barre.ok > div { background: #22a06b; }
.cg-etat { margin: 0; color: var(--doux); font-size: .86rem; }
.cg-qui { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; border-top: 1px solid var(--bord); padding-top: 10px; }
.cg-membre { display: grid; grid-template-columns: 26px minmax(60px, auto) 1fr auto; align-items: center; gap: 10px; font-size: .88rem; }
.cg-membre .avatar { width: 26px; height: 26px; font-size: .7rem; }
.cg-membre span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-membre .barre { height: 6px; margin: 0; }
.cg-membre b { font-variant-numeric: tabular-nums; }
.cg-bas { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cg-bas .cg-histo { flex-basis: 100%; order: 3; }
.cg-finir { margin-left: auto; }
.cg-finir svg.ico { width: 15px; height: 15px; vertical-align: -2px; }
.cg-archives-btn { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding: 10px 6px; border: 0; background: none; color: var(--doux);
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.cg-archives-btn span { flex: 1; text-align: left; }
.cg-archives-btn svg.ico { width: 17px; height: 17px; }
.cg-archives { margin-top: 4px; }
.cg-archives .montant { color: var(--doux); }
.cg-fin { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cg-fin .rond { width: 56px; height: 56px; } .cg-fin .rond svg.ico { width: 26px; height: 26px; }
.cg-fin h2 { margin: 8px 0 0; }
.cg-fin-choix { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.cg-fin-choix .btn { width: 100%; justify-content: center; padding-block: 13px; }
.cg-fin-choix .btn svg.ico { width: 17px; height: 17px; vertical-align: -3px; margin-right: 4px; }
.carte.cagnotte[data-m] { cursor: pointer; transition: transform .15s; }
.carte.cagnotte[data-m]:active { transform: scale(.985); }
.btn.ok { background: #22a06b; color: #fff; border-color: #22a06b; }
.btn.ok svg.ico { width: 15px; height: 15px; vertical-align: -2px; }
.cg-voir { align-self: flex-start; font-size: .84rem; }
.cg-histo li .avatar { width: 28px; height: 28px; font-size: .72rem; }
.cagnotte.terminee { opacity: .8; }
.cg-vide { width: 100%; display: flex; align-items: center; gap: 12px; border: 2px dashed var(--bord); background: none; box-shadow: none; cursor: pointer; font: inherit; font-weight: 700; color: var(--doux); }
.cagnotte-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--doux); font-size: .86rem; }
.cagnotte-membres { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: .84rem; font-weight: 700; align-items: center; }

/* Repas */
.ligne-repas { gap: 8px !important; }
.ligne-repas.auj .repas-jour b { color: var(--accent-texte); }
.repas-jour { width: 40px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.repas-jour b { text-transform: capitalize; font-size: .82rem; }
.repas-jour span { font-weight: 800; font-size: 1.15rem; }
.case-repas {
  flex: 1; min-width: 0; min-height: 52px; border: 1.5px dashed var(--bord); background: none; border-radius: 14px; color: var(--tres-doux);
  cursor: pointer; text-align: left; padding: 6px 10px; font-weight: 700; font-size: .9rem; display: flex; flex-direction: column; justify-content: center;
  overflow-wrap: anywhere; transition: background var(--anim);
}
.case-repas small { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tres-doux); }
.case-repas.pleine { border-style: solid; border-color: transparent; background: color-mix(in srgb, #e8604c 10%, var(--carte)); color: var(--texte); }

/* Envies */
.envies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .envies { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.envie { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; display: flex; flex-direction: column; transition: opacity var(--anim); }
.envie.offert { opacity: .55; }
.envie-image {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 100%;
  background: color-mix(in srgb, #e05aa6 10%, var(--carte-2)); color: color-mix(in srgb, #e05aa6 60%, var(--carte));
}
.envie-image svg.ico { width: 36px; height: 36px; }
.envie-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 8px; }
.envie-badge { position: absolute; top: 8px; left: 8px; background: #e05aa6; color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; }
.envie-corps { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.envie-corps .t { font-weight: 800; font-size: .92rem; line-height: 1.25; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.envie-bas { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; }
.envie-boutons { display: flex; gap: 6px; }
.envie-boutons .btn { flex: 1; text-align: center; text-decoration: none; padding-inline: 8px; }
.envie-apercu-form { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.envie-vignette { width: 84px; height: 84px; border-radius: 16px; background: var(--carte-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: var(--tres-doux); font-size: .7rem; text-align: center; }
.envie-vignette img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.envie-actions-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.envie-actions-form .btn { display: inline-flex; align-items: center; gap: 6px; }
.envie-actions-form .btn svg.ico { width: 16px; height: 16px; }
.envie-actions-form .s { color: var(--doux); font-size: .8rem; }

/* Fiches */
.infos-fiche { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.infos-fiche li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--carte-2); border-radius: 12px; font-size: .92rem; }
.infos-fiche li span { color: var(--doux); }
.infos-fiche li b { text-align: right; overflow-wrap: anywhere; }
.rappel-fiche { margin-top: 10px; display: flex; align-items: center; gap: 8px; color: #b86e0b; font-weight: 700; font-size: .88rem; }
.rappel-fiche svg.ico { width: 18px; height: 18px; }

/* Mur de petits mots */
.mot { background: color-mix(in srgb, #e05aa6 8%, var(--carte-2)); border-radius: 16px 16px 16px 4px; padding: 10px 12px; margin-top: 8px; }
.mot-texte { font-weight: 700; overflow-wrap: anywhere; }
.mot-pied { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .78rem; color: var(--doux); }
.mot-pied .btn-icone { margin-left: auto; width: 26px; height: 26px; }
.mot-form { margin-top: 10px; flex-wrap: nowrap; }
.mot-form select { border: 0; background: var(--carte-2); color: var(--texte); border-radius: 99px; padding: 10px 8px; font-weight: 700; max-width: 30%; min-width: 0; }
.mot-form input { min-width: 0; }
.mot-form input { box-shadow: none; background: var(--carte-2); padding: 10px 14px; }

/* Rappels */
.rappels li .info { cursor: pointer; }
.rappels li > svg.ico { color: var(--tres-doux); width: 18px; height: 18px; }

/* Page Plus */
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .modules { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.module {
  border: 0; background: var(--carte); box-shadow: var(--ombre); border-radius: var(--rayon); padding: 16px 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; color: var(--texte); font-weight: 800; font-size: .95rem; text-align: left;
  transition: transform .12s ease;
}
.module:active { transform: scale(.96); }
#recherche { width: 100%; }

/* ---------- Barre de navigation : en bas (téléphone) ou à gauche (ordinateur), au choix ---------- */
.marque, .navbar .seulement-gauche { display: none; }
.navbar button span { line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) { :root:not([data-barre="gauche"]) .navbar button { font-size: .62rem; padding-inline: 1px; } }
:root[data-barre="gauche"] body { padding-bottom: 32px; padding-left: 240px; }
:root[data-barre="gauche"] .navbar {
  top: 0; bottom: 0; left: 0; right: auto; width: 240px; max-width: none; margin: 0;
  flex-direction: column; justify-content: flex-start; gap: 4px; overflow-y: auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 14px calc(20px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  border-radius: 0; box-shadow: none; border-right: 1px solid var(--bord);
  background: var(--carte); -webkit-backdrop-filter: none; backdrop-filter: none;
}
:root[data-barre="gauche"] .navbar .marque { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 800; font-size: 1.15rem; color: var(--texte); }
:root[data-barre="gauche"] .navbar .marque span { width: 34px; height: 34px; border-radius: 11px; background: var(--primaire); color: var(--sur-primaire); display: grid; place-items: center; }
:root[data-barre="gauche"] .navbar .marque svg.ico { width: 20px; height: 20px; }
:root[data-barre="gauche"] .navbar button { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; font-size: .95rem; text-align: left; }
:root[data-barre="gauche"] .navbar button.actif { background: var(--primaire-doux); }
:root[data-barre="gauche"] .navbar .en-bas { margin-top: auto; }
:root[data-barre="gauche"] .toast { left: calc(50% + 120px); bottom: 32px; }
/* À gauche sur un téléphone : rail compact avec icônes */
@media (max-width: 899px) {
  :root[data-barre="gauche"] body { padding-left: calc(76px + env(safe-area-inset-left, 0px)); padding-bottom: 24px; }
  :root[data-barre="gauche"] .navbar { width: calc(76px + env(safe-area-inset-left, 0px)); padding-inline: max(6px, env(safe-area-inset-left, 0px)) 6px; gap: 2px; }
  :root[data-barre="gauche"] .navbar .marque { display: none; }
  :root[data-barre="gauche"] .navbar button { flex-direction: column; justify-content: center; text-align: center; gap: 3px; padding: 9px 2px; font-size: .64rem; border-radius: 16px; }
  :root[data-barre="gauche"] .topbar, :root[data-barre="gauche"] main { padding-left: 12px; }
  :root[data-barre="gauche"] .toast { left: calc(50% + 38px); }
}
/* En bas sur un ordinateur : pilule centrée */
:root[data-barre="bas"] .navbar { max-width: 640px; }

/* ---------- Grand écran : contenu plus large ---------- */
@media (min-width: 900px) {
  .topbar { padding-block: 18px; max-width: 980px; margin: 0 auto; }
  .titres { text-align: left; }
  .topbar h1 { font-size: 1.6rem; }
  main { max-width: 980px; }
  .grille { gap: 14px; }
  .envies { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .annee { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .modules { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .segments.principal { top: 86px; }
  dialog { width: min(520px, calc(100vw - 48px)); }
}
@media (min-width: 1280px) { main, .topbar { max-width: 1080px; } }

/* ---------- Profils ---------- */
.avatar {
  --c: var(--primaire);
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  display: inline-grid; place-items: center; font-weight: 800; font-size: .9rem;
  background: color-mix(in srgb, var(--c) 22%, var(--carte)); color: color-mix(in srgb, var(--c) 60%, var(--texte));
}
.avatar.grand { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar.entete { width: 44px; height: 44px; font-size: 1.05rem; }
#btn-foyer { position: relative; padding: 0; overflow: visible; }
.badge-foyer {
  position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--carte); box-shadow: var(--ombre); display: grid; place-items: center; font-size: .72rem;
}
.pastille.avec-photo { display: inline-flex; align-items: center; gap: 5px; padding-left: 3px; }
.pastille.avec-photo img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.avatar-bouton { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; flex-shrink: 0; }
.avatar-bouton em {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .6rem; font-weight: 800;
  background: var(--primaire); color: var(--sur-primaire); padding: 1px 5px; border-radius: 99px;
}
.profil-photo { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profil-ligne {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; cursor: pointer;
  background: var(--carte-2); border-radius: 18px; padding: 10px 12px; margin: -4px 0 14px; color: var(--texte);
}
.profil-ligne .profil-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.avatar { aspect-ratio: 1; }
.profil-ligne small { color: var(--doux); font-size: .8rem; }
.profil-ligne svg.ico { color: var(--tres-doux); width: 18px; height: 18px; }

/* ---------- Réglages de la barre ---------- */
.liste-onglets li { gap: 8px; }
.liste-onglets li.onglet-off .t { color: var(--doux); font-weight: 600; }
.liste-onglets .rond { width: 36px; height: 36px; }
.liste-onglets .rond svg.ico { width: 18px; height: 18px; }
.btn-icone.descendre svg.ico { transform: rotate(180deg); }
.btn-icone:disabled { opacity: .3; cursor: default; }
.interrupteur { position: relative; width: 44px; height: 26px; flex-shrink: 0; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.interrupteur span { position: absolute; inset: 0; border-radius: 99px; background: var(--bord); transition: background var(--anim); }
.interrupteur span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform var(--anim);
}
.interrupteur input:checked + span { background: var(--primaire); }
.interrupteur input:checked + span::after { transform: translateX(18px); }
.interrupteur input:disabled + span { opacity: .55; }
.interrupteur input:focus-visible + span { outline: 2px solid var(--primaire); outline-offset: 2px; }
.apercu-barre { display: flex; gap: 4px; padding: 6px; background: var(--carte-2); border-radius: 22px; overflow-x: auto; }
.apercu-barre span { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--doux); padding: 6px 2px; }
.apercu-barre span:first-child { color: var(--accent-texte); background: var(--carte); border-radius: 16px; }
.apercu-barre small { font-size: .6rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apercu-barre svg.ico { width: 18px; height: 18px; }
.apercu-barre.gauche { flex-direction: column; width: 150px; border-radius: 16px; }
.apercu-barre.gauche span { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 6px 10px; min-width: 0; }
.apercu-barre.gauche small { font-size: .78rem; }

/* Barre du bas avec 7 onglets : un peu plus compacte */
:root[data-barre="bas"] .navbar:has(> button:nth-of-type(7)) button { font-size: .62rem; padding-inline: 0; }
:root[data-barre="bas"] .navbar:has(> button:nth-of-type(7)) svg.ico { width: 21px; height: 21px; }

/* Budget : répartition et partage */
.repartition { display: flex; gap: 3px; height: 14px; border-radius: 99px; overflow: hidden; background: var(--carte-2); margin-top: 4px; }
.repartition i { display: block; background: var(--c); min-width: 0; transition: flex .5s ease; }
.ligne-partage { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.ligne-partage .avatar { width: 30px; height: 30px; font-size: .8rem; }
.membre-partage { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.membre-partage + .membre-partage { border-top: 1px solid var(--bord); }
.membre-partage .corps { flex: 1; min-width: 0; }
.membre-partage .haut { display: flex; justify-content: space-between; gap: 8px; }
.membre-partage .s { color: var(--doux); font-size: .82rem; margin-top: 4px; }
.choix-partage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choix-partage .choix { padding: 14px 12px; gap: 6px; }
.choix-partage .choix small { font-size: .76rem; }
.choix-icone {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 4px;
  background: var(--carte); color: var(--accent-texte); box-shadow: var(--ombre);
}
.choix-icone:has(b) { display: flex; align-items: center; justify-content: center; gap: 3px; font-size: .78rem; }
.choix-icone i { width: 2px; height: 22px; background: var(--primaire); border-radius: 2px; transform: rotate(20deg); }
.choix-icone svg.ico { width: 26px; height: 26px; }
.choix.actif .choix-icone { background: var(--primaire); color: var(--sur-primaire); }
.choix.actif .choix-icone i { background: var(--sur-primaire); }

/* Choix du style de barre, avec aperçu dessiné */
.choix-barre { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choix {
  border: 2px solid transparent; background: var(--carte-2); border-radius: 18px; padding: 10px 8px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--texte); text-align: center;
  transition: border-color var(--anim), background var(--anim), transform .12s ease;
}
.choix:active { transform: scale(.97); }
.choix.actif { border-color: var(--primaire); background: var(--primaire-doux); }
.choix b { font-size: .88rem; }
.choix small { font-size: .72rem; color: var(--doux); line-height: 1.25; }
.mini-ecran {
  position: relative; width: 64px; height: 84px; border-radius: 12px; background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--bord); margin-bottom: 6px; overflow: hidden; display: block;
}
.mini-ecran i { position: absolute; display: block; border-radius: 4px; background: var(--carte); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.mini-ecran .m-titre { left: 10px; right: 10px; top: 8px; height: 6px; background: var(--tres-doux); opacity: .5; }
.mini-ecran .m-carte { left: 8px; right: 8px; height: 16px; }
.mini-ecran .m-carte:nth-child(2) { top: 20px; }
.mini-ecran .m-carte:nth-child(3) { top: 40px; }
.mini-ecran .m-barre { background: var(--primaire); }
.mini-ecran.bas .m-barre { left: 9px; right: 9px; bottom: 7px; height: 11px; border-radius: 99px; }
.mini-ecran.gauche .m-barre { left: 0; top: 0; bottom: 0; width: 15px; border-radius: 0; }
.mini-ecran.gauche .m-titre, .mini-ecran.gauche .m-carte { left: 21px; }
.mini-ecran.auto { width: 84px; }
.mini-ecran.auto .m-barre { left: 0; top: 0; bottom: 0; width: 13px; border-radius: 0; }
.mini-ecran.auto .m-titre, .mini-ecran.auto .m-carte { left: 18px; right: 34px; }
.mini-ecran.auto::after {
  content: ""; position: absolute; right: 6px; top: 14px; width: 22px; height: 40px; border-radius: 6px;
  background: var(--carte); box-shadow: inset 0 0 0 1.5px var(--bord), inset 0 -7px 0 -3px var(--primaire);
}

.version-appli { text-align: center; color: var(--tres-doux); font-size: .8rem; margin: 6px 0 0; }

.ajouts-rapides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.ajouts-rapides .module { padding: 12px; gap: 8px; flex-direction: row; align-items: center; background: var(--carte-2); box-shadow: none; font-size: .9rem; }
.ajouts-rapides .module .rond { width: 36px; height: 36px; }

/* ---------- Espaces (types : maison, vacances, travail…) ---------- */
.types-espace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 38vh; overflow-y: auto; padding: 2px; }
@media (min-width: 560px) { .types-espace { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: none; } }
.type-espace {
  --c: var(--primaire);
  border: 2px solid transparent; background: var(--carte-2); border-radius: 16px; padding: 10px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 2px; color: var(--texte); transition: border-color var(--anim), background var(--anim);
}
.type-espace.actif { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--carte)); }
.type-espace b { font-size: .92rem; }
.type-espace small { color: var(--doux); font-size: .72rem; line-height: 1.3; }
.type-emoji { font-size: 1.4rem; line-height: 1; margin-bottom: 4px; }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.emojis button { width: 40px; height: 40px; border-radius: 12px; border: 2px solid transparent; background: var(--carte-2); font-size: 1.2rem; cursor: pointer; }
.emojis button.actif { border-color: var(--primaire); background: var(--primaire-doux); }
.deux-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.espace-hero { background: linear-gradient(160deg, color-mix(in srgb, var(--primaire) 18%, var(--carte)), var(--carte) 70%); }
#foyers-liste li { box-shadow: inset 4px 0 0 var(--c, transparent); }
.mini-justif { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.bouton-statut { border: 0; cursor: pointer; margin-top: 4px; }
#form-e-valise select { border: 0; background: var(--carte-2); color: var(--texte); border-radius: 99px; padding: 0 10px; font-weight: 700; max-width: 34%; }
#form-e-valise input { box-shadow: none; background: var(--carte-2); }

/* ---------- Sélecteur de couleur maison ---------- */
#choix-couleur { width: min(400px, calc(100vw - 24px)); }
.cc-apercu { display: flex; justify-content: center; margin: 4px 0 20px; }
.cc-rond { width: 96px; height: 96px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), var(--ombre); flex-shrink: 0; transition: background .15s ease; }
.cc-hex { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cc-hex label, .cc-titre { font-size: .82rem; font-weight: 700; color: var(--doux); }
.cc-hex input { border: 1.5px solid transparent; background: var(--carte-2); color: var(--texte); border-radius: 99px; padding: 10px 14px; font: inherit; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cc-hex input:focus { outline: none; border-color: var(--primaire); }
.cc-reglage { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cc-curseur {
  -webkit-appearance: none; appearance: none; width: 100%; height: 16px; border-radius: 99px; margin: 0; cursor: pointer;
  background: var(--fond, var(--carte-2)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.cc-teinte { --fond: linear-gradient(90deg, #f25 0%, #f80 9%, #fc0 17%, #6c3 30%, #1b9 42%, #19c 55%, #45e 66%, #85e 76%, #d4a 88%, #f25 100%); }
.cc-curseur::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--pouce, #fff);
  border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transition: transform .12s ease;
}
.cc-curseur::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--pouce, #fff); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.cc-curseur:active::-webkit-slider-thumb { transform: scale(1.12); }
.cc-curseur:focus-visible { outline: 2px solid var(--primaire); outline-offset: 4px; }
.cc-nuances { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; }
.cc-nuances .pastille-couleur { width: 100%; height: auto; aspect-ratio: 1; max-width: 38px; justify-self: center; }
.champ-nuancier { gap: 8px; }
.champ-nuancier .pastille-couleur { width: 34px; height: 34px; }
.pastille-couleur.libre span { position: absolute; inset: 5px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }

/* Grille d'icônes des catégories */
.grille-icones { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 380px) { .grille-icones { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grille-icones button {
  --c: var(--primaire);
  aspect-ratio: 1; border: 2px solid transparent; border-radius: 12px; background: var(--carte-2); color: var(--doux);
  display: grid; place-items: center; cursor: pointer; transition: background var(--anim), color var(--anim), border-color var(--anim);
}
.grille-icones button svg.ico { width: 19px; height: 19px; }
.grille-icones button.actif { background: color-mix(in srgb, var(--c) 18%, var(--carte)); color: var(--c); border-color: var(--c); }

/* ---------- Message (espace Famille) ---------- */
.message-texte {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer; color: var(--texte);
  background: color-mix(in srgb, var(--primaire) 9%, var(--carte-2)); border-radius: 16px 16px 16px 4px;
  padding: 12px 14px; font-weight: 700; font-size: 1.02rem; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap;
  animation: message .3s ease;
}
@keyframes message { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.message-pied { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .8rem; color: var(--doux); }
.message-reste { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; opacity: .8; }
.message-reste svg.ico { width: 13px; height: 13px; }
.message-effacer { margin-left: auto; background: var(--carte-2); border: 0; color: var(--doux); border-radius: 99px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.message-form { display: flex; gap: 8px; align-items: flex-end; }
.message-form textarea {
  flex: 1; min-width: 0; resize: none; background: var(--carte-2); border: 0; border-radius: 16px; box-shadow: none;
  color: var(--texte); padding: 10px 14px; font-size: .95rem; line-height: 1.35;
}
.message-btn { background: var(--primaire); color: #fff; border: 0; border-radius: 99px; padding: 10px 16px; font-weight: 800; cursor: pointer; }

/* ---------- Tâches faites ---------- */
.compteur { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--carte-2); color: var(--doux); font-size: .78rem; font-weight: 800; margin-left: 6px; margin-right: auto; }
.taches-faites .liste li { opacity: .62; }
.taches-faites .liste li .t { text-decoration: line-through; }
.ligne-cat.cliquable { cursor: pointer; border-radius: 12px; transition: background var(--anim); }
.ligne-cat.cliquable:hover { background: var(--carte-2); }

/* ---------- Invitation ---------- */
.invitation { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr { background: #fff; border-radius: 20px; padding: 10px; box-shadow: var(--ombre); line-height: 0; }
.qr svg { width: 200px; height: 200px; max-width: 60vw; max-height: 60vw; }
.invitation-code { display: flex; align-items: center; gap: 10px; }
.invitation-code span { color: var(--doux); font-weight: 700; font-size: .85rem; }
.invitation-code b { font-size: 1.6rem; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.invitation-lien { display: flex; gap: 8px; width: 100%; }
.invitation-lien input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--carte-2); color: var(--doux); font-size: .8rem; }

/* Mode simple : l'essentiel, en plus gros */
:root[data-mode="simple"] .avance-simple { display: none !important; }
:root[data-mode="simple"] { font-size: 112.5%; }
:root[data-mode="simple"][data-taille="grand"] { font-size: 125%; }
:root[data-mode="simple"] .navbar button { font-size: .78rem; }

/* ---------- Transitions ---------- */
.entree > * { animation: monte .32s var(--anim) both; }
.entree > *:nth-child(2) { animation-delay: .04s; }
.entree > *:nth-child(3) { animation-delay: .08s; }
.entree > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes monte { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
li.nouveau { animation: apparait .3s var(--anim); }
@keyframes apparait { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.liste input[type=checkbox]:checked { animation: coche .28s ease; }
@keyframes coche { 50% { transform: scale(1.18); } }
dialog[open] { animation: pop .24s var(--anim); }
dialog[open]::backdrop { animation: fondu .24s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 10px);
  background: var(--texte); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 700;
  font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity var(--anim), transform var(--anim); z-index: 20;
  max-width: calc(100vw - 32px);
}
.toast.visible { opacity: .96; transform: translate(-50%, 0); }

@media (max-width: 380px) {
  .grille { gap: 8px; }
  .stat { padding: 10px; }
  .hero .val { font-size: 2.2rem; }
  .salut { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Gestes : glisser une ligne ---------- */
.liste { position: relative; }
.liste:has(> li.glisse) { overflow: hidden; }
.liste > li, .glissable { touch-action: pan-y; }
.cg-zone, .envie-zone { position: relative; border-radius: var(--rayon); }
.envie-zone:has(> .glisse) { overflow: hidden; }
.envie-zone > .envie { height: 100%; }
.cg-zone:has(> .glisse) { overflow: hidden; }
.cg-zone + .cg-zone { margin-top: 12px; }
.glissable.glisse { position: relative; z-index: 1; user-select: none; -webkit-user-select: none; }
.liste > li.glisse { position: relative; z-index: 1; background: var(--carte); user-select: none; -webkit-user-select: none; }
.geste-fond { position: absolute; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; z-index: 0; pointer-events: none; }
.geste-gauche, .geste-droite { display: flex; height: 100%; align-items: center; pointer-events: auto; }
.geste-fond[data-sens="gauche"] .geste-droite, .geste-fond[data-sens="droite"] .geste-gauche { display: none; }
.geste-gauche, .geste-droite { flex-shrink: 0; }
.geste-fond[data-sens="gauche"] { justify-content: flex-start; }
.geste-fond[data-sens="droite"] { justify-content: flex-end; }
.geste-act {
  --c: var(--primaire); width: 74px; height: 100%; border: 0; background: none; color: var(--texte); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: .72rem; font-weight: 700;
}
.geste-rond { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.geste-rond svg.ico { width: 20px; height: 20px; }
.geste-act:active .geste-rond { transform: scale(.9); }
.plein-droite .geste-droite .geste-act:last-child .geste-rond, .plein-gauche .geste-gauche .geste-act:first-child .geste-rond { transform: scale(1.15); }
.plein-droite .geste-droite .geste-act:not(:last-child), .plein-gauche .geste-gauche .geste-act:not(:first-child) { opacity: 0; transition: opacity .15s; }
/* Petit drapeau des priorités */
.drapeau { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: #f29a2e; }
.drapeau svg.ico { width: 15px; height: 15px; }
li.prio .info .t { color: var(--texte); }
/* Bouton « Annuler » après une suppression */
.toast-annuler { display: flex; align-items: center; gap: 14px; }
.toast-annuler.visible { pointer-events: auto; }
.toast-annuler button { background: none; border: 0; color: var(--primaire-clair, #a9a2ff); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
/* Sur téléphone, le glissement remplace les petites croix */
/* Lignes basses (courses…) : ronds plus petits, sans texte */
.geste-fond.compact .geste-act > span:last-child { display: none; }
.geste-fond.compact .geste-rond { width: 34px; height: 34px; }
.geste-fond.compact .geste-rond svg.ico { width: 17px; height: 17px; }
/* Le glissement remplace les petites croix (aussi à la souris, ou clic droit) */
[data-suppr-course], .liste [data-m^="note-suppr"], .liste [data-e^="valise-suppr"] { display: none !important; }
/* Grand glissement : la couleur de l'action remplit l'espace */
.geste-fond.plein-droite .geste-droite, .geste-fond.plein-gauche .geste-gauche {
  width: var(--revele); background: var(--plein); transition: background .15s;
}
.geste-fond.plein-droite .geste-droite { justify-content: flex-start; padding-left: 6px; border-radius: 0 14px 14px 0; }
.geste-fond.plein-gauche .geste-gauche { justify-content: flex-end; padding-right: 6px; border-radius: 14px 0 0 14px; }
.plein-droite .geste-droite .geste-act:not(:last-child), .plein-gauche .geste-gauche .geste-act:not(:first-child) { display: none; }
.plein-droite .geste-droite .geste-act, .plein-gauche .geste-gauche .geste-act { color: #fff; }
.plein-droite .geste-droite .geste-rond, .plein-gauche .geste-gauche .geste-rond { background: rgba(255, 255, 255, .22); }
.toast-annuler[popover] { inset: auto; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); margin: 0; border: 0; overflow: visible; }
#foyers-liste > li { cursor: pointer; }

/* ---------- Espace Amis : dispos ---------- */
.dispos-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dispos-nav .btn-icone[disabled] { opacity: .3; }
.dispos-grille { display: grid; grid-template-columns: minmax(64px, 1.25fr) repeat(var(--n), minmax(0, 1fr)); gap: 6px 4px; align-items: center; }
.dispos-jour { text-align: center; display: flex; flex-direction: column; line-height: 1.1; padding: 4px 0; border-radius: 12px; }
.dispos-jour small { color: var(--doux); font-size: .68rem; font-weight: 700; text-transform: capitalize; }
.dispos-jour b { font-size: .95rem; }
.dispos-jour.auj { background: color-mix(in srgb, var(--primaire) 14%, transparent); color: var(--accent-texte); }
.dispos-jour.tous b { color: #22a06b; }
.dispos-nom { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .84rem; min-width: 0; }
.dispos-nom > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dispos-nom .avatar { width: 24px; height: 24px; font-size: .7rem; flex-shrink: 0; }
.dispos-nom.total { color: var(--doux); font-size: .76rem; padding-top: 4px; }
.dispo-case {
  --c: var(--doux); aspect-ratio: 1; width: 100%; max-width: 40px; justify-self: center; border-radius: 50%; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--doux) 35%, transparent); background: none; color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: .9rem; transition: transform .15s, background var(--anim), border-color var(--anim);
}
.dispo-case:active { transform: scale(.88); }
.dispo-case.oui, .dispo-case.peut, .dispo-case.non { border: 0; background: var(--c); }
.dispo-case svg.ico { width: 15px; height: 15px; stroke-width: 2.6; }
.dispos-total { text-align: center; font-size: .74rem; font-weight: 800; color: var(--doux); padding-top: 4px; }
.dispos-total.tous { color: #22a06b; }
.dispos-total svg.ico { width: 16px; height: 16px; fill: currentColor; }
.dispos-legende { display: flex; gap: 14px; justify-content: center; margin-top: 14px; font-size: .76rem; color: var(--doux); font-weight: 700; flex-wrap: wrap; }
.dispos-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: -1px; }
.dispos-raccourcis { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }

/* ---------- Espace Amis : sorties ---------- */
.sortes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sorte { background: var(--carte); border: 0; border-radius: var(--rayon-petit); box-shadow: var(--ombre); padding: 12px 4px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font: inherit; font-size: .74rem; font-weight: 800; color: var(--texte); transition: transform .15s; }
.sorte:active { transform: scale(.95); }
.sorte .rond { width: 36px; height: 36px; }
.liste li.sortie { align-items: flex-start; }
.liste li.sortie > .rond { margin-top: 2px; }
.votes { display: flex; align-items: center; gap: 4px; margin-top: 7px; flex-wrap: wrap; }
.vote-av { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.vote-av .avatar { width: 26px; height: 26px; font-size: .7rem; box-shadow: 0 0 0 2px var(--carte); }
.vote-av::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, transparent); box-shadow: 0 0 0 2px var(--carte); }
.vote-av.attente .avatar { opacity: .45; filter: grayscale(.6); }
.votes-txt { font-size: .76rem; color: var(--doux); font-weight: 700; margin-left: 4px; }
.mes-votes { display: flex; gap: 6px; flex-shrink: 0; }
.mes-votes button { --c: var(--doux); width: 36px; height: 36px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); background: none; color: var(--c);
  display: grid; place-items: center; cursor: pointer; transition: background var(--anim), color var(--anim), transform .15s; }
.mes-votes button:active { transform: scale(.9); }
.mes-votes button.actif { background: var(--c); color: #fff; border-color: var(--c); }
.mes-votes svg.ico { width: 17px; height: 17px; stroke-width: 2.4; }
.puces-dates { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.puces-dates .puce.actif { background: var(--primaire); color: var(--sur-primaire); }

/* ---------- Espace Amis : accueil ---------- */
.semaine-amis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.jour-amis { border: 0; background: var(--carte-2); border-radius: 14px; padding: 8px 2px; cursor: pointer; color: var(--texte); font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .15s; }
.jour-amis:active { transform: scale(.94); }
.jour-amis small { font-size: .66rem; color: var(--doux); font-weight: 700; text-transform: capitalize; }
.jour-amis b { font-size: .95rem; }
.jour-amis .jauge { width: 8px; height: 34px; border-radius: 99px; background: color-mix(in srgb, var(--doux) 18%, transparent); display: flex; align-items: flex-end; overflow: hidden; }
.jour-amis .jauge i { width: 100%; background: #f29a2e; border-radius: 99px; transition: height .4s cubic-bezier(.2,.8,.2,1); }
.jour-amis.tous { background: color-mix(in srgb, #22a06b 16%, var(--carte-2)); }
.jour-amis.tous .jauge i { background: #22a06b; }
.jour-amis.auj { box-shadow: inset 0 0 0 2px var(--primaire); }

/* ---------- Ordre des onglets : glisser-déposer ---------- */
.liste-onglets.glisser { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.liste-onglets.glisser > li {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 16px; background: var(--carte-2);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; position: relative;
  transition: box-shadow .2s, background .2s;
}
.liste-onglets.glisser > li .t { flex: 1; font-weight: 700; }
.liste-onglets.glisser .rond { width: 34px; height: 34px; }
.liste-onglets.glisser .poignee { color: var(--tres-doux, var(--doux)); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; touch-action: none; cursor: grab; }
.liste-onglets.glisser > li.tire { z-index: 3; cursor: grabbing; background: var(--carte); box-shadow: 0 12px 28px rgba(15, 20, 45, .25), 0 0 0 2px var(--primaire); transition: box-shadow .2s; }
.liste-onglets.glisser > li.tire .poignee { color: var(--accent-texte); }
.liste-onglets.en-cours > li:not(.tire) { opacity: .85; }

/* ---------- Menu « + » : feuille du bas ---------- */
dialog.feuille { margin: auto auto 0; width: min(520px, 100vw); max-width: 100vw; border-radius: 28px 28px 0 0; padding: 0; animation: feuille .32s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 700px) { dialog.feuille { margin: auto; border-radius: 28px; animation: pop .24s var(--anim); } .feuille-poignee { display: none; } }
@keyframes feuille { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.feuille-corps { padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px)); }
.feuille-poignee { display: block; width: 40px; height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--doux) 35%, transparent); margin: 0 auto 12px; }
.feuille h2 { margin: 4px 2px 14px; font-size: 1.15rem; }
.feuille-principal {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 18px; cursor: pointer; font: inherit; font-weight: 800; font-size: .98rem;
  background: color-mix(in srgb, var(--primaire) 13%, var(--carte-2)); color: var(--texte); margin-bottom: 14px; transition: transform .15s;
}
.feuille-principal span:not(.rond) { flex: 1; text-align: left; }
.feuille-principal > svg.ico { color: var(--doux); width: 18px; height: 18px; }
.feuille-principal:active { transform: scale(.98); }
.feuille-tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; }
.tuile { --c: var(--primaire); border: 0; background: none; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; color: var(--texte);
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 2px; animation: tuile .35s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 25ms); }
@keyframes tuile { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
.tuile-rond { width: 56px; height: 56px; border-radius: 19px; display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, var(--carte-2)); transition: transform .15s, background .2s; }
.tuile-rond svg.ico { width: 24px; height: 24px; }
.tuile:hover .tuile-rond { background: color-mix(in srgb, var(--c) 24%, var(--carte-2)); }
.tuile:active .tuile-rond { transform: scale(.9); }
.feuille-assistant { width: 100%; margin-top: 18px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--carte-2); color: var(--doux); font: inherit; font-weight: 700; }
.feuille-assistant span { flex: 1; text-align: left; }
.feuille-assistant svg.ico { width: 18px; height: 18px; color: var(--accent-texte); }

/* ---------- Assistant façon Siri ---------- */
dialog.siri { width: min(520px, 100vw); max-width: 100vw; margin: auto auto 0; border-radius: 30px 30px 0 0; padding: 0; overflow: hidden;
  background: color-mix(in srgb, var(--carte) 92%, transparent); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); animation: feuille .34s cubic-bezier(.2,.8,.2,1); }
dialog.siri::backdrop { background: rgba(10, 12, 30, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@media (min-width: 700px) { dialog.siri { margin: auto; border-radius: 30px; animation: pop .26s var(--anim); } }
.siri-corps { position: relative; padding: 26px 18px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; text-align: center; }
.siri-fermer { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--carte-2); color: var(--doux); display: grid; place-items: center; cursor: pointer; }
.siri-fermer svg.ico { width: 16px; height: 16px; }
.orbe { position: relative; width: 78px; height: 78px; margin: 6px 0 14px; }
.orbe i { position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: screen; filter: blur(.5px);
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--primaire) 30%, #fff), var(--primaire) 55%, transparent 72%); animation: orbe 6s ease-in-out infinite; }
.orbe i:nth-child(2) { background: radial-gradient(circle at 60% 40%, #f29ad8, transparent 62%); animation-duration: 7.5s; animation-direction: reverse; }
.orbe i:nth-child(3) { background: radial-gradient(circle at 45% 65%, #5ee0d0, transparent 60%); animation-duration: 9s; }
:root[data-theme="light"] .orbe i { mix-blend-mode: normal; opacity: .8; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .orbe i { mix-blend-mode: normal; opacity: .8; } }
@keyframes orbe { 0%, 100% { transform: rotate(0) scale(1); } 33% { transform: rotate(120deg) scale(1.06) translate(2px, -2px); } 66% { transform: rotate(240deg) scale(.95) translate(-2px, 1px); } }
.siri.reflechit .orbe i { animation-duration: 1.6s; }
.siri:has(.siri-micro.ecoute) .orbe { animation: ecoute 1.1s ease-in-out infinite; }
.siri:has(.siri-micro.ecoute) .orbe i { animation-duration: 1.2s; }
@keyframes ecoute { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
.siri-salut { margin: 0 0 14px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.siri-salut small { display: block; margin-top: 3px; font-size: .9rem; font-weight: 600; color: var(--doux); }
#assistant-apercu { width: 100%; }
.siri .apercu { text-align: left; display: block; gap: 12px; align-items: flex-start; background: var(--carte-2); border-radius: 20px 20px 20px 6px; padding: 14px 16px; margin: 0 0 12px;
  animation: bulle .3s cubic-bezier(.2,.8,.2,1); line-height: 1.45; }
.siri .apercu:has(> .rond) { display: flex; }
.siri .apercu:has(> .rond) > :not(.rond) { flex: 1; min-width: 0; }
.siri .apercu .s { color: var(--doux); font-size: .86rem; }
.siri .apercu p { margin: 4px 0 0; color: var(--doux); font-size: .9rem; }
.siri .apercu .reponse { margin: 8px 0 0; padding-left: 18px; }
.siri .apercu .reponse li { margin: 2px 0; }
@keyframes bulle { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.siri-actions { display: flex; gap: 8px; justify-content: center; margin: 0 0 14px; }
.siri-actions[hidden] { display: none; }
.siri-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 0 0 16px; }
.siri-suggestions .puce { background: color-mix(in srgb, var(--primaire) 9%, var(--carte-2)); color: var(--texte); font-weight: 700; padding: 8px 13px;
  animation: tuile .35s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 45ms); }
.siri-saisie { width: 100%; display: flex; align-items: flex-end; gap: 6px; background: var(--carte-2); border-radius: 26px; padding: 6px 6px 6px 18px;
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s; }
.siri-saisie:focus-within { box-shadow: inset 0 0 0 1.5px var(--primaire); }
.siri-saisie textarea { flex: 1; border: 0; background: none; color: var(--texte); resize: none; font: inherit; font-size: 1rem; padding: 10px 0; line-height: 1.35; max-height: 120px; box-shadow: none; }
.siri-saisie textarea:focus { outline: none; }
.siri-micro { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--primaire); color: var(--sur-primaire); display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .2s; }
.siri-micro svg.ico { width: 19px; height: 19px; }
.siri-micro:active { transform: scale(.9); }
.siri-micro.ecoute { background: var(--danger); color: #fff; animation: respire 1.4s ease-in-out infinite; }

/* ---------- Bienvenue : présentation ---------- */
dialog#bienvenue { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 0; background: var(--bg); }
@media (min-width: 700px) { dialog#bienvenue { width: min(460px, 100vw); height: min(720px, 100dvh); margin: auto; border-radius: 32px; } }
dialog#bienvenue::backdrop { background: rgba(10, 12, 30, .55); }
.bv { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: max(28px, env(safe-area-inset-top)) 28px calc(28px + env(safe-area-inset-bottom, 0px)); gap: 12px; user-select: none; -webkit-user-select: none; }
.bv.entre > * { animation: monte .45s cubic-bezier(.2,.8,.2,1) both; }
.bv.entre > *:nth-child(3) { animation-delay: .06s; } .bv.entre > *:nth-child(4) { animation-delay: .12s; } .bv.entre > *:nth-child(n+5) { animation-delay: .18s; }
.bv h2 { margin: 18px 0 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.bv p { margin: 0 0 6px; color: var(--doux); font-size: 1.02rem; line-height: 1.45; max-width: 320px; }
.bv-passer { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; background: none; border: 0; color: var(--doux); font: inherit; font-weight: 700; cursor: pointer; padding: 8px 10px; }
.bv-deco { position: relative; width: 260px; height: 220px; display: grid; place-items: center; }
.bv-deco.petit { height: 130px; }
.bv-logo { width: 104px; height: 104px; border-radius: 32px; background: var(--primaire); color: var(--sur-primaire); display: grid; place-items: center;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--primaire) 40%, transparent); }
.bv-logo svg.ico { width: 52px; height: 52px; }
.bv-bulle { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 18px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--carte)); box-shadow: var(--ombre);
  transform: translate(var(--x), var(--y)); animation: flotte 4s ease-in-out infinite; animation-delay: calc(var(--k) * -.9s); }
.bv-bulle svg.ico { width: 24px; height: 24px; }
@keyframes flotte { 0%, 100% { transform: translate(var(--x), var(--y)); } 50% { transform: translate(var(--x), calc(var(--y) - 8px)); } }
.bv-espaces { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.bv-espaces span { width: 72px; height: 72px; border-radius: 24px; background: var(--carte); box-shadow: var(--ombre); display: grid; place-items: center; font-size: 2rem;
  animation: tuile .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--k) * 70ms); }
.bv-avatars { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.bv-avatars > span { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 1.5rem;
  margin: 0 -8px; box-shadow: 0 0 0 4px var(--bg); animation: tuile .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--k) * 90ms); }
.bv-avatars { flex-direction: row; flex-wrap: wrap; justify-content: center; width: 240px; }
.bv-carte-demo { flex-basis: 100%; display: flex; align-items: center; gap: 10px; background: var(--carte); border-radius: 18px; padding: 12px 14px; box-shadow: var(--ombre);
  text-align: left; animation: tuile .5s .35s cubic-bezier(.2,.8,.2,1) both; }
.bv-carte-demo svg.ico { color: #22a06b; width: 22px; height: 22px; }
.bv-carte-demo b { flex: 1; } .bv-carte-demo small { color: var(--doux); font-size: .78rem; }
.bv-moi { width: 96px; height: 96px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; transition: background .25s; }
.bv-champ { width: min(320px, 100%); text-align: center; font-size: 1.1rem; font-weight: 700; padding: 14px 18px; border-radius: 18px; border: 1.5px solid transparent; background: var(--carte); color: var(--texte); }
.bv-champ:focus { outline: none; border-color: var(--primaire); }
.bv-couleurs { display: grid; grid-template-columns: repeat(8, 32px); gap: 8px; justify-content: center; }
.bv-couleurs .pastille-couleur { width: 32px; height: 32px; }
.bv-passer:focus:not(:focus-visible), .bv-suivant:focus:not(:focus-visible) { outline: none; }
.bv-points { display: flex; gap: 6px; margin-top: 10px; }
.bv-points i { width: 7px; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--doux) 35%, transparent); transition: width .3s, background .3s; }
.bv-points i.actif { width: 22px; background: var(--primaire); }
.bv-suivant { width: min(320px, 100%); padding-block: 15px; font-size: 1rem; margin-top: 4px; }

/* ---------- Visite guidée ---------- */
.visite { position: fixed; inset: 0; z-index: 60; animation: fondu .25s ease; }
.visite.sortie { opacity: 0; transition: opacity .25s; }
.visite-trou { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(10, 12, 30, .62), 0 0 0 3px color-mix(in srgb, var(--primaire) 70%, #fff);
  transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), opacity .25s; pointer-events: none; }
.visite-trou.vide { box-shadow: 0 0 0 9999px rgba(10, 12, 30, .62); }
.visite-bulle { position: fixed; background: var(--carte); color: var(--texte); border-radius: 22px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.visite-bulle.entre { animation: bulle .3s cubic-bezier(.2,.8,.2,1); }
.visite-titre { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.visite-bulle p { margin: 0 0 12px; color: var(--doux); font-size: .92rem; line-height: 1.45; }
.visite-pied { display: flex; align-items: center; gap: 12px; }
.visite-pied > span { flex: 1; color: var(--doux); font-size: .8rem; font-weight: 700; }
.visite-demo { position: relative; height: 52px; border-radius: 14px; overflow: hidden; margin-bottom: 12px; background: #ef4f5f; }
.vd-fond { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #fff; }
.vd-fond svg.ico { width: 22px; height: 22px; }
.vd-ligne { position: absolute; inset: 0; background: var(--carte-2); display: flex; align-items: center; gap: 10px; padding: 0 14px; animation: vd 2.6s ease-in-out infinite; }
.vd-rond { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--doux); }
@keyframes vd { 0%, 20% { transform: translateX(0); } 45%, 65% { transform: translateX(-72px); } 90%, 100% { transform: translateX(0); } }

/* Bienvenue : compte et premier espace */
.bv-form { width: min(340px, 100%); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.bv-form .bv-champ { width: 100%; text-align: left; font-weight: 600; font-size: 1rem; }
.bv-mdp { position: relative; width: 100%; }
.bv-mdp .bv-champ { padding-right: 50px; }
.bv-oeil { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--doux); display: grid; place-items: center; cursor: pointer; }
.bv-oeil svg.ico { width: 20px; height: 20px; }
.bv-force { width: 100%; display: flex; align-items: center; gap: 5px; min-height: 16px; }
.bv-force i { flex: 1; height: 4px; border-radius: 99px; background: color-mix(in srgb, var(--doux) 22%, transparent); transition: background .25s; }
.bv-force span { min-width: 96px; text-align: right; font-size: .76rem; font-weight: 700; color: var(--doux); }
.bv-force[data-n="1"] i:nth-child(1) { background: #ef4f5f; }
.bv-force[data-n="2"] i:nth-child(-n+2) { background: #f29a2e; }
.bv-force[data-n="3"] i { background: #22a06b; }
.bv-erreur { margin: 0; min-height: 1.2em; color: var(--danger); font-size: .86rem; font-weight: 700; }
.bv-erreur.secoue { animation: secoue .35s ease; }
@keyframes secoue { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.bv-lien { font-size: .9rem; }
.bv.large { justify-content: flex-start; padding-top: max(40px, env(safe-area-inset-top)); overflow-y: auto; }
.bv-haut { margin-top: 6px !important; }
.bv-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(380px, 100%); margin-top: 6px; }
.bv-type { --c: var(--primaire); border: 2px solid transparent; background: var(--carte); border-radius: 18px; padding: 12px 4px 10px; cursor: pointer; font: inherit; color: var(--texte);
  display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--ombre); transition: border-color .2s, transform .15s, background .2s; }
.bv-type span { font-size: 1.6rem; line-height: 1; }
.bv-type b { font-size: .74rem; }
.bv-type:active { transform: scale(.95); }
.bv-type.actif { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--carte)); }
.bv-desc { min-height: 2.6em; font-size: .9rem !important; margin: 4px 0 2px !important; }
.visite-fin { display: flex; justify-content: center; margin-bottom: 8px; }
.visite-fin .rond { width: 52px; height: 52px; } .visite-fin .rond svg.ico { width: 24px; height: 24px; }

/* Fermeture douce des fenêtres (navigateurs récents ; sinon elles se ferment simplement) */
dialog { transition: opacity .18s ease, transform .18s ease, overlay .18s allow-discrete, display .18s allow-discrete; }
dialog:not([open]) { opacity: 0; transform: translateY(10px) scale(.98); }
dialog::backdrop { transition: opacity .18s ease, overlay .18s allow-discrete, display .18s allow-discrete; }
dialog:not([open])::backdrop { opacity: 0; }
@media (prefers-reduced-motion: reduce) { dialog, dialog::backdrop { transition: none; } }
.envie a, .envie img { -webkit-user-drag: none; user-select: none; }

/* Envies : coller un lien */
.envie-coller { display: flex; align-items: center; gap: 8px; background: var(--carte); border-radius: 99px; padding: 6px 6px 6px 16px; box-shadow: var(--ombre); }
.envie-coller > svg.ico { width: 18px; height: 18px; color: var(--doux); flex-shrink: 0; }
.envie-coller input { flex: 1; min-width: 0; border: 0; background: none; color: var(--texte); font: inherit; padding: 8px 0; box-shadow: none; }
.envie-coller input:focus { outline: none; }
.envie-coller:focus-within { box-shadow: var(--ombre), 0 0 0 2px var(--primaire); }
.rond-charge { width: 30px; height: 30px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--doux) 25%, transparent); border-top-color: var(--primaire); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rond-charge { animation: tourne 2s linear infinite !important; } }

.envie-reessayer { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border: 0; border-radius: 99px; padding: 6px 11px; background: var(--carte); color: var(--texte); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; box-shadow: var(--ombre); }
.envie-reessayer svg.ico { width: 14px; height: 14px; }

/* Indicateur de synchronisation (petit point sur l'avatar) */
.synchro { position: absolute; left: 44px; top: max(14px, env(safe-area-inset-top)); width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); z-index: 3; pointer-events: none; transition: background .3s; }
.synchro.ok { background: #22a06b; } .synchro.envoi { background: #3b8cf0; animation: respire 1.2s ease-in-out infinite; }
.synchro.hors { background: #e69320; } .synchro.erreur { background: var(--danger); }
