/* Foyer — thème clair / sombre (palette de la V1 : sapin et miel) */
:root {
  color-scheme: light;
  --fond: #f1f3ee;
  --surface: #fbfcf9;
  --surface-2: #e9ece4;
  --bordure: #dcdfd5;
  --texte: #232a22;
  --texte-2: #4b5448;
  --discret: #6c7568;
  --accent: #2e4a3b;
  --accent-texte: #ffffff;
  --accent-doux: #e2ebe4;
  --bon: #0ca30c;
  --bon-texte: #006300;
  --attention: #fab219;
  --attention-texte: #8a5a00;
  --critique: #d03b3b;
  --critique-texte: #b02a2a;
  --serie-1: #2e4a3b;
  --phase-arret: #eb6834;
  --phase-maternite: #1baf7a;
  --phase-naissance_m1: #eda100;
  --phase-naissance_m2: #e87ba4;
  --phase-parental: #008300;
  --phase-reprise: #4a3aa7;
  --phase-autre: #8a8883;
  --ombre: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .04);
  --rayon: 16px;
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #141815;
    --surface: #1d231e;
    --surface-2: #262e27;
    --bordure: #2c332d;
    --texte: #ffffff;
    --texte-2: #c3c2b7;
    --discret: #96958c;
    --accent: #8cc2a6;
    --accent-doux: #22342a;
    --bon-texte: #4fd04f;
    --attention-texte: #fab219;
    --critique-texte: #ef7a7a;
    --serie-1: #8cc2a6;
    --phase-arret: #d95926;
    --phase-maternite: #199e70;
    --phase-naissance_m1: #c98500;
    --phase-naissance_m2: #d55181;
    --phase-parental: #008300;
    --phase-reprise: #9085e9;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #141815;
  --surface: #1d231e;
  --surface-2: #262e27;
  --bordure: #2c332d;
  --texte: #ffffff;
  --texte-2: #c3c2b7;
  --discret: #96958c;
  --accent: #8cc2a6;
  --accent-doux: #22342a;
  --bon-texte: #4fd04f;
  --attention-texte: #fab219;
  --critique-texte: #ef7a7a;
  --serie-1: #8cc2a6;
  --phase-arret: #d95926;
  --phase-maternite: #199e70;
  --phase-naissance_m1: #c98500;
  --phase-naissance_m2: #d55181;
  --phase-parental: #008300;
  --phase-reprise: #9085e9;
  --ombre: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
.discret { color: var(--discret); }
.petit { font-size: .85rem; }
.droite { text-align: right; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------ structure */
.app { min-height: 100dvh; }
.entete {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--haut-sur) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--fond) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--bordure) 60%, transparent);
}
.entete-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 760px; margin: 0 auto; }
.entete-titre { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vue { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(96px + var(--bas-sur)); outline: none; }

.scenario, .segment {
  display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 2px; flex-shrink: 0;
}
.scenario button, .segment button {
  border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  color: var(--texte-2); cursor: pointer; min-height: 32px;
}
.scenario button[aria-checked="true"], .segment button[aria-pressed="true"] {
  background: var(--surface); color: var(--texte); box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.segment { width: 100%; margin-bottom: 14px; }
.segment button { flex: 1; font-size: .9rem; padding: 7px 10px; }

.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + var(--bas-sur));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--bordure);
}
.onglets a {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--discret); font-size: .68rem; font-weight: 600; padding: 4px 0; border-radius: 10px;
}
.onglets svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.onglets a[aria-current="page"] { color: var(--accent); }
.onglets a[aria-current="page"] svg circle { fill: currentColor; }

/* ------------------------------------------------ cartes */
.carte {
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 16px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--bordure) 55%, transparent);
}
.carte-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.carte-titre a, .lien { font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.section-titre { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); font-weight: 700; margin: 22px 4px 8px; }

.heros { font-size: 2.4rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.heros-legende { color: var(--texte-2); font-size: .9rem; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chiffre { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.chiffre b { display: block; font-size: 1.15rem; }
.chiffre span { font-size: .78rem; color: var(--texte-2); }

.statut {
  display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700;
  padding: 3px 9px 3px 6px; border-radius: 999px; white-space: nowrap;
}
.statut::before { content: ""; width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; background-position: center; background-repeat: no-repeat; background-size: 10px; }
.statut.vert { background: color-mix(in srgb, var(--bon) 14%, transparent); color: var(--bon-texte); }
.statut.vert::before { background-color: var(--bon); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2 4.1 7.3 8 3' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.statut.orange { background: color-mix(in srgb, var(--attention) 20%, transparent); color: var(--attention-texte); }
.statut.orange::before { background-color: var(--attention); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2.2v3.4' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='5' cy='7.6' r='.9' fill='white'/%3E%3C/svg%3E"); }
.statut.rouge { background: color-mix(in srgb, var(--critique) 14%, transparent); color: var(--critique-texte); }
.statut.rouge::before { background-color: var(--critique); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='m3 3 4 4M7 3 3 7' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.statut.neutre { background: var(--surface-2); color: var(--texte-2); }
.statut.neutre::before { display: none; }
.puce { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--texte-2); white-space: nowrap; }
.puce.estime { background: color-mix(in srgb, var(--attention) 18%, transparent); color: var(--attention-texte); }
.puce.confirme { background: color-mix(in srgb, var(--bon) 12%, transparent); color: var(--bon-texte); }
.pastille-phase { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }

/* barre de progression */
.jauge { position: relative; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: visible; margin: 12px 0 6px; }
.jauge-rempli { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--serie-1); max-width: 100%; }
.jauge-rempli.depasse { background: var(--critique); }
.jauge-repere { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--texte); border-radius: 1px; }
.jauge-legende { display: flex; justify-content: space-between; font-size: .78rem; color: var(--texte-2); }

/* ------------------------------------------------ listes */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { border-top: 1px solid var(--bordure); }
.liste > li:first-child { border-top: 0; }
.ligne {
  display: flex; align-items: center; gap: 12px; padding: 11px 2px; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer; color: inherit; text-decoration: none; min-height: 48px;
}
.ligne-corps { flex: 1; min-width: 0; }
.ligne-titre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ligne-sous { font-size: .8rem; color: var(--texte-2); margin-top: 1px; }
.ligne-montant { font-weight: 650; white-space: nowrap; text-align: right; }
.ligne-montant small { display: block; font-weight: 500; font-size: .75rem; color: var(--discret); }
.chevron::after { content: "›"; color: var(--discret); font-size: 1.3rem; margin-left: 2px; }
.groupe-titre { font-size: .78rem; font-weight: 700; color: var(--discret); text-transform: uppercase; letter-spacing: .05em; padding: 14px 2px 2px; }

.alerte { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; margin-bottom: 8px; font-size: .88rem; align-items: flex-start; }
.alerte::before { content: "i"; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .75rem; color: #fff; background: var(--accent); margin-top: 1px; }
.alerte.info { background: var(--accent-doux); }
.alerte.orange { background: color-mix(in srgb, var(--attention) 16%, transparent); }
.alerte.orange::before { content: "!"; background: var(--attention); }
.alerte.rouge { background: color-mix(in srgb, var(--critique) 12%, transparent); }
.alerte.rouge::before { content: "!"; background: var(--critique); }
.alerte.vert { background: color-mix(in srgb, var(--bon) 12%, transparent); }
.alerte.vert::before { content: "✓"; background: var(--bon); }

/* ------------------------------------------------ tableaux */
.tableau-defile { overflow-x: auto; margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
table.tableau { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tableau th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--discret); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--bordure); white-space: nowrap; }
.tableau td { padding: 9px 6px; border-bottom: 1px solid var(--bordure); white-space: nowrap; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .num { text-align: right; }
.tableau tbody tr[data-mois] { cursor: pointer; }
.tableau tbody tr[data-mois]:active { background: var(--surface-2); }
.tableau tr.courant td { font-weight: 700; }

/* ------------------------------------------------ graphique */
.graphe { position: relative; width: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.graphe svg { display: block; width: 100%; overflow: visible; }
.graphe .axe text { fill: var(--discret); font-size: 11px; }
.graphe .grille line { stroke: var(--bordure); stroke-width: 1; }
.graphe .seuil-rouge { stroke: var(--critique); stroke-width: 1.5; stroke-dasharray: 5 4; }
.graphe .seuil-vert { stroke: var(--bon); stroke-width: 1; stroke-dasharray: 2 4; opacity: .8; }
.graphe .seuil-texte { font-size: 10.5px; font-weight: 700; }
.graphe .fourchette { fill: var(--serie-1); opacity: .16; }
.graphe .courbe { fill: none; stroke: var(--serie-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graphe .point { stroke: var(--surface); stroke-width: 2; }
.graphe .point.vert { fill: var(--bon); }
.graphe .point.orange { fill: var(--attention); }
.graphe .point.rouge { fill: var(--critique); }
.graphe .phase-bande { opacity: .11; }
.graphe .phase-texte { font-size: 10px; font-weight: 700; fill: var(--texte-2); }
.graphe .viseur { stroke: var(--texte-2); stroke-width: 1; stroke-dasharray: 3 3; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--texte-2); margin-top: 8px; }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.legende i { display: inline-block; width: 16px; height: 8px; border-radius: 2px; }
.legende i.trait { height: 2px; background: var(--serie-1); }
.legende i.zone { background: var(--serie-1); opacity: .25; height: 10px; }
.legende i.pointille { height: 0; border-top: 2px dashed var(--critique); }
.infobulle {
  position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--texte);
  border: 1px solid var(--bordure); box-shadow: 0 6px 24px rgba(0, 0, 0, .16); border-radius: 12px;
  padding: 9px 11px; font-size: .8rem; min-width: 170px; max-width: 240px;
}
.infobulle b { display: block; margin-bottom: 3px; }
.infobulle .ib-ligne { display: flex; justify-content: space-between; gap: 12px; }
.infobulle .ib-ligne span:first-child { color: var(--texte-2); }

/* barres horizontales (catégories) */
.barres { display: grid; gap: 9px; }
.barre-ligne { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.barre-piste { height: 10px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.barre-val { height: 100%; background: var(--serie-1); border-radius: 0 4px 4px 0; }

/* ------------------------------------------------ formulaires */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte);
  padding: 11px 16px; border-radius: 12px; font-weight: 650; cursor: pointer; min-height: 46px; text-decoration: none;
}
.bouton.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.bouton.danger { color: var(--critique-texte); }
.bouton.plein { width: 100%; }
.bouton:disabled { opacity: .5; cursor: default; }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.boutons .bouton { flex: 1 1 140px; }
.bouton-icone { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: var(--texte-2); font-size: .95rem; }
.flottant {
  position: fixed; right: 18px; bottom: calc(78px + var(--bas-sur)); z-index: 25;
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  font-size: 30px; line-height: 1; box-shadow: 0 6px 20px rgba(46, 74, 59, .35); cursor: pointer;
}

label { display: block; font-size: .82rem; font-weight: 600; color: var(--texte-2); margin-bottom: 12px; }
label > input, label > select, label > textarea, .champ {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 11px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); font-size: 16px; min-height: 46px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.case { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--texte); font-weight: 500; }
.case input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rangee-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.rangee-3 label { margin-bottom: 6px; }
.aide { font-size: .8rem; color: var(--discret); margin: -6px 0 12px; }
.erreur { color: var(--critique-texte); font-size: .88rem; min-height: 1.2em; margin: 4px 0 8px; }
fieldset { border: 1px solid var(--bordure); border-radius: 12px; padding: 10px 12px 2px; margin: 0 0 12px; }
legend { font-size: .8rem; font-weight: 700; color: var(--texte-2); padding: 0 4px; }

/* hypothèses (édition rapide) */
.hypothese { padding: 12px 0; border-top: 1px solid var(--bordure); }
.hypothese:first-child { border-top: 0; }
.hypothese-titre { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.hypothese input { margin-top: 3px; padding: 8px 10px; min-height: 40px; text-align: right; }
.hypothese label { font-size: .72rem; margin-bottom: 0; }

/* ------------------------------------------------ feuille (bottom sheet) */
.feuille-fond { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; animation: apparait .2s ease; }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 40px rgba(0, 0, 0, .2);
  max-width: 640px; margin: 0 auto; animation: monte .25s cubic-bezier(.2, .8, .2, 1);
}
.feuille-poignee { width: 38px; height: 5px; border-radius: 3px; background: var(--bordure); margin: 8px auto 0; }
.feuille-entete { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 6px; gap: 10px; }
.feuille-entete h2 { font-size: 1.1rem; }
.feuille-corps { overflow-y: auto; padding: 6px 16px calc(18px + var(--bas-sur)); -webkit-overflow-scrolling: touch; }
@keyframes monte { from { transform: translateY(100%); } to { transform: none; } }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .feuille, .feuille-fond { animation: none; } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--bas-sur)); z-index: 70;
  background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 12px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: calc(100% - 32px);
}
.toast.erreur-toast { background: var(--critique); color: #fff; }

/* ------------------------------------------------ connexion / chargement */
.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.connexion-carte { width: 100%; max-width: 360px; background: var(--surface); border-radius: 22px; padding: 28px 22px; box-shadow: var(--ombre); text-align: center; }
.connexion-carte label { text-align: left; }
.connexion-carte h1 { font-size: 1.5rem; margin-top: 10px; }
.connexion-carte .discret { margin: 4px 0 20px; }
.connexion-carte .bouton { width: 100%; }
.connexion-logo { border-radius: 16px; }
.chargement { position: fixed; inset: 0; display: grid; place-items: center; color: var(--discret); }

.mois-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mois-nav h2 { font-size: 1.1rem; text-transform: capitalize; }
.vide { text-align: center; color: var(--discret); padding: 20px 10px; font-size: .9rem; }
.apercu-csv { max-height: 46dvh; overflow: auto; border: 1px solid var(--bordure); border-radius: 12px; margin-bottom: 12px; }
.apercu-csv table { font-size: .78rem; }
.apercu-csv td { white-space: normal; vertical-align: top; }
.apercu-csv select { padding: 4px; min-height: 0; font-size: .78rem; border-radius: 6px; border: 1px solid var(--bordure); background: var(--surface); }
.apercu-csv tr.exclu td { opacity: .45; }
.regle { font-size: .86rem; color: var(--texte-2); margin: 0 0 8px; padding-left: 14px; position: relative; }
.regle::before { content: "•"; position: absolute; left: 2px; color: var(--discret); }

@media (min-width: 700px) {
  .vue { padding-top: 22px; }
  .grille-large { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .grille-large > .carte { margin-bottom: 0; }
  .flottant { right: max(18px, calc(50% - 360px)); }
}
.tableau td .petit { white-space: normal; min-width: 140px; }

/* comptes et banque */
.ligne-montant.credit { color: var(--bon-texte); }
.ligne-montant.neutre { color: var(--discret); font-weight: 500; }
.etat-rapproche { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.etat-rapproche.fait { background: color-mix(in srgb, var(--bon) 16%, transparent); color: var(--bon-texte); }
.etat-rapproche.attente { background: var(--surface-2); color: var(--discret); }
.etat-rapproche.erreur { background: color-mix(in srgb, var(--critique) 14%, transparent); color: var(--critique-texte); }
.petit-segment { margin-bottom: 6px; }
.petit-segment button { font-size: .78rem; padding: 6px 4px; }
.boutons-ligne { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.danger-lien { color: var(--critique-texte) !important; }
.compte-ligne { padding: 12px 2px; }
.compte-ligne .rangee { margin-top: 8px; }
.compte-ligne select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--bordure); background: var(--surface); min-height: 40px; font-size: 15px; }
.etapes { padding-left: 20px; margin: 10px 0 0; }
.etapes li { margin-bottom: 10px; font-size: .92rem; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.choix-banque select { margin-bottom: 10px; }
.choix-banque input { margin-bottom: 8px; }
.replie summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; cursor: pointer; font-weight: 700; list-style: none; border-top: 1px solid var(--bordure); }
.replie summary::-webkit-details-marker { display: none; }
.replie summary span:first-child::before { content: "▸ "; color: var(--discret); }
.replie[open] summary span:first-child::before { content: "▾ "; }
.jauge-legende { margin-bottom: 12px; }
.courbe.prevision { stroke-dasharray: 5 5; opacity: .75; }
.graphe .point.creux { fill: var(--surface); stroke-width: 2; }
.graphe .point.creux.vert { stroke: var(--bon); }
.graphe .point.creux.orange { stroke: var(--attention); }
.graphe .point.creux.rouge { stroke: var(--critique); }
.legende i.pointille-bleu { height: 0; background: none; border-top: 2px dashed var(--serie-1); }
.suggestion { display: flex; gap: 12px; padding: 12px 2px; align-items: flex-start; }
.petit-bouton { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.barre { text-decoration: line-through; color: var(--discret); }
.scenario button { padding: 5px 8px; }
.cle-texte { font-family: ui-monospace, Menlo, monospace; font-size: 12px !important; min-height: 140px; }


/* ------------------------------------------------ Foyer */
:root { --miel: #e0a342; --miel-texte: #7a5312; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent-texte: #12160f; --miel-texte: #e7b667; } }
:root[data-theme="dark"] { --accent-texte: #12160f; --miel-texte: #e7b667; }
.direct { font-size: .72rem; font-weight: 700; color: var(--bon-texte); white-space: nowrap; }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #888); flex-shrink: 0; }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .7rem; font-weight: 800; color: #fff;
  background: var(--c, #888); flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--bordure); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: .86rem; font-weight: 600; color: var(--texte); cursor: pointer; min-height: 36px; text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.chip .compte { font-size: .72rem; background: var(--surface-2); color: var(--texte-2); border-radius: 999px; padding: 1px 7px; }
.chip[aria-pressed="true"] .compte { background: rgba(255, 255, 255, .25); color: inherit; }
.defile-x { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px; scrollbar-width: none; }
.defile-x::-webkit-scrollbar { display: none; }
.defile-x > * { flex-shrink: 0; }

/* tuiles d'accueil */
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tuile { background: var(--surface); border: 1px solid color-mix(in srgb, var(--bordure) 55%, transparent); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 14px; text-decoration: none; color: var(--texte); display: flex; flex-direction: column; gap: 4px; min-height: 104px; }
.tuile-k { font-size: .76rem; font-weight: 700; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }
.tuile-v { font-size: 2rem; font-weight: 800; line-height: 1.05; }
.tuile-v small { font-size: .85rem; font-weight: 600; color: var(--texte-2); margin-left: 4px; }
.tuile-l { font-size: .88rem; }
.tuile-l b { color: var(--miel-texte); }

/* listes */
.ajout { display: grid; grid-template-columns: 1fr 74px auto; gap: 8px; margin-bottom: 10px; }
.ajout input { margin: 0; }
.ajout .bouton { min-height: 46px; padding: 0 14px; }
.article { display: flex; align-items: center; gap: 10px; padding: 9px 2px; min-height: 52px; }
.coche { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--bordure);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; margin: 0; }
.coche:checked { background: var(--accent); border-color: var(--accent); }
.coche:checked::after { content: ""; width: 7px; height: 12px; border: solid var(--accent-texte); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.article-corps { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; }
.article-libelle { font-weight: 600; overflow-wrap: anywhere; }
.article.fait .article-libelle { text-decoration: line-through; color: var(--discret); font-weight: 500; }
.article-qte { color: var(--miel-texte); font-weight: 700; font-size: .85rem; margin-left: 6px; }
.article-sous { font-size: .74rem; color: var(--discret); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.rayon-titre { font-size: .76rem; font-weight: 700; color: var(--texte-2); padding: 12px 2px 2px; }
.suggestions { margin: -2px 0 12px; }
.suggestions .chip { font-weight: 500; font-size: .82rem; min-height: 32px; padding: 4px 10px; }

/* repas */
.semaine-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.semaine-nav b { font-size: 1rem; }
.jour { background: var(--surface); border: 1px solid color-mix(in srgb, var(--bordure) 55%, transparent); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 10px 12px; margin-bottom: 10px; }
.jour.aujourdhui { border: 2px solid var(--accent); }
.jour.passe { opacity: .55; }
.jour-tete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.jour-tete b { text-transform: capitalize; }
.jour-tete .evt { font-size: .76rem; color: var(--miel-texte); font-weight: 700; }
.creneau { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 2px; background: none; border: 0; border-top: 1px solid var(--bordure);
  color: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.creneau:first-of-type { border-top: 0; }
.creneau-t { width: 42px; font-size: .74rem; font-weight: 700; color: var(--discret); text-transform: uppercase; }
.creneau-l { flex: 1; font-weight: 600; }
.creneau-l.vide-l { color: var(--discret); font-weight: 400; font-style: italic; }
.creneau .recette { font-size: .7rem; color: var(--miel-texte); font-weight: 700; }

/* recettes */
.ingredient { display: grid; grid-template-columns: 1fr 90px 34px; gap: 6px; margin-bottom: 6px; }
.ingredient input { margin: 0; min-height: 42px; padding: 8px 10px; }
.couleurs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.couleurs button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; background: var(--c); cursor: pointer; }
.couleurs button[aria-pressed="true"] { border-color: var(--texte); }

/* mode magasin, check-lists, hors ligne */
.direct.hors-ligne { color: var(--attention-texte); }
.outils-liste { display: flex; gap: 8px; margin-bottom: 10px; }
.outils-liste .bouton:first-child { flex: 1; }
.section-ajout { margin: -4px 0 10px; }
.section-ajout select { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); min-height: 40px; }
.progression { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); margin: 8px 0; }
.progression-val { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); }
.magasin-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.magasin-tete { position: sticky; top: calc(var(--haut-sur) + 58px); z-index: 10; }
.article.magasin { width: 100%; min-height: 64px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font-size: 1.15rem;
  padding: 12px 4px; display: flex; align-items: center; gap: 14px; }
.article.magasin .article-libelle { font-weight: 650; flex: 1; }
.article.magasin .article-qte { font-size: 1rem; }
.coche-grande { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; border: 2.5px solid var(--bordure); display: grid; place-items: center;
  font-size: 1.2rem; font-weight: 800; color: var(--accent-texte); }
.article.magasin.fait .coche-grande { background: var(--accent); border-color: var(--accent); }
.article.magasin.fait .article-libelle { text-decoration: line-through; color: var(--discret); font-weight: 500; }
.carte.panier { opacity: .7; }
.vide.grand { font-size: 1.2rem; padding: 40px 10px; }
