/* Atlas des collectes 1789 — feuille de style.
   Tout passe par les jetons de :root ; les blocs sombre ne redéfinissent que les jetons. */

:root {
  color-scheme: light dark;
  --papier: #f4f2ec;        /* fond de page, papier gris chaud */
  --papier-2: #ebe8df;      /* rail, contrôles */
  --mer: #dfe5e3;
  --eau: #6f9bb8;           /* fleuves */
  --actuel: #a0527a;        /* repères de la France d'aujourd'hui */
  --route: #a77b4f;         /* routes de poste */
  --terre: #f8f6f0;
  --terre-hors: #ece9e0;
  --etranger: #e2dfd3;      /* terres hors du royaume en 1789 */
  --trait: #b9b3a5;
  --trait-fort: #7d766a;
  --encre: #1f1e1a;
  --encre-2: #55514a;
  --encre-3: #8a847a;
  --focus: #1f1e1a;
  /* douze teintes ; deux dépôts voisins sur la carte n'ont jamais la même ni une proche */
  --t-rouge: #b5402f; --t-bleu: #2a6f9e; --t-ocre: #b3801b; --t-violet: #6a4c9c; --t-vert: #2f9a4e; --t-indigo: #3d5fcf;
  --t-rose: #d04c8f; --t-brun: #8a6d1f; --t-orange: #d9731f; --t-olive: #6b7d1a; --t-cyan: #1b8ca3; --t-bordeaux: #8c2f4f;
  /* dépôt → teinte (un dépôt nouveau sans ligne ici sort en gris : .pt { --c } par défaut) */
  --ad01: var(--t-vert); --ad02: var(--t-cyan); --ad07: var(--t-bleu); --ad14: var(--t-indigo); --ad15: var(--t-vert);
  --ad16: var(--t-brun); --ad22: var(--t-rouge); --ad24: var(--t-bleu); --ad27: var(--t-rose); --ad29: var(--t-brun);
  --ad30: var(--t-indigo); --ad34: var(--t-ocre); --ad41: var(--t-rose); --ad43: var(--t-bordeaux); --ad44: var(--t-violet);
  --ad49: var(--t-olive); --ad52: var(--t-vert); --ad56: var(--t-bleu); --ad58: var(--t-ocre); --ad61: var(--t-orange);
  --ad62: var(--t-ocre); --ad65: var(--t-violet); --ad70: var(--t-indigo); --ad71: var(--t-bordeaux); --ad76: var(--t-cyan);
  --ad78: var(--t-orange); --ad7986: var(--t-rouge); --ad80: var(--t-rouge); --ad83: var(--t-rose); --ad89: var(--t-violet);
  --ad91: var(--t-olive);
  --ed: #1f8a70;            /* éditions départementales : cahiers généraux hors AP */
  --ap: #55514a;            /* Archives parlementaires : encre, pas une teinte de plus */
  --ap-surface: #e6e2d6;    /* bailliages dotés d'un cahier général */
  --g-1: #b5402f;           /* graphiques des Repères : accent (validé avec --g-2, clair et sombre) */
  --g-2: #2a6f9e;
  --lire: #2e8540;          /* points et disques : texte à lire ici — le vert, « c'est prêt » */
  --bulle: #1f1e1a;
  --bulle-texte: #f4f2ec;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "DejaVu Sans Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #1b1b19; --papier-2: #242320; --mer: #161b1e; --eau: #5f9cc4; --actuel: #c97aa3; --route: #d0a36b; --terre: #2f2d29; --terre-hors: #282723; --etranger: #1f1f1d;
    --trait: #4a4741; --trait-fort: #8c867a; --encre: #ebe7dd; --encre-2: #b8b2a5; --encre-3: #7f796e;
    --focus: #ebe7dd; --bulle: #ebe7dd; --bulle-texte: #1b1b19;
    --t-rouge: #d4634f; --t-bleu: #4f93c2; --t-ocre: #d6a23a; --t-violet: #9370c4; --t-vert: #3fa85a; --t-indigo: #6f84e0;
    --t-rose: #d9609e; --t-brun: #b08f3a; --t-orange: #e8904a; --t-olive: #9aae3a; --t-cyan: #3fb3c9; --t-bordeaux: #c25a7c;
    --ed: #3fae92; --ap: #b8b2a5; --ap-surface: #34322d;
    --g-1: #d4634f; --g-2: #4a96d8; --lire: #4cb562;
  }
}
:root[data-theme="dark"] {
  --papier: #1b1b19; --papier-2: #242320; --mer: #161b1e; --eau: #5f9cc4; --actuel: #c97aa3; --route: #d0a36b; --terre: #2f2d29; --terre-hors: #282723; --etranger: #1f1f1d;
  --trait: #4a4741; --trait-fort: #8c867a; --encre: #ebe7dd; --encre-2: #b8b2a5; --encre-3: #7f796e;
  --focus: #ebe7dd; --bulle: #ebe7dd; --bulle-texte: #1b1b19;
  --t-rouge: #d4634f; --t-bleu: #4f93c2; --t-ocre: #d6a23a; --t-violet: #9370c4; --t-vert: #3fa85a; --t-indigo: #6f84e0;
  --t-rose: #d9609e; --t-brun: #b08f3a; --t-orange: #e8904a; --t-olive: #9aae3a; --t-cyan: #3fb3c9; --t-bordeaux: #c25a7c;
  --ed: #3fae92; --ap: #b8b2a5; --ap-surface: #34322d;
  --g-1: #d4634f; --g-2: #4a96d8; --lire: #4cb562;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--encre);
  font: 15px/1.45 var(--serif);
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: inherit; text-decoration-color: var(--trait-fort); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- en-tête ---- */
.entete {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; align-items: end;
  padding: 18px 24px 14px; border-bottom: 1px solid var(--trait);
}
.entete h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; text-wrap: balance; }
.entete h1 a { color: inherit; text-decoration: none; }
.entete-sous { grid-column: 1; margin: 0; color: var(--encre-2); max-width: 62ch; }
.entete-sous #genere { color: var(--encre-3); font-family: var(--mono); font-size: 12px; }
.outils { grid-column: 2; grid-row: 1 / 3; display: flex; gap: 12px; align-items: center; }
.recherche { position: relative; }
.suggestions { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; z-index: 20; margin: 0; padding: 4px 0; list-style: none;
  background: var(--papier); border: 1px solid var(--trait-fort); border-radius: 3px; box-shadow: 0 6px 18px rgb(0 0 0 / 0.18); max-height: 340px; overflow-y: auto; }
.suggestions li { padding: 6px 10px; font-size: 14px; cursor: pointer; }
.suggestions li small { font: 11px var(--mono); color: var(--encre-3); margin-left: 4px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--papier-2); }
.suggestions li.vide { color: var(--encre-3); cursor: default; font-style: italic; }
.recherche input {
  font: 14px var(--serif); color: var(--encre); background: var(--papier-2);
  border: 1px solid var(--trait); border-radius: 3px; padding: 7px 10px; width: 240px;
}
.segment { display: inline-flex; border: 1px solid var(--trait); border-radius: 3px; overflow: hidden; }
.segment button {
  font: 500 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 12px; border: 0; background: transparent; color: var(--encre-2); cursor: pointer;
}
.segment button + button { border-left: 1px solid var(--trait); }
.segment button.actif { background: var(--encre); color: var(--papier); }

/* ---- corps : scène + rail ---- */
.corps { flex: 1; display: grid; grid-template-columns: 1fr 320px; min-height: 0; }
.scene { position: relative; background: var(--mer); min-height: 480px; overflow: hidden; }
#carte { width: 100%; height: 100%; display: block; }
.liste { padding: 16px 24px; overflow: auto; background: var(--papier); }
.rail {
  border-left: 1px solid var(--trait); background: var(--papier-2);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 22px; overflow: auto;
}
.accueil { margin: 0 0 14px; padding: 10px 12px; background: var(--terre); border-left: 3px solid var(--g-1); border-radius: 2px; font-size: 14px; line-height: 1.4; }
.accueil a { font-weight: 600; }
.bloc h2 {
  margin: 0 0 6px; font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--encre-3);
}
.aide { margin: 0 0 10px; font-size: 13px; color: var(--encre-2); }

/* ---- carte ---- */
.royaume { fill: var(--terre); stroke: var(--trait-fort); stroke-width: 0.9; vector-effect: non-scaling-stroke; }
.bailliage { fill: transparent; stroke: var(--trait); stroke-width: 0.5; stroke-opacity: 0.7; vector-effect: non-scaling-stroke; }
.bailliage.avec-cahier { fill: var(--ap-surface); cursor: pointer; }
.bailliage.avec-cahier.eteint { fill: transparent; cursor: default; }
.bailliage:hover { fill: var(--terre-hors); }
/* autour du royaume : terres étrangères en 1789, lacs, et la France d'aujourd'hui en repère */
.hors-royaume { fill: var(--etranger); stroke: none; pointer-events: none; }
.lac { fill: var(--mer); stroke: var(--eau); stroke-width: 0.6; vector-effect: non-scaling-stroke; pointer-events: none; }
.departement { fill: none; stroke: var(--actuel); stroke-width: 0.7; stroke-dasharray: 1 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.frontiere-actuelle { fill: none; stroke: var(--actuel); stroke-width: 1.4; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.noms-departements text { font-family: var(--mono); fill: var(--actuel); text-anchor: middle; letter-spacing: 0.04em; pointer-events: none;
  paint-order: stroke; stroke: var(--terre); stroke-width: 2px; stroke-linejoin: round; }
.voisin text { font: italic 600 13px var(--serif); fill: var(--encre-3); text-anchor: middle; letter-spacing: 0.06em; pointer-events: none;
  paint-order: stroke; stroke: var(--etranger); stroke-width: 3px; stroke-linejoin: round; }
.voisin .souverain { font-size: 10.5px; font-weight: 400; letter-spacing: 0.02em; }
.voisin.mer text { font-weight: 400; letter-spacing: 0.3em; fill: var(--eau); stroke: var(--mer); text-transform: uppercase; font-size: 11px; }
.voisin.enclave text { font-size: 11px; }
.voisin.rang-2 { display: none; }
.voisins.detail .voisin.rang-2 { display: inline; }
.bascule { position: absolute; left: 12px; top: 112px; padding: 5px 8px; font: 500 11px var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--papier); color: var(--encre-2); border: 1px solid var(--trait); border-radius: 2px; cursor: pointer; }
.bascule[aria-pressed="true"] { color: var(--encre); border-color: var(--actuel); box-shadow: inset 3px 0 0 var(--actuel); }
/* le cadre du royaume : fleuves, généralités, villes d'intendance et de cour souveraine */
.route { fill: none; stroke: var(--route); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.route.rang-1 { stroke-width: 2; }
.route.rang-2 { stroke-width: 0.9; display: none; }
.routes.detail .route.rang-2 { display: inline; }
.route.droit { stroke-dasharray: 3 2; }
.chemin-cassini { fill: none; stroke: var(--route); stroke-opacity: 0.45; stroke-width: 0.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.fleuve { fill: none; stroke: var(--eau); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.fleuve.rang-1 { stroke-width: 2.2; }
.fleuve.rang-2 { stroke-width: 1.5; }
.fleuve.rang-3 { stroke-width: 1; display: none; }
.fleuves.detail .fleuve.rang-3 { display: inline; }
.generalite { fill: none; stroke: var(--encre-2); stroke-opacity: 0.85; stroke-width: 1.7; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.ville circle { fill: var(--terre); stroke: var(--encre); stroke-width: 1.3; }
.ville.cour circle { fill: var(--encre); }
.ville text { font: 600 11.5px var(--serif); fill: var(--encre); paint-order: stroke; stroke: var(--terre); stroke-width: 3px; stroke-linejoin: round; letter-spacing: 0.02em; }
.ville { cursor: default; }
.chef-lieu { fill: var(--ap); stroke: var(--papier); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.chef-lieu.actif { stroke: var(--encre); stroke-width: 2.2; }
.etiquettes text {
  font-family: var(--serif); font-style: italic; fill: var(--encre-3); text-anchor: middle;
  pointer-events: none; paint-order: stroke; stroke: var(--terre); stroke-width: 2px; stroke-linejoin: round;
}
.pt { stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; stroke: var(--terre); }
.pt.u-lire { fill: var(--lire); }
.pt.u-voir { fill: var(--g-2); }
.pt.u-imprime { fill: var(--terre); stroke: var(--encre-2); stroke-width: 1.4; }
.pt.actif { stroke: var(--encre); stroke-width: 2.4; }
/* le royaume habité : une communauté de 1793 par cercle (carte.js, majPeuple) */
.communautes { pointer-events: none; vector-effect: non-scaling-stroke; }
.communautes.fond { fill: var(--encre-2); fill-opacity: 0.55; }
.peuple .communautes.lire { fill: var(--lire); }
.peuple .communautes.voir { fill: var(--g-2); }
.peuple .communautes.imprime { fill: var(--terre); stroke: var(--encre-2); stroke-width: 1; }
.peuple .communautes.hyslop { fill: var(--t-ocre); }
.peuple .communautes.aucun { fill: var(--encre-3); fill-opacity: 0.35; }
.peuple.approche .communautes { opacity: 0.75; }
.peuple.proche .communautes.aucun { fill: none; stroke: var(--encre-3); stroke-width: 0.8; stroke-opacity: 0.8; }
.teinte-aucune .bailliage.avec-cahier { fill: transparent; }
.bulle {
  position: absolute; pointer-events: none; background: var(--bulle); color: var(--bulle-texte);
  padding: 6px 9px; border-radius: 3px; font-size: 13px; line-height: 1.35; max-width: 260px;
  transform: translate(-50%, calc(-100% - 12px)); width: max-content; max-width: min(340px, calc(100% - 16px));
  white-space: normal; overflow-wrap: anywhere; text-wrap: pretty;
}
.bulle.dessous { transform: translate(-50%, 16px); }
.bulle small { display: block; opacity: 0.75; font-family: var(--mono); font-size: 11px; }
.zoom { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 1px; }
.zoom button {
  width: 30px; height: 30px; border: 1px solid var(--trait); background: var(--papier); color: var(--encre);
  font: 16px var(--mono); cursor: pointer;
}
.fond-note {
  position: absolute; left: 12px; bottom: 8px; margin: 0; max-width: 46ch;
  font-size: 11.5px; line-height: 1.3; color: var(--encre-3); text-align: left; pointer-events: none;
  background: color-mix(in srgb, var(--papier) 88%, transparent); padding: 6px 8px; border-radius: 2px;
}
.fond-note a { pointer-events: auto; color: inherit; }

/* ---- couverture : cinq degrés d'encre sur le bailliage, une seule teinte ---- */
.teinte-couverture .bailliage.avec-cahier { fill: transparent; }
.teinte-couverture .bailliage[data-degre="1"] { fill: var(--encre); fill-opacity: 0.08; }
.teinte-couverture .bailliage[data-degre="2"] { fill: var(--encre); fill-opacity: 0.18; }
.teinte-couverture .bailliage[data-degre="3"] { fill: var(--encre); fill-opacity: 0.30; }
.teinte-couverture .bailliage[data-degre="4"] { fill: var(--encre); fill-opacity: 0.44; }
.teinte-couverture .bailliage[data-degre="5"] { fill: var(--encre); fill-opacity: 0.60; }
.teinte-couverture .bailliage:hover { fill: var(--terre-hors); fill-opacity: 1; }
/* éditions imprimées numérisées : deux tons, paroisses éditées ou seulement les cahiers généraux */
.teinte-editions .bailliage.avec-cahier { fill: transparent; }
.teinte-editions .bailliage[data-edition="paroisses"] { fill: var(--encre); fill-opacity: 0.44; }
.teinte-editions .bailliage[data-edition="autre"] { fill: var(--encre); fill-opacity: 0.12; }
.teinte-editions .bailliage:hover { fill: var(--terre-hors); fill-opacity: 1; }
.editions-legende [data-edition="paroisses"] { opacity: 0.44; } .editions-legende [data-edition="autre"] { opacity: 0.12; }
.editions { padding-left: 1.1em; margin: 0 0 10px; font-size: 13px; }
.editions li { margin-bottom: 6px; }
.editions li.sans-paroisses { color: var(--encre-2); }
.hyslop .perdu { font-style: italic; color: var(--encre-3); }
.teinte { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.teinte input { accent-color: var(--encre); margin: 0 6px 0 0; }
.degres { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font: 11px var(--mono); color: var(--encre-2); }
.degres li { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.degres i { width: 14px; height: 10px; display: inline-block; background: var(--encre); opacity: 0.08; }
.degres [data-degre="2"] { opacity: 0.18; } .degres [data-degre="3"] { opacity: 0.30; } .degres [data-degre="4"] { opacity: 0.44; } .degres [data-degre="5"] { opacity: 0.60; }
.detail .couverture { margin: 0 0 8px; font-size: 14px; }
.detail .par-source { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; color: var(--encre-2); }
.detail .par-source .pastille { display: none; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.detail .par-source .pastille.carre { border-radius: 0; }

/* ---- légende / états ---- */
.legende, .etats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legende li { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; }
.legende input { margin: 4px 0 0; accent-color: var(--encre); }
.legende .nom { display: flex; align-items: baseline; gap: 8px; }
.legende .pastille { display: none; width: 10px; height: 10px; border-radius: 50%; flex: none; position: relative; top: -1px; }
.legende .pastille.carre { border-radius: 0; }
.legende .chiffres { grid-column: 2; font-family: var(--mono); font-size: 12px; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.legende .chiffres b { color: var(--encre); font-weight: 500; }
.legende .statut { font-size: 12px; color: var(--encre-3); font-style: italic; }
.legende .note { grid-column: 2; font-size: 12.5px; color: var(--encre-2); margin: 0; }
.etats li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

/* ---- détail du lieu ---- */
.detail h3 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.15; }
.detail .commune { margin: 2px 0 10px; font-size: 13px; color: var(--encre-2); }
.detail h4 { margin: 14px 0 6px; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--encre-3); }
.detail .commune .pastille { display: none; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.detail .commune .pastille.carre { border-radius: 1px; }
.detail ol + .commune { margin-top: 12px; }
.detail .commune .mono { font-family: var(--mono); font-size: 12px; }
.detail ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.detail li { border-top: 1px solid var(--trait); padding-top: 8px; font-size: 13.5px; }
.detail li .meta { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--encre-3); }
.detail li .ordre { display: block; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--encre-3); margin-bottom: 3px; }
.detail li a + .meta { display: inline; margin-left: 4px; }
.detail .avert { font-size: 12.5px; color: var(--encre-3); margin: 10px 0 0; }

/* ---- liste ---- */
.tableau-cadre { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--encre-3); position: sticky; top: 0; background: var(--papier); }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
td .pastille { display: none; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
tbody tr:hover { background: var(--papier-2); }

@media (max-width: 860px) {
  .entete { grid-template-columns: 1fr; }
  .outils { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .recherche input { width: 100%; }
  .corps { grid-template-columns: 1fr; }
  .scene { min-height: 60vh; }
  .rail { border-left: 0; border-top: 1px solid var(--trait); }
  .fond-note { display: none; }
}

/* ---- page de texte (a-propos.html) ---- */
body.page { min-height: 100vh; }
.lien-page { font: 500 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--encre-2); }
.lien-page:hover { color: var(--encre); }
.prose { max-width: 68ch; padding: 24px 24px 48px; margin: 0 auto; }
.prose h2 { margin: 28px 0 8px; font: 500 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--encre-3); }
.prose p, .prose li { margin: 0 0 12px; }
.prose ul { padding-left: 1.2em; }
.prose code { font: 13px var(--mono); }
.prose .tableau-cadre { margin: 0 0 12px; overflow-x: auto; }
.prose table { border-collapse: collapse; font-size: 13px; width: 100%; }
.prose th, .prose td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.prose th { font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--encre-3); }
.prose .num, .prose td.num { text-align: right; font-variant-numeric: tabular-nums; }
.prose td:nth-child(2) { white-space: nowrap; }
.licences { margin: 0 0 12px; font-size: 13px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.licences dt { font: 500 11px/1.6 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--encre-3); }
.licences dd { margin: 0; color: var(--encre-2); }
.pied { padding: 12px 24px; border-top: 1px solid var(--trait); font-size: 13px; color: var(--encre-2); text-align: center; }

/* ---- page Repères (reperes.html) ---- */
.reperes { max-width: 860px; position: relative; }
.reperes .chapeau { font-size: 17px; color: var(--encre-2); margin: 4px 0 20px; text-wrap: pretty; }
.reperes h2 { margin-top: 40px; }
.reperes h3 { margin: 0 0 6px; font-size: 21px; font-weight: 600; line-height: 1.2; text-wrap: balance; }
.reperes .source { font-size: 12.5px; color: var(--encre-3); }
.reperes .source a { color: inherit; }
.figure { position: relative; margin: 12px 0 8px; }
.figure svg { display: block; overflow: visible; font-family: var(--mono); }
.figure .tic { font-size: 11px; fill: var(--encre-3); }
.figure .titre-axe { font-size: 11px; fill: var(--encre-2); }
.figure .axe { stroke: var(--trait-fort); stroke-width: 1; }
.figure .grille line { stroke: var(--trait); stroke-width: 0.6; stroke-dasharray: 2 3; }
.figure .annot { font: italic 13px var(--serif); fill: var(--encre-2); }
.reperes .bulle { z-index: 2; transform: translate(-50%, calc(-100% - 14px)); white-space: normal; width: max-content; max-width: 260px; }
.cle { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--encre-2); }
.cle li { display: flex; align-items: center; gap: 6px; }
.cle i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cle i.trait { width: 18px; height: 0; border-radius: 0; border-top: 2px solid var(--encre); }

/* frise */
#frise .bande { fill: var(--g-1); opacity: 0.22; }
#frise .repere circle { fill: var(--papier); stroke: var(--encre); stroke-width: 2; }
#frise .repere.convocation circle { stroke: var(--g-2); }
#frise .repere.assemblees circle { stroke: var(--g-1); }
#frise .repere.revolution circle { fill: var(--encre); }
#frise .tige { stroke: var(--trait-fort); stroke-width: 1; }
#frise .etiquette { font: 13px var(--serif); fill: var(--encre); paint-order: stroke; stroke: var(--papier); stroke-width: 5px; stroke-linejoin: round; }
#frise .cible { fill: transparent; }
#frise .repere { cursor: default; outline: none; }
#frise .repere:hover .etiquette, #frise .repere:focus .etiquette { text-decoration: underline; }
#frise .repere:focus-visible circle { stroke-width: 3.5; }
.frise-liste { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.frise-liste li { display: contents; }
.frise-liste time { font: 12px/1.9 var(--mono); color: var(--encre-3); white-space: nowrap; }
.frise-liste .quoi { margin: 0; }
.frise-liste .quoi a { font-size: 12px; color: var(--encre-3); margin-left: 4px; }
.frise-liste .apres time { color: var(--encre-2); }
details.detail-frise summary { cursor: pointer; font: 500 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--encre-2); margin-top: 10px; }
@media (max-width: 640px) {
  #frise { display: none; }
  details.detail-frise { display: contents; }
  details.detail-frise summary { display: none; }
  .frise-liste { grid-template-columns: 1fr; gap: 0; }
  .frise-liste time { margin-top: 10px; }
}

/* schéma de la convocation (HTML, pour rester lisible sur téléphone) */
.convocation { list-style: none; margin: 14px 0 10px; padding: 0; }
.convocation .etage-nom { margin: 0 0 6px; font: 500 11.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--encre-3); }
.convocation .boites { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.convocation .boite { background: var(--terre); border: 1px solid var(--trait); border-top: 3px solid var(--encre-3); border-radius: 4px; padding: 8px 10px 6px; font-size: 13.5px; line-height: 1.35; display: flex; flex-direction: column; }
.convocation .boite.tiers { border-top-color: var(--g-1); }
.convocation .boite.clerge, .convocation .boite.noblesse { border-top-color: var(--g-2); }
.convocation .boite.trois { border-top-color: var(--encre); }
.convocation .boite.final { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.convocation .boite.final a { color: inherit; }
.convocation .boite.large { grid-column: 1 / -1; }
.convocation .boite b { font-size: 15px; font-weight: 600; }
.convocation .boite p { margin: 3px 0 4px; flex: 1; }
.convocation .ordre { font: 500 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--encre-3); margin-bottom: 2px; }
.convocation .art { font: 11px var(--mono); color: var(--encre-3); }
.convocation .passage { text-align: center; margin: 6px 0; font: 12px var(--mono); color: var(--encre-2); }
.reperes sup, .reperes .quoi a, .reperes p > a[href^="#s"], .reperes dd > a[href^="#s"], .convocation a[href^="#s"] { font-size: 11px; vertical-align: super; line-height: 0; text-decoration: none; margin-left: 1px; }

/* députés, calendrier, reste */
#fig-deputes .regle { fill: none; stroke: var(--encre); stroke-width: 2; }
#fig-deputes .obs { stroke: var(--papier); stroke-width: 1; }
#fig-deputes .obs.conforme { fill: var(--g-2); fill-opacity: 0.55; }
#fig-deputes .obs.ecart { fill: var(--g-1); }
#fig-deputes .obs:hover { stroke: var(--encre); stroke-width: 2; }
.cle i.conforme { background: var(--g-2); opacity: 0.55; }
.cle i.ecart { background: var(--g-1); }
#fig-calendrier .barre { fill: var(--g-1); }
#fig-calendrier .barre:hover { fill: var(--encre); }
#fig-calendrier .nom-serie { font: 14px var(--serif); fill: var(--encre); }
#fig-calendrier .reperage { stroke: var(--encre); stroke-width: 1; stroke-dasharray: 3 3; }
#fig-reste .valeur { font: 600 16px var(--serif); fill: var(--encre); }
#fig-reste .libelle { font: 14px var(--serif); fill: var(--encre-2); }
#fig-reste .barre-reste { fill: var(--encre-3); }
#fig-reste .barre-reste.en-ligne { fill: var(--g-1); }
#fig-reste .barre-incertaine { fill: none; stroke: var(--encre-3); stroke-dasharray: 3 3; }

/* glossaire */
.mots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 12px 0; padding: 0; }
.mots div { background: var(--papier-2); border-radius: 4px; padding: 10px 12px; }
.mots dt { font-weight: 600; font-size: 16px; }
.mots dd { margin: 2px 0 0; font-size: 13.5px; color: var(--encre-2); }
.sources-liste { font-size: 13px; color: var(--encre-2); padding-left: 1.4em; }
.sources-liste li { margin-bottom: 6px; }
.sources-liste a { word-break: break-word; }


/* ---- page de lecture d'un document (texte.html) ---- */
.prose.lecture { max-width: 1240px; }
.lecture .tete { max-width: 76ch; }
.lecture h3.titre-doc { margin: 0 0 6px; font-size: 24px; font-weight: 600; line-height: 1.2; text-wrap: balance; }
.lecture .fiche { color: var(--encre-2); }
.lecture .mono { font: 13px var(--mono); }
.avertissement { margin: 16px 0 24px; padding: 12px 14px; background: var(--terre); border-left: 3px solid var(--g-1); border-radius: 2px; font-size: 14.5px; line-height: 1.45; }
.avertissement p:last-child { margin-bottom: 0; }
.legende-lecture { font-size: 13.5px; color: var(--encre-2); }
.bouton { display: inline-block; margin: 2px 8px 2px 0; padding: 6px 10px; border: 1px solid var(--trait-fort); border-radius: 2px; background: var(--encre); color: var(--papier); text-decoration: none; font-size: 14px; }
.bouton.secondaire { background: transparent; color: var(--encre); }
.bouton:hover { opacity: 0.85; }
.page-lue { margin: 0 0 28px; }
.page-lue h4 { margin: 0 0 8px; padding-top: 10px; border-top: 1px solid var(--trait); font: 500 12px var(--mono); letter-spacing: 0.06em; color: var(--encre-3); }
.vis-a-vis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cliche { margin: 0; position: sticky; top: 12px; justify-self: center; width: min(100%, calc((100vh - 32px) * var(--format))); }
.cliche .cadre { position: relative; overflow: hidden; width: 100%; background: var(--terre-hors); border: 1px solid var(--trait); }
.cliche .plan { position: absolute; inset: 0; transform-origin: 0 0; transition: transform 0.35s ease; }
.cliche .cadre:has(.plan[style*="scale"]) { cursor: grab; touch-action: none; }
.cliche img, .cliche svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cliche .cadre { user-select: none; -webkit-user-select: none; }
.cliche img { pointer-events: none; }
.cliche polygon { fill: transparent; stroke: transparent; stroke-width: 3; vector-effect: non-scaling-stroke; cursor: pointer; }
.cliche polygon.vise { fill: rgb(214 162 58 / 0.18); stroke: #d6a23a; }
.cliche polygon.choisie { fill: rgb(214 162 58 / 0.10); stroke: #d4634f; }
.cliche .entiere { position: absolute; right: 8px; top: 8px; padding: 4px 8px; font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; background: var(--papier); color: var(--encre); border: 1px solid var(--trait-fort); border-radius: 2px; cursor: pointer; }
.texte-lu { font-size: 16px; line-height: 1.5; }
.texte-lu .l { padding: 1px 6px; margin: 0 -6px; border-radius: 2px; cursor: pointer; overflow-wrap: anywhere; }
.texte-lu .l.vise { background: rgb(214 162 58 / 0.22); }
.texte-lu .l.choisie { box-shadow: inset 3px 0 0 #d4634f; background: rgb(214 162 58 / 0.12); }
.texte-lu .l.hors, .hors-ex { color: var(--encre-3); cursor: default; }
.doute { display: inline-block; padding: 0 3px; margin-left: 1px; font: 500 11px/1.3 var(--mono); color: var(--papier); background: var(--encre-3); border-radius: 2px; vertical-align: 1px; }
.marque { font-style: italic; font-size: 0.85em; color: var(--encre-3); }
.marque::before { content: "["; } .marque::after { content: "]"; }
.lecture del { text-decoration-color: #d4634f; text-decoration-thickness: 2px; }
@media (max-width: 800px) {
  .vis-a-vis { grid-template-columns: 1fr; gap: 10px; }
  /* l'image reste en haut de l'écran, réduite, pendant qu'on lit sa page */
  .cliche { top: 0; z-index: 2; width: 100%; padding: 6px 0; background: var(--papier); box-shadow: 0 6px 10px -6px rgb(0 0 0 / 0.5); }
  .cliche .cadre { width: min(100%, calc(44vh * var(--format))); width: min(100%, calc(44svh * var(--format))); margin: 0 auto; }
}
.detail a.lire { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--trait-fort); border-radius: 2px; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.detail a.lire:hover { background: var(--encre); color: var(--papier); }

/* ---- téléphone : en-tête resserré, carte plus haute, fiche en panneau au bas de l'écran ---- */
.fermer-fiche { display: none; }
.villes.serre .ville:not(.cour) text { display: none; }
@media (max-width: 640px) {
  .entete { padding: 10px 14px 10px; gap: 6px; }
  .entete h1 { font-size: 20px; }
  .entete-sous { display: none; }
  .outils { gap: 8px 10px; }
  .recherche { flex: 1 1 100%; order: -1; }
  .lien-page { font-size: 11px; }
  .segment button { padding: 6px 10px; }
  .scene { min-height: 0; height: 72vh; height: 72svh; }
  .bascule { top: 112px; font-size: 10px; padding: 4px 6px; }
  .rail { padding: 14px 16px; }
  .detail.ouverte {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 62vh; max-height: 62svh; overflow-y: auto;
    margin: 0; padding: 12px 16px 20px; background: var(--papier); border-top: 1px solid var(--trait-fort);
    box-shadow: 0 -8px 24px rgb(0 0 0 / 0.35); border-radius: 10px 10px 0 0; overscroll-behavior: contain;
  }
  .detail.ouverte .fermer-fiche {
    display: block; position: sticky; top: 0; margin: -4px 0 6px auto; padding: 6px 12px; z-index: 1;
    font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
    background: var(--papier-2); color: var(--encre); border: 1px solid var(--trait-fort); border-radius: 14px; cursor: pointer;
  }
  .ville text { font-size: 13px; }
}
.page-lue.seule .texte-lu { max-width: 42em; }
.page-lue.seule .texte-lu .l { cursor: auto; }
