:root {
  --fond: #f3f4f8;
  --carte: #ffffff;
  --carte-2: #f7f8fb;
  --texte: #1b1d2a;
  --discret: #6b6f80;
  --bord: #e5e7ef;
  --encre: #1f2233;
  --sur-encre: #ffffff;
  --danger: #d93f3f;
  --moi: #4f46e5;
  --ombre: 0 1px 2px rgba(30, 34, 60, .05), 0 6px 20px rgba(30, 34, 60, .06);
  --rayon: 22px;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #101118;
    --carte: #1b1d27;
    --carte-2: #23252f;
    --texte: #f1f2f4;
    --discret: #9a9ca4;
    --bord: #2d2f35;
    --encre: #f1f2f4;
    --sur-encre: #111214;
    --danger: #f06a6a;
    --ombre: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.4 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.discret { color: var(--discret); }
.petit { font-size: 13px; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--haut) + 20px) 16px calc(var(--bas) + 108px);
}

/* ---------- En-tête d'écran ---------- */
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 4px 20px; }
.entete h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.entete .sur-titre { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); margin-bottom: 4px; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 16px;
  margin-bottom: 14px;
}
.carte h2 { font-size: 16px; font-weight: 750; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.carte h2 .lien { margin-left: auto; font-size: 14px; font-weight: 650; color: var(--acc, var(--discret)); text-decoration: none; }
.vide { color: var(--discret); font-size: 15px; padding: 4px 0; }
.bientot { opacity: .55; }
.pastille { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--discret)); flex: none; }
.puce-num {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--carte-2); border: 1px solid var(--bord);
  font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 16px;
  background: var(--encre); color: var(--sur-encre); font-weight: 600;
  text-decoration: none;
}
.btn.second { background: var(--carte-2); color: var(--texte); border: 1px solid var(--bord); }
.btn.danger { background: none; color: var(--danger); border: 1px solid var(--bord); }
.btn.plein { width: 100%; }
.btn:disabled { opacity: .5; }

/* ---------- Connexion ---------- */
.connexion { min-height: calc(100dvh - 140px); display: flex; flex-direction: column; justify-content: center; gap: 28px; text-align: center; }
.connexion .logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto; box-shadow: var(--ombre); }
.connexion h1 { font-size: 32px; font-weight: 750; letter-spacing: -.02em; }
.connexion p { color: var(--discret); }
.connexion .actions { display: flex; flex-direction: column; gap: 12px; }
.g { width: 18px; height: 18px; }
.code-liaison { display: flex; gap: 8px; }
.code-liaison input { flex: 1; text-align: center; letter-spacing: .3em; font-size: 20px; }
.alerte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 12px 14px; text-align: left; font-size: 14px; }
.alerte.erreur { border-color: var(--danger); color: var(--danger); }

input[type=text], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid var(--bord); background: var(--carte);
  outline: none; -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--moi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--moi) 20%, transparent); }
select {
  padding-right: 40px;
  background: var(--carte) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
}
label.champ { display: block; font-size: 13px; font-weight: 600; color: var(--discret); margin: 14px 0 6px; }

/* ---------- Onglets du bas ---------- */
#onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  padding: 0 12px calc(max(var(--bas), 10px) + 2px);
  pointer-events: none;
}
#onglets .rang {
  display: flex; width: 100%; max-width: 560px; padding: 6px; pointer-events: auto;
  background: color-mix(in srgb, var(--carte) 88%, transparent); border-radius: 26px;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 28px rgba(30, 34, 60, .14), 0 0 0 1px var(--bord);
}
#onglets a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 20px;
  padding: 7px 0 5px; font-size: 11px; font-weight: 700; color: var(--discret); text-decoration: none;
}
#onglets a svg { width: 23px; height: 23px; }
#onglets a[aria-current=page] { color: var(--moi); background: color-mix(in srgb, var(--moi) 13%, transparent); }

/* ---------- Courses ---------- */
.segments { display: flex; gap: 6px; background: var(--carte-2); border: 1px solid var(--bord); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.segments button {
  flex: 1; min-height: 38px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--discret);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.segments button[aria-pressed=true] { background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }
.segments .nb { font-size: 12px; opacity: .7; }

.ajout { position: relative; margin-bottom: 18px; }
.ajout form { display: flex; gap: 8px; }
.ajout .nom { flex: 1; }
.ajout .qte { width: 76px; text-align: center; }
.ajout button[type=submit] { width: 46px; min-height: 46px; border-radius: 12px; background: var(--encre); color: var(--sur-encre); font-size: 24px; line-height: 1; flex: none; }
.suggestions {
  position: absolute; left: 0; right: 0; top: 52px; z-index: 5;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  overflow: hidden;
}
.suggestions button { display: flex; width: 100%; padding: 12px 14px; justify-content: space-between; text-align: left; border-bottom: 1px solid var(--bord); }
.suggestions button:last-child { border-bottom: 0; }

.groupe { margin-bottom: 16px; }
.groupe h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--discret); margin: 0 6px 6px; display: flex; justify-content: space-between; align-items: center; }
.groupe h3 button { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--danger); }
.liste { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; }
.article { display: flex; align-items: center; gap: 12px; padding: 0 6px 0 14px; min-height: 52px; border-bottom: 1px solid var(--bord); }
.article:last-child { border-bottom: 0; }
.article .case {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bord); flex: none;
  display: grid; place-items: center; color: var(--sur-encre);
}
.article.fait .case { background: var(--encre); border-color: var(--encre); }
.article .corps { flex: 1; min-width: 0; padding: 10px 0; text-align: left; display: flex; align-items: center; gap: 12px; }
.article .nom-a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.article .q { color: var(--discret); font-size: 14px; }
.article.fait .nom-a { text-decoration: line-through; color: var(--discret); }
.article .plus { width: 40px; height: 44px; color: var(--discret); display: grid; place-items: center; flex: none; }

/* ---------- Plus ---------- */
.ligne { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bord); }
.ligne:last-child { border-bottom: 0; }
.ligne .txt { flex: 1; }
.couleurs { display: flex; flex-wrap: wrap; gap: 10px; }
.couleurs button { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid transparent; }
.couleurs button[aria-pressed=true] { border-color: var(--carte); box-shadow: 0 0 0 2px var(--c); }
.code-affiche { font-size: 34px; font-weight: 750; letter-spacing: .25em; text-align: center; padding: 12px 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: #fff; flex: none;
  display: inline-grid; place-items: center; font-weight: 800; font-size: 15px; line-height: 1; overflow: hidden;
  box-shadow: 0 0 0 2px var(--carte), 0 0 0 4px color-mix(in srgb, var(--c) 55%, transparent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.emoji { background: color-mix(in srgb, var(--c) 18%, var(--carte)); font-size: 20px; }
.avatar.mini { width: 22px; height: 22px; font-size: 11px; box-shadow: 0 0 0 1.5px var(--c); }
.avatar.mini.emoji { font-size: 13px; }
.avatar.grand { width: 52px; height: 52px; font-size: 21px; }
.avatar.grand.emoji { font-size: 28px; }
.avatar.geant { width: 76px; height: 76px; font-size: 30px; box-shadow: 0 0 0 3px var(--carte), 0 0 0 6px color-mix(in srgb, var(--c) 60%, transparent); }
.avatar.geant.emoji { font-size: 42px; }

/* ---------- Feuille du bas ---------- */
#feuille { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; }
#feuille .panneau {
  width: 100%; max-width: 640px; background: var(--fond); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(var(--bas) + 18px); max-height: 90dvh; overflow: auto;
  animation: monte .18s ease-out;
}
#feuille .poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--bord); margin: 0 auto 12px; }
#feuille h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
#feuille .actions { display: flex; gap: 10px; margin-top: 20px; }
#feuille .actions .btn { flex: 1; }
@keyframes monte { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--bas) + 96px); transform: translateX(-50%); z-index: 30;
  background: var(--encre); color: var(--sur-encre); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ---------- Agenda ---------- */
.rond {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--encre); color: var(--sur-encre); font-size: 24px; line-height: 1;
  display: inline-grid; place-items: center;
}
.rond.second { background: var(--carte); color: var(--texte); border: 1px solid var(--bord); font-size: 22px; }
.semaine-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.titre-sem { flex: 1; font-weight: 650; font-size: 16px; text-align: center; min-height: 40px; }
.bande { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.bande a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px;
  border-radius: 14px; color: var(--texte); text-decoration: none; background: var(--carte); box-shadow: var(--ombre);
}
.bande a strong { font-size: 17px; }
.bande a.auj { background: var(--encre); color: var(--sur-encre); }
.bande a.auj .discret { color: inherit; opacity: .7; }
.points { display: flex; gap: 2px; height: 6px; }
.points i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filtre {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border-radius: 17px; border: 1px solid var(--bord); background: var(--carte); font-size: 14px; font-weight: 600;
}
.filtre .pastille { background: var(--c); }
.filtre[aria-pressed=false] { opacity: .45; }
.filtre[aria-pressed=false] .pastille { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.filtre:disabled { cursor: default; }
.jour { margin-bottom: 18px; scroll-margin-top: calc(var(--haut) + 12px); }
.jour h3 { font-size: 14px; font-weight: 650; margin: 0 6px 8px; display: flex; align-items: center; gap: 8px; }
.jour h3::first-letter { text-transform: uppercase; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--moi); color: #fff; }
.rien { color: var(--discret); font-size: 14px; margin: 0 6px; }
.evenement { display: flex; align-items: stretch; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--bord); }
.evenement:last-child { border-bottom: 0; }
.evenement .heure { width: 46px; flex: none; display: flex; flex-direction: column; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.evenement .heure .discret { font-weight: 500; font-size: 13px; }
.barres { display: flex; gap: 2px; flex: none; }
.barres i { width: 4px; border-radius: 2px; background: var(--c); }
.evenement .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.titre-ev { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.liste.plate { box-shadow: none; margin: 0 -16px -16px; border-radius: 0 0 var(--rayon) var(--rayon); }
.notes { white-space: pre-wrap; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.interrupteur { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 600; }
.interrupteur input { width: 22px; height: 22px; accent-color: var(--moi); }
input[type=date], input[type=time] {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--bord);
  background: var(--carte); -webkit-appearance: none; appearance: none; display: block;
}
textarea { resize: vertical; }
#feuille .carte { box-shadow: none; }

/* ---------- Tâches ---------- */
.article.manquee .nom-a { color: var(--discret); }
.article .case:disabled { opacity: .4; }
.etiquette { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; background: var(--carte-2); border: 1px solid var(--bord); color: var(--discret); flex: none; }
.etiquette.rouge { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.puce-num.ok { background: var(--encre); color: var(--sur-encre); border-color: var(--encre); }
.lien-ligne { width: 100%; text-align: left; color: inherit; text-decoration: none; }
.lien-ligne:disabled { cursor: default; }
.lien-ligne svg { color: var(--discret); flex: none; }
.jours-choix { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.jours-choix button { height: 44px; border-radius: 12px; border: 1px solid var(--bord); background: var(--carte); font-weight: 650; }
.jours-choix button[aria-pressed=true] { background: var(--encre); color: var(--sur-encre); border-color: var(--encre); }
.etapes { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.choix-agenda { cursor: pointer; }
.choix-agenda input { width: 22px; height: 22px; accent-color: var(--moi); flex: none; margin: 0; }

/* ---------- Eau ---------- */
:root { --vert: #1f9d55; --orange: #e08a00; --rouge: #d93f3f; --bleu: #2f80ed; }
@media (prefers-color-scheme: dark) { :root { --vert: #4cc47f; --orange: #f0a83a; --rouge: #f06a6a; --bleu: #5b9cf2; } }
.tuile-eau { border-left: 6px solid var(--niv, var(--bord)); }
.tuile-eau .grand { font-size: 44px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 2px; }
.tuile-eau .grand span { font-size: 22px; font-weight: 600; color: var(--discret); }
.tuile-eau .statut { margin-top: 10px; font-weight: 650; color: var(--niv, var(--texte)); }
.vert { --niv: var(--vert); } .orange { --niv: var(--orange); } .rouge { --niv: var(--rouge); } .bleu { --niv: var(--bleu); } .neutre { --niv: var(--discret); }
.pastille-niveau { width: 12px; height: 12px; border-radius: 50%; background: var(--niv); flex: none; }
.releve { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.releve > p, .releve > button { grid-column: 1 / -1; }
.releve > p { margin: 8px 0 12px; }
.releve input { font-size: 18px; font-weight: 600; }
.graphe { width: 100%; height: auto; display: block; }
.graphe .barre { fill: var(--niv); }
.graphe .val { font-size: 11px; font-weight: 650; text-anchor: middle; fill: var(--texte); }
.graphe .mois { font-size: 11px; text-anchor: middle; fill: var(--discret); }
.graphe .moy { stroke: var(--texte); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .5; }
.legende { margin-left: auto; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.moy-l { display: inline-block; width: 16px; border-top: 1.5px dashed var(--discret); }
a.carte.ligne { display: flex; padding: 16px; border: 0; }
.annees { display: grid; gap: 10px; }
.annee { display: grid; grid-template-columns: 92px 1fr 74px 28px; align-items: center; gap: 8px; }
.annee .lbl { font-size: 13px; color: var(--discret); }
.annee .piste { height: 14px; border-radius: 7px; background: var(--carte-2); overflow: hidden; }
.annee .jauge { display: block; height: 100%; border-radius: 7px; background: var(--bleu); }
.annee.estime .jauge { background: repeating-linear-gradient(135deg, var(--orange) 0 6px, color-mix(in srgb, var(--orange) 55%, transparent) 6px 12px); }
.annee .val { text-align: right; font-size: 14px; line-height: 1.2; }
.annee .plus { width: 28px; height: 28px; }
.graphe .zone-arrosage { fill: color-mix(in srgb, var(--vert) 10%, transparent); }
.zone-l { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--vert) 22%, transparent); }

/* ---------- Repas ---------- */
.petit-btn { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; cursor: pointer; }
.note-semaine { display: block; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--orange) 12%, var(--carte)); font-size: 14px; }
.note-semaine.vide-note { background: none; border: 1px dashed var(--bord); color: var(--discret); }
.jour-repas { padding: 12px 16px 6px; }
.jour-repas.auj { box-shadow: 0 0 0 2px var(--moi), var(--ombre); }
.jour-repas h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.repas-jour { display: flex; gap: 12px; width: 100%; text-align: left; padding: 10px 0; border-top: 1px solid var(--bord); color: inherit; text-decoration: none; }
.jour-repas .repas-jour:first-of-type { border-top: 0; }
.repas-jour .moment { width: 40px; flex: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--discret); padding-top: 3px; }
.repas-jour .contenu { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.repas-jour .plat { font-weight: 600; }
.repas-jour .ajouter { color: var(--discret); font-size: 14px; }
.mention { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 8px;
  background: var(--carte-2); border: 1px solid var(--bord); color: var(--discret); }
.idee .petit-btn { flex: none; }
.petit-av { width: 28px; height: 28px; font-size: 12px; }
.grille-placer { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: center; }
.grille-placer .jl { font-weight: 600; font-size: 14px; text-transform: capitalize; }
.case-placer { min-height: 40px; border-radius: 11px; border: 1px solid var(--bord); background: var(--carte); font-weight: 600; font-size: 14px; }
.case-placer.pleine { background: var(--carte-2); color: var(--discret); }
.apercu .ap-jour { padding: 8px 0; border-bottom: 1px solid var(--bord); }
.apercu .ap-jour:last-of-type { border-bottom: 0; }
.ajout-ing { display: flex; gap: 8px; }
.ajout-ing input { flex: 1; }
.ajout-ing .btn { width: 46px; padding: 0; font-size: 22px; }

/* ---------- Accueil chaleureux ---------- */
:root { --a-bleu: #3b7ff0; --a-vert: #1fa463; --a-orange: #f08a24; --a-rose: #e0567a; --a-turquoise: #12a3a3; --a-violet: #7c5cf0; }
@media (prefers-color-scheme: dark) {
  :root { --a-bleu: #6ea2f7; --a-vert: #4cc47f; --a-orange: #f5a54f; --a-rose: #f07a99; --a-turquoise: #3cc4c4; --a-violet: #9d85f5; }
}
.bleu { --acc: var(--a-bleu); } .vert.teinte { --acc: var(--a-vert); } .orange.teinte { --acc: var(--a-orange); }
.rose { --acc: var(--a-rose); } .turquoise { --acc: var(--a-turquoise); } .violet { --acc: var(--a-violet); }
.carte.teinte {
  background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 11%, var(--carte)), var(--carte) 70%);
  box-shadow: var(--ombre), inset 0 0 0 1px color-mix(in srgb, var(--acc) 18%, transparent);
}
.carte h2 .ic {
  width: 32px; height: 32px; border-radius: 11px; flex: none; display: grid; place-items: center; font-size: 17px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--acc, var(--moi)) 80%, #fff), var(--acc, var(--moi)));
  color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--acc, var(--moi)) 30%, transparent);
}
.carte h2 .ic svg { width: 18px; height: 18px; }
.carte.teinte .liste.plate { background: transparent; }
.carte.teinte .evenement, .carte.teinte .ligne, .carte.teinte .article, .carte.teinte .repas-jour { border-color: color-mix(in srgb, var(--acc) 14%, var(--bord)); }

.famille-rang { display: flex; gap: 6px; margin: -6px 0 18px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px; }
.famille-rang::-webkit-scrollbar { display: none; }
.membre { flex: 1; min-width: 68px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--texte); font-size: 13px; font-weight: 700; }

.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tuile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 18px;
  background: var(--carte); text-decoration: none; color: var(--texte); box-shadow: 0 1px 3px rgba(30, 34, 60, .06);
}
.tuile .emo { font-size: 24px; line-height: 1.2; }
.tuile strong { font-size: 22px; font-weight: 800; color: var(--acc); }
.tuile .petit { color: var(--discret); font-weight: 600; font-size: 12px; }
.tuile.zero strong { color: var(--discret); opacity: .6; }

.progres { display: block; height: 8px; border-radius: 4px; margin: 6px 0 5px; background: color-mix(in srgb, var(--acc, var(--moi)) 15%, var(--carte-2)); overflow: hidden; }
.progres i { display: block; height: 100%; border-radius: 4px; background: var(--acc, var(--moi)); transition: width .3s; }
#carte-taches .ligne { align-items: center; }

.profil { display: flex; align-items: center; gap: 16px; padding: 4px 0 8px; }
.profil .txt { flex: 1; }
.profil .txt strong { font-size: 18px; }
.ligne .petit-btn svg { flex: none; }
.apercu-avatar { display: flex; justify-content: center; padding: 14px 0 20px; }
.emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emojis button { aspect-ratio: 1; border-radius: 12px; font-size: 22px; background: var(--carte); border: 1px solid var(--bord); }
.emojis button[aria-pressed=true] { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.segments button .avatar.mini, .filtre .avatar.mini { margin-left: -4px; }
.filtre { padding-left: 8px; }
.petit-btn { white-space: nowrap; }

/* ---------- Une couleur par page ---------- */
body { --acc: var(--moi); }
body[data-section=courses] { --acc: var(--a-orange); }
body[data-section=agenda] { --acc: var(--a-bleu); }
body[data-section=taches] { --acc: var(--a-vert); }
body[data-section=repas] { --acc: var(--a-rose); }
body[data-section=eau] { --acc: var(--a-turquoise); }
body[data-section=plus] { --acc: var(--a-violet); }
body {
  background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 12%, var(--fond)) 0, var(--fond) 340px) no-repeat, var(--fond);
}
body[data-section=""] { background: linear-gradient(180deg, color-mix(in srgb, var(--moi) 9%, var(--fond)) 0, var(--fond) 340px) no-repeat, var(--fond); }

.titre-page { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ic-page {
  width: 44px; height: 44px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--acc) 75%, #fff), var(--acc));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--acc) 35%, transparent);
}
.ic-page svg { width: 24px; height: 24px; }
.ic-page.petit-ic { width: 36px; height: 36px; border-radius: 12px; }
.ic-page.petit-ic svg { width: 20px; height: 20px; }
.eau-ic { --acc: var(--a-turquoise); }
.entete { align-items: center; }

/* Boutons ronds, segments, puces : couleur de la page */
.rond { background: linear-gradient(140deg, color-mix(in srgb, var(--acc) 78%, #fff), var(--acc)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--acc) 35%, transparent); }
.rond.second { background: var(--carte); color: var(--acc); border: 0; box-shadow: var(--ombre); font-weight: 700; }
.titre-sem { color: var(--texte); }
.segments { background: var(--carte); border: 0; box-shadow: var(--ombre); border-radius: 18px; padding: 5px; }
.segments button { border-radius: 14px; min-height: 40px; }
.segments button[aria-pressed=true] { background: color-mix(in srgb, var(--acc) 14%, var(--carte)); color: var(--acc); box-shadow: none; }
.segments .nb { background: var(--acc); color: #fff; opacity: 1; border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; display: inline-grid; place-items: center; }
.segments button[aria-pressed=false] .nb { background: var(--carte-2); color: var(--discret); }
.emo-seg { font-size: 15px; }
.badge { background: var(--acc); }
.ajout button[type=submit], .ajout-ing .btn { background: linear-gradient(140deg, color-mix(in srgb, var(--acc) 78%, #fff), var(--acc)); color: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 20%, transparent); }
.interrupteur input, .choix-agenda input { accent-color: var(--acc); }

/* Listes et cases */
.liste { border-radius: var(--rayon); }
.groupe h3 { color: var(--acc); display: flex; gap: 8px; justify-content: flex-start; }
.groupe h3::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); }
.groupe h3 button { margin-left: auto; }
.article .case { border-color: color-mix(in srgb, var(--acc) 45%, var(--bord)); }
.article.fait .case { background: var(--acc); border-color: var(--acc); color: #fff; }
.puce-num.ok { background: var(--acc); border-color: var(--acc); color: #fff; }
.jours-choix button[aria-pressed=true] { background: var(--acc); border-color: var(--acc); color: #fff; }

/* Agenda */
.bande a { border-radius: 16px; }
.bande a.auj { background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 80%, #fff), var(--acc)); color: #fff; }
.jour h3 { color: var(--texte); }
.jour .liste .evenement .heure { color: var(--acc); }

/* Repas */
.jour-repas.auj { box-shadow: 0 0 0 2px var(--acc), var(--ombre); background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 9%, var(--carte)), var(--carte) 70%); }
.repas-jour .moment { color: var(--acc); }
.note-semaine { border-radius: 18px; box-shadow: var(--ombre); }
.note-semaine.vide-note { box-shadow: none; border-color: color-mix(in srgb, var(--acc) 35%, var(--bord)); color: var(--acc); font-weight: 600; }

/* Feuilles du bas */
#feuille .panneau { border-radius: 26px 26px 0 0; }
.btn:not(.second):not(.danger) {
  background: linear-gradient(140deg, var(--acc), color-mix(in srgb, var(--acc) 82%, #000)); color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--acc) 28%, transparent);
}
.filtre[aria-pressed=true] { border-color: color-mix(in srgb, var(--c) 50%, var(--bord)); background: color-mix(in srgb, var(--c) 10%, var(--carte)); }

/* Plus */
.couleurs button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--c), 0 4px 10px color-mix(in srgb, var(--c) 40%, transparent); }
a.carte.ligne { align-items: center; gap: 12px; }
#onglets a[aria-current=page] { color: var(--acc); background: color-mix(in srgb, var(--acc) 13%, transparent); }
#segments button { gap: 4px; font-size: 13.5px; padding: 0 2px; letter-spacing: -.01em; }
