/* Cahier Sobre : mise en page de cahier de relevés (papier quadrillé, onglets de classeur, fiches à pointillés). Polices système uniquement. */
:root {
  --paper: #f3eddc; --sheet: #fffdf5; --ink: #1e2a24; --muted: #46564b; --rule: #cfc3a2; --grid: #e7ddc2;
  --green: #1b5e48; --green-d: #123f31; --bind: #173f33; --clay: #9a3b1b; --blue: #1d4f91; --hl: #f6df8a; --err: #9b1c1c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper); font: 1rem/1.65 var(--sans);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
img, svg { max-width: 100%; height: auto; }
a { color: #17504a; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: var(--clay); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--hl); color: var(--ink); padding: .6em 1em; font-weight: 700; }
.skip:focus { top: 8px; }

/* ---------- Bandeau relié ---------- */
.masthead { background: var(--bind); color: #f6efd9; position: relative; padding-bottom: 14px; }
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: radial-gradient(circle at 14px 0, var(--paper) 0 6px, transparent 7px) 0 0 / 28px 14px repeat-x; }
.masthead-in { max-width: 1140px; margin: 0 auto; padding: 14px 16px 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { display: block; }
.brand-name { font: 700 1.45rem/1 var(--serif); letter-spacing: .01em; color: #f6efd9; }
.brand-name em { font-style: italic; color: var(--hl); margin-left: .18em; }
.mainnav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.mainnav > a, .menu > summary { color: #f6efd9; text-decoration: none; padding: .4em .8em; font-weight: 600; font-size: .95rem; border-bottom: 2px solid transparent; cursor: pointer; list-style: none; display: inline-block; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " ▾"; font-size: .8em; }
.mainnav > a:hover, .menu > summary:hover, .menu[open] > summary { color: #fff; border-bottom-color: var(--hl); }
.masthead :focus-visible, .foot :focus-visible { outline-color: var(--hl); }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; max-width: calc(100vw - 32px); background: var(--sheet); border: 2px solid var(--ink); box-shadow: 5px 5px 0 rgba(0,0,0,.25); padding: 8px; display: grid; gap: 2px; }
.menu-panel a { color: var(--ink); text-decoration: none; padding: .45em .7em; font-weight: 600; font-size: .95rem; }
.menu-panel a:hover { background: var(--hl); color: var(--ink); }

main { max-width: 1140px; margin: 0 auto; padding: 22px 16px 40px; }
.block { margin: 0 0 40px; min-width: 0; }
.blocktitle { font-size: 1.65rem; display: inline-block; padding: 0 .35em .05em 0; background: linear-gradient(transparent 62%, var(--hl) 62%); }
.blocknote { color: var(--muted); max-width: 70ch; }
.kicker { font: 700 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--clay); margin: 0 0 14px; }
.boxtitle { font: 700 .85rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

/* ---------- Couverture de l'accueil ---------- */
.cover { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 34px; align-items: start; padding: 20px 0 44px; }
.cover-text, .cover-card { min-width: 0; }
.cover h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); letter-spacing: -.01em; margin-bottom: .35em; }
.cover .lead { font-size: 1.15rem; max-width: 56ch; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.cover-card { position: relative; background: var(--sheet); border: 2px solid var(--ink); padding: 26px 20px 14px; transform: rotate(1deg); box-shadow: 6px 6px 0 var(--green); }
.cover-card::before { content: ""; position: absolute; top: -12px; left: 50%; width: 110px; height: 24px; margin-left: -55px; background: var(--hl); border: 1px solid var(--rule); transform: rotate(-2deg); }
.toc { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 9px 0; border-bottom: 1px dotted var(--ink); text-decoration: none; color: var(--ink); font-weight: 600; }
.toc a:hover { background: var(--hl); }
.toc b { font-family: var(--mono); background: var(--ink); color: #fff; padding: 0 .5em; border-radius: 3px; }
.steps { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps li { counter-increment: st; background: var(--sheet); border: 1.5px solid var(--ink); padding: 18px 16px 14px 60px; position: relative; min-width: 0; }
.steps li::before { content: counter(st); position: absolute; left: 14px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font: 700 1.1rem/34px var(--serif); text-align: center; }
.steps b { display: block; font: 700 1.15rem/1.3 var(--serif); }
.steps span { color: var(--muted); }

/* ---------- En-tête de page ---------- */
.pagehead { position: relative; background: var(--sheet); border: 1.5px solid var(--ink); border-left: 12px solid var(--c, var(--green)); padding: 18px 22px 8px; margin: 0 0 34px; box-shadow: 6px 6px 0 rgba(30,42,36,.18); }
.pagehead h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: .3em; }
.pagehead h1 span:last-child { min-width: 0; overflow-wrap: break-word; }
.ico { flex: none; width: 1.55em; height: 1.55em; display: grid; place-items: center; font-size: .9em; background: color-mix(in srgb, var(--c, #1b5e48) 22%, #fffdf5); border: 1.5px solid var(--ink); border-radius: 6px 6px 6px 0; }
.lead { font-size: 1.1rem; max-width: 70ch; color: #2a372f; }
.count { color: var(--muted); }
.count b { font: 700 1.5rem var(--serif); color: var(--ink); margin-right: .2em; }
.famtag { display: inline-block; background: var(--ink); color: #fff; padding: .15em .8em; border-radius: 99px; font-size: .85rem; font-weight: 700; }
.byline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; margin: 6px 0 10px; }
.avatar { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font: 700 .8rem var(--sans); letter-spacing: .04em; }
.byline span { min-width: 0; }
.crumbs { font-size: .85rem; margin-bottom: 10px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.crumbs li + li::before { content: "›"; margin: 0 .55em; color: var(--muted); }
.crumbs a { color: #17504a; }
.crumbs [aria-current] { color: var(--muted); overflow-wrap: anywhere; }
.author { text-align: left; }
.portrait { float: right; width: 104px; height: 104px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; border: 3px solid var(--ink); font: 700 2rem var(--serif); margin: 0 0 8px 16px; }

/* ---------- Cartes : onglets de classeur et fiches ---------- */
.tabs, .cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.tabs { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tabs li, .cards li { display: flex; min-width: 0; }
.tab { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px 14px 14px; background: var(--sheet); color: var(--ink); text-decoration: none; border: 1.5px solid var(--ink); border-top: 9px solid var(--c); border-radius: 12px 12px 3px 3px; }
.tab i { font-style: normal; font-size: 1.6rem; line-height: 1; }
.tab b { font: 700 1.05rem/1.3 var(--serif); }
.tab span { color: var(--muted); font-size: .9rem; margin-top: auto; }
.tab:hover { background: var(--hl); color: var(--ink); transform: translateY(-2px); }
.card { flex: 1; min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 14px; align-items: start; padding: 14px 16px; background: var(--sheet); color: var(--ink); text-decoration: none; border: 1.5px solid var(--ink); box-shadow: 4px 4px 0 var(--c); }
.card i { grid-row: span 2; width: 46px; height: 46px; display: grid; place-items: center; font-style: normal; font-size: 1.5rem; background: color-mix(in srgb, var(--c) 20%, #fffdf5); border: 1.5px solid var(--ink); border-radius: 50%; }
.card b { font: 700 1.05rem/1.3 var(--serif); }
.card span { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.card:hover { background: var(--hl); color: var(--ink); }
.card:hover span { color: var(--ink); }

/* ---------- Annuaire : registre à lignes ---------- */
.finder { margin: 0 0 18px; }
.finder-row { position: relative; max-width: 560px; }
.finder-row input { width: 100%; font: inherit; padding: .75em 2.6em .75em 1em; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 4px; }
.finder-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--ink); font-size: 1rem; cursor: pointer; }
.finder-hint, .finder-count { color: var(--muted); font-size: .9rem; margin: 6px 0; }
.chips { list-style: none; margin: 12px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { font: inherit; font-size: .88rem; font-weight: 600; padding: .4em .85em; border: 1.5px solid var(--ink); background: var(--sheet); color: var(--ink); border-radius: 99px; cursor: pointer; }
.chips button:hover { background: var(--hl); }
.chips button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green-d); }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0 28px; }
.ledger li { position: relative; min-width: 0; border-bottom: 1px solid var(--rule); border-left: 5px solid var(--c, var(--green)); background: color-mix(in srgb, var(--sheet) 80%, transparent); }
.ledger li[hidden] { display: none; }
.site { display: grid; gap: 1px; padding: 9px 44px 9px 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.site b { font-weight: 700; overflow-wrap: anywhere; }
.site span { font-size: .82rem; color: var(--muted); }
.site:hover { background: var(--hl); color: var(--ink); }
.fav { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: #7a4d00; cursor: pointer; }
.fav[aria-pressed="true"] { color: #8a3a00; }
.favbox { background: var(--sheet); border: 2px dashed var(--ink); padding: 14px 16px; margin: 0 0 22px; }
.favbox-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 4px; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: #17504a; text-decoration: underline; cursor: pointer; }
.empty { text-align: center; padding: 30px 10px; background: var(--sheet); border: 2px dashed var(--ink); }

/* ---------- Boutons et champs ---------- */
.btn { display: inline-block; font: 700 1rem var(--sans); padding: .7em 1.3em; background: var(--green); color: #fff; border: 2px solid var(--green-d); box-shadow: 3px 3px 0 var(--green-d); text-decoration: none; cursor: pointer; border-radius: 3px; }
.btn:hover { background: var(--green-d); color: #fff; }
.btn.alt { background: var(--sheet); color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn.alt:hover { background: var(--hl); color: var(--ink); }
.btn.small { font-size: .9rem; padding: .5em 1em; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field label { font-weight: 700; font-size: .92rem; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; font: inherit; padding: .6em .7em; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); border-radius: 3px; }
.field textarea { font-family: var(--mono); font-size: .92rem; line-height: 1.5; resize: vertical; }
.field[hidden] { display: none; }
.swap { align-self: end; font: inherit; font-weight: 700; padding: .6em 1em; border: 1.5px solid var(--ink); background: var(--sheet); color: var(--ink); cursor: pointer; border-radius: 3px; }
.swap:hover { background: var(--hl); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.controls select { font: inherit; padding: .45em .6em; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); }

/* ---------- Fiche de calcul ---------- */
.toolbox { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: start; margin: 0 0 40px; }
.toolbox > form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; background: var(--sheet); border: 1.5px solid var(--ink); padding: 20px 18px; min-width: 0; box-shadow: 5px 5px 0 var(--rule); }
.toolbox .field.wide { grid-column: 1 / -1; }
.result, .local-out, .plan-out { min-width: 0; }
.toolbox > .result, .local-out > .result, .plan-out > .result { background: var(--sheet); border: 2px dashed var(--ink); padding: 16px 16px 6px; position: relative; }
.res { margin: 0; }
.res > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; padding: 8px 0; border-bottom: 1px dotted var(--ink); }
.res dt { color: var(--muted); font-weight: 600; min-width: 0; }
.res dd { margin: 0 0 0 auto; font: 700 1.02rem var(--mono); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.res .main { background: var(--hl); border: 1.5px solid var(--ink); padding: 10px 12px; margin: 4px -4px; }
.res .main dt { color: var(--ink); }
.res .main dd { font-size: 1.2rem; }
.rnote { color: var(--muted); font-size: .88rem; margin: 10px 0; }
.err { color: var(--err); font-weight: 700; background: #fde8e6; border: 1.5px solid var(--err); padding: 10px 12px; }
.conv-main { font: 700 1.25rem/1.4 var(--serif); margin: 0 0 10px; overflow-wrap: anywhere; }
.status { color: var(--muted); min-height: 1.4em; font-size: .9rem; }
.actions, .dl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.actions[hidden], .dl-actions[hidden], [hidden] { display: none; }

/* ---------- Texte courant ---------- */
.prose { max-width: 860px; margin: 0 auto 40px; min-width: 0; }
.prose.wide { max-width: none; }
.prose h2 { font-size: 1.5rem; margin-top: 1.7em; padding-bottom: .15em; border-bottom: 2px solid var(--ink); }
.prose h3 { font-size: 1.2rem; margin-top: 1.3em; }
.prose p, .prose li { max-width: 74ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.guide .dropcap { font-size: 1.12rem; }
.guide .dropcap::first-letter { float: left; font: 700 3.6rem/.85 var(--serif); padding: .06em .12em 0 0; color: var(--green); }
.note { color: var(--muted); font-size: .92rem; background: color-mix(in srgb, var(--hl) 35%, transparent); border-left: 4px solid var(--hl); padding: 8px 12px; }
.facts { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 6px 18px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.crit-list { grid-template-columns: minmax(0, 1fr); }
.plain { list-style: none; padding: 0; columns: 2 280px; column-gap: 28px; }
.plain li { break-inside: avoid; }
.links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.links a { display: grid; padding: 10px 14px; background: var(--sheet); border: 1.5px solid var(--ink); text-decoration: none; color: var(--ink); }
.links a:hover { background: var(--hl); }
.links span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.faq { display: grid; gap: 10px; margin: 0 0 20px; }
.faq details { background: var(--sheet); border: 1.5px solid var(--ink); padding: 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 16px; list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 8px; font: 700 1.4rem var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { background: var(--hl); }
.faq details p { margin: 0; padding: 12px 16px 14px; }
.faqblock .faq { max-width: 860px; }
.chiplist { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.chiplist li { margin: 0; max-width: 100%; }
.chiplist a { display: inline-block; padding: .35em .9em; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 99px; text-decoration: none; color: var(--ink); font-size: .92rem; font-weight: 600; }
.chiplist a:hover { background: var(--hl); }
.checklist { background: var(--sheet); border: 1.5px solid var(--ink); padding: 8px 18px; }
.checklist ul { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 8px 0 8px 34px; position: relative; border-bottom: 1px dotted var(--ink); margin: 0; }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 11px; width: 18px; height: 18px; border: 2px solid var(--ink); background: #fff; }
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; background: var(--sheet); border: 1.5px solid var(--ink); border-left: 12px solid var(--c); padding: 14px 18px; margin: 22px 0; }
.callout p { margin: 0; max-width: 60ch; }
.guide-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.guide-nav a { display: grid; padding: 12px 16px; background: var(--sheet); border: 1.5px solid var(--ink); text-decoration: none; color: var(--ink); font-weight: 700; font-family: var(--serif); }
.guide-nav a:last-child { text-align: right; }
.guide-nav a:hover { background: var(--hl); }
.guide-nav span { font: 600 .8rem var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.embedbox { background: var(--sheet); border: 2px dashed var(--ink); padding: 14px 16px; }
.embedbox textarea { width: 100%; font: .85rem/1.5 var(--mono); padding: .6em; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); resize: vertical; }
.example { background: var(--sheet); border: 1.5px solid var(--ink); padding: 14px 18px; margin: 0 0 18px; }
.example ul { margin: 0 0 12px; }

/* ---------- Tableaux ---------- */
.tablewrap { overflow-x: auto; max-width: 100%; position: relative; margin: 0 0 18px; background: var(--sheet); border: 1.5px solid var(--ink); }
.tablewrap table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 520px; }
.tablewrap th, .tablewrap td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tablewrap thead th { background: var(--ink); color: #fff; font-weight: 700; white-space: nowrap; }
.tablewrap tbody th { font-weight: 700; white-space: nowrap; }
.evlist small { display: block; color: var(--muted); }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin: 0 0 22px; }
.month { background: var(--sheet); border: 1.5px solid var(--ink); padding: 8px; min-width: 0; }
.month table { width: 100%; border-collapse: collapse; font-size: .82rem; table-layout: fixed; }
.month caption { font: 700 1rem var(--serif); text-align: left; padding: 2px 4px 6px; text-transform: capitalize; }
.month th, .month td { text-align: center; padding: 3px 0; }
.month th { color: var(--muted); font-weight: 600; }
.month td.mk span { display: inline-block; min-width: 1.9em; padding: 1px 0; color: #fff; font-weight: 700; border-radius: 50%; background: var(--green); }
.mk-eau span { background: #1d4f91 !important; }
.mk-energie span { background: #8a4b00 !important; }
.mk-compost span { background: #3b6a14 !important; }
.mk-heure span { background: #5b3a9a !important; }
.mk-releve span { background: #9a3b1b !important; }
.mk-saison span { background: #123f31 !important; }

/* ---------- Carnets, atelier, balance ---------- */
.modele-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 26px; align-items: start; margin: 0 0 36px; }
.modele-form, .modele-side { min-width: 0; }
.modele-form { display: grid; gap: 12px; background: var(--sheet); border: 1.5px solid var(--ink); padding: 18px; }
.paper { background: #fff; border: 1.5px solid var(--ink); padding: 26px 26px 20px 52px; font: 1rem/1.7 var(--serif); min-height: 340px; position: relative; overflow-wrap: anywhere; background-image: linear-gradient(transparent 27px, #d6e2ec 27px, #d6e2ec 28px, transparent 28px); background-size: 100% 28px; }
.paper::before { content: ""; position: absolute; left: 36px; top: 0; bottom: 0; width: 2px; background: #d98a8a; }
.paper p { margin: 0; min-height: 28px; line-height: 28px; }
.localbox .local-form { display: grid; gap: 14px; }
.localbox > form.local-form { grid-template-columns: minmax(0, 1fr); }
.checklist-out { list-style: none; padding: 0; margin: 0 0 8px; }
.checklist-out li { padding: 6px 0 6px 30px; position: relative; border-bottom: 1px dotted var(--ink); }
.checklist-out li::before { content: ""; position: absolute; left: 0; top: 10px; width: 16px; height: 16px; border: 2px solid var(--ink); background: #fff; }
.bocaux { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bocal { border: 2px dashed var(--ink); padding: 10px 12px; background: #fff; display: grid; gap: 2px; min-width: 0; }
.bocal b { font: 700 1.05rem var(--serif); }
.bocal span { font-size: .85rem; color: var(--muted); }
.chart { margin: 0 0 10px; overflow-x: auto; max-width: 100%; position: relative; }
.chart svg { display: block; max-width: 100%; height: auto; }
.codeout { max-height: 360px; overflow: auto; max-width: 100%; position: relative; background: #fff; border: 1.5px solid var(--ink); padding: 12px; font: .85rem/1.5 var(--mono); white-space: pre; margin: 0 0 10px; }
.datatab { width: 100%; }
.matrix { margin: 0 0 30px; min-width: 0; }
.matrix-top, .names, .scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 12px; }
.matrix [data-live] { background: var(--sheet); border: 1.5px solid var(--ink); padding: 18px; min-width: 0; }
.fallback { background: var(--sheet); border: 2px dashed var(--ink); padding: 12px 14px; }
.help { color: var(--muted); font-size: .92rem; }
fieldset.crit { border: 1.5px solid var(--ink); background: #fff; margin: 0 0 14px; padding: 12px 14px 8px; min-width: 0; }
fieldset.crit legend { font: 700 .95rem var(--serif); padding: 0 .4em; }
.ranking { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; }
.ranking li { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(70px, 1.2fr) auto; gap: 10px; align-items: center; background: #fff; border: 1.5px solid var(--ink); padding: 10px 12px; }
.ranking .rk { font: 700 1rem var(--mono); background: var(--ink); color: #fff; padding: 0 .5em; border-radius: 3px; }
.ranking b { overflow-wrap: anywhere; }
.bar { display: block; height: 12px; background: var(--grid); border: 1px solid var(--ink); position: relative; }
.bar i { display: block; height: 100%; background: var(--green); }
.sc { font: 700 .95rem var(--mono); white-space: nowrap; }
.verdict { font-weight: 700; background: var(--hl); border: 1.5px solid var(--ink); padding: 10px 14px; }

/* ---------- Pied de page ---------- */
.foot { background: var(--bind); color: #f6efd9; margin-top: 30px; border-top: 6px double var(--hl); }
.foot-in { max-width: 1140px; margin: 0 auto; padding: 34px 16px 14px; display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 26px; }
.foot-in > * { min-width: 0; }
.foot-about p { color: #e3dcc3; font-size: .92rem; margin-top: 12px; }
.foot-title { font: 700 .85rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--hl); margin: 0 0 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 6px; }
.foot a { color: #f6efd9; text-decoration-color: rgba(246,239,217,.45); font-size: .93rem; }
.foot a:hover { color: #fff; text-decoration-color: var(--hl); }
.foot .brand-name { font-size: 1.3rem; }
.foot-bottom { max-width: 1140px; margin: 0 auto; padding: 14px 16px 24px; color: #e3dcc3; font-size: .82rem; border-top: 1px solid rgba(246,239,217,.25); }

/* ---------- Pages intégrables ---------- */
body.embed { background-image: none; background-color: #fff; }
.embed-wrap { max-width: 640px; padding: 14px 14px 20px; }
.embed-wrap h1 { font-size: 1.35rem; }
.embed .toolbox { grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0 0 12px; }
.embed .toolbox > form { grid-template-columns: minmax(0, 1fr); box-shadow: none; }
.embed-credit { font-size: .85rem; text-align: right; margin: 0; }

/* ---------- Adaptation ---------- */
@media (max-width: 980px) {
  .cover { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cover-card { transform: none; }
  .toolbox, .modele-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-about { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .steps, .guide-nav, .facts { grid-template-columns: minmax(0, 1fr); }
  .toolbox > form { grid-template-columns: minmax(0, 1fr); padding: 16px 14px; }
  .tabs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .pagehead { padding: 14px 14px 6px; border-left-width: 8px; }
  .paper { padding: 20px 14px 16px 38px; }
  .paper::before { left: 26px; }
  .ranking li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ranking .bar { grid-column: 1 / -1; order: 5; }
  .menu-panel { position: static; margin-top: 6px; box-shadow: none; max-width: none; }
  .mainnav { width: 100%; }
  .menu { width: 100%; }
  .portrait { float: none; display: block; margin: 0 0 10px; }
  .guide-nav a:last-child { text-align: left; }
  .tablewrap table { min-width: 480px; }
}
@media (max-width: 480px) {
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .blocktitle { font-size: 1.4rem; }
  .brand-name { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .tab:hover { transform: none; } }
@media print {
  body { background: #fff; }
  .masthead, .foot, .pagehead, .skip, .prose, .block, .dl-actions, .modele-form, .local-form, .actions, .status, .toolbox > form, .crumbs { display: none !important; }
  .modele-side > .boxtitle { display: none; }
  main { padding: 0; max-width: none; }
  .modele-grid, .toolbox { display: block; }
  .paper, .toolbox > .result, .local-out > .result { border: 0; box-shadow: none; }
  .print-result .local-out { display: block; }
  .toolbox, .localbox, .local-out { display: block !important; }
}


/* ===== kit commun : export, filtre, outils liés, impression, grandes listes ===== */
.kit-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:.9rem 0 0}
.kit-actions button{font:inherit;font-weight:700;font-size:.95rem;cursor:pointer;padding:.45rem .85rem;min-height:44px;border:2px solid currentColor;border-radius:.6rem;background:transparent;color:inherit}
.kit-actions button:hover{text-decoration:underline}
.kit-status{font-size:.9rem;min-height:1.2em}
.kit-filter{margin:0 0 1.2rem}
.kit-filter label{display:block;font-weight:700;margin-bottom:.35rem}
.kit-filter input{font:inherit;width:100%;max-width:32rem;padding:.6rem .8rem;min-height:44px;border:2px solid #222;border-radius:.6rem;background:#fff;color:#111}
.kit-count{margin:.4rem 0 0;font-size:.92rem;min-height:1.2em}
.kit-related{margin:2.2rem 0 1rem;padding:1rem 1.2rem;border:2px solid currentColor;border-radius:.8rem}
.kit-related h2{font-size:1.15rem;margin:0 0 .7rem}
.kit-related ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,15rem),1fr));gap:.4rem .8rem}
.kit-related li{min-width:0}
.kit-related a{display:block;padding:.35rem .1rem;overflow-wrap:break-word}
ul:has(> li:nth-child(40)) > li{content-visibility:auto;contain-intrinsic-size:auto 100px}
@media print{
  body.kit-printing *{visibility:hidden!important}
  body.kit-printing .kit-print-target,body.kit-printing .kit-print-target *{visibility:visible!important}
  body.kit-printing .kit-print-target{position:absolute!important;left:0;top:0;width:100%;color:#000!important;background:#fff!important;box-shadow:none!important}
}
