/* Moi aussi président · feuille de style — identité MAP v1.0 « Tableau de marque » (brand/IDENTITE.md, ADR 0018).
   Valeurs = brand/design-tokens.json, telles quelles. Mobile first ; desktop ≥ 1024 px. Thèmes clair et sombre :
   `prefers-color-scheme`, et `data-theme="light|dark"` sur <html> (bouton de l'en-tête) qui l'emporte dans les deux sens.
   Neutralité (CLAUDE.md règle 5) : up / down (bleu-vert / brique) servent seulement aux INDICATEURS ; montants de recettes,
   dépenses et dette, mesures, leviers : encre. Le jaune `brand` n'est jamais du texte sur fond clair. */

/* ---------- Polices auto-hébergées (ui/assets/fonts, SIL OFL 1.1) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-62-wght800-900.woff2") format("woff2");
  font-weight: 800 900; font-stretch: 62%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("assets/fonts/atkinson-hyperlegible-next-wght400-800.woff2") format("woff2");
  font-weight: 400 800; font-style: normal; font-display: swap;
}

/* ---------- Jetons ---------- */
:root {
  color-scheme: light;
  --brand: #FFC629; --on-brand: #121212; --brand-text: #7A5A00;
  --bg: #F4F3EE; --surface: #FFFFFF; --surface-sunken: #ECEBE5;
  --ink: #121212; --ink-2: #47463F; --ink-3: #5F5E57;
  --border: #D9D7CF; --border-strong: #7D7B72; --focus: #121212;
  --up: #0A6B66; --up-fill: #1A9A92; --up-bg: #DCF1EE;
  --down: #A8411A; --down-fill: #D6672A; --down-bg: #FBE5D8;
  --neutral: #5F5E57; --neutral-bg: #ECEBE5;
  --cat-1: #3A6FC4; --cat-2: #C96A12; --cat-3: #1E9E86; --cat-4: #B08400; --cat-5: #D9649A; --cat-6: #6B8E23; --cat-7: #7A5CC2; --cat-8: #A3521F;
  --shadow-card: 0 1px 0 rgba(18,18,18,0.08), 0 4px 12px rgba(18,18,18,0.08);
  --scrim: rgba(18, 18, 18, 0.55);

  --font-display: "Archivo", "Arial Narrow", sans-serif;
  --font-text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;
  --radius-xs: 4px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --duration-instant: 80ms; --duration-fast: 160ms; --duration-base: 240ms; --duration-score: 600ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1); --ease-in-out: cubic-bezier(0.6, 0, 0.3, 1); --ease-flap: steps(6, end);

  /* Échelle (IDENTITE.md §5) — mobile */
  --fs-display: 40px; --lh-display: 40px;
  --fs-h1: 28px; --lh-h1: 32px;
  --fs-h2: 22px; --lh-h2: 28px;
  --fs-h3: 18px; --lh-h3: 24px;
  --fs-body: 17px; --lh-body: 26px;
  --fs-body-sm: 15px; --lh-body-sm: 22px;
  --fs-caption: 13px; --lh-caption: 18px;
  --fs-label: 13px; --lh-label: 16px;
  --fs-amount-lg: 44px; --lh-amount-lg: 44px;
  --fs-amount: 17px; --lh-amount: 22px;
  --fs-compare: 15px; --lh-compare: 22px;

  /* Alias des anciens noms (v0.1–v0.4), conservés pour les composants : mêmes rôles, nouvelles valeurs */
  --card: var(--surface); --card2: var(--surface-sunken); --line: var(--border);
  --txt: var(--ink); --mut: var(--ink-2); --acc: var(--ink);
  --ok: var(--up); --bad: var(--down); --warn: var(--brand-text); --ai: var(--cat-7);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-text: #FFC629;
  --bg: #121210; --surface: #1C1B18; --surface-sunken: #0B0B0A;
  --ink: #F4F3EE; --ink-2: #CBC9C0; --ink-3: #A7A59C;
  --border: #35332E; --border-strong: #83817A; --focus: #FFC629;
  --up: #5ED3C7; --up-fill: #2FB3A7; --up-bg: #123B38;
  --down: #FF9C66; --down-fill: #E07436; --down-bg: #43230F;
  --neutral: #A7A59C; --neutral-bg: #26251F;
  --cat-1: #4F86DA; --cat-2: #C97818; --cat-3: #1F9A83; --cat-4: #B88A10; --cat-5: #D0679A; --cat-6: #73952A; --cat-7: #8D75D8; --cat-8: #B0602F;
  --shadow-card: 0 0 0 1px rgba(244,243,238,0.08);
  --scrim: rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand-text: #FFC629;
    --bg: #121210; --surface: #1C1B18; --surface-sunken: #0B0B0A;
    --ink: #F4F3EE; --ink-2: #CBC9C0; --ink-3: #A7A59C;
    --border: #35332E; --border-strong: #83817A; --focus: #FFC629;
    --up: #5ED3C7; --up-fill: #2FB3A7; --up-bg: #123B38;
    --down: #FF9C66; --down-fill: #E07436; --down-bg: #43230F;
    --neutral: #A7A59C; --neutral-bg: #26251F;
    --cat-1: #4F86DA; --cat-2: #C97818; --cat-3: #1F9A83; --cat-4: #B88A10; --cat-5: #D0679A; --cat-6: #73952A; --cat-7: #8D75D8; --cat-8: #B0602F;
    --shadow-card: 0 0 0 1px rgba(244,243,238,0.08);
    --scrim: rgba(0, 0, 0, 0.7);
  }
}
@media (min-width: 1024px) {
  :root {
    --fs-display: 64px; --lh-display: 60px;
    --fs-h1: 40px; --lh-h1: 44px;
    --fs-h2: 28px; --lh-h2: 34px;
    --fs-h3: 20px; --lh-h3: 26px;
    --fs-body: 18px; --lh-body: 28px;
    --fs-body-sm: 16px; --lh-body-sm: 24px;
    --fs-caption: 14px; --lh-caption: 20px;
    --fs-label: 14px; --lh-label: 18px;
    --fs-amount-lg: 72px; --lh-amount-lg: 72px;
    --fs-amount: 20px; --lh-amount: 26px;
    --fs-compare: 18px; --lh-compare: 26px;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--border-strong) var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 400;
  -webkit-font-smoothing: antialiased; caret-color: var(--ink);
}
::selection { background: var(--brand); color: var(--on-brand); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: var(--space-2) 0; }
.display, h1, .plate-v, .crisis-title, .primary { font-family: var(--font-display); font-stretch: 62%; font-variation-settings: "wdth" 62; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase; margin: var(--space-3) 0 var(--space-2); text-wrap: balance; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 700; margin: 0 0 var(--space-3); text-wrap: balance; }
h3 { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin: var(--space-6) 0 var(--space-2); }
p, .hint { text-wrap: pretty; }
main p, .status { max-width: 60ch; }
.mut { color: var(--ink-2); }
small { color: var(--ink-2); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.sm { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.xs { font-size: var(--fs-caption); line-height: var(--lh-caption); }
.hint { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-3); margin: var(--space-1) 0 0; }
/* Sens d'un INDICATEUR (jamais d'un montant ou d'une mesure) */
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--neutral); }
.warn { color: var(--brand-text); }
.num, table { font-variant-numeric: tabular-nums; }
.num { white-space: nowrap; }
.ico { flex: none; display: inline-block; vertical-align: -0.2em; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--space-4); top: -60px; z-index: 30; background: var(--brand); color: var(--on-brand); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); font-weight: 700; }
.skip:focus { top: var(--space-2); }

/* Focus : anneau 2 px `focus` + décalage 2 px, partout */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- En-tête ---------- */
header.top {
  position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border);
  padding: var(--space-2) var(--space-4); display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
}
.brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.brand img { display: block; width: 132px; height: auto; }
@media (min-width: 420px) { .brand img { width: 152px; } }
@media (min-width: 1024px) { .brand img { width: 200px; } }
.topnav { display: flex; align-items: center; gap: var(--space-2); }
.toplink, .theme-toggle {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-3);
  font-size: var(--fs-caption); font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill); background: transparent;
}
.theme-toggle { font-family: inherit; cursor: pointer; position: relative; }
.toplink { position: relative; }
.toplink::after, .theme-toggle::after { content: ""; position: absolute; inset: -2px; }
@media (max-width: 420px) { .topnav { gap: 6px; } .toplink, .theme-toggle { padding: 0 10px; } }
header.top .badge { overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
@media (max-width: 420px) { header.top .badge { display: none; } }

/* ---------- Mise en page ---------- */
main { max-width: 760px; margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-6); }
@media (min-width: 1024px) { main { max-width: 880px; padding-top: var(--space-6); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); margin-bottom: var(--space-3); }
@media (min-width: 1024px) { .card { padding: var(--space-6); } }
.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.two { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 720px) { .two { grid-template-columns: 1fr 1fr; align-items: start; } }
footer.site { max-width: 760px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); color: var(--ink-3); font-size: var(--fs-caption); line-height: var(--lh-caption); text-align: center; }
body:has(#bottom:not([hidden])) footer.site { padding-bottom: 140px; }

/* Fil d'étapes : texte, étape courante soulignée, aucune pastille de couleur */
.steps { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); list-style: none; padding: 0; margin: 0 0 var(--space-2); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-3); }
.steps li { white-space: nowrap; }
.steps li.done { color: var(--ink-2); }
.steps li[aria-current="step"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Boutons ---------- */
button {
  font-family: var(--font-text); font-size: var(--fs-body-sm); line-height: 1.2; font-weight: 700; color: var(--ink);
  background: transparent; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 10px var(--space-4); min-height: 44px; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), transform var(--duration-instant) var(--ease-out);
}
button:hover:not([disabled]) { background: var(--surface-sunken); }
button:active:not([disabled]) { transform: translateY(1px); }
button[disabled] { opacity: .5; cursor: not-allowed; }
/* Primaire : un seul par écran (CTA de la barre basse ou fin d'écran) */
button.primary {
  background: var(--brand); color: var(--on-brand); border: 0; min-height: 52px; padding: 0 var(--space-5);
  font-size: 20px; line-height: 1; font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em;
}
button.primary:hover:not([disabled]) { background: var(--brand); box-shadow: inset 0 -3px 0 rgba(18,18,18,0.25); }
/* Vote à risque : même gabarit, aplat brique (« censure probable » est un état du jeu, pas une mesure) */
button.primary.danger, button.primary.danger:hover:not([disabled]) { background: var(--down-fill); color: var(--on-brand); }
button.sec { background: transparent; }
button.ghost { border: 0; color: var(--ink-2); font-weight: 700; padding: var(--space-1) var(--space-2); min-height: 44px; min-width: 44px; font-size: var(--fs-caption); }
button.ghost.close { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }

/* ---------- Badges, pilules, ⓘ ---------- */
.badge { display: inline-block; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; color: var(--ink-2); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: 1px var(--space-2); white-space: nowrap; }
.badge.ok { color: var(--ink); border-color: var(--ink); }
.badge.warn { color: var(--ink-2); border-style: dashed; }
.badge.mut { color: var(--ink-3); border-color: var(--border); }
.badge.ai { color: var(--ai); border-color: var(--ai); }
.pill { display: inline-block; font-size: var(--fs-caption); line-height: var(--lh-caption); padding: 2px var(--space-2); border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink-2); margin: 2px 4px 0 0; }
.pill.warn { color: var(--ink); border: 1px dashed var(--border-strong); background: transparent; }
.pill.ok { color: var(--up); } .pill.bad { color: var(--down); } .pill.ai { color: var(--ai); }
.pol { display: inline-block; font-size: var(--fs-caption); line-height: var(--lh-caption); padding: 2px var(--space-2); border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink); margin: 2px 4px 0 0; }
.stat { display: inline-block; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-pill); padding: 0 var(--space-2); margin-top: var(--space-1); }
.stat.none { border-style: dotted; }

/* Bouton ⓘ : la source à un geste. Dessin 22 px, cible 44 px par pseudo-élément. */
.src {
  position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 22px; height: 22px; min-height: 0; padding: 0; margin-left: var(--space-1); border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: transparent; color: var(--ink-2);
  font-family: var(--font-text); font-size: var(--fs-caption); font-weight: 700; line-height: 1;
}
.src::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.src.todo { border-style: dashed; color: var(--ink-3); }
.src.ai { color: var(--ai); border-color: var(--ai); }

/* Badge de vérification (IDENTITE.md §7) : jamais en jaune plein ; « vérifié » seulement après le fact-checker */
.fc {
  display: inline-flex; align-items: center; gap: var(--space-1); vertical-align: middle; max-width: 100%;
  font-family: var(--font-text); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700;
  color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: var(--radius-pill);
  padding: 1px var(--space-2) 1px 6px; min-height: 0; margin-left: var(--space-1); white-space: normal; text-align: left;
}
button.fc { min-height: 24px; cursor: pointer; }
button.fc:hover { background: var(--surface-sunken); }
.fc .ico { width: 16px; height: 16px; }
.fc-une_source, .fc-a_verifier { color: var(--ink-3); border-style: dashed; border-color: var(--ink-3); padding-left: var(--space-2); }
.fc-ecart { color: var(--down); border-color: var(--down); }
.fcline .fc { margin-left: 0; }

/* Pastille d'indicateur : flèche + valeur signée + mot masqué ; couleur = effet sur le pays */
.pastille {
  display: inline-flex; align-items: center; gap: 2px; border-radius: var(--radius-xs); padding: 2px 6px;
  font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pastille .ico { width: 14px; height: 14px; }
.pastille.fx-better { color: var(--up); background: var(--up-bg); }
.pastille.fx-worse { color: var(--down); background: var(--down-bg); }
.pastille.fx-equal { color: var(--neutral); background: var(--neutral-bg); }

/* Plaque-chiffre (héros) : une par écran au plus */
.plate { background: var(--brand); color: var(--on-brand); border-radius: var(--radius-md); padding: 10px 14px 12px; margin: var(--space-3) 0; }
.plate p { margin: 0; }
.plate-l { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; }
.plate-v { font-size: var(--fs-amount-lg); line-height: var(--lh-amount-lg); font-weight: 900; font-variant-numeric: tabular-nums; margin-top: var(--space-1) !important; }
.plate-v small { color: var(--on-brand); font-family: var(--font-text); font-stretch: normal; font-variation-settings: normal; font-size: var(--fs-body-sm); font-weight: 700; }
.plate-n { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); margin-top: var(--space-1) !important; }
.plate .src { color: var(--on-brand); border-color: var(--on-brand); }
.plate .fc { color: var(--on-brand); border-color: var(--on-brand); }
.plate a { color: var(--on-brand); }
@media (prefers-reduced-motion: no-preference) {
  .plate-v { animation: plate-in var(--duration-score) var(--ease-flap) both; }
}
@keyframes plate-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* Barre de mandat : un segment par année, rempli = encre, vide = contour 1,5 px encre */
.mandate { margin: var(--space-3) 0 var(--space-2); }
.mbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; list-style: none; padding: 0; margin: 0; }
.mbar li { height: 8px; border-radius: 4px; border: 1.5px solid var(--ink); }
.mbar li.on { background: var(--ink); }
.mandate.on-brand .mbar li { border-color: var(--on-brand); }
.mandate.on-brand .mbar li.on { background: var(--on-brand); }
.mlab { margin: var(--space-1) 0 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); }
.mlab b { color: var(--ink); }

/* ---------- Tuiles KPI ---------- */
.toggle { display: inline-flex; border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: var(--space-2); }
.toggle button { border: 0; border-radius: 0; min-height: 44px; padding: 0 var(--space-4); font-size: var(--fs-caption); color: var(--ink-2); }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.kpis, .pub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3); position: relative; min-width: 0; }
.kpi .l { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); }
.kpi .v { font-size: var(--fs-amount); line-height: var(--lh-amount); font-weight: 800; margin-top: var(--space-1); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .d, .kpi .e { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-3); margin-top: 2px; }
.kpi .d.up { color: var(--up); } .kpi .d.down { color: var(--down); }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.light.ok { background: var(--up-fill); } .light.warn { background: var(--neutral); } .light.bad { background: var(--down-fill); }

/* ---------- Catalogue des mesures ---------- */
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: var(--space-2); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.cat { border-top: 1px solid var(--border); padding: var(--space-1) 0; }
details.cat > summary { justify-content: space-between; font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700; padding: var(--space-2) 0; }
details.cat > summary .cl { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
details.cat > summary .sum { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); font-weight: 400; text-align: right; }
details.cat > summary::after { content: ""; width: 8px; height: 8px; flex: none; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); margin: 0 4px 4px; transition: transform var(--duration-fast) var(--ease-out); }
details.cat[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.m { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-3) 0 var(--space-2); align-items: flex-start; border-top: 1px solid var(--border); }
details.cat > summary + .m { border-top: 0; }
.m > .full { flex-basis: 100%; min-width: 0; }
.m input[type="checkbox"] { margin-top: 2px; accent-color: var(--ink); width: 24px; height: 24px; flex: none; }
.m .body { flex: 1 1 0; min-width: 0; }
.m .t { font-weight: 700; }
.m .d { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--ink-2); margin-top: 2px; }
.m .fx { margin-top: var(--space-1); }
.m .cost { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; font-weight: 800; font-size: var(--fs-amount); line-height: var(--lh-amount); text-align: right; white-space: nowrap; }
.m .mh { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.m .mb { margin-top: var(--space-1); }
.m .mb .src { margin-left: 0; }
.m .cost { max-width: 112px; }
.m .cost small { display: block; font-weight: 400; color: var(--ink-3); white-space: normal; }
@media (min-width: 560px) { .m .cost { max-width: 200px; } }
.hyp { margin: var(--space-2) 0 0; font-size: var(--fs-body-sm); }
.hyp input { width: 100%; accent-color: var(--ink); }
details.more { margin-top: var(--space-1); }
details.more > summary { color: var(--ink-2); font-size: var(--fs-body-sm); font-weight: 700; padding: 0; }
details.more > summary::before { content: ""; width: 6px; height: 6px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-right: 2px; transition: transform var(--duration-fast) var(--ease-out); }
details.more[open] > summary::before { transform: rotate(45deg); }
details.concr > summary { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
details.yd > summary, .prio > summary { font-size: var(--fs-body); color: var(--ink); }
.claims { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); margin-top: var(--space-2); display: grid; gap: var(--space-1); }
.claims b { color: var(--ink-2); font-weight: 700; }
table.traj { width: 100%; border-collapse: collapse; font-size: var(--fs-caption); margin-top: var(--space-2); }
.traj th { color: var(--ink-2); font-weight: 700; text-align: right; padding: 2px 4px; }
.traj td { padding: 4px; border-top: 1px solid var(--border); text-align: right; white-space: nowrap; }
.traj td:first-child, .traj th:first-child { text-align: left; color: var(--ink-2); }
.presets .preset { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.presets .preset:first-of-type { border-top: 0; padding-top: 0; }

/* ---------- Financement ---------- */
.lever { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.lever .n { font-weight: 700; }
.lever .s { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); }
.lever .val { font-variant-numeric: tabular-nums; text-align: right; font-weight: 800; min-width: 84px; white-space: nowrap; }
.lever input[type="range"] { grid-column: 1 / 3; width: 100%; accent-color: var(--ink); margin: 0; height: 44px; }
.lever.wgt .val { min-width: 96px; font-weight: 700; font-size: var(--fs-body-sm); }
input[type="range"] { min-height: 44px; accent-color: var(--ink); }
/* Répartition recettes / dette : neutre (aplat encre / hachures), jamais vert / rouge */
.bar { height: 10px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; display: flex; margin-top: var(--space-2); }
.bar i { display: block; height: 100%; }
.bar i.rev { background: var(--ink); }
.bar i.debt { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 5px); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: var(--radius-xs); vertical-align: -1px; margin-right: 4px; }
.sw.rev { background: var(--ink); }
.sw.debt { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 5px); border: 1px solid var(--border-strong); }
.lgd > span { white-space: nowrap; margin-right: var(--space-3); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-2); }
.cmp > div { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3); }
.cmp .l { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); }
.cmp .v { font-size: var(--fs-amount); line-height: var(--lh-amount); font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0; }

/* Le compte */
.ledger { display: grid; grid-template-columns: 1fr; gap: var(--space-3); font-size: var(--fs-body-sm); }
@media (min-width: 560px) { .ledger { grid-template-columns: 1fr 1fr; } }
.ledger .lh { font-size: var(--fs-label); line-height: var(--lh-label); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-2); margin-bottom: var(--space-2); }
.ledger .lr { display: flex; justify-content: space-between; gap: var(--space-2); padding: var(--space-1) 0; border-top: 1px solid var(--border); }
.ledger .lr span { color: var(--ink-2); } .ledger .lr b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger .lt { border-top: 2px solid var(--ink); margin-top: var(--space-1); } .ledger .lt span { color: var(--ink); font-weight: 700; }
.bal { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-3); }
.bal > div { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3); }
.bal .l { font-size: var(--fs-caption); color: var(--ink-2); } .bal .v { font-size: var(--fs-amount); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- « Ce qui existe » : barres horizontales (montants : encre, neutres) ---------- */
.hb { margin: var(--space-3) 0; }
.hb .hl { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.hb .hl span { color: var(--ink); }
.hb .hl b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 800; }
.hbar { display: block; height: 8px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; margin-top: var(--space-1); }
.hbar i { display: block; height: 100%; background: var(--ink-2); border-radius: var(--radius-pill); }

/* Services publics : moyens / besoins (indice = indicateur : bleu-vert / brique) */
.svcs { font-size: var(--fs-caption) !important; font-weight: 400 !important; display: grid; gap: var(--space-1); margin-top: var(--space-1); }
.svc { display: grid; grid-template-columns: minmax(62px, 30%) 1fr 44px; gap: 6px; align-items: center; }
.svc span:first-child { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.svcbar { display: block; height: 6px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.svcbar i { display: block; height: 100%; background: var(--neutral); }
.svcbar i.ok { background: var(--up-fill); } .svcbar i.bad { background: var(--down-fill); }
svg.hemi { display: block; width: 100%; max-width: 220px; margin: 2px auto 0; }
svg.hemi.s { max-width: 150px; }
.gaugebox { text-align: center; margin: var(--space-2) 0; }

/* Contrôle segmenté */
.seg { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 var(--space-1); }
.segb { font-size: var(--fs-body-sm); font-weight: 700; text-align: left; min-height: 44px; padding: var(--space-2) var(--space-3); }
.segb small { display: block; }
.segb[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.segb[aria-pressed="true"] small { color: var(--bg); }

/* « Concrètement » : décomposition */
.tblwrap { overflow-x: auto; }
table.bd { width: 100%; border-collapse: collapse; font-size: var(--fs-caption); margin-top: var(--space-1); }
.bd th { color: var(--ink-2); font-weight: 700; text-align: right; padding: 4px; white-space: nowrap; }
.bd td { padding: 4px; border-top: 1px solid var(--border); text-align: right; white-space: nowrap; }
.bd td:first-child, .bd th:first-child { text-align: left; white-space: normal; }
.bd tr.lt td { border-top: 2px solid var(--ink); font-weight: 700; }
.price { margin: var(--space-1) 0 0; }
@media (max-width: 519px) {
  table.bd, .bd tbody, .bd tr, .bd td { display: block; width: 100%; }
  .bd tr:first-child { display: none; }
  .bd tr { border-top: 1px solid var(--border); padding: 6px 0; }
  .bd td { border-top: 0; padding: 1px 0; text-align: left; white-space: normal; }
  .bd td:first-child { font-size: var(--fs-body-sm); padding-bottom: 4px; }
  .bd td[data-label] { display: flex; justify-content: space-between; gap: var(--space-2); }
  .bd td[data-label]::before { content: attr(data-label); color: var(--ink-2); }
  .bd td:empty, .bd td.na { display: none; }
  .bd tr.lt { border-top: 2px solid var(--ink); }
  .bd tr.lt td { border-top: 0; }
  .tblwrap { overflow-x: visible; }
}

/* Propositions libres */
.prop { margin-top: var(--space-3); padding: var(--space-3); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); }
.prop .t { font-weight: 700; }
.prop textarea, .share input, #why select {
  width: 100%; background: var(--surface-sunken); color: var(--ink); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3); font: inherit; font-size: var(--fs-body-sm);
}
.prop textarea { margin: var(--space-2) 0; resize: vertical; }
.props { padding-left: 18px; font-size: var(--fs-body-sm); } .props li { margin: var(--space-1) 0; }
.est { margin-top: var(--space-2); border: 1.5px solid var(--ai); border-radius: var(--radius-md); padding: var(--space-3); }
.est.off { border-style: dashed; }
.est .estrow { display: grid; grid-template-columns: 1fr; gap: var(--space-1); margin: var(--space-2) 0; }
.est .l { font-size: var(--fs-caption); color: var(--ink-2); }
.est .v { font-size: var(--fs-amount); font-weight: 800; }
.est button { margin-top: var(--space-2); }

/* ---------- Mandat et carte de crise ---------- */
.strip { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); margin-top: var(--space-2); }
.strip > .l { width: 100%; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.strip b { display: block; color: var(--ink); font-size: var(--fs-amount); line-height: var(--lh-amount); font-weight: 800; font-variant-numeric: tabular-nums; }
.strip b.down { color: var(--down); }
.card.event { box-shadow: var(--shadow-card); }
@media (prefers-reduced-motion: no-preference) {
  .card.event[data-event] { animation: card-in var(--duration-base) var(--ease-out) both; }
}
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.crisis-art { display: block; width: 100%; max-width: 320px; height: auto; aspect-ratio: 320 / 200; border-radius: var(--radius-md); margin: 0 0 var(--space-3); background: #ECEBE5; }
.crisis-title { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 var(--space-1); }
.crisis-meta { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 var(--space-3); }
.shock { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin: var(--space-3) 0; }
.opt { border-top: 1px solid var(--border); padding: var(--space-4) 0 var(--space-2); margin-top: var(--space-3); }
.opt .oh { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.opt .ot { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700; }
.opt .ocost { font-size: var(--fs-amount); line-height: var(--lh-amount); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt .choice { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); width: 100%; margin-top: var(--space-3); text-align: left; }
.opt .choice .amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt.free { border-top-style: dashed; }
.ob { font-size: var(--fs-body-sm); margin-top: var(--space-1); }
.ob .bar { height: 6px; margin: var(--space-1) 0 2px; }
.outc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); margin-top: var(--space-2); }
@media (min-width: 560px) { .outc { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.outc > div { background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 6px var(--space-2); }
.outc .l { display: block; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); }
.outc b { font-size: var(--fs-body-sm); font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 4px; }
.outc > div > span.xs { display: block; }
.journal { padding-left: 18px; margin: var(--space-2) 0; } .journal li { margin: 6px 0; }

/* ---------- Graphiques ---------- */
svg.chart { width: 100%; height: 110px; display: block; }
.legend { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); margin-top: var(--space-1); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-xs); margin-right: 4px; vertical-align: middle; }
.legend i.dot { background: none; border-top: 2px dotted var(--ink); border-radius: 0; height: 0; width: 14px; }
.legend i.band { background: var(--ink); opacity: .25; }
.cmpcharts { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 640px) { .cmpcharts { grid-template-columns: 1fr 1fr; } }
.cmpchart { margin: 0; }
.cmpchart .chart { width: 100%; height: auto; }

/* ---------- Tableaux ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-body-sm); }
.tbl td { padding: 6px 0; border-top: 1px solid var(--border); }
.tbl td:last-child { text-align: right; }
.tbl.key th { font-size: var(--fs-caption); color: var(--ink-2); font-weight: 700; text-align: right; padding-bottom: var(--space-1); }
.tbl.key td { vertical-align: top; padding: var(--space-2) 0; }
.tbl.key td:nth-child(2) { text-align: right; padding-right: var(--space-3); }

/* Tableau de bilan « Toi / Si rien ne change / Budget du gouv. » (IDENTITE.md §7) : vrai <table>, colonnes fixes, tient à 390 px */
.bilan-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--fs-body-sm); }
.bilan-table col.c-you { width: 64px; } .bilan-table col.c-cmp { width: 56px; }
@media (min-width: 560px) { .bilan-table col.c-you { width: 104px; } .bilan-table col.c-cmp { width: 112px; } }
.bilan-table thead th { vertical-align: bottom; text-align: right; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 400; color: var(--ink-2); padding: 0 0 var(--space-2) 6px; overflow-wrap: anywhere; }
.bilan-table thead th:first-child { text-align: left; padding-left: 0; font-weight: 700; color: var(--ink); }
.bilan-table thead th.you span.tag { display: inline-block; background: var(--brand); color: var(--on-brand); font-weight: 700; border-radius: var(--radius-xs); padding: 2px 6px; }
.bilan-table thead th .src { margin: 2px 0 0; }
.bilan-table thead th .hint { display: block; font-weight: 400; }
.bilan-table tbody th { text-align: left; font-weight: 400; vertical-align: top; padding: var(--space-3) 6px var(--space-3) 0; border-top: 1px solid var(--border); min-width: 0; }
.bilan-table tbody td { text-align: right; vertical-align: top; padding: var(--space-3) 0 var(--space-3) 6px; border-top: 1px solid var(--border); white-space: nowrap; }
.bilan-table tr.grp th { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: var(--space-5) 0 var(--space-2); border-top: 0; }
.bilan-table .il { display: flex; align-items: flex-start; gap: 6px; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--ink); }
.bilan-table .il .ico { margin-top: 2px; }
.bilan-table .iu { display: block; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-3); margin-top: 2px; }
.bilan-table .gap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: var(--space-1); }
.bilan-table td.you { font-size: var(--fs-amount); line-height: var(--lh-amount); font-weight: 800; color: var(--ink); }
.bilan-table td.cmpv { font-size: var(--fs-compare); line-height: var(--lh-compare); color: var(--ink-2); }
.bilan-table button.why { font-size: var(--fs-caption); padding: 0; min-height: 32px; min-width: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.bilan-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.cmpm { display: inline; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); white-space: nowrap; }
.cmpm.better { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cmpm.worse { text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Résumé et « Pourquoi ? » */
.scsum { display: grid; grid-template-columns: 1fr; gap: var(--space-2); margin: var(--space-3) 0 var(--space-1); }
.scsum > div { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3); }
.scsum dt { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); }
.scsum dd { margin: 2px 0 0; }
.scsum dd b { display: block; font-size: var(--fs-amount); line-height: var(--lh-amount); font-weight: 800; font-variant-numeric: tabular-nums; }
.scsum dd .xs { display: block; color: var(--ink-3); }
.switch { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); align-items: start; margin: var(--space-3) 0 var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.switch input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--ink); }
.switch label { font-size: var(--fs-body-sm); cursor: pointer; }
.switch .hint { grid-column: 2; }
.attrs { list-style: none; padding: 0; margin: var(--space-2) 0; }
.attr { padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.attr .ah { font-size: var(--fs-body-sm); }
.attr .ab { display: grid; grid-template-columns: 90px 1fr; gap: var(--space-2); align-items: center; margin-top: var(--space-1); }
.attr .cmpm { margin-left: 4px; }
.abar { display: block; height: 8px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.abar i { display: block; height: 100%; background: var(--ink-2); }
.abar i.ok { background: var(--up-fill); } .abar i.bad { background: var(--down-fill); } .abar i.n { background: var(--ink-2); }
#why select { width: auto; max-width: 100%; min-height: 44px; }
.prio { margin-top: var(--space-3); border-top: 1px solid var(--border); padding-top: var(--space-2); }
.tglist { list-style: none; padding: 0; margin: 0; }
.tg { padding: var(--space-3) 0; border-top: 1px solid var(--border); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.gind { list-style: none; padding: 0; margin: var(--space-2) 0 0; font-size: var(--fs-body-sm); }
.gind li { display: flex; justify-content: space-between; gap: var(--space-2); padding: 6px 0; border-top: 1px solid var(--border); }

/* ---------- Barre basse ---------- */
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
}
.bottom .in { max-width: 760px; margin: 0 auto; display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; }
.bottom .in p { flex: 1; margin: 0; font-size: var(--fs-caption); line-height: var(--lh-caption); }
.bottom .nums { display: flex; flex-wrap: wrap; gap: 2px var(--space-4); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); min-width: 0; }
.bottom .nums b { display: block; color: var(--ink); font-size: var(--fs-amount); line-height: var(--lh-amount); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bottom .nums b .mut { font-size: var(--fs-caption); font-weight: 400; }
.bottom .nums b.down { color: var(--down); }
.bottom .hint { max-width: 760px; margin: var(--space-2) auto 0; }
@media (max-width: 420px) { .bottom button.primary { padding: 0 var(--space-4); font-size: 18px; } }

/* ---------- Panneau source (modal) ---------- */
.modal { position: fixed; inset: 0; background: var(--scrim); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 720px) { .modal { align-items: center; } }
.modal .sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: var(--space-4); width: 100%; max-width: 560px; max-height: 80vh; overflow: auto; }
@media (min-width: 720px) { .modal .sheet { border-radius: var(--radius-lg); padding: var(--space-6); } }
.modal .sheet h2 { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); font-size: var(--fs-h3); line-height: var(--lh-h3); }
.modal .sheet dl { margin: var(--space-2) 0; font-size: var(--fs-body-sm); }
.modal .sheet dt { color: var(--ink-3); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: var(--space-2); }
.modal .sheet dd { margin: 2px 0 0; word-break: break-word; }
.share { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.share input { flex: 1; min-width: 160px; min-height: 44px; font-size: var(--fs-caption); }

/* ---------- v0.3 « crédibilité » ---------- */
.status { max-width: 760px; margin: var(--space-2) auto 0; padding: var(--space-2) var(--space-3); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--ink-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
@media (max-width: 791px) { .status { margin-left: var(--space-4); margin-right: var(--space-4); } }
.status a { white-space: nowrap; }
.notice { border-style: dashed; border-color: var(--border-strong); }
.rules { list-style: none; padding: 0; margin: var(--space-1) 0; font-size: var(--fs-body-sm); }
.rules li { padding: 3px 0; }
.rules.gov { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 4px; color: var(--ink-2); }
.nomeasure { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: var(--fs-body-sm); }
.prov { display: block; border-radius: var(--radius-sm); white-space: normal; padding: 6px 9px; }
.prms { list-style: none; padding: 0; margin: var(--space-2) 0; }
.prm { padding: var(--space-2) 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.prm .ph { font-size: var(--fs-body-sm); }
.prm code { font-size: var(--fs-caption); }
.hypl input[type=range] { width: 100%; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
