:root {
  --papier: #fbfcfe;
  --encre: #1e2f6b;
  --encre-douce: #56648f;
  --trait: #d9deea;
  --absent: #a7adba;
  --ocre: #b7791f;
  --marge: #d2453a;
  --ombre: 0 6px 24px rgba(30, 47, 107, 0.16);
  --ui: "Atkinson Hyperlegible", system-ui, sans-serif;
  --titre: "Literata", Georgia, serif;
  --barre-h: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--papier);
  color: var(--encre);
  font: 16px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--encre); }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- barre du haut */
.barre {
  position: fixed; inset: 0 0 auto 0; z-index: 3;
  height: var(--barre-h);
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--papier);
  border-bottom: 1px solid var(--trait);
}
.titre { font: 650 1.2rem/1 var(--titre); text-decoration: none; }
.lien-doc { font-weight: 700; text-underline-offset: 3px; }

/* ---------- carte */
.page-carte { overflow: hidden; }
#carte { position: fixed; inset: var(--barre-h) 0 0 0; }

/* ---------- panneau des calques */
.panneau {
  position: fixed; z-index: 2;
  left: 0; right: 0; bottom: 0;
  max-height: calc(100% - var(--barre-h) - 96px); overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--papier);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 18px rgba(30, 47, 107, 0.18);
}
.panneau-tete {
  width: 100%; min-height: 44px; padding: 6px 0 4px;
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--encre); cursor: pointer; text-align: left;
  font: 1rem var(--ui);
}
.panneau-tete::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #c9cede; }
.panneau-titre { font: 650 1.1rem/1 var(--titre); padding-top: 8px; }
.compte { font-size: 0.85rem; color: var(--encre-douce); padding-top: 8px; }
.panneau-tete .chevron { margin-left: auto; transform: rotate(180deg); transition: transform 0.15s; padding-top: 4px; }
.panneau.replie .panneau-tete .chevron { transform: none; }
.panneau.replie .calques { display: none; }
.champ { display: block; font-size: 0.85rem; color: var(--encre-douce); margin: 12px 0 5px; }
select {
  width: 100%;
  font: 700 1rem var(--ui); color: var(--encre);
  padding: 9px 36px 9px 12px;
  border: 1.5px solid var(--encre); border-radius: 10px;
  background: var(--papier) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231e2f6b' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
}
.calque { border-top: 1px solid var(--trait); padding: 4px 0 6px; }
.calque-tete { display: flex; align-items: center; gap: 10px; }
.calque-ouvrir {
  flex: 1; min-width: 0; min-height: 48px; padding: 4px 0;
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--encre); text-align: left; cursor: pointer;
  font: 1rem var(--ui);
}
.calque .forme { flex: none; }
.calque-titres { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.calque-nom { font-weight: 700; }
.calque-resume { font-size: 0.85rem; color: var(--encre-douce); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calque-ouvrir .chevron { flex: none; transition: transform 0.15s; }
.calque-ouvrir[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.calque-inactif .calque-nom { color: #8a93ad; }
.calque-reglages { padding: 0 0 8px; }
.calque-reglages > .note, .legende-notes .note { margin: 6px 0 0; font-size: 0.82rem; color: var(--encre-douce); line-height: 1.4; }

/* Interrupteur (role="switch") */
.interrupteur {
  flex: none; position: relative; width: 46px; height: 28px; padding: 0;
  border: 0; border-radius: 14px; background: #c9cede; cursor: pointer;
}
.interrupteur::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: left 0.15s;
}
.interrupteur[aria-checked="true"] { background: var(--encre); }
.interrupteur[aria-checked="true"]::after { left: 22px; }
.interrupteur:disabled { opacity: 0.5; cursor: not-allowed; }

/* Choix public / privé */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces button {
  min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--encre); border-radius: 20px;
  background: var(--papier); color: var(--encre);
  font: 700 0.9rem var(--ui); cursor: pointer;
}
.puces button[aria-pressed="true"] { background: var(--encre); color: #fff; }
.puces button { display: inline-flex; align-items: center; gap: 6px; }
.puces button[aria-pressed="false"] { opacity: 0.75; }
.puces button[aria-pressed="true"]::after { content: "✓"; }
.cle-contour { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 0; padding-top: 8px; border-top: 1px solid var(--trait); font-size: 0.8rem; color: var(--encre-douce); }
.cle-contour span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; margin-right: 12px; }
.ligne-zones { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.ligne-zones.indisponible span { color: #8a93ad; }

/* Légende d'un calque */
.calque-legende:empty { display: none; }
.legende-ligne { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.legende-corps { flex: 1; min-width: 0; }
.legende-nom { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legende-ligne .degrade { height: 8px; border-radius: 4px; margin: 3px 0 2px; }
.legende-ligne .bornes { display: flex; justify-content: space-between; color: var(--encre-douce); }
.etat { margin: 6px 0 0; font-size: 0.85rem; color: var(--encre-douce); }
.etat:empty { display: none; }
/* Indication affichée en vue large : les secteurs n'apparaissent qu'à partir du zoom ZOOM_SECTEURS. */
.indice-zoom { position: fixed; z-index: 5; top: calc(var(--barre-h) + 10px); left: 50%; transform: translateX(-50%); margin: 0;
  max-width: calc(100vw - 96px); padding: 6px 14px; white-space: normal; border-radius: 999px; background: rgba(30, 47, 107, 0.88); color: #fff;
  font-size: 0.88rem; text-align: center; box-shadow: var(--ombre); pointer-events: none; }
.indice-zoom[hidden] { display: none; }

/* ---------- fiche établissement : une copie double, avec sa marge */
.fiche {
  position: fixed; z-index: 4;
  left: 0; right: 0; bottom: 0;
  max-height: 72vh; overflow-y: auto;
  background: var(--papier);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--ombre);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)) 40px;
  background-image: linear-gradient(var(--marge), var(--marge));
  background-size: 1.5px 100%;
  background-position: 26px 0;
  background-repeat: no-repeat;
  animation: monte 0.22s ease-out;
}
@keyframes monte { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fiche { animation: none; } }
.fermer {
  position: absolute; top: 10px; right: 10px;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--encre);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.fermer:hover { background: #eef1f8; }
.fiche h2 { font: 650 1.45rem/1.2 var(--titre); margin: 0 44px 4px 0; }
.fiche .lieu { margin: 0 0 16px; color: var(--encre-douce); }
.fiche .sans-brevet { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--trait); color: var(--encre-douce); font-size: 0.92rem; line-height: 1.45; }
.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin: 0 0 18px; }
.chiffre dt { font-size: 0.82rem; color: var(--encre-douce); }
.chiffre dd { margin: 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.chiffre dd small { font-size: 0.8rem; font-weight: 400; color: var(--encre-douce); }
.chiffre.vide dd { color: var(--absent); font-size: 1rem; font-weight: 400; padding-top: 6px; }
.fiche h3 { font: 650 1.05rem/1.3 var(--titre); margin: 20px 0 6px; }
.historique { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.historique th, .historique td { text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--trait); }
.historique th:first-child, .historique td:first-child { text-align: left; padding-left: 0; }
.historique thead th { font-weight: 400; color: var(--encre-douce); }
.fiche .renvoi { margin-top: 18px; font-size: 0.9rem; }

/* ---------- écrans larges */
@media (min-width: 760px) {
  .panneau {
    left: 16px; right: auto; top: calc(var(--barre-h) + 16px); bottom: auto; width: 360px;
    max-height: calc(100% - var(--barre-h) - 32px);
    padding: 4px 18px 12px; border-radius: 16px; box-shadow: var(--ombre);
  }
  .panneau-tete::before { display: none; }
  .panneau-titre, .compte { padding-top: 4px; }
  .fiche {
    left: auto; right: 16px; top: calc(var(--barre-h) + 16px); bottom: 16px;
    width: 400px; max-height: none;
    border-radius: 16px;
    animation-name: glisse;
  }
  @keyframes glisse { from { transform: translateX(24px); opacity: 0; } }
}

/* ---------- MapLibre */
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: var(--panneau-h, 220px); }
@media (min-width: 760px) {
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: 0; }
  .fiche-ouverte .maplibregl-ctrl-top-right { right: 424px; }
}

/* ---------- page Documentation */
.page-doc main { max-width: 42rem; margin: 0 auto; padding: calc(var(--barre-h) + 28px) 16px 64px; }
.page-doc h1 { font: 650 2rem/1.15 var(--titre); margin: 0 0 12px; }
.page-doc h2 { font: 650 1.35rem/1.25 var(--titre); margin: 40px 0 8px; padding-left: 14px; border-left: 2px solid var(--marge); }
.page-doc h3 { font: 700 1.05rem/1.3 var(--ui); margin: 24px 0 4px; }
.page-doc p, .page-doc li { max-width: 68ch; }
.page-doc .chapeau { font-size: 1.1rem; color: var(--encre-douce); }
.page-doc table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 8px 0; }
.page-doc th, .page-doc td { text-align: left; vertical-align: top; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--trait); }
.page-doc th { font-weight: 400; color: var(--encre-douce); }

/* Documentation découpée en pages : sommaire en cartes, fil d'Ariane, sommaire de page, navigation. */
.page-doc h1[id], .page-doc h2[id] { scroll-margin-top: calc(var(--barre-h) + 12px); }
.page-doc .fil { font-size: 0.9rem; color: var(--encre-douce); margin: 0 0 6px; }
.page-doc .fil a { color: var(--encre-douce); }
.doc-cartes { list-style: none; padding: 0; margin: 24px 0 8px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.doc-cartes li { max-width: none; }
.doc-cartes a { display: flex; flex-direction: column; gap: 4px; height: 100%; box-sizing: border-box; padding: 14px 16px;
  border: 1px solid var(--trait); border-left: 3px solid var(--marge); border-radius: 6px; background: #fff; text-decoration: none; }
.doc-cartes a:hover { box-shadow: var(--ombre); }
.doc-carte-titre { font: 650 1.1rem/1.25 var(--titre); }
.doc-carte-texte { font-size: 0.92rem; color: var(--encre-douce); }
.doc-sommaire { margin: 16px 0 8px; padding: 10px 14px; border: 1px solid var(--trait); border-radius: 6px; background: #fff; font-size: 0.95rem; }
.doc-sommaire p { margin: 0 0 4px; font-weight: 700; }
.doc-sommaire ol { margin: 0; padding-left: 1.2rem; columns: 2 12rem; column-gap: 24px; }
.doc-sommaire li { break-inside: avoid; }
.doc-suite { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--trait); }
.doc-suite a { display: flex; flex-direction: column; text-decoration: none; font-weight: 700; max-width: 48%; }
.doc-suite small { font-weight: 400; color: var(--encre-douce); }
.doc-suite .suiv { margin-left: auto; text-align: right; }
.page-doc .formule { padding: 10px 14px; background: #eef1f8; border-radius: 8px; }
@media (max-width: 560px) {
  .page-doc .sources thead { display: none; }
  .page-doc .sources tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--trait); }
  .page-doc .sources td { display: block; border: 0; padding: 2px 0; }
}

.page-doc [id] { scroll-margin-top: calc(var(--barre-h) + 16px); }
.chiffres[hidden] { display: none; }

/* ---------- fiche : graphique d'évolution, un indicateur à la fois */
.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.onglets button {
  min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--encre); border-radius: 20px;
  background: var(--papier); color: var(--encre);
  font: 700 0.875rem var(--ui); cursor: pointer;
}
.onglets button[aria-pressed="true"] { background: var(--encre); color: #fff; }
.graphe-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fiche .graphe-tete h3 { margin: 0; }
.graphe-tete .valeur { margin: 0; white-space: nowrap; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.graphe-tete .valeur small { font-size: 0.8rem; font-weight: 400; color: var(--encre-douce); }
.graphe-contexte { margin: 2px 0 8px; font-size: 0.82rem; color: var(--encre-douce); }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe text { font: 12px var(--ui); fill: var(--encre-douce); font-variant-numeric: tabular-nums; }
.graphe text.titre-panneau { font-weight: 700; fill: var(--encre); }
.legende-graphe { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 0.82rem; color: var(--encre-douce); }
.legende-graphe span { display: inline-flex; align-items: center; gap: 6px; }
details.valeurs { margin-top: 14px; font-size: 0.9rem; }
details.valeurs summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
details.valeurs .historique { margin-top: 4px; }

/* ---------- recherche (barre du haut) */
.recherche { position: relative; flex: 1; max-width: 440px; margin: 0 24px; }
#recherche {
  width: 100%; height: 40px; box-sizing: border-box;
  padding: 0 44px 0 38px;
  border: 1.5px solid var(--encre); border-radius: 10px;
  font: 1rem var(--ui); color: var(--encre);
  background: var(--papier) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231e2f6b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
}
#recherche::placeholder { color: var(--encre-douce); }
/* Safari et iOS : retirer l'apparence native des champs de recherche, qui ignore padding et fond. */
#recherche { -webkit-appearance: none; appearance: none; }
#recherche::-webkit-search-decoration, #recherche::-webkit-search-results-decoration { -webkit-appearance: none; }
/* Croix native de Chrome et Safari masquée : remplacée par le bouton #effacer-recherche, visible partout. */
#recherche::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.effacer-recherche {
  position: absolute; top: 0; right: 0; width: 44px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 0 10px 10px 0; background: transparent; color: var(--encre-douce); cursor: pointer;
}
.effacer-recherche[hidden] { display: none; }
.effacer-recherche:hover { color: var(--encre); }
.effacer-recherche:focus-visible { outline: 2px solid var(--encre); outline-offset: -4px; }
#suggestions {
  position: absolute; z-index: 10; top: 46px; left: 0; right: 0;
  margin: 0; padding: 6px 0; list-style: none;
  max-height: min(60vh, 420px); overflow-y: auto;
  background: var(--papier); border-radius: 12px; box-shadow: var(--ombre);
}
#suggestions .groupe { padding: 8px 14px 4px; font-size: 0.8rem; color: var(--encre-douce); }
#suggestions [role="option"] { padding: 9px 14px; cursor: pointer; line-height: 1.3; }
#suggestions [role="option"] small { display: block; font-size: 0.82rem; color: var(--encre-douce); }
#suggestions [role="option"][aria-selected="true"], #suggestions [role="option"]:hover { background: #eef1f8; }
#suggestions .info { padding: 9px 14px; font-size: 0.85rem; color: var(--encre-douce); }
.repere-adresse { width: 18px; height: 18px; border-radius: 50%; background: var(--marge); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--encre); }
.proches { list-style: none; margin: 8px 0 0; padding: 0; }
.proches li { border-bottom: 1px solid var(--trait); }
.proches button {
  width: 100%; min-height: 48px; padding: 8px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 0; background: transparent; color: var(--encre);
  font: 1rem var(--ui); text-align: left; cursor: pointer;
}
.proches button small { display: block; font-size: 0.82rem; color: var(--encre-douce); }
.proches .distance { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--encre-douce); }
.avertissement { font-size: 0.88rem; color: var(--encre-douce); margin: 14px 0 0; }
@media (max-width: 759px) {
  .page-carte { --barre-h: 104px; }
  .page-carte .barre { flex-wrap: wrap; align-content: center; row-gap: 6px; padding-top: 6px; padding-bottom: 8px; }
  .page-carte .recherche { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
}

/* ---------- secteurs */
.proches li.secteur-adresse { border-bottom: 2px solid var(--encre); margin-bottom: 6px; }
.proches .etiquette { display: inline-block; font-size: 0.78rem; font-weight: 700; color: #fff; background: var(--encre); border-radius: 4px; padding: 1px 6px; margin-bottom: 2px; }

/* ---------- fiche lycée */
.cles { display: flex; gap: 8px; margin: 0 0 16px; }
.cles > div { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--trait); border-radius: 10px; background: #fff; }
.cles dt { font-size: 0.78rem; color: var(--encre-douce); line-height: 1.25; }
.cles dd { margin: 0; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cles dd.detail { font-size: 0.78rem; font-weight: 400; color: var(--encre-douce); }
.historique.detail { margin-top: 14px; }
.historique.detail caption { text-align: left; font-weight: 700; padding-bottom: 4px; }
.historique.detail tr.sous th { padding-left: 14px; font-weight: 400; color: var(--encre-douce); }
.historique.detail tr.sous td { color: var(--encre-douce); }

/* ---------- fiche école */
.fiche .lieu small { font-size: 0.85rem; }
.note-ecole { margin: 0 0 14px; padding: 8px 10px; border-radius: 10px; background: #f1f3f9; font-size: 0.85rem; color: #3d4a78; line-height: 1.4; }
.liens-ecole { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--trait); }
.liens-ecole li { padding: 8px 0; border-bottom: 1px solid var(--trait); }
.liens-ecole .lien-titre { display: block; font-size: 0.78rem; color: var(--encre-douce); }
.liens-ecole .lien-texte { font-size: 0.92rem; }
.liens-ecole button {
  display: block; width: 100%; min-height: 44px; padding: 2px 0; border: 0; background: transparent; color: var(--encre);
  font: 700 1rem var(--ui); text-align: left; cursor: pointer;
}
.liens-ecole .lien-nom { text-decoration: underline; text-underline-offset: 3px; }
.liens-ecole button small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--encre-douce); }
.barres { margin-top: 10px; }
.barres-titre { margin: 0 0 4px; font-size: 0.85rem; font-weight: 700; }
.barre-ligne { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.85rem; color: #3d4a78; }
.barre-ligne.moi { color: var(--encre); font-weight: 700; }
.barre-nom { flex: 1; min-width: 0; }
.barre-piste { position: relative; flex: none; width: 112px; height: 12px; border-radius: 6px; background: #eef1f6; }
.barre-piste span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: #a9b3cc; }
.barre-ligne.moi .barre-piste span { background: var(--encre); }
.barre-val { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.graphe-note { margin: 10px 0 0; font-size: 0.82rem; color: var(--encre-douce); }

.proches .info-secteur { padding: 10px 4px; font-size: 0.9rem; color: var(--encre-douce); border-bottom: 1px solid var(--trait); }

/* ---------- page de suivi des données (suivi.html) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.page-suivi main { max-width: 75rem; }
.page-suivi p { max-width: none; }
.suivi-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 16px; border-bottom: 1.5px solid var(--marge); }
.suivi-tete .chapeau { margin: 0; }
.suivi-global { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 0.9rem; color: #3d4a78; }
.s-etat { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 10px; border-radius: 16px; font-weight: 700; font-size: 0.82rem; white-space: nowrap; }
.s-etat-grand { padding: 6px 14px; font-size: 1rem; }
.s-etat-ok { color: #1f6f43; background: #e5f3ea; }
.s-etat-partiel { color: #8a4b00; background: #fdf0dc; }
.s-etat-ko { color: #a3241b; background: #fbe6e4; }
.suivi-alerte { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: #fdf3e7; border: 1px solid #f0d3ad; color: #5a3a12; }
.suivi-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 12px; margin: 24px 0; }
.suivi-tuile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--trait); border-radius: 12px; background: #fff; }
.suivi-tuile span, .suivi-tuile small { font-size: 0.82rem; color: var(--encre-douce); }
.suivi-tuile b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.suivi-filtres { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.suivi-filtres [role="group"] { display: flex; flex-wrap: wrap; gap: 6px; }
.suivi-filtre { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--encre); background: #fff; color: var(--encre); font: 700 0.9rem var(--ui); cursor: pointer; }
.suivi-filtre[aria-pressed="true"] { background: var(--encre); color: #fff; }
.suivi-legende { margin: 0; font-size: 0.82rem; color: #3d4a78; }
.suivi-bloc { margin-top: 28px; }
.suivi-titre-bloc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.suivi-titre-bloc h2 { margin: 0 !important; }
.suivi-titre-bloc span { font-size: 0.82rem; color: var(--encre-douce); }
.suivi-table { position: relative; overflow-x: auto; border: 1px solid var(--trait); border-radius: 12px; background: #fff; }
.page-suivi .suivi-table table { margin: 0; min-width: 58rem; }
.page-suivi .suivi-table th, .page-suivi .suivi-table td { padding: 10px 12px; vertical-align: middle; border-bottom: 1px solid #eef1f6; }
.page-suivi .suivi-table thead th { font-size: 0.78rem; font-weight: 700; }
.suivi-table .nb { text-align: right; font-variant-numeric: tabular-nums; }
.suivi-source { display: block; font-weight: 700; }
.suivi-table small { display: block; font-size: 0.78rem; color: var(--encre-douce); }
.suivi-table .maj { font-size: 0.85rem; color: #3d4a78; }
.suivi-bouton { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1.5px solid #c9cede; background: #fff; color: var(--encre); font: 700 0.82rem var(--ui); cursor: pointer; }
.suivi-details td { padding-top: 0 !important; }
.suivi-details dl { margin: 0; padding: 12px 14px; border-radius: 10px; background: #f4f6fb; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; }
.suivi-details dl div { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; }
.suivi-details dt { color: var(--encre-douce); }
.suivi-details dd { margin: 0; color: #3d4a78; overflow-wrap: anywhere; }
.suivi-details .ton-alerte { color: #a3241b; font-weight: 700; }
.suivi-details .ton-attention { color: #8a4b00; font-weight: 700; }
.suivi-table .vide, .suivi-bloc .vide { color: var(--encre-douce); padding: 14px 16px; margin: 0; }
.suivi-controles { display: grid; grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); gap: 0 24px; padding: 6px 16px; border: 1px solid var(--trait); border-radius: 12px; background: #fff; }
.suivi-controle { display: grid; grid-template-columns: 1fr 7.5rem 6rem; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #eef1f6; font-size: 0.9rem; }
.suivi-controle .nb { text-align: right; font-variant-numeric: tabular-nums; }
.suivi-controle small { display: block; font-size: 0.75rem; color: var(--encre-douce); }
.suivi-controle .jauge { position: relative; height: 10px; border-radius: 5px; background: #eef1f6; }
.suivi-controle .jauge span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--encre); }
.suivi-controle .jauge i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--marge); }
.suivi-controle.rate b { color: #a3241b; }
.suivi-controle.rate .jauge span { background: #a3241b; }
.suivi-note { font-size: 0.82rem; color: var(--encre-douce); }
.suivi-historique .suivi-table table { min-width: 0; }
.page-suivi .suivi-historique th[scope="row"] { font-weight: 400; color: var(--encre); font-size: 0.85rem; min-width: 14rem; }
.page-suivi .suivi-historique td { text-align: center; }
.suivi-historique .col-build { text-align: center; white-space: nowrap; }
.suivi-historique .ligne-global th, .suivi-historique .ligne-global td { background: #f7f8fc; font-weight: 700; }
.carre { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; }
.carre.absent { color: var(--absent); }
.suivi-pied { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--trait); font-size: 0.9rem; }
.suivi-pied span { color: var(--encre-douce); }
@media (max-width: 40rem) {
  .suivi-global { align-items: flex-start; }
  .suivi-controle { grid-template-columns: 1fr 5rem 5.5rem; }
}
.page-suivi .table-sources { table-layout: fixed; }
.table-sources th:nth-child(1) { width: 30%; }
.table-sources th:nth-child(2) { width: 10%; }
.table-sources th:nth-child(3) { width: 24%; }
.table-sources th:nth-child(4) { width: 16%; }
.table-sources th:nth-child(5) { width: 10%; }
.table-sources th:nth-child(6) { width: 10%; }
.page-doc .sources tr.groupe th { padding: 16px 0 6px; font-family: var(--titre, inherit); font-size: 1rem; text-align: left; border-bottom: 1.5px solid var(--trait); }
.page-doc .sources td small { color: var(--encre-douce); }
