/* Every value below follows a rule in docs/DESIGN.md. */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #15181e;
  --muted: #4a5160;
  --rule: #d6dae1;
  --grid: #e4e7ec;
  --axe: #9aa1ad;
  --rn: #1f4f9e;
  --rn-clair: #8fa9d6;
  --nfp: #c0285c;
  --nfp-clair: #e3a0b6;
  --fin: #7d8696;
  --acc: #b07a00;
  --acc-texte: #855a00;
  /* Links: a thin rule under running text, a light accent tint behind it on hover and focus. */
  --lien-trait: #7d8696;
  --lien-fond: #f6ecd2;
  /* Budget bars, cyclic order checked in test/design.test.js: blue, green, violet, yellow, aqua, orange. */
  --b1: #257de0; --b2: #008a17; --b3: #6a4ce2; --b4: #f2a600; --b5: #00b894; --b6: #f47230;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  /* Photos : bleu, blanc, rouge. Titre en bleu France sur la photo blanche, filet rouge,
     fond blanc tant que la photo charge. Mêmes valeurs dans les deux thèmes : la photo
     est sa propre surface. Bleu France et rouge Marianne : charte de l'État (DSFR). */
  --photo-texte: #000091;
  --photo-fond: #ffffff;
  --photo-filet: #e1000f;
  /* Measure of running text, in em of the body size: about 66 characters a line, measured on the built pages (docs/DESIGN.md). */
  --mesure: 31em;
  --mast: 64px;
  /* Wordmark: bleu France, the cover titles' colour; a lighter step in dark mode (4.5:1 on the panel). */
  --marque: #000091;
  --barre: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --panel: #181b21; --ink: #eef0f3; --muted: #b6bdc8; --rule: #2c313a; --grid: #222731; --axe: #5b6371;
    --rn: #6f9bea; --rn-clair: #3d5a8c; --nfp: #ef6a93; --nfp-clair: #8c3d57; --fin: #7a8394; --acc: #f0b429; --acc-texte: #f0b429; --lien-trait: #6b7383; --lien-fond: #33290f; --marque: #a3adff; color-scheme: dark;
    --b1: #338ced; --b2: #0aac23; --b3: #9887ef; --b4: #d28e05; --b5: #00a888; --b6: #e76624;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --panel: #181b21; --ink: #eef0f3; --muted: #b6bdc8; --rule: #2c313a; --grid: #222731; --axe: #5b6371;
  --rn: #6f9bea; --rn-clair: #3d5a8c; --nfp: #ef6a93; --nfp-clair: #8c3d57; --fin: #7a8394; --acc: #f0b429; --acc-texte: #f0b429; --lien-trait: #6b7383; --lien-fond: #33290f; --marque: #a3adff; color-scheme: dark;
  --b1: #338ced; --b2: #0aac23; --b3: #9887ef; --b4: #d28e05; --b5: #00a888; --b6: #e76624;
}

/* Self-hosted latin subsets (SIL OFL, licences beside the files). Optional display
   plus preload: the page never reflows when a font arrives late. */
@font-face { font-family: "Archivo"; src: url("site/fonts/archivo.woff2") format("woff2"); font-weight: 400 900; font-stretch: 62% 125%; font-display: optional; }
@font-face { font-family: "Source Serif 4"; src: url("site/fonts/source-serif-4.woff2") format("woff2"); font-weight: 400 600; font-display: optional; }
@font-face { font-family: "Source Serif 4"; src: url("site/fonts/source-serif-4-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: optional; }
@font-face { font-family: "JetBrains Mono"; src: url("site/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 400 600; font-display: optional; }

* { box-sizing: border-box; }
/* Long unbreakable strings (file paths, URLs, numbers with units) break inside their box
   instead of running out of it; code breaks anywhere, prose only where a word cannot fit. */
code, kbd, samp { overflow-wrap: anywhere; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.1875rem/1.6 var(--text); font-optical-sizing: auto; text-rendering: optimizeLegibility; overflow-wrap: break-word; }
@media (max-width: 600px) { body { font-size: 1.125rem; } }
/* Links by context (docs/DESIGN.md, Links). Running text: thin rule, tint on hover. Small print:
   dotted rule. Calls to action: solid rule. Navigation, cards and tiles: no rule. */
a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--lien-trait); text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-skip-ink: auto; }
a:hover, a:focus-visible { text-decoration-color: currentColor; }
:is(p, li, td, figcaption, dd) a:is(:hover, :focus-visible) { background: var(--lien-fond); }
:is(.credit, .credits, .source, .pied, .meta, .note, .lire-g, caption, small) a { text-decoration-style: dotted; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.in { max-width: 1152px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
/* Two widths: running text holds the --mesure column; figures,
   tools and tables break out to the full 1120 px. */
:is(.bloc, .une) > .in, .tete-photo .in { display: grid; grid-template-columns: [large-start] minmax(0, 1fr) [texte-start] minmax(0, var(--mesure)) [texte-end] minmax(0, 1fr) [large-end]; }
:is(.bloc, .une) > .in > * { grid-column: texte; }
:is(.bloc, .une) > .in > :is(.graphe, .outil, .defile, details, [data-vue], .code, pre.eq, .liste-mod, .rubriques) { grid-column: large; }
/* Home sections are a layout, not running text: they span the content width in grids. */
.bloc.large > .in > * { grid-column: large; }
/* Equations and code listings hug their longest line, centred on the text axis:
   as wide as the text column at least, out to the full width when a line needs it. */
:is(.bloc, .une) > .in > :is(.code, pre.eq) { justify-self: center; width: fit-content; min-width: min(var(--mesure), 100%); max-width: 100%; }
b, strong { font-weight: 600; }
dfn { font-style: normal; font-weight: 600; }
h1, h2, h3, legend, .sur, nav, .logo, .kpi, .duel, figcaption, .note, .source, .lire-g, table, .cur-l, .choix, .leg-g, summary, .mod, .meta, .date, .sommaire, .chiffre, .rub, .lire, .bulle, .pied, .g-serie, .legende {
  font-family: var(--display);
}
h1 { font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 850; font-stretch: 78%; line-height: 1.02; letter-spacing: -0.01em; margin: 0.15em 0 0.35em; text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 3.4vw, 1.9rem); font-weight: 800; font-stretch: 88%; line-height: 1.15; margin: 0 0 0.6em; text-wrap: balance; }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin: 0; text-wrap: balance; }

/* Bandeau */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--panel); }
.mast { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: var(--mast); border-bottom: 1px solid var(--rule); background: var(--panel); }
.mast .in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; max-width: 1120px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; padding-block: 7px; min-width: 44px; }
.logo b { font-size: 2.5rem; font-weight: 900; font-stretch: 62%; letter-spacing: -0.02em; line-height: 1; color: var(--marque); }
.logo span { font-size: 0.9375rem; font-weight: 700; line-height: 1.2; color: var(--ink); padding-left: 10px; border-left: 4px solid var(--photo-filet); }
nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; font-size: 1rem; font-weight: 700; }
nav a { flex: none; text-decoration: none; padding: 20px 10px 16px; color: var(--muted); border-bottom: 4px solid transparent; }
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--photo-filet); }
/* Phone: the site menu moves to a bar at the bottom, in thumb reach, one equal
   target per entry, and the logo stays alone at the top. */
@media (max-width: 600px) {
  body { padding-bottom: calc(var(--barre) + env(safe-area-inset-bottom, 0px)); }
  .mast nav { position: fixed; inset: auto 0 0; z-index: 25; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; font-size: 0.875rem; overflow: visible; background: var(--panel); border-top: 1px solid var(--rule); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .mast nav a { display: flex; align-items: center; justify-content: center; height: var(--barre); padding: 0 4px; border-bottom: 0; border-top: 4px solid transparent; text-align: center; }
  .mast nav a[aria-current="page"] { color: var(--ink); border-top-color: var(--photo-filet); }
}
.lecture { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--mast)); z-index: 19; height: 3px; margin-top: -3px; }
.lecture i { display: block; height: 100%; background: var(--acc); transform: scaleX(0); transform-origin: 0 50%; }

/* En-tête d'article */
.une { padding-block: 40px 32px; }
.sur { font-size: 0.875rem; font-weight: 700; color: var(--acc-texte); margin: 0; }
.chapo { font-size: 1.3rem; line-height: 1.5; margin: 0 0 12px; }
.meta { font-size: 0.875rem; color: var(--muted); margin: 0; }
.en-bref { margin-top: 28px; padding-top: 14px; border-top: 2px solid var(--ink); }
.en-bref h2 { font-size: 1rem; font-stretch: 100%; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.en-bref ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 10px; }
.en-bref li::marker { color: var(--ink); }

/* Tête photo : la photo en noir et blanc, le titre imprimé dessus. La plage de tons
   de la photo (photos.js, TONS.blanc) garantit 4,5:1 sous chaque lettre. */
.une-photo, .accueil.une-photo { padding-top: 0; }
.tete-photo { display: grid; background: var(--photo-fond); color: var(--photo-texte); margin-bottom: 8px; }
.tete-photo > * { grid-area: 1 / 1; }
.tete-photo picture, .tete-photo img { display: block; width: 100%; }
.tete-photo img { height: auto; max-height: 72vh; object-fit: cover; }
.tete-photo .in { align-self: end; width: 100%; padding-block: 24px 32px; }
.tete-photo .in > * { grid-column: texte; }
.tete-photo .sur { color: var(--photo-texte); }
.tete-photo .date { display: inline-block; color: inherit; font-size: inherit; }
.tete-photo .sur::before, .photo-carte :is(h2, h3)::before { content: ""; display: block; width: 56px; height: 6px; background: var(--photo-filet); margin-bottom: 12px; }
.tete-photo h1 { font-size: clamp(2.75rem, 5.4vw, 5rem); font-weight: 900; max-width: 13ch; margin: 0.1em 0 0; line-height: 1.14; text-wrap: balance; }
/* Laptops and wider: the cover title runs from the text column to the right edge of the content,
   two balanced lines instead of four stacked ones over the photo. */
@media (min-width: 861px) { .tete-photo .in > h1 { grid-column: texte-start / large-end; max-width: 22ch; } }
/* Text never rests on the photo's grain: each line of a title sits on a flat white strip,
   so its contrast does not depend on the pixels behind it (docs/DESIGN.md, Photos). */
:is(.tete-photo :is(.sur, h1), .photo-carte :is(h2, h3)) > span { background: var(--photo-fond); box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 0.04em 0.16em; }
.tete-photo .sur > span { padding: 0.2em 0.4em; }
.credit { font-family: var(--display); font-size: 0.8125rem; line-height: 1.5; color: var(--muted); margin: 0 0 24px; }
.credits { font-size: 0.8125rem; }
.nw { white-space: nowrap; }

/* Vignette : la photo en haut d'une carte ou d'une tuile, le titre imprimé dessus. */
.photo-carte { display: grid; background: var(--photo-fond); color: var(--photo-texte); }
.photo-carte > * { grid-area: 1 / 1; }
.photo-carte img { display: block; width: 100%; height: auto; }
.photo-carte :is(h2, h3) { align-self: end; margin: 0; padding: 14px 18px; color: var(--photo-texte); font-weight: 900; line-height: 1.16; text-wrap: balance; }
.lead .photo-carte { margin: -24px -24px 12px; }
.tuile .photo-carte { margin: -18px -20px 12px; }
.tuile .photo-carte h3, .tuile:hover .photo-carte h3 { font-size: 1.6rem; font-weight: 900; font-stretch: 70%; line-height: 1.05; color: var(--photo-texte); }

/* Sommaire collant */
.sommaire { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--mast)); z-index: 18; background: var(--bg); border-block: 1px solid var(--rule); }
.sommaire .in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.sommaire a { flex: none; display: flex; align-items: center; min-height: 48px; font-size: 0.875rem; font-weight: 600; text-decoration: none; color: var(--muted); padding: 2px 8px 0; border-bottom: 2px solid transparent; }
.sommaire a:hover { color: var(--ink); }
.sommaire a.actif { color: var(--ink); border-bottom-color: var(--acc); }

/* Sections */
.bloc { padding-block: 48px; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--mast) + 56px); }
.bloc.fort { background: var(--panel); }
.verdict h2::before { content: ""; display: block; width: 48px; height: 4px; background: var(--acc); margin-bottom: 14px; }
details { margin: 12px 0; border-top: 1px solid var(--rule); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; font-size: 1rem; min-height: 44px; padding-block: 10px; }
summary::marker { color: var(--acc-texte); }
.note, .source, .lire-g { font-size: 0.9375rem; color: var(--muted); line-height: 1.5; }

/* Graphiques : titre qui énonce le constat, sous-titre qui dit ce qui est tracé */
.graphe { margin: 28px 0; min-width: 0; }
.graphe figcaption { margin-bottom: 14px; }
.graphe figcaption p { margin: 4px 0 0; font-size: 0.9375rem; color: var(--muted); }
.g { min-width: 0; }
/* The SVG keeps its drawn height at any width (no height: auto): the build draws
   at 720 px, the browser redraws at the real width, and the page does not move. */
.g svg { display: block; max-width: 100%; overflow: visible; }
.g-serie { margin: 14px 0 4px; font-weight: 700; font-size: 0.9375rem; display: flex; align-items: center; gap: 8px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 0.875rem; font-weight: 600; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.pastille { display: inline-block; width: 12px; height: 12px; flex: none; margin-right: 6px; vertical-align: -1px; }
.legende .pastille, .g-serie .pastille { margin-right: 0; }
.pastille.rn { background: var(--rn); } .pastille.nfp { background: var(--nfp); }
.pastille.b1 { background: var(--b1); } .pastille.b2 { background: var(--b2); } .pastille.b3 { background: var(--b3); }
.pastille.b4 { background: var(--b4); } .pastille.b5 { background: var(--b5); } .pastille.b6 { background: var(--b6); }
.pastille.fin { background: var(--fin); } .pastille.acc { background: var(--acc); } .pastille.vide { background: var(--grid); outline: 1px solid var(--rule); }
.lire-g, .partage-g { margin: 12px 0 0; }
.partage-g { font-size: 0.9375rem; }
.source { margin: 8px 0 0; }

svg text { font-family: var(--display); fill: var(--ink); }
.t-lab { font-size: 13px; font-weight: 500; fill: var(--muted); }
.t-ax { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.t-val { font-size: 14px; font-weight: 700; }
.t-note { font-size: 14px; font-weight: 600; font-style: italic; }
.s-note { stroke: var(--ink); stroke-width: 1; fill: none; }
.t-in { font-size: 13px; font-weight: 700; fill: #ffffff; }
.s-grid { stroke: var(--grid); stroke-width: 1; }
.s-axe { stroke: var(--axe); stroke-width: 1; }
.s-ink { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.s-cur { stroke: var(--acc); stroke-width: 2; }
.rn { fill: var(--rn); } .nfp { fill: var(--nfp); } .fin { fill: var(--fin); } .acc { fill: var(--acc); }
.vide { fill: var(--grid); } .rn-clair { fill: var(--rn-clair); } .nfp-clair { fill: var(--nfp-clair); } .encre { fill: var(--ink); }
.b1 { fill: var(--b1); } .b2 { fill: var(--b2); } .b3 { fill: var(--b3); } .b4 { fill: var(--b4); } .b5 { fill: var(--b5); } .b6 { fill: var(--b6); }
path.o1 { opacity: 0.78; } path.o2 { opacity: 0.62; } path.o3 { opacity: 0.48; }
.anneau { stroke: var(--bg); stroke-width: 2; }
.bloc.fort .anneau, .lead .anneau { stroke: var(--panel); }
.l-rn, .l-nfp { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.l-rn { stroke: var(--rn); } .l-nfp { stroke: var(--nfp); }
.l-b1, .l-b3 { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.l-b1 { stroke: var(--b1); } .l-b3 { stroke: var(--b3); } .l-rupture { stroke-dasharray: 4 4; }
.w-int { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
[data-tip] { cursor: crosshair; transition: opacity 0.15s; }
svg:has([data-tip]:hover) [data-tip]:not(:hover) { opacity: 0.55; }
.bulle { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; background: var(--ink); color: var(--bg); border: 2px solid var(--bg); font-size: 0.875rem; font-weight: 600; padding: 6px 10px; max-width: 280px; }

.direct { position: fixed; inset: auto 0 0; z-index: 24; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--panel); border-top: 2px solid var(--ink); font-family: var(--display); font-size: 0.875rem; font-weight: 600; color: var(--muted); pointer-events: none; }
.direct[hidden] { display: none; }
.direct span { display: inline-flex; align-items: center; }
.direct b { font-size: 1.25rem; font-weight: 800; color: var(--ink); margin-right: 12px; }
@media (max-width: 600px) { .direct { bottom: calc(var(--barre) + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; } }

/* Outils : hypothèses, résultat, graphique, de haut en bas */
.outil { display: flex; flex-direction: column; gap: 20px; margin: 24px 0; }
.curs { border: 0; padding: 16px 18px 18px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px 28px; background: var(--panel); }
.bloc.fort .curs { background: var(--bg); }
/* A floated legend leaves the fieldset border and sits inside the panel, as its first row. */
legend { float: left; width: 100%; grid-column: 1 / -1; font-size: 0.875rem; font-weight: 700; padding: 0; margin: 0; color: var(--muted); }
.cur-l { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 0.9375rem; font-weight: 500; align-items: end; }
.cur-l output { font-weight: 700; font-variant-numeric: tabular-nums; }
.cur-l input { grid-column: 1 / -1; width: 100%; margin: 0; height: 44px; accent-color: var(--acc); cursor: pointer; }
.choix { display: grid; align-content: start; font-size: 0.9375rem; font-weight: 500; }
.choix label { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.choix input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--acc); cursor: pointer; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { padding-top: 8px; border-top: 2px solid var(--rule); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi span { font-size: 0.875rem; color: var(--muted); }
.kpi b { font-size: 1.6rem; font-weight: 800; font-stretch: 85%; line-height: 1.15; }
.kpi.cle { border-top-color: var(--ink); }
.duels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.duel { padding-top: 8px; border-top: 2px solid var(--ink); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.duel span { font-weight: 700; font-size: 1rem; display: flex; align-items: center; }
.duel b { font-size: 2.1rem; font-weight: 850; font-stretch: 80%; line-height: 1.1; }
.duel small { color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }

/* Tableaux */
.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; margin: 12px 0; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: 0.9375rem; color: var(--muted); padding-bottom: 8px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.postes td:nth-child(2), .scen td:not(:first-child), .chiffres-t td:not(:first-child) { text-align: right; }
.scen th:not(:first-child), .chiffres-t th:not(:first-child) { text-align: right; }
.postes tr.fin td:first-child { color: var(--muted); }
.comparaison td:not(:first-child), .comparaison th:not(:first-child) { text-align: right; hyphens: manual; }
.comparaison tr:not(.raisons):not(.seule) td { border-bottom: 0; }
.comparaison tr:not(.raisons) td { font-weight: 600; }
.comparaison tr.raisons td { text-align: left; padding-top: 0; }
.comparaison tr.raisons p { margin: 0; color: var(--muted); }
.comparaison tr.raisons ul { margin: 4px 0 0; padding-left: 20px; }
.duo tbody th { font-weight: 600; width: 30%; }
td small { color: var(--muted); font-size: 0.875rem; }
@media (max-width: 600px) { table { font-size: 0.875rem; } th, td { padding-right: 8px; hyphens: auto; hyphenate-limit-chars: 10 4 4; } }

/* Gaufre */
.gauf { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.carre { width: min(240px, 100%); }
.carre svg { display: block; width: 100%; height: auto; }
.leg-g { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.leg-g li { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 10px; font-size: 1rem; }
.leg-g b { font-size: 1.6rem; font-weight: 850; font-stretch: 80%; min-width: 3.4em; }


/* Accueil */
.accueil { padding-block: 44px 8px; }
.date { font-size: 0.9375rem; font-weight: 600; color: var(--muted); margin: 0; }
.date::first-letter { text-transform: uppercase; }
.titre-site { font-size: clamp(2.8rem, 9vw, 6rem); font-stretch: 65%; font-weight: 900; margin: 0.08em 0 0.2em; letter-spacing: -0.02em; }
.grille-une { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; padding-block: 20px 48px; }
@media (max-width: 860px) { .grille-une { grid-template-columns: minmax(0, 1fr); } }
.lead { background: var(--panel); padding: 24px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; border-top: 4px solid var(--ink); min-width: 0; }
.lead-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: -24px -24px 12px; }
.lead .lead-photos .photo-carte { margin: 0; }
.lead-photos .photo-carte h3 { font-size: 1.6rem; font-stretch: 70%; line-height: 1.05; }
.lead-photos a:is(:hover, :focus-visible) h3 { text-decoration: underline; text-decoration-thickness: 2px; }
.lires { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: auto; }
.lead h2 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); font-stretch: 75%; font-weight: 900; margin: 0; }
.lead p { margin: 0; }
.lead .graphe { margin: 16px 0 4px; }
.lire { font-weight: 700; font-size: 1rem; margin-top: auto; padding-top: 8px; }
.lire { text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.accueil .in { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 24px; }
.accueil .in > * { grid-column: 1 / -1; }
.accueil .chapo { grid-column: 1; }
@media (max-width: 860px) { .accueil .in { grid-template-columns: minmax(0, 1fr); } .accueil .chapo { grid-column: 1 / -1; } }
.chiffres { display: flex; flex-direction: column; min-width: 0; }
.chiffre { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: baseline; padding-block: 16px; border-bottom: 1px solid var(--rule); }
.chiffre b { font-size: 2.5rem; font-weight: 900; font-stretch: 68%; line-height: 1; }
.chiffre span { font-weight: 600; font-size: 1rem; }
.chiffre small { grid-column: 1 / -1; color: var(--muted); font-size: 0.875rem; margin-top: 6px; }
.chiffre.parti { border-left: 6px solid var(--rule); padding-left: 14px; border-bottom: 0; margin-bottom: 12px; background: var(--panel); padding-block: 16px 14px; }
.chiffre.parti b { font-size: 3.4rem; }
.chiffre.parti.rn { border-left-color: var(--rn); } .chiffre.parti.nfp { border-left-color: var(--nfp); }
.chiffre.contexte b { font-size: 1.9rem; }
.chiffre .ech { grid-column: 1 / -1; margin-top: 10px; }
.chiffre .ech svg { display: block; width: 100%; height: 22px; overflow: visible; }
.rubriques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .rubriques { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .rubriques { grid-template-columns: minmax(0, 1fr); } }
.tuile { background: var(--panel); border-top: 6px solid var(--ink); padding: 18px 20px 20px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tuile.rn { border-top-color: var(--rn); } .tuile.nfp { border-top-color: var(--nfp); } .tuile.acc { border-top-color: var(--acc); }
.tuile h3 { font-size: 1rem; color: var(--muted); }
.tuile:hover h3 { color: var(--ink); }
.rub-n { font-family: var(--display); font-size: 2.6rem; font-weight: 900; font-stretch: 65%; line-height: 1.05; }
.tuile p { margin: 0 0 10px; font-family: var(--text); font-size: 1rem; color: var(--muted); }
.tuile .ech { margin-top: auto; }
.tuile .ech svg { display: block; width: 100%; height: 22px; }
.barres { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-family: var(--display); font-size: 0.8125rem; }
.barres li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline; }
.barres span { color: var(--muted); }
.barres b { font-weight: 700; font-variant-numeric: tabular-nums; }
.barres i { grid-column: 1 / -1; display: block; height: 8px; min-width: 2px; }
.barres i.rn { background: var(--rn); } .barres i.nfp { background: var(--nfp); }
.barres i.b1 { background: var(--b1); } .barres i.b2 { background: var(--b2); } .barres i.b3 { background: var(--b3); } .barres i.b5 { background: var(--b5); }
.cases { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.cases i { width: 16px; height: 16px; background: var(--ink); }
.principes ol { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.principes li { padding-top: 10px; border-top: 1px solid var(--rule); }
.principes li b { display: block; font-family: var(--display); font-size: 1.125rem; font-weight: 800; margin-bottom: 4px; }
@media (max-width: 860px) { .principes ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .principes ol { grid-template-columns: minmax(0, 1fr); } }

/* Modèles */
.liste-mod { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 24px 0; }
.mod { background: var(--panel); border: 0; border-top: 4px solid var(--ink); padding: 18px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.mod:hover { border-color: var(--ink); }
.mod b { font-size: 1.2rem; font-weight: 800; }
.mod span { font-family: var(--text); font-size: 1rem; color: var(--muted); }
.mod code, .tests { font-family: var(--mono); font-size: 0.875rem; }
.modele h2 { margin-top: 40px; font-size: 1.4rem; }
pre.eq { font-family: var(--mono); font-size: 0.9375rem; background: var(--panel); border: 0; border-left: 4px solid var(--acc); padding: 14px 16px; overflow-x: auto; line-height: 1.6; }
.code { margin: 16px 0; min-width: 0; }
.code figcaption { font-size: 0.875rem; color: var(--muted); margin-bottom: 6px; }
.code pre { margin: 0; background: var(--panel); border: 0; overflow-x: auto; font-size: 0.875rem; line-height: 1.55; padding: 12px 0; }
.code code { font-family: var(--mono); counter-reset: l; display: block; }
.code code span { display: block; padding-right: 16px; }
.code code span::before { counter-increment: l; content: counter(l); display: inline-block; width: 3.2em; padding-right: 1em; text-align: right; color: var(--muted); user-select: none; }

.pied .in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: 0 40px; align-items: start; }
.pied p { margin-top: 0; }
@media (max-width: 860px) { .pied .in { grid-template-columns: minmax(0, 1fr); } }
.pied { padding-block: 36px 56px; color: var(--muted); font-size: 0.9375rem; border-top: 1px solid var(--rule); }
.pied-logo b { font-size: 1.6rem; font-weight: 900; font-stretch: 62%; margin-right: 8px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .pastille { forced-color-adjust: none; } }
.verif-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.copier { min-height: 44px; padding: 0 18px; border: 0; background: var(--ink); color: var(--bg); font: 600 1rem var(--display); cursor: pointer; }
.verif-texte { font-family: var(--mono); font-size: 0.875rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28em; overflow-y: auto; margin: 0; padding: 12px 16px; background: var(--panel); }
.bloc.fort .verif-texte { background: var(--bg); }
