/* Écrans des cas d'usage 2 à 4 (préparation de visite, veille incendie, Risko) et composants
   partagés ajoutés avec eux : boîte de confirmation, bouton de suppression, conversation, fiches.
   Mêmes règles qu'app.css : jetons de tokens.css uniquement, aucune couleur écrite en dur. */

/* ======================================================================================
   Boîte de confirmation, bouton de suppression
   ====================================================================================== */

.btn--danger { background: var(--st-red); color: var(--white); }
.btn--danger:hover:not(:disabled) { background: var(--st-red-ink); }
.btn--danger-ghost { color: var(--st-red-ink); }
.btn--danger-ghost:hover { background: var(--st-red-bg); }

.overlay--center { align-items: center; padding-top: 16px; }
.dialog {
  width: 100%; max-width: 440px; padding: 24px;
  background: var(--white); border: 1px solid var(--stroke-subtle); border-radius: var(--radius-3xl); box-shadow: var(--shadow-dialog);
  animation: dialog-in 200ms var(--ease-out);
}
.overlay.is-closing .dialog { animation: dialog-out var(--dur-fast) var(--ease-in-out) forwards; }
.dialog__title { margin: 0 0 8px; font-size: 18px; font-weight: 650; color: var(--ink); }
.dialog__text { margin: 0 0 20px; color: var(--fg-secondary); font-size: 14px; line-height: 1.5; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ======================================================================================
   Barre de navigation : sept onglets
   ====================================================================================== */

@media (max-width: 1180px) and (min-width: 881px) {
  .nav__link { padding: 0 12px; }
}

/* ======================================================================================
   Veille incendie (CU3)
   ====================================================================================== */

.stack-lg { display: flex; flex-direction: column; gap: 20px; }

.veille-run {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px;
  background: linear-gradient(135deg, var(--violet-100), var(--white) 60%);
}
.veille-run__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 320px; }
.veille-run__title { font-size: 18px; line-height: 24px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.veille-run__sub { font-size: 13.5px; line-height: 20px; color: var(--fg-tertiary); }
.veille-run__progress { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13.5px; color: var(--violet-700); font-weight: 500; }

.fiche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.fiche { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
.fiche__top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fiche__date { font-size: 13px; font-weight: 600; color: var(--fg-secondary); font-variant-numeric: tabular-nums; }
.fiche__title { font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; overflow-wrap: anywhere; }
.fiche__desc { font-size: 14px; line-height: 21px; color: var(--fg-secondary); overflow-wrap: anywhere; }
.fiche__kv { margin-top: 0; grid-template-columns: 104px minmax(0, 1fr); }
.fiche__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: auto -22px -20px; padding: 14px 22px; }
.fiche__source { font-size: 12.5px; color: var(--fg-tertiary); }
.fiche .chips .chip { max-width: 100%; }

.veille-search { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.veille-search__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search--wide { flex: 1 1 320px; width: auto; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .select { height: 36px; font-size: 13.5px; }
.input--dept { width: 78px; height: 36px; font-size: 13.5px; border-radius: var(--radius-full); }
.results-count { margin-bottom: 12px; font-size: 13.5px; color: var(--fg-tertiary); }
.more-row { display: flex; justify-content: center; margin-top: 16px; }

@media (max-width: 560px) {
  .fiche-grid { grid-template-columns: minmax(0, 1fr); }
  .veille-run { padding: 18px; }
  .veille-search { padding: 14px; }
  .filters { width: 100%; }
  .filters .select { flex: 1 1 140px; }
}

/* ======================================================================================
   Formulaires (préparation de visite, notes des ingénieurs)
   ====================================================================================== */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 600; color: var(--fg-secondary); }
.field__hint { font-size: 12.5px; color: var(--fg-muted); }
.textarea { height: auto; min-height: 44px; padding: 10px 14px; line-height: 20px; resize: vertical; font-family: inherit; }
.select--block { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; padding-top: 24px; }
.form-grid__wide { grid-column: 1 / -1; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.form-foot .veille-run__progress { margin: 0 auto 0 0; }

/* ======================================================================================
   Notes des ingénieurs
   ====================================================================================== */

.rating__body { display: flex; flex-direction: column; gap: 12px; }
.rating__summary { font-size: 14px; line-height: 21px; color: var(--fg-secondary); }
.rating__form { display: grid; grid-template-columns: minmax(0, 2fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.rating__actions { display: flex; justify-content: flex-end; }

@media (max-width: 880px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .rating__form { grid-template-columns: minmax(0, 1fr); }
}

/* ======================================================================================
   Réponses mises en forme (markdown), cartes jointes, étapes numérotées
   ====================================================================================== */

.md { display: flex; flex-direction: column; gap: 8px; }
.md p, .md li { font-size: 14px; line-height: 21px; color: var(--ink); }
.md ul, .md ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.md h4 { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.md code { font-family: var(--font-mono); font-size: 12.5px; padding: 1px 5px; border-radius: 6px; background: var(--bg-hover); }
.md a { color: var(--violet-700); text-decoration: underline; text-underline-offset: 2px; }
.cite {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin: 0 2px; padding: 0 5px; border-radius: var(--radius-full);
  background: var(--violet-200); color: var(--violet-800); font-size: 11px; font-weight: 700; text-decoration: none; vertical-align: super;
}
.bot-card { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px 14px; border-radius: 14px; background: var(--violet-100); }
.setup__steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 21px; color: var(--ink); }

/* Listes : app.css retire les puces par défaut ; ces listes de contenu les gardent. */
.md ul { list-style: disc; }
.md ol, .setup__steps { list-style: decimal; }

/* ======================================================================================
   Écrans de verre : Risko, veille incendie, préparation de visite, rapports
   Mise en page seulement : la matière (Liquid Glass, D-40) est peinte par liquid-glass.css.
   ====================================================================================== */

/* Pastille : sphère irisée aux couleurs des halos, auréole qui respire autour de la grande. */
.orb {
  position: relative; isolation: isolate; display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, var(--white) 0 14%, transparent 46%),
    conic-gradient(from 200deg, var(--glow-cyan), var(--glow-violet), var(--glow-pink), var(--glow-lilac), var(--glow-cyan));
  color: var(--violet-700); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), var(--shadow-soft);
}
.orb .icon { width: 16px; height: 16px; stroke-width: 2; }
.orb__logo { width: 66%; height: 66%; object-fit: contain; }
.orb--lg { width: 76px; height: 76px; animation: float 7s var(--ease-in-out) infinite; }
.orb--lg .icon { width: 30px; height: 30px; stroke-width: 1.7; }
.orb--lg .orb__logo { width: 54%; height: 54%; }
.orb--lg::before {
  content: ""; position: absolute; z-index: -1; inset: -18px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow-violet), var(--glow-pink) 45%, transparent 70%);
  filter: blur(14px); opacity: .85; animation: orb-breathe 5s var(--ease-in-out) infinite;
}

/* En-tête centré */
.ghead { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 0 32px; text-align: center; }
.ghead:not(:has(> .orb)) { padding-top: 44px; }
.ghead > .orb--lg { margin-bottom: 8px; }
.ghead__back { margin: 0 0 6px; }
.ghead__title {
  max-width: 900px; font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 4vw, 48px); line-height: 1.06;
  letter-spacing: -0.04em; color: var(--ink); text-wrap: balance; overflow-wrap: anywhere;
}
.ghead__lead { max-width: 640px; font-size: 15.5px; line-height: 24px; color: var(--fg-secondary); text-wrap: balance; }
.ghead__state {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; margin-top: 4px; padding: 0 14px;
  border-radius: var(--radius-full); font-size: 12.5px; font-weight: 550; color: var(--fg-secondary);
}
.ghead__dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--st-green); }
.ghead__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--st-green); animation: ping 2.4s var(--ease-out) infinite; }
.ghead__dot.is-off { background: var(--st-gray); }
.ghead__dot.is-off::after { display: none; }
.ghead__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; }

/* Fond : les halos montent plus haut que sur les autres pages, pour que le verre ait toujours
   de la couleur à flouter, où que l'on soit dans la page (le fond est fixe, il suit le défilement). */
body[data-route="glass"] .backdrop__glow { bottom: -16vh; height: 96vh; }

/* Composants partagés sur l'accueil et les écrans de verre (les autres pages gardent le blanc). */
body:not([data-route="page"]) .content .row-link:hover { background: rgba(255, 255, 255, 0.55); }
body:not([data-route="page"]) .tabbar { justify-content: safe center; margin: 0 0 24px; }
/* Onglets d'un rapport : sous les chiffres clés, un peu d'air au-dessus. */
body:not([data-route="page"]) div:has(> .kpis) ~ .tabbar { margin-top: 36px; }

/* ======================================================================================
   Conversation (Risko, barre de chat du dashboard de visite)
   ====================================================================================== */

/* Messages : l'assistant à gauche sur verre (sans pastille : son nom suffit), l'utilisateur à
   droite en violet plein. */
.rmsg { display: flex; align-items: flex-start; gap: 12px; animation: fade-up 320ms var(--ease-out); scroll-margin-top: 88px; }
.rmsg--user { justify-content: flex-end; }
.rmsg__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: 100%; }
.rmsg__name { padding-left: 4px; font-size: 12.5px; font-weight: 650; line-height: 12px; color: var(--fg-secondary); }
.rmsg__bubble { padding: 16px 20px; border-radius: 22px; font-size: 14.5px; line-height: 23px; color: var(--ink); overflow-wrap: anywhere; }
.rmsg--bot .rmsg__bubble { display: flex; flex-direction: column; gap: 12px; border-top-left-radius: 8px; }
.rmsg--bot .md p, .rmsg--bot .md li { font-size: 14.5px; line-height: 23px; }
.rmsg--user .rmsg__bubble { max-width: min(80%, 560px); padding: 12px 18px; border-bottom-right-radius: 8px; white-space: pre-wrap; color: var(--white); }
.rmsg--typing .rmsg__bubble { flex-direction: row; align-items: center; gap: 12px; padding: 14px 20px; color: var(--fg-tertiary); font-size: 14px; }
.rdots { display: inline-flex; flex: none; gap: 4px; }
.rdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--violet-600); animation: dot-wave 1.2s var(--ease-in-out) infinite; }
.rdots i:nth-child(2) { animation-delay: .15s; }
.rdots i:nth-child(3) { animation-delay: .3s; }

/* Questions proposées : pastilles de verre, flèche qui avance au survol. */
.rsuggest { display: flex; flex-wrap: wrap; gap: 8px; }
.rsuggest__item {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px 8px 16px; text-align: left;
  border: 0; border-radius: var(--radius-full); font-size: 13.5px; font-weight: 550; line-height: 19px; color: var(--ink);
}
.rsuggest__item .icon { width: 14px; height: 14px; color: var(--fg-muted); transition: transform var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out); }
.rsuggest__item:hover:not(:disabled) { color: var(--violet-800); }
.rsuggest__item:hover:not(:disabled) .icon { color: var(--violet-700); transform: translateX(2px); }
.rsuggest__item:disabled { cursor: default; opacity: .55; }

/* Score de fiabilité d'une réponse : une jauge, toujours la même, en tête de la bulle. La jauge et le
   pourcentage prennent une seule couleur, celle du niveau atteint : rouge pour un score faible, verte
   pour un score sûr, orangée ou jaune entre les deux. --tone (0 : rouge, 1 : vert) est posé par
   l'écran (scoreOf, risko.js). Les deux teintes sont les couleurs de statut, mélangées en oklch ; un
   navigateur sans color-mix garde la jauge violette et le pourcentage noir. */
.rscore { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--stroke-weak); }
.rscore__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rscore__title { font-size: 12px; font-weight: 650; color: var(--fg-tertiary); }
.rscore__value { font-size: 15px; line-height: 18px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.rscore .meter { height: 6px; }
@supports (color: color-mix(in oklch, black, white)) {
  .rscore {
    --rscore: color-mix(in oklch, var(--st-red), var(--st-green) calc(var(--tone, 1) * 100%));
    --rscore-ink: color-mix(in oklch, var(--st-red-ink), var(--st-green-ink) calc(var(--tone, 1) * 100%));
  }
  .rscore .meter__fill { background: var(--rscore); }
  .rscore__value { color: var(--rscore-ink); }
}
.rscore__label { font-size: 12.5px; line-height: 18px; color: var(--fg-secondary); }

/* Sources citées : liste numérotée sous la réponse, chaque document cliquable. */
.rsources { padding-top: 12px; border-top: 1px solid var(--stroke-weak); }
.rsources__title { margin-bottom: 8px; font-size: 12px; font-weight: 650; color: var(--fg-tertiary); }
.rsources__list { display: flex; flex-direction: column; gap: 4px; list-style: none; }
.rsources__item {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 12px;
  font-size: 13px; line-height: 18px; color: var(--fg-secondary); text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out);
}
a.rsources__item:hover { background: var(--violet-100); color: var(--violet-800); }
.rsources__num {
  display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: var(--radius-full);
  background: var(--violet-200); color: var(--violet-800); font-size: 11px; font-weight: 700;
}
.rsources__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rsources__item .icon { width: 13px; height: 13px; color: var(--fg-muted); }
.rsources__place { display: block; font-size: 12px; color: var(--fg-tertiary); }
.rsources__more { padding: 0 10px 6px 36px; font-size: 13px; }
.rsources__excerpt { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--violet-200); white-space: pre-wrap; color: var(--fg-secondary); }
.rverify { margin-top: 10px; font-size: 12px; color: var(--fg-tertiary); }

/* Risko : disposition d'un assistant de conversation. Barre latérale (nouvelle conversation,
   historique, paramètres), colonne de discussion étroite et centrée. */
.content:has(> .rk) { --content-w: 1320px; padding-bottom: 0; }
.rk { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 28px; align-items: start; min-height: calc(100vh - 84px); }
.rk__side {
  position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; height: calc(100vh - 104px);
  padding: 14px 12px; border-radius: var(--radius-4xl); overflow: hidden;
}
.rk__new {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--violet-100); color: var(--violet-800); font: inherit; font-size: 14px; font-weight: 600; text-align: left;
  transition: background-color var(--dur-fast) var(--ease-in-out);
}
.rk__new:hover { background: var(--violet-200); }
.rk__new .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.rk__group { display: flex; flex-direction: column; flex: none; gap: 4px; }
.rk__group--grow { flex: 1 1 auto; min-height: 96px; overflow-y: auto; }
.rk__head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 10px; }
.rk__title { font-size: 12px; font-weight: 650; color: var(--fg-tertiary); }
.rk__more {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border: 0; border-radius: 9px; cursor: pointer;
  background: none; color: var(--fg-tertiary);
}
.rk__more:hover { background: var(--bg-active); color: var(--ink); }
.rk__more .icon { width: 14px; height: 14px; }
.rk__list { display: flex; flex-direction: column; gap: 2px; list-style: none; }
.rk__row { display: flex; align-items: center; gap: 2px; min-width: 0; border-radius: 12px; }
.rk__row:hover { background: var(--bg-active); }
.rk__item {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 8px 10px; border: 0; border-radius: 12px; cursor: pointer;
  background: none; color: var(--fg-secondary); font: inherit; font-size: 13.5px; line-height: 18px; text-align: left;
}
/* Le libellé porte la coupure : les points de suspension ne s'appliquent pas à un conteneur flex. */
.rk__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk__item[aria-current="true"] { background: var(--bg-active); color: var(--ink); font-weight: 600; }
.rk__item .icon { flex: none; width: 14px; height: 14px; color: var(--fg-muted); }
.rk__more { opacity: 0; }
.rk__row:hover .rk__more, .rk__more:focus-visible, .rk__more[aria-expanded="true"] { opacity: 1; }
.rk__settings { flex: none; border-top: 1px solid var(--stroke-weak); border-radius: 0 0 12px 12px; padding-top: 12px; }
.rk__none { padding: 4px 10px; font-size: 12.5px; color: var(--fg-muted); }
.rk__rename { height: 34px; font-size: 13.5px; }

/* Colonne principale : accueil centré, puis fil de discussion avec la zone de saisie en bas. */
.rk__main { min-width: 0; }
.rk__home, .rk__chat, .rk__settings-host { width: min(100%, 720px); margin: 0 auto; }
.rk__home { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 9vh 0 48px; }
.rk__hello { font-size: 28px; line-height: 36px; font-weight: 650; letter-spacing: -0.03em; text-align: center; color: var(--ink); }
/* Idées de questions à l'accueil : trois pastilles au libellé court, tirées au sort à chaque
   retour, juste au-dessus de la zone de saisie. Elles commencent à droite de la chouette, perchée
   sur le bord gauche de la zone de saisie (.lune : de 34 à 98 px), dans la marge de 34 px que la
   zone de saisie lui réserve (.has-lune) : d'où la marge négative. */
.rk__ideas { align-items: center; min-height: 32px; margin-bottom: -40px; padding-left: 108px; }
.rk__ideas .rsuggest__item { padding: 6px 14px; white-space: nowrap; }
@media (max-width: 560px) {
  /* Sur téléphone, la ligne défile de côté sur toute la largeur, au-dessus de la chouette. */
  .rk__ideas { margin-bottom: 0; padding-left: 0; }
}
.rk__ideas-more {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
  background: none; color: var(--fg-tertiary);
  transition: background-color var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out);
}
.rk__ideas-more:hover { background: var(--bg-active); color: var(--ink); }
.rk__ideas-more .icon { width: 14px; height: 14px; }
.rk__chat { display: flex; flex-direction: column; min-height: calc(100vh - 84px); }
.rk__chat-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 0 22px; }
.rk__chat-title { font-size: 13px; line-height: 19px; font-weight: 600; color: var(--fg-tertiary); overflow-wrap: anywhere; }
.rk__bar { justify-content: flex-end; }
.rk__attach {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; margin-right: auto; border: 0; border-radius: 50%;
  cursor: pointer; background: none; color: var(--fg-secondary);
  transition: background-color var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out);
}
.rk__attach:hover:not(:disabled) { background: var(--bg-active); color: var(--ink); }
.rk__attach:disabled { opacity: .5; cursor: default; }
.rk__attach .icon { width: 17px; height: 17px; stroke-width: 2.2; }
.rk__docs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 0; }
.rk__docs[hidden] { display: none; }
.rk__doc {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 6px 5px 10px; border-radius: 10px;
  background: var(--violet-100); color: var(--violet-800); font-size: 12.5px; font-weight: 550;
}
.rk__doc .icon { flex: none; width: 13px; height: 13px; }
.rk__doc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk__doc-x {
  flex: none; width: 20px; height: 20px; margin-left: auto; border: 0; border-radius: 50%; cursor: pointer; background: none;
  color: inherit; font-size: 15px; line-height: 18px;
}
.rk__doc-x:hover { background: var(--violet-200); }

.rk__mode {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: var(--radius-full); cursor: pointer;
  background: none; color: var(--fg-secondary); font: inherit; font-size: 13.5px; font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out);
}
.rk__mode:hover, .rk__mode[aria-expanded="true"] { background: var(--bg-active); color: var(--ink); }
.rk__mode .icon { width: 14px; height: 14px; }
.rk__note { align-self: center; margin-top: 10px; text-align: center; }
.rk__chat .risko__dock { display: flex; flex-direction: column; }
.rk__settings-host { padding: 8px 0 48px; }
@media (max-width: 900px) {
  .rk { grid-template-columns: 1fr; gap: 16px; }
  .rk__side { position: static; height: auto; max-height: 360px; }
  .rk__home { padding-top: 24px; }
  .rk__more { opacity: 1; }
}

.rsettings { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding: 20px 22px; border-radius: var(--radius-4xl); }
.rsettings__title { font-size: 16px; font-weight: 650; color: var(--ink); }
.rsettings__sub { margin-top: 4px; font-size: 12px; font-weight: 650; color: var(--fg-tertiary); }
.rsettings__none { font-size: 13px; color: var(--fg-tertiary); }
.rsettings__keys { display: flex; flex-direction: column; gap: 4px; list-style: none; }
.rsettings__key { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.rsettings__key code { flex: 1; color: var(--fg-tertiary); }
.rsettings__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.rsettings__row > .btn { height: 40px; }
.rsettings__row .field { flex: 1 1 200px; }

/* Compositeur : zone de saisie qui grandit, barre d'outils, bouton d'envoi rond. */
.gcomposer { display: flex; flex-direction: column; border-radius: var(--radius-4xl); }
.gcomposer__input {
  display: block; width: 100%; min-height: 56px; max-height: 168px; padding: 18px 22px 4px; resize: none;
  border: 0; outline: none; background: none; font-size: 15px; line-height: 23px; color: var(--ink);
}
.gcomposer__input::placeholder { color: var(--fg-muted); }
.gcomposer__input:focus-visible { outline: none; }
.gcomposer__input:disabled { cursor: default; color: var(--fg-tertiary); }
.gcomposer__bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 10px 12px; }
.gcomposer__send { width: 40px; height: 40px; border-radius: 50%; }
.gcomposer__send:disabled { opacity: 1; color: var(--fg-muted); }
.gcomposer__send .icon { width: 18px; height: 18px; stroke-width: 2.2; }

/* ======================================================================================
   Risko (CU4)
   ====================================================================================== */

/* Colonne centrée qui occupe toute la hauteur ; le compositeur colle au bas de l'écran. */
.content:has(> .risko) { padding-bottom: 0; }
.risko { display: flex; flex-direction: column; width: min(100%, 820px); min-height: calc(100vh - 84px); margin: 0 auto; }
.risko__thread { flex: 1; display: flex; flex-direction: column; gap: 22px; padding-bottom: 28px; }
.risko__empty { align-self: center; font-size: 14px; color: var(--fg-tertiary); }
.risko__thread > .callout { animation: fade-up var(--dur-base) var(--ease-out); }

/* Bas d'écran : un voile flou progressif sous le compositeur, les messages y glissent. */
.risko__dock { position: sticky; bottom: 0; z-index: 10; padding: 18px 0 14px; }
.risko__dock::before {
  content: ""; position: absolute; z-index: -1; inset: 0 -24px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 45%); mask-image: linear-gradient(to bottom, transparent, black 45%);
}
.risko__below { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 12px; text-align: center; }
.risko__aria { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; font-weight: 550; color: var(--violet-700); text-decoration: none; }
.risko__aria .icon { width: 14px; height: 14px; transition: transform var(--dur-fast) var(--ease-in-out); }
.risko__aria:hover .icon { transform: translateX(2px); }
.risko__note { max-width: 620px; font-size: 12px; line-height: 17px; color: var(--fg-muted); }

/* Risko non branché : même en-tête, mode d'emploi sur une carte de verre. */
.risko--setup { min-height: 0; padding-bottom: 88px; }
.risko-setup { display: flex; flex-direction: column; gap: 14px; padding: 26px 28px; border-radius: var(--radius-4xl); }
.risko-setup__title { font-size: 17px; line-height: 24px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.risko-setup__sub { margin-top: -10px; font-size: 13.5px; line-height: 20px; color: var(--fg-tertiary); }

/* ======================================================================================
   Veille incendie et préparation de visite, version verre
   ====================================================================================== */

body[data-route="glass"] .content .card.veille-run { justify-content: flex-start; }
.veille-run .veille-run__text { flex: 1 1 280px; }
.veille-run > .btn, .veille-run__actions { margin-left: auto; }
.veille-run__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.base-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.switch__count { margin-left: -3px; font-size: 12px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
body[data-route="glass"] .fiche__foot { background: rgba(255, 255, 255, 0.32); }

/* Questions proposées (Risko, dashboard de visite). */
.rsuggest--sm .rsuggest__item { min-height: 32px; padding: 6px 10px 6px 13px; gap: 6px; font-size: 12.5px; line-height: 17px; }
.rsuggest--sm .rsuggest__item .icon { width: 13px; height: 13px; }


@keyframes orb-breathe { 50% { transform: scale(1.12); opacity: .55; } }
@keyframes dot-wave { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 880px) {
  .rmsg { scroll-margin-top: 128px; }
}

@media (max-width: 560px) {
  .ghead { padding: 12px 0 24px; }
  .rmsg__body { max-width: 100%; }
  .rmsg__bubble { padding: 14px 16px; }
  .gcomposer__send { margin-left: auto; }
  .risko__aria-q { display: none; }
  .risko-setup { padding: 20px; }
  /* Sur téléphone, les relances tiennent sur une ligne qui défile de côté. */
  .rsuggest--sm { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rsuggest--sm .rsuggest__item { flex: none; white-space: nowrap; }
}

/* ======================================================================================
   Analyse et rapports, version verre et aérée
   ====================================================================================== */

/* Accueil : le compositeur de dépôt, les repères et le suivi de l'analyse sont en verre (liquid-glass.css). */
body[data-route="home"] .composer__bar { border-top-color: rgba(255, 255, 255, 0.6); }
.run .run__action { display: flex; align-items: center; gap: 4px; }

/* Rapport : les blocs internes des cartes restent des aplats clairs, sans flou. */
body[data-route="glass"] .fact.is-missing { background: rgba(255, 255, 255, 0.24); border-color: var(--stroke-subtle); box-shadow: none; }
body[data-route="glass"] :is(.effects, .rblock:not(.rblock--key)) { background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85); }

/* Aération : plus d'air entre les cartes et dans chacune, textes longs repliés (« Lire tout »). */
.clamp.is-clamped { -webkit-line-clamp: var(--lines, 2); line-clamp: var(--lines, 2); }
.reco-sum { gap: 16px; margin-bottom: 8px; }
.sum { padding: 18px 20px; }
.reco-grid { gap: 20px; }
.reco { gap: 14px; padding: 22px 24px; }
.reco .chips { gap: 8px; }
.reco__title { font-size: 15.5px; line-height: 22px; }
.reco .clamp { font-size: 14px; line-height: 22px; }
.effects { gap: 12px 14px; padding: 14px 16px; }
.retex-grid { gap: 20px; }
.retex { gap: 16px; padding: 26px; }
.retex .card__foot { margin: auto -26px -26px; padding: 16px 26px; }
.retex__blocks { gap: 12px; }
.rblock { padding: 16px 18px; }
.rblock__head { margin-bottom: 6px; }
.rblock .clamp { font-size: 14px; line-height: 22px; color: var(--ink); }
.scn-bento { gap: 20px; }
.scn { padding: 24px 26px 20px; }
.scn__stats { gap: 10px; margin-top: 18px; }
.scn__more { margin-top: 16px; }
.profile-head { padding: 22px 26px; margin-bottom: 8px; }
.ask { margin-bottom: 20px; }
.fact-group { margin: 36px 0 14px; font-size: 16px; }
.facts-grid { gap: 14px; }
.fact { gap: 14px; padding: 16px 18px; border-radius: 18px; }
.fact dd { margin-top: 3px; font-size: 14px; line-height: 21px; font-weight: 500; }
.fact dd .clamp { font-size: 14px; line-height: 21px; font-weight: 500; color: var(--ink); }
.fact dd .clamp-wrap .link-btn { font-weight: 500; }
.plist-grid { gap: 20px; }
.plist { padding: 22px 24px 24px; }
.plist__title { margin-bottom: 14px; }
.plist .chips { gap: 8px; }
.plist .chip--soft { padding: 8px 12px; line-height: 20px; background: rgba(255, 255, 255, 0.6); }
body[data-route="glass"] .tabpanel .section { margin-top: 56px; }
body[data-route="glass"] .tabpanel .section__head { margin-bottom: 18px; }

@media (max-width: 560px) {
  .reco, .scn, .plist { padding: 18px; }
  .retex { padding: 20px; }
  .retex .card__foot { margin: auto -20px -20px; padding: 14px 20px; }
}

/* ======================================================================================
   Protocole de validation (double aveugle)
   ====================================================================================== */

.table .row-total td { background: var(--canvas); }
.table .row-section td { padding-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--violet-700); background: var(--white); }
.annot { display: flex; flex-direction: column; gap: 14px; }
.annot__bar { position: sticky; top: 76px; z-index: 5; padding: 14px 20px; }
.annot__barin { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.annot__name { flex: 1 1 260px; }
.annot__saved { font-size: 13px; }
.annot__points { display: flex; flex-direction: column; padding: 8px 24px 18px; }
.annot__row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 200px minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--stroke-weak);
}
.annot__row:first-child { border-top: 0; }
.annot__num { font-size: 12.5px; color: var(--fg-muted); }
.annot__title { font-size: 14px; line-height: 20px; color: var(--ink); }
.annot__select, .annot__note { height: 36px; font-size: 13.5px; }

@media (max-width: 880px) {
  .annot__row { grid-template-columns: 40px minmax(0, 1fr); }
  .annot__select, .annot__note { grid-column: 2; }
  .annot__bar { top: 110px; }
}

/* ======================================================================================
   Connexion (mot de passe facultatif)
   ====================================================================================== */

.login { display: grid; place-items: center; min-height: 60vh; padding: 24px 0; }
.login__card { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 400px); padding: 32px 28px; text-align: center; }
.login__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--violet-100); color: var(--violet-700); }
.login__title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.login__text { font-size: 14px; color: var(--fg-tertiary); }
.login__form { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 8px; }
.login__error { font-size: 13.5px; color: var(--st-red-ink); }

/* --- Lune, la chouette des barres de chat (js/lune.js) --------------------------------------------
   Une fenêtre posée sur le bord haut de la barre : la tête dépasse, le reste est caché dessous. */
.gcomposer.has-lune { position: relative; margin-top: 34px; }
.ask__bar.has-lune { position: relative; }
.ask:has(.has-lune) { margin-top: 34px; }
.run-wrap { position: relative; width: min(100%, 680px); margin: 34px auto 0; }
.lune { position: absolute; bottom: 100%; left: 34px; width: 64px; height: 52px; overflow: hidden; pointer-events: none; }
.lune--right { left: auto; right: 72px; }
.lune__art { position: absolute; top: 9px; left: 0; width: 64px; height: 64px; overflow: visible; }
/* Les transitions sur translate et rotate adoucissent le retour au neutre quand une phase change. */
.lune__head { transform-origin: 64px 90px; transition: transform 420ms var(--ease-out), translate 300ms var(--ease-out), rotate 300ms var(--ease-out); }
.lune__face { transform-origin: 64px 66px; transition: translate 300ms var(--ease-out); }
.lune__body { fill: var(--violet-700); pointer-events: auto; cursor: pointer; }
.lune__disc { fill: var(--violet-200); pointer-events: none; }
.lune__beak { fill: var(--violet-300); stroke: var(--violet-300); stroke-width: 3; stroke-linejoin: round; pointer-events: none; }
.lune__pupil { fill: var(--ink); pointer-events: none; transition: transform 240ms var(--ease-out), translate 240ms var(--ease-out); }
.lune__lid { fill: var(--violet-700); transition: transform 200ms var(--ease-in-out), translate 200ms var(--ease-in-out); }
.lune__lid.is-blink { transform: none !important; transition-duration: 70ms; }
.lune__arc { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.lune__arc.is-on { opacity: 1; }
.lune__blush { fill: var(--glow-pink); opacity: 0; transition: opacity 240ms ease; }
.lune__blush.is-on { opacity: 1; }
.lune__dots circle { fill: var(--violet-600); opacity: 0; }
.lune__spark { stroke: var(--violet-600); stroke-width: 3; stroke-linecap: round; opacity: 0; transform-origin: 106px 28px; pointer-events: none; }
.lune__moon { transform-origin: 64px 70px; opacity: 0; transition: opacity 240ms ease; pointer-events: none; }
.lune__moon path { fill: var(--violet-600); }

/* Hauteur de la tête : à moitié cachée au repos, sortie pour répondre, plongée pour se cacher. */
.lune[data-state="idle"] .lune__head { transform: translateY(6px); animation: lune-breathe 4s ease-in-out infinite; }
.lune[data-state="listen"] .lune__head { transform: translateY(0); }
.lune[data-state="think"] .lune__head { transform: translateY(4px); }
.lune[data-state="answer"] .lune__head { transform: translateY(-14px); }
.lune[data-state="sad"] .lune__head { transform: translateY(10px); }
.lune[data-state="boop"] .lune__head { transform: translateY(-6px); }
.lune[data-state="grumpy"] .lune__head { transform: translateY(4px); animation: lune-shake 360ms ease-in-out 2; }
.lune[data-state="hide"] .lune__head { transform: translateY(82px); transition-duration: 300ms; }
.lune[data-state="peek"] .lune__head { transform: translateY(26px); transition-duration: 900ms; }

.lune[data-phase="ponder"] .lune__head { animation: lune-tilt 1.4s ease-in-out infinite; }
.lune[data-phase="read"] .lune__pupil { animation: lune-read 1.1s ease-in-out infinite; }
.lune[data-phase="dots"] .lune__dots circle { animation: lune-dot 1.2s ease-in-out infinite; }
.lune[data-phase="dots"] .lune__dots circle:nth-child(2) { animation-delay: 0.2s; }
.lune[data-phase="dots"] .lune__dots circle:nth-child(3) { animation-delay: 0.4s; }
.lune[data-phase="focus"] .lune__head { animation: lune-nod 0.9s ease-in-out infinite; }
.lune[data-phase="souvenir"] .lune__pupil { animation: lune-souvenir 2.4s var(--ease-in-out) infinite; }
.lune[data-phase="souvenir"] .lune__head { animation: lune-souvenir-head 2.4s var(--ease-in-out) infinite; }
.lune[data-phase="orbite"] .lune__pupil { animation: lune-orbit 1.8s linear infinite; }
.lune[data-phase="pivot"] .lune__face { animation: lune-pivot 2.4s ease-in-out infinite; }
.lune[data-phase="pivot"] .lune__head { animation: lune-pivot-head 2.4s ease-in-out infinite; }
.lune[data-phase="plisse"] .lune__lid { animation: lune-squint 2s ease-in-out infinite; }
.lune[data-phase="ecriture"] .lune__pupil { animation: lune-write 1.6s linear infinite; }
.lune[data-phase="ecriture"] .lune__head { animation: lune-write-nod 1.6s ease-in-out infinite; }
.lune[data-phase="lune"] .lune__moon { opacity: 1; animation: lune-moon 3.2s ease-in-out infinite; }
.lune[data-phase="lune"] .lune__pupil { animation: lune-moon-eyes 3.2s ease-in-out infinite; }
.lune[data-phase="patience"] .lune__lid { animation: lune-slow-blink 3s ease-in-out infinite; }
.lune[data-phase="patience"] .lune__head { animation: lune-patience 3s ease-in-out infinite; }
.lune[data-phase="eureka"] .lune__head { animation: lune-eureka 650ms var(--ease-out) forwards; }
.lune[data-phase="eureka"] .lune__spark { animation: lune-spark 650ms var(--ease-out) forwards; }
.lune[data-state="answer"] .lune__art { animation: lune-hop 620ms var(--ease-out); }
.lune[data-state="boop"] .lune__art { animation: lune-squash 420ms var(--ease-out); }

@keyframes lune-breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes lune-tilt { 0%, 100% { rotate: 0deg; } 50% { rotate: -7deg; } }
@keyframes lune-read { 0%, 100% { translate: 0 0; } 25% { translate: -3.5px 0; } 75% { translate: 3.5px 0; } }
@keyframes lune-dot { 0%, 100% { opacity: 0.15; translate: 0 0; } 40% { opacity: 1; translate: 0 -3px; } }
@keyframes lune-nod { 0%, 100% { translate: 0 0; } 50% { translate: 0 2px; } }
@keyframes lune-hop { 0% { transform: translateY(0); } 35% { transform: translateY(-9px); } 70% { transform: translateY(1px); } 100% { transform: translateY(0); } }
@keyframes lune-squash { 0% { transform: scale(1, 1); } 30% { transform: scale(1.12, 0.86) translateY(6px); } 65% { transform: scale(0.95, 1.06); } 100% { transform: scale(1, 1); } }
@keyframes lune-shake { 0%, 100% { rotate: 0deg; } 25% { rotate: -6deg; } 75% { rotate: 6deg; } }
@keyframes lune-souvenir { 0%, 100% { translate: 0 0; } 15%, 40% { translate: -4px -5px; } 55%, 85% { translate: 4px -5px; } }
@keyframes lune-souvenir-head { 0%, 100% { rotate: 0deg; } 15%, 40% { rotate: -3deg; } 55%, 85% { rotate: 3deg; } }
@keyframes lune-orbit {
  0%, 100% { translate: 0 -4px; } 12.5% { translate: 2.8px -2.8px; } 25% { translate: 4px 0; } 37.5% { translate: 2.8px 2.8px; }
  50% { translate: 0 4px; } 62.5% { translate: -2.8px 2.8px; } 75% { translate: -4px 0; } 87.5% { translate: -2.8px -2.8px; }
}
@keyframes lune-pivot { 0%, 100% { translate: 0 0; } 20%, 40% { translate: -7px 0; } 60%, 80% { translate: 7px 0; } }
@keyframes lune-pivot-head { 0%, 100% { rotate: 0deg; } 20%, 40% { rotate: -2deg; } 60%, 80% { rotate: 2deg; } }
@keyframes lune-squint { 0%, 100% { translate: 0 0; } 45%, 70% { translate: 0 9px; } }
@keyframes lune-write {
  0%, 18% { translate: -4px 0; } 22%, 40% { translate: -1.5px 0; } 44%, 62% { translate: 1px 0; }
  66%, 84% { translate: 3.5px 0; } 100% { translate: -4px 0; }
}
@keyframes lune-write-nod { 0%, 84%, 100% { translate: 0 0; } 92% { translate: 0 2px; } }
@keyframes lune-moon { 0%, 100% { rotate: -72deg; } 50% { rotate: 72deg; } }
@keyframes lune-moon-eyes { 0%, 100% { translate: -5px -1px; } 25%, 75% { translate: 0 -5.5px; } 50% { translate: 5px -1px; } }
@keyframes lune-slow-blink { 0%, 38%, 70%, 100% { translate: 0 0; } 48%, 58% { translate: 0 32px; } }
@keyframes lune-patience { 0%, 100% { rotate: 0deg; } 30%, 75% { rotate: 6deg; } }
@keyframes lune-eureka { 0% { translate: 0 0; } 35% { translate: 0 -7px; } 70%, 100% { translate: 0 -4px; } }
@keyframes lune-spark { 0% { opacity: 0; scale: 0.5; } 35% { opacity: 1; scale: 1; } 100% { opacity: 1; scale: 1.08; } }

@media (max-width: 640px) { .lune { left: 22px; } .lune--right { left: auto; right: 60px; } }
@media (prefers-reduced-motion: reduce) { .lune, .lune * { animation: none !important; transition: none !important; } }
/* ======================================================================================
   Dashboard de préparation de visite (CU2, décisions D-51, D-58 et D-60) : un en-tête, huit blocs
   calmes (une ligne par élément), la barre de chat ; le détail s'ouvre dans la modale
   ====================================================================================== */

/* La vue occupe exactement la hauteur de la fenêtre ; une liste trop longue montre ce qui tient et
   compte le reste (js/views/visite-tiles.js, fitTiles). */
.content:has(> .vd) { --content-w: 1320px; min-height: 0; padding: 12px 0 0; }
/* 82 px : barre de navigation (68 px), sa bordure (1 px), marge haute de .content (12 px), plus 1 px
   de jeu. 520 px : plancher ; plus bas, la vue ne rétrécit plus, la page défile. */
.vd { display: flex; flex-direction: column; height: calc(100dvh - 82px); min-height: 520px; }
/* Sous 880 px la barre de navigation passe sur deux lignes (114 px) : 114 + 12 de marge haute + 1 px de jeu. */
@media (max-width: 880px) { .vd { height: calc(100dvh - 127px); } }

/* En-tête : retour, nom du site et son activité, puis l'impression et le menu. */
.vd__head { grid-area: head; display: flex; align-items: center; gap: 8px; min-width: 0; }
.vd__head > .icon-btn { flex: none; margin-left: -6px; }
.vd__titles { flex: 1; min-width: 0; }
.vd__title { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; line-height: 28px; font-weight: 650; letter-spacing: -0.03em; color: var(--ink); }
.vd__lead { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 18px; color: var(--fg-tertiary); }
.vd__actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* Fenêtre large : le procédé en bandeau sous l'en-tête ; dessous, À vérifier à gauche sur deux
   rangées, et deux rangées de trois blocs ; la barre de chat en bas. */
.vd__grid {
  flex: 1; min-height: 0; display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr) auto;
  grid-template-areas:
    "head head head head"
    "process process process process"
    "points site risques retex"
    "points questions documents bibliotheque"
    "dock dock dock dock";
}
.vt--points { grid-area: points; }
.vt--process { grid-area: process; }
.vt--site { grid-area: site; }
.vt--risques { grid-area: risques; }
.vt--retex { grid-area: retex; }
.vt--questions { grid-area: questions; }
.vt--documents { grid-area: documents; }
.vt--bibliotheque { grid-area: bibliotheque; }

/* Un bloc : le verre de Risko (classe glass), un titre, son contenu. */
.vt { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 12px 16px 10px; border-radius: var(--radius-4xl); overflow: hidden; }
.vt--hero { --lg-fill: linear-gradient(180deg, var(--violet-area), transparent 200px), var(--lg-fill-regular); }
/* Bloc que le chat vient de mettre à jour : un anneau violet, jusqu'au message suivant. */
.vt--updated { --lg-ring: 0 0 0 2px var(--violet-500); }
.vt [hidden] { display: none !important; }
.vt__head { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; min-height: 22px; }
.vt__title { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); white-space: nowrap; }
.vt__meta { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; font-weight: 600; color: var(--fg-tertiary); white-space: nowrap; }
.vt__meta--upd { display: inline-flex; align-items: center; gap: 6px; color: var(--violet-700); }
.vt__dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--violet-700); }

/* Bloc prêt : il s'ouvre en grand. Son titre est un bouton dont la zone de clic couvre le bloc ; les
   lignes cliquables, « +N », le champ d'adresse et les boutons restent au-dessus. Au survol, le bloc
   se soulève et montre la flèche d'agrandissement. */
.vt.is-openable { cursor: pointer; transition: translate var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.vt__open { border: 0; padding: 0; background: none; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; }
.vt__open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.vt__open:focus-visible { outline: none; }
.vt:has(> .vt__head .vt__open:focus-visible) { --lg-ring: 0 0 0 3px var(--violet-ring), 0 0 0 1px var(--violet-600); }
:is(.vrow__open, .vt__more, .vt__address, .vt__foot .btn) { position: relative; z-index: 2; }
.vt__grow { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin: -1px -6px -1px 0; border-radius: 50%; background: rgba(255, 255, 255, 0.75); color: var(--violet-700); opacity: 0; scale: .8; transition: opacity var(--dur-base) var(--ease-out), scale 340ms var(--lg-ease-spring); }
.vt__title + .vt__grow { margin-left: auto; }
.vt__grow .icon { width: 12px; height: 12px; stroke-width: 2.2; }
@media (hover: hover) {
  .vt.is-openable:hover { translate: 0 -2px; --lg-drop-x: var(--lg-drop-float); }
  .vt.is-openable:not(.vt--updated):hover { --lg-ring: 0 0 0 1px var(--violet-400); }
  .vt.is-openable:hover .vt__grow { opacity: 1; scale: 1; }
  .vt.is-openable:hover .vt__title { color: var(--violet-700); }
}
@media (hover: none) { .vt__grow { opacity: .7; scale: 1; } }
.vt .chip { flex: none; min-height: 20px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; line-height: 18px; }

/* Listes : une ligne par élément, coupée s'il le faut (texte entier au survol, dans la modale et sur
   la feuille). La liste coupe ce qui dépasse ; ses lignes débordent de 6 px de chaque côté, d'où la
   marge intérieure compensée. */
.vt__list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; margin: -2px -10px; padding: 2px 10px; list-style: none; }
.vrow { flex: none; position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0 -6px; padding: 3px 6px; border-radius: 10px; font-size: 13px; line-height: 18px; color: var(--fg-secondary); }
.vrow__open { display: flex; align-items: center; gap: 9px; width: calc(100% + 12px); min-width: 0; margin: -3px -6px; padding: 3px 6px; border: 0; border-radius: 10px; background: none; cursor: pointer; font: inherit; text-align: left; color: inherit; transition: background-color var(--dur-fast) var(--ease-in-out); }
.vrow__open:hover { background: rgba(255, 255, 255, 0.65); }
.vrow__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow__end { flex: none; font-size: 11.5px; font-weight: 550; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.vrow__dot { flex: none; width: 5px; height: 5px; margin: 0 3px; border-radius: 50%; background: var(--violet-500); }
.vrow__ico { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--violet-100); color: var(--violet-700); }
.vrow__ico .icon { width: 12px; height: 12px; }
/* Ligne écrite par l'ingénieur : filet violet. Ligne changée par le dernier message : surlignée. */
.vrow.is-own::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; border-radius: 1px; background: var(--violet-700); }
.vrow.is-new { background: var(--violet-200); color: var(--ink); }
.vt__list--points { gap: 6px; }
.vt__list--points .vrow { font-size: 14px; line-height: 20px; }
.vt__list--points .vrow__text { font-weight: 600; color: var(--ink); }
.vt__list--risks .vrow__text { color: var(--ink); }
.vt__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; min-height: 18px; }
.vt__foot--start { justify-content: flex-start; }
.vt__more { border: 0; padding: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px; line-height: 18px; font-weight: 600; color: var(--violet-700); }
.vt__note { flex: 1; margin: 0; font-size: 13px; line-height: 19px; color: var(--fg-tertiary); }
.vt__address { display: flex; gap: 6px; flex: none; cursor: auto; }
.vt__address .input { height: 32px; padding: 0 10px; font-size: 13px; }
.vt__address .btn { height: 32px; flex: none; }
.vt--wait .skeleton { flex: 1; padding-top: 4px; gap: 8px; }
.vt--wait .skeleton i { height: 12px; }

/* Numéro d'un point : la couleur de sa priorité ; le même numéro repère son incident dans RETEX. */
.vnum { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--st-gray); color: var(--white); font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.vnum--red { background: var(--st-red); }
.vnum--violet { background: var(--violet-700); }

/* Procédé : les étapes en pastilles reliées par un trait, de gauche à droite. */
.vt--process { gap: 10px; }
/* Une seule rangée : les noms longs se coupent plutôt que de laisser un trait pendre en fin de ligne. */
.vchain { display: flex; align-items: center; gap: 22px; min-width: 0; margin: 0; padding: 0 0 2px; list-style: none; }
.vchain__step { position: relative; display: inline-flex; flex: 0 1 auto; align-items: center; gap: 7px; min-width: 0; max-width: 220px; padding: 4px 12px 4px 4px; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), var(--shadow-xs); }
.vchain__step:not(:last-child)::after { content: ""; position: absolute; left: 100%; top: 50%; width: 22px; height: 2px; margin-top: -1px; background: var(--violet-300); }
.vchain__n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--violet-100); color: var(--violet-700); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vchain__step--violet .vchain__n { background: var(--violet-700); color: var(--white); }
.vchain__step--rouge .vchain__n { background: var(--st-red); color: var(--white); }
.vchain__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink); }

/* Site : la vue aérienne, l'effectif et le code NAF en légende. */
.vsite { position: relative; flex: 1; min-height: 60px; margin: 0; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85); }
.vsite__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.vsite__img--empty { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0 10px, var(--violet-area) 10px 20px); }
.vsite__cap { position: absolute; left: 6px; right: 6px; bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 10px; border-radius: 10px; background: var(--lg-fill-thick); -webkit-backdrop-filter: blur(12px) saturate(1.6); backdrop-filter: blur(12px) saturate(1.6); font-size: 12px; font-weight: 600; color: var(--ink); }

/* Barre du bas : le verre et les commandes de Risko, sur une seule ligne. */
.vd__dock { grid-area: dock; display: flex; align-items: flex-end; justify-content: center; gap: 12px; min-width: 0; padding-bottom: 10px; }
.vd__chat { flex: 0 1 760px; min-width: 0; display: flex; flex-direction: column; }
.vd__dock .rk__ideas { flex-wrap: nowrap; }
.vd__dock .gcomposer { flex-direction: row; align-items: center; }
.vd__dock .gcomposer__bar { display: contents; }
.vd__dock .rk__attach { order: 1; margin: 0 0 0 12px; }
.vd__dock .gcomposer__input { order: 2; flex: 1; min-height: 0; height: 52px; padding: 14px 10px 14px 6px; }
.vd__dock .gcomposer__send { order: 3; margin-right: 6px; }
.vd__state { margin: 0 0 0 auto; border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.vd__state:disabled { cursor: default; }

/* Fenêtre plus haute que 16/10 (tablette, petit portable) : trois colonnes, À vérifier sur deux
   rangées. */
@media (max-aspect-ratio: 16/10) {
  .vd .vd__grid {
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-areas:
      "head head head"
      "process process process"
      "points site risques"
      "points retex questions"
      "bibliotheque bibliotheque documents"
      "dock dock dock";
  }
}

/* Fenêtre étroite (téléphone) : une colonne, la page défile. */
@media (max-width: 760px) {
  .vd { height: auto; }
  .vd .vd__grid {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto;
    grid-template-areas: "head" "points" "process" "site" "risques" "retex" "questions" "documents" "bibliotheque" "dock";
  }
  .vd .vt__list { overflow: visible; }
  .vd .vt--site { min-height: 180px; }
  /* Le procédé passe à la ligne, sans trait entre deux rangées. */
  .vd .vchain { flex-wrap: wrap; gap: 8px; }
  .vd .vchain__step::after { display: none; }
  .vd .vd__dock { flex-wrap: wrap; }
  .vd .vd__actions .lbtn__label { font-size: 12px; }
}

/* Tablette : des cibles plus grandes pour le doigt. */
@media (pointer: coarse) {
  .vd .vt__more { min-height: 30px; min-width: 30px; }
}

/* ======================================================================================
   Modale d'une tuile (D-58, js/views/visite-modal.js) : verre épais sur un voile flou, halos de
   Sherpa en tête de carte, pictogramme sur une tuile en dégradé violet, pilules pour passer d'une
   tuile à l'autre
   ====================================================================================== */

html.has-vmodal { overflow: hidden; }
.vmodal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 28px 24px; }
.vmodal[hidden] { display: none; }
/* Le dashboard reste deviné derrière : un voile clair et flou, jamais un fond noir. */
.vmodal__scrim {
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 40%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.28));
  -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
}
.vmodal__card {
  position: relative; isolation: isolate; display: flex; flex-direction: column; width: min(880px, 100%); height: min(780px, calc(100dvh - 56px));
  overflow: hidden; outline: none; border-radius: 32px; background: var(--lg-fill-thick);
  -webkit-backdrop-filter: blur(30px) saturate(1.9); backdrop-filter: blur(30px) saturate(1.9);
  box-shadow: var(--lg-rim), var(--lg-drop-float), 0 40px 120px -40px var(--violet-ring);
}
/* Les quatre halos de Sherpa, en dégradé, derrière l'en-tête ; ils s'effacent vers le contenu. */
.vmodal__glow {
  position: absolute; z-index: -1; top: -60px; left: -8%; right: -8%; height: 320px; pointer-events: none;
  background:
    radial-gradient(36% 62% at 12% 42%, var(--glow-cyan), transparent 70%),
    radial-gradient(34% 64% at 88% 30%, var(--glow-pink), transparent 70%),
    radial-gradient(46% 76% at 56% 18%, var(--glow-violet), transparent 72%),
    radial-gradient(30% 54% at 34% 64%, var(--glow-lilac), transparent 70%);
  opacity: .9;
  -webkit-mask-image: linear-gradient(to bottom, black 38%, transparent); mask-image: linear-gradient(to bottom, black 38%, transparent);
  animation: glow-drift 16s var(--ease-in-out) infinite alternate;
}
.vmodal__head { display: flex; align-items: center; gap: 16px; flex: none; padding: 26px 22px 14px 28px; }
.vmodal__obj {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; color: var(--white);
  background: linear-gradient(150deg, var(--violet-600) 0%, var(--violet-700) 58%, var(--violet-1000) 130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -10px 18px var(--violet-area), var(--lg-drop-tint);
}
.vmodal__obj .icon { width: 24px; height: 24px; stroke-width: 1.8; }
.vmodal__titles { flex: 1; min-width: 0; }
.vmodal__eyebrow { margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; line-height: 17px; font-weight: 600; color: var(--violet-700); }
.vmodal__title { margin: 0; font-size: 28px; line-height: 1.12; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); text-wrap: balance; }
.vmodal__sub { margin: 5px 0 0; font-size: 13.5px; line-height: 19px; color: var(--fg-tertiary); }
.vmodal__close {
  flex: none; align-self: flex-start; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.62); color: var(--ink); box-shadow: var(--lg-rim), var(--lg-drop);
  transition: scale 340ms var(--lg-ease-spring), background-color var(--dur-fast) var(--ease-in-out);
}
.vmodal__close:hover { scale: 1.06; background: rgba(255, 255, 255, 0.9); }
.vmodal__close .icon { width: 17px; height: 17px; }
.vmodal__nav { flex: none; padding: 0 22px 14px 28px; overflow-x: auto; scrollbar-width: none; }
.vmodal__nav::-webkit-scrollbar { display: none; }
.vmodal__nav[hidden] { display: none; }
.vmodal__nav .pills { background: rgba(255, 255, 255, 0.5); border-color: rgba(255, 255, 255, 0.9); box-shadow: var(--lg-rim), var(--lg-drop); }
.vmodal__nav .pills__btn { height: 32px; padding: 0 13px; font-size: 13px; }
.vmodal__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid rgba(255, 255, 255, 0.8); scroll-padding: 24px; }
.vmodal__body { display: flex; flex-direction: column; gap: 14px; padding: 20px 28px 32px; }
.vmodal .btn--secondary { background: rgba(255, 255, 255, 0.7); border-color: rgba(255, 255, 255, 0.95); box-shadow: var(--lg-rim), var(--lg-drop); }
.vmodal .input { background-color: rgba(255, 255, 255, 0.78); }

/* Contenu */
.vm__note { margin: 0; font-size: 14px; line-height: 21px; color: var(--fg-tertiary); }
.vm__p { margin: 0; font-size: 14.5px; line-height: 22px; color: var(--fg-secondary); overflow-wrap: anywhere; }
.vm__source { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--fg-tertiary); }
.vm__section { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.vm__label { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.vm__grow { flex: 1; min-width: 0; }
.vm__add { align-self: flex-start; }
.vm__icon-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--fg-tertiary); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out); }
.vm__icon-btn:hover { background: rgba(255, 255, 255, 0.9); color: var(--violet-700); }
.vm__icon-btn .icon { width: 15px; height: 15px; }

/* Carte de contenu : blanc translucide posé sur le verre, liseré blanc. */
.vm__card, .vm__facts, .vm__rows, .vm__stat {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), var(--shadow-soft);
}
.vm__card { position: relative; padding: 16px 18px; border-radius: 22px; }
.vm__card.is-own::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 18px; width: 3px; border-radius: 2px; background: var(--violet-700); }
.vm__card.is-new { background: linear-gradient(var(--violet-area), var(--violet-area)), rgba(255, 255, 255, 0.62); }
.is-focus { animation: vm-focus 1.8s var(--ease-out); }
@keyframes vm-focus { 0%, 35% { box-shadow: 0 0 0 3px var(--violet-500), var(--shadow-soft); } }

/* À vérifier et RETEX : une carte par point ou par incident. */
.vm__points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vm__point-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vm__point-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; line-height: 22px; font-weight: 650; letter-spacing: -0.015em; color: var(--ink); text-wrap: pretty; }
.vnum--lg { width: 26px; height: 26px; font-size: 12.5px; }
.vm__kv { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 4px 10px; margin: 10px 0 0 36px; font-size: 14px; line-height: 20px; }
.vm__kv dt { font-size: 12px; line-height: 20px; font-weight: 650; color: var(--violet-700); }
.vm__kv dd { margin: 0; color: var(--fg-secondary); }
.vm__point > .vm__source { margin: 10px 0 0 36px; }
.vm__incident {
  display: flex; align-items: center; gap: 12px; margin: 12px 0 0 36px; padding: 10px 12px; border-radius: 16px;
  background: linear-gradient(120deg, var(--violet-100), rgba(255, 255, 255, 0.5)); box-shadow: inset 0 0 0 1px var(--violet-200);
}
.vm__incident-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--white); color: var(--violet-700); box-shadow: var(--shadow-xs); }
.vm__incident-ico .icon { width: 15px; height: 15px; }
.vm__incident-text { flex: 1; min-width: 0; }
.vm__incident-what { margin: 0; font-size: 13.5px; line-height: 19px; font-weight: 600; color: var(--ink); }
.vm__incident-meta { margin: 0; font-size: 12.5px; line-height: 17px; color: var(--fg-tertiary); }
.vm__link {
  flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: var(--radius-full); text-decoration: none;
  background: rgba(255, 255, 255, 0.85); box-shadow: inset 0 0 0 1px var(--violet-200); font-size: 12.5px; font-weight: 600; color: var(--violet-700);
}
.vm__link:hover { background: var(--white); }
.vm__link .icon { width: 13px; height: 13px; }
.vm__retex-meta { margin: 6px 0 0 36px; font-size: 12.5px; font-weight: 550; color: var(--fg-tertiary); }
.vm__retex > .vm__p { margin: 8px 0 0 36px; font-size: 14px; line-height: 21px; }
.vm__retex-foot { display: flex; align-items: center; gap: 12px; margin: 12px 0 0 36px; }
.vm__retex-cite { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--violet-700); }

/* Correction d'un point, dans sa carte. */
.vm__point.is-editing { display: flex; flex-direction: column; gap: 12px; box-shadow: 0 0 0 3px var(--violet-ring), inset 0 0 0 1px var(--violet-400), var(--shadow-soft); }
.vm__field { display: flex; flex-direction: column; gap: 6px; }
.vm__field-label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.vm__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.vm__choices { display: flex; gap: 6px; }
.vm__choice { border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; opacity: .55; }
.vm__choice[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--violet-ring); }
.vm__form-actions { display: flex; align-items: center; gap: 8px; }
.vm__spacer { flex: 1; }

/* Faits du site : une ligne par risque, sa pastille de statut et sa valeur. */
.vm__key {
  display: flex; align-items: baseline; gap: 12px; padding: 16px 20px; border-radius: 22px;
  background: linear-gradient(120deg, var(--violet-100), rgba(255, 255, 255, 0.5)); box-shadow: inset 0 0 0 1px var(--violet-200);
}
.vm__key-n { font-size: 38px; line-height: 1; font-weight: 700; letter-spacing: -0.035em; color: var(--violet-700); font-variant-numeric: tabular-nums; }
.vm__key-l { font-size: 14px; color: var(--fg-secondary); }
.vm__facts { margin: 0; padding: 2px 18px; border-radius: 22px; list-style: none; }
.vm__fact { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--stroke-weak); }
.vm__fact:first-child { border-top: 0; }
.vm__fact-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--st-gray); }
.vm__fact--rouge .vm__fact-dot { background: var(--st-red); }
.vm__fact--violet .vm__fact-dot { background: var(--violet-700); }
.vm__fact--vert .vm__fact-dot { background: var(--st-green); }
.vm__fact-text { flex: 1; min-width: 0; }
.vm__fact-label { margin: 0; font-size: 14.5px; line-height: 20px; font-weight: 550; color: var(--ink); }
.vm__fact-hint { margin: 0; font-size: 12.5px; line-height: 17px; color: var(--fg-tertiary); }
.vm__facts--quiet .vm__fact-label { font-weight: 450; color: var(--fg-secondary); }
/* Photo aérienne (D-64) : constats hors de la liste fixe, sous les lignes. */
.vm__photo-more { margin: 10px 0 0; padding: 0 0 0 18px; font-size: 14px; line-height: 21px; color: var(--fg-secondary); }
.vm__photo-more li + li { margin-top: 4px; }

/* Faits : la source datée et « Actualiser » ; la mention d'une copie locale (service injoignable). */
.vm__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.vm__stale { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 16px; background: var(--violet-100); box-shadow: inset 0 0 0 1px var(--violet-200); font-size: 13.5px; line-height: 20px; color: var(--violet-800); }
.vm__stale .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }

/* Légende de la vue aérienne : le site (point violet), les canalisations (bande rouge). */
:is(.vm__legend, .vdoc__legend) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font-size: 12.5px; line-height: 18px; color: var(--fg-tertiary); }
.vm__key-site { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--violet-700); box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--stroke-subtle); }
.vm__key-band { flex: none; width: 18px; height: 8px; margin-left: 8px; border-radius: 2px; background: var(--st-red-bg); box-shadow: inset 0 0 0 1.5px var(--st-red); }

/* Site : la vue aérienne en grand, puis trois repères. */
.vm__aerial { position: relative; margin: 0; aspect-ratio: 16 / 10; border-radius: 24px; overflow: hidden; background: var(--violet-100); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), var(--shadow-soft); }
.vm__aerial img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vm__aerial-cap {
  position: absolute; left: 12px; bottom: 12px; padding: 5px 12px; border-radius: var(--radius-full); background: var(--lg-fill-thick);
  -webkit-backdrop-filter: blur(12px) saturate(1.6); backdrop-filter: blur(12px) saturate(1.6); font-size: 12px; font-weight: 550; color: var(--fg-secondary);
}
.vm__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.vm__stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 18px; }
.vm__stat-l { font-size: 12px; font-weight: 600; color: var(--fg-tertiary); }
.vm__stat-v { font-size: 16px; line-height: 22px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Historique : la frise, une carte par ligne. */
.vm__tl { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.vm__tl-item { position: relative; display: grid; grid-template-columns: 14px 52px minmax(0, 1fr); column-gap: 10px; align-items: start; }
.vm__tl-item:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 30px; bottom: -14px; width: 2px; border-radius: 1px; background: var(--violet-300); }
.vm__tl-dot { width: 14px; height: 14px; margin-top: 18px; border-radius: 50%; background: var(--st-gray); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85); }
.vm__tl-item--rouge .vm__tl-dot { background: var(--st-red); }
.vm__tl-item--violet .vm__tl-dot { background: var(--violet-700); }
.vm__tl-item--vert .vm__tl-dot { background: var(--st-green); }
.vm__tl-year { margin-top: 14px; font-size: 16px; line-height: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.vm__tl-head { display: flex; align-items: center; gap: 10px; }
.vm__tl-label { flex: 1; min-width: 0; margin: 0; font-size: 15px; line-height: 21px; font-weight: 650; color: var(--ink); }
.vm__tl-detail { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 20px; color: var(--fg-secondary); }
.vm__tl-card > .vm__source { margin-top: 8px; }

/* Listes réécrites sur place : questions, documents, observations, documents joints. */
.vm__rows { display: flex; flex-direction: column; margin: 0; padding: 4px 8px; border-radius: 22px; list-style: none; }
.vm__rows:empty { display: none; }
.vm__row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 8px; border-top: 1px solid var(--stroke-weak); border-radius: 12px; }
.vm__row:first-child { border-top-color: transparent; }
.vm__row.is-new { background: var(--violet-200); }
.vm__row-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: var(--violet-100); color: var(--violet-700); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vm__row-ico { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--violet-100); color: var(--violet-700); }
.vm__row-ico .icon { width: 14px; height: 14px; }
.vm__row-hint { margin: 2px 0 0 6px; font-size: 12.5px; line-height: 17px; color: var(--fg-tertiary); }
.vm__doc-n { flex: none; font-size: 12.5px; line-height: 22px; font-weight: 600; color: var(--violet-700); }
.vm__row--draft { border-top-color: transparent; }
.vm__edit {
  position: relative; display: block; flex: 1; min-width: 0; padding: 1px 6px; border-radius: 8px; outline: none; cursor: text;
  font-size: 14.5px; line-height: 22px; color: var(--fg-primary); overflow-wrap: anywhere;
  transition: background-color var(--dur-fast) var(--ease-in-out), box-shadow var(--dur-fast) var(--ease-in-out);
}
.vm__edit:hover { background: rgba(255, 255, 255, 0.85); }
.vm__edit:focus { background: var(--white); color: var(--ink); box-shadow: 0 0 0 3px var(--violet-ring), inset 0 0 0 1px var(--violet-400); }
/* Ligne écrite ou corrigée par l'ingénieur : filet violet. */
.vm__edit.is-own { padding-left: 12px; color: var(--ink); font-weight: 550; }
.vm__edit.is-own::after { content: ""; position: absolute; left: 3px; top: 4px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--violet-700); }
.vm__edit:empty::before { content: attr(aria-label); color: var(--fg-muted); font-weight: 450; }

/* Échanges : le fil du chat. */
.vm__thread { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vm__msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), var(--shadow-xs); }
.vm__msg--user { align-self: flex-end; background: var(--lg-fill-tint); color: var(--white); box-shadow: var(--lg-drop-tint); }
.vm__msg-who { display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 650; color: var(--fg-tertiary); }
.vm__msg--user .vm__msg-who { color: rgba(255, 255, 255, 0.75); }
.vm__msg-text { margin: 0; font-size: 14px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.vm__wait { gap: 10px; padding-top: 6px; }


/* Procédé (D-62) : le schéma, de haut en bas, une carte par étape reliée à la suivante. */
.vm__ai { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95); font-size: 13px; line-height: 19px; color: var(--fg-secondary); }
.vm__ai .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--violet-700); }
.vflow { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.vflow__step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; padding-bottom: 14px; }
.vflow__step:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; border-radius: 1px; background: linear-gradient(var(--violet-400), var(--violet-200)); }
.vflow__n {
  position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px;
  background: var(--white); color: var(--violet-700); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px var(--violet-300), var(--shadow-xs);
}
.vflow__step--violet .vflow__n { background: linear-gradient(150deg, var(--violet-600), var(--violet-700)); color: var(--white); box-shadow: var(--lg-drop-tint); }
.vflow__step--rouge .vflow__n { background: var(--st-red); color: var(--white); box-shadow: 0 0 0 4px var(--st-red-bg); }
.vflow__card { min-width: 0; padding: 12px 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), var(--shadow-soft); }
.vflow__head { display: flex; align-items: center; gap: 10px; }
.vflow__name { flex: 1; min-width: 0; margin: 0; font-size: 15.5px; line-height: 21px; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
.vflow__hint { margin: 3px 0 0; font-size: 13.5px; line-height: 20px; color: var(--fg-secondary); }
.vflow__machines { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.vflow__machines li { padding: 2px 10px; border-radius: var(--radius-full); background: var(--violet-100); box-shadow: inset 0 0 0 1px var(--violet-200); font-size: 12px; font-weight: 550; color: var(--violet-800); }
.vflow__watch { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 19px; font-weight: 550; }
.vflow__watch .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.vflow__watch--rouge { background: var(--st-red-bg); color: var(--st-red-ink); }
.vflow__watch--violet { background: var(--violet-100); color: var(--violet-800); box-shadow: inset 0 0 0 1px var(--violet-200); }

/* Bibliothèque (D-61) : un document par carte, sa synthèse, la lecture du texte entier. */
.vm__toolbar { display: flex; align-items: center; gap: 16px; }
.vm__toolbar .vm__note { flex: 1; font-size: 13px; line-height: 19px; }
.vm__toolbar .btn { flex: none; }
.vm__doc .vm__retex-meta, .vm__doc > .vm__p, .vm__doc > .vm__facts, .vm__doc > .vm__note, .vm__doc .vm__retex-foot { margin-left: 36px; }
.vm__doc > .vm__p { margin-top: 8px; font-size: 14px; line-height: 21px; }
.vm__doc > .vm__note { margin-top: 8px; }
.vm__doc-points { margin-top: 10px; }
.vm__doc-points .vm__fact { padding: 8px 0; }
.vm__doc-points .vm__fact-label { font-size: 13.5px; font-weight: 500; }

/* Sources (D-63) : le site officiel, puis une ligne par service ou page consultée, avec son lien. */
.vm__web { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.vm__web-line { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 600; }
.vm__icpe { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; line-height: 20px; color: var(--ink); }
.vm__icpe dt { font-size: 12px; font-weight: 600; color: var(--fg-tertiary); }
.vm__icpe dd { margin: 0; overflow-wrap: anywhere; }
.vm__icpe-list { margin: 0; padding: 0; list-style: none; }
.vm__icpe-hint { color: var(--fg-secondary); }
.vm__web-link { color: var(--violet-700); text-decoration: none; }
.vm__web-link:hover { text-decoration: underline; }
.vm__srcs { display: flex; flex-direction: column; margin: 0; padding: 4px 16px; list-style: none; border-radius: 22px; background: rgba(255, 255, 255, 0.62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), var(--shadow-soft); }
.vm__src { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; }
.vm__src + .vm__src { box-shadow: 0 -1px 0 var(--stroke-subtle); }
.vm__src.is-off .vm__src-title { color: var(--fg-tertiary); }
.vm__src-main { flex: 1; min-width: 0; }
.vm__src-title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.vm__src-meta { margin: 1px 0 0; font-size: 12.5px; line-height: 17px; color: var(--fg-tertiary); overflow-wrap: anywhere; }
.vm__src-note { margin: 3px 0 0; font-size: 12.5px; line-height: 17px; font-weight: 550; color: var(--violet-700); }
.vm__src-note.is-off { color: var(--st-red-ink); }
.vm__src-links { flex: none; display: flex; gap: 6px; padding-top: 1px; }
.vm__src-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-full); text-decoration: none; white-space: nowrap;
  background: rgba(255, 255, 255, 0.85); box-shadow: inset 0 0 0 1px var(--violet-200); font-size: 12px; font-weight: 600; color: var(--violet-700);
}
.vm__src-link:hover { background: var(--white); }
.vm__src-link .icon { width: 12px; height: 12px; }
.vd__count { margin-left: 2px; min-width: 18px; padding: 0 5px; border-radius: var(--radius-full); background: var(--violet-100); color: var(--violet-700); font-size: 11.5px; line-height: 18px; font-weight: 650; text-align: center; }
.vd__count[hidden] { display: none; }
@media (max-width: 640px) {
  .vm__src { flex-wrap: wrap; }
  .vm__src-links { width: 100%; padding-left: 36px; }
}
.vread__bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vread__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.vread { display: flex; flex-direction: column; gap: 14px; }
.vread__toc { padding: 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95); }
.vread__toc-head { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--violet-700); }
.vread__jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vread__jump { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 11px; border: 0; border-radius: var(--radius-full); background: var(--white); box-shadow: inset 0 0 0 1px var(--violet-200); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--violet-700); }
.vread__jump:hover { background: var(--violet-100); }
.vread__doc { padding: 22px 26px; border-radius: 22px; background: var(--white); box-shadow: inset 0 0 0 1px var(--stroke-weak), var(--shadow-soft); font-size: 14.5px; line-height: 23px; color: var(--fg-primary); }
.vread__doc > * + * { margin-top: 10px; }
.vread__doc h3 { margin-top: 24px; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.vread__doc h4 { margin-top: 18px; font-size: 15.5px; line-height: 22px; font-weight: 650; color: var(--ink); }
.vread__doc h5 { margin-top: 14px; font-size: 14.5px; font-weight: 650; color: var(--violet-800); }
.vread__doc > h3:first-child, .vread__doc > h4:first-child { margin-top: 0; }
.vread__doc p { margin: 0; overflow-wrap: anywhere; }
.vread__doc :is(ul, ol) { margin: 0; padding-left: 22px; }
.vread__doc ul { list-style: disc; }
.vread__doc ol { list-style: decimal; }
.vread__doc li + li { margin-top: 3px; }
.vread__doc code { font-family: var(--font-mono); font-size: 12.5px; padding: 1px 5px; border-radius: 6px; background: var(--bg-hover); }
.vread__table { overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--stroke-subtle); }
.vread__table table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 19px; }
.vread__table :is(th, td) { padding: 7px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--stroke-weak); }
.vread__table th { border-top: 0; background: var(--violet-100); font-weight: 650; color: var(--ink); }
.vread__image { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--bg-hover); font-size: 12.5px; color: var(--fg-tertiary); }
.vread__image .icon { width: 14px; height: 14px; }

/* Téléphone : la modale devient une feuille qui monte du bas de l'écran. */
@media (max-width: 760px) {
  .vmodal { padding: 0; place-items: end stretch; }
  .vmodal__card { width: 100%; height: 92dvh; border-radius: 28px 28px 0 0; }
  .vmodal__head { gap: 12px; padding: 20px 14px 10px 18px; }
  .vmodal__obj { width: 42px; height: 42px; border-radius: 14px; }
  .vmodal__obj .icon { width: 20px; height: 20px; }
  .vmodal__title { font-size: 22px; }
  .vmodal__nav { padding: 0 16px 10px 18px; }
  .vmodal__body { padding: 14px 16px 28px; }
  :is(.vm__kv, .vm__incident, .vm__retex-meta, .vm__retex-foot), .vm__point > .vm__source, .vm__retex > .vm__p { margin-left: 0; }
  .vm__doc :is(.vm__retex-meta, .vm__p, .vm__facts, .vm__note, .vm__retex-foot) { margin-left: 0; }
  .vm__toolbar { flex-direction: column; align-items: flex-start; }
  .vread__doc { padding: 16px; }
  .vm__incident { flex-wrap: wrap; }
  .vm__pair { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-transparency: reduce) {
  .vmodal__scrim, .vmodal__card, .vm__aerial-cap { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .vmodal__scrim { background: rgba(255, 255, 255, 0.92); }
}

/* ======================================================================================
   Préparation de visite : la feuille A4 portrait (D-58), deux pages au plus
   ====================================================================================== */

/* Page nommée : seules les pages de cet aperçu passent en A4 portrait. La feuille porte ses propres
   marges, pour que les halos aillent jusqu'au bord. */
@page visite { size: A4 portrait; margin: 0; }

.content:has(> .vdoc-wrap) { --content-w: 232mm; padding: 16px 0 48px; }
body.vd-print .backdrop { display: none; }
.vdoc-wrap { display: flex; flex-direction: column; align-items: safe center; gap: 16px; }
.vdoc__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 210mm; max-width: 100%; }
.vdoc__bar-info { font-size: 13px; font-weight: 550; color: var(--fg-tertiary); }
.vdoc { display: flex; flex-direction: column; align-items: center; gap: 18px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Une page à l'échelle : ce que l'on voit est ce qui s'imprime. Le verre ne s'imprime pas : cartes en
   blanc translucide sur les halos de Sherpa, en pied de page. */
.vdoc__page {
  position: relative; box-sizing: border-box; display: flex; flex-direction: column; gap: 4.5mm; width: 210mm; height: 297mm; padding: 11mm 13mm 12mm;
  overflow: hidden; background: var(--white); border-radius: var(--radius-xs); box-shadow: var(--shadow-dialog); color: var(--fg-secondary); font-size: 12.5px; line-height: 1.45;
}
.vdoc__page > * { position: relative; }
.vdoc__page > [hidden] { display: none; }
.vdoc__glow {
  position: absolute; left: -15%; right: -15%; bottom: -22%; height: 52%; pointer-events: none;
  background:
    radial-gradient(38% 52% at 20% 58%, var(--glow-cyan), transparent 70%),
    radial-gradient(34% 50% at 80% 60%, var(--glow-pink), transparent 70%),
    radial-gradient(44% 60% at 56% 72%, var(--glow-violet), transparent 72%),
    radial-gradient(30% 40% at 38% 80%, var(--glow-lilac), transparent 70%);
  opacity: .85;
}
.vdoc__page > .vdoc__glow { position: absolute; }
.vdoc__brand { display: flex; align-items: center; gap: 6px; flex: none; font-size: 10.5px; font-weight: 550; color: var(--fg-tertiary); }
.vdoc__brand img { width: 16px; height: 16px; }
.vdoc__brand b { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.vdoc__brand-end { margin-left: auto; font-variant-numeric: tabular-nums; }
.vdoc__head { flex: none; }
.vdoc__title { margin: 0; font-size: 27px; line-height: 1.1; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); }
.vdoc__lead { margin: 3px 0 0; font-size: 12.5px; color: var(--fg-tertiary); }
.vdoc__h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2.5mm; padding-bottom: 1.5mm; border-bottom: 1.5px solid var(--violet-300); font-size: 14px; line-height: 1.3; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.vdoc__count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--fg-tertiary); }
.vdoc__muted { margin: 0; color: var(--fg-tertiary); }
.vdoc .chip { min-height: 18px; padding: 0 7px; font-size: 10.5px; font-weight: 600; line-height: 18px; }
.vdoc .vnum { width: 19px; height: 19px; font-size: 10.5px; }

/* Page 1 : la vue aérienne et les faits du site, côte à côte. */
.vdoc__site { display: grid; grid-template-columns: 76mm minmax(0, 1fr); gap: 5mm; flex: none; }
.vdoc__aerial-box { display: flex; flex-direction: column; gap: 1.5mm; min-width: 0; }
.vdoc__legend { font-size: 9.5px; line-height: 1.35; gap: 1mm 1.5mm; }
.vdoc__aerial { margin: 0; height: 64mm; border-radius: 4mm; overflow: hidden; background: var(--violet-100); box-shadow: inset 0 0 0 1px var(--stroke-weak); }
.vdoc__aerial img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vdoc__site--text { grid-template-columns: minmax(0, 1fr); }
.vdoc__site--text .vdoc__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vdoc__facts { display: flex; flex-direction: column; gap: 2.5mm; min-width: 0; }
.vdoc__fact { padding: 2.5mm 3.5mm; border-radius: 3.5mm; background: rgba(255, 255, 255, 0.7); box-shadow: inset 0 0 0 1px var(--stroke-weak); }
.vdoc__fact h3 { margin: 0 0 1mm; font-size: 11px; font-weight: 700; letter-spacing: .01em; color: var(--violet-700); }
.vdoc__alert { margin: 0; font-size: 12px; line-height: 21px; color: var(--ink); }
.vdoc__alert .chip { margin-right: 2px; vertical-align: 1px; }
.vdoc__quiet { margin: 1mm 0 0; font-size: 10.5px; line-height: 1.4; color: var(--fg-tertiary); }
.vdoc__key { margin: 0 0 1mm; font-size: 12px; color: var(--fg-secondary); }
.vdoc__key b { font-size: 17px; font-weight: 700; color: var(--violet-700); font-variant-numeric: tabular-nums; }
.vdoc__own { margin: 1mm 0 0; padding-left: 4mm; font-size: 11px; color: var(--ink); }
.vdoc__dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5mm 3mm; margin: 0; font-size: 12px; }
.vdoc__dl dt { color: var(--fg-tertiary); }
.vdoc__dl dd { margin: 0; font-weight: 600; color: var(--ink); }

/* À vérifier : chaque point en entier. */
.vdoc__block { flex: none; min-width: 0; }
.vdoc__points { display: flex; flex-direction: column; gap: 2.6mm; margin: 0; padding: 0; list-style: none; }
.vdoc__point { padding: 2.8mm 3.5mm 3mm; border-radius: 3.5mm; background: rgba(255, 255, 255, 0.72); box-shadow: inset 0 0 0 1px var(--stroke-weak); break-inside: avoid; }
.vdoc__point-head { display: flex; align-items: center; gap: 2.5mm; }
.vdoc__point-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; line-height: 1.3; font-weight: 650; color: var(--ink); }
.vdoc__kv { display: grid; grid-template-columns: 17mm minmax(0, 1fr); gap: 0.6mm 2.5mm; margin: 1.5mm 0 0 7.5mm; font-size: 12px; line-height: 1.4; }
.vdoc__kv dt { font-size: 10.5px; font-weight: 650; line-height: 1.6; color: var(--violet-700); }
.vdoc__kv dd { margin: 0; color: var(--fg-secondary); }

/* Page 2 : deux colonnes, puis les notes. */
.vdoc__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm 7mm; align-items: start; flex: none; }
.vdoc__col { display: flex; flex-direction: column; gap: 5mm; min-width: 0; }
.vdoc__questions { margin: 0; padding-left: 5mm; list-style: decimal; font-size: 12px; line-height: 1.45; color: var(--ink); }
.vdoc__questions li { padding-left: 1mm; margin-bottom: 1.2mm; }
.vdoc__questions li::marker { font-weight: 700; color: var(--violet-700); font-variant-numeric: tabular-nums; }
.vdoc__docs { margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.45; }
.vdoc__docs li { position: relative; padding-left: 4mm; margin-bottom: 1.2mm; color: var(--fg-tertiary); }
.vdoc__docs li::before { content: ""; position: absolute; left: 0.5mm; top: 2mm; width: 4px; height: 4px; border-radius: 50%; background: var(--violet-500); }
.vdoc__docs b { font-weight: 600; color: var(--ink); }
.vdoc__history { margin: 0; padding: 0; list-style: none; }
.vdoc__hist { display: grid; grid-template-columns: 11mm minmax(0, 1fr); gap: 2mm; margin-bottom: 2mm; font-size: 12px; }
.vdoc__hist-year { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.vdoc__hist-head { display: flex; align-items: center; gap: 2mm; margin: 0; color: var(--ink); }
.vdoc__hist-head b { font-weight: 600; }
.vdoc__hist-detail { margin: 0.5mm 0 0; font-size: 11px; line-height: 1.4; color: var(--fg-tertiary); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.vdoc__retex { display: flex; flex-direction: column; gap: 2.2mm; margin: 0; padding: 0; list-style: none; }
.vdoc__retex li { display: flex; gap: 2.5mm; }
.vdoc__retex-title { margin: 0; font-size: 12px; line-height: 1.35; font-weight: 650; color: var(--ink); }
.vdoc__retex-meta { margin: 0.3mm 0 0; font-size: 10.5px; color: var(--fg-tertiary); }
.vdoc__retex-sum { margin: 0.6mm 0 0; font-size: 11px; line-height: 1.4; color: var(--fg-secondary); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.vdoc__more { margin: 0.5mm 0 0; font-size: 10.5px; font-weight: 600; color: var(--violet-700); }
.vdoc__sources { flex: none; margin: auto 0 0; padding-top: 2mm; font-size: 9.5px; line-height: 1.4; color: var(--fg-tertiary); }


/* Procédé (D-62) : la chaîne de gauche à droite, une case par étape ; le point d'attention dessous. */
.vdoc__process .vdoc__count { font-weight: 500; }
/* Quatre étapes par rangée (huit au plus) : le trait vers l'étape suivante ne sort jamais du cadre. */
.vdoc__chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2mm 4mm; margin: 0; padding: 0; list-style: none; }
.vdoc__step:nth-child(4n)::after { display: none; }
.vdoc__step { position: relative; padding: 2mm 2.5mm; border-radius: 3mm; background: rgba(255, 255, 255, 0.75); box-shadow: inset 0 0 0 1px var(--stroke-weak); font-size: 10.5px; line-height: 1.35; }
.vdoc__step::after { content: ""; position: absolute; left: 100%; top: 4.5mm; width: 4mm; height: 1.5px; background: var(--violet-300); }
.vdoc__step:last-child::after { display: none; }
.vdoc__step--violet { box-shadow: inset 0 0 0 1px var(--violet-400); }
.vdoc__step--rouge { box-shadow: inset 0 0 0 1.5px var(--st-red); }
.vdoc__step-head { margin: 0; font-size: 11.5px; color: var(--ink); }
.vdoc__step-machines { margin: 0.6mm 0 0; color: var(--fg-tertiary); }
.vdoc__step-watch { margin: 1mm 0 0; font-weight: 600; color: var(--violet-800); }
.vdoc__step--rouge .vdoc__step-watch { color: var(--st-red-ink); }

/* Resserrage, par étapes, d'une page qui déborde (js/views/visite-print.js, fitPages). */
.vdoc.p1-compact .vdoc__aerial { height: 50mm; }
.vdoc.p1-compact [data-page="1"] { gap: 3.5mm; }
.vdoc.p1-small [data-page="1"] .vdoc__point-head h3 { font-size: 12.5px; }
.vdoc.p1-small [data-page="1"] .vdoc__kv { font-size: 11px; }
.vdoc.p1-small [data-page="1"] .vdoc__points { gap: 1.8mm; }
.vdoc.p2-short :is(.vdoc__retex-sum, .vdoc__hist-detail) { -webkit-line-clamp: 2; }
.vdoc.p2-compact :is(.vdoc__retex-sum, .vdoc__hist-detail) { -webkit-line-clamp: 1; }
.vdoc.p2-compact [data-page="2"] { gap: 3.5mm; }
.vdoc.p2-small [data-page="2"] :is(.vdoc__questions, .vdoc__docs, .vdoc__hist) { font-size: 11px; }

@media print {
  body.vd-print :is(.nav, .toasts, .reveal-banner, .vmodal), .vdoc__bar { display: none !important; }
  .content:has(> .vdoc-wrap) { width: auto; min-height: 0; padding: 0; }
  /* Tout le document est sur la page nommée : sans changement de nom de page, aucune page blanche
     (format par défaut) ne s'insère avant la feuille. */
  body.vd-print { page: visite; }
  .vdoc-wrap, .vdoc { display: block; }
  .vdoc__page { page: visite; border-radius: 0; box-shadow: none; break-after: page; }
  .vdoc__page:last-child { break-after: auto; }
  html:has(> body.vd-print), body.vd-print { background: var(--white); }
}

@media print { .lune { display: none; } }
