/* PoliMap — feuille de style unique. Lisibilité de texte long avant tout. */

:root {
  --fond: #fbfaf8;
  --fond-2: #f2efe9;
  --fond-3: #e8e4dc;
  --texte: #1e1c19;
  --texte-2: #5c574f;
  --trait: #d8d3c8;
  --accent: #7a4b2a;
  --accent-clair: #b8825c;
  --neg: #6b7fa8;
  --pos: #a86b6b;
  --alerte-fond: #fdf4e3;
  --alerte-trait: #d9a441;
  --ok: #4a7a52;
  --largeur: 44rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #16150f; --fond-2: #1f1e17; --fond-3: #2b2920;
    --texte: #e8e4da; --texte-2: #a39d90; --trait: #37342a;
    --accent: #d2a077; --accent-clair: #b8825c;
    --neg: #8fa4cc; --pos: #cc8f8f;
    --alerte-fond: #2a2318; --alerte-trait: #a37b2c;
    --ok: #7aa882;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 17px/1.65 Charter, Georgia, "Iowan Old Style", serif;
}
.saut { position: absolute; left: -9999px; }
.saut:focus { left: 1rem; top: .5rem; background: var(--fond); padding: .5rem; z-index: 10; }

/* ---- structure ---- */
.entete {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--trait);
  background: var(--fond-2); position: sticky; top: 0; z-index: 5;
}
.marque { font-weight: 700; font-size: 1.15rem; color: var(--texte); text-decoration: none; letter-spacing: -.01em; }
.entete nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .88rem; font-family: system-ui, sans-serif; }
.entete nav a { color: var(--texte-2); text-decoration: none; }
.entete nav a:hover { color: var(--accent); text-decoration: underline; }
.entete nav > a, .entete nav details.menu > summary {
  /* Le trait est la des le depart, transparent : le surlignage de la section
     courante ne doit pas decaler la barre d'une page a l'autre. */
  border-bottom: 2px solid transparent; padding-bottom: .15rem;
}
.entete nav > a.actif, .entete nav details.menu.actif > summary {
  color: var(--texte); border-bottom-color: var(--accent);
}
.entete nav > a.actif:hover { text-decoration: none; }

/* Le menu deroulant des analyses, dans l'entete.
   Quatre entrees dans la barre de navigation la faisaient deborder sur mobile et
   mettaient les analyses au meme rang que le reste du site ; un menu les groupe
   sans les cacher. */

.entete nav details.menu { position: relative; }
.entete nav details.menu > summary { cursor: pointer; list-style: none; }
.entete nav details.menu > summary::-webkit-details-marker { display: none; }
.entete nav details.menu > summary::after { content: " ▾"; font-size: .8em; }
.entete nav details.menu > summary:hover,
.entete nav details.menu[open] > summary { color: var(--accent); }

.entete nav .menu-liste {
  position: absolute; z-index: 30; top: calc(100% + .55rem); left: -.5rem;
  min-width: 17rem; max-width: calc(100vw - 2rem);
  background: var(--fond); border: 1px solid var(--trait); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .13); padding: .35rem;
}
.entete nav .menu-liste a {
  display: block; padding: .45rem .55rem; border-radius: 4px;
  color: var(--texte); text-decoration: none; line-height: 1.3;
}
.entete nav .menu-liste a:hover { background: var(--fond-2); text-decoration: none; }
.entete nav .menu-liste a[aria-current] {
  background: var(--fond-2); box-shadow: inset 2px 0 0 var(--accent);
}
.entete nav .menu-liste strong { display: block; font-size: .88rem; font-weight: 600; }
.entete nav .menu-liste span { display: block; font-size: .76rem; color: var(--texte-2); }

/* Sur un ecran etroit, le panneau ancre sous son libelle depasse du bord droit.
   On l'ancre alors sous l'entete entiere, dont il epouse la largeur. */
@media (max-width: 600px) {
  .entete nav details.menu { position: static; }
  .entete nav .menu-liste { left: 1rem; right: 1rem; min-width: 0; max-width: none; }
}
main { max-width: var(--largeur); margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
main.accueil, main.test-page { max-width: 58rem; }
.pied {
  border-top: 1px solid var(--trait); padding: 1.5rem; text-align: center;
  color: var(--texte-2); font-size: .82rem; font-family: system-ui, sans-serif;
}
.pied p { margin: .3rem 0; }

/* ---- typographie ---- */
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; margin: 2.4rem 0 .8rem; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; margin: 1.8rem 0 .5rem; }
h4 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
p, li { overflow-wrap: break-word; }
a { color: var(--accent); text-underline-offset: 2px; }
.ancre { opacity: 0; margin-left: .4rem; text-decoration: none; font-weight: 400; color: var(--texte-2); }
h1:hover .ancre, h2:hover .ancre, h3:hover .ancre { opacity: .5; }
code {
  font: .88em/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--fond-3); padding: .1em .35em; border-radius: 3px;
}
pre {
  background: var(--fond-2); border: 1px solid var(--trait); border-radius: 6px;
  padding: .9rem 1rem; overflow-x: auto; font-size: .84rem; line-height: 1.5;
}
pre code { background: none; padding: 0; }
blockquote {
  margin: 1.2rem 0; padding: .1rem 1.1rem; border-left: 3px solid var(--accent-clair);
  color: var(--texte-2);
}
hr { border: 0; border-top: 1px solid var(--trait); margin: 2.5rem 0; }
.chapo { font-size: 1.08rem; color: var(--texte-2); }
.fil { font-size: .82rem; color: var(--texte-2); font-family: system-ui, sans-serif; margin: 0 0 .8rem; }
.compte { font-family: system-ui, sans-serif; font-size: .9rem; color: var(--texte-2); }

.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-family: system-ui, sans-serif; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-weight: 600; background: var(--fond-2); }

.alerte {
  background: var(--alerte-fond); border-left: 3px solid var(--alerte-trait);
  padding: .8rem 1rem; margin: 1.2rem 0; font-size: .94rem; border-radius: 0 4px 4px 0;
}
.alerte ul { margin: .4rem 0 0; padding-left: 1.2rem; }

/* ---- badges ---- */
.badge, .tag {
  display: inline-block; font: 600 .68rem/1 system-ui, sans-serif; text-transform: uppercase;
  letter-spacing: .04em; padding: .28em .5em; border-radius: 3px; vertical-align: middle;
  background: var(--fond-3); color: var(--texte-2);
}
.badge-brouillon { background: var(--alerte-fond); color: var(--alerte-trait); }
.tag-deduit { background: var(--fond-3); color: var(--accent); }
.tag-peripherique { background: var(--fond-3); color: var(--texte-2); }
/* L'absence de position doit se voir sans etre criarde : c'est une information
   sur la doctrine, pas un defaut de la fiche. */
.tag-sans-position { background: var(--fond-3); color: var(--texte-2); font-style: italic; }
.tag-structurante { background: var(--fond-3); color: var(--accent); font-weight: 600; }
.tag-pose, .tag-ok { background: transparent; color: var(--ok); border: 1px solid currentColor; }
.tag-manque { background: var(--alerte-fond); color: var(--alerte-trait); }
.conf-haute { color: var(--ok); }
.conf-moyenne { color: var(--texte-2); }
.conf-basse { color: var(--alerte-trait); }

/* ---- accueil ---- */
.hero { padding: 1rem 0 2rem; }
.hero h1 { font-size: 2.4rem; max-width: 22ch; }
.cta { margin-top: 1.6rem; display: flex; gap: .7rem; flex-wrap: wrap; }
.bouton {
  display: inline-block; background: var(--accent); color: var(--fond); padding: .6rem 1.1rem;
  border-radius: 4px; text-decoration: none; font: 600 .95rem system-ui, sans-serif;
}
.bouton-2 { background: transparent; color: var(--accent); border: 1px solid var(--trait); }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 2rem 0; }
.chiffres div { background: var(--fond-2); border: 1px solid var(--trait); border-radius: 6px; padding: 1rem; }
.chiffres strong { display: block; font-size: 1.9rem; color: var(--accent); line-height: 1.1; }
.chiffres span { font-size: .84rem; color: var(--texte-2); font-family: system-ui, sans-serif; }
.etapes li { margin-bottom: .7rem; }
.honnete { background: var(--fond-2); border: 1px solid var(--trait); border-radius: 6px; padding: .2rem 1.2rem 1rem; }

/* ---- cartes ---- */
.cartes { list-style: none; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.cartes a {
  display: block; padding: .8rem .9rem; border: 1px solid var(--trait); border-radius: 6px;
  text-decoration: none; color: var(--texte); background: var(--fond-2); height: 100%;
}
.cartes a:hover { border-color: var(--accent-clair); }
.cartes strong { display: block; margin-bottom: .25rem; }
.cartes .q { display: block; font-size: .84rem; color: var(--texte-2); margin-top: .3rem; }
.cartes .tag { float: right; margin-left: .4rem; }
.fam { margin-bottom: 2.2rem; }
.sous { color: var(--texte-2); font-size: .9rem; margin-top: -.4rem; }

/* ---- fiche d'axe ---- */
.question { font-size: 1.15rem; color: var(--texte-2); font-style: italic; }
.echelle { background: var(--fond-2); border: 1px solid var(--trait); border-radius: 6px; padding: 1rem; margin: 1.5rem 0; }
.echelle-poles { display: flex; justify-content: space-between; font: 600 .8rem system-ui, sans-serif; color: var(--texte-2); }
.echelle-poles span:first-child { color: var(--neg); }
.echelle-poles span:last-child { color: var(--pos); }
.grads { list-style: none; padding: 0; margin: .8rem 0 0; }
.grads li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .2rem .7rem; padding: .45rem 0; border-top: 1px solid var(--trait); }
.grads .val { font: 600 .8rem ui-monospace, monospace; color: var(--texte-2); padding-top: .15rem; }
.grads .courant { grid-column: 2; font-size: .88rem; color: var(--texte-2); }
.lies ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.lies li a { display: inline-block; padding: .3rem .6rem; background: var(--fond-2); border: 1px solid var(--trait); border-radius: 4px; font-size: .85rem; text-decoration: none; }

/* ---- profil de doctrine ---- */
.periode { color: var(--texte-2); font-size: .9rem; margin-top: -.6rem; }
.confiance { font-family: system-ui, sans-serif; font-size: .88rem; }
.profil .ligne { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr 2.6rem; gap: .7rem; align-items: center; padding: .3rem 0; }
.profil .lab { font-size: .85rem; }
.profil .lab a { color: var(--texte); text-decoration: none; }
.profil .lab a:hover { color: var(--accent); }
.profil .barre { position: relative; height: 1.5rem; background: linear-gradient(90deg, var(--neg), var(--fond-3) 50%, var(--pos)); border-radius: 3px; opacity: .55; }
.profil .axe0 { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--texte-2); }
.profil .point { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; background: var(--texte); border: 2px solid var(--fond); border-radius: 50%; }
.profil .v { font: 600 .8rem ui-monospace, monospace; color: var(--texte-2); text-align: right; }
/* Plages de valeurs : le motif dit la nature. Pleine, la position bouge ; rayée, on
   sait mal où elle est ; cerclée, toute la bande est acceptée. */
.profil .plage, .plage-cle { position: absolute; top: 22%; bottom: 22%; border-radius: 3px; box-sizing: border-box; }
.plage-variabilite { background: var(--texte); opacity: .35; }
.plage-incertitude { background: repeating-linear-gradient(135deg, var(--texte) 0 2px, transparent 2px 5px); opacity: .55; }
.plage-latitude { border: 2px solid var(--texte); background: color-mix(in srgb, var(--texte) 12%, transparent); opacity: .7; }
.profil .plage.pt-fac { top: 50%; bottom: 8%; }
.profil .plage.pt-doc { top: 8%; bottom: 50%; }
.profil .plage.pt-fac.plage-variabilite { background: var(--accent); }
.plage-cle { position: relative; display: inline-block; width: 1.6rem; height: .7rem; vertical-align: middle; top: auto; bottom: auto; }
.legende-plages { font: .82rem/1.7 system-ui, sans-serif; color: var(--texte-2); }
.plage-note { display: block; margin-top: .45rem; padding-top: .4rem; border-top: 1px dashed var(--trait); }
.tag-plage { background: var(--fond-3); color: var(--texte-2); }
.profil .note { grid-column: 1/-1; font-size: .85rem; color: var(--texte-2); background: var(--fond-2); border-left: 2px solid var(--accent-clair); padding: .5rem .8rem; margin: .1rem 0 .6rem; }
.sources li { font-size: .88rem; margin-bottom: .4rem; }

/* ---- idées reçues / sources ---- */
.piege, .src-bloc { border: 1px solid var(--trait); border-radius: 6px; margin: .5rem 0; background: var(--fond-2); }
.piege summary, .src-bloc summary { padding: .7rem .9rem; cursor: pointer; font-weight: 600; font-size: .95rem; }
.piege summary::marker, .src-bloc summary::marker { color: var(--texte-2); }
.piege .src { display: block; font: 400 .78rem system-ui, sans-serif; color: var(--texte-2); margin-top: .15rem; }
.piege > *:not(summary), .src-bloc > *:not(summary) { padding: 0 .9rem; }
.piege > p:last-child, .src-bloc ul { padding-bottom: .8rem; }
.src-bloc summary .tag { float: right; }
.lien-axe { font-size: .85rem; }

/* ---- questionnaire ---- */
.test-page main { max-width: 52rem; }
.barre-progres { position: sticky; top: 4rem; background: var(--fond); padding: .6rem 0; z-index: 4; border-bottom: 1px solid var(--trait); margin-bottom: 1.5rem; }
.barre-progres .piste { height: 5px; background: var(--fond-3); border-radius: 3px; overflow: hidden; }
.barre-progres .fait { height: 100%; background: var(--accent); transition: width .25s; }
.barre-progres .txt { font: .82rem system-ui, sans-serif; color: var(--texte-2); margin-top: .35rem; display: flex; justify-content: space-between; }
.q-axe { border: 1px solid var(--trait); border-radius: 8px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; background: var(--fond-2); }
.q-axe.repondu { border-color: var(--accent-clair); }
.q-axe h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.q-axe .q-txt { color: var(--texte-2); font-size: .92rem; margin: 0 0 .9rem; font-style: italic; }
.curseur { width: 100%; margin: .4rem 0 .2rem; accent-color: var(--accent); }
/* La plage : deux curseurs natifs superposes sur un meme rail. Leurs pistes sont
   transparentes et ignorent le pointeur ; seules les poignees le captent. */
.plage-q { --poignee: 18px; position: relative; height: 1.6rem; margin: .4rem 0 .2rem; cursor: pointer; }
.plage-q[hidden], .curseur[hidden] { display: none; }
.plage-q::before { content: ""; position: absolute; left: calc(var(--poignee) / 2); right: calc(var(--poignee) / 2); top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--fond-3); }
.plage-q .pq-bande { position: absolute; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--accent); }
.plage-q input { position: absolute; left: 0; top: 50%; width: 100%; height: var(--poignee); margin: calc(var(--poignee) / -2) 0 0; padding: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; z-index: 1; }
.plage-q input.dessus { z-index: 2; }
.plage-q input:focus { outline: none; }
.plage-q input::-webkit-slider-runnable-track { height: var(--poignee); background: none; border: 0; }
.plage-q input::-moz-range-track { height: var(--poignee); background: none; border: 0; }
.plage-q input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; box-sizing: border-box; width: var(--poignee); height: var(--poignee); border-radius: 50%; background: var(--accent); border: 2px solid var(--fond); box-shadow: 0 0 0 1px var(--accent); cursor: grab; }
.plage-q input::-moz-range-thumb { pointer-events: auto; width: var(--poignee); height: var(--poignee); box-sizing: border-box; border-radius: 50%; background: var(--accent); border: 2px solid var(--fond); box-shadow: 0 0 0 1px var(--accent); cursor: grab; }
.plage-q input:active::-webkit-slider-thumb { cursor: grabbing; }
.plage-q input:active::-moz-range-thumb { cursor: grabbing; }
.plage-q input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-clair); }
.plage-q input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-clair); }
.outils-q .b-plage[aria-pressed="true"] { border-color: var(--accent-clair); color: var(--accent); }
.poles { display: flex; justify-content: space-between; font: .78rem system-ui, sans-serif; color: var(--texte-2); }
.poles b { font-weight: 600; }
.lecture { text-align: center; font: 600 .92rem system-ui, sans-serif; margin: .5rem 0 0; min-height: 1.4em; }
.lecture .nul { color: var(--texte-2); font-weight: 400; }
.outils-q { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .7rem; font: .82rem system-ui, sans-serif; }
.outils-q button { background: none; border: 1px solid var(--trait); border-radius: 4px; padding: .25rem .6rem; cursor: pointer; color: var(--texte-2); font: inherit; }
.outils-q button:hover { border-color: var(--accent-clair); color: var(--accent); }

/* ---- repondre ou deduire ------------------------------------------------
   Chaque axe porte le choix, et le cout du choix. Un axe deduit reste visible,
   grise et non modifiable, avec le bouton qui le rend a l'utilisateur : c'est
   ce qui distingue « je laisse estimer » de « on a decide pour moi ». */

.q-axe .mode {
  margin: .7rem 0 0; font: .82rem/1.5 system-ui, sans-serif; color: var(--texte-2);
}
.q-axe .mode button {
  background: none; border: 1px solid var(--trait); border-radius: 4px;
  padding: .2rem .55rem; cursor: pointer; color: var(--texte-2);
  font: inherit; white-space: nowrap;
}
.q-axe .mode button:hover { border-color: var(--accent-clair); color: var(--accent); }
.q-axe .alerte-inline { color: var(--accent); }

.q-axe.q-deduit { background: var(--fond); border-style: dashed; }
.q-axe.q-deduit h3, .q-axe.q-deduit .q-txt, .q-axe.q-deduit .poles { opacity: .75; }
.q-axe.q-deduit .curseur { opacity: .5; cursor: not-allowed; }
.q-axe.q-deduit .outils-q { display: none; }
.imp { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .4rem; color: var(--texte-2); }
.imp-niveaux { display: inline-flex; }
.outils-q .imp button { border-radius: 0; margin-left: -1px; }
.outils-q .imp button:first-of-type { border-radius: 4px 0 0 4px; margin-left: 0; }
.outils-q .imp button:last-of-type { border-radius: 0 4px 4px 0; }
.outils-q .imp button[aria-checked="true"] { position: relative; border-color: var(--accent-clair); color: var(--accent); font-weight: 600; }
.outils-q .imp-aide { flex-basis: 100%; font-size: .78rem; color: var(--texte-2); }
.outils-q .imp-aide[hidden] { display: none; }
.pieges-q { margin-top: .7rem; font-size: .88rem; }
.pieges-q summary { cursor: pointer; color: var(--texte-2); font: .82rem system-ui, sans-serif; }
.pieges-q ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.section-emp { border: 1px dashed var(--alerte-trait); border-radius: 8px; padding: .2rem 1rem 1rem; margin: 2rem 0; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; margin: 2rem 0; }

/* ---- résultats ---- */
/* Le plan interactif : filtres au-dessus, outils en dessous, liste repliée. */
.plan-interactif { font: .84rem system-ui, sans-serif; margin: 1rem 0; }
.plan-filtres { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.plan-filtres fieldset { border: 0; padding: 0; margin: 0; }
.plan-filtres legend { color: var(--texte-2); font-size: .76rem; padding: 0; margin-bottom: .2rem; }
.plan-filtres fieldset > div { display: flex; flex-wrap: wrap; gap: .3rem .5rem; }
.plan-filtres label {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  border: 1px solid var(--trait); border-radius: 999px; padding: .15rem .6rem .15rem .4rem;
  background: var(--fond-2);
}
/* `display` l'emporterait sur l'attribut `hidden` : une case retiree resterait
   visible (« les 22 composantes », qui n'a de sens que pour les cos²). */
.plan-filtres label[hidden] { display: none; }
.plan-filtres input { margin: 0; accent-color: var(--accent); }
.pf-n { color: var(--texte-2); font-size: .74rem; }
.pf-cle { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; flex: none; }
.pf-cle.pf-carre { border-radius: 1px; background: var(--texte-2); }
.pf-cle.pf-creux { background: transparent; border: 2px solid var(--texte-2); }
.plan-cadre { position: relative; margin: .7rem 0 .4rem; }
.plan-cadre svg {
  display: block; width: 100%; height: auto; background: var(--fond);
  user-select: none; -webkit-user-select: none; cursor: crosshair;
}
.plan-cadre.en-zoom svg { touch-action: none; }
.plan-cadre .p-pt { cursor: pointer; }
.plan-cadre .p-zone-zoom { fill: var(--accent); fill-opacity: .08; stroke: var(--accent); stroke-dasharray: 4 3; }
.plan-info {
  position: absolute; z-index: 3; pointer-events: none; max-width: 17rem;
  background: var(--fond); border: 1px solid var(--trait); border-radius: 4px;
  padding: .4rem .6rem; font: .78rem/1.45 system-ui, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.plan-info .pi-aide { color: var(--texte-2); font-size: .72rem; }
.plan-barre { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.pb-groupe { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.pb-plages { display: inline-flex; align-items: center; gap: .3rem; font: .82rem system-ui, sans-serif; color: var(--texte-2); cursor: pointer; }
.plan-info .pi-plages { display: block; margin-top: .2rem; color: var(--texte-2); font-size: .75rem; }
.plan-barre button {
  background: none; border: 1px solid var(--trait); border-radius: 4px; padding: .22rem .6rem;
  cursor: pointer; color: var(--texte-2); font: inherit;
}
.plan-barre button:hover:not(:disabled) { border-color: var(--accent-clair); color: var(--accent); }
.plan-barre button:disabled { opacity: .45; cursor: default; }
.plan-barre button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--fond); }
.plan-etat { color: var(--texte-2); font-size: .78rem; margin: .4rem 0; }
.plan-liste .pl-groupes { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .2rem 1.2rem; }
.plan-liste h4 { margin: .6rem 0 .2rem; font-size: .82rem; display: flex; align-items: center; gap: .35rem; }
.plan-liste ul { list-style: none; padding: 0; margin: 0; }
.plan-liste li { display: flex; justify-content: space-between; gap: .5rem; padding: .08rem 0; }
.plan-liste label { cursor: pointer; }
.plan-liste .pl-fiche { font-size: .72rem; color: var(--texte-2); white-space: nowrap; }
.deduit-carte { background: var(--fond-2); border: 1px solid var(--trait); border-left: 3px solid var(--accent-clair); border-radius: 0 6px 6px 0; padding: .8rem 1rem; margin-bottom: .7rem; }
.deduit-carte h4 { margin: 0 0 .3rem; }
.formule { font: .82rem ui-monospace, monospace; color: var(--texte-2); background: var(--fond-3); padding: .4rem .6rem; border-radius: 4px; overflow-x: auto; }
.proches li { margin-bottom: .35rem; }
.proches .dist { font: .8rem ui-monospace, monospace; color: var(--texte-2); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 1.5rem 1rem 3rem; }
  .hero h1 { font-size: 1.8rem; }
  .profil .ligne { grid-template-columns: 1fr 2.6rem; }
  .profil .barre { grid-column: 1/-1; }
  /* Plus collante sur mobile, ou elle mangerait un tiers de l'ecran, mais
     positionnee quand meme : le panneau du menu s'y accroche. */
  .entete { position: relative; }
  .barre-progres { top: 0; }
}
@media print {
  .entete, .pied, .actions, .barre-progres { display: none; }
}

/* ---- pays par periode ----------------------------------------------------
   Une frise, parce qu'une periode se lit d'abord dans sa place par rapport aux
   autres, et que les trous de couverture doivent se voir. */

.frise { list-style: none; padding: 0; margin: .6rem 0 1.2rem; border-left: 2px solid var(--trait); }
.frise li { position: relative; margin: 0 0 .1rem; }
.frise li > a {
  display: block; padding: .6rem .9rem; text-decoration: none; color: var(--texte);
  border-radius: 0 6px 6px 0;
}
.frise li > a:hover { background: var(--fond-2); text-decoration: none; }
.frise li > a::before {
  content: ""; position: absolute; left: -6px; top: 1.05rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--fond);
}
.frise-date { display: block; font: .78rem system-ui, sans-serif; color: var(--texte-2); }
.frise strong { display: block; font-size: 1.02rem; }
.frise .q { display: block; font-size: .88rem; color: var(--texte-2); }
.frise .tag { margin-top: .3rem; display: inline-block; }
.fil-periodes { font: .85rem system-ui, sans-serif; color: var(--texte-2); margin: -.4rem 0 1.2rem; }
.note-de_jure { border-left-color: var(--accent-clair); }

/* ---- fiches de personnages politiques ---- */
.fonctions { list-style: none; padding: 0; margin: .4rem 0 1rem; font-size: .88rem; color: var(--texte-2); }
.fonctions li { display: inline-block; margin-right: .8rem; }
.fonctions li::before { content: "· "; }
.legende-perso { font: .85rem system-ui, sans-serif; color: var(--texte-2); display: flex; align-items: center; gap: .3rem; }
.pt-doc, .pt-fac { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; }
.pt-doc { background: transparent; border: 2px solid var(--texte); }
.pt-fac { background: var(--accent); border: 2px solid var(--fond); }
.profil-perso .point.pt-doc { background: transparent; border: 2px solid var(--texte); }
.profil-perso .point.pt-fac { background: var(--accent); border: 2px solid var(--fond); z-index: 2; }
.profil-perso .ligne.a-ecart { background: var(--alerte-fond); border-radius: 4px; }
.profil-perso .ligne.a-ecart .lab a { font-weight: 700; }
.profil-perso .v { font-size: .72rem; white-space: nowrap; }
.profil .ligne { grid-template-columns: minmax(8rem, 13rem) 1fr 4.2rem; }
.ecart { background: var(--fond-2); border-left: 3px solid var(--alerte-trait); border-radius: 0 5px 5px 0; padding: .7rem 1rem; margin-bottom: .7rem; }
.ecart h4 { margin: 0 0 .3rem; }
.ecart p { margin: 0; font-size: .93rem; }

/* ---- sources et bibliographie -------------------------------------------
   Le projet est pédagogique : une source n'est pas une note de bas de page à
   vérifier, c'est une lecture proposée. D'où deux traitements distincts —
   la citation inline, discrète, et la fiche de lecture, mise en avant. */

.chapo-2 {
  font: .92rem/1.55 system-ui, sans-serif; color: var(--texte-2);
  margin: -.4rem 0 1.2rem; max-width: 34rem;
}

/* citation inline, sous une justification */
.src-ligne { margin: .35rem 0 0; font-family: system-ui, sans-serif; font-size: .78rem; }
a.ref {
  color: var(--texte-2); text-decoration: none;
  border-bottom: 1px dotted var(--trait); white-space: nowrap;
}
a.ref:hover { color: var(--accent); border-bottom-color: var(--accent); }
.src-manque { color: var(--alerte-trait); font-family: system-ui, sans-serif; font-size: .78rem; }
.lien-inexistant { color: var(--texte-2); border-bottom: 1px dotted var(--trait); }

.controverse {
  display: block; margin-top: .35rem; padding-left: .6rem;
  border-left: 2px solid var(--alerte-trait);
  font-size: .88rem; color: var(--texte-2);
}

.note-de_facto { border-left-color: var(--accent); }

/* accessibilité d'une référence : information utile, pas décoration */
.acces { font-variant: small-caps; letter-spacing: .02em; }
.acces-libre { color: var(--ok); }
.acces-partiel { color: var(--accent-clair); }
.acces-payant, .acces-papier { color: var(--texte-2); }

/* bloc « pour aller plus loin », en bas des fiches */
.lectures {
  margin: 2.5rem 0 1rem; padding: 1.2rem 1.4rem;
  background: var(--fond-2); border-radius: 6px;
}
.lectures h2 { margin-top: 0; font-size: 1.1rem; }
.lectures ul { list-style: none; padding: 0; margin: 0; }
.lectures li { margin-bottom: 1.1rem; }
.lectures li:last-child { margin-bottom: 0; }
.lec-titre { font-weight: 600; }
.lec-titre a { color: var(--texte); }
.lec-meta { font: .78rem system-ui, sans-serif; color: var(--texte-2); margin: .1rem 0 .3rem; }
.lec-pourquoi { font-size: .92rem; color: var(--texte-2); margin: 0; }

/* page bibliographie */
.biblio { margin-bottom: 2rem; }
.ref-fiche {
  padding: .9rem 0 1rem; border-top: 1px solid var(--trait);
  scroll-margin-top: 4rem;
}
.ref-fiche:target { background: var(--alerte-fond); padding-left: .8rem; padding-right: .8rem; border-radius: 4px; }
.ref-fiche h3 { margin: 0 0 .15rem; font-size: 1.02rem; font-weight: 600; }
.ref-fiche h3 a { color: var(--texte); }
.ref-meta { font: .78rem system-ui, sans-serif; color: var(--texte-2); margin-bottom: .45rem; }
.ref-pourquoi { margin: 0; font-size: .95rem; }
.ref-note { margin: .4rem 0 0; font-size: .85rem; color: var(--texte-2); font-style: italic; }
.ref-cite { margin-top: .4rem; font: .76rem system-ui, sans-serif; color: var(--texte-2); }

/* ---- pages d'analyse ----------------------------------------------------
   Des chiffres, donc : des tableaux qui se lisent en diagonale, un éboulis
   qu'on voit décroître, et un nuage dont les étiquettes ne se chevauchent pas. */

table.tableau-chiffres {
  width: 100%; border-collapse: collapse; margin: 1rem 0 1.6rem;
  font: .88rem/1.45 system-ui, sans-serif;
}
table.tableau-chiffres th, table.tableau-chiffres td {
  padding: .4rem .5rem; border-bottom: 1px solid var(--trait); text-align: left;
  vertical-align: top;
}
table.tableau-chiffres thead th {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--texte-2); border-bottom-width: 2px;
}
table.tableau-chiffres td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tableau-chiffres tr.fort td { font-weight: 600; background: var(--fond-2); }
table.tableau-chiffres a { color: var(--texte); }

.eboulis {
  display: flex; align-items: flex-end; gap: .5rem;
  height: 150px; margin: 1.2rem 0 .4rem;
}
.eb-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.eb-barre { background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.eb-val { font: .7rem system-ui, sans-serif; color: var(--texte-2); text-align: center; padding-top: .2rem; }
.eb-lab { font: .7rem system-ui, sans-serif; color: var(--texte-2); text-align: center; }

.legende { font: .8rem system-ui, sans-serif; color: var(--texte-2); margin: .3rem 0 1.6rem; }
.n-cle {
  display: inline-block; width: .6rem; height: .6rem; border-radius: 50%;
  vertical-align: baseline;
}
.n-cle.n-doctrine { background: var(--texte); }
.n-cle.n-doctrinal { background: var(--accent); }
.n-cle.n-de_facto { background: var(--neg); }

svg.nuage {
  width: 100%; height: auto; margin: 1rem 0 .3rem;
  background: var(--fond-2); border-radius: 6px;
}
svg.nuage .n-axe { stroke: var(--trait); stroke-width: 1; }
svg.nuage .n-axe-lab { font: 11px system-ui, sans-serif; fill: var(--texte-2); }
svg.nuage .n-lab { font: 10px system-ui, sans-serif; fill: var(--texte-2); }
svg.nuage .n-lab-doctrine { fill: var(--texte); }
svg.nuage .n-lab-doctrinal { fill: var(--accent); }
svg.nuage .n-lab-de_facto { fill: var(--neg); }
svg.nuage .n-pt { stroke: var(--fond-2); stroke-width: 1.5; }
svg.nuage .n-fond { fill: var(--texte-2); opacity: .28; }
svg.nuage .n-trajet { stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .55; }
svg.nuage .n-ecart { stroke-width: 2; opacity: .8; }
svg.nuage .n-per { stroke-width: 1.8; }
/* une similarite sous le seuil de bruit doit sauter aux yeux */
table.tableau-chiffres td.fort { font-weight: 600; color: var(--neg); }

.liste-plate { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.liste-plate li { font: .88rem system-ui, sans-serif; }

details.repli { margin: 0 0 1.8rem; }
details.repli > summary {
  cursor: pointer; font: .85rem system-ui, sans-serif; color: var(--texte-2);
  padding: .4rem 0;
}
details.repli > summary:hover { color: var(--accent); }

.analyse h2 { margin-top: 2.4rem; }

/* Les sections repliees des resultats : le titre reste un h2, lisible d'un coup d'oeil. */
details.section-repli { margin: 2.4rem 0 .8rem; }
details.section-repli > summary { cursor: pointer; }
details.section-repli > summary::marker { color: var(--texte-2); }
details.section-repli > summary h2 { display: inline; margin: 0; }
details.section-repli > summary:hover h2 { color: var(--accent); }
details.section-repli[open] > summary { margin-bottom: .8rem; }
.analyse h3 { margin-top: 1.6rem; font-size: 1rem; }

/* ---- la ligne à une composante ----
   Le panneau sous le graphique dit en toutes lettres ce que la ligne cache :
   les paires qu'elle rapproche à tort, et ce qui reste visible de l'utilisateur. */
.ligne-composante { display: inline-flex; border: 1px solid var(--trait); border-radius: 4px; overflow: hidden; margin-bottom: .6rem; font: .84rem system-ui, sans-serif; }
.ligne-composante button { background: none; border: 0; padding: .25rem .8rem; cursor: pointer; color: var(--texte-2); font: inherit; }
.ligne-composante button + button { border-left: 1px solid var(--trait); }
.ligne-composante button[aria-pressed="true"] { background: var(--accent); color: var(--fond); }
.ligne-panneau { font: .86rem/1.55 system-ui, sans-serif; }
.ligne-panneau h4 { margin: 1rem 0 .3rem; font-size: .9rem; }
.ligne-panneau details.lp-repli > summary { margin: 1rem 0 .3rem; font-weight: 600; font-size: .9rem; cursor: pointer; }
.ligne-panneau details.lp-repli > summary:hover { color: var(--accent); }
.ligne-panneau .lp-vous { background: var(--fond-2); border-left: 3px solid var(--accent-clair); padding: .5rem .8rem; margin: .6rem 0; }
.ligne-panneau .lp-liste { margin: 0; padding-left: 1.2rem; }
.ligne-panneau .lp-liste li { margin-bottom: .35rem; }
.ligne-panneau .lp-liste li.actif { background: var(--fond-2); }
.ligne-panneau button { background: none; border: 1px solid var(--trait); border-radius: 4px; padding: .05rem .45rem; cursor: pointer; color: var(--texte); font: inherit; }
.ligne-panneau button:hover, .ligne-panneau li.actif .lp-paire { border-color: var(--accent); color: var(--accent); }
.tag-faux-voisin { color: var(--accent); border-color: var(--accent-clair); }

/* ---- l'espace à trois composantes ----
   Au doigt, le glissement horizontal fait tourner, le vertical fait défiler la page. */
.espace-cadre svg { touch-action: pan-y; cursor: grab; }
.espace-cadre svg:active { cursor: grabbing; }
.espace-cadre svg:focus-visible { outline: 2px solid var(--accent-clair); outline-offset: 2px; }
.plan-barre button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--fond); }
.espace-panneau td.num { text-align: right; }
.espace-panneau th:not(:first-child) { text-align: right; }
.espace-cadre svg { overflow: hidden; }

/* ---- axes traditionnels ---- */
.lc-trad { font-style: italic; }
.pt-note, .lc-note, .cc-note { font: .84rem/1.5 system-ui, sans-serif; background: var(--fond-2); border-left: 3px solid var(--accent-clair); padding: .1rem .8rem; margin: .2rem 0 .8rem; }
.pt-note p, .lc-note p, .cc-note p { margin: .45rem 0; }
.lc-note { padding: .5rem .8rem; }
.espace-panneau tr.ligne-trad td { font-style: italic; }

/* ---- cercle des corrélations ---- */
.cercle-cadre svg { max-width: 40rem; margin: 0 auto; }
.cercle-cadre .p-pt { cursor: pointer; }

/* ---- corrplot ---- */
.corrplot-cadre { overflow-x: auto; }
.corrplot-cadre svg { width: 100%; min-width: 34rem; }
.corrplot-cadre .cp-tete { cursor: pointer; }
.corrplot-cadre a text:hover { fill: var(--accent); text-decoration: underline; }

/* ---- matrice des corrélations ---- */
.matrice-cadre { overflow-x: auto; }
.matrice-cadre svg { width: 100%; min-width: 36rem; }
.matrice-cadre .p-pt { cursor: pointer; }
.matrice-cadre a text:hover { fill: var(--accent); text-decoration: underline; }
.matrice-panneau .mx-nuage { display: block; width: 100%; max-width: 16rem; margin: .6rem 0 .2rem; }

/* deux listes côte à côte, l'une sous l'autre sur un écran étroit */
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 1.6rem; }
.deux-colonnes p { margin-bottom: .3rem; }
.deux-colonnes ul { margin-top: 0; padding-left: 1.2rem; }

/* ---- comparer deux positions ---- */
.proches .b-cmp { margin-left: .3rem; background: none; border: 1px solid var(--trait); border-radius: 4px; padding: .1rem .5rem; cursor: pointer; color: var(--texte-2); font: .78rem system-ui, sans-serif; }
.proches .b-cmp:hover { border-color: var(--accent-clair); color: var(--accent); }
details.cmp-bloc > summary h3 { display: inline; margin: 0; font-size: 1.05rem; }
.cmp-choix { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: .6rem 0; font: .88rem system-ui, sans-serif; }
.cmp-cote { display: flex; align-items: center; gap: .4rem; flex: 1 1 18rem; min-width: 0; }
.cmp-choix select, .cmp-cherche { font: inherit; padding: .3rem .4rem; border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); color: var(--texte); }
.cmp-choix select { flex: 1; min-width: 0; }
.cmp-cherche { width: 8rem; flex: none; }
.cmp-echanger, .cmp-tri button { background: none; border: 1px solid var(--trait); border-radius: 4px; padding: .25rem .6rem; cursor: pointer; color: var(--texte-2); font: .82rem system-ui, sans-serif; }
.cmp-echanger:hover, .cmp-tri button:hover { border-color: var(--accent-clair); color: var(--accent); }
.cmp-tri { display: flex; gap: .4rem; margin: .6rem 0 .2rem; }
.cmp-tri button[aria-pressed="true"] { border-color: var(--accent-clair); color: var(--accent); font-weight: 600; }
.cmp-bilan p { margin: .3rem 0; }
.cmp-pastille { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; flex: none; vertical-align: middle; }
.cmp-pastille.cmp-a { background: var(--texte); }
.cmp-pastille.cmp-b { background: var(--accent); }
.cmp-lignes .barre { opacity: 1; background: var(--fond-3); }
.cmp-lignes .point.cmp-a { background: var(--texte); }
.cmp-lignes .point.cmp-b { background: var(--accent); }
.cmp-lignes .point.cmp-muet { opacity: .35; }
.cmp-lignes .cmp-bande { position: absolute; border-radius: 3px; opacity: .3; }
.cmp-lignes .cmp-bande.cmp-a { top: 12%; bottom: 52%; background: var(--texte); }
.cmp-lignes .cmp-bande.cmp-b { top: 52%; bottom: 12%; background: var(--accent); }
.cmp-lignes .cmp-ecart { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; background: var(--alerte-trait); }
.cmp-ligne > summary { cursor: pointer; list-style: none; }
.cmp-ligne > summary::-webkit-details-marker { display: none; }
.cmp-ligne > summary:hover .lab { color: var(--accent); }
.cmp-ligne[open] > summary .lab { font-weight: 600; }
.cmp-hors > summary { opacity: .55; }
.cmp-detail { font-size: .85rem; background: var(--fond-2); border-left: 2px solid var(--accent-clair); padding: .4rem .8rem; margin: .1rem 0 .6rem; }
.cmp-detail p { margin: .25rem 0; }
.cmp-lignes h3 { font-size: .95rem; margin: 1rem 0 .3rem; }

/* ---- recherche dans une liste ---- */
.recherche { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: 1rem 0 .8rem; font: .9rem system-ui, sans-serif; }
.recherche input { flex: 1 1 16rem; max-width: 26rem; font: inherit; padding: .45rem .6rem; border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); color: var(--texte); }
.recherche input:focus { outline: 2px solid var(--accent-clair); outline-offset: 1px; }
.rch-compte { color: var(--texte-2); font-size: .85rem; }
[data-recherche] > [hidden] { display: none !important; }

.vers-comparer { font: .88rem system-ui, sans-serif; }
.vers-comparer a::before { content: "⇄ "; }
