:root {
  --fond: #f6f8fa;
  --carte: #ffffff;
  --texte: #1f2933;
  --doux: #52606d;
  --trait: #d9e2ec;
  --accent: #1f4e79;
  --accent-texte: #ffffff;
  --encart: #fff8e6;
  --encart-trait: #f0b429;
  --zone: #dfe7ef;
  --zone-survol: #9fb3c8;
  --zone-choix: #1f4e79;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11161c;
    --carte: #1b232c;
    --texte: #e4e9ef;
    --doux: #a6b3c0;
    --trait: #33414f;
    --accent: #8cb8e6;
    --accent-texte: #0d1a26;
    --encart: #2a2416;
    --encart-trait: #c9961f;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--encart-trait);
  outline-offset: 2px;
}
.evitement { position: absolute; left: -9999px; top: 0; }
.evitement:focus { left: 16px; top: 8px; z-index: 20; background: var(--carte); padding: 6px 10px; }

header.site, footer.site { background: var(--carte); border-bottom: 1px solid var(--trait); }
footer.site { border-top: 1px solid var(--trait); border-bottom: 0; margin-top: 48px; }
.barre { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.logo { font-weight: 700; color: var(--texte); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; margin-right: auto; }
.logo svg { width: 22px; height: 22px; }
nav.principale ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; }
nav.principale a { text-decoration: none; }
nav.principale a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
footer.site .barre { display: block; font-size: 14px; color: var(--doux); padding-top: 18px; padding-bottom: 24px; }
footer.site p { margin: 6px 0; }

main { max-width: 1080px; margin: 0 auto; padding: 8px 16px; }
h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); line-height: 1.2; margin: 20px 0 8px; }
h2 { font-size: 1.3rem; margin: 32px 0 8px; line-height: 1.3; }
h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.chapeau { font-size: 1.08rem; color: var(--doux); margin-top: 0; max-width: 760px; }
p, li { max-width: 760px; }
code { font: 0.92em ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--carte); border: 1px solid var(--trait); border-radius: 4px; padding: 0 4px; }
pre { background: var(--carte); border: 1px solid var(--trait); border-radius: 8px; padding: 12px; overflow-x: auto; max-width: 100%; font-size: 14px; line-height: 1.45; }
pre code { border: 0; padding: 0; background: none; }

.disposition { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 820px) { .disposition { grid-template-columns: minmax(0, 1fr); } }

.carte-boite { background: #ffffff; border: 1px solid var(--trait); border-radius: 10px; padding: 8px; position: relative; color: #1f2933; }
.carte-boite > img, .carte-boite > svg { display: block; width: 100%; height: auto; }
.carte-boite .zone { fill: var(--zone); stroke: #ffffff; stroke-width: 0.8; cursor: pointer; transition: fill .12s; }
.carte-boite .inset { fill: none; stroke: #9aa7b4; stroke-width: 0.8; }
.carte-boite .zone:hover { fill: var(--zone-survol); }
.carte-boite .zone:focus { outline: none; }
.carte-boite .zone:focus-visible { fill: var(--zone-survol); stroke: #1f2933; stroke-width: 2; }
.carte-boite .zone.est-choisie { fill: var(--zone-choix); stroke: #1f2933; stroke-width: 1.6; }
.carte-boite .etiquettes text { font: 700 12.5px system-ui, sans-serif; fill: #1f2933; pointer-events: none; text-anchor: middle; dominant-baseline: central; }
.carte-boite .etiquettes text.petit { font-size: 5px; }
.carte-boite .etiquettes text.sur-choix { fill: #ffffff; }
.carte-boite .etiquettes-insets text { font: 12px system-ui, sans-serif; fill: #52606d; text-anchor: middle; pointer-events: none; }
.carte-boite.vierge .zone { fill: #ffffff; stroke: #1f2933; stroke-width: 0.6; }
.carte-boite.vierge .zone:hover, .carte-boite.vierge .zone:focus-visible { fill: #dfe7ef; }
.carte-boite.vierge .zone.est-choisie { fill: #9fb3c8; }
.etat-carte { margin: 6px 0 0; font-size: 14px; color: var(--doux); }

/* Régions : une couleur par région (codes INSEE des régions) */
.carte-boite .r-11 { fill: #a5c8e4; } .carte-boite .r-24 { fill: #f6d186; } .carte-boite .r-27 { fill: #c3b1e1; }
.carte-boite .r-28 { fill: #8fd3d1; } .carte-boite .r-32 { fill: #f4a7a7; } .carte-boite .r-44 { fill: #b5d99c; }
.carte-boite .r-52 { fill: #f2b880; } .carte-boite .r-53 { fill: #d4a5c9; } .carte-boite .r-75 { fill: #9fc5a8; }
.carte-boite .r-76 { fill: #e8c07d; } .carte-boite .r-84 { fill: #a7b8d6; } .carte-boite .r-93 { fill: #e6a6b8; }
.carte-boite .r-94 { fill: #c9d97a; }
.carte-boite .r-01, .carte-boite .r-02, .carte-boite .r-03, .carte-boite .r-04, .carte-boite .r-06 { fill: #d9c29c; }
.carte-boite.regions .zone:hover, .carte-boite.regions .zone:focus-visible { fill: #52606d; }
.carte-boite.regions .zone.region-choisie { stroke: #1f2933; stroke-width: 1.4; }
.carte-boite.regions .zone.est-choisie { fill: #1f4e79; }
.pastille { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 3px; vertical-align: -0.1em; margin-right: 6px; border: 1px solid rgba(0,0,0,.25); }
.p-11 { background: #a5c8e4; } .p-24 { background: #f6d186; } .p-27 { background: #c3b1e1; } .p-28 { background: #8fd3d1; }
.p-32 { background: #f4a7a7; } .p-44 { background: #b5d99c; } .p-52 { background: #f2b880; } .p-53 { background: #d4a5c9; }
.p-75 { background: #9fc5a8; } .p-76 { background: #e8c07d; } .p-84 { background: #a7b8d6; } .p-93 { background: #e6a6b8; }
.p-94 { background: #c9d97a; } .p-01, .p-02, .p-03, .p-04, .p-06 { background: #d9c29c; }

.panneau { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 14px 16px; }
.panneau h2 { margin-top: 0; font-size: 1.15rem; }
.panneau label { display: block; font-weight: 600; margin-bottom: 4px; }
.panneau select, .filtre input { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--trait); border-radius: 6px; background: var(--fond); color: var(--texte); }
.fiche { margin-top: 14px; min-height: 120px; }
.fiche dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.fiche dt { color: var(--doux); }
.fiche dd { margin: 0; font-weight: 600; }
.fiche .nom { font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }

.bouton { display: inline-block; background: var(--accent); color: var(--accent-texte); border-radius: 8px; padding: 10px 16px; font-weight: 700; text-decoration: none; border: 0; }
.bouton.secondaire { background: transparent; color: var(--accent); border: 2px solid var(--accent); padding: 8px 14px; }
.telechargements { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; max-width: 760px; }
.telechargements li { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.telechargements .meta { color: var(--doux); font-size: 14px; display: block; }

.pack { background: var(--encart); border: 2px solid var(--encart-trait); border-radius: 12px; padding: 16px 18px; margin: 32px 0; max-width: 760px; }
.pack h2 { margin-top: 0; }
.pack ul { padding-left: 20px; }
.pack .prix { font-weight: 700; }

.mention { font-size: 14px; color: var(--doux); }
.tableau-boite { overflow-x: auto; max-width: 100%; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
thead th { background: var(--fond); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
td.code { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.filtre { max-width: 420px; margin: 12px 0; }
.filtre label { font-weight: 600; display: block; }
.liens-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.liens-pages li { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 12px 14px; max-width: none; }
.liens-pages a { font-weight: 700; }
.liste-regions { columns: 2 260px; padding-left: 0; list-style: none; }
.liste-regions li { break-inside: avoid; margin-bottom: 10px; }

@media print {
  header.site, footer.site nav, nav.principale, .pack, .panneau, .evitement, .telechargements, .pas-imprime { display: none !important; }
  body { background: #fff; color: #000; }
  .disposition { display: block; }
  .carte-boite { border: 0; padding: 0; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
