/* ==========================================================================
   Usine à sites — feuille de base.
   Couleurs, polices et arrondis viennent des variables du thème de chaque site
   (voir engine/src/theme.mjs). Clair et sombre sont gérés ici une fois pour toutes.
   ========================================================================== */

:root {
  --accent: #0b6e4f;
  --bg: #fbfaf7;
  --surface: #fff;
  --ink: #1d1c1a;
  --muted: #5c5850;
  --line: #e7e2d9;
  --radius: 12px;
  --font-body: system-ui, sans-serif;
  --font-head: var(--font-body);
  --good: #1a7f37;
  --warn: #9a6700;
  --bad: #b42318;
  --info: #0b5cad;
  --warm: #c8553d;
  --cold: #2e86ab;
  --c2: #b45309;
  --c3: #2563eb;
  --ink-on-accent: #fff;
  --accent-soft: color-mix(in oklab, var(--accent) 9%, var(--surface));
  --accent-line: color-mix(in oklab, var(--accent) 30%, var(--line));
  --maxw: 70rem;
  --measure: 43rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark){
:root:not([data-theme="light"]){--good: #4ac26b;
    --warn: #d4a72c;
    --bad: #f47067;
    --info: #6cb6ff;
    --warm: #f08a70;
    --cold: #6cc0e0;
    --c2: #f0a04b;
    --c3: #7aa2ff;
    --ink-on-accent: #101214;}

}
:root[data-theme="dark"]{--good: #4ac26b;
    --warn: #d4a72c;
    --bad: #f47067;
    --info: #6cb6ff;
    --warm: #f08a70;
    --cold: #6cc0e0;
    --c2: #f0a04b;
    --c3: #7aa2ff;
    --ink-on-accent: #101214;}



*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.65 var(--font-body); text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.4vw, 2.7rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.6rem); letter-spacing: -0.01em; margin: 0 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; height: auto; }
ul, ol { padding-left: 1.25rem; }
small, .note, .meta { color: var(--muted); font-size: 0.875rem; }
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* En-tête */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; flex-wrap: wrap; padding-block: 0.8rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font: 700 1.15rem/1 var(--font-head); letter-spacing: -0.01em; }
.brand__mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: calc(var(--radius) * 0.6); background: var(--accent); color: var(--ink-on-accent); }
.brand__mark svg { width: 1.25rem; height: 1.25rem; }
.brand__letter { font-size: 1.05rem; }
.nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-block; padding: 0.25rem 0; color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav a:hover { color: var(--accent); text-decoration: underline; }

/* Corps de page */
main { padding-block: 1.25rem 3.5rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; list-style: none; margin: 0 0 1.25rem; padding: 0; font-size: 0.875rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 0.5rem; }
.crumbs a { color: var(--muted); }
.page-head { margin-bottom: 1.75rem; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: var(--measure); margin: 0.85rem 0 0; }
.block { margin-top: 2.5rem; }
.block > p, .block > ul, .block > ol, .prose, .lead { max-width: var(--measure); }
.lead { font-size: 1.06rem; }
.prose h2 { margin-top: 2.25rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin: 0.3rem 0; }
.prose blockquote { margin: 1.25rem 0; padding: 0.25rem 0 0.25rem 1rem; border-left: 3px solid var(--accent-line); color: var(--muted); }

/* Chiffres clés */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 0.75rem; margin: 1.25rem 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.tile__label { font-size: 0.8rem; color: var(--muted); }
.tile__value { font: 700 1.65rem/1.2 var(--font-head); font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.tile__unit { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.tile__note { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.tile--good .tile__value { color: var(--good); }
.tile--warn .tile__value { color: var(--warn); }
.tile--bad .tile__value { color: var(--bad); }
.tile--accent { border-color: var(--accent-line); background: var(--accent-soft); }

/* Tableaux */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 0.7rem 0.9rem; font-weight: 600; border-bottom: 1px solid var(--line); }
th, td { padding: 0.55rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; background: color-mix(in oklab, var(--bg) 60%, var(--surface)); }
tbody th { font-weight: 600; }
.num { text-align: right; white-space: nowrap; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1.5rem; margin: 1rem 0; }
.facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Encadrés */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--surface); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1.25rem 0; max-width: var(--measure); }
.callout--good { border-left-color: var(--good); }
.callout--warn { border-left-color: var(--warn); }
.callout--bad { border-left-color: var(--bad); }
.callout__title { font-weight: 700; margin: 0 0 0.25rem; }
.callout > div > :last-child { margin-bottom: 0; }

/* Graphiques */
.chart { margin: 1.25rem 0; max-width: 46rem; }
.chart svg { display: block; width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__axis { stroke: var(--muted); stroke-width: 1; }
.chart__tick, .chart__x { fill: var(--muted); font: 12px var(--font-body); }
.chart__col { fill: color-mix(in oklab, var(--accent) 55%, var(--surface)); }
.chart__col.is-hi { fill: var(--accent); }
.chart__line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke: var(--accent); }
.chart__dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.chart__line--2 { stroke: var(--c2); } .chart__dot--2 { fill: var(--c2); }
.chart__line--3 { stroke: var(--c3); } .chart__dot--3 { fill: var(--c3); }
.chart__line--warm { stroke: var(--warm); } .chart__dot--warm { fill: var(--warm); }
.chart__line--cold { stroke: var(--cold); } .chart__dot--cold { fill: var(--cold); }
.chart__legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0; }
.chart__key::before { content: ""; display: inline-block; width: 0.9rem; height: 0.22rem; border-radius: 2px; margin-right: 0.4rem; vertical-align: middle; background: var(--accent); }
.chart__key--2::before { background: var(--c2); }
.chart__key--3::before { background: var(--c3); }
.chart__key--warm::before { background: var(--warm); }
.chart__key--cold::before { background: var(--cold); }

.bars { display: grid; gap: 0.4rem; }
.bars__row { display: grid; grid-template-columns: minmax(6rem, 12rem) 1fr auto; gap: 0.75rem; align-items: center; font-size: 0.95rem; }
.bars__track { height: 0.8rem; background: color-mix(in oklab, var(--line) 70%, transparent); border-radius: 99px; overflow: hidden; }
.bars__fill { display: block; height: 100%; background: color-mix(in oklab, var(--accent) 50%, var(--surface)); border-radius: 99px; }
.bars__row.is-hi .bars__fill { background: var(--accent); }
.bars__row.is-hi .bars__label { font-weight: 700; }
.bars__value { font-variant-numeric: tabular-nums; white-space: nowrap; }

.scale { position: relative; margin: 2.8rem 0 1.25rem; max-width: 46rem; }
.scale__track { display: flex; height: 2.1rem; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.scale__seg { display: grid; place-items: center; min-width: 0; font-size: 0.78rem; font-weight: 600; background: color-mix(in oklab, var(--muted) 16%, var(--surface)); }
.scale__seg + .scale__seg { border-left: 1px solid var(--surface); }
.scale__seg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 0.4rem; max-width: 100%; }
.scale__seg--good { background: color-mix(in oklab, var(--good) 26%, var(--surface)); }
.scale__seg--warn { background: color-mix(in oklab, var(--warn) 30%, var(--surface)); }
.scale__seg--bad { background: color-mix(in oklab, var(--bad) 28%, var(--surface)); }
.scale__marker { position: absolute; top: -1.9rem; transform: translateX(-50%); display: grid; justify-items: center; z-index: 1; }
.scale__marker b { background: var(--ink); color: var(--bg); font-size: 0.82rem; padding: 0.12rem 0.5rem; border-radius: 6px; white-space: nowrap; }
.scale__marker::after { content: ""; width: 2px; height: 2.6rem; background: var(--ink); margin-top: 2px; }

/* Cartes et listes de liens */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; list-style: none; margin: 1rem 0; padding: 0; }
.card a { display: grid; gap: 0.25rem; height: 100%; align-content: start; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.card a:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgb(0 0 0 / 0.06); }
.card__title { font-weight: 650; color: var(--accent); }
.card__text { font-size: 0.9rem; color: var(--muted); }
.card__meta { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.linklist { list-style: none; margin: 0.5rem 0 1rem; padding: 0; columns: 14rem auto; column-gap: 1.5rem; }
.linklist li { break-inside: avoid; padding: 0.18rem 0; }
.alpha__nav { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 1rem 0; }
.alpha__nav a { display: grid; place-items: center; min-width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; font-weight: 600; }
.alpha h3 { border-bottom: 1px solid var(--line); padding-bottom: 0.25rem; }

/* Offres partenaires */
.offers { margin: 2.5rem 0; padding: 1.25rem; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); }
.offers > p { max-width: var(--measure); }
.offers__list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.offer { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.offer__body { flex: 1 1 18rem; min-width: 0; }
.offer__title { font-weight: 700; margin: 0; }
.offer__pitch { margin: 0.2rem 0 0; font-size: 0.95rem; color: var(--muted); }
.offer__facts { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; }
.btn { display: inline-flex; flex-direction: column; align-items: center; gap: 0.05rem; background: var(--accent); color: var(--ink-on-accent); text-decoration: none; font-weight: 650; padding: 0.6rem 1.1rem; border-radius: calc(var(--radius) * 0.75); line-height: 1.25; text-align: center; }
.btn:hover { background: color-mix(in oklab, var(--accent) 86%, black); }
.btn__sub { font-size: 0.75rem; font-weight: 500; opacity: 0.9; }
.disclosure { font-size: 0.8rem; color: var(--muted); margin: 1rem 0 0; }

/* Questions fréquentes, sources, maillage, sommaire */
.faq { max-width: var(--measure); margin: 1rem 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 0.2rem 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 0.6rem 0; }
.faq__a { padding: 0 0 0.6rem; }
.sources { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }
.sources h2 { font-size: 1.05rem; color: var(--ink); }
.related { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: grid; gap: 1.5rem; }
.related h2 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; max-width: var(--measure); margin: 0 0 1.5rem; }
.toc__title { font-weight: 700; margin: 0 0 0.25rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }

/* Recherche */
.search { margin: 1.5rem 0; max-width: 34rem; }
.search label { display: block; font-weight: 650; margin-bottom: 0.35rem; }
.search__field { position: relative; }
.search input { width: 100%; font: inherit; padding: 0.75rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.search__results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 0.3rem); list-style: none; margin: 0; padding: 0.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / 0.12); }
.search__results a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.7rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search__results a:hover, .search__results a:focus { background: var(--accent-soft); }
.search__results span { color: var(--muted); font-size: 0.85rem; }
.search__empty { padding: 0.5rem 0.7rem; color: var(--muted); }
.search__browse { font-size: 0.9rem; color: var(--muted); margin: 0.5rem 0 0; }

/* Pied de page */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 2.25rem 1.5rem; font-size: 0.92rem; }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.5rem 2rem; }
.site-footer__about { color: var(--muted); }
.site-footer__name { font: 700 1.05rem var(--font-head); color: var(--ink); margin: 0 0 0.4rem; }
.site-footer h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 0.15rem 0; }
.site-footer a { color: var(--ink); }
.site-footer__legal { margin: 1.75rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }

@media (max-width: 34rem) {
  .bars__row { grid-template-columns: 1fr auto; }
  .bars__track { grid-column: 1 / -1; grid-row: 2; }
}
@media print {
  .site-header, .site-footer, .related, .search, .offers { display: none; }
}

/* Bouton jour / nuit */
.theme-toggle { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; transition: rotate 0.4s ease, background 0.2s ease; }
.theme-toggle:hover { rotate: 20deg; }
.theme-toggle svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle__soleil { display: none; }
@media (prefers-color-scheme: dark){
:root:not([data-theme="light"]) .theme-toggle__soleil{display: block;}
:root:not([data-theme="light"]) .theme-toggle__lune{display: none;}

}
:root[data-theme="dark"] .theme-toggle__soleil{display: block;}
:root[data-theme="dark"] .theme-toggle__lune{display: none;}



:root[data-theme="dark"]{color-scheme:dark}
:root[data-theme="light"]{color-scheme:light}
:root{--accent:#8a5200;--bg:#f2f0eb;--surface:#faf9f6;--ink:#16181b;--muted:#5a5e65;--line:#d5d2ca;--radius:3px;--font-body:Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;--font-head:"DIN Alternate", Bahnschrift, "sans-serif-condensed", "Roboto Condensed", "Arial Narrow", sans-serif}
@media (prefers-color-scheme: dark){
:root:not([data-theme="light"]){--accent:#ffb224;--bg:#0e1012;--surface:#15181b;--ink:#eceae5;--muted:#9a9ea6;--line:#2a2e33}
}
:root[data-theme="dark"]{--accent:#ffb224;--bg:#0e1012;--surface:#15181b;--ink:#eceae5;--muted:#9a9ea6;--line:#2a2e33}

/* Wattologie : habillage du site (s'ajoute à la feuille de base du moteur).
   Parti pris : la plaque signalétique et le schéma électrique. Des filets fins, des chiffres
   en capitales étroites, une seule couleur vive, l'ambre, réservée à l'énergie en réserve.
   Règle de mouvement : rien ne bouge sans courant. La page est immobile tant que le visiteur
   n'a pas lancé une coupure ; ce qui bouge alors représente une grandeur réelle. */

:root {
  --ambre: #f5a400;
  --ambre-2: #ffc34d;
  --ambre-3: #d48600;
  --trait: color-mix(in oklab, var(--ink) 82%, var(--bg));
  --filet: color-mix(in oklab, var(--ink) 18%, var(--bg));
  --creux: color-mix(in oklab, var(--ink) 7%, var(--surface));
  --font-chiffre: var(--font-head);
  --maxw: 72rem;
}
@media (prefers-color-scheme: dark){
:root:not([data-theme="light"]){--ambre: #ffb224;
    --ambre-2: #ffd27a;
    --ambre-3: #e0931a;}

}
:root[data-theme="dark"]{--ambre: #ffb224;
    --ambre-2: #ffd27a;
    --ambre-3: #e0931a;}



/* ---- La coupure : la page passe dans le noir, seul le schéma reste éclairé ---- */
html.est-coupure {
  --bg: #08090a;
  --surface: #101214;
  --ink: #e9e7e2;
  --muted: #8c9098;
  --line: #24282d;
  --accent: #ffb224;
  --ambre: #ffb224;
  --ambre-2: #ffd27a;
  --ambre-3: #e0931a;
  color-scheme: dark;
}
@media (prefers-reduced-motion: no-preference) {
  body, .site-header, .site-footer, .sch__plaque, .sch__case { transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, fill 0.5s ease, stroke 0.5s ease; }
}

/* ---- Typographie ---- */
body { font-size: 1.0625rem; line-height: 1.62; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; }
h1 { font-size: clamp(2rem, 1.25rem + 3.4vw, 3.5rem); line-height: 1.02; letter-spacing: 0.005em; text-transform: uppercase; max-width: 20ch; }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem); letter-spacing: 0.01em; }
.lede { font-size: 1.15rem; line-height: 1.5; color: var(--ink); max-width: 38rem; margin-top: 1rem; }
a { text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.etiquette { font: 700 0.72rem/1.2 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0; }

/* ---- En-tête et pied ---- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--trait); }
.brand { text-transform: uppercase; letter-spacing: 0.06em; font-size: 1.02rem; }
.brand__mark { border-radius: 2px; background: var(--ink); color: var(--ambre); }
.brand__mark svg { width: 1.45rem; height: 1.45rem; }
.nav a { font: 700 0.78rem/1 var(--font-head); letter-spacing: 0.13em; text-transform: uppercase; }
.nav a:hover { text-decoration: none; color: var(--ink); box-shadow: 0 2px 0 var(--ambre); }
.theme-toggle { border-radius: 2px; border-color: var(--filet); background: transparent; }
.theme-toggle:hover { rotate: none; border-color: var(--trait); }
.crumbs ol { font: 600 0.74rem/1.3 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; }
.page-head { margin-bottom: 2rem; }
.site-footer { background: var(--bg); border-top: 1px solid var(--trait); }
.site-footer__name { text-transform: uppercase; letter-spacing: 0.06em; }
main { padding-top: 1.5rem; }

/* ---- Bouton : un interrupteur, pas une pastille ---- */
.bouton { display: inline-flex; align-items: center; gap: 0.7rem; white-space: nowrap; font: 700 0.9rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bg); background: var(--ink); border: 1px solid var(--ink); border-radius: 2px; padding: 0.85rem 1.15rem 0.85rem 0.85rem; cursor: pointer; }
.bouton::before { content: ""; width: 1.9rem; height: 1rem; border-radius: 1rem; background: radial-gradient(circle at 1.4rem 50%, var(--ambre) 0 0.33rem, transparent 0.36rem), color-mix(in oklab, var(--bg) 22%, var(--ink)); }
.est-coupure .bouton::before { background: radial-gradient(circle at 0.5rem 50%, var(--muted) 0 0.33rem, transparent 0.36rem), color-mix(in oklab, var(--bg) 22%, var(--ink)); }
.bouton:hover { background: color-mix(in oklab, var(--ink) 88%, var(--ambre)); }
.bouton:disabled { opacity: 0.4; cursor: not-allowed; }
.lien-fleche { font: 700 0.82rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--ambre); padding-bottom: 0.25rem; }
.lien-fleche::after { content: " →"; }

/* ---- Simulateur : disposition ---- */
.sim { display: grid; gap: 1.75rem; grid-template-areas: "resultat" "schema" "reglages" "detail" "besoin"; }
.sim__reglages { grid-area: reglages; display: grid; gap: 1.5rem; align-content: start; }
.sim__schema { grid-area: schema; }
.sim__resultat { grid-area: resultat; }
.sim__detail { grid-area: detail; }
.sim__besoin { grid-area: besoin; }
@media (min-width: 44rem) {
  .sim { grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem); grid-template-areas: "resultat schema" "reglages schema" "detail schema" "besoin schema"; align-items: start; column-gap: 2.5rem; }
  .sim__schema { position: sticky; top: 1rem; }
}
@media (min-width: 68rem) {
  .sim { grid-template-columns: minmax(16rem, 20rem) minmax(20rem, 25rem) minmax(17rem, 1fr); grid-template-areas: "reglages schema resultat" "reglages schema detail" "reglages schema besoin"; grid-template-rows: auto auto 1fr; }
}

/* ---- Simulateur : réglages ---- */
.sim__bloc { border: 0; border-top: 2px solid var(--trait); margin: 0; padding: 0.9rem 0 0; min-width: 0; }
.sim__bloc legend { font: 700 0.72rem/1.2 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); padding: 0 0.6rem 0 0; float: left; width: 100%; margin-bottom: 0.9rem; }
.sim__bloc legend + * { clear: both; }
.champ { display: grid; gap: 0.35rem; font-size: 0.95rem; }
.champ__nom { font: 600 0.78rem/1.2 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.champ--regle { grid-template-columns: 1fr auto; align-items: baseline; }
.champ--regle input[type="range"], .champ__echelle { grid-column: 1 / -1; }
.champ__val { font: 700 1.05rem/1 var(--font-head); }
.champ__nombre { width: 5.2rem; font: 700 1.5rem/1 var(--font-head); text-align: right; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--filet); padding: 0 0 0.1rem; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.champ__nombre::-webkit-outer-spin-button, .champ__nombre::-webkit-inner-spin-button, .app__reglages input::-webkit-outer-spin-button, .app__reglages input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.1rem; }
.sim select { font: 600 1rem/1.2 var(--font-head); color: var(--ink); background: var(--surface); border: 1px solid var(--filet); border-radius: 2px; padding: 0.45rem 0.5rem; width: 100%; }
.sim select:focus-visible, .sim input:focus-visible { outline: 2px solid var(--ambre); outline-offset: 2px; }

/* La capacité se règle sur une règle graduée : un cran par taille courante du marché. */
.sim input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.6rem; margin: 0.4rem 0 0; background: linear-gradient(var(--trait), var(--trait)) center / 100% 2px no-repeat, repeating-linear-gradient(to right, var(--trait) 0 1px, transparent 1px calc((100% - 1px) / 8)) center / 100% 0.7rem no-repeat; cursor: pointer; }
.sim input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 0.85rem; height: 1.6rem; background: var(--ambre); border: 1px solid var(--ink); border-radius: 1px; }
.sim input[type="range"]::-moz-range-thumb { width: 0.85rem; height: 1.6rem; background: var(--ambre); border: 1px solid var(--ink); border-radius: 1px; }
.champ__echelle { display: flex; justify-content: space-between; font: 600 0.66rem/1 var(--font-head); color: var(--muted); letter-spacing: 0.02em; }
.champ__echelle span { width: 0; display: flex; justify-content: center; white-space: nowrap; }

.groupe + .groupe { margin-top: 1.1rem; }
.groupe__nom { font: 600 0.72rem/1.2 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.3rem; }
.groupe__liste { list-style: none; margin: 0; padding: 0; }
.app { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; border-bottom: 1px solid var(--filet); min-height: 2.6rem; }
.app__choix { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 auto; min-width: 0; cursor: pointer; padding: 0.3rem 0; }
.app__choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.app__icone { flex: none; width: 1.9rem; height: 1.9rem; padding: 0.22rem; border: 1px solid var(--filet); border-radius: 2px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.app__nom { font-size: 0.95rem; line-height: 1.25; color: var(--muted); }
.app.est-coche .app__icone { background: var(--ambre); border-color: var(--ink); stroke: #16181b; }
.app.est-coche .app__nom { color: var(--ink); font-weight: 600; }
.app__choix:hover .app__icone { border-color: var(--trait); }
.app__choix input:focus-visible + .app__icone { outline: 2px solid var(--ambre); outline-offset: 2px; }
.app__reglages { display: none; align-items: baseline; gap: 0.25rem; font: 600 0.85rem/1 var(--font-head); color: var(--muted); white-space: nowrap; }
.app.est-coche .app__reglages { display: inline-flex; }
.app__reglages input { font: 700 0.95rem/1 var(--font-head); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--filet); text-align: right; padding: 0.1rem 0; -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.app__q { width: 1.5rem; }
.app__w { width: 2.9rem; }

/* ---- Simulateur : résultat ---- */
.sim__duree { font: 700 clamp(3.4rem, 2rem + 7vw, 5.6rem)/0.95 var(--font-head); letter-spacing: -0.01em; margin: 0.35rem 0 0.5rem; font-variant-numeric: tabular-nums; }
.sim__arret { margin: 0; font-size: 1rem; }
.sim__commandes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.25rem; }
.sim__horloge { margin: 0; font: 600 0.95rem/1.3 var(--font-head); letter-spacing: 0.02em; }
.sim__horloge b { color: var(--accent); font-size: 1.15rem; }
.mesures { margin: 0; border-top: 2px solid var(--trait); }
.mesures > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--filet); }
.mesures dt { font-size: 0.92rem; color: var(--muted); }
.mesures dd { margin: 0; font: 700 1.05rem/1 var(--font-head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.alerte { margin: 0.9rem 0 0; padding: 0.7rem 0.9rem; border-left: 3px solid var(--bad); background: color-mix(in oklab, var(--bad) 8%, var(--surface)); font-size: 0.95rem; }
.sim__lecture { margin: 1rem 0 0; font-size: 1rem; }
.besoin { font-size: 0.95rem; border-top: 2px solid var(--trait); margin-top: 0.6rem; }
.besoin th, .besoin td { padding: 0.5rem 0; border-bottom: 1px solid var(--filet); background: transparent; }
.besoin thead th { font: 600 0.72rem/1.2 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; }
.besoin td { font: 700 1.05rem/1 var(--font-head); }

/* Frise de la coupure : la réserve qui descend, heure par heure. */
.frise { position: relative; height: 3.9rem; margin: 1.1rem 0 0; container-type: inline-size; }
/* Frise étroite : une graduation sur deux, et jamais d'étiquette collée à l'heure de l'arrêt. */
@container (max-width: 26rem) {
  .frise__heures li:nth-child(even):not(.frise__fin), .frise__heures li:nth-last-child(2):not(:first-child) { display: none; }
}
.frise__courbe { position: absolute; inset: 0 0 auto 0; width: 100%; height: 2.2rem; background: var(--creux); }
.frise__courbe polygon { fill: var(--ambre); }
/* Le curseur de la frise : le visiteur avance lui-même dans la coupure, à son rythme. */
.sim .frise .frise__temps { position: absolute; top: -0.4rem; left: -0.45rem; width: calc(100% + 0.9rem); height: 2.95rem; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: ew-resize; }
.sim .frise .frise__temps::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.sim .frise .frise__temps::-moz-range-track { height: 100%; background: transparent; }
.sim .frise .frise__temps::-webkit-slider-thumb { -webkit-appearance: none; width: 0.9rem; height: 2.95rem; border: 0; border-radius: 0; background: linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat, linear-gradient(var(--ink), var(--ink)) center top / 100% 0.4rem no-repeat; }
.sim .frise .frise__temps::-moz-range-thumb { width: 0.9rem; height: 2.95rem; border: 0; border-radius: 0; background: linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat, linear-gradient(var(--ink), var(--ink)) center top / 100% 0.4rem no-repeat; }
.sim .frise .frise__temps:focus-visible { outline: 2px solid var(--ambre); outline-offset: 3px; }
.frise__heures { list-style: none; margin: 0; padding: 0; position: absolute; top: 2.75rem; left: 0; right: 0; font: 600 0.74rem/1 var(--font-head); color: var(--muted); letter-spacing: 0.03em; }
.frise__heures li { position: absolute; translate: -50% 0; white-space: nowrap; }
.frise__heures li::before { content: ""; position: absolute; left: 50%; top: -0.5rem; width: 1px; height: 0.32rem; background: var(--muted); }
.frise__heures li:first-child { translate: 0 0; }
.frise__heures li:first-child::before { left: 0; }
.frise__heures li.frise__fin { translate: -100% 0; }
.frise__heures li.frise__fin::before { left: auto; right: 0; }
.frise__heures b { color: var(--ink); font-size: 0.82rem; }

/* ---- Le schéma ---- */
.sch { display: block; width: 100%; height: auto; font-family: var(--font-head); }
.sch text { fill: var(--ink); }
.sch__plaque { fill: var(--surface); stroke: var(--trait); stroke-width: 1; }
.sch__label { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--muted) !important; }
.sch__gros { font-size: 23px; font-weight: 700; }
.sch__utile { font-size: 10.5px; text-anchor: end; fill: var(--muted) !important; }
.sch__niveau { font-size: 17px; font-weight: 700; text-anchor: end; font-variant-numeric: tabular-nums; }
.sch__reserve-fond, .sch__jauge, .sch__hachure-fond { fill: var(--creux); }
/* La réserve se vide en proportion : la barre se réduit vers la gauche, chaque part avec elle. */
.sch__reserve { transform-box: fill-box; transform-origin: left center; transform: scaleX(var(--niveau, 1)); }
/* Part d'énergie non restituée : hachurée dans la batterie, en pointillé jusqu'à la terre de l'onduleur. */
.sch__part.sch__part--perdu { fill: url(#sch-hachure); }
.sch__hachure { stroke: var(--muted); stroke-width: 1.5; }
.sch__fil.sch__fil--perdu { stroke: color-mix(in oklab, var(--muted) 60%, var(--surface)); stroke-dasharray: 2 2.5; }
.sch__terre { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.sch__ton0 { --ton: var(--ambre); }
.sch__ton1 { --ton: var(--ambre-2); }
.sch__ton2 { --ton: var(--ambre-3); }
.sch__part { fill: var(--ton); }
.sch__fil { fill: none; stroke: var(--ton); stroke-linejoin: round; }
.sch__flux { fill: none; stroke: none; }
.sch__case { fill: var(--surface); stroke: var(--trait); stroke-width: 1; }
.sch__icone { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sch__nom { font-size: 13px; font-weight: 700; }
.sch__sous { font-size: 10.5px; fill: var(--muted) !important; }
.sch__pct { font-size: 13px; font-weight: 700; text-anchor: end; font-variant-numeric: tabular-nums; }
.sch__val { font-size: 11px; font-weight: 600; }
.sch__val--fin { text-anchor: end; }
.sch__jauge-val { fill: var(--ink); }
.sch__jauge-val.est-trop { fill: var(--bad); }
.sch__vide { font-size: 12px; text-anchor: middle; fill: var(--muted) !important; }

/* Pendant la coupure : un fil parcouru de tirets est un appareil en marche (la largeur du fil dit
   sa puissance, le mouvement dit seulement « allumé »), un appareil à l'arrêt entre deux cycles se
   grise, et tout s'éteint quand la réserve est vide. */
.sch__voie.est-coupe .sch__fil { stroke: var(--filet); }
.sch__voie.est-coupe .sch__icone, .sch.est-eteint .sch__icone { stroke: var(--muted); }
.sch.est-eteint .sch__fil:not(.sch__fil--perdu) { stroke: var(--filet); }
.sch.est-eteint .sch__nom, .sch.est-eteint .sch__pct { fill: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .sch.est-en-marche .sch__voie:not(.est-coupe) .sch__flux { stroke: var(--surface); stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 2.5 9.5; opacity: 0.9; animation: flux 0.8s linear infinite; }
  .sch.est-fige .sch__flux { animation-play-state: paused !important; }
  .sch__voie.est-nouveau .sch__fil { stroke-dasharray: 640; stroke-dashoffset: 640; animation: trace 0.55s ease-out forwards; }
  .sch__voie.est-nouveau :is(.sch__case, .sch__icone, text) { opacity: 0; animation: paraitre 0.2s 0.42s forwards; }
  @keyframes flux { to { stroke-dashoffset: -12; } }
  @keyframes trace { to { stroke-dashoffset: 0; } }
  @keyframes paraitre { to { opacity: 1; } }
}

/* Survol d'un appareil : son fil et sa part de la réserve ressortent, le reste s'efface. */
.sch.est-vise [data-voie]:not(.est-la-voie) { opacity: 0.28; }
.sch [data-voie] { transition: opacity 0.15s ease; }

/* Rappel de la durée, en bas de l'écran du téléphone, quand le résultat est sorti de la vue. */
.sim__resume { grid-column: 1 / -1; position: sticky; bottom: 0.6rem; z-index: 3; display: none; align-items: baseline; gap: 0.7rem; margin: 0; padding: 0.6rem 0.9rem; background: var(--ink); color: var(--bg); border-radius: 2px; font: 600 0.85rem/1.2 var(--font-head); letter-spacing: 0.04em; }
.sim__resume b { font-size: 1.35rem; color: var(--ambre); font-variant-numeric: tabular-nums; }
.sim--compact .sim__resume { display: none !important; }
@media (max-width: 43.99rem) {
  .sim__resume.est-utile { display: flex; }
}

/* ---- Accueil : le simulateur en vitrine, sans la liste des réglages ---- */
.sim--compact { grid-template-areas: "resultat" "schema"; }
.sim--compact .sim__reglages, .sim--compact .sim__besoin, .sim--compact .sim__detail { display: none; }
@media (min-width: 44rem) {
  .sim--compact { grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem); grid-template-areas: "resultat schema"; }
  .sim--compact .sim__schema { position: static; }
}
.kind-home .page-head { margin-bottom: 1.5rem; }
/* Sur grand écran, le schéma monte à hauteur du titre : la page d'accueil est une seule composition. */
@media (min-width: 60rem) {
  .kind-home article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem); column-gap: 3rem; align-items: start; }
  .kind-home .page-head { grid-column: 1; grid-row: 1; }
  .kind-home .sim--compact { display: contents; }
  .kind-home .sim__resultat { grid-column: 1; grid-row: 2; }
  .kind-home .sim__schema { grid-column: 2; grid-row: 1 / span 2; margin-top: 0.4rem; }
}


/* Le calcul posé comme sur une feuille : libellé, opération, résultat. */
.sim__calcul-titre { margin-top: 1.6rem; }
.calcul { margin: 0.6rem 0 0; border-top: 2px solid var(--trait); font-size: 0.92rem; }
.calcul > div { padding: 0.55rem 0; border-bottom: 1px solid var(--filet); }
.calcul dt { font: 600 0.72rem/1.2 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.calcul dd { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.2rem 1rem; font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.calcul dd span { color: var(--muted); }
.calcul dd b { font-size: 1.05rem; white-space: nowrap; margin-left: auto; }

/* ---- Pages de texte : sommaire, intertitres numérotés, formule, tableaux ---- */
.toc { background: transparent; border: 0; border-top: 2px solid var(--trait); border-radius: 0; padding: 0.85rem 0 0; margin-bottom: 2.5rem; }
.toc__title { font: 700 0.72rem/1.2 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5rem; }
.toc ol { list-style: none; padding: 0; counter-reset: sommaire; columns: 2 15rem; column-gap: 2rem; }
.toc li { counter-increment: sommaire; padding: 0.18rem 0; break-inside: avoid; }
.toc li::before { content: counter(sommaire) "."; font: 700 0.9rem/1 var(--font-head); color: var(--accent); margin-right: 0.5rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--ambre); }
.prose { counter-reset: intertitre; }
.prose h2 { counter-increment: intertitre; margin-top: 3rem; padding-top: 0.95rem; border-top: 1px solid var(--filet); }
.prose h2::before { content: counter(intertitre) "."; color: var(--accent); margin-right: 0.45rem; }
.prose blockquote { border-left: 3px solid var(--ambre); color: var(--ink); font: 600 1.12rem/1.4 var(--font-head); letter-spacing: 0.01em; padding: 0.55rem 0 0.55rem 1rem; margin: 1.4rem 0; }
.prose blockquote p { margin: 0; }
.prose strong { font-weight: 700; }
.table-wrap { border-radius: 2px; border-color: var(--trait); max-width: none; }
caption { font: 700 0.72rem/1.2 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; }
thead th { font: 700 0.68rem/1.2 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; }
td.num { font: 600 0.95rem/1.3 var(--font-head); }
.suite { margin-top: 4rem; }

/* ---- Fiche du site : des lignes libellé / texte, comme sur une plaque signalétique ---- */
.fiche { margin-top: 4.5rem; padding-top: 1.1rem; border-top: 2px solid var(--trait); }
.fiche h2 { margin-bottom: 1.2rem; }
.fiche__lignes { margin: 0 0 1.8rem; }
.fiche__lignes > div { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 44rem); gap: 0.3rem 2rem; padding: 0.95rem 0; border-top: 1px solid var(--filet); }
.fiche__lignes > div:last-child { border-bottom: 1px solid var(--filet); }
.fiche__lignes dt { font: 700 0.78rem/1.5 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; }
.fiche__lignes dd { margin: 0; }
.fiche__lignes dd b { font-weight: 700; }
@media (max-width: 40rem) { .fiche__lignes > div { grid-template-columns: 1fr; } }
@media (min-width: 60rem) { .kind-home .fiche { grid-column: 1 / -1; } }

/* Le tableau des sources déborde de la colonne de texte : il a besoin de toute la largeur de la page. */
.prose .table-wrap { width: min(70rem, calc(100vw - 2 * clamp(1rem, 4vw, 2rem))); max-width: none; }
.prose td .note { display: block; margin-top: 0.3rem; font-size: 0.82rem; }
.prose td, .prose tbody th { font-size: 0.92rem; }

/* ---- Pages par besoin : la phrase à nombres ----
   Une phrase rédigée, en grand, dont le visiteur règle les nombres. Les résultats sont posés sur
   une plaquette d'ambre (l'énergie en réserve) ; les nombres réglables portent un filet sombre. */
.phrase { margin: 2.2rem 0 2.6rem; padding: 1.5rem 0 1.25rem; border-top: 2px solid var(--trait); border-bottom: 1px solid var(--filet); max-width: none; }
.phrase__texte { font: 600 clamp(1.3rem, 1rem + 1.55vw, 1.95rem)/1.5 var(--font-head); letter-spacing: 0.005em; margin: 0; max-width: 46rem; font-variant-numeric: tabular-nums; }
.nb { white-space: nowrap; font-weight: 700; }
.res { white-space: nowrap; font-weight: 700; color: #16181b; background: var(--ambre); padding: 0.02em 0.32em 0.06em; border-radius: 2px; }
.nb__champ { font: inherit; color: var(--ink); background: var(--creux); border: 0; border-bottom: 2px solid var(--ink); border-radius: 2px 2px 0 0; padding: 0 0.12em; margin: 0; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.nb__champ::-webkit-outer-spin-button, .nb__champ::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select.nb__champ { -webkit-appearance: none; appearance: none; text-align: left; cursor: pointer; padding-right: 1em; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(-45deg, transparent 50%, var(--ink) 50%); background-position: calc(100% - 0.55em) 55%, calc(100% - 0.3em) 55%; background-size: 0.26em 0.26em; background-repeat: no-repeat; }
.nb__champ:hover { background-color: color-mix(in oklab, var(--ambre) 22%, var(--surface)); }
.nb__champ:focus-visible { outline: 2px solid var(--ambre); outline-offset: 2px; }
.phrase__suite { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem 1.5rem; margin: 1.1rem 0 0; }
.phrase__aide { font-size: 0.92rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  /* Le résultat que le geste du visiteur vient de changer se souligne un instant. */
  .res.est-change { animation: change 0.7s ease-out; }
  @keyframes change { from { box-shadow: 0 0.2em 0 0 var(--ink); } to { box-shadow: 0 0.2em 0 0 transparent; } }
}

/* ---- Pages par besoin : l'abaque (durée tenue selon la capacité de la station) ---- */
.abaque { margin: 1.8rem 0 2.2rem; max-width: none; }
.abaque__dessin { max-width: 35rem; }
.aba { display: block; width: 100%; height: auto; font-family: var(--font-head); overflow: visible; }
.aba text { fill: var(--muted); font-size: 10px; font-weight: 600; }
.aba__grille { stroke: var(--filet); stroke-width: 1; }
.aba__cadre { fill: none; stroke: var(--trait); stroke-width: 1.2; }
.aba__grad--y { text-anchor: end; }
.aba__grad--x { text-anchor: middle; }
.aba text.aba__axe { text-anchor: end; font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.aba__regime { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.aba__pt { fill: var(--ink); }
.aba text.aba__nom { fill: var(--ink); font-size: 10.5px; font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.aba__moi { fill: none; stroke: var(--ambre); stroke-width: 5; stroke-linecap: round; }
.aba__guide { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 2.5; }
.aba__moi-pt { fill: var(--ambre); stroke: var(--ink); stroke-width: 1.5; }
.aba text.aba__moi-val { fill: var(--ink); font-size: 13.5px; font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 3.5px; stroke-linejoin: round; }
.abaque__legende { list-style: none; padding: 0; margin: 0.9rem 0 1.3rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; font: 600 0.82rem/1.3 var(--font-head); letter-spacing: 0.02em; }
.prose .abaque__legende li { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.aba__ech { width: 1.9rem; height: 0.5rem; flex: none; overflow: visible; }
.prose .abaque .table-wrap { width: auto; max-width: 46rem; }
.abaque tbody th .note { display: block; font-weight: 400; }
.abaque td.num { white-space: nowrap; }
.abaque__ligne-moi > * { background: color-mix(in oklab, var(--ambre) 18%, var(--surface)); }

/* ---- Pages par besoin : la plaque de vérification (ce qu'on lit sur la fiche d'une station) ---- */
.plaque { margin: 2rem 0; max-width: 40rem; padding: 1.15rem 1.4rem 0.35rem; border: 1px solid var(--trait); border-radius: 3px; background-color: var(--surface);
  background-image: radial-gradient(circle at 11px 11px, var(--muted) 0 2px, transparent 2.6px), radial-gradient(circle at calc(100% - 11px) 11px, var(--muted) 0 2px, transparent 2.6px), radial-gradient(circle at 11px calc(100% - 11px), var(--muted) 0 2px, transparent 2.6px), radial-gradient(circle at calc(100% - 11px) calc(100% - 11px), var(--muted) 0 2px, transparent 2.6px); }
.prose .plaque__titre { font: 700 0.8rem/1.3 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; margin: 0 1.2rem 0.85rem; text-align: center; }
.plaque__lignes { margin: 0; }
.plaque__lignes > div { display: grid; grid-template-columns: minmax(7.5rem, 11.5rem) minmax(0, 1fr); gap: 0.15rem 1.3rem; padding: 0.7rem 0; border-top: 1px solid var(--filet); }
.plaque dt { font: 600 0.74rem/1.5 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.plaque dd { margin: 0; }
.plaque dd b { display: block; font: 700 1.12rem/1.3 var(--font-head); font-variant-numeric: tabular-nums; }
.plaque dd span { display: block; font-size: 0.92rem; color: var(--muted); margin-top: 0.15rem; }
.plaque .res { display: inline; background: none; padding: 0; color: inherit; }
@media (max-width: 34rem) { .plaque__lignes > div { grid-template-columns: 1fr; } }

/* ---- Pages par besoin : les stations du catalogue face au calcul ----
   Une ligne par station, comme un tableau d'essais : qui, ses chiffres, le verdict du calcul.
   Celle que le calcul retient (la plus petite qui suffit) porte un filet d'ambre. */
.stations { margin: 1.6rem 0 2.2rem; max-width: none; }
.prose .stations__liste { list-style: none; padding: 0; margin: 0 0 0.9rem; border-top: 2px solid var(--trait); max-width: 52rem; }
.prose .station { margin: 0; padding: 1rem 0.9rem; border-bottom: 1px solid var(--filet); border-left: 4px solid transparent; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0.35rem 1.6rem; align-items: start; }
.prose .station.est-choisie { border-left-color: var(--ambre); background: color-mix(in oklab, var(--ambre) 10%, transparent); }
.prose .station p { margin: 0; max-width: none; }
.station__nom { font: 700 1.08rem/1.3 var(--font-head); }
.station__badge { display: inline-block; margin-left: 0.4rem; font: 700 0.68rem/1 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; color: #16181b; background: var(--ambre); padding: 0.3em 0.5em; border-radius: 2px; vertical-align: 0.14em; }
.station__specs { font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.station.est-ecartee .station__nom, .station.est-ecartee .station__verdict { color: var(--muted); }
.station__liens { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.3rem; margin-top: 0.4rem; }
.station__partenaire { font: 600 0.72rem/1 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.station__manuel { font-size: 0.88rem; color: var(--muted); }
@media (max-width: 40rem) { .prose .station { grid-template-columns: 1fr; } }

/* ---- Documents cités en bas de page ---- */
.prose .docs { list-style: none; padding: 0; margin: 1.2rem 0 0; border-top: 2px solid var(--trait); max-width: 46rem; }
.prose .docs li { margin: 0; padding: 0.65rem 0; border-bottom: 1px solid var(--filet); font-size: 0.95rem; }
.docs__lu { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }

/* ---- Listes de pages par besoin : une ligne par appareil, avec son chiffre repère ---- */
.lignes { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--trait); }
.lignes li { margin: 0; }
.ligne { display: grid; grid-template-columns: 2.7rem minmax(0, 1fr) auto; grid-template-areas: "icone nom chiffre" "icone texte chiffre"; column-gap: 1.1rem; row-gap: 0.1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--filet); color: var(--ink); text-decoration: none; }
.ligne__icone { grid-area: icone; width: 2.7rem; height: 2.7rem; padding: 0.42rem; border: 1px solid var(--filet); border-radius: 2px; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ligne__nom { grid-area: nom; align-self: end; font: 700 1.15rem/1.2 var(--font-head); letter-spacing: 0.03em; text-transform: uppercase; }
.ligne__texte { grid-area: texte; align-self: start; color: var(--muted); font-size: 0.96rem; line-height: 1.4; }
.ligne__chiffre { grid-area: chiffre; text-align: right; font: 600 0.78rem/1.3 var(--font-head); letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.ligne__chiffre b { display: block; font-size: 1.6rem; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.ligne:hover { text-decoration: none; }
.ligne:hover .ligne__icone, .ligne:focus-visible .ligne__icone { background: var(--ambre); border-color: var(--ink); stroke: #16181b; }
.ligne:hover .ligne__nom { text-decoration: underline; text-decoration-color: var(--ambre); text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
@media (max-width: 36rem) {
  .ligne { grid-template-columns: 2.5rem minmax(0, 1fr); grid-template-areas: "icone nom" "icone texte" "icone chiffre"; }
  .ligne__icone { width: 2.5rem; height: 2.5rem; align-self: start; }
  .ligne__chiffre { text-align: left; margin-top: 0.3rem; }
  .ligne__chiffre b { display: inline; font-size: 1.15rem; margin-right: 0.35rem; }
}
.rubrique { margin-top: 4.5rem; }
.rubrique h2 { margin-bottom: 0.5rem; }
.rubrique__chapo { max-width: 40rem; margin: 0 0 1.4rem; }
.rubrique .lien-fleche { display: inline-block; margin-top: 1.5rem; }
.rubrique__suite { max-width: 40rem; margin-top: 1.8rem; }
@media (min-width: 60rem) { .kind-home .rubrique { grid-column: 1 / -1; } }
.kind-hub .lignes { max-width: 56rem; }

/* Dans une page par besoin, le texte garde sa mesure ; les blocs prennent leur propre largeur. */
.besoin-texte { max-width: none; }
.besoin-texte > :is(p, ul, ol, h2, h3, blockquote) { max-width: var(--measure); }
.prose.besoin-texte > .table-wrap { width: auto; max-width: 52rem; }
/* La phrase ouvre la page, juste sous le chapô. */
article > .phrase { margin-top: 0.4rem; }
article > .phrase + .meta { margin-bottom: 1.6rem; }

/* ---- Téléphone : la marque et le mode nuit sur une ligne, le menu sur une seule ligne dessous ---- */
@media (max-width: 44rem) {
  .site-header__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "marque bascule" "menu menu"; gap: 0.55rem 1rem; align-items: center; }
  .brand { grid-area: marque; }
  .theme-toggle { grid-area: bascule; }
  .nav { grid-area: menu; min-width: 0; }
  .nav ul { flex-wrap: nowrap; gap: 0 1.05rem; overflow-x: auto; scrollbar-width: none; }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav a { font-size: 0.72rem; letter-spacing: 0.09em; white-space: nowrap; }
}
@media (max-width: 36rem) {
  .abaque table { font-size: 0.86rem; }
  .abaque th, .abaque td { padding: 0.5rem 0.45rem; }
  .abaque td.num { font-size: 0.86rem; }
  .abaque caption { padding: 0.6rem 0.45rem; }
}

/* ---- Outil solaire ----
   Deux blocs côte à côte : la production mois par mois (ce que le kit donne) et la course du soleil
   au-dessus du panneau (pourquoi il le donne). L'ambre reste la couleur de l'énergie : la part
   consommée sur place, le soleil, son rayon et la face éclairée du panneau. */
.solaire { display: grid; gap: 2.5rem; margin: 2.2rem 0 0; }
.solaire__bloc { min-width: 0; border-top: 2px solid var(--trait); padding-top: 0.9rem; }
.solaire__bloc h2 { font-size: 1.15rem; letter-spacing: 0.03em; text-transform: uppercase; margin: 0 0 1.1rem; }
@media (min-width: 58rem) {
  .solaire { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: 3rem; align-items: start; }
}

/* Le graphique mensuel : chaque colonne est un bouton qui choisit le mois montré dans le ciel. */
.mois { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.3rem; height: 15.5rem; }
.mois li { margin: 0; display: flex; min-width: 0; }
.mois__barre { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0.28rem; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; font: 600 0.7rem/1 var(--font-head); font-variant-numeric: tabular-nums; }
.mois__barre::before { content: ""; flex: calc(1 - var(--total)) 1 0; }
.mois__val { text-align: center; color: var(--muted); }
.mois__colonne { flex: var(--total) 1 0; min-height: 3px; display: flex; flex-direction: column; border: 1px solid var(--trait); background: repeating-linear-gradient(135deg, transparent 0 3px, var(--filet) 3px 4.5px); }
.mois__colonne::before { content: ""; flex: calc(1 - var(--auto)) 1 0; }
.mois__auto { flex: var(--auto) 1 0; background: var(--ambre); border-top: 1px solid var(--trait); }
.mois__nom { text-align: center; padding: 0.3rem 0 0.25rem; letter-spacing: 0.02em; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; overflow: hidden; }
.mois__barre:hover .mois__colonne { border-color: var(--ink); }
.mois__barre.est-choisi .mois__val, .mois__barre.est-choisi .mois__nom { color: var(--ink); font-weight: 700; }
.mois__barre.est-choisi .mois__nom { border-bottom-color: var(--ink); }
.mois__barre.est-choisi .mois__colonne { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.mois__barre:focus-visible { outline: 2px solid var(--ambre); outline-offset: 2px; }
.solaire__cles { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.2rem; margin: 0.9rem 0 0; font: 600 0.78rem/1.3 var(--font-head); letter-spacing: 0.02em; color: var(--muted); }
.cle { width: 0.85rem; height: 0.85rem; flex: none; border: 1px solid var(--trait); }
.cle--auto { background: var(--ambre); }
.cle--reste { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--filet) 3px 4.5px); }
.solaire__unite { margin-left: auto; }
@media (max-width: 30rem) { .mois { gap: 0.15rem; height: 13rem; } .mois__barre { font-size: 0.6rem; } .mois__val { font-size: 0.56rem; letter-spacing: -0.02em; } }

/* Le ciel */
.solaire__ciel { max-width: 30rem; margin-inline: auto; }
.ciel { display: block; width: 100%; height: auto; font-family: var(--font-head); overflow: visible; }
.ciel__sol { fill: var(--creux); stroke: var(--trait); stroke-width: 1; }
.ciel__axe { stroke: var(--filet); stroke-width: 1; }
.ciel__cardinal { fill: var(--muted); font-size: 11px; font-weight: 700; text-anchor: middle; }
.ciel__voute { fill: none; stroke: var(--trait); stroke-width: 1.2; }
.ciel__course { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3.5 3; }
.ciel__course--mois { stroke: var(--ink); stroke-width: 1.8; stroke-dasharray: none; }
.ciel__heure { fill: var(--ink); }
.ciel__heure-nom { fill: var(--muted); font-size: 9.5px; font-weight: 600; text-anchor: middle; }
.ciel__repere { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 1.5 2.5; }
.ciel__panneau { fill: #16181b; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.ciel__panneau--dos { fill: var(--surface); }
.ciel__eclat { fill: var(--ambre); stroke: none; }
.ciel__cellule { stroke: rgba(22, 24, 27, 0.55); stroke-width: 0.8; }
.ciel__normale { stroke: var(--ink); stroke-width: 1; }
.ciel__rayon { stroke: var(--ambre); stroke-width: 2.4; stroke-linecap: round; }
.ciel__rayon--dos { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.ciel__soleil { fill: var(--ambre); stroke: var(--ink); stroke-width: 1.5; }

/* Le curseur de l'heure : une règle, comme celle de la capacité dans le simulateur. */
.temps { max-width: 30rem; margin: 0.6rem auto 0; }
.temps input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 1.7rem; margin: 0; background: linear-gradient(var(--trait), var(--trait)) center / 100% 2px no-repeat; cursor: ew-resize; }
.temps input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 0.9rem; height: 1.7rem; background: var(--ambre); border: 1px solid var(--ink); border-radius: 1px; }
.temps input[type="range"]::-moz-range-thumb { width: 0.9rem; height: 1.7rem; background: var(--ambre); border: 1px solid var(--ink); border-radius: 1px; }
.temps input[type="range"]:focus-visible { outline: 2px solid var(--ambre); outline-offset: 3px; }
.temps__bornes { display: flex; justify-content: space-between; font: 600 0.72rem/1.2 var(--font-head); letter-spacing: 0.03em; color: var(--muted); margin-top: 0.2rem; }
.solaire__lecture { max-width: 30rem; margin: 0.9rem auto 0; font-size: 1rem; }
.solaire__bloc .note { max-width: 30rem; margin: 0.6rem auto 0; display: block; }
.phrase__suite .phrase__aide b { color: var(--ink); font-family: var(--font-head); }
.ciel__pied { stroke: var(--ink); stroke-width: 1.2; }
.cle-nom { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
