/* ═══════════════════════════════════════════════════════════════
   NIMRY InfraXact — Composants d'interface
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════ BOUTONS ═══════════════ */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px; height:36px; padding:0 14px;
  border-radius:var(--r); border:1px solid var(--line); background:var(--surface); color:var(--ink-2);
  font-size:13.5px; font-weight:600; cursor:pointer; transition:.14s; white-space:nowrap;
}
.btn:hover{background:var(--surface-2); border-color:var(--line-fort)}
.btn svg{width:16px;height:16px}
.btn--primary{background:var(--brand); border-color:var(--brand); color:#fff}
.btn--primary:hover{background:var(--brand-600); border-color:var(--brand-600)}
.btn--accent{background:var(--accent); border-color:var(--accent); color:#fff}
.btn--accent:hover{background:var(--accent-600); border-color:var(--accent-600)}
.btn--danger{background:var(--red); border-color:var(--red); color:#fff}

/* ── Un bouton dans une infobulle de carte ──────────────────────
   Leaflet pose `.leaflet-container a { color: #0078A8 }` — deux
   classes, donc plus fort que `.btn--primary`, qui n’en a qu’une.
   Résultat : un bouton primaire dans une infobulle recevait du bleu
   Leaflet sur le bleu de la marque, illisible. On rend sa couleur à
   chaque variante, avec une spécificité qui gagne. */
.leaflet-container a.btn{color:var(--ink-2)}
.leaflet-container a.btn--primary,
.leaflet-container a.btn--accent,
.leaflet-container a.btn--danger{color:#fff}
/* Le fond doit être redonné explicitement : `.btn:hover` est plus
   spécifique que `.btn--danger` et lui imposait un fond presque blanc,
   sous un texte blanc. Le bouton devenait illisible au survol — partout
   où il est employé. */
.btn--danger:hover{background:var(--red); border-color:var(--red); filter:brightness(.94)}
.btn--ghost{border-color:transparent; background:transparent}
.btn--ghost:hover{background:var(--surface-2); border-color:transparent}
.btn--sm{height:31px; padding:0 11px; font-size:12.5px; border-radius:var(--r-sm)}
.btn--sm svg{width:14px;height:14px}
.btn--lg{height:44px; padding:0 20px; font-size:15px}
.btn--block{width:100%}
.btn[disabled]{opacity:.45; cursor:not-allowed; pointer-events:none}
.iconbtn{
  width:34px;height:34px;display:grid;place-items:center;border-radius:var(--r); border:1px solid transparent;
  background:transparent; color:var(--ink-3); cursor:pointer; transition:.14s; position:relative;
}
.iconbtn:hover{background:var(--surface-2); color:var(--ink)}
.iconbtn .dot{position:absolute; top:6px; right:7px; width:7px;height:7px;border-radius:50%;
  background:var(--red); border:1.5px solid var(--surface)}

/* ═══════════════ CARTES ═══════════════ */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-1)}
.card__h{padding:16px 20px; border-bottom:1px solid var(--line-2); display:flex; align-items:center; gap:12px}
.card__h h3{font-size:14.5px}
.card__h p{font-size:12.5px; color:var(--ink-3); margin-top:2px}
.card__h .a{margin-left:auto; display:flex; gap:8px; align-items:center}
.card__b{padding:20px}
.card__b--flush{padding:0; overflow-x:auto}
.card__f{padding:12px 20px; border-top:1px solid var(--line-2); background:var(--surface-2);
  border-radius:0 0 var(--r-lg) var(--r-lg); font-size:12.5px; color:var(--ink-3)}

.grid{display:grid; gap:20px}
.g-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.g-21{grid-template-columns:minmax(0,2fr) minmax(0,1fr); align-items:start}
.g-12{grid-template-columns:minmax(0,1fr) minmax(0,2fr); align-items:start}
.g-31{grid-template-columns:minmax(0,3fr) minmax(0,1.15fr); align-items:start}
.grid--eq{align-items:stretch}
.grid--eq>.card{display:flex; flex-direction:column}
.grid--eq>.card>.card__b{flex:1 0 auto}
.mt-12{margin-top:12px} .mt-16{margin-top:16px} .mt-20{margin-top:20px} .mt-24{margin-top:24px}
.mb-12{margin-bottom:12px} .mb-16{margin-bottom:16px} .mb-20{margin-bottom:20px}

/* KPI */
.kpi{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:18px 20px;
  box-shadow:var(--sh-1); position:relative; overflow:hidden}
.kpi__l{font-size:12px; color:var(--ink-3); font-weight:550; display:flex; align-items:center; gap:6px}
.kpi__v{font-size:29px; font-weight:680; letter-spacing:-.02em; margin-top:7px; line-height:1.1}
.kpi__v small{font-size:15px; font-weight:600; color:var(--ink-3); margin-left:2px}
.kpi__d{margin-top:7px; font-size:12px; display:flex; align-items:center; gap:6px; color:var(--ink-3);
  position:relative; z-index:1; flex-wrap:wrap}
/* Une pastille de tuile passe à la ligne plutôt que de sortir du cadre (16/11/2026) :
   « Échéance contractuelle dépassée » se coupait sur un portable de 1280 px. */
.kpi__d .badge{white-space:normal; max-width:100%}
.kpi__d .up{color:var(--green); font-weight:650}
.kpi__d .dn{color:var(--red); font-weight:650}
.kpi__spark{position:absolute; right:16px; top:44px; opacity:.55; pointer-events:none; z-index:0}
.kpi--alert{border-color:var(--red-200); background:linear-gradient(180deg,var(--surface) 0%,var(--red-50) 100%)}
.kpi--alert .kpi__v{color:var(--red)}

/* ═══════════════ BADGES / PILLS ═══════════════ */
.badge{display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 9px; border-radius:99px;
  font-size:11.5px; font-weight:650; letter-spacing:.01em; white-space:nowrap; border:1px solid transparent}
.badge svg{width:12px;height:12px;stroke-width:2.2}
/* Une pastille qui porte du **texte saisi**, pas un état.
   `.badge` ne se coupe jamais : c'est ce qui fait tenir « En retard »
   sur une ligne dans une cellule de tableau. Verser de la prose dedans
   — des risques HSE, par exemple — la fait sortir de sa colonne et
   pousse la page entière de côté, avec une barre de défilement
   horizontale pour seul signe. Cette variante se plie. */
.badge--libre{height:auto; min-height:22px; padding:3px 9px; max-width:100%;
  white-space:normal; overflow-wrap:anywhere; line-height:1.45;
  align-items:flex-start}
.b-red{background:var(--red-50); color:var(--red-700); border-color:var(--red-200)}
.b-amber{background:var(--accent-50); color:var(--amber-700); border-color:var(--amber-200)}
.b-blue{background:var(--brand-50); color:var(--brand-700); border-color:var(--brand-200)}
.b-green{background:var(--green-50); color:var(--green-700); border-color:var(--green-200)}
.b-slate{background:var(--slate-50); color:var(--ink-2); border-color:var(--line)}
.b-violet{background:var(--violet-50); color:var(--violet-700); border-color:var(--violet-200)}
.b-dark{background:var(--inverse-fond); color:var(--inverse-texte)}
.srcchip{display:inline-flex; align-items:center; justify-content:center; min-width:46px; height:26px;
  padding:0 9px; border-radius:var(--r-sm); font-size:10.5px; font-weight:700; letter-spacing:.03em;
  border:1px solid transparent; flex:none; white-space:nowrap}
.icotile{width:32px; height:32px; border-radius:var(--r-sm); display:grid; place-items:center; flex:none;
  border:1px solid transparent}
.icotile svg{width:15px; height:15px; stroke-width:2}
.tick{display:grid; place-items:center; width:22px; height:22px; border-radius:50%; font-size:12px;
  font-weight:700; line-height:1}
.tick--ok{background:var(--green-100); color:var(--green-700)}
.tick--ko{background:var(--red-100); color:var(--red-700)}

.pill{display:inline-flex; align-items:center; gap:6px; padding:4px 11px; border-radius:99px; font-size:11.5px;
  font-weight:650; background:var(--brand-50); color:var(--brand-700)}
.pill--accent{background:var(--accent-50); color:var(--amber-700)}
.pill--dark{background:var(--inverse-fond); color:var(--inverse-texte)}
.dotstat{width:7px;height:7px;border-radius:50%;display:inline-block; flex:none}

/* ═══════════════ TABLEAUX ═══════════════ */
.tablewrap{overflow-x:auto}
table.tbl{width:100%; border-collapse:collapse; font-size:13px}
table.tbl th{
  text-align:left; font-size:11px; font-weight:700; letter-spacing:.055em; text-transform:uppercase;
  color:var(--ink-4); padding:11px 16px; border-bottom:1px solid var(--line); background:var(--surface-2);
  white-space:nowrap; position:sticky; top:0;
}
table.tbl td{padding:12px 16px; border-bottom:1px solid var(--line-2); vertical-align:middle}
table.tbl tbody tr{transition:background .12s}
table.tbl tbody tr:hover{background:var(--surface-2)}
table.tbl tbody tr.is-click{cursor:pointer}
table.tbl tbody tr:last-child td{border-bottom:0}
table.tbl .id{font-family:var(--mono); font-size:12px; font-weight:600; color:var(--brand)}
table.tbl td .sub{font-size:11.5px; color:var(--ink-3)}
.tbl--compact td{padding:9px 14px}
.tbl--compact th{padding:9px 14px}

/* ── Tableau qui se plie ──────────────────────────────────────
   `tbl--cartes` : sur écran étroit, chaque ligne devient une carte et
   chaque cellule porte son intitulé de colonne. Sans cela, un tableau de
   neuf colonnes ne se lit qu'en le faisant défiler latéralement — geste
   qu'on ne fait pas d'une main, debout, et qui cache la moitié de
   l'information à celui qui ne le tente pas.

   Un seul balisage, pour un seul contenu. La solution évidente — un
   tableau pour l'écran large, une liste de cartes pour l'étroit —
   demande d'écrire deux fois la même chose, et les deux divergent à la
   première colonne ajoutée : l'une la reçoit, l'autre non, et personne
   ne s'en aperçoit avant qu'un utilisateur de téléphone signale qu'il
   lui manque une donnée.

   L'intitulé vient de `data-libelle`, posé sur la cellule. Il double
   l'en-tête plutôt que de le remplacer : l'en-tête reste pour l'écran
   large et pour les lecteurs d'écran, qui lisent la structure du tableau
   et non nos pseudo-éléments. */
@media (max-width:860px){
  .tbl--cartes thead{
    /* Masqué à l'œil, gardé pour la structure du tableau : `display:none`
       retirerait l'en-tête de l'arbre d'accessibilité, et une cellule ne
       serait plus rattachée à sa colonne. */
    position:absolute; width:1px; height:1px; overflow:hidden;
    clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
  }
  .tbl--cartes,
  .tbl--cartes tbody,
  .tbl--cartes tr,
  .tbl--cartes td{display:block; width:auto}

  .tbl--cartes tbody tr{
    border:1px solid var(--line); border-radius:var(--r);
    background:var(--surface); padding:11px 13px; margin:0 12px 10px;
  }
  .tbl--cartes tbody tr:hover{background:var(--surface-2)}

  .tbl--cartes td{
    border-bottom:0; padding:4px 0;
    display:flex; align-items:baseline; gap:12px;
  }

  .tbl--cartes td::before{
    content:attr(data-libelle);
    flex:none; width:104px;
    font-size:10.5px; font-weight:700; letter-spacing:.05em;
    text-transform:uppercase; color:var(--ink-4);
  }

  /* La première cellule porte l'identité : elle prend toute la largeur
     et se lit d'un coup, comme le titre d'une carte. */
  .tbl--cartes td:first-child{
    display:block; padding:0 0 8px;
    border-bottom:1px solid var(--line-2); margin-bottom:6px;
  }
  .tbl--cartes td:first-child::before{display:none}
  .tbl--cartes td .sub{white-space:normal}

  /* Une cellule vide n'occupe pas une ligne pour ne rien dire. */
  .tbl--cartes td:empty{display:none}

  /* Une carte ne défile pas : le bouton de vue rapide n'a pas à rester collé,
     et une pastille longue passe à la ligne au lieu de sortir de la carte. */
  table.tbl.tbl--cartes td.vr{position:static; width:auto; box-shadow:none; padding:12px 16px; background:none; align-items:center}
  .tbl--cartes td .pill, .tbl--cartes td .badge{white-space:normal; height:auto; line-height:1.35; padding-top:3px; padding-bottom:3px}

  .tbl--cartes .nowrap{white-space:normal}
}

.emptystate{padding:56px 24px; text-align:center; color:var(--ink-3)}
.emptystate svg{width:34px;height:34px; color:var(--ink-4); margin-bottom:12px}
.emptystate h4{margin-bottom:5px}
/* La page vide qui enseigne (fx_vide_guide) : ce qu'on range ici, puis
   deux ou trois étapes numérotées, chacune avec son geste. Le numéro
   porte l'ordre — c'est la seule chose que la mise en page ajoute. */
.emptystate--guide{padding:40px 24px}
.emptystate--guide p{max-width:520px; margin-left:auto; margin-right:auto}
.emptystate__etapes{list-style:none; counter-reset:etape; margin:18px auto 0; padding:0;
  max-width:520px; text-align:left; display:grid; gap:10px}
.emptystate__etapes li{counter-increment:etape; display:grid;
  grid-template-columns:24px minmax(0,1fr) auto; align-items:center; gap:10px;
  color:var(--ink-2); font-size:13.5px}
.emptystate__etapes li::before{content:counter(etape); width:24px; height:24px;
  border-radius:99px; background:var(--surface-2); border:1px solid var(--line);
  display:grid; place-items:center; font-size:12px; font-weight:700;
  color:var(--ink-3); font-variant-numeric:tabular-nums}
@media (max-width:560px){
  .emptystate__etapes li{grid-template-columns:24px minmax(0,1fr)}
  .emptystate__etapes li > .btn{grid-column:2; justify-self:start}
}

/* Filtres */
.filters{display:flex; gap:9px; flex-wrap:wrap; align-items:center; margin-bottom:16px}
.chip{
  display:inline-flex; align-items:center; gap:7px; height:32px; padding:0 13px; border-radius:99px;
  border:1px solid var(--line); background:var(--surface); font-size:12.5px; font-weight:550;
  color:var(--ink-2); cursor:pointer; transition:.14s;
}
.chip:hover{border-color:var(--line-fort); background:var(--surface-2)}
.chip.is-on{background:var(--inverse-fond); border-color:var(--inverse-fond); color:var(--inverse-texte)}
.chip .n{font-size:11px; opacity:.75; font-weight:700}
.selectwrap{position:relative}
.selectwrap select{height:32px; padding:0 30px 0 12px; font-size:12.5px; border-radius:99px;
  appearance:none; background:var(--surface); font-weight:550; cursor:pointer}
.selectwrap::after{content:""; position:absolute; right:12px; top:13px; width:6px;height:6px;
  border-right:1.6px solid var(--ink-3); border-bottom:1.6px solid var(--ink-3); transform:rotate(45deg); pointer-events:none}

/* ═══════════════ ONGLETS ═══════════════ */
.tabs{display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:22px; overflow-x:auto}
.tab{
  padding:10px 15px; font-size:13.5px; font-weight:600; color:var(--ink-3); cursor:pointer;
  border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; transition:.14s;
  display:flex; align-items:center; gap:7px; background:none; border-top:0; border-left:0; border-right:0;
}
.tab:hover{color:var(--ink)}
.tab.is-on{color:var(--brand); border-bottom-color:var(--brand)}
.tab .cnt{font-size:11px; font-weight:700; background:var(--line-2); color:var(--ink-3); padding:0 6px; border-radius:99px}
.tab.is-on .cnt{background:var(--brand-50); color:var(--brand-700)}

/* ═══════════════ TIMELINE ═══════════════ */
.tl{position:relative; padding-left:26px}
.tl::before{content:""; position:absolute; left:7px; top:6px; bottom:6px; width:2px; background:var(--line)}
.tlitem{position:relative; padding-bottom:20px}
.tlitem:last-child{padding-bottom:0}
.tlitem::before{
  content:""; position:absolute; left:-24px; top:4px; width:12px;height:12px;border-radius:50%;
  background:var(--surface); border:2.5px solid var(--ink-4);
}
.tlitem.is-brand::before{border-color:var(--brand); background:var(--brand)}
.tlitem.is-red::before{border-color:var(--red); background:var(--red)}
.tlitem.is-green::before{border-color:var(--green); background:var(--green)}
.tlitem.is-amber::before{border-color:var(--accent); background:var(--accent)}
.tlitem__t{font-size:13.5px; font-weight:600; display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.tlitem__m{font-size:12px; color:var(--ink-4); margin-top:2px}
.tlitem__d{font-size:12.5px; color:var(--ink-2); margin-top:6px; background:var(--surface-2);
  border:1px solid var(--line-2); border-radius:var(--r); padding:9px 12px}

/* Étapes du cycle d'état */
.stepper{display:flex; gap:0; overflow-x:auto; padding:4px 0}
.step{display:flex; align-items:center; gap:8px; padding:7px 14px 7px 12px; font-size:12px; font-weight:600;
  background:var(--surface-2); color:var(--ink-4); position:relative; white-space:nowrap; flex:none;
  border-top:1px solid var(--line); border-bottom:1px solid var(--line)}
.step:first-child{border-left:1px solid var(--line); border-radius:var(--r) 0 0 var(--r)}
.step:last-child{border-right:1px solid var(--line); border-radius:0 var(--r) var(--r) 0}
.step .num{width:18px;height:18px;border-radius:50%; background:var(--line); color:var(--ink-3);
  display:grid; place-items:center; font-size:10px; font-weight:700}
.stepper .is-done{background:var(--brand-50); color:var(--brand-700)}
.stepper .is-done .num{background:var(--brand); color:#fff}
.stepper .is-now{background:var(--brand); color:#fff}
.stepper .is-now .num{background:rgba(255,255,255,.25); color:#fff}

/* ═══════════════ CARTE / SVG ═══════════════ */
.mapbox{position:relative; background:var(--carte-fond); border-radius:var(--r-lg); overflow:hidden; border:1px solid var(--line)}
.mapbox>svg{width:100%; height:auto; display:block; stroke:none}
.maptools{position:absolute; top:76px; left:16px; display:flex; flex-direction:column; gap:8px; z-index:2}
.maplayers{background:var(--verre); border:1px solid var(--line); border-radius:var(--r);
  padding:11px 13px; box-shadow:var(--sh-2); backdrop-filter:blur(6px)}
.maplayers h5{font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--ink-4); margin-bottom:8px}
.lyr{display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-2); padding:3px 0; cursor:pointer}
.lyr input{width:14px;height:14px; accent-color:var(--brand); cursor:pointer}
.netmap{cursor:grab; touch-action:none; -webkit-user-select:none; user-select:none}
.netmap.is-drag{cursor:grabbing}
.mapnode{cursor:pointer}
.mapnode:hover rect,.mapnode:hover circle{filter:brightness(1.06)}
.mapnode:hover text{font-weight:700}

.maphint{position:absolute; top:14px; right:14px; z-index:2; display:flex; align-items:center; gap:7px;
  background:var(--verre); border:1px solid var(--line); border-radius:99px; padding:5px 13px;
  font-size:11.5px; color:var(--ink-3); box-shadow:var(--sh-1); pointer-events:none; max-width:calc(100% - 28px)}
.maphint svg{width:13px; height:13px; color:var(--ink-4)}

.mapzoom{position:absolute; bottom:14px; right:14px; display:flex; gap:6px; z-index:2; align-items:center}
.mapzoom .btn{background:var(--verre); box-shadow:var(--sh-2); min-width:31px}
.mapzoomlvl{display:grid; place-items:center; height:31px; padding:0 11px; background:var(--verre);
  border:1px solid var(--line); border-radius:var(--r-sm); box-shadow:var(--sh-2);
  font-size:11.5px; font-weight:600; color:var(--ink-2); font-variant-numeric:tabular-nums}
.maplegend{position:absolute; bottom:14px; left:14px; background:var(--verre); border:1px solid var(--line);
  border-radius:var(--r); padding:10px 13px; box-shadow:var(--sh-2); display:flex; gap:16px; flex-wrap:wrap; z-index:2}
.lg{display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-2)}
.lg i{width:10px;height:10px;border-radius:50%; display:block}
.lg i.ln{width:16px;height:3px;border-radius:2px; background:var(--brand)}
/* Couleurs de la légende. Elles vivent dans la feuille, au même endroit
   que celles de la carte : posées en style en ligne, elles finiraient
   par diverger de ce que la carte dessine. */
.lg-ok{background:var(--surface); border:2px solid var(--brand)}
.lg-warn{background:var(--accent)}
.lg-inc{background:var(--red)}
.lg-halo{background:var(--red); opacity:.28}
.lg-otdr{background:#0f766e; border-radius:0; width:3px}
/* Les ouvrages posés : mêmes teintes que les repères de la carte réelle,
   sans quoi la légende désignerait autre chose que ce qu'on voit. */
.lg-poteau{background:#8b5cf6}
.lg-boitier{background:#0ea5e9}
.lg-racc{background:#10b981}
.lg-chambre{background:#f59e0b}
/* Les tronçons (MET-002) : la couleur dit le mode de pose — terre pour le
   souterrain, violet des poteaux pour l'aérien —, le tireté un tronçon
   encore prévu. */
.lg i.lg-troncon{width:16px;height:3px;border-radius:2px; background:#b45309}
.lg i.lg-troncon-aerien{background:#7c3aed}
.lg i.lg-troncon-prevu{background:repeating-linear-gradient(90deg,#b45309 0 4px,transparent 4px 7px)}
/* Les réserves de réception (OSP-013) : un losange, pour ne pas se
   confondre avec les ronds des ouvrages sur lesquels il se pose. La
   couleur dit la gravité ; l'anneau, qu'une correction attend d'être
   constatée ; le gris, que la réserve est levée. */
.lg i.lg-rsv{border-radius:1px; transform:rotate(45deg); width:9px; height:9px}
.lg-rsv-majeure{background:#dc2626}
.lg-rsv-mineure{background:#d97706}
.lg-rsv-observation{background:#475569}
.lg-rsv-corrigee{background:#fff; box-shadow:inset 0 0 0 2px #d97706}
.lg-rsv-levee{background:#94a3b8}
/* Les écarts au plan (MET-010) : un trait tireté, rouge à traiter, gris
   une fois justifié — mêmes teintes que la carte. */
.lg i.lg-ecart{width:16px; height:0; border-radius:0; background:none; border-top:3px dashed #dc2626}
.lg i.lg-ecart-justifie{border-top-color:#94a3b8}
/* La mesure de surface de la carte réelle (GIS-004) : un bouton sous le
   zoom, un résultat en bas à gauche, un curseur en croix pendant la mesure. */
.reel-surface__b{display:block; padding:6px 10px; border:0; background:var(--surface); color:var(--ink);
    font-family:inherit; font-size:12px; font-weight:600; line-height:1.2; cursor:pointer}
.reel-surface__b:hover{background:var(--surface-2)}
.reel-surface__b:focus-visible{outline:2px solid var(--brand); outline-offset:2px}
.reel-surface__b.is-on{background:#111827; color:#fff}
.reel-surface__r{max-width:min(360px, calc(100vw - 48px)); padding:6px 10px; background:var(--surface); color:var(--ink);
    border-radius:var(--r); box-shadow:var(--sh-1); font-size:12.5px; font-weight:600;
    font-variant-numeric:tabular-nums}
.mapreel__c.is-mesure{cursor:crosshair}

/* Le panneau de couches ne s'élargit pas au gré des libellés : au-delà,
   il déborde du cadre de la carte, qui masque ce qui dépasse. */
/* ── Carte réelle ──────────────────────────────────────────────
   Une hauteur explicite, et non un ratio : un fond de carte n'a pas de
   proportion naturelle, et sans hauteur le conteneur s'effondre à zéro.
   Elle se réduit sur petit écran, où la page entière est plus courte. */
.mapreel{position:relative; border-radius:var(--r-lg); overflow:hidden;
  border:1px solid var(--line); background:var(--line-2)}
.mapreel__c{height:560px}

.reel-actif span{display:block; width:100%; height:100%; border-radius:50%;
  border:2px solid #fff; box-shadow:0 1px 3px rgba(15,23,42,.35)}

/* Un site (C1) : carré, là où un actif est rond. La forme distingue
   mieux que la couleur — elle se lit en noir et blanc, et elle tient
   quand deux marqueurs se superposent. */
.reel-site span{display:block; width:100%; height:100%; border-radius:3px;
  border:2px solid #fff; box-shadow:0 1px 4px rgba(15,23,42,.45);}
.reel-inc span{display:block; width:100%; height:100%; border-radius:50%;
  border:3px solid #fff; box-shadow:0 1px 4px rgba(15,23,42,.45)}
.reel-inc.is-on span{box-shadow:0 0 0 4px rgba(220,38,38,.22), 0 1px 4px rgba(15,23,42,.45)}
.reel-reserve span{display:block; width:100%; height:100%; border-radius:2px; transform:rotate(45deg);
  border:2px solid #fff; box-shadow:0 1px 3px rgba(15,23,42,.45)}
.reel-reserve.is-on span{box-shadow:0 0 0 4px rgba(15,23,42,.18), 0 1px 4px rgba(15,23,42,.45)}

.maplayers{max-width:190px}
.maplayers .btn{width:100%}

/* ═══════════════ WHATSAPP ═══════════════ */
.wa{background:#efe7de; border-radius:var(--r-lg); padding:20px; min-height:420px; max-height:560px;
  overflow-y:auto; border:1px solid var(--line);
  background-image:radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size:22px 22px}
.wamsg{max-width:78%; margin-bottom:12px; background:#fff; border-radius:10px; padding:10px 13px;
  box-shadow:0 1px 1px rgba(0,0,0,.09); font-size:13px; line-height:1.55; position:relative}
.wamsg--out{margin-left:auto; background:#dcf8c6}
.wamsg__h{font-size:11.5px; font-weight:700; color:var(--brand); margin-bottom:3px}
.wamsg__b{white-space:pre-wrap; word-break:break-word}
.wamsg__f{margin-top:5px; font-size:10.5px; color:#8a9199; display:flex; align-items:center; gap:5px; justify-content:flex-end}
.wamsg__f .ck{color:#53bdeb; font-weight:700; letter-spacing:-1px}
.wamsg__f .ck--gray{color:#9aa3ab}
.wabtns{display:flex; gap:6px; margin-top:9px; flex-wrap:wrap; border-top:1px solid rgba(0,0,0,.08); padding-top:8px}
.wabtn{flex:1; min-width:100px; text-align:center; font-size:12px; font-weight:600; color:#0a7cff;
  padding:6px; border-radius:6px; cursor:pointer; background:rgba(10,124,255,.06)}
.wabtn:hover{background:rgba(10,124,255,.12)}
.wahead{display:flex; align-items:center; gap:11px; padding:12px 16px; background:#075e54; color:#fff;
  border-radius:var(--r-lg) var(--r-lg) 0 0; margin:-1px -1px 0}
.wahead .n{font-size:13.5px; font-weight:650}
.wahead .s{font-size:11.5px; opacity:.75}
.wainput{display:flex; gap:9px; padding:12px; background:#f0f2f5; border-radius:0 0 var(--r-lg) var(--r-lg);
  border:1px solid var(--line); border-top:0}

/* ═══════════════ TÉLÉPHONE (aperçu PWA terrain) ═══════════════ */
.phonewrap{display:flex; justify-content:center; padding:8px 0}
.phone{
  width:376px; flex:none; background:var(--cadre-telephone); border-radius:38px; padding:11px;
  box-shadow:var(--sh-4); position:relative;
}
.phone__screen{background:var(--surface-2); border-radius:28px; overflow:hidden; height:734px;
  display:flex; flex-direction:column; position:relative}
.phone__notch{position:absolute; top:11px; left:50%; transform:translateX(-50%); width:112px; height:24px;
  background:var(--cadre-telephone); border-radius:0 0 16px 16px; z-index:5}
.phone iframe{width:100%; height:100%; border:0; background:var(--surface-2)}

.pstatus{height:40px; display:flex; align-items:flex-end; justify-content:space-between; padding:0 22px 5px;
  font-size:11.5px; font-weight:650; color:var(--ink); background:var(--surface); flex:none}
.phead{background:var(--brand); color:#fff; padding:13px 16px; display:flex; align-items:center; gap:11px; flex:none}
.phead h4{color:#fff; font-size:14.5px}
.phead p{font-size:11.5px; opacity:.85}
.pbody{flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:14px}
.ptabs{display:flex; background:var(--surface); border-top:1px solid var(--line); flex:none}
.ptab{flex:1; padding:9px 4px 12px; text-align:center; font-size:10.5px; font-weight:600; color:var(--ink-4);
  cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:4px; background:none; border:0}
.ptab svg{width:20px;height:20px}
.ptab.is-on{color:var(--brand)}
.pcard{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:14px; box-shadow:var(--sh-1)}
.pcard--alert{border-color:var(--red-200); background:linear-gradient(180deg,var(--surface),var(--red-50))}
.poffline{background:var(--accent-50); border:1px solid var(--amber-200); color:var(--amber-800); padding:9px 13px;
  border-radius:var(--r); font-size:12px; display:flex; align-items:center; gap:8px; font-weight:600}
.plist{display:grid; gap:9px}
.prow{display:flex; justify-content:space-between; gap:10px; font-size:12.5px; padding:7px 0;
  border-bottom:1px solid var(--line-2)}
.prow:last-child{border-bottom:0}
.prow .k{color:var(--ink-3)}
.prow .v{font-weight:600; text-align:right}
.pcheck{display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-bottom:1px solid var(--line-2); cursor:pointer}
.pcheck:last-child{border-bottom:0}
.pcheck input{width:17px;height:17px; accent-color:var(--brand); margin-top:1px; flex:none; cursor:pointer}
.pcheck .t{font-size:12.5px; line-height:1.45}
.pcheck .h{font-size:11px; color:var(--ink-3)}
.pphotos{display:grid; grid-template-columns:repeat(3,1fr); gap:8px}
.pphoto{aspect-ratio:1; border-radius:var(--r-sm); background:linear-gradient(135deg,var(--line-fort),var(--ink-4));
  display:grid; place-items:center; color:#fff; font-size:10px; font-weight:600; text-align:center; padding:5px;
  position:relative; overflow:hidden}
.pphoto--add{background:var(--surface); border:1.5px dashed var(--line); color:var(--ink-4); cursor:pointer}
.pphoto--add:hover{border-color:var(--brand); color:var(--brand)}

.fldsteps{display:flex; gap:4px; overflow-x:auto; padding:2px 0 4px}
.fldstep{flex:1; min-width:56px; display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:7px 4px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface);
  font-size:10px; font-weight:600; color:var(--ink-4); cursor:pointer; transition:.14s}
.fldstep:hover{border-color:var(--line-fort)}
.fldstep .dotstep{width:16px; height:16px; border-radius:50%; background:var(--line-2); color:transparent;
  display:grid; place-items:center; font-size:9px; font-weight:700}
.fldstep.is-done{color:var(--green-700); border-color:var(--green-200); background:var(--green-50)}
.fldstep.is-done .dotstep{background:var(--green); color:#fff}
.fldstep.is-now{color:#fff; background:var(--brand); border-color:var(--brand)}
.fldstep.is-now .dotstep{background:rgba(255,255,255,.28); color:#fff}

.fldtabs{display:flex; gap:5px; background:var(--surface-2); padding:4px; border-radius:var(--r); border:1px solid var(--line)}
.fldtab{flex:1; padding:7px 6px; border:0; background:transparent; border-radius:var(--r-sm);
  font-size:11.5px; font-weight:600; color:var(--ink-3); cursor:pointer; transition:.14s}
.fldtab b{font-size:10.5px; opacity:.65; margin-left:3px}
.fldtab.is-on{background:var(--surface); color:var(--brand); box-shadow:var(--sh-1)}

.fldpick{display:block; width:100%; text-align:left; padding:10px 12px; border:1px solid var(--line);
  border-radius:var(--r); background:var(--surface); cursor:pointer; transition:.14s}
.fldpick:hover{border-color:var(--line-fort); background:var(--surface-2)}
.fldpick b{display:block; font-size:12.5px; font-weight:600; color:var(--ink)}
.fldpick span{display:block; font-size:11px; color:var(--ink-3); margin-top:2px; line-height:1.4}
.fldpick.is-on{border-color:var(--brand); background:var(--brand-50); box-shadow:0 0 0 3px var(--focus-anneau)}
.fldpick.is-on b{color:var(--brand-700)}

table.tbl tbody tr.is-cur{background:var(--brand-50)}
table.tbl tbody tr.is-cur:hover{background:var(--brand-100)}

/* Le liseré bleu de gauche est retiré à la demande du client : il
   distinguait mal les cartes entre elles et alourdissait une colonne
   déjà étroite.

   `display:block` et la couleur d'encre ne sont pas décoratifs. Ces
   cartes sont de vrais liens — atteignables au clavier, ouvrables dans
   un nouvel onglet, ce qu'un `<div>` rendu cliquable par du JavaScript
   n'est pas. Mais un `<a>` est en ligne, bleu et souligné au survol :
   sans ces trois règles, la carte cesserait d'être une carte. */
.planitem{display:block; border:1px solid var(--line); border-radius:var(--r-sm);
  padding:8px 10px; margin-bottom:7px; background:var(--surface); color:var(--ink);
  cursor:pointer; transition:.14s}
.planitem:hover{box-shadow:var(--sh-2); border-color:var(--line-fort); text-decoration:none}
.planitem b{display:block; font-size:12px; margin:5px 0 2px; line-height:1.35}
.planitem .muted{font-size:11px; color:var(--ink-3)}

/* ═══════════════ TIROIR SIMULATEUR ═══════════════ */
.drawer{
  position:fixed; top:0; right:0; width:440px; max-width:92vw; height:100vh; background:var(--surface);
  box-shadow:var(--sh-4); z-index:120; transform:translateX(100%); transition:transform .28s cubic-bezier(.4,0,.2,1);
  display:flex; flex-direction:column;
}
.drawer.is-open{transform:translateX(0)}
.drawer__head{padding:20px 22px; border-bottom:1px solid var(--line); display:flex; gap:14px; align-items:flex-start}
.drawer__head h3{font-size:15px}
.drawer__head p{font-size:12.5px; margin-top:3px}
.drawer__head .iconbtn{margin-left:auto; flex:none}
.drawer__body{flex:1; overflow-y:auto; padding:20px 22px 40px}
.scrim{position:fixed; inset:0; background:var(--scrim); z-index:110; opacity:0; pointer-events:none;
  transition:opacity .28s}
.scrim.is-on{opacity:1; pointer-events:auto}

.simsec{margin-bottom:26px}
.simsec__t{font-size:10.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--ink-4);
  margin-bottom:10px; display:flex; align-items:center; gap:8px}
.scn{border:1px solid var(--line); border-radius:var(--r); padding:13px 14px; margin-bottom:9px; transition:.15s;
  background:var(--surface)}
.scn:hover{border-color:var(--line-fort); box-shadow:var(--sh-2)}
.scn__h{display:flex; align-items:center; gap:9px; margin-bottom:5px}
.scn__h h4{font-size:13px; flex:1}
.scn__d{font-size:12px; color:var(--ink-3); line-height:1.5; margin-bottom:10px}
.scn__f{display:flex; gap:8px; align-items:center}
.scn__f .btn{flex:1}
.scn.is-fired{background:var(--surface-2); opacity:.72}

.togglerow{display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line-2)}
.togglerow:last-child{border-bottom:0}
.togglerow .t{flex:1}
.togglerow .t b{font-size:12.5px; font-weight:600; display:block}
.togglerow .t span{font-size:11.5px; color:var(--ink-3)}
.switch{width:40px;height:23px;border-radius:99px;background:var(--line); position:relative; cursor:pointer;
  transition:.2s; flex:none; border:0}
.switch::after{content:""; position:absolute; top:2.5px; left:2.5px; width:18px;height:18px;border-radius:50%;
  background:var(--texte-sur-marque); transition:.2s; box-shadow:var(--sh-1)}
.switch.is-on{background:var(--brand)}
.switch.is-on::after{transform:translateX(17px)}
.switch.is-on.switch--warn{background:var(--accent)}

/* ═══════════════ NOTIFICATIONS / TOASTS / MODALE ═══════════════ */
.notifpanel{
  position:fixed; top:calc(var(--topbar-h) + 8px); right:16px; width:392px; max-width:92vw; max-height:74vh;
  overflow-y:auto; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--sh-4); z-index:100; display:none;
}
.notifpanel.is-open{display:block}
.notifpanel__h{padding:14px 18px; border-bottom:1px solid var(--line-2); display:flex; align-items:center; gap:10px}
.notif{padding:13px 18px; border-bottom:1px solid var(--line-2); display:flex; gap:12px; cursor:pointer}
.notif:hover{background:var(--surface-2)}
.notif__t{font-size:12.5px; font-weight:600; line-height:1.4}
.notif__m{font-size:11.5px; color:var(--ink-3); margin-top:2px}
.notif .ic{width:32px; height:32px; flex:none; border-radius:9px; display:grid; place-items:center}
.notif .ic svg{width:16px; height:16px}
/* Une non lue se distingue d’une lue, sans quoi le panneau ne dit plus
   ce qui est nouveau — et la pastille rouge devient le seul indice. */
.notif--neuve{background:var(--brand-50)}
.notif--neuve:hover{background:var(--brand-50)}
.notif--neuve .notif__t{font-weight:700}
a.notif{color:inherit; text-decoration:none}
a.notif:hover{text-decoration:none}

.toasts{position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:200; display:flex;
  flex-direction:column; gap:9px; align-items:center; pointer-events:none}
.toast{
  background:var(--inverse-fond); color:var(--inverse-texte); padding:11px 17px; border-radius:99px; font-size:13px; font-weight:550;
  box-shadow:var(--sh-4); display:flex; align-items:center; gap:10px; max-width:min(620px,92vw);
  animation:toastIn .26s cubic-bezier(.2,.9,.3,1.3);
}
.toast svg{width:16px;height:16px}
.toast--ok{background:#14532d} .toast--warn{background:#92400e} .toast--red{background:#991b1b}
@keyframes toastIn{from{opacity:0; transform:translateY(14px) scale(.96)}to{opacity:1; transform:none}}

.modal{position:fixed; inset:0; background:var(--scrim); z-index:150; display:none;
  align-items:center; justify-content:center; padding:24px}
.modal.is-open{display:flex}
.modal__box{background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--sh-4); width:100%;
  max-width:600px; max-height:88vh; overflow-y:auto; animation:toastIn .22s ease}
.modal__box--lg{max-width:860px}
.modal__h{padding:20px 24px 0; display:flex; gap:14px; align-items:flex-start}
.modal__h h3{flex:1}
.modal__b{padding:16px 24px 20px}
.modal__f{padding:16px 24px; border-top:1px solid var(--line-2); display:flex; gap:9px; justify-content:flex-end;
  background:var(--surface-2); border-radius:0 0 var(--r-lg) var(--r-lg)}

/* Grille de formulaires générés par UI.form */
.formgrid{display:grid; grid-template-columns:1fr 1fr; gap:0 18px}
.formgrid .field--full{grid-column:1/-1}
.field .req{color:var(--red)}
.field .hint{font-size:11px; color:var(--ink-4); margin-top:5px}
.field.invalid input,.field.invalid select,.field.invalid textarea{border-color:var(--red); box-shadow:0 0 0 3px rgba(220,38,38,.10)}
.field .err{display:none; font-size:11px; color:var(--red-700); margin-top:5px}
.field.invalid .err{display:block}
.checkrow{display:flex; align-items:center; gap:9px; padding:9px 0; font-size:13px; cursor:pointer}
.checkrow input{width:16px; height:16px; accent-color:var(--brand); cursor:pointer}

/* ═══════════════ DIVERS ═══════════════ */
.note{padding:13px 16px; border-radius:var(--r); font-size:12.5px; line-height:1.6; display:flex; gap:11px;
  border:1px solid transparent}
.note svg{width:16px;height:16px; margin-top:1px; flex:none}
.note--info{background:var(--brand-50); border-color:var(--brand-200); color:var(--brand-700)}
.note--warn{background:var(--accent-50); border-color:var(--amber-200); color:var(--amber-800)}
.note--danger{background:var(--red-50); border-color:var(--red-200); color:var(--red-800)}
.note--ok{background:var(--green-50); border-color:var(--green-200); color:var(--green-700)}
.note--neutral{background:var(--surface-2); border-color:var(--line); color:var(--ink-2)}

/* Vue rapide : le bouton reste à portée quand le tableau défile. */
table.tbl th.vr, table.tbl td.vr{position:sticky; right:0; width:44px; padding-left:8px; padding-right:12px;
  background:var(--surface); box-shadow:-8px 0 8px -8px rgba(15,23,42,.14)}
table.tbl th.vr{background:var(--surface-2)}
/* Trop large pour son cadre : il se resserre, puis replie ses colonnes
   secondaires, que la vue rapide montre (shell.js, ajusterTableau). */
table.tbl.tbl--serre th, table.tbl.tbl--serre td{padding:10px 9px}
table.tbl.tbl--serre th.vr, table.tbl.tbl--serre td.vr{padding-left:6px; padding-right:10px}
table.tbl th.col-repliee, table.tbl td.col-repliee{display:none}
.tbl-replis{margin:0; padding:8px 16px 10px; font-size:11.5px; color:var(--ink-3)}
.btn--icone{padding-left:8px; padding-right:8px}
.vr-liste{display:grid; gap:0; margin:0}
.vr-ligne{display:grid; grid-template-columns:150px 1fr; gap:12px; padding:9px 0; border-bottom:1px solid var(--line-2)}
.vr-ligne:last-child{border-bottom:0}
.vr-ligne dt{font-size:12px; color:var(--ink-3)}
.vr-ligne dd{margin:0; font-size:13px; color:var(--ink); overflow-wrap:anywhere; white-space:pre-line}
@media (max-width:520px){ .vr-ligne{grid-template-columns:1fr; gap:2px} }

/* Un code se lit d'un bloc : coupé sur trois lignes, il ne se reconnaît plus,
   et chaque ligne de tableau prenait le quart de l'écran. */
table.tbl .id{white-space:nowrap}
/* Le texte long tient sur deux lignes : la suite est dans la vue rapide. */
.deux-lignes{display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden}

/* Un geste replié : l'état se lit d'abord, le formulaire s'ouvre au besoin. */
.geste{margin-top:10px}
.geste>summary{list-style:none; display:inline-flex; cursor:pointer}
.geste>summary::-webkit-details-marker{display:none}
.geste[open]>summary{margin-bottom:12px}

/* Un long code ou une longue adresse se coupe plutôt que de pousser la page. */
.mono{overflow-wrap:anywhere}

/* La règle du mot de passe, sous le champ. */
.mdp-regles{display:flex; flex-direction:column; align-items:flex-start; gap:4px; margin-top:8px}
.mdp-regle{font-size:12px; color:var(--ink-2); padding-left:18px; position:relative}
.mdp-regle::before{content:"○"; position:absolute; left:0}
.mdp-regle.is-ok{color:var(--green-700)}
.mdp-regle.is-ok::before{content:"✓"}
.mdp-regle.is-info::before{content:"•"}
.mdp-regles .btn{margin-top:4px}
.note b{font-weight:670}

.deflist{display:grid; gap:0; min-width:0}
/* La valeur passe sous son libellé quand la carte est étroite : dans une colonne
   latérale, elle tenait sur 27 pixels et poussait son badge hors de l'écran. */
.def{display:flex; flex-wrap:wrap; gap:2px 16px; padding:11px 0;
  border-bottom:1px solid var(--line-2); font-size:13px; align-items:baseline}
.def>dt{flex:0 1 175px}
.def>dd{flex:1 1 130px}
.def:last-child{border-bottom:0}
.def dt{color:var(--ink-3); font-size:12.5px; min-width:0; overflow-wrap:anywhere}
.def dd{margin:0; font-weight:550; min-width:0; overflow-wrap:anywhere}

.bar{height:7px; border-radius:99px; background:var(--line-2); overflow:hidden}
.bar>i{display:block; height:100%; border-radius:99px; background:var(--brand); transition:width .5s}
.bar>i.amber{background:var(--accent)} .bar>i.red{background:var(--red)} .bar>i.green{background:var(--green)}

/* Les trois parts d'une rangée : le libellé, la barre, le chiffre.
   Le libellé était figé à 180 px et interdit de rétrécir ; dans une
   colonne étroite, les 180 px du libellé, les 64 du chiffre et les deux
   écarts dépassaient la place disponible, et la page glissait de
   quelques pixels. Le libellé cède maintenant avant la barre. */
.meterrow{display:flex; align-items:center; gap:12px; padding:9px 0;
  font-size:12.5px; min-width:0}
.meterrow .lab{flex:0 1 180px; min-width:0; color:var(--ink-2);
  overflow-wrap:anywhere}
.meterrow .bar{flex:1 1 40px; min-width:24px}
.meterrow .val{width:64px; text-align:right; font-weight:650; font-size:12.5px; flex:none}

.stack{display:flex; flex-direction:column; gap:20px; min-width:0}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
/* Employé depuis le lot 3 sans avoir jamais été défini : les rangées
   concernées ne s'écartaient pas. */
.row--between{justify-content:space-between; width:100%}

/* ═══════════════ ÉTATS DE TEXTE ═══════════════
   Ces trois-là n'existaient qu'en sélecteur composé (.tlitem.is-red) :
   employées seules, elles ne coloraient rien. Le garde-fou du lot 13 bis
   ne l'avait pas vu — il acceptait une classe présente n'importe où dans
   la feuille, fût-ce accrochée à une autre. */
.is-red{color:var(--red)}
.is-amber{color:var(--accent-600)}
.is-green{color:var(--green)}

/* ═══════════════ CHAMP DE POSITION ═══════════════ */
.champgps{display:block}
.champgps__saisie{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.champgps__saisie input{flex:1; min-width:220px}
.champgps__carte{
  margin-top:10px; border:1px solid var(--line); border-radius:var(--r);
  overflow:hidden; background:var(--surface-2);
}
/* Leaflet pose ses propres contrôles ; on les aligne sur la charte sans
   toucher à la feuille de la bibliothèque, qui doit rester telle quelle
   pour être remplaçable par une mise à jour. */
.champgps__carte .leaflet-container{font:inherit; background:var(--surface-2)}
.champgps__carte .leaflet-control-attribution{
  font-size:10.5px; background:var(--verre-2)
}

/* leaflet.css pose `position:relative` sur `.leaflet-container` sans
   jamais fixer son `z-index` — il reste `auto`, ce qui n'ouvre aucun
   contexte d'empilement propre. Les contrôles et infobulles internes
   de Leaflet (jusqu'à 1000, voire davantage pour une infobulle
   ouverte) rivalisaient alors directement avec `.modal` (150) : sur
   un incident portant une carte de trace, le bouton de zoom ou une
   infobulle ouverte passait devant « Reclasser l'incident », «
   Affecter une équipe ». Fixer un `z-index` bas ici referme le
   contexte d'empilement sur la carte elle-même — ses contrôles
   restent au-dessus de ses propres tuiles, mais toute la carte reste
   sous n'importe quelle boîte de dialogue du reste de l'application. */
.leaflet-container{position:relative; z-index:1}

/* Le marqueur d'une équipe suivie en ce moment.
   ---------------------------------------------
   C'est la seule chose de ces cartes qui bouge, et la raison pour
   laquelle on les ouvre. Un rond vert de neuf pixels se perdait
   pourtant sur un fond de tuiles — surtout en satellite, où le vert de
   la végétation est partout.

   Deux pièces désormais : le repère, plein et cerclé de blanc, qui bat
   doucement ; et sous lui un halo qui s'écarte et s'efface, comme une
   onde. Le halo n'intercepte pas le clic — sans quoi il faudrait viser
   le centre exact pour ouvrir l'infobulle. */
.fx-marqueur-direct{
  transform-box:fill-box; transform-origin:center;
  animation:fx-pouls 1.6s ease-in-out infinite;
  filter:drop-shadow(0 0 3px rgba(22,163,74,.9));
}
.fx-halo-direct{
  transform-box:fill-box; transform-origin:center;
  animation:fx-onde 2.2s ease-out infinite;
}
@keyframes fx-pouls{ 0%,100%{opacity:1} 50%{opacity:.7} }
@keyframes fx-onde{
  0%   { transform:scale(.55); opacity:.75 }
  70%  { transform:scale(1.35); opacity:.12 }
  100% { transform:scale(1.5);  opacity:0 }
}
@media (prefers-reduced-motion:reduce){
  .fx-marqueur-direct, .fx-halo-direct{animation:none}
  /* Sans animation, le halo reste : il porte à lui seul la
     visibilité que le battement apportait. */
  .fx-halo-direct{opacity:.5}
}
.lg-en-direct{color:var(--green); font-weight:700}

.sep{height:1px; background:var(--line-2); margin:16px 0}

.confbar{display:flex; align-items:center; gap:5px; flex-wrap:wrap}
.confbar .seg{width:22px; height:6px; border-radius:2px; background:var(--line-2); flex:none}
.confbar b{margin-left:5px}
.confbar .seg.on{background:var(--accent)}
.confbar .seg.on.hi{background:var(--green)}
.confbar .seg.on.lo{background:var(--red)}

.codeblock{background:#0f1b33; color:#cbd5e1; border-radius:var(--r); padding:15px 17px; font-family:var(--mono);
  font-size:12px; line-height:1.7; overflow-x:auto; white-space:pre}
.codeblock .k{color:#93c5fd} .codeblock .s{color:#fcd34d} .codeblock .c{color:#64748b}

.matrix td{text-align:center; font-size:12px}
.matrix td:first-child{text-align:left; font-weight:600}
.matrix .yes{color:var(--green); font-weight:700}
.matrix .no{color:var(--ink-4)}
.matrix .part{color:var(--accent-600); font-weight:650; font-size:11.5px}

/* Une case modifiable se distingue d'une case en lecture : sans repère,
   personne ne devine qu'elle s'ouvre — et la matrice paraît figée comme
   avant. Le bouton hérite de la couleur de sa case pour ne rien changer
   à la lecture d'ensemble. */
.matrix .lienmat{
  all:unset; cursor:pointer; color:inherit; font:inherit;
  padding:2px 7px; border-radius:99px; border:1px dashed transparent;
  transition:.13s;
}
.matrix .lienmat:hover,
.matrix .lienmat:focus-visible{
  border-color:currentColor; background:var(--surface-2);
}

.evrow{display:flex; gap:12px; padding:11px 0; border-bottom:1px solid var(--line-2); align-items:flex-start}
.evrow:last-child{border-bottom:0}
.evrow__t{font-size:12.5px; font-weight:600}
.evrow__m{font-size:11.5px; color:var(--ink-3); margin-top:1px}
.evrow__x{margin-left:auto; font-size:11px; color:var(--ink-4); white-space:nowrap; text-align:right; flex:none}

/* ═══════════════ PLAN D'OCCUPATION D'UN BOÎTIER ═══════════════
   Une case par port réellement ouvert — jamais par position théorique
   du coffret. La couleur dit l'état, le numéro est celui gravé sur le
   boîtier : c'est ce que le technicien lit en l'ouvrant. */
.portplan{display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:9px}
.portplan__p{border:1px solid var(--line); border-radius:var(--r); padding:9px 11px;
  background:var(--surface-2); font-size:11.5px; line-height:1.5; min-width:0}
.portplan__p b{display:block; font-family:var(--mono); font-size:12.5px}
.portplan__p span{display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.portplan__p--libre{background:var(--green-50); border-color:var(--green-200)}
.portplan__p--occupe{background:var(--brand-50); border-color:var(--brand-200)}
.portplan__p--hs{background:var(--red-50); border-color:var(--red-200)}
.portplan__p--reserve{background:var(--accent-50); border-color:var(--amber-200)}
.portplan__p--bloque{background:var(--slate-100); border-color:var(--line-fort)}

/* ═══════════════ PHOTOS DU DOSSIER DE PREUVES ═══════════════ */
.photogrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px}
.photogrid__i{border:1px solid var(--line); border-radius:var(--r); overflow:hidden;
  background:var(--surface-2)}
.photogrid__i img{display:block; width:100%; height:136px; object-fit:cover; background:var(--line-2)}
.photogrid__c{padding:9px 11px; font-size:11.5px; line-height:1.55}

.livedot{width:6px;height:6px;border-radius:50%;background:var(--red); display:inline-block;
  animation:pulse 1.8s infinite}
@keyframes pulse{0%,100%{opacity:1; box-shadow:0 0 0 0 rgba(220,38,38,.5)}50%{opacity:.7; box-shadow:0 0 0 5px rgba(220,38,38,0)}}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width:1360px){
  .g-5{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:1180px){
  .g-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g-31,.g-21,.g-12{grid-template-columns:minmax(0,1fr)}
  .topbar__search{max-width:280px}
}
@media (max-width:980px){
  .login{grid-template-columns:1fr}
  .login__brand{padding:44px 32px; min-height:auto}
  .login__logo{width:170px; margin-bottom:28px}
  .login__title{font-size:34px}
  .login__points{display:none}
  .login__foot{margin-top:28px}
  .g-3,.g-2{grid-template-columns:minmax(0,1fr)}
  .main{padding:20px 18px 44px}
  .sidebar{position:fixed; top:var(--topbar-h); left:0; z-index:90; transform:translateX(-100%);
    transition:transform .25s; box-shadow:var(--sh-4)}
  .sidebar.is-open{transform:translateX(0)}
  .topbar__burger{display:grid}
  /* ── Le périmètre tient sur une ligne ────────────────────────
     Le métier, le client, l'activité et le pays **commandent** ce que montre tout l'écran, et aucune autre porte
     n'y mène : on ne peut pas les masquer. Mais quatre sélecteurs ne tiennent pas côte à côte sur un téléphone,
     et les ranger sur deux rangs faisait une barre haute et débordante.

     Ils se rangent donc derrière **une** ligne qui dit où l'on est (« Energy · Airtel · Niger »), sous la barre ;
     elle s'ouvre en un panneau, un champ par ligne avec son nom. La barre fait deux rangs fixes — d'où
     `--topbar-h`, dont la barre latérale et le panneau des notifications se servent pour se placer. */
  :root{--topbar-h:106px}
  :root:has(.topbar__scopes--fixe){--topbar-h:60px}
  .topbar{display:flex; flex-wrap:wrap; align-content:flex-start; align-items:center; gap:0 8px; padding:0 12px}
  .topbar__left{display:contents}
  .topbar__burger,.topbar__brand,.topbar__right{height:56px}
  /* Le logo cède la place, jamais les boutons : à base nulle, il ne compte pas
     quand la barre décide de passer à la ligne, et rétrécit dans ce qui reste.
     Sans quoi, à 390 px, les boutons passaient sur un troisième rang et la barre,
     haute de deux, débordait sur le titre de la page (17/11/2026). */
  .topbar__brand{min-width:0; flex:1 1 0}
  .topbar__brand img{max-width:min(104px, 100%); height:auto; max-height:26px; object-fit:contain; object-position:left center}
  .topbar__right{margin-left:auto; padding-top:0}
  .topbar__search{display:none}

  .topbar__scopes{display:block; order:9; flex:0 0 100%; min-width:0; padding:0 0 10px; position:relative}
  .topbar__scopes--fixe{display:none}
  .topbar__ctx{display:flex; align-items:center; gap:8px; width:100%; max-width:none; height:40px; padding:0 12px; cursor:pointer;
    border:1px solid var(--line); border-radius:99px; background:var(--surface-2); color:var(--ink-2);
    font:inherit; font-size:13px; font-weight:550; text-align:left}
  .topbar__ctx-t{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .topbar__ctx[aria-expanded="true"]{border-color:var(--brand); background:var(--surface)}

  /* Le panneau : un champ par ligne, son nom au-dessus, pleine largeur. */
  .topbar__ctxpanel{display:none; position:absolute; left:0; right:0; width:auto; top:calc(100% - 4px); z-index:70;
    flex-direction:column; gap:12px; padding:14px; background:var(--surface); border:1px solid var(--line);
    border-radius:var(--r-lg, 14px); box-shadow:var(--sh-4)}
  .topbar__scopes.is-ouvert .topbar__ctxpanel{display:flex}
  .topbar__scope{display:grid; grid-template-columns:auto 1fr; grid-template-areas:"nom nom" "ic ch"; gap:4px 8px;
    align-items:center; height:auto; min-width:0; padding:0; border:0; background:none}
  .topbar__scope-l{display:block; grid-area:nom; font-size:11px; font-weight:700; letter-spacing:.08em;
    text-transform:uppercase; color:var(--ink-4)}
  .topbar__scope>svg{grid-area:ic; flex:none}
  .topbar__scope form,.topbar__scope .topbar__pays{grid-area:ch; min-width:0; display:flex}
  .topbar__scope select,.topbar__scope .topbar__pays{width:100%; max-width:none; height:40px; padding:0 12px;
    border:1px solid var(--line); border-radius:10px; background:var(--surface-2); font-size:14px}
  .topbar__scope .topbar__pays{line-height:40px; align-items:center}

  /* La langue : une icône dans la barre. Le sélecteur la recouvre, invisible — un toucher ouvre le choix natif. */
  .topbar__langue{position:relative; width:34px; padding:0; justify-content:center; border-radius:50%}
  .topbar__langue svg{width:17px; height:17px}
  .topbar__langue form{position:absolute; inset:0}
  .topbar__langue select{position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer}
  .def>dt,.def>dd{flex-basis:100%}
}
/* ── Cartes sur petit écran ────────────────────────────────────
   Le panneau des couches, la légende et les commandes de zoom sont
   posés en surimpression : sur un téléphone ils recouvrent la carte
   qu'ils sont censés servir. Ils passent donc sous elle, dans le flux,
   où ils restent lisibles et cessent de la masquer. */
@media (max-width:860px){
  .mapreel__c{height:380px}

  .maptools{position:static; margin-top:12px}
  .maplayers{max-width:none}
  .maplegend{position:static; margin-top:10px; display:flex; flex-wrap:wrap;
    gap:10px 16px; box-shadow:none; border-radius:var(--r)}
  .maphint{display:none}
  .mapzoom{bottom:10px; right:10px}
  .mapbox{overflow:visible}
}

/* Sur téléphone, le choix clair / sombre quitte la barre, comme chez Adarka :
   il reste dans Profil → Affichage. La place va aux boutons de tous les jours.
   Sous 370 px, la langue la suit (même carte du profil) : le logo garde ainsi
   sa largeur. Deux classes : `.topbar__theme{display:contents}` (ui-pro.css)
   passe après cette feuille. */
@media (max-width:480px){
  .topbar__right .topbar__theme{display:none}
}
@media (max-width:370px){
  .topbar__right .topbar__langue{display:none}
}
@media (max-width:760px){
  .topbar{padding:0 12px}
  .topbar__right{gap:5px}
  .topbar__user{padding:2px}
  .topbar__user>span:last-child{display:none}
  #btnSim span{display:none}
}
@media (max-width:560px){
  .g-4,.g-5{grid-template-columns:minmax(0,1fr)}
  .phone{width:100%; border-radius:22px; padding:7px}
  .phone__screen{height:640px; border-radius:18px}
  .topbar__product{display:none}
  .pagehead__a{margin-left:0; width:100%}
  .pagehead__a .btn{flex:1}
  .main{padding:18px 14px 40px}
  .card__h,.card__b{padding:14px 16px}
  .filters{gap:7px}
  .formgrid{grid-template-columns:1fr}
}

/* ═══════════════════════════════════════════════════════════════
   Éditeur visuel du référentiel

   Trois colonnes : ce qu'on pose, où on le pose, ce qu'on en dit.
   La carte occupe la hauteur disponible — un éditeur cartographique
   qui tient dans une vignette ne sert à rien.
   ═══════════════════════════════════════════════════════════════ */
.ed{display:grid; grid-template-columns:260px minmax(0,1fr) 330px; gap:16px;
    align-items:stretch; min-height:640px}

.ed-palette,.ed-panneau{background:var(--surface); border:1px solid var(--line);
    border-radius:var(--r-lg); box-shadow:var(--sh-1); padding:16px;
    max-height:calc(100vh - 220px); overflow-y:auto}

.ed-sec{padding-bottom:14px; margin-bottom:14px; border-bottom:1px solid var(--line-2)}
.ed-sec:last-child{padding-bottom:0; margin-bottom:0; border-bottom:0}
.ed-sec h4{font-size:11px; text-transform:uppercase; letter-spacing:.07em;
    color:var(--ink-4); margin-bottom:8px; display:flex; align-items:center; gap:6px}
.ed-sec select{width:100%}
.ed-sec p{margin-top:6px}

.ed-compte{margin-left:auto; background:var(--slate-50); border:1px solid var(--line);
    border-radius:999px; padding:1px 7px; font-size:10.5px; color:var(--ink-3)}

.ed-types{display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px}
.ed-type{display:flex; align-items:center; gap:6px; padding:7px 8px; cursor:pointer;
    background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm);
    font:inherit; font-size:11.5px; color:var(--ink-2); text-align:left}
.ed-type:hover{border-color:var(--brand); color:var(--brand)}
.ed-type.is-on{background:var(--brand-50); border-color:var(--brand); color:var(--brand-700)}

.ed-pin{width:11px; height:11px; border-radius:50%; flex:0 0 auto;
    background:var(--slate); border:2px solid #fff; box-shadow:0 0 0 1px var(--line)}
.ed-pin--chambre{background:#0ea5e9}
.ed-pin--joint{background:#8b5cf6}
.ed-pin--odf{background:#2563eb}
.ed-pin--pm{background:#059669}
.ed-pin--pbo{background:#65a30d}
.ed-pin--poteau{background:#b45309}
.ed-pin--olt{background:#be123c}

.ed-orphelins{display:flex; flex-direction:column; gap:5px; margin-top:8px}
.ed-orphelin{display:flex; flex-direction:column; gap:1px; padding:7px 9px; cursor:pointer;
    background:var(--amber-50); border:1px solid var(--line); border-radius:var(--r-sm);
    font:inherit; font-size:11.5px; color:var(--ink-2); text-align:left}
.ed-orphelin:hover{border-color:var(--accent)}
.ed-orphelin.is-on{border-color:var(--accent-600); box-shadow:0 0 0 2px var(--accent-100)}

.ed-legende{display:flex; flex-direction:column; gap:5px; font-size:11.5px; color:var(--ink-3)}
.ed-legende span{display:flex; align-items:center; gap:7px}
.ed-lg{width:10px; height:10px; border-radius:50%; border:2px solid #fff;
    box-shadow:0 0 0 1px var(--line)}
.ed-lg--ok{background:#1f9d55}
.ed-lg--warn{background:#d98324}
.ed-lg--ko{background:#c0392b}
.ed-lg--prop{background:#94a3b8; border-color:#6b7280}

.ed-carte{position:relative; border:1px solid var(--line); border-radius:var(--r-lg);
    overflow:hidden; box-shadow:var(--sh-1); min-height:640px}
.ed-map{position:absolute; inset:0}
.ed-map.is-pose{cursor:crosshair}

.ed-mode{position:absolute; left:50%; transform:translateX(-50%); bottom:16px; z-index:500;
    display:flex; align-items:center; gap:10px; padding:8px 12px;
    background:var(--verre); border:1px solid var(--brand); border-radius:999px;
    box-shadow:var(--sh-2); font-size:12px; color:var(--ink-2)}

/* ── Outils de l'éditeur ─────────────────────────────────────
   La barre flotte au-dessus de la carte plutôt que de la pousser vers
   le bas : la hauteur de travail est ce qui manque le plus quand on
   place des ouvrages, et la reprendre pour trois boutons se paierait à
   chaque geste.

   Elle commence à 56 px et non à 12 : le contrôle de zoom de Leaflet
   occupe le coin haut-gauche (34 px de large, 10 px de marge). La
   barre lui passait dessus, et le « + » ne se cliquait plus — un
   défaut invisible à la relecture du HTML, puisque les deux couches
   viennent de sources différentes. */
.ed-outils{position:absolute; top:12px; left:56px; z-index:500;
    max-width:calc(100% - 124px);
    display:flex; align-items:center; gap:8px; padding:6px 8px;
    background:var(--verre); border:1px solid var(--line);
    border-radius:999px; box-shadow:var(--sh-1); backdrop-filter:blur(6px)}
.ed-outils .btn.is-on{background:var(--brand); border-color:var(--brand); color:#fff}
.ed-coords{font-family:var(--mono, ui-monospace, monospace); font-size:11.5px;
    color:var(--ink-4); padding:0 6px; min-width:132px; text-align:right}

.ed-recherche{width:100%}
.ed-resultats{margin-top:8px; display:flex; flex-direction:column; gap:4px;
    max-height:230px; overflow-y:auto}
.ed-resultat{display:flex; flex-direction:column; gap:1px; padding:7px 9px; cursor:pointer;
    text-align:left; background:var(--surface-2); border:1px solid var(--line-2);
    border-radius:var(--r); font-size:12.5px; color:var(--ink)}
.ed-resultat:hover{border-color:var(--brand)}

/* L'étiquette de mesure suit le dernier point posé : elle doit rester
   lisible sur un fond aérien comme sur un plan clair. */
.ed-mesure-etiquette span{display:inline-block; white-space:nowrap; padding:2px 7px;
    background:#111827; color:#fff; border-radius:var(--r);
    font-size:11.5px; font-weight:700; box-shadow:var(--sh-1)}

.ed-marqueur span{display:block; width:100%; height:100%; border-radius:50%;
    border:2px solid #fff; box-shadow:0 1px 3px rgba(15,23,42,.35)}
.ed-marqueur.is-on span{box-shadow:0 0 0 3px var(--brand-100), 0 1px 3px rgba(15,23,42,.35)}
.ed-marqueur.is-neuf span{background:var(--brand); border-style:dashed; border-color:#fff}

.ed-titre{display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding-bottom:10px; margin-bottom:12px; border-bottom:1px solid var(--line-2)}
.ed-titre h3{font-size:15px}

.ed-lu{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:10px 0 12px;
    padding:10px; background:var(--surface-2); border-radius:var(--r-sm)}
.ed-lu>div{display:flex; flex-direction:column; gap:2px; min-width:0}
.ed-lu b{font-size:12px; overflow-wrap:anywhere}

.ed-actions{display:flex; gap:8px; margin-top:14px}
.ed-actions .btn{flex:1; justify-content:center}

.ed-vide{text-align:center; padding:40px 10px; color:var(--ink-4)}
.ed-vide svg{width:26px; height:26px; margin-bottom:8px}
.ed-vide h4{font-size:13px; color:var(--ink-3); margin-bottom:4px}

@media (max-width:1200px){
  .ed{grid-template-columns:220px minmax(0,1fr)}
  .ed-panneau{grid-column:1 / -1; max-height:none}
}
@media (max-width:860px){
  .ed{grid-template-columns:minmax(0,1fr)}
  .ed-palette{max-height:none}
  .ed-carte{min-height:420px}

  /* Les coordonnées affichent la position **sous le curseur**. Sur un
     écran tactile il n'y en a pas : elles resteraient à « — » en
     occupant 132 px, dont la barre a besoin pour ne pas passer sous le
     bouton de plein écran.

     Précaution raisonnée et non mesurée : Chrome n'ouvre pas de fenêtre
     sous ~500 px, et à 500 la barre tient encore avec ou sans elles.
     C'est en deçà que la place manque. */
  .ed-coords{display:none}
  .ed-outils{max-width:calc(100% - 124px)}
}

/* La mise en route du tableau de bord. Une ligne par étape : sa coche,
   ce qu'elle est et pourquoi, et le geste. La prochaine étape se
   distingue — une seule —, le reste attend sans crier. */
.mise-en-route__liste{list-style:none; margin:0; padding:0; display:grid; gap:10px}
.mise-en-route__etape{display:grid; grid-template-columns:28px minmax(0,1fr) auto;
  align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--line);
  border-radius:var(--r); background:var(--surface)}
.mise-en-route__etape--suivante{border-color:var(--brand);
  box-shadow:0 0 0 1px var(--brand) inset}
.mise-en-route__etape--fait{background:var(--surface-2)}
.mise-en-route__coche{width:28px; height:28px; border-radius:99px; display:grid;
  place-items:center; font-size:12px; font-weight:700; color:var(--ink-2);
  background:var(--surface-2); border:1px solid var(--line);
  font-variant-numeric:tabular-nums}
.mise-en-route__etape--fait .mise-en-route__coche{background:var(--green-50);
  border-color:var(--green); color:var(--green)}
.mise-en-route__coche svg{width:14px; height:14px}
.mise-en-route__action{display:flex; align-items:center; gap:8px; white-space:nowrap}
@media (max-width:560px){
  .mise-en-route__etape{grid-template-columns:28px minmax(0,1fr)}
  .mise-en-route__action{grid-column:2}
}

/* Le guide pas à pas. Les étapes reprennent celles de la mise en route ;
   ici, seulement ce qui s'y ajoute : les familles de tâches, la carte
   d'une tâche — un lien entier, qu'on atteint d'un clic —, le choix de
   l'objet suivi (un client, un site) et l'exemple sous une étape. */
.guide-famille{margin:24px 0 12px; font-size:12px; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase; color:var(--ink-2)}
.guide-famille:first-of-type{margin-top:4px}
.guide-carte{display:block; color:inherit; text-decoration:none;
  transition:border-color .15s, box-shadow .15s}
.guide-carte:hover,.guide-carte:focus-visible{border-color:var(--brand);
  box-shadow:0 0 0 1px var(--brand) inset}
.guide-carte h3{margin:0 0 6px}
.guide-choix{display:flex; flex-wrap:wrap; gap:10px}
.guide-choix .btn{display:flex; flex-direction:column; align-items:flex-start;
  gap:2px; height:auto; padding:10px 14px; text-align:left; white-space:normal}
.guide-autre label{display:block; margin-bottom:6px; font-weight:600}
.guide-autre__champ{display:flex; gap:8px; max-width:420px}
.guide-autre__champ input{flex:1; min-width:0}
.guide-exemple{font-style:italic}

/* Une carte de métier sur le sommaire du manuel : un lien qu'on
   lit avant de le suivre — nom, ce qu'on y fait, combien de tâches. */
.manuel-metier{display:block; padding:16px 18px; border:1px solid var(--line);
  border-radius:var(--r); background:var(--surface); color:var(--ink);
  text-decoration:none; transition:border-color .15s, box-shadow .15s}
.manuel-metier:hover{border-color:var(--ink-4); box-shadow:var(--sh-2);
  text-decoration:none}
.manuel-metier:focus-visible{outline:2px solid var(--brand); outline-offset:2px}

/* Le parcours d'un métier : une tâche numérotée, et son écran.
   Le numéro porte l'ordre — c'est la seule information que la mise
   en page ajoute, et elle est vraie : ces tâches se font dans cet
   ordre la première fois. */
.etape__t{display:flex; align-items:flex-start; gap:12px}
.etape__t h4{margin:0; font-size:15px; font-weight:650; color:var(--ink)}
.etape__n{flex:none; width:26px; height:26px; border-radius:99px;
  background:var(--surface-2); border:1px solid var(--line);
  display:grid; place-items:center; font-size:12px; font-weight:700;
  color:var(--ink-2); font-variant-numeric:tabular-nums}
.etape + .etape{border-top:1px solid var(--line); padding-top:20px}

@media print{
  .topbar,.sidebar,.drawer,.scrim,.toasts,.notifpanel,.pagehead__a,
  .manuel-metiers,.tbl-replis,table.tbl th.vr,table.tbl td.vr{display:none !important}
  table.tbl th.col-repliee,table.tbl td.col-repliee{display:table-cell !important}
  .main{padding:0}
  .card{break-inside:avoid; box-shadow:none}
  body{background:#fff}
}


/* Le bloc de configuration revele au choix d'un adaptateur.
   Masque par l'attribut `hidden`, pas par une classe : l'attribut est
   ce que le script bascule, et deux mecanismes de masquage finissent
   par se contredire. */
.bloc-env[hidden]{display:none}
.bloc-env pre{margin:8px 0 0}

/* ═══════════════ MANUEL D’UTILISATION ═══════════════
   Une notice se lit d’un bout à l’autre, contrairement au reste de la
   plateforme qui se scanne. Le texte est donc plus large d’interligne
   et borné en largeur : au-delà d’une soixantaine de caractères, l’œil
   perd la ligne suivante. */
.manuel{max-width:74ch}
.manuel__resume{font-size:13.5px; color:var(--ink-2); line-height:1.6; margin-bottom:14px}
.manuel__t{font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--ink-3); margin:18px 0 8px}
.manuel__t:first-child{margin-top:0}
.manuel__p{font-size:13px; line-height:1.7; color:var(--ink-2)}
.manuel__geste{border-left:2px solid var(--line-2); padding:2px 0 2px 12px; margin-bottom:12px}
.manuel__geste b{font-size:12.5px}
.manuel__bloc{border-left:2px solid var(--amber); padding:2px 0 2px 12px; margin-bottom:12px}
.manuel__bloc b{font-size:12.5px}
.manuel__comment{font-size:12.5px; line-height:1.65; color:var(--ink-2); margin-top:3px}
.manuel__effet{font-size:12px; line-height:1.6; color:var(--ink-3); margin-top:5px}
.manuel__liste{margin:0; padding-left:20px; font-size:12.5px; line-height:1.8; color:var(--ink-2)}
.manuel__groupe{font-size:15px; font-weight:700; margin:26px 0 12px; color:var(--ink)}

/* L’écran d’où l’on vient, quand on ouvre le manuel depuis une notice :
   sans repère, on atterrit au milieu de quarante cartes identiques. */
.is-vise{box-shadow:0 0 0 2px var(--brand-100)}

/* ── Plein écran d'une carte ─────────────────────────────────
   Une carte de 640 px suffit à poser un ouvrage ; elle ne suffit pas à
   suivre 92 km de fibre d'un bout à l'autre, ni à lire trois équipes
   dispersées sur un pays. Plutôt qu'un second écran « grande carte »,
   le conteneur se détache et couvre la fenêtre : même DOM, même
   instance Leaflet, donc mêmes marqueurs, même fond et même mesure en
   cours au retour.

   L'API native est demandée en plus, quand le navigateur l'accorde ;
   cette classe seule suffit au rendu. Les deux chemins donnent la même
   image, ce qui évite d'avoir à savoir lequel a servi.

   `min-height:0` est indispensable : `.ed-carte` en impose 640, et sur
   un écran plus court la carte dépasserait la fenêtre qu'elle est
   censée remplir. */
[data-plein-cible].is-plein{position:fixed; inset:0; z-index:9000; margin:0;
    width:auto; height:auto; max-width:none; max-height:none;
    min-height:0; min-width:0;
    border:0; border-radius:0; box-shadow:none; background:var(--surface)}
body.is-plein-actif{overflow:hidden}

/* La zone des messages est déplacée dans l'élément en plein écran par
   la coque — le plein écran natif ne peint que ce sous-arbre. Elle y
   entre avec son z-index de 200, sous les contrôles de Leaflet qui
   montent à 1000 dans le même contexte d'empilement. */
[data-plein-cible].is-plein > .toasts{z-index:9100}

/* Le bouton se pose sur la carte, jamais dans l'entête de la carte :
   en plein écran l'entête a disparu, et un bouton qu'on ne peut plus
   atteindre pour ressortir est pire que pas de bouton du tout. */
.carte-plein{position:absolute; top:12px; right:12px; z-index:500;
    background:var(--verre); backdrop-filter:blur(6px);
    box-shadow:var(--sh-1)}
.carte-plein [data-plein-sortie]{display:none}
[data-plein-cible].is-plein .carte-plein [data-plein-entree]{display:none}
[data-plein-cible].is-plein .carte-plein [data-plein-sortie]{display:inline-flex}
.carte-plein span{display:inline-flex; align-items:center; gap:6px}

/* Quand la carte porte un sélecteur de fonds, il occupe déjà le coin
   haut-droit : le bouton se pose dessous plutôt que dessus. C'est le
   défaut qu'on vient de corriger sur la barre de l'éditeur — deux
   couches venues de sources différentes, dont aucune ne sait ce que
   l'autre occupe.

   68 px et non 56 : le sélecteur mesure 48 px, posé à 11 du haut, donc
   il descend jusqu'à 59. La première valeur laissait deux pixels de
   recouvrement — invisible à l'œil, mais deux pixels du bouton qui ne
   répondent pas au clic. C'est le navigateur qui l'a mesuré. */
.carte-plein--sous-couches{top:68px}

/* Le cadre d'une carte simple — celle des équipes en direct. Sa hauteur
   passe par une variable plutôt que par un `style="height:…"` en dur :
   le plein écran doit pouvoir la remplacer, et un style en ligne aurait
   obligé à un `!important` pour reprendre la main dessus. */
.carte-cadre{position:relative}
.carte-cadre .carte-map{height:var(--carte-h, 420px); width:100%}
.carte-cadre.is-plein .carte-map{height:100%}

/* ── Tableau de flux (kanban) ────────────────────────────────
   Une liste triée par criticité dit ce qui est le plus grave ; elle ne
   dit pas où ça bloque. La réponse est une forme — la colonne qui
   grossit —, et une forme se voit au lieu de se calculer.

   Le tableau défile **de côté, dans son propre cadre** : le cycle d'un
   incident compte dix états, et les tasser pour les faire tenir dans la
   largeur donnerait dix colonnes illisibles. C'est le seul endroit de
   la plateforme où l'on défile horizontalement, et c'est assumé — mais
   jamais la page entière, seulement ce bloc. */
.kb{display:flex; gap:12px; overflow-x:auto; padding-bottom:10px;
    align-items:flex-start; scroll-snap-type:x proximity}
.kb__col{flex:0 0 246px; scroll-snap-align:start; background:var(--surface-2);
    border:1px solid var(--line); border-radius:var(--r-lg); padding:10px}
.kb__col.is-cible{border-color:var(--brand); background:var(--brand-50)}
.kb__col.is-refus{border-color:var(--red); background:var(--red-50)}

.kb__tete{display:flex; align-items:center; justify-content:space-between; gap:8px}
.kb__tete h4{font-size:12.5px; font-weight:700; letter-spacing:.01em; margin:0}
.kb__n{font-size:11px; font-weight:700; color:var(--ink-3);
    background:var(--surface); border:1px solid var(--line);
    border-radius:99px; padding:1px 7px}
.kb__aide{margin:4px 0 0; font-size:11px; color:var(--ink-4); line-height:1.45}

.kb__pile{display:flex; flex-direction:column; gap:8px; margin-top:9px;
    min-height:56px}
.kb__rien{margin:0; padding:10px 0; text-align:center; color:var(--ink-4);
    font-size:12px}

.kb__carte{background:var(--surface); border:1px solid var(--line);
    border-radius:var(--r); padding:9px 10px; box-shadow:var(--sh-1)}
.kb__carte[draggable="true"]{cursor:grab}
.kb__carte.is-prise{opacity:.55}
/* Une carte qu'on ne peut pas déplacer ne doit pas ressembler à une
   carte qu'on peut déplacer : sans ce trait, on essaie, rien ne bouge,
   et l'on croit l'écran cassé. */
.kb__carte[draggable="false"]{border-left:3px solid var(--line-2)}

.kb__titre{display:block; font-size:12.5px; font-weight:650; color:var(--ink);
    text-decoration:none; overflow-wrap:anywhere}
a.kb__titre:hover{color:var(--brand); text-decoration:underline}
.kb__sous{margin:3px 0 0; font-size:11.5px; color:var(--ink-3); line-height:1.45}
.kb__eti{display:flex; flex-wrap:wrap; gap:5px; margin-top:7px}

.kb-bascule{display:inline-flex; gap:6px}

@media (max-width:860px){
  .kb__col{flex-basis:82%}
}
