/* ==========================================================================
   Mes Comptes Faciles — page d'accueil
   Mise en page inspirée de tasteskill.dev : épurée, beaucoup d'air, une barre de
   navigation légère, des titres en deux tons (encre puis gris), des boutons en pilule,
   des cartes blanches aux coins arrondis et de grands panneaux arrondis posés dans les
   marges. Couleurs de Mes Comptes Faciles : papier, encre, or et nuit.
   Chargée uniquement sur l'accueil ; l'application garde grandlivre.css.
   ========================================================================== */

body.accueil {
  --papier: #f3f1ec;
  --blanc: #ffffff;
  --pas: #e9e5dc;          /* un ton sous le papier */
  --encre: #17140e;
  --doux: #8b857b;         /* la deuxième ligne des titres */
  --texte-doux: #57514a;   /* paragraphes secondaires */
  --filet: #e6e2d9;
  --or: #dfa43a;
  --sur-or: #17140e;
  --nuit: #121316;
  --sur-nuit: #f3eee3;
  --nuit-doux: #8f8b84;
  --nuit-pas: #1d1e22;
  --ombre: 0 1px 2px rgba(23, 20, 14, .04), 0 12px 32px -18px rgba(23, 20, 14, .18);
  --ombre-flottante: 0 2px 6px rgba(23, 20, 14, .05), 0 30px 60px -28px rgba(23, 20, 14, .32);

  --m: clamp(20px, 3.4vw, 56px);
  --g: clamp(14px, 1.6vw, 24px);
  --r-carte: 20px;
  --r-panneau: 28px;
  --texte: 'Archivo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.55;
}
:root[data-theme="sombre"] body.accueil {
  --papier: #111113;
  --blanc: #1a1a1d;
  --pas: #202024;
  --encre: #f3eee3;
  --doux: #8a867e;
  --texte-doux: #b4b0a8;
  --filet: #2a2a2e;
  --or: #e6b04a;
  --sur-or: #14110a;
  --nuit: #1a1a1d;
  --nuit-pas: #242428;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -18px rgba(0, 0, 0, .6);
  --ombre-flottante: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 60px -28px rgba(0, 0, 0, .8);
}

.accueil .feuille { max-width: none; margin: 0; padding: 0; }
.accueil main { display: block; }
.accueil .depeches-flash { max-width: 1240px; margin: 16px auto; padding: 0 var(--m); }
.accueil a { text-decoration-color: currentColor; }
.cadre { max-width: calc(1240px + 2 * var(--m)); margin-left: auto; margin-right: auto; padding-left: var(--m); padding-right: var(--m); }

/* --- Titres en deux tons ----------------------------------------------------------- */
.titre-deux-tons { margin: 0; font-family: var(--texte); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; color: var(--encre); }
.titre-deux-tons > span { display: block; }
.ton-doux { color: var(--doux); }

/* --- Pilules ----------------------------------------------------------------------- */
.pilule {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 600 1rem/1 var(--texte); transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.pilule:hover { transform: translateY(-1px); }
.pilule:active { transform: translateY(0) scale(.98); }
.pilule-noire { background: var(--encre); color: var(--papier); }
.pilule-blanche { background: var(--blanc); color: var(--encre); border-color: var(--filet); box-shadow: var(--ombre); }
.pilule-or { background: var(--or); color: var(--sur-or); }
.pilule-petite { min-height: 38px; padding: 0 16px; font-size: .92rem; }
.pilule span[aria-hidden] { transition: transform .18s ease; }
.pilule:hover span[aria-hidden] { transform: translateX(3px); }
.pilule:focus-visible, .accueil a:focus-visible, .classement-saisie:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }

/* --- Barre de navigation ------------------------------------------------------------ */
.barre { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--papier) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.barre-contenu { display: flex; align-items: center; gap: 12px 32px; min-height: 68px; }
.marque { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; letter-spacing: -0.02em; text-decoration: none; color: var(--encre); white-space: nowrap; }
.marque .logo-marque { height: 36px; }
.liens { display: flex; gap: 4px clamp(16px, 1.8vw, 26px); margin-left: auto; font-size: .95rem; }
.liens a { text-decoration: none; color: var(--texte-doux); white-space: nowrap; }
.liens a:hover { color: var(--encre); }
.barre-droite { display: flex; align-items: center; gap: 10px; }
.barre .texte-court { display: none; }
.barre .bascule-theme { border: 0; background: transparent; color: var(--texte-doux); border-radius: 999px; }
.barre .bascule-theme:hover { background: var(--pas); color: var(--encre); }
.barre .bascule-langue button { border: 0; background: transparent; color: var(--texte-doux); border-radius: 999px; }
.barre .bascule-langue button:hover { background: var(--pas); color: var(--encre); }

/* --- Objectifs : un exemple de poches d'épargne ----------------------------------- */
.objectifs-livre { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px clamp(28px, 4vw, 64px); align-items: center; padding-top: clamp(64px, 8vw, 112px); }
.objectifs-exemple { padding: clamp(20px, 2.4vw, 32px); }
.objectifs-exemple ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.objectif-ex-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; }
.objectif-ex-tete b { font-size: 1.05rem; }
.objectif-ex-tete span { font-weight: 700; font-variant-numeric: tabular-nums; }
.objectif-ex-tete small { font-weight: 500; color: var(--texte-doux); }
.objectif-ex-jauge { display: block; height: 10px; margin: 10px 0 8px; border-radius: 5px; background: var(--pas); position: relative; overflow: hidden; }
.objectif-ex-jauge::after { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--part) * 100%); background: var(--encre); border-radius: 5px; }
.objectif-ex-note { margin: 0; font-size: .9rem; color: var(--texte-doux); }
.objectif-ex-libre { display: flex; justify-content: space-between; gap: 12px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--filet); }
.objectif-ex-libre b { font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .objectifs-livre { grid-template-columns: 1fr; } }

/* --- Héros : texte à gauche, l'application à droite -------------------------------- */
.heros-livre { display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(32px, 5vw, 80px); align-items: center; min-height: calc(100svh - 68px); padding-top: 40px; padding-bottom: 72px; }
.heros-titre-livre { font-size: clamp(48px, 5.4vw, 84px); }
.heros-titre-livre .ligne > span { white-space: nowrap; }
.heros-titre-livre .ligne { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.heros-titre-livre .ligne > span { display: block; }
.heros-phrase { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--texte-doux); max-width: 34ch; margin: 26px 0 32px; }
.heros-phrase:has(+ .heros-accroche) { margin-bottom: 20px; }
.heros-accroche { font-size: clamp(17px, 1.35vw, 19px); line-height: 1.45; color: var(--encre); max-width: 36ch; margin: 0 0 22px; padding-left: 14px; border-left: 3px solid var(--or); }
.heros-accroche strong { font-weight: 700; }
.heros-garanties { margin: 18px 0 0; font-size: 14px; color: var(--texte-doux); letter-spacing: .01em; }
.heros-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.heros-actions form { margin: 0; }
.heros-visuel { position: relative; }
.heros-fragment { margin: 0; border-radius: var(--r-carte); box-shadow: var(--ombre-flottante); overflow: hidden; }
.heros-bloc {
  position: absolute; left: -28px; bottom: 0; z-index: 2; width: 280px; padding: 18px 20px 20px;
  background: var(--or); color: var(--sur-or); border-radius: 18px; box-shadow: var(--ombre);
}
.heros-bloc p { margin: 0; font-size: 15px; line-height: 1.4; }
.heros-bloc .heros-chiffre { font-weight: 800; font-size: 34px; line-height: 1; margin-bottom: 8px; letter-spacing: -0.03em; }

/* --- Fragments d'interface : de vrais morceaux de l'application (data-ui) ------------- */
.ui {
  --ui-fond: #ffffff; --ui-pas: #f4f1ea; --ui-encre: #17140e; --ui-doux: #6c665c; --ui-bord: rgba(23, 20, 14, .08);
  background: var(--ui-fond); color: var(--ui-encre); font-family: var(--texte); font-size: 14px; line-height: 1.4;
  font-variant-numeric: tabular-nums; padding: 22px 24px;
}
:root[data-theme="sombre"] .accueil .ui { --ui-fond: #1f1f23; --ui-pas: #29292e; --ui-encre: #f3eee3; --ui-doux: #a6a397; --ui-bord: rgba(255, 255, 255, .08); }
.ui-petit { display: block; font-size: 12px; font-weight: 600; color: var(--ui-doux); }
.ui-tete { display: flex; align-items: center; gap: 28px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--ui-bord); }
.ui-marque { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.ui-marque .logo-marque { height: 18px; }
.ui-onglets { display: flex; gap: 20px; color: var(--ui-doux); font-size: 13px; }
.ui-onglets b { color: var(--ui-encre); }
.ui-argent { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ui-total { display: block; font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; }
.ui-familles { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--ui-doux); }
.ui-familles b { color: var(--ui-encre); margin-left: 4px; }
.ui-familles i, .ui-repartition span { display: inline-block; }
.ui-familles i { width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.f-courant { background: #3f6fb0; } .f-epargne { background: #1d8a5a; } .f-invest { background: #c48a1f; }
.ui-repartition { display: flex; gap: 3px; height: 8px; margin: 14px 0 18px; }
.ui-repartition span { height: 100%; border-radius: 4px; }
.ui-bilan { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr auto 1fr auto 1.25fr auto 1fr auto 1fr; gap: 6px; align-items: stretch; }
.ui-bilan li { background: var(--ui-pas); border-radius: 10px; padding: 10px 12px; }
.ui-bilan li b { display: block; margin-top: 4px; font-size: 17px; }
.ui-bilan .op { background: none; padding: 0; align-self: center; color: var(--ui-doux); font-weight: 700; }
.ui-bilan .reste { background: rgba(223, 164, 58, .22); }
.ui-bilan .cote { background: rgba(29, 138, 90, .14); }
.ui-bilan .cote b { color: #127048; }
:root[data-theme="sombre"] .accueil .ui-bilan .cote b { color: #5fd39c; }

/* --- Panneaux arrondis posés dans les marges --------------------------------------- */
.panneau-nuit { background: var(--nuit); color: var(--sur-nuit); border-radius: var(--r-panneau); }
:root[data-theme="sombre"] .accueil .panneau-nuit, :root[data-theme="sombre"] .accueil .tuile-nuit { box-shadow: inset 0 0 0 1px var(--filet); }
.panneau-or { background: var(--or); color: var(--sur-or); border-radius: var(--r-panneau); }
.carte-douce { background: var(--blanc); border: 1px solid var(--filet); border-radius: var(--r-carte); box-shadow: var(--ombre); }

/* Aperçu du héros : le patrimoine réuni, sa courbe, et deux cartes posées dessous */
.ui-patrimoine { padding: 26px 28px 54px; }
.ui-patrimoine .ui-total { font-size: clamp(40px, 3.6vw, 54px); letter-spacing: -0.035em; margin: 6px 0 4px; }
.ui-ecart-ligne { margin: 0; font-size: 14px; color: var(--ui-doux); }
.ui-ecart { font-weight: 750; font-size: 15px; }
.ui .positif { color: #127048; } .ui .negatif { color: #a8412b; }
:root[data-theme="sombre"] .accueil .ui .positif { color: #5fd39c; }
:root[data-theme="sombre"] .accueil .ui .negatif { color: #f08a72; }
.ui-patrimoine-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; }
.ui-courbe-cadre { position: relative; margin: 18px 0 8px; }
.ui-courbe { display: block; width: 100%; height: 112px; overflow: visible; }
.ui-courbe .c-aire { fill: rgba(223, 164, 58, .16); }
.ui-courbe .c-ligne { fill: none; stroke: #c48a1f; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ui-point { position: absolute; right: -6px; top: calc(11% - 6px); width: 12px; height: 12px; border-radius: 50%; background: #c48a1f; box-shadow: 0 0 0 5px rgba(223, 164, 58, .25); }
.ui-axe { display: flex; justify-content: space-between; font-size: 12px; color: var(--ui-doux); }
.ui-patrimoine .ui-repartition { margin: 20px 0 12px; }
.ui-patrimoine .ui-familles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ui-patrimoine .ui-familles li { display: flex; align-items: center; gap: 4px; }
.ui-patrimoine .ui-familles em { font-style: normal; font-weight: 700; font-size: 12px; }

.heros-pied { position: relative; z-index: 2; display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; margin: -34px 20px 0; }
.heros-carte { margin: 0; border-radius: 18px; box-shadow: var(--ombre); overflow: hidden; }
.ui-comptes { padding: 16px 18px 10px; }
.ui-comptes-tete { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; font-size: 14px; }
.ui-comptes-tete span { font-size: 12px; color: var(--ui-doux); }
.ui-comptes ul { list-style: none; margin: 0; padding: 0; }
.ui-comptes li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13.5px; }
.ui-comptes li + li { border-top: 1px solid var(--ui-bord); }
.ui-comptes small { display: block; font-size: 11.5px; color: var(--ui-doux); }
.ui-comptes li b { font-size: 13.5px; }
.banque { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 800; background: var(--ui-pas); color: var(--ui-doux); }
.b-place { background: rgba(63, 111, 176, .16); color: #2f5d9b; }
.b-quai { background: rgba(196, 138, 31, .2); color: #8f6312; }
.b-port { background: rgba(29, 138, 90, .16); color: #157049; }
:root[data-theme="sombre"] .accueil .b-place { color: #8fb3e6; }
:root[data-theme="sombre"] .accueil .b-quai { color: #e6b04a; }
:root[data-theme="sombre"] .accueil .b-port { color: #5fd39c; }
.ui-comptes .autres { color: var(--ui-doux); }
.heros-pied .heros-bloc { position: static; width: auto; margin-top: 46px; }
.heros-pied .heros-bloc .heros-chiffre { font-size: 44px; }
.heros-bloc .heros-bloc-suite { margin-top: 10px; font-weight: 700; }
@media (max-width: 620px) {
  .ui-patrimoine { padding: 20px 18px 48px; }
  .heros-pied { grid-template-columns: 1fr; margin: -30px 10px 0; }
  .heros-pied .heros-bloc { margin-top: 0; }
}

/* --- Le classement : relevé brut à gauche, registre rangé à droite ---------------------- */
#classement { margin-top: 40px; }
.classement { padding: clamp(32px, 4.4vw, 64px); }
.classement .titre-deux-tons { color: var(--sur-nuit); font-size: clamp(38px, 4.4vw, 64px); }
.classement .ton-doux { color: var(--nuit-doux); }
.classement-chapo { margin: 16px 0 0; font-size: 17px; line-height: 1.55; color: var(--nuit-doux); max-width: 56ch; }
.classement-grille { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 48px); margin-top: 40px; align-items: start; }
.classement-etiquette { display: block; font-size: 15px; font-weight: 600; color: var(--nuit-doux); margin-bottom: 12px; }
.classement-saisie {
  display: block; width: 100%; min-height: 12.5em; resize: vertical; border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px;
  white-space: pre; overflow-x: auto; background: var(--nuit-pas); color: var(--sur-nuit); padding: 16px 18px;
  font: 400 16px/1.75 var(--texte); letter-spacing: -0.005em;
}
.classement-format { margin: 12px 0 0; font-size: 15px; color: var(--nuit-doux); }
.ui-registre { border-radius: 16px; padding: 18px 20px; }
.ui-registre-tete { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--ui-doux); }
.ui-registre ul { list-style: none; margin: 0; padding: 0; }
.ui-registre li { display: grid; grid-template-columns: 1.1fr 1.2fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--ui-bord); transition: background-color .2s ease; }
.ui-registre small { display: block; font-size: 11.5px; color: var(--ui-doux); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-marchand { font-weight: 700; min-width: 0; }
.r-rubrique { font-weight: 600; min-width: 0; }
.r-rubrique::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #c48a1f; vertical-align: 1px; }
.a-classer .r-rubrique { color: #b3271b; }
.a-classer .r-rubrique::before { background: #b3271b; }
.r-montant { font-weight: 700; white-space: nowrap; }
.r-montant.positif { color: #127048; }
:root[data-theme="sombre"] .accueil .r-montant.positif { color: #5fd39c; }
.ui-registre li.nouvelle { animation: arrivee .35s ease both; }
@keyframes arrivee { from { opacity: 0; transform: translateY(6px); } }

/* --- Comment ça marche : quatre cartes ------------------------------------------------ */
.marches { padding-top: clamp(96px, 12vw, 160px); }
.etapes-cartes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--g); }
.etapes-cartes li { padding: 28px 26px 30px; }
.etapes-cartes h2, .etapes-cartes h3 { margin: 0 0 12px; font-size: clamp(21px, 1.7vw, 25px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.etapes-cartes .accent { color: #a8700f; }
:root[data-theme="sombre"] .accueil .etapes-cartes .accent { color: var(--or); }
.etapes-cartes p { margin: 0; font-size: 16px; color: var(--texte-doux); }

/* --- Le tableau de bord : panneau or ------------------------------------------------- */
#lecture { margin-top: clamp(96px, 12vw, 160px); }
.lecture { padding: clamp(32px, 4.4vw, 64px); }
.lecture-tete { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px 48px; align-items: end; }
.lecture .titre-deux-tons { color: var(--sur-or); font-size: clamp(38px, 4.4vw, 64px); }
.lecture .ton-doux { color: rgba(23, 20, 14, .55); }
.lecture-note { margin: 0; font-size: 17px; max-width: 34ch; }
.lecture-colonnes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--g); margin: 40px 0 28px; }
.lecture-colonnes p { margin: 0; font-size: 16px; line-height: 1.5; background: rgba(255, 255, 255, .28); border-radius: 16px; padding: 18px 20px; }
.mosaique { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g); }
.tuile { margin: 0; border-radius: 18px; overflow: hidden; }
.tuile-tableur { grid-column: 1 / -1; }
.tuile-tableur .ui { height: 100%; padding: 22px clamp(16px, 2.4vw, 32px); }
.tuile-nuit { background: var(--nuit); color: var(--sur-nuit); padding: 26px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; }
.tuile-nuit p { margin: 0; max-width: 26ch; font-size: 16px; }
.tuile-nuit .tuile-chiffre { font-weight: 800; font-size: clamp(40px, 3.6vw, 56px); line-height: 1; margin-bottom: 12px !important; color: var(--or); letter-spacing: -0.03em; }
.tuile-calendrier { grid-column: auto; }
.tuile-calendrier .ui { height: 100%; }
.tuile-pas { background: rgba(255, 255, 255, .28); padding: 24px; display: flex; align-items: flex-end; }
.tuile-pas p { margin: 0; font-size: 16px; }
.ui-tableur { width: 100%; border-collapse: collapse; font-size: 15px; }
.ui-tableur th, .ui-tableur td { padding: 9px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--ui-bord); }
.ui-tableur thead th { font-size: 12px; color: var(--ui-doux); font-weight: 600; }
.ui-tableur tbody th { text-align: left; font-weight: 600; }
.ui-tableur .fixe td { background: rgba(63, 111, 176, .16); }
.ui-tableur .rentree td { background: rgba(29, 138, 90, .18); }
.ui-tableur .variable td { background: rgba(196, 138, 31, calc(var(--i, 0) * .34)); }
.ui-tableur td:last-child { color: var(--ui-doux); border-left: 1px solid var(--ui-bord); }
.ui-tableur .sous-total > *, .ui-tableur .solde > * { font-weight: 750; background: var(--ui-pas); }
.ui-tableur .solde > * { background: rgba(29, 138, 90, .14); }
.ui-echeances { list-style: none; margin: 10px 0 0; padding: 0; }
.ui-echeances li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--ui-bord); font-size: 13px; }
.ui-echeances b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ui-pas); font-size: 12px; }
.ui-echeances small { display: block; color: var(--ui-doux); font-size: 11.5px; }
.ui-echeances em { font-style: normal; font-weight: 700; }
.ui-echeances .a-venir b { background: rgba(223, 164, 58, .3); }

/* --- Tarifs : un tableau dans une carte, la formule disponible sur l'or ----------------- */
.tarifs-livre { padding-top: clamp(96px, 12vw, 160px); }
.tableau-tarifs { display: grid; overflow: hidden; padding: 12px; }
.tt-ligne { display: grid; grid-template-columns: 4fr 4fr 4fr; }
.tt-ligne > div { padding: 16px 22px; font-size: 17px; }
.tt-ligne:not(.tt-tete):not(.tt-pied) > div { border-top: 1px solid var(--filet); }
.tt-ligne > .tt-mise { background: color-mix(in srgb, var(--or) 22%, var(--blanc)); }
.tt-tete > .tt-mise { border-radius: 16px 16px 0 0; }
.tt-pied > .tt-mise { border-radius: 0 0 16px 16px; }
.tt-sujet { color: var(--texte-doux); }
.tt-tete > div { padding-top: 26px; padding-bottom: 24px; }
.tt-tete h2 { margin: 0; font-weight: 800; font-size: clamp(30px, 2.8vw, 42px); line-height: 1.05; letter-spacing: -0.035em; color: var(--encre); }
.tt-nom { display: block; font-weight: 800; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.05; letter-spacing: -0.025em; }
.tt-prix { display: block; margin-top: 6px; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.05; color: var(--texte-doux); }
.tt-prix small { display: block; font-size: 15px; margin-top: 8px; }
.tt-pied > div { padding-top: 22px; padding-bottom: 26px; }
.tt-pied form { margin: 0; }

/* --- Questions : une carte, une ligne par question --------------------------------------- */
.questions { padding-top: clamp(96px, 12vw, 160px); }
.questions-titre { font-size: clamp(38px, 4.4vw, 64px); margin-bottom: 32px; }
.questions-liste { padding: 8px clamp(20px, 3vw, 40px); }
.question-ligne { display: grid; grid-template-columns: 5fr 7fr; gap: 12px 48px; padding: 26px 0; }
.question-ligne + .question-ligne { border-top: 1px solid var(--filet); }
.question-ligne h3 { margin: 0; font-size: clamp(19px, 1.5vw, 22px); line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; }
.question-ligne p { margin: 0; font-size: 16.5px; color: var(--texte-doux); }

/* --- Fin : l'appel dans un panneau, puis le pied ----------------------------------------- */
.appel { padding-top: clamp(96px, 12vw, 160px); }
.appel-panneau { text-align: center; padding: clamp(56px, 8vw, 112px) clamp(24px, 4vw, 64px); display: flex; flex-direction: column; align-items: center; }
.appel-panneau .titre-deux-tons { color: var(--sur-nuit); font-size: clamp(44px, 6vw, 88px); }
.appel-panneau .ton-doux { color: var(--nuit-doux); }
.appel-phrase { margin: 24px 0 34px; font-size: 19px; color: var(--nuit-doux); max-width: 40ch; }
.pied-livre { padding-top: 72px; padding-bottom: 28px; }
.pied-colonnes { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px var(--g); }
.pied-colonnes ul { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.8; color: var(--texte-doux); }
.pied-colonnes li:first-child { color: var(--encre); font-weight: 700; }
.pied-colonnes .pied-devise { font-weight: 400; color: var(--texte-doux); margin-top: 8px; max-width: 24ch; line-height: 1.5; }
.pied-colonnes a { color: inherit; text-decoration: none; }
.pied-colonnes a:hover { color: var(--encre); text-decoration: underline; }
.pied-legal { margin: 48px 0 0; padding-top: 20px; border-top: 1px solid var(--filet); font-size: 13px; color: var(--doux); }

/* --- Le problème : des comptes éparpillés, puis un seul total ---------------------------- */
.reunis { padding-top: clamp(72px, 9vw, 128px); padding-bottom: clamp(56px, 7vw, 96px); }
.reunis-tete { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px 56px; align-items: end; margin-bottom: clamp(28px, 3.4vw, 48px); }
.reunis-tete .titre-deux-tons { margin: 0; font-size: clamp(40px, 4.8vw, 72px); }
.reunis-phrase { margin: 0; font-size: 18px; line-height: 1.55; color: var(--texte-doux); max-width: 46ch; }
.reunis-grille { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g); align-items: stretch; }
.reunis-etiquette { margin: 0 0 14px; font-size: 14px; font-weight: 700; letter-spacing: .01em; color: var(--doux); }
.reunis-avant { margin: 0; padding: clamp(22px, 2.6vw, 34px); display: flex; flex-direction: column; }
.reunis-epars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.reunis-epars li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px dashed var(--filet); border-radius: 14px; background: var(--papier); font-size: 15px; }
.reunis-epars li:nth-child(2) { transform: translateX(14px); }
.reunis-epars li:nth-child(3) { transform: translateX(-8px); }
.reunis-epars li:nth-child(4) { transform: translateX(20px); }
.reunis-epars small { display: block; color: var(--texte-doux); font-size: 13px; }
.reunis-epars b { font-variant-numeric: tabular-nums; }
.reunis-somme { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--filet); font-weight: 700; }
.reunis-somme b { font-size: 34px; line-height: 1; color: var(--doux); }
.reunis-note { margin: 12px 0 0; font-size: 15px; color: var(--texte-doux); }
.reunis-apres { padding: clamp(26px, 3vw, 40px); display: flex; flex-direction: column; }
.reunis-apres .reunis-etiquette { color: var(--nuit-doux); }
.reunis-total { margin: 0; font-weight: 800; font-size: clamp(52px, 6vw, 88px); line-height: 1; letter-spacing: -0.035em; color: var(--or); font-variant-numeric: tabular-nums; }
.reunis-sous-total { margin: 10px 0 0; color: var(--nuit-doux); }
.reunis-lectures { list-style: none; margin: auto 0 0; padding: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reunis-lectures li { background: var(--nuit-pas); border-radius: 14px; padding: 14px 16px; }
.reunis-lectures b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.reunis-lectures .positif { color: #5fd39c; }
.reunis-lectures span { font-size: 14px; color: var(--nuit-doux); }
.reunis-apres .reunis-note { color: var(--nuit-doux); }

/* --- Optimiser : ce que coûtent les dépenses qui reviennent ------------------------------- */
.optimiser-livre { padding-top: clamp(72px, 9vw, 128px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px clamp(28px, 4vw, 64px); align-items: center; }
.optimiser-tete .titre-deux-tons { margin: 0; font-size: clamp(38px, 4.4vw, 64px); }
.optimiser-phrase { margin: 20px 0 0; font-size: 18px; line-height: 1.55; color: var(--texte-doux); max-width: 40ch; }
.optimiser-releve { margin: 0; padding: clamp(22px, 2.6vw, 34px); }
.optimiser-total-ligne { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--filet); }
.optimiser-total { margin: 0; font-weight: 800; font-size: clamp(40px, 4vw, 56px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.optimiser-total small { font-size: 16px; font-weight: 600; color: var(--texte-doux); letter-spacing: 0; }
.optimiser-an { margin: 0; color: var(--texte-doux); font-size: 15px; }
.optimiser-postes { list-style: none; margin: 0; padding: 0; }
.optimiser-postes li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 7.5em; grid-template-areas: "nom barre montant" "piste piste piste"; gap: 6px 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--filet); }
.optimiser-postes li:last-child { border-bottom: 0; padding-bottom: 0; }
.optimiser-nom { grid-area: nom; font-weight: 700; }
.optimiser-nom small { display: block; font-weight: 400; font-size: 13px; color: var(--texte-doux); }
.optimiser-barre { grid-area: barre; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--or) calc(var(--part) * 100%), var(--pas) 0); }
.optimiser-postes b { grid-area: montant; font-variant-numeric: tabular-nums; font-size: 18px; text-align: right; white-space: nowrap; }
.optimiser-postes b small { font-size: 13px; font-weight: 500; color: var(--texte-doux); }
.optimiser-postes em { grid-area: piste; font-style: normal; font-size: 14px; color: var(--texte-doux); }
.optimiser-postes em::before { content: '→ '; color: var(--or); font-weight: 700; }
.tarifs-code { margin: 18px 0 0; text-align: center; font-size: 15px; color: var(--texte-doux); }

/* --- Mouvement : titre qui monte, entrées échelonnées, fragment qui dérive ------------------ */
@media (prefers-reduced-motion: no-preference) {
  .js-anime .heros-titre-livre .ligne > span { transform: translateY(105%); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
  .js-anime .heros-titre-livre .ligne:nth-child(2) > span { transition-delay: .11s; }
  .js-anime.pret .heros-titre-livre .ligne > span { transform: none; }
  .js-anime .anime { opacity: 0; transform: translateY(20px); transition: opacity .7s ease .45s, transform .7s ease .45s; }
  .js-anime.pret .anime { opacity: 1; transform: none; }
  .js-anime .heros-fragment { opacity: 0; transition: opacity .9s ease .3s; }
  .js-anime.pret .heros-fragment { opacity: 1; }
  .js-anime .revele { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--retard, 0s); }
  .js-anime .revele.vu { opacity: 1; transform: none; }
  .carte-douce, .tuile { transition: transform .25s ease, box-shadow .25s ease; }
  .etapes-cartes li:hover { transform: translateY(-3px); }
}

/* --- Tablette ------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .heros-livre { grid-template-columns: 1fr; min-height: 0; padding-top: 48px; }
  .heros-visuel { max-width: 760px; }
  .etapes-cartes { grid-template-columns: 1fr 1fr; }
  .lecture-tete { grid-template-columns: 1fr; }
  .reunis-tete { grid-template-columns: 1fr; }
  .optimiser-livre { grid-template-columns: 1fr; }
  .lecture-colonnes { grid-template-columns: 1fr; }
  .mosaique { grid-template-columns: 1fr 1fr; }
  .tuile-pas { grid-column: 1 / -1; }
  .ui-tableur { font-size: 13.5px; }
  .ui-tableur th, .ui-tableur td { padding: 8px 6px; }
  .pied-colonnes { grid-template-columns: repeat(3, 1fr); }
  .pied-colonnes ul:first-child { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .liens { display: none; }
  .barre-droite { margin-left: auto; }
}
@media (max-width: 1000px) {
  .classement-grille { grid-template-columns: 1fr; }
  .ui-bilan { grid-template-columns: 1fr 1fr; }
  .ui-bilan .op { display: none; }
  .ui-bilan .reste { grid-column: 1 / -1; }
  .ui-onglets span { display: none; }
  .liens { display: none; }
  .barre-droite { margin-left: auto; }
}

/* --- Téléphone ----------------------------------------------------------------------- */
@media (max-width: 760px) {
  body.accueil { --m: 18px; }
  .barre-contenu { min-height: 60px; gap: 10px; }
  .barre .pilule-petite { padding: 0 12px; font-size: .85rem; }
  .barre .texte-long { display: none; }
  .barre .texte-court { display: inline; }
  /* Le nom tient sur deux lignes plutôt que de pousser les boutons hors de l'écran */
  .barre .marque { white-space: normal; flex: 0 0 auto; line-height: 1.1; font-size: .98rem; gap: 8px; }
  .barre .logo-nom { display: inline-block; max-width: 7.6em; }
  .barre-droite { gap: 4px; }
  .barre .marque .logo-marque { height: 28px; }
  .heros-livre { padding-top: 32px; padding-bottom: 64px; gap: 40px; }
  .heros-titre-livre { font-size: clamp(42px, 12vw, 56px); }
  .heros-phrase { margin: 20px 0 24px; }
  .heros-actions .pilule, .heros-actions form { width: 100%; }
  .heros-visuel { padding-bottom: 0; }
  .heros-bloc { position: relative; left: auto; bottom: auto; width: auto; margin: -24px 14px 0; }
  .ui-onglets { display: none; }
  .classement, .lecture { padding: 28px 20px; border-radius: 22px; }
  .classement-saisie { font-size: 15px; }
  .ui-registre li { grid-template-columns: 1fr auto; }
  .ui-registre .r-rubrique { grid-column: 1 / -1; grid-row: 2; }
  .etapes-cartes { grid-template-columns: 1fr; }
  .reunis-grille { grid-template-columns: 1fr; }
  .reunis-epars li { transform: none !important; }
  .reunis-lectures { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .reunis-lectures li { padding: 10px; }
  .reunis-lectures b { font-size: 17px; }
  .optimiser-postes li { grid-template-columns: 1fr auto; grid-template-areas: "nom montant" "barre barre" "piste piste"; }
  .mosaique { grid-template-columns: 1fr; }
  .tuile-calendrier, .tuile-pas, .tuile-nuit { grid-column: auto; }
  .tuile-tableur .ui { padding: 16px 12px; }
  .ui-tableur { font-size: 13px; }
  .ui-tableur th:nth-child(n+2):nth-child(-n+4), .ui-tableur td:nth-child(n+2):nth-child(-n+4) { display: none; }
  .ui-tableur tbody th { white-space: normal; }
  .tableau-tarifs { padding: 8px; }
  .tt-ligne { grid-template-columns: 1fr 1fr; }
  .tt-ligne > .tt-sujet { grid-column: 1 / -1; padding-bottom: 4px; font-weight: 700; color: var(--encre); }
  .tt-ligne:not(.tt-tete):not(.tt-pied) > .tt-mise, .tt-ligne:not(.tt-tete):not(.tt-pied) > div:last-child { border-top: 0; }
  .tt-ligne > div { font-size: 15px; padding: 10px 12px; }
  .tt-tete > .tt-sujet { padding-bottom: 16px; }
  .tt-pied > .tt-sujet { display: none; }
  .tt-pied .pilule { width: 100%; padding: 0 10px; font-size: 14px; white-space: normal; text-align: center; }
  .question-ligne { grid-template-columns: 1fr; }
  .appel-panneau { border-radius: 22px; }
  .pied-colonnes { grid-template-columns: 1fr 1fr; }
}
