/* Hoshu — charte Swiiptel (bleu #5A97B0, ardoise #4A626F, marine #1E2F38).
   Clair / sombre selon le système, utilisable dès 320 px, imprimable. */
:root {
  --fond: #f4f7f9; --surface: #ffffff; --surface-2: #eef3f6; --texte: #1f2a30; --discret: #5b6770;
  --bord: #cbd9df; --accent: #356f87; --accent-fort: #1e2f38; --accent-clair: #e6f0f4; --sur-accent: #fff;
  --rouge: #b42318; --rouge-fond: #fdecea; --orange: #8a5a00; --orange-fond: #fbf1d9;
  --vert: #1d6b45; --vert-fond: #e3f4ea; --bleu-fond: #e6f0f4; --focus: #f2a900;
  --rayon: 10px; --ombre: 0 1px 2px rgba(16, 27, 34, .06), 0 2px 8px rgba(16, 27, 34, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11181d; --surface: #182229; --surface-2: #1f2b33; --texte: #e3eaee; --discret: #9fb0ba;
    --bord: #2f3f49; --accent: #7fb8cf; --accent-fort: #0c1419; --accent-clair: #1f3540; --sur-accent: #0c1419;
    --rouge: #ff8a80; --rouge-fond: #3a1d1b; --orange: #f3c26b; --orange-fond: #3a2e14;
    --vert: #7fd6a4; --vert-fond: #173226; --bleu-fond: #1f3540;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Noto Sans", Roboto, sans-serif;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
h1 { font-size: 1.6rem; margin: .2em 0 .6em; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.4em 0 .5em; color: var(--texte); }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 8px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* --- bandeau : marque, client courant et compte en haut ; rubriques du client dessous (lot 3 de l'audit UX) */
.bandeau { padding: 0 16px; background: #1e2f38; color: #e6f0f4; position: sticky; top: 0; z-index: 5; }
.bandeau a { color: #e6f0f4; text-decoration: none; }
.bandeau a:hover, .bandeau a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.bandeau-haut { display: flex; align-items: center; flex-wrap: wrap; gap: 0 16px; min-height: 52px; }
.marque { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; }
.marque small { font-weight: 400; opacity: .7; }
.marque.grande { font-size: 1.6rem; justify-content: center; color: var(--texte); }
.client-courant { font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #3b5663; overflow-wrap: anywhere; }
.nav-globale { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; margin-left: auto; font-size: .92rem; }
.nav-client { display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; border-top: 1px solid #2f4450; margin: 0 -8px; }
/* Cibles de 44 px de haut (WCAG 2.5.8, 44 px au toucher). */
.bandeau nav a, .bandeau nav .lien { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.nav-client a[aria-current="page"] { text-decoration: none; box-shadow: inset 0 -3px 0 #7fb8cf; font-weight: 600; }
.utilisateur { opacity: .85; overflow-wrap: anywhere; }
.burger { display: none; margin-left: auto; min-width: 44px; min-height: 44px; background: none; border: 1px solid #5a97b0; color: #fff; border-radius: 8px; font-size: 1.2rem; padding: 2px 10px; }
.bandeau .lien { color: #e6f0f4; }
@media (max-width: 760px) {
  .burger { display: block; }
  .nav-globale, .nav-client { display: none; flex-direction: column; align-items: stretch; width: 100%; margin: 0; }
  .nav-globale.ouvert, .nav-client.ouvert { display: flex; }
  /* Rubriques du client d'abord, compte ensuite : la rangée du haut se fond dans le bandeau pour l'ordre. */
  .bandeau { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; min-height: 52px; }
  .bandeau-haut { display: contents; }
  .nav-client { order: 2; border-top: 1px solid #2f4450; }
  .nav-globale { order: 3; border-top: 1px solid #2f4450; padding-bottom: 6px; }
  .nav-client a[aria-current="page"] { box-shadow: inset 3px 0 0 #7fb8cf; }
}

.sous-titre { margin: -10px 0 12px; }

/* --- fil d'Ariane */
.fil-ariane ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0 0 8px; padding: 0; font-size: .92rem; }
.fil-ariane li + li::before { content: "›"; margin-right: 6px; color: var(--discret); }
.fil-ariane a { display: inline-flex; align-items: center; min-height: 24px; }
.fil-ariane [aria-current] { color: var(--discret); overflow-wrap: anywhere; }

/* --- page */
.page { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.titre-page { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.discret { color: var(--discret); }
.pre { white-space: pre-wrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: .9em; overflow-wrap: anywhere; }
.alerte { background: var(--rouge-fond); color: var(--rouge); border-left: 4px solid var(--rouge); padding: 8px 12px; border-radius: 6px; }
.note { background: var(--orange-fond); padding: 8px 12px; border-radius: 6px; }
.signature { background: var(--vert-fond); color: var(--vert); padding: 10px 12px; border-radius: 6px; }

/* --- boutons */
.bouton {
  display: inline-block; padding: 10px 16px; min-height: 44px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--sur-accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bouton:hover { filter: brightness(1.08); }
.bouton.secondaire { background: transparent; color: var(--accent); }
.bouton.large { width: 100%; }
.bouton:disabled { opacity: .55; cursor: not-allowed; }
.lien { background: none; border: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.lien.danger { color: var(--rouge); }
/* Cibles (lot 4 de l'audit UX, WCAG 2.5.8) : bouton-lien de 24 px au moins, 44 px au toucher ; cases de 24 px. */
button.lien { min-height: 24px; }
@media (pointer: coarse) { button.lien { min-height: 44px; } }
input[type=checkbox], input[type=radio] { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--accent); }
.actions-ligne { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }

/* --- tuiles du tableau de bord */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tuile {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--rayon); background: var(--surface);
  box-shadow: var(--ombre); border: 1px solid var(--bord); text-decoration: none; color: var(--texte);
}
.tuile .valeur { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.tuile .libelle { color: var(--discret); font-size: .92rem; }
.tuile.alerte-tuile { border-color: var(--orange); background: var(--orange-fond); }
.tuile.alerte-tuile .valeur { color: var(--orange); }

/* --- cartes */
.grille-cartes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); }
.carte h2 { margin-top: 0; }
/* Fiche équipement : supervision et veille côte à côte. */
.fiche-blocs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 16px 0; }
.fiche-blocs .panneau { margin: 0; }
.fiche-blocs h2 { margin-top: 0; font-size: 1.1rem; }
/* Accueil : compteurs d'un client. */
.pastilles { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.panneau { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 16px; margin: 16px 0; }
.panneau summary { cursor: pointer; font-weight: 600; min-height: 32px; }

/* --- tableaux */
.tableau-defilant { position: relative; overflow-x: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: var(--accent-clair); }
td.nombre, .compact td.nombre { text-align: right; font-variant-numeric: tabular-nums; }
table.compact th, table.compact td { padding: 5px 8px; }
caption { text-align: left; font-weight: 600; padding: 6px 0; }

/* Sous 600 px, tableaux marqués « cartes » : une carte par ligne, intitulé de colonne (data-label)
   devant chaque valeur ; la cellule « titre-carte » sert de titre. */
@media (max-width: 600px) {
  .tableau-defilant:has(> table.cartes) { border: 0; background: none; overflow: visible; }
  table.cartes, table.cartes tbody, table.cartes tr, table.cartes td { display: block; width: auto; }
  table.cartes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cartes caption { display: block; }
  table.cartes tr { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px 12px; margin: 0 0 10px; }
  table.cartes tbody tr:hover { background: var(--surface); }
  table.cartes td { border: 0; padding: 3px 0; text-align: left; }
  table.cartes td.nombre { text-align: left; }
  table.cartes td[data-label] { display: grid; grid-template-columns: minmax(7.5em, 38%) minmax(0, 1fr); gap: 8px; align-items: baseline; }
  table.cartes td[data-label]::before { content: attr(data-label); color: var(--discret); font-size: .88rem; }
  table.cartes td.titre-carte { font-weight: 600; font-size: 1rem; padding-bottom: 6px; overflow-wrap: anywhere; }
  table.cartes td.actions-carte { padding-top: 8px; }
  table.cartes td a { display: inline-block; min-height: 24px; padding-block: 2px; }
  table.cartes td input:not([type="checkbox"]) { width: 100%; max-width: none; }
}
.seul-carte { display: none; }
@media (max-width: 600px) { .seul-carte { display: inline; } }

/* --- badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.badge.rouge { background: var(--rouge-fond); color: var(--rouge); }
.badge.orange { background: var(--orange-fond); color: var(--orange); }
.badge.vert { background: var(--vert-fond); color: var(--vert); }
.badge.bleu { background: var(--bleu-fond); color: var(--accent); }
.badge.gris { background: var(--surface-2); color: var(--discret); }

/* --- formulaires */
.formulaire { display: flex; flex-direction: column; gap: 6px; max-width: 720px; }
.formulaire label { font-weight: 600; margin-top: 8px; }
input, select, textarea {
  font: inherit; color: var(--texte); background: var(--surface); border: 1px solid var(--bord); border-radius: 8px;
  padding: 9px 10px; min-height: 44px; max-width: 100%;
}
textarea { resize: vertical; }
.formulaire .bouton { align-self: flex-start; margin-top: 12px; }
.formulaire .actions.etapes { flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; }
.formulaire .actions.etapes .bouton { margin-top: 0; }
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.filtres label { font-weight: 600; }
.aide-filtres { margin: -6px 0 12px; }
/* Tri des colonnes : bouton d'en-tête, sens affiché ; sur téléphone, un choix « Trier par ». */
th[aria-sort], thead th:has(> button.tri) { padding: 0; }
button.tri { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; padding: 8px 10px; cursor: pointer; font-weight: 600; white-space: nowrap; }
table.compact button.tri { padding: 5px 8px; }
button.tri:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
button.tri:hover { color: var(--accent); }
button.tri .sens { color: var(--discret); font-size: .8em; }
th[aria-sort] button.tri .sens { color: var(--accent); }
.choix-tri { display: none; }
@media (max-width: 600px) { .choix-tri { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; } .choix-tri label { font-weight: 600; } }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.trois-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.deux-colonnes label, .deux-colonnes select, .deux-colonnes input { display: block; width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.case { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 400 !important; cursor: pointer; }
.case input { min-height: auto; }
legend { font-weight: 600; padding: 0 4px; }
.actions a { display: inline-flex; align-items: center; min-height: 44px; }
.choix-equipements { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; margin-top: 10px; }
.choix-equipements input[type=search] { width: 100%; }
.groupe-champs { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; margin: 10px 0 0; min-width: 0; }
.cases { list-style: none; padding: 0; margin: 8px 0 0; max-height: 260px; overflow-y: auto; }
.cases label { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 2px 0; font-weight: 400; margin: 0; overflow-wrap: anywhere; cursor: pointer; }
.cases input { min-height: auto; }

/* --- fiches */
.fiche { display: grid; grid-template-columns: minmax(140px, 260px) 1fr; gap: 6px 16px; }
.fiche dt { color: var(--discret); }
.fiche dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .fiche { grid-template-columns: 1fr; } .fiche dd { margin-bottom: 6px; } }
.liste { padding-left: 1.2em; }

/* --- connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.carte-connexion { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 28px 24px; box-shadow: var(--ombre); text-align: center; }
.carte-connexion h1 { font-size: 1.2rem; }
.carte-connexion .formulaire { text-align: left; }
.carte-connexion .formulaire .bouton { align-self: stretch; }
.fournisseurs { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.separateur { color: var(--discret); margin: 16px 0 0; }

/* --- rapport */
.rapport { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 20px; }
.indicateurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.indicateur { border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.indicateur .valeur { font-size: 1.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.indicateur .libelle { color: var(--discret); font-size: .88rem; }

@media print {
  .bandeau, .non-imprime, .evitement { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page { padding: 0; max-width: none; }
  .rapport { border: none; padding: 0; }
  h3 { break-after: avoid; }
  table, .indicateurs { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* --- double authentification */
.qr { display: block; margin: 12px auto; background: #fff; padding: 8px; border-radius: 8px; }
.codes-secours { columns: 2; list-style: none; padding: 12px; background: var(--surface-2); border-radius: 8px; text-align: left; }
.codes-secours li { padding: 2px 0; }

/* --- fil d'échanges et pièces jointes (lot 3) */
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fil { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.fil .message { background: var(--surface); border: 1px solid var(--bord); border-left: 4px solid var(--bord); border-radius: 8px; padding: 8px 12px; }
.fil .message.prestataire { border-left-color: var(--accent); }
.fil .message.client { border-left-color: var(--vert); }
.fil .message.interne { border-left-color: var(--orange); background: var(--orange-fond); }
.fil .entete { margin: 0 0 4px; font-size: .92rem; color: var(--discret); }
.fil .entete strong { color: var(--texte); }
.fil .message .pre { margin: 0; }
.formulaire-echange { display: flex; flex-direction: column; gap: 8px; }
.formulaire-echange textarea { width: 100%; box-sizing: border-box; }
.formulaire-echange .pieces { display: flex; flex-direction: column; gap: 6px; }
.formulaire-echange .pieces input[type=file] { max-width: 100%; }
.formulaire-echange .pieces select { max-width: 100%; }
.formulaire-echange .photo { align-self: flex-start; }
.formulaire-echange > .bouton { align-self: flex-start; }
.bouton.petit { padding: 4px 10px; min-height: 32px; font-size: .9rem; }
td.actions { white-space: nowrap; }
td.actions .lien { margin-left: 8px; }

/* --- contrat : onglets, registre de conformité (lot 8) */
.onglets { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--bord); margin: 12px 0 16px; }
.onglet { background: none; border: 1px solid transparent; border-bottom: none; border-radius: var(--rayon) var(--rayon) 0 0;
          padding: 8px 14px; font: inherit; color: var(--accent); cursor: pointer; margin-bottom: -1px; }
.onglet[aria-selected=true] { background: var(--surface); border-color: var(--bord); color: inherit; font-weight: 600; }
.registre { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ligne-registre { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px 14px; min-width: 0; }
.entete-registre { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.entete-registre h3 { margin: 0; }
.reference { font-weight: 600; color: var(--discret); }
.exigence { margin: 6px 0; font-weight: 600; }
.constat, .justification { margin: 6px 0; overflow-wrap: anywhere; }
.justification { border-left: 3px solid var(--orange); padding-left: 10px; }
.justification p { margin: 4px 0; }
.actions-registre { margin: 6px 0 0; }
.historique { font-size: .9rem; padding-left: 18px; }
.alerte-note { border-left: 3px solid var(--orange); }
.decisions { padding-left: 18px; }
.decisions .formulaire.en-ligne { max-width: none; }
.validation-doc { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.indicateur.alerte-tuile { border-color: var(--rouge); background: var(--rouge-fond); }
.fichiers-doc { white-space: nowrap; }
.depot-doc { position: relative; cursor: pointer; font-weight: 400; }
.gabarits { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gabarits .bouton { min-width: 14em; }

/* Veille sécurité (lot 9) : champs de version dans le tableau. */
input.court { width: 9.5em; min-width: 0; padding: 4px 6px; }
.entete-registre .badges { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.lien-cst { display: inline-block; min-height: 24px; padding-block: 2px; white-space: nowrap; font-size: .88rem; }
td input.court { width: 7.5em; }
td input.court.large { width: 13em; }

/* --- supervision : synthèse, alertes groupées par équipement (lot 2 de l'audit UX) */
.synthese p { margin: 0 0 6px; }
.synthese .historique { margin: 0; }
.groupe-alertes summary { cursor: pointer; min-height: 44px; padding: 6px 0; display: list-item; }
.groupe-alertes summary .badges { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; vertical-align: middle; }
.alertes-groupe { margin: 8px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.groupe-alertes .actions-registre { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- sondes (tableau de bord) */
.sondes { margin-top: 28px; }
.titre-section { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.titre-section h2 { margin-right: auto; }
.grille-sondes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.sonde { border-left-width: 5px; }
.sonde.sonde-vert { border-left-color: var(--vert); }
.sonde.sonde-orange { border-left-color: var(--orange); }
.sonde.sonde-rouge { border-left-color: var(--rouge); }
.sonde-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sonde-tete .badge { margin-left: auto; }
.sonde-collecteur { margin: 4px 0 8px; font-size: .9rem; overflow-wrap: anywhere; }
.voyant { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--discret); }
.voyant.vert { background: var(--vert); box-shadow: 0 0 0 3px var(--vert-fond); }
.voyant.orange { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-fond); }
.voyant.rouge { background: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-fond); }
@media (prefers-reduced-motion: no-preference) {
  .sonde-vert .voyant.vert { animation: pouls 2.4s ease-in-out infinite; }
  @keyframes pouls { 50% { box-shadow: 0 0 0 6px var(--vert-fond); } }
}
.sonde-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; }
.sonde-chiffres dt { color: var(--discret); font-size: .82rem; }
.sonde-chiffres dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sonde-chiffres dd.rouge { color: var(--rouge); }
.sonde-chiffres dd.orange { color: var(--orange); }
.sonde-historique { list-style: none; padding: 0; margin: 12px 0 0; display: flex; align-items: flex-end; gap: 3px; }
.sonde-historique li { flex: 1; max-width: 22px; height: 10px; border-radius: 3px; }
.sonde-historique li.vert { background: var(--vert); opacity: .75; }
.sonde-historique li.orange { background: var(--orange); height: 16px; }
/* Légende de l'historique : la hauteur double la couleur (jamais l'information par la seule couleur). */
.sonde-legende { margin: 6px 0 0; font-size: .82rem; }
.sonde-legende .echantillon { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.sonde-legende .echantillon.vert { background: var(--vert); opacity: .75; }
.sonde-legende .echantillon.orange { background: var(--orange); height: 16px; }
.injoignables li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }

/* --- documentation */
.documentation { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.doc-sommaire { position: sticky; top: 72px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 16px; }
.doc-sommaire h2 { margin: 0 0 8px; font-size: 1rem; }
.doc-sommaire ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-sommaire a[aria-current="page"] { font-weight: 700; color: var(--texte); }
.doc-contenu { min-width: 0; max-width: 860px; }
.doc-contenu table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: .94rem; display: block; overflow-x: auto; }
.doc-contenu th, .doc-contenu td { border: 1px solid var(--bord); padding: 6px 10px; text-align: left; vertical-align: top; }
.doc-contenu th { background: var(--surface-2); }
.doc-contenu pre { background: var(--accent-fort); color: #e3eaee; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .88rem; line-height: 1.45; }
.doc-contenu code { font-size: .92em; overflow-wrap: anywhere; }
.doc-contenu pre code { overflow-wrap: normal; }
.doc-contenu :not(pre) > code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.bloc-code { position: relative; }
.bloc-code .copier { position: absolute; top: 6px; right: 8px; min-height: 32px; padding: 4px 10px; border-radius: 6px; background: var(--surface); color: var(--texte); text-decoration: none; font-size: .85rem; }
.bloc-code pre { padding-right: 84px; }
.sur-cette-page { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin: 8px 0 20px; }
.sur-cette-page h2 { font-size: 1rem; margin: 0 0 6px; }
.sur-cette-page ul { margin: 0; padding-left: 18px; columns: 2 240px; column-gap: 24px; }
.sur-cette-page li { margin: 2px 0; break-inside: avoid; }
.sur-cette-page a { display: inline-block; min-height: 24px; padding: 2px 0; }
.doc-contenu h2[id] { scroll-margin-top: 80px; }
@media (max-width: 760px) {
  .documentation { grid-template-columns: minmax(0, 1fr); }
  .doc-sommaire { position: static; }
}

/* --- schéma d'architecture (SVG de doc/architecture.md) */
.schema { margin: 16px 0 24px; overflow-x: auto; }
.schema svg { display: block; width: 100%; height: auto; }
.schema figcaption { color: var(--discret); font-size: .88rem; margin-top: 6px; }
.schema .zone { fill: var(--surface-2); stroke: var(--bord); stroke-width: 1.5; }
.schema .zone-swiiptel { fill: var(--accent-clair); }
.schema .boite { fill: var(--surface); stroke: var(--bord); stroke-width: 1.5; }
.schema .boite-forte { stroke: var(--accent); stroke-width: 2.5; }
.schema .boite-discrete { fill: var(--surface-2); stroke-dasharray: 5 4; }
.schema .txt-zone { fill: var(--accent); font-weight: 700; font-size: 18px; }
.schema .txt { fill: var(--texte); font-weight: 600; font-size: 16px; }
.schema .txt-petit { fill: var(--discret); font-size: 13px; }
.schema .fleche { stroke: var(--discret); stroke-width: 2; }
.schema .fleche-forte { stroke: var(--accent); stroke-width: 3; }
.schema .pointe { fill: var(--discret); }
.schema .lien-pointille { stroke: var(--discret); stroke-width: 1.5; stroke-dasharray: 4 4; }
.schema .parefeu { stroke: var(--rouge); stroke-width: 3; stroke-dasharray: 10 6; }

/* --- installation du collecteur */
.installation h2 { margin-top: 4px; }
pre.commande { background: var(--accent-fort); color: #e3eaee; padding: 12px 14px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; }

/* --- nouvelle version disponible (sw-register.js) */
.nouvelle-version {
  position: fixed; left: 16px; right: 16px; bottom: 16px; margin-inline: auto; width: fit-content; max-width: 640px; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  background: var(--accent-fort); color: #e6f0f4; border-radius: var(--rayon); padding: 10px 16px; box-shadow: var(--ombre);
}
.nouvelle-version .lien { color: #e6f0f4; }
@media print { .nouvelle-version { display: none; } }

/* Planning (planning.rs) : calendrier du mois, agenda sur téléphone, Gantt. */
.barre-planning { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 8px 0 6px; }
.bascule { display: inline-flex; border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.bascule button { border: 0; background: var(--surface); color: var(--texte); padding: 8px 14px; min-height: 40px; cursor: pointer; font: inherit; }
.bascule button + button { border-left: 1px solid var(--bord); }
.bascule button[aria-pressed=true] { background: var(--accent); color: var(--sur-accent); font-weight: 600; }
.navigation-periode { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.navigation-periode strong { margin-left: 6px; }
.en-ligne { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.legende-planning { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ev { display: block; border-radius: 4px; padding: 1px 5px; font-size: .8rem; line-height: 1.35; text-decoration: none;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--accent);
      background: var(--accent-clair); color: var(--texte); }
.legende-planning .ev { display: inline-block; }
.ev-demandee { border-left-color: var(--accent); background: var(--bleu-fond); }
.ev-encours { border-left-color: var(--orange); background: var(--orange-fond); }
.ev-faite { border-left-color: var(--vert); background: var(--vert-fond); }
.ev-annulee { border-left-color: var(--discret); background: var(--surface-2); color: var(--discret); text-decoration: line-through; }
.ev-prevue { border: 1px dashed var(--discret); border-left-width: 3px; background: transparent; color: var(--discret); }
a.ev:hover, a.ev:focus-visible { filter: brightness(.95); text-decoration: underline; }
.calendrier { border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; background: var(--surface); }
.entete-semaine, .grille-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.entete-semaine div { padding: 6px 8px; font-weight: 600; font-size: .85rem; background: var(--surface-2); border-bottom: 1px solid var(--bord); }
.grille-mois .jour { min-height: 6.5rem; padding: 4px 5px; border-right: 1px solid var(--bord); border-bottom: 1px solid var(--bord); min-width: 0; }
.grille-mois .jour:nth-child(7n) { border-right: 0; }
.grille-mois .jour ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; }
.grille-mois .numero { font-size: .8rem; color: var(--discret); }
.grille-mois .week-end { background: var(--surface-2); }
.grille-mois .hors-mois .numero { opacity: .55; }
.grille-mois .aujourdhui .numero { background: var(--accent); color: var(--sur-accent); border-radius: 999px; padding: 0 6px; font-weight: 700; }
.agenda, .agenda-vide { display: none; }
.agenda { list-style: none; padding: 0; margin: 0; }
.agenda > li { border-bottom: 1px solid var(--bord); padding: 8px 0; }
.agenda h3 { margin: 0 0 6px; font-size: .95rem; }
.agenda li.aujourdhui h3 { color: var(--accent); }
.agenda ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.agenda .ev { white-space: normal; font-size: .95rem; padding: 6px 8px; display: inline-block; }
@media (max-width: 760px) {
  .calendrier { display: none; }
  .agenda, .agenda-vide { display: block; }
}
.gantt-cadre { padding: 0; }
.gantt { min-width: calc(14rem + 28 * 1.9rem); font-size: .8rem; }
.g-ligne { display: grid; grid-auto-rows: minmax(1.9rem, auto); border-bottom: 1px solid var(--bord); position: relative; }
.g-entete { position: sticky; top: 0; background: var(--surface-2); z-index: 2; }
.g-libelle { grid-column: 1; padding: 6px 8px; font-weight: 600; position: sticky; left: 0; background: var(--surface); z-index: 1;
             border-right: 1px solid var(--bord); overflow-wrap: anywhere; }
.g-entete .g-libelle { background: var(--surface-2); }
.g-jour { display: flex; flex-direction: column; align-items: center; padding: 3px 0; border-left: 1px solid var(--bord); line-height: 1.1; }
.g-jour span { color: var(--discret); font-size: .7rem; }
.g-jour.week-end, .g-fond.week-end { background: var(--surface-2); }
.g-jour.aujourdhui strong { background: var(--accent); color: var(--sur-accent); border-radius: 999px; padding: 0 5px; }
.g-fond { border-left: 1px solid var(--bord); }
.g-fond.aujourdhui { box-shadow: inset 2px 0 0 var(--accent); }
.g-barre { z-index: 1; margin: 3px 1px; align-self: center; min-width: 0; padding: 1px 2px; text-overflow: clip; text-align: center; }
.pleine-largeur { width: 100%; }
td .ev { display: inline-block; }

/* Pied de page : contact de Swiiptel, version, retours (v0.27.0). */
.pied { max-width: 1200px; margin: 0 auto; padding: 16px 16px 32px; border-top: 1px solid var(--bord); color: var(--discret); font-size: .9rem; }
.pied p { margin: 4px 0; }
.pied .version { font-variant-numeric: tabular-nums; }
.pied-connexion { border-top: none; text-align: center; }
.contact a { overflow-wrap: anywhere; }
.liste-retours { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.message-retour { white-space: pre-wrap; overflow-wrap: anywhere; }
.reponse-retour { border-left: 4px solid var(--accent); padding: 4px 12px; margin-top: 8px; background: var(--surface-2); border-radius: 6px; }
.formulaire fieldset { border: none; padding: 0; margin: 0; }
.formulaire legend { font-weight: 600; margin-bottom: 4px; }
.formulaire .choix { display: flex; flex-direction: row; gap: 10px; align-items: center; margin: 6px 0; }
.formulaire .choix label { font-weight: normal; margin-top: 0; }
.petit { font-size: .85rem; }
@media print { .pied { display: none; } }

/* Textes et amendements des contrats (v0.28.0). */
.texte-contrat section { margin-bottom: 12px; }
.texte-contrat p { text-align: justify; }
.texte-contrat .retrait { margin-left: 2em; }
.ecart { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.ecart del { background: var(--rouge-fond); color: var(--rouge); }
.ecart ins { background: var(--vert-fond); color: var(--vert); text-decoration: underline; }
.liste-renvois { padding-left: 1.2em; }
.liste-renvois li { margin: 6px 0; }
.ecart-article { margin-bottom: 10px; }
.empreintes { overflow-wrap: anywhere; }

/* --- recherche plein texte */
.recherche-entete input { width: 11rem; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); }
.resultats { list-style: none; padding: 0; }
.resultats li { padding: 8px 0; border-bottom: 1px solid var(--bord); }
.resultats .extrait { margin: 4px 0 0; color: var(--discret); font-size: .92rem; }
.resultats mark { background: var(--accent-clair); color: var(--texte); padding: 0 1px; border-radius: 2px; }
@media (max-width: 720px) { .recherche-entete input { width: 100%; } }
