/* =========================================================
   Gestio — livre de caisse personnel
   Encre sur papier : l'interface reste en noir et blanc cassé,
   la couleur est réservée aux données (familles et alertes).
   ========================================================= */

:root {
  color-scheme: light;

  /* papier & encre */
  --papier: #efe8d8;
  --carte: #fffdf7;
  --encre: #1c1a15;
  --encre-2: #544f45;
  --encre-3: #766f60;
  --clair: #f3ecdc;
  --filet: rgba(28, 26, 21, .14);
  --filet-leger: rgba(28, 26, 21, .06);
  --piste: #e8e2d3;

  /* familles de dépenses (palette validée, ordre fixe) */
  --s-fixe: #2a78d6;
  --s-quotidien: #eb6834;
  --s-epargne: #1baf7a;
  --s-ponctuel: #eda100;
  --s-libre: #cfc8b6;

  /* états (toujours accompagnés d'une icône et d'un libellé) */
  --bon: #0ca30c;
  --attention: #fab219;
  --serieux: #ec835a;
  --critique: #d03b3b;
  --piste-attention: #fbe9bd;
  --piste-serieux: #f9dccf;
  --piste-critique: #f5d3cf;
  --piste-epargne: #cdeedd;

  --police: Bahnschrift, "DIN Alternate", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --rayon: 4px;
  --ombre: 0 1px 0 rgba(28, 26, 21, .05), 0 16px 30px -24px rgba(28, 26, 21, .5);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.5;
  color: var(--encre);
  background-color: var(--papier);
  /* lignes de cahier */
  background-image: linear-gradient(to bottom, transparent 31px, var(--filet-leger) 31px);
  background-size: 100% 32px;
}

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

svg { display: block; }
.nav svg, .btn svg, .icone svg, .mois-nav svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- structure ---------- */

.app {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 30px 18px 22px;
  background: var(--encre);
  color: var(--clair);
}

.marque { padding: 0 10px; }
.marque-nom {
  display: block;
  font-size: 34px; font-weight: 700; font-stretch: 75%;
  letter-spacing: .05em; text-transform: uppercase; line-height: 1;
}
.marque small {
  display: block; margin-top: 8px;
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  opacity: .6;
}

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 40px; }
.nav button {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px;
  border: 0; border-left: 3px solid transparent; border-radius: 0 3px 3px 0;
  background: none; text-align: left;
  font-size: 15.5px; opacity: .68;
  transition: opacity .15s, background-color .15s;
}
.nav button:hover { opacity: 1; background: rgba(243, 236, 220, .06); }
.nav button[aria-current="page"] {
  opacity: 1; font-weight: 600;
  border-left-color: var(--clair);
  background: rgba(243, 236, 220, .1);
}
.nav button:focus-visible { outline-color: var(--clair); }

.rail-note {
  margin-top: auto; padding: 14px 10px 0;
  border-top: 1px solid rgba(243, 236, 220, .16);
  font-size: 12.5px; line-height: 1.45; opacity: .6;
}

.page {
  width: 100%; max-width: 1120px;
  padding: 30px 40px 72px;
}

.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px; margin-bottom: 26px;
}
.entete h1 {
  font-size: clamp(26px, 4vw, 40px); font-weight: 700; font-stretch: 75%;
  text-transform: uppercase; letter-spacing: .03em; line-height: 1;
}
.entete-titre { display: flex; align-items: center; gap: 4px; min-width: 0; }
.mois-nav {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--filet); border-radius: var(--rayon);
  background: var(--carte);
}
.mois-nav:hover { border-color: var(--encre); }
.entete-titre h1 { margin: 0 10px; white-space: nowrap; }
.retour-auj {
  margin-left: 10px;
  border: 0; background: none; padding: 4px 2px;
  font-size: 13.5px; color: var(--encre-2);
  text-decoration: underline; text-underline-offset: 3px;
}
.retour-auj:hover { color: var(--encre); }

/* ---------- boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--encre); border-radius: var(--rayon);
  background: transparent;
  font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background-color .15s, color .15s, transform .1s;
}
.btn:hover { background: rgba(28, 26, 21, .07); }
.btn:active { transform: translateY(1px); }
.btn.primaire { background: var(--encre); color: var(--clair); }
.btn.primaire:hover { background: #38342b; }
.btn.mini { padding: 5px 11px; font-size: 13.5px; border-width: 1px; }
.btn.danger { border-color: var(--critique); color: #a32828; }
.btn.danger.arme { background: var(--critique); color: #fff; }

.lien {
  border: 0; background: none; padding: 2px 0;
  font-size: 14px; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.lien:hover { text-decoration-thickness: 2px; }

.icone {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 0; border-radius: var(--rayon);
  background: none; color: var(--encre-3);
}
.icone:hover { background: rgba(28, 26, 21, .08); color: var(--encre); }
.icone svg { width: 18px; height: 18px; }

/* ---------- cartes & titres ---------- */

.carte {
  background: var(--carte);
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 22px 24px 24px;
}

#vue { display: grid; gap: 20px; }

.titre {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding-bottom: 9px;
  border-bottom: 3px double var(--encre);
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .13em;
}
.titre .titre-plus {
  font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--encre-2); text-align: right;
}

.grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.colonne { display: grid; gap: 20px; min-width: 0; }

.pastille {
  display: inline-block; flex: none;
  width: 10px; height: 10px; margin-right: 8px;
  border-radius: 2px; background: var(--c, var(--s-libre));
}

.muet { color: var(--encre-2); font-size: 14px; }
.vide { padding: 18px 0 6px; color: var(--encre-2); }
.vide strong { display: block; color: var(--encre); font-size: 17px; margin-bottom: 2px; }
.vide .btn { margin-top: 14px; }

/* ---------- états ---------- */

.statut {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--encre-2); line-height: 1.3;
}
.statut svg { width: 15px; height: 15px; flex: none; }
.statut.bon svg { color: var(--bon); }
.statut.attention svg { color: var(--attention); }
.statut.serieux svg { color: var(--serieux); }
.statut.critique svg { color: var(--critique); }
.statut.info svg { color: var(--encre-3); }

.etiquette {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 7px;
  border: 1px solid var(--filet); border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--encre); white-space: nowrap;
}
.etiquette svg { width: 14px; height: 14px; }
.etiquette.bon svg { color: var(--bon); }
.etiquette.attention svg { color: var(--attention); }
.etiquette.serieux svg { color: var(--serieux); }
.etiquette.critique svg { color: var(--critique); }
.etiquette.info svg { color: var(--encre-3); }

.bandeau {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--filet); border-left: 4px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--carte);
  font-size: 14.5px; color: var(--encre-2);
}
.bandeau strong { color: var(--encre); }
.bandeau p + p { margin-top: 4px; }
.bandeau .icone { margin: -4px -6px 0 auto; }

/* ---------- héro (accueil, épargne) ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  padding: 0;
  border-top: 4px solid var(--encre);
}
.hero-principal { padding: 26px 30px 28px; min-width: 0; }
.surtitre {
  font-size: 13px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--encre-2);
}
.hero-chiffre {
  margin: 10px 0 14px;
  font-size: clamp(64px, 9.5vw, 112px); font-weight: 700; font-stretch: 75%;
  line-height: .9; letter-spacing: -.005em; white-space: nowrap;
}
.hero-chiffre .unite { font-size: .36em; font-weight: 600; margin-left: .18em; letter-spacing: .02em; }
.hero-sous { color: var(--encre-2); font-size: 15px; }
.hero-etat { margin-top: 14px; }
.hero-etat .statut { font-size: 14.5px; color: var(--encre); }

.tuiles { display: grid; border-left: 1px solid var(--filet); }
.tuile { padding: 16px 24px; border-bottom: 1px solid var(--filet); display: grid; align-content: center; }
.tuile:last-child { border-bottom: 0; }
.tuile-label { font-size: 12px; letter-spacing: .11em; text-transform: uppercase; color: var(--encre-3); }
.tuile-valeur { font-size: 27px; font-weight: 600; font-stretch: 80%; line-height: 1.2; }
.tuile-sous { font-size: 13.5px; color: var(--encre-2); }

/* ---------- jauges ---------- */

.jauge {
  position: relative; height: 8px;
  border-radius: 4px; background: var(--piste);
}
.jauge-val {
  display: block; height: 100%; min-width: 0;
  border-radius: 4px; background: var(--encre);
  transition: width .35s cubic-bezier(.2, .7, .2, 1);
}
.jauge.attention { background: var(--piste-attention); }
.jauge.attention .jauge-val { background: var(--attention); }
.jauge.serieux { background: var(--piste-serieux); }
.jauge.serieux .jauge-val { background: var(--serieux); }
.jauge.critique { background: var(--piste-critique); }
.jauge.critique .jauge-val { background: var(--critique); }
.jauge.epargne { background: var(--piste-epargne); }
.jauge.epargne .jauge-val { background: var(--s-epargne); }
.jauge.haute { height: 12px; border-radius: 6px; }
.jauge.haute .jauge-val { border-radius: 6px; }

/* repère « où tu devrais en être aujourd'hui » */
.jauge-repere {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px; margin-left: -1px;
  background: var(--encre);
  box-shadow: 0 0 0 2px var(--carte);
  border-radius: 1px;
}

.enveloppes { display: grid; gap: 18px; }
.env-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.env-nom { font-weight: 600; font-size: 16px; }
.env-chiffres { font-size: 14.5px; color: var(--encre-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.env-chiffres b { color: var(--encre); font-weight: 600; }
.env-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; min-height: 24px; }
.reste { font-size: 13.5px; color: var(--encre-2); }
.note-repere { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--encre-2); }
.note-repere i { display: inline-block; width: 2px; height: 14px; background: var(--encre); border-radius: 1px; }

/* ---------- à régler ---------- */

.regles li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--filet);
}
.regles li:last-child { border-bottom: 0; padding-bottom: 2px; }
.regles li:first-child { padding-top: 2px; }
.regle-nom { font-weight: 600; display: flex; align-items: center; min-width: 0; }
.regle-montant { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.regle-etat { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.regles li.fait .regle-nom, .regles li.fait .regle-montant { color: var(--encre-2); }
.dabord {
  margin-left: 10px; padding: 1px 7px;
  border: 1px solid var(--encre); border-radius: 2px;
  font-size: 10.5px; font-style: normal; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}

/* ---------- liste des dépenses ---------- */

.jour + .jour { margin-top: 18px; }
.jour-tete {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 6px; border-bottom: 1px solid var(--encre);
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.jour-tete span:last-child { font-variant-numeric: tabular-nums; letter-spacing: 0; }

.dep {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto auto;
  align-items: center; gap: 12px;
  padding: 8px 0; min-height: 46px;
  border-bottom: 1px solid var(--filet);
}
.deps.sans-actions .dep { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; }
.deps .dep:last-child { border-bottom: 0; }
.dep-cat { display: flex; align-items: center; font-weight: 600; min-width: 0; }
.dep-cat span, .dep-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-note { color: var(--encre-2); font-size: 14.5px; }
.dep-montant { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.dep-actions { display: flex; gap: 2px; }

.barre-outils { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- champs ---------- */

.champ { display: grid; gap: 5px; min-width: 0; }
.champ > span { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-2); }

input[type="text"], input[type="date"], select {
  width: 100%; min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--filet); border-radius: var(--rayon);
  background: #fff;
}
input:hover, select:hover { border-color: rgba(28, 26, 21, .4); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--encre); outline-offset: 0; border-color: var(--encre); }

/* saisie « à la ligne », comme dans un cahier */
.ligne {
  border: 0 !important; border-bottom: 1px solid var(--filet) !important; border-radius: 0 !important;
  background: transparent !important; padding: 6px 2px !important;
}
.ligne:hover { border-bottom-color: var(--encre-3) !important; }
.ligne:focus-visible { outline: 0 !important; border-bottom: 2px solid var(--encre) !important; padding-bottom: 5px !important; background: rgba(28, 26, 21, .04) !important; }
.chiffre { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- budget ---------- */

.salaire { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.salaire-saisie { display: flex; align-items: baseline; gap: 10px; }
.salaire-saisie input {
  width: 6.2ch; box-sizing: content-box;
  font-size: 46px; font-weight: 700; font-stretch: 75%; line-height: 1;
  text-align: left;
}
.salaire-saisie span { font-size: 20px; font-weight: 600; }
.verdict { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.verdict .statut { font-size: 15px; color: var(--encre); }

.segbarre { display: flex; gap: 2px; height: 28px; margin-top: 18px; }
.seg {
  position: relative; flex: 0 1 0; min-width: 0;
  border-radius: 4px; background: var(--c);
  color: #fff; font-size: 13.5px; font-weight: 600;
}
.seg-ponctuel, .seg-libre { color: var(--encre); }
.seg-lab { position: absolute; left: 9px; top: 0; line-height: 28px; white-space: nowrap; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; font-size: 14px; color: var(--encre-2); }
.legende li { display: flex; align-items: center; }
.legende b { margin-left: 7px; color: var(--encre); font-weight: 600; font-variant-numeric: tabular-nums; }

.groupe + .groupe { margin-top: 26px; }
.groupe-tete {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 7px; border-bottom: 1px solid var(--encre);
  font-size: 16px; font-weight: 600;
}
.groupe-tete .pastille { align-self: center; margin-right: 0; }
.groupe-tete .aide { font-size: 13.5px; font-weight: 400; color: var(--encre-2); }
.groupe-tete .g-total { margin-left: auto; font-size: 14.5px; font-variant-numeric: tabular-nums; }

.lb {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(250px, 1.5fr) 48px 132px 32px;
  align-items: center; gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--filet);
}
.lb-nom { font-weight: 600; }
.lb-montant { display: flex; align-items: center; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.lb-montant input { width: 84px; }
.lb-montant input.court { width: 40px; }
.lb-montant .u { color: var(--encre-2); font-size: 14px; }
.lb-montant .egal { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 74px; text-align: right; }
.lb-mode { font-size: 12.5px; font-weight: 400; color: var(--encre-2); margin-left: 4px; }
.lb-part { text-align: right; font-size: 14px; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.lb select { padding: 6px 8px; font-size: 14px; }
.groupe > .lien { margin-top: 10px; }

.donnees { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ---------- analyse ---------- */

.resume { font-size: 19px; line-height: 1.45; max-width: 62ch; }
.resume b { font-weight: 600; }

.diags { display: grid; gap: 0; }
.diag { padding: 18px 0; border-bottom: 1px solid var(--filet); display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 6px 20px; }
.diag:first-child { padding-top: 4px; }
.diag:last-child { border-bottom: 0; padding-bottom: 2px; }
.diag h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.diag-corps { display: grid; gap: 9px; min-width: 0; }
.diag p { color: var(--encre-2); font-size: 15px; max-width: 68ch; }

.rb { position: relative; height: 8px; max-width: 440px; border-radius: 4px; background: var(--piste); margin-top: 4px; }
.rb-val { display: block; height: 100%; border-radius: 4px; background: var(--encre); }
.rb-tick { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--encre); box-shadow: 0 0 0 2px var(--carte); border-radius: 1px; }
.rb.attention { background: var(--piste-attention); } .rb.attention .rb-val { background: var(--attention); }
.rb.serieux { background: var(--piste-serieux); } .rb.serieux .rb-val { background: var(--serieux); }
.rb.critique { background: var(--piste-critique); } .rb.critique .rb-val { background: var(--critique); }
.rb-legende { font-size: 13.5px !important; color: var(--encre-2); }
.rb-legende b { color: var(--encre); font-weight: 600; }

.etapes { counter-reset: e; display: grid; gap: 0; }
.etapes li { counter-increment: e; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; padding: 13px 0; border-bottom: 1px solid var(--filet); }
.etapes li:last-child { border-bottom: 0; padding-bottom: 2px; }
.etapes li::before {
  content: counter(e);
  grid-row: span 2;
  font-size: 38px; font-weight: 700; font-stretch: 75%; line-height: 1;
}
.etapes b { font-weight: 600; font-size: 16.5px; }
.etapes b small { font-weight: 400; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-2); margin-left: 8px; }
.etapes p { color: var(--encre-2); font-size: 15px; grid-column: 2; }

.leviers li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 13px 0; border-bottom: 1px solid var(--filet); }
.leviers li:last-child { border-bottom: 0; }
.leviers b { font-weight: 600; font-size: 16.5px; }
.leviers p { grid-column: 1; color: var(--encre-2); font-size: 15px; }
.leviers .gain { grid-row: span 2; align-self: center; text-align: right; font-size: 22px; font-weight: 600; font-stretch: 80%; white-space: nowrap; }
.leviers .gain small { display: block; font-size: 12px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-2); }
.bilan-leviers { margin-top: 14px; padding-top: 14px; border-top: 3px double var(--encre); font-size: 15.5px; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 8px 0 8px 14px; text-align: right; border-bottom: 1px solid var(--filet); font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; white-space: normal; }
thead th { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-2); border-bottom: 1px solid var(--encre); }
tbody th { font-weight: 400; }
tbody th .pastille { margin-right: 8px; }
tfoot th, tfoot td { font-weight: 600; border-bottom: 0; border-top: 3px double var(--encre); }
td.ecart { color: var(--encre-2); }
.defile { overflow-x: auto; }

/* ---------- épargne ---------- */

.paliers { display: grid; gap: 18px; }
.reglages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.reglages .champ input { font-size: 20px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- dialogue ---------- */

dialog {
  width: min(460px, calc(100vw - 24px));
  padding: 0; border: 1px solid var(--encre); border-top-width: 4px; border-radius: var(--rayon);
  background: var(--carte); color: var(--encre);
  box-shadow: 0 30px 60px -20px rgba(28, 26, 21, .55);
}
dialog::backdrop { background: rgba(28, 26, 21, .45); }
dialog form { display: grid; gap: 16px; padding: 20px 22px 22px; }
.dlg-tete { display: flex; align-items: center; justify-content: space-between; }
.dlg-tete h2 { font-size: 15px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.saisie-montant { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--encre); }
.saisie-montant input {
  border: 0 !important; background: transparent !important; padding: 0 !important; outline: 0 !important;
  font-size: 52px; font-weight: 700; font-stretch: 75%; line-height: 1.1;
}
.saisie-montant i { font-style: normal; font-size: 22px; font-weight: 600; }
.raccourcis { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.raccourcis button {
  padding: 4px 12px;
  border: 1px solid var(--filet); border-radius: 999px; background: none;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.raccourcis button:hover { border-color: var(--encre); }
.deux { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; }
.erreur { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.erreur svg { width: 16px; height: 16px; color: var(--critique); flex: none; }
.dlg-pied { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- toast & bulle ---------- */

#toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100vw - 24px);
  padding: 11px 16px;
  background: var(--encre); color: var(--clair);
  border-radius: var(--rayon);
  box-shadow: 0 16px 32px -14px rgba(28, 26, 21, .6);
  font-size: 15px;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), opacity .2s;
}
#toast.visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#toast button { border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

#bulle {
  position: fixed; top: 0; left: 0; z-index: 40;
  padding: 6px 10px;
  background: var(--encre); color: var(--clair);
  border-radius: 3px; font-size: 13.5px; white-space: nowrap;
  pointer-events: none;
}

/* ---------- budget du jour (accueil) ---------- */

.plan-jour {
  display: grid; gap: 0;
  max-width: 440px; margin: 16px 0 4px;
  border-top: 1px solid var(--filet);
}
.plan-jour li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; gap: 12px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--filet);
  font-size: 15px;
}
.plan-jour b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.plan-jour small { font-size: 12.5px; color: var(--encre-2); text-align: right; font-variant-numeric: tabular-nums; }
.hero-note {
  margin-top: 12px; padding: 9px 12px;
  border-left: 3px solid var(--s-ponctuel); background: rgba(237, 161, 0, .08);
  font-size: 14px; color: var(--encre-2);
}
.hero-principal .actions { align-items: center; }
.hero-principal .actions .statut { font-size: 14.5px; color: var(--encre); }

/* ---------- case « lun–ven » du budget ---------- */

.lb-semaine {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 6px; font-size: 13px; color: var(--encre-2); cursor: pointer;
}
.lb-semaine input, .interrupteur input { accent-color: var(--encre); width: 16px; height: 16px; margin: 0; }

/* ---------- bilan du jour ---------- */

.dlg-bilan { width: min(540px, calc(100vw - 24px)); }
.bilan { display: grid; gap: 14px; padding: 20px 22px 22px; max-height: calc(100vh - 60px); overflow-y: auto; }
.bilan:focus { outline: none; }
.bilan-date { font-size: 30px; font-weight: 700; font-stretch: 75%; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; }
.bilan-question { color: var(--encre-2); font-size: 15px; margin-top: -6px; }
.bilan-chiffres { display: grid; grid-template-columns: 1fr 1fr; border-top: 3px double var(--encre); border-bottom: 1px solid var(--filet); }
.bilan-chiffres div { padding: 9px 0; display: grid; }
.bilan-chiffres div + div { padding-left: 16px; border-left: 1px solid var(--filet); }
.bilan-chiffres span { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-3); }
.bilan-chiffres b { font-size: 24px; font-weight: 600; font-stretch: 80%; }
.bilan-vide { color: var(--encre-2); font-size: 14.5px; }
.bilan .raccourcis { margin-top: 0; }
.bilan .dlg-pied { margin-top: 2px; }
.bilan .deps .dep { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }

/* ---------- toast d'alerte ---------- */

#toast.alerte { max-width: min(560px, calc(100vw - 24px)); align-items: flex-start; }
.toast-ico { flex: none; margin-top: 2px; }
.toast-ico svg { width: 18px; height: 18px; }
.toast-ico.critique { color: var(--critique); }
.toast-ico.attention { color: var(--attention); }

/* ---------- rappels ---------- */

.etat-ligne { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.etat-ligne .statut { font-size: 15px; color: var(--encre); }
.carte > .muet, .carte > p + p { margin-top: 10px; }
.prochain { margin-top: 12px; font-size: 15px; }
.sous-titre { margin-top: 20px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-2); }
.historique { margin-top: 6px; }
.historique li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--filet); font-size: 14px; }
.historique li span:first-child { color: var(--encre-2); font-variant-numeric: tabular-nums; }
.etapes-courtes { list-style: decimal; padding-left: 22px; margin-top: 12px; display: grid; gap: 6px; font-size: 15px; color: var(--encre-2); }
.etapes-courtes b { color: var(--encre); }

.interrupteur { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; margin-bottom: 16px; }
.reglages-heures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.reglages-heures small { font-size: 12.5px; color: var(--encre-2); }
input[type="time"] {
  width: 100%; padding: 6px 10px;
  border: 1px solid var(--filet); border-radius: var(--rayon); background: #fff;
  font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums;
}

.regles-rappel li { padding: 10px 0; border-bottom: 1px solid var(--filet); font-size: 14.5px; color: var(--encre-2); }
.regles-rappel li:last-child { border-bottom: 0; }
.regles-rappel li:first-child { padding-top: 2px; }
.regles-rappel b { color: var(--encre); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }

.apercus { display: grid; gap: 14px; }
.apercus li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.apercu-heure { font-size: 22px; font-weight: 700; font-stretch: 75%; padding-top: 10px; }
.notif {
  max-width: 400px; padding: 12px 14px 14px;
  background: #2b2a27; color: #f3f1ec;
  border-radius: 8px; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6);
  font-family: "Segoe UI", system-ui, sans-serif; font-size: 13.5px; line-height: 1.4;
}
.notif p + p { margin-top: 2px; color: #cfccc4; }
.notif-app { font-size: 12px; color: #a9a59b !important; margin-bottom: 6px; }
.notif-titre { font-weight: 600; color: #fff !important; font-size: 14.5px; }
.notif-bouton { display: block; margin-top: 10px; padding: 6px 0; text-align: center; border-radius: 4px; background: #3d3c38; font-size: 13px; }

/* ---------- écran de compte : connexion et configuration ---------- */

.ecran-compte {
  min-height: 100vh;
  padding: max(28px, env(safe-area-inset-top)) 16px max(40px, env(safe-area-inset-bottom));
}
.compte, .config { width: 100%; max-width: 460px; margin: 0 auto; display: grid; gap: 18px; }
.config { max-width: 760px; }
.compte-tete { text-align: center; padding: 18px 0 4px; }
.compte-tete .marque-nom, .config-tete .marque-nom {
  display: block; font-size: 44px; font-weight: 700; font-stretch: 75%;
  letter-spacing: .05em; text-transform: uppercase; line-height: 1;
}
.compte-tete small { display: block; margin-top: 8px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--encre-2); }
.compte-carte form { display: grid; gap: 14px; margin-top: 18px; }
.compte-carte .btn.primaire { padding: 12px 16px; font-size: 16px; }
input[type="email"], input[type="password"] {
  width: 100%; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--filet); border-radius: var(--rayon); background: #fff;
}
input[type="email"]:focus-visible, input[type="password"]:focus-visible { outline: 2px solid var(--encre); outline-offset: 0; border-color: var(--encre); }
.onglets { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--filet); }
.onglets button {
  padding: 10px 6px; border: 0; border-bottom: 3px solid transparent; background: none;
  font-size: 14.5px; font-weight: 600; color: var(--encre-2);
}
.onglets button[aria-selected="true"] { color: var(--encre); border-bottom-color: var(--encre); }
.info-compte .statut { color: var(--encre); font-size: 14.5px; }
.compte-atouts { display: grid; gap: 0; padding: 0 4px; }
.compte-atouts li { padding: 9px 0; border-bottom: 1px solid var(--filet); font-size: 14.5px; color: var(--encre-2); }
.compte-atouts li:last-child { border-bottom: 0; }
.compte-atouts b { color: var(--encre); margin-right: 6px; }
.compte-pied { text-align: center; }

.config-tete { padding: 10px 0 0; }
.config-tete h1 { margin-top: 14px; font-size: clamp(26px, 6vw, 36px); font-weight: 700; font-stretch: 75%; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.config-tete p { margin-top: 8px; color: var(--encre-2); max-width: 60ch; }
#form-config { display: grid; gap: 16px; }
.config-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.config-grille small { font-size: 12.5px; color: var(--encre-2); }
.config-grille input[type="text"] { font-size: 18px; font-weight: 600; }
.config-grille input[name="prochesNom"], .config-grille input[name="deviseAutre"] { font-size: 16px; font-weight: 400; }
.config-bilan { border-top: 4px solid var(--encre); }
.config-reste { font-size: 18px; }
.config-reste b { font-weight: 700; }
.config-repartition { margin: 10px 0 8px; border-top: 1px solid var(--filet); }
.config-repartition li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--filet); font-size: 15px; }
.config-repartition span { display: flex; align-items: center; }
.config-repartition b { font-variant-numeric: tabular-nums; }
.config-actions { display: flex; justify-content: flex-end; gap: 10px; }
.config-actions .btn.primaire { padding: 12px 20px; font-size: 16px; }

.bandeau-rappels { border-left-color: var(--s-epargne); }
.bandeau-rappels .actions { margin-top: 10px; }
select.lb-semaine { width: auto; padding: 3px 6px; font-size: 13px; margin-left: 6px; }

/* ---------- entrée en scène ---------- */

@keyframes monte { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes remplit { from { transform: scaleX(0); } }

#vue.entree > * { animation: monte .45s cubic-bezier(.2, .7, .2, 1) both; }
#vue.entree > *:nth-child(2) { animation-delay: .06s; }
#vue.entree > *:nth-child(3) { animation-delay: .12s; }
#vue.entree > *:nth-child(4) { animation-delay: .18s; }
#vue.entree > *:nth-child(n+5) { animation-delay: .24s; }
#vue.entree .jauge-val, #vue.entree .rb-val { transform-origin: left; animation: remplit .7s .2s cubic-bezier(.2, .7, .2, 1) both; }

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

/* ---------- écrans étroits ---------- */

@media (max-width: 1000px) {
  .lb { grid-template-columns: minmax(0, 1fr) auto 32px; grid-template-areas: "nom part suppr" "montant montant montant" "type type type"; gap: 6px 12px; padding: 12px 0; }
  .lb-nom { grid-area: nom; } .lb-montant { grid-area: montant; justify-content: flex-start; flex-wrap: wrap; }
  .lb-part { grid-area: part; } .lb select { grid-area: type; } .lb > .icone { grid-area: suppr; }
}

@media (max-width: 860px) {
  .app { display: block; }
  .config-bilan { padding: 14px 16px; }
  .rail {
    position: fixed; inset: auto 0 0 0; z-index: 20;
    height: auto; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    flex-direction: row;
  }
  .marque, .rail-note { display: none; }
  .nav { flex-direction: row; margin: 0; width: 100%; gap: 0; }
  .nav button {
    flex: 1; flex-direction: column; gap: 3px;
    padding: 8px 2px 6px; font-size: 11.5px;
    border-left: 0; border-top: 3px solid transparent; border-radius: 0;
  }
  .nav button[aria-current="page"] { border-top-color: var(--clair); }
  .page { padding: 18px 16px 110px; }
  .entete { margin-bottom: 18px; }
  .grille { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-principal { padding: 22px 20px 22px; }
  .tuiles { border-left: 0; border-top: 1px solid var(--filet); }
  .tuile { padding: 13px 20px; }
  .carte { padding: 18px 16px 20px; }
  .hero.carte { padding: 0; }
  .diag { grid-template-columns: minmax(0, 1fr); }
  .dep { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "cat montant actions" "note montant actions"; gap: 0 10px; }
  .deps.sans-actions .dep { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cat montant" "note montant"; }
  .dep-cat { grid-area: cat; } .dep-note { grid-area: note; } .dep-montant { grid-area: montant; } .dep-actions { grid-area: actions; }
  .reglages, .deux { grid-template-columns: minmax(0, 1fr); }
  .reglages-heures { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 12px; }
  .apercus li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .apercu-heure { padding-top: 0; font-size: 18px; }
  .nav button { font-size: 10.5px; }
  .bilan .deps .dep { grid-template-columns: minmax(0, 1fr) auto auto; }
  #toast { bottom: 84px; }
  .entete .btn.primaire span { display: none; }
  .entete .btn.primaire { padding: 9px 11px; }
  .retour-auj { display: none; }
}
