/* SPDX-License-Identifier: AGPL-3.0-or-later
   D’après les sondages — reprend Depuis 1958 de Victor Poughon (2017). Voir NOTICE.md. */
/* D’après les sondages — feuille de style unique.
   Principe : une page de données plutôt qu'une application. La structure tient
   aux filets et à la typographie ; la couleur est réservée aux données. */

/* Polices hébergées sur le site (SIL Open Font License, voir assets/fonts/) */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --page: #fcfbf9;
  --surface: #fcfbf9;   /* fond des graphiques : le même que la page */
  --raised: #ffffff;    /* infobulles, champs */
  --ink: #141413;
  --ink-2: #474641;
  --muted: #6b6a64;
  --axis: #8a8983;
  --grid: #e9e7e1;
  --rule: #e2e0d9;
  --rule-strong: #141413;
  --baseline: #bdbbb3;
  --wash: #f1f0eb;
  --field: #d3d1c9;
  --accent: #1f5fbf;
  --shadow: 0 6px 24px rgba(20, 20, 19, 0.10);
  --div-neg: #2a78d6;
  --div-pos: #e34948;

  /* Palette catégorielle validée (8 teintes), 0 = gris des petits candidats */
  --s0: #a9a8a1;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #6250d6;
  --s8: #e34948;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 1200px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121211;
    --surface: #121211;
    --raised: #1c1c1a;
    --ink: #eeede8;
    --ink-2: #c9c8c1;
    --muted: #9d9c95;
    --axis: #86857e;
    --grid: #262624;
    --rule: #2d2d2a;
    --rule-strong: #eeede8;
    --baseline: #4a4944;
    --wash: #1d1d1b;
    --field: #3a3a36;
    --accent: #6ea0ec;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    --s0: #6b6a64;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s8: #e66767;
    --div-neg: #3987e5;
    --div-pos: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121211;
  --surface: #121211;
  --raised: #1c1c1a;
  --ink: #eeede8;
  --ink-2: #c9c8c1;
  --muted: #9d9c95;
  --axis: #86857e;
  --grid: #262624;
  --rule: #2d2d2a;
  --rule-strong: #eeede8;
  --baseline: #4a4944;
  --wash: #1d1d1b;
  --field: #3a3a36;
  --accent: #6ea0ec;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  --s0: #6b6a64;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #008300;
  --s7: #9085e9;
  --s8: #e66767;
  --div-neg: #3987e5;
  --div-pos: #e66767;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 1px; text-decoration-color: var(--baseline); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: color-mix(in oklab, var(--accent) 22%, transparent); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- en-tête ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--page); }
.site-header .wrap { display: flex; align-items: stretch; justify-content: space-between; gap: 24px; min-height: 64px; }
.brand { display: flex; flex-direction: column; justify-content: center; gap: 3px; text-decoration: none; padding: 12px 0; flex: none; }
.brand-name { font: 650 21px/1.05 var(--serif); letter-spacing: -0.012em; white-space: nowrap; }
.brand-tag { font-size: 12.5px; line-height: 1.2; color: var(--muted); }
.site-nav { display: flex; align-items: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  display: flex; align-items: center; padding: 0 10px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
}
.site-nav a:hover { color: var(--ink); box-shadow: inset 0 -2px 0 var(--baseline); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

/* ---------- typographie ---------- */
h1, h2 { font-family: var(--serif); font-weight: 600; font-optical-sizing: auto; }
h1 { font-size: clamp(34px, 4.8vw, 54px); line-height: 1.06; letter-spacing: -0.022em; margin: 0 0 16px; max-width: 17em; text-wrap: balance; }
h2 { font-size: 27px; line-height: 1.2; letter-spacing: -0.012em; margin: 0 0 6px; text-wrap: balance; }
h3 { font: 600 17px/1.35 var(--sans); margin: 0 0 4px; }
p { margin: 0 0 12px; }
p, li, dd, td { overflow-wrap: break-word; }
.lede { font-size: 18.5px; line-height: 1.55; color: var(--ink-2); max-width: 40em; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font: 600 12.5px/1.35 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.eyebrow a { text-decoration-color: var(--rule); }
.dek { font-size: 15px; color: var(--muted); margin: 0; max-width: 44em; }
.prose { max-width: 42em; font-size: 16.5px; line-height: 1.65; }
.prose h2 { margin: 48px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 6px; font-size: 17px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--muted); }
code { font-size: 0.9em; background: var(--wash); padding: 1px 5px; border-radius: 3px; }
pre.code { background: var(--raised); border: 1px solid var(--rule); border-radius: 4px; padding: 14px 16px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-width: 680px; }
sup { line-height: 0; }

/* Chiffres : alignés en colonnes partout où l'on compare */
.n, .bar-value, .range-value, .tile-v, .hero-number, .align-score strong, table, .duel-foot, .tt-row strong { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- en-tête de page ---------- */
.hero { padding: 48px 0 8px; }
.hero > :last-child { margin-bottom: 0; }
.hero-figure { display: flex; align-items: baseline; gap: 6px 20px; flex-wrap: wrap; margin: 28px 0 18px; }
.hero-number { font: 600 clamp(68px, 9vw, 104px)/0.9 var(--serif); letter-spacing: -0.035em; white-space: nowrap; }
.hero-caption { font-size: 17px; line-height: 1.5; max-width: 22em; color: var(--ink-2); }
.hero-caption strong { color: var(--ink); font-weight: 600; }
.notice { border-left: 2px solid var(--baseline); padding: 2px 0 2px 14px; color: var(--ink-2); max-width: 40em; font-size: 15px; line-height: 1.55; }

/* Accueil : texte à gauche, graphique principal à droite */
.hero-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 64px; align-items: start; }
.hero-split .hero-text { min-width: 0; }
.hero-panel { border-top: 1px solid var(--rule-strong); padding-top: 14px; margin-top: 6px; min-width: 0; }
.hero-panel .bars { gap: 14px; }
.hero-panel .bar-track { height: 26px; }
.hero-panel .bar { height: 18px; }
.hero-panel .bar-label { font-size: 15.5px; }
.hero-panel .bar-value { font-size: 15px; }

/* ---------- blocs et panneaux ---------- */
.hero + .prose, .hero + .table-wrap { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule-strong); }
main > section, .block { margin: 72px 0 0; padding-top: 16px; border-top: 1px solid var(--rule-strong); }
.block-head, .section-head { margin-bottom: 24px; max-width: 46em; }
.block-head p, .section-head p { margin: 0; color: var(--muted); font-size: 15px; }

.grid { display: grid; gap: 48px 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin: 32px 0 0; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
@media (min-width: 1100px) { .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { border-top: 1px solid var(--rule); padding-top: 16px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card-head { margin-bottom: 18px; max-width: 46em; }
.card-head h2, .hero-panel h2, .panel-title { font: 600 17px/1.35 var(--sans); letter-spacing: 0; margin: 0 0 4px; }
.card-head p, .hero-panel .dek { margin: 0; font-size: 14px; color: var(--muted); }
/* Petits multiples générés par le script : leur première ligne sert de titre */
.card > .eyebrow:first-child { font: 600 15px/1.35 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); margin-bottom: 10px; }

/* Bandeau de scénario : la commande au-dessus de ce qu'elle pilote */
.scenario-bar { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 6px 32px; margin: 56px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rule); }
.scenario-bar .panel-title { font-size: 15px; }
.scenario-bar .dek { font-size: 13.5px; }
.scenario-bar .filters { margin: 0; }
.scenario-bar .scenario-note { grid-column: 2; margin: 8px 0 0; }

/* ---------- commandes ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 28px 0 12px; }
.filters-label { font-size: 14px; color: var(--muted); margin-right: 6px; }
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  font: 500 14px/1 var(--sans); color: var(--ink-2);
  background: var(--raised); border: 1px solid var(--field); border-radius: 4px;
  cursor: pointer; transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
/* Candidats : cases à cocher dessinées en CSS */
.chip.cand::before { content: ""; flex: none; width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 2px; }
.chip.cand[aria-pressed="true"]::before { background: var(--page); border-color: var(--page); }
.chip.cand[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 16.5px; top: 50%; width: 4px; height: 8px;
  border: solid var(--ink); border-width: 0 1.8px 1.8px 0; transform: translateY(-62%) rotate(45deg);
}
.chip.reset { border-style: dashed; background: transparent; }
.scenario-note { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; max-width: 60em; }
.chart-controls { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- barres horizontales ---------- */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(92px, 8.5em) 1fr; align-items: center; gap: 14px; cursor: default; }
.bar-label { font-size: 14.5px; font-weight: 500; line-height: 1.2; }
.bar-label .party { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.bar-track { position: relative; height: 22px; display: flex; align-items: center; }
.bar { height: 14px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--c, var(--s0)); transition: opacity 0.15s; }
.bar-value { margin-left: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.bar-row:hover .bar, .bar-row:focus-visible .bar { opacity: 0.8; }

/* ---------- intervalles ---------- */
.ranges { position: relative; }
.range-row { display: grid; grid-template-columns: minmax(92px, 8.5em) 1fr; align-items: center; gap: 14px; height: 36px; }
.range-plot { position: relative; height: 36px; }
.range-axis { display: grid; grid-template-columns: minmax(92px, 8.5em) 1fr; gap: 14px; margin-top: 4px; }
.range-ticks { position: relative; height: 20px; border-top: 1px solid var(--baseline); }
.range-ticks span { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--axis); font-variant-numeric: tabular-nums; }
.range-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.range-line { position: absolute; top: 16px; height: 4px; border-radius: 2px; background: var(--c); opacity: 0.35; }
.range-dot { position: absolute; top: 12px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
.range-result { position: absolute; top: 7px; width: 2px; height: 22px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.range-band { position: absolute; top: 5px; bottom: 5px; background: var(--wash); border-radius: 3px; }
.range-value { position: absolute; top: 9px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ref-row .bar-label { font-size: 13px; font-weight: 400; }
.range-uniform { position: absolute; top: 0; bottom: 0; border-left: 2px dotted var(--axis); }

/* ---------- légendes ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin: 0 0 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.key-line { width: 14px; height: 2px; border-radius: 1px; background: var(--c); }
.key-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.key-rect { width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.key-range { width: 18px; height: 4px; border-radius: 2px; background: var(--ink-2); opacity: 0.35; }
.key-result { width: 2px; height: 12px; background: var(--ink); }
.key-uniform { width: 0; height: 12px; border-left: 2px dotted var(--axis); }
.key-band { width: 18px; height: 12px; border-radius: 2px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--rule); }

/* ---------- duels ---------- */
.duels { display: grid; gap: 22px; }
.duel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14.5px; font-weight: 600; margin-bottom: 7px; flex-wrap: wrap; }
.duel-head .p { color: var(--muted); font-size: 13px; font-weight: 400; }
.duel-bar { display: flex; height: 14px; gap: 2px; position: relative; }
.duel-bar > div { height: 100%; }
.duel-bar .left { background: var(--ca); border-radius: 4px 0 0 4px; }
.duel-bar .right { background: var(--cb); border-radius: 0 4px 4px 0; }
.duel-mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--ink); opacity: 0.55; }
.duel-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-top: 7px; gap: 12px; }
.tag { display: inline-block; font-size: 12px; line-height: 1.5; padding: 0 6px; border-radius: 3px; background: var(--wash); color: var(--ink-2); }

/* ---------- courbes ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; font-family: var(--sans); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--baseline); stroke-width: 1; }
.chart .tick { fill: var(--axis); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .poll-dot { opacity: 0.28; }
.chart .end-dot { stroke: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--ink); font-size: 12.5px; font-weight: 500; }
.chart .event { stroke: var(--baseline); stroke-width: 1; }
.chart .event-mark { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.5; cursor: pointer; }
.chart .event-mark:hover, .chart .event-mark:focus { fill: var(--ink); }
.chart .crosshair { stroke: var(--ink-2); stroke-width: 1; }
.chart .band { opacity: 0.12; }

/* ---------- infobulle ---------- */
.tooltip {
  position: absolute; z-index: 10; pointer-events: none;
  background: var(--raised); border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 9px 11px; font-size: 13px; line-height: 1.45; min-width: 160px; max-width: 290px;
}
.tooltip[hidden] { display: none; }
.tooltip .tt-title { font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.tooltip .tt-text { color: var(--ink-2); }
.tooltip .tt-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 7px; }
.tooltip .tt-row span:last-child { color: var(--ink-2); }

/* ---------- tableaux ---------- */
details.data { margin-top: 16px; font-size: 14px; }
details.data summary { cursor: pointer; color: var(--ink-2); font-size: 13.5px; font-weight: 500; width: max-content; max-width: 100%; }
details.data summary::marker { color: var(--muted); }
details.data summary:hover { color: var(--ink); }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.table-wrap.scroll { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 14px 8px 0; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:last-child, td:last-child { padding-right: 0; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); vertical-align: bottom; background: var(--page); border-bottom-color: var(--baseline); position: sticky; top: 0; z-index: 1; }
td.n, th.n { text-align: right; }
td.empty { color: var(--baseline); text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--wash); }
.tbl-cand { display: inline-flex; align-items: center; gap: 7px; }
th .tbl-cand { justify-content: flex-end; }
.table-wrap.scroll th, .table-wrap.scroll td { padding-left: 6px; padding-right: 10px; }

/* ---------- questions de campagne ---------- */
.tiles { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.tile { border-top: 1px solid var(--rule); padding: 14px 0 26px; }
.tile-q { font-size: 14.5px; font-weight: 500; line-height: 1.4; margin: 0 0 10px; }
.tile-v { font: 600 40px/1 var(--serif); letter-spacing: -0.02em; margin: 0 0 8px; }
.tile-d { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0; }

/* ---------- cette semaine ---------- */
.week-grid { display: grid; gap: 28px 48px; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.week-news p { margin: 0 0 10px; }
.week-news time { color: var(--muted); }
.poll-week { border-left: 2px solid var(--ink); padding-left: 14px; margin-bottom: 18px; }
.poll-week p { margin: 0 0 6px; }
td.delta { color: var(--ink-2); }

/* ---------- biais des instituts : carte de chaleur divergente ---------- */
.heat td.cell { text-align: center; min-width: 4.5em; padding-left: 8px; padding-right: 8px;
  background: color-mix(in oklab, var(--div) var(--k), var(--surface)); border-left: 2px solid var(--surface); }
.heat td.cell.na { color: var(--baseline); }
.heat th.n { text-align: center; padding-left: 8px; padding-right: 8px; }
.heat th .tbl-cand { justify-content: center; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin: 12px 0 0; flex-wrap: wrap; }
.heat-legend .sw { width: 28px; height: 12px; border-radius: 2px; display: inline-block; }

/* ---------- préoccupations : barres appariées ---------- */
.pairs { display: grid; gap: 12px; }
.pair-row { display: grid; grid-template-columns: minmax(110px, 11em) 1fr; gap: 12px; align-items: center; }
.pair-label { font-size: 14px; line-height: 1.25; }
.pair-bars { display: grid; gap: 3px; }
.pair-line { display: flex; align-items: center; height: 14px; }
.pair-line .bar { height: 10px; border-radius: 0 3px 3px 0; }
.pair-line .bar-value { font-size: 12px; margin-left: 6px; }
.verdict-text { font-size: 14.5px; margin: 14px 0 0; }
.passages { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.passages .tag { margin-right: 4px; }
.align-head { display: flex; align-items: center; gap: 8px; }
.align-score { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.align-score strong { font: 600 44px/1 var(--serif); color: var(--ink); letter-spacing: -0.025em; margin-right: 3px; }

/* En-tête de section avec encadré à droite (état des données) */
.block-head-split { display: grid; grid-template-columns: minmax(0, 46em) minmax(0, 1fr); gap: 20px 56px; align-items: start; margin-bottom: 24px; }
.block-head-split .block-head { margin-bottom: 0; }
.status-note { border-left: 2px solid var(--ink); padding: 2px 0 2px 16px; font-size: 14px; line-height: 1.55; color: var(--ink-2); max-width: 30em; }
.status-note .eyebrow { color: var(--ink); margin-bottom: 8px; }
.status-note p { margin: 0 0 8px; }
.status-note strong { color: var(--ink); font-weight: 600; }
.status-note .status-meta { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- au même stade ---------- */
.compare-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 44px 36px; margin-top: 8px; }
.compare-absence { color: var(--ink-2); margin: 6px 0 12px; }
/* Phrase de synthèse : la conclusion à retenir, en romain */
.stage-summary { font: 400 20px/1.45 var(--serif); max-width: 38em; margin: 8px 0 28px; text-wrap: pretty; }
.stage-summary strong { font-weight: 600; }
.compare-facts { margin: 4px 0 12px; display: grid; gap: 10px; }
.compare-facts div { display: grid; grid-template-columns: 1fr; gap: 2px; }
.compare-facts dt { font-size: 12.5px; color: var(--muted); }
.compare-facts dd { margin: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.compare-p { color: var(--ink-2); font-size: 14px; }
.verdict { font-size: 14.5px; margin: 0 0 14px; padding-left: 26px; position: relative; }
.verdict::before { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; font: 700 11px/18px -apple-system, "Segoe UI Symbol", sans-serif; text-align: center; color: var(--page); }
.verdict.ok::before { content: "✓"; background: var(--ink-2); }
.verdict.ko::before { content: "✗"; background: var(--ink); }
.compare-chart { margin-top: 4px; }
.compare-chart .today { stroke: var(--ink); stroke-width: 1; }
.compare-chart .today-label { fill: var(--ink-2); font-size: 12px; }

/* ---------- historique ---------- */
.record td.ok::before, .record td.ko::before { font: 700 13px/1 -apple-system, "Segoe UI Symbol", sans-serif; margin-right: 4px; }
.record td.ok::before { content: "✓"; }
.record td.ko::before { content: "✗"; }
.events { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: 14px; }
.events time { color: var(--muted); font-variant-numeric: tabular-nums; display: inline-block; min-width: 9.5em; }

/* ---------- pied de page ---------- */
.site-footer { margin-top: 96px; border-top: 1px solid var(--rule-strong); padding: 28px 0 56px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; }
.footer-grid p { margin: 0 0 8px; }
.footer-brand { font: 600 18px/1.2 var(--serif); color: var(--ink); margin: 0 0 8px; }
.footer-title { font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.footer-meta { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--rule); }

/* ---------- bandeau de consentement : discret, non bloquant, refuser aussi simple qu'accepter ---------- */
.consent { position: fixed; z-index: 20; left: 16px; bottom: 16px; max-width: 400px; background: var(--raised); border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 12px; }
.consent-actions { display: flex; gap: 8px; }
.consent-btn { flex: 1; height: 36px; font: 600 14px/1 var(--sans); color: var(--ink); background: var(--raised); border: 1px solid var(--ink); border-radius: 4px; cursor: pointer; }
.consent-btn:hover { background: var(--ink); color: var(--page); }
.link-button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--baseline); text-underline-offset: 3px; }
.link-button:hover { text-decoration-color: currentColor; }

/* ---------- petits écrans ---------- */
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-panel { margin-top: 12px; }
  .week-grid { grid-template-columns: 1fr; }
  .block-head-split { grid-template-columns: 1fr; }
  .scenario-bar { grid-template-columns: 1fr; }
  .scenario-bar .scenario-note { grid-column: 1; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .site-header .wrap { flex-direction: column; gap: 0; min-height: 0; }
  .brand { padding: 14px 0 10px; }
  .site-nav { margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 10px); height: 44px; border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .hero { padding-top: 32px; }
  h2 { font-size: 24px; }
  .lede { font-size: 17px; }
  main > section, .block { margin-top: 56px; }
  .grid { gap: 40px; }
  .bar-row, .range-row, .range-axis { grid-template-columns: minmax(80px, 7em) 1fr; gap: 10px; }
  .pair-row { grid-template-columns: minmax(96px, 8.5em) 1fr; }
  .stage-summary { font-size: 18px; }
  .consent { left: 8px; right: 8px; bottom: 8px; max-width: none; }
}

@media print {
  .site-nav, .filters, .chart-controls, .scenario-bar, details.data summary, .consent { display: none; }
  .card, .tile { break-inside: avoid; }
  body { background: #fff; }
}
