
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-var.woff2') format('woff2-variations');
  font-weight: 100 800; font-display: swap;
}

:root {
  --ink: #10213a; --ink-2: #44506a; --ink-3: #5c6578; --ink-hover: #1d3557;
  --paper: #edede8; --paper-2: #e3e3dc; --sheet: #f6f6f2; --rule: #cfcfc5; --rule-2: #b9b9ad;
  --station: #ffffff; --on-ink: #dfe5ef; --on-ink-2: #a9bad6;
  --l-info: #f2b705; --l-heb: #e5620b; --l-sav: #6ba539; --l-con: #1c9c9a; --l-pve: #1f5fbf;
  --l-info-ink: #7a5c00; --l-heb-ink: #a8430a; --l-sav-ink: #3f6e1c; --l-con-ink: #0f6e6c;
  --ok-bg: #e1edd5; --ok-text: #2f5714; --wait-bg: #fbefc8; --wait-text: #6d5200;
  --bad-bg: #f6ded3; --bad-text: #8a3309;
  --sans: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --line: var(--ink); --line-ink: var(--ink);
  --gutter: 1.1rem; --max: 76rem;
  --step--1: 0.8125rem; --step-0: 1.0625rem;
}
@media (min-width: 640px) { :root { --gutter: 1.75rem; } }
@media (min-width: 1000px) { :root { --gutter: 2.5rem; } }

[data-line='trafic'] { --line: var(--l-heb); --line-ink: var(--l-heb-ink); }
[data-line='sauvegarde'] { --line: var(--l-sav); --line-ink: var(--l-sav-ink); }
[data-line='attente'] { --line: var(--l-info); --line-ink: var(--l-info-ink); }
[data-line='preview'] { --line: var(--l-con); --line-ink: var(--l-con-ink); }
[data-line='encre'] { --line: var(--ink); --line-ink: var(--ink); }
[data-line='alerte'] { --line: var(--l-heb-ink); --line-ink: var(--l-heb-ink); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans); font-feature-settings: 'lnum';
}
:focus-visible { outline: 3px solid var(--l-pve); outline-offset: 3px; border-radius: 3px; }
a { color: var(--ink); text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--line); }
::selection { background: var(--l-info); color: var(--ink); }

h1, h2, h3 { margin: 0; font-weight: 720; line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); font-weight: 780; font-stretch: 112%; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-stretch: 110%; }
h3 { font-size: 1.25rem; font-weight: 680; font-stretch: 104%; line-height: 1.25; }
p { margin: 0 0 1rem; max-width: 68ch; }
.lede { font-size: 1.25rem; line-height: 1.55; color: var(--ink-2); max-width: 46rem; }
.small { font-size: var(--step--1); color: var(--ink-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.88em; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: 1rem; }
section { padding-block: clamp(2rem, 4vw, 3.2rem); }
section + section { border-top: 1px solid var(--rule); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.25rem; }
.section-head h2 { max-width: 46rem; }

/* En-tête : chaque rubrique précédée d'un tiret de sa couleur. */
header.top {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--paper) 90%, transparent); border-bottom: 1px solid var(--rule);
}
header.top .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 3.5rem; flex-wrap: wrap; }
.brand { font-weight: 780; font-stretch: 112%; font-size: 1.3rem; letter-spacing: -0.03em; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand::before { content: ''; width: 1.1rem; height: 4px; border-radius: 999px; background: var(--l-heb); }
nav.top { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-left: auto; }
nav.top a {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.6rem; border-radius: 8px;
  font-weight: 560; font-size: 0.9375rem; color: var(--ink-2); text-decoration: none;
}
nav.top a::before { content: ''; width: 0.8rem; height: 4px; border-radius: 999px; background: var(--dash, var(--rule-2)); }
nav.top a:hover { background: var(--sheet); color: var(--ink); }
nav.top a[aria-current='page'] { background: var(--sheet); color: var(--ink); box-shadow: inset 0 -3px 0 var(--line); }

/* Fil d'Ariane : stations reliées par un segment de la couleur de la page. */
.ariane { display: flex; align-items: center; gap: 0.5rem; font-size: var(--step--1); color: var(--ink-2); padding-top: 1.2rem; }
.ariane a { text-decoration: none; }
.ariane .st { width: 0.8rem; height: 0.8rem; border-radius: 999px; background: var(--station); border: 2px solid var(--ink); flex: none; }
.ariane .seg { width: 1.4rem; height: 3px; border-radius: 999px; background: var(--line); }

/* Boutons : pilules d'encre. */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.1rem; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--sheet);
  font: 650 0.875rem/1.2 var(--sans); font-stretch: 104%; cursor: pointer; text-decoration: none; transition: transform .16s ease-out, background .16s ease-out;
}
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--sheet); border-color: var(--ink); }
.btn--small { padding: 0.35rem 0.7rem; font-size: 0.8125rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* Pastilles d'état. */
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem; border-radius: 999px; font: 600 0.75rem/1.5 var(--sans); white-space: nowrap; }
.chip--ok { background: var(--ok-bg); color: var(--ok-text); }
.chip--wait { background: var(--wait-bg); color: var(--wait-text); }
.chip--bad { background: var(--bad-bg); color: var(--bad-text); }
.chip--neutre { background: var(--paper-2); color: var(--ink-2); }

/* Surfaces. */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 1.2rem 1.3rem; }
.vitrine {
  background: var(--sheet) radial-gradient(circle, var(--rule-2) 1.1px, transparent 1.3px) 0 0 / 20px 20px;
  border: 1px solid var(--rule); border-radius: 14px; padding: 1rem; overflow: auto;
  box-shadow: 0 1px 1px rgba(16,33,58,.05), 0 24px 48px -28px rgba(16,33,58,.35);
}

/* Tableaux de données. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; font-size: 0.9375rem; }
th { text-align: left; background: var(--paper-2); color: var(--ink-2); font: 650 0.875rem/1.4 var(--sans); padding: 0.6rem 0.9rem; }
td { padding: 0.65rem 0.9rem; border-top: 1px solid var(--rule); vertical-align: middle; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr:hover td { background: color-mix(in srgb, var(--paper-2) 45%, transparent); }

/* Ligne de temps des versions : le trait de la rubrique, une station par version datée. */
.ligne { --gouttiere: 1.6rem; --st: 1.05rem; --rang: 1.6em; --trunk: var(--line); list-style: none; margin: 0; padding: 0; }
/* Ligne de métro verticale : une gouttière fixe, la station centrée sur la première ligne de texte,
   et le trait tracé d'une station à la suivante (jamais au-delà de la première ni de la dernière). */
.ligne > li { position: relative; display: grid; grid-template-columns: var(--gouttiere) minmax(0, 1fr); column-gap: 0.85rem; padding-bottom: 1.15rem; }
.ligne > li > * { grid-column: 2; min-width: 0; }
.ligne > li::before {
  content: ''; grid-column: 1; grid-row: 1; justify-self: center; position: relative; z-index: 1;
  width: var(--st); height: var(--st); margin-top: calc((var(--rang) - var(--st)) / 2);
  border-radius: 999px; background: var(--station); border: 3px solid var(--ink);
}
.ligne > li::after {
  content: ''; position: absolute; left: calc(var(--gouttiere) / 2 - 3px); top: calc(var(--rang) / 2); height: 100%;
  width: 6px; background: var(--trunk);
}
.ligne > li:last-child { padding-bottom: 0; }
.ligne > li:last-child::after { display: none; }
.ligne > li[data-etat='echec']::before { border-color: var(--l-heb-ink); }
.ligne > li[data-etat='attente']::before { border-color: var(--l-info); }
.ligne > li[data-etat='passe']::before { border-color: var(--rule-2); }
.ligne__actions { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; margin-top: 0.35rem; }
.ligne__actions form { margin: 0; }
.ligne .quand { font-size: var(--step--1); color: var(--ink-3); font-family: var(--mono); }

/* Journal : fond encre, mots-clés en jaune, comme le journal des actions du site. */
.journal {
  background: var(--ink); color: var(--on-ink); border-radius: 10px; padding: 0.9rem 1rem;
  font: 400 0.8125rem/1.5 var(--mono); max-height: 28rem; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.journal b { color: var(--l-info); font-weight: 400; }
.journal .err { color: #ffb4a0; }
.journal .ok { color: #bfe49a; }
.journal:empty::after { content: 'En attente du constructeur…'; color: var(--on-ink-2); }

/* Grille des pages projet : schéma à gauche, état à droite. */
.deux { display: grid; gap: 1.5rem; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .deux { grid-template-columns: minmax(0, 7fr) minmax(16rem, 3fr); } }

dl.faits { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; font-size: 0.9375rem; }
dl.faits dt { color: var(--ink-3); }
dl.faits dd { margin: 0; font-weight: 560; overflow-wrap: anywhere; }

.copie { display: flex; gap: 0.5rem; align-items: stretch; }
.copie code {
  flex: 1; background: var(--ink); color: var(--on-ink); border-radius: 8px; padding: 0.7rem 0.85rem;
  font: 400 0.8125rem/1.5 var(--mono); overflow-x: auto; white-space: pre;
}
.copie button { white-space: nowrap; }

.vide { border: 1px dashed var(--rule-2); border-radius: 10px; padding: 1.4rem; color: var(--ink-2); background: transparent; }
.vide p:last-child { margin-bottom: 0; }

form.connexion { max-width: 24rem; }
input[type='password'], input[type='text'], input[type='email'], textarea, select {
  width: 100%; padding: 0.6rem 0.75rem; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--station); font: 400 1rem/1.4 var(--sans); color: var(--ink);
}
textarea { font-family: var(--mono); font-size: 0.85rem; min-height: 16rem; }
label { display: block; font: 650 0.875rem/1.4 var(--sans); margin-bottom: 0.35rem; }

footer.bas { background: var(--ink); color: var(--on-ink-2); margin-top: 3rem; padding-block: 2rem; font-size: var(--step--1); }
footer.bas a { color: var(--on-ink); }
footer.bas .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }

/* Catalogue des briques : l'extrait YAML se lit comme du code, sans déborder. */
table.catalogue td { vertical-align: top; }
table.catalogue td:first-child { max-width: 30rem; }
table.catalogue .small { margin-top: 0.2rem; }
pre.extrait { margin: 0; font: 400 0.78rem/1.45 var(--mono); color: var(--ink); background: var(--paper-2); border-radius: 6px; padding: 0.45rem 0.6rem; white-space: pre; overflow-x: auto; max-width: 22rem; }
ul.contrat { margin: 0; padding-left: 1.1rem; max-width: 68ch; }
ul.contrat li + li { margin-top: 0.45rem; }

/* Le schéma d'architecture : seule vitrine de la page projet. */
.schema { margin: 0; container-type: inline-size; display: grid; gap: 0.7rem; }
.schema figcaption { max-width: 52ch; }

/* Les petits traits pleins sont des données : une barre par minute, en orange si des erreurs. */
.barres { display: flex; align-items: flex-end; gap: 2px; height: 40px; padding: 2px 0; }
.barres i { display: block; width: 4px; border-radius: 999px; background: var(--l-heb); opacity: .75; }
.barres i.err { background: var(--l-heb-ink); opacity: 1; }

/* Une alerte est une surface, précédée du tiret de sa ligne — jamais une bordure latérale épaisse. */
.alerte {
  display: flex; gap: 0.7rem; align-items: baseline;
  background: var(--wait-bg); color: var(--wait-text);
  border: 1px solid color-mix(in srgb, var(--l-info) 40%, var(--wait-bg));
  padding: 0.8rem 1rem; border-radius: 10px;
}
.alerte::before { content: ''; flex: none; width: 1rem; height: 4px; border-radius: 999px; background: var(--l-info); transform: translateY(-0.25em); }
.alerte--err { background: var(--bad-bg); color: var(--bad-text); border-color: color-mix(in srgb, var(--l-heb) 40%, var(--bad-bg)); }
.alerte--err::before { background: var(--l-heb-ink); }
.alerte a { color: inherit; }


/* ---- Projet : sélecteurs communs, onglets ---- */
.projet-tete { align-items: flex-end; margin-bottom: 0.6rem; }
.selecteurs { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--sheet); }
.seg__b { padding: 0.3rem 0.8rem; font: 600 0.8125rem/1.4 var(--sans); text-decoration: none; color: var(--ink); white-space: nowrap; }
.seg__b + .seg__b { border-left: 1px solid var(--rule-2); }
.seg__b:hover:not([aria-current]) { background: var(--paper-2); }
.seg__b[aria-current] { background: var(--ink); color: var(--sheet); }
.onglets { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--rule); margin: 0.2rem 0 1.4rem; overflow-x: auto; }
.onglets a { position: relative; padding: 0.55rem 0; text-decoration: none; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.onglets a:hover { color: var(--ink); }
.onglets a[aria-current] { color: var(--ink); }
.onglets a[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; border-radius: 999px; background: var(--line); }

/* ---- Plan en attente ---- */
.plan-attente { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem;
  padding: 0.75rem 1rem; border: 1.5px dashed var(--l-info-ink); border-radius: 10px; background: var(--wait-bg); color: var(--wait-text); margin-bottom: 1.2rem; }
.plan-attente p { margin: 0; }
.plan-attente strong { color: var(--ink); }
.plan-attente__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.plan-attente__actions form { margin: 0; }

/* ---- Panneau latéral d'une brique ou d'un moment ---- */
.panneau { transition: opacity .15s ease-out; }
.panneau--charge { opacity: .55; }
@media (min-width: 60rem) { .vue .panneau { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding-right: 0.2rem; } }
.panneau__tete { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; }
.panneau__tete h2 { font-size: 1.5rem; outline: none; }
.panneau__tete p { margin: 0.2rem 0 0; }
.panneau__s { border-top: 1px solid var(--rule); padding: 0.9rem 0 0; margin: 1rem 0 0; }
.panneau__s h3 { font-size: 1rem; margin-bottom: 0.55rem; }
.panneau__s p:last-child { margin-bottom: 0; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.liste > li { display: grid; gap: 0.1rem; }
.liste--serree { gap: 0.25rem; }
.liste__t { font-weight: 600; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; line-height: 1.35; }
.liste form { margin: 0.25rem 0 0; }
.liste details { margin-top: 0.2rem; }
.journal--panneau { max-height: 16rem; overflow: auto; font-size: 0.75rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin: 0 0 0.5rem; }
.graphique { margin: 0.7rem 0 0; }
.graphique svg { width: 100%; height: 64px; display: block; }
.g__r { fill: var(--l-heb); opacity: .7; }
.g__e { fill: var(--l-heb-ink); }
.g__base { stroke: var(--rule-2); stroke-width: 1; }
.graphique figcaption { display: flex; justify-content: space-between; gap: 0.5rem; font-family: var(--mono); font-size: 0.72rem; margin-top: 0.2rem; }

/* ---- Bande de la ligne de temps : une ligne de métro, une station par moment ---- */
.bande { padding: 0.4rem 0.9rem 0.2rem; }
.bande__stations { position: relative; list-style: none; margin: 0; padding: 0; height: 2.2rem; }
.bande__stations::before { content: ''; position: absolute; left: -0.9rem; right: -0.9rem; top: 50%; height: 6px; margin-top: -3px; border-radius: 999px; background: var(--ink); }
.bande__stations li { position: absolute; left: var(--x); top: 50%; transform: translate(-50%, -50%); line-height: 0; }
.station { box-sizing: border-box; width: 1.15rem; height: 1.15rem; padding: 0; border-radius: 999px; background: var(--station); border: 3px solid var(--line);
  cursor: pointer; display: inline-grid; place-items: center; transition: transform .15s ease-out, box-shadow .15s ease-out; }
.station--groupe { width: auto; min-width: 1.6rem; height: 1.6rem; padding: 0 0.3rem; border-color: var(--ink); background: var(--station); }
.station--groupe.station--alerte { border-color: var(--l-heb-ink); }
.station--groupe.station--alerte span { color: var(--l-heb-ink); }
.station:hover { transform: scale(1.15); }
.station:focus-visible { outline-offset: 4px; }
.station[data-line='alerte'] { background: var(--line); }
.station[data-grave='error'] { background: var(--l-heb-ink); border-color: var(--l-heb-ink); }
.station[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--ink); }
.station span { font: 700 0.68rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.station[data-grave='error'] span, .station[data-line='alerte'] span { color: var(--station); }
.bande__reperes { position: relative; list-style: none; margin: 0.15rem 0 0; padding: 0; height: 1.5rem; font: 0.72rem/1 var(--mono); color: var(--ink-3); }
.bande__reperes li { position: absolute; left: var(--x); top: 0; transform: translateX(-50%); white-space: nowrap; padding-top: 0.55rem; }
.bande__reperes li::before { content: ''; position: absolute; left: 50%; top: 0; width: 2px; height: 0.4rem; margin-left: -1px; border-radius: 1px; background: var(--ink-3); opacity: .55; }
.bande__legende { display: flex; gap: 0.4rem 1.1rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0.9rem 0 0; }
.bande__legende li { display: inline-flex; align-items: center; gap: 0.4rem; }
.bande__legende li::before { content: ''; width: 0.75rem; height: 0.75rem; border-radius: 999px; border: 3px solid var(--line); background: var(--station); }
.bande__legende li[data-line='alerte']::before { background: var(--line); }
.bande__vide { margin: 0.9rem 0 0; }


/* ---- Activité : un fil, une station par moment, couleur de ligne par famille ---- */
.filtres { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; margin: 0 0 1.6rem; }
.filtres > div { display: grid; gap: 0.25rem; }
.filtres select { min-width: 12rem; }
.fil__jour { font-size: 1.15rem; margin: 1.6rem 0 0.8rem; }
.fil > li::before { border-color: var(--line); }
.fil > li[data-line='alerte']::before { background: var(--line); }
/* Une erreur se lit en couleur d'alerte, quelle que soit sa famille : jamais une station pleine verte. */
.fil > li[data-grave='error']::before { background: var(--l-heb-ink); border-color: var(--l-heb-ink); }
.fil__tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.6rem; line-height: var(--rang); }
.fil__tete .quand { flex: none; }
.fil__meta { display: flex; flex-wrap: wrap; gap: 0.1rem 0.45rem; align-items: baseline; color: var(--ink-3); }
.fil__meta > * + *::before { content: '·'; margin-right: 0.45rem; color: var(--rule-2); }
.fil__famille { color: var(--line-ink); font-weight: 600; }
.fil__actions { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: baseline; margin-top: 0.3rem; }
.fil__actions details { flex-basis: 100%; }
.fil__actions details > summary { cursor: pointer; font-size: var(--step--1); }
.fil__impact[open] { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 0.7rem 0.9rem; }
.impact table { font-size: var(--step--1); }


/* ---- Observer : graphiques sur la plage, mises en ligne marquées ---- */
.seg--services { margin: 0 0 1.2rem; flex-wrap: wrap; }
.obs__titre { font-size: 1.35rem; margin: 2rem 0 0.4rem; }
.obs__grille { display: grid; gap: 1rem; margin-top: 0.8rem; }
@media (min-width: 60rem) { .obs__grille { grid-template-columns: repeat(3, minmax(0, 1fr)); } .obs__grille--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.courbe { margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 0.8rem 0.9rem 0.6rem; min-width: 0; }
.courbe figcaption { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; margin-bottom: 0.3rem; }
.courbe svg { width: 100%; height: auto; display: block; overflow: visible; }
.courbe__vide { margin: 1.4rem 0; }
.c__g { stroke: var(--rule); stroke-width: 1; }
.c__y, .c__x { font: 10.5px var(--mono); fill: var(--ink-3); }
.c__m line { stroke: var(--ink-3); stroke-width: 1.25; stroke-dasharray: 3 3; }
.c__m text { font: 600 10.5px var(--sans); fill: var(--ink-2); }
.c__m--alerte line { stroke: var(--l-heb-ink); stroke-dasharray: none; stroke-width: 1.75; }
.c__m--alerte text { fill: var(--l-heb-ink); }
.c__p { stroke: var(--ink-2); stroke-width: 1.25; stroke-dasharray: 6 4; }
.c__legende { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; list-style: none; margin: 0.4rem 0 0; padding: 0; }
.c__legende li { display: inline-flex; align-items: center; gap: 0.35rem; }
.c__legende li::before { content: ''; width: 0.9rem; height: 3px; border-radius: 999px; background: var(--c); }
.obs__chiffre { font: 780 2.4rem/1 var(--sans); font-stretch: 110%; letter-spacing: -0.02em; margin: 0; font-variant-numeric: tabular-nums; }
.obs__erreurs details summary { cursor: pointer; }
.obs__erreurs td:first-child { max-width: 34rem; }
.journal--obs { max-height: 26rem; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; }
.filtres__large { flex: 1 1 22rem; }
.filtres__large input { width: 100%; }
.obs__promql { margin-top: 1.6rem; }
.obs__promql > summary { cursor: pointer; font-weight: 600; }


/* ---- Réglages ---- */
.copie--ligne { display: inline-flex; gap: 0.3rem; align-items: center; vertical-align: middle; max-width: 100%; }
.copie--ligne code { font-size: 0.78rem; padding: 0.15rem 0.45rem; overflow-x: auto; white-space: nowrap; max-width: 22rem; }
.dns > li { gap: 0.25rem; }
.reglages td { vertical-align: top; }


/* ---- Données ---- */
.base h3 { font-size: 1.15rem; }
.base .section-head p { margin: 0.2rem 0 0; }
.base form { margin: 0; }


/* ---- Compte : budget ---- */
.budget { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin: 0.35rem 0 0.2rem; min-width: 8rem; }
.budget__barre { display: block; height: 100%; width: var(--part); border-radius: 999px; background: var(--l-sav); }
.budget__barre--wait { background: var(--l-info); }
.budget__barre--bad { background: var(--l-heb-ink); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}


.sch { display: block; max-width: 100%; height: auto; margin-inline: auto; overflow: visible; }
.sch--etroit { display: none; }
@container (max-width: 37.5rem) { .sch--large { display: none; } .sch--etroit { display: block; } }
.sch__zone { fill: color-mix(in srgb, var(--l-heb) 5%, transparent); stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 5; }
.sch__tag { font: 650 13px var(--sans); fill: var(--ink-2); }
.sch__l { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sch__l--req { stroke: var(--l-heb); stroke-width: 3.5; }
.sch__l--sav { stroke: var(--l-sav); stroke-width: 3.5; }
.sch__l--test { stroke: var(--l-sav); stroke-width: 2.5; stroke-dasharray: 1 6; }
.sch__l--int { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 6 5; }
.fl--req { fill: var(--l-heb); }
.fl--sav { fill: var(--l-sav); }
.sch__lb rect { fill: var(--station); stroke: var(--l-heb); stroke-width: 1.5; }
.sch__lb text { font: 600 12px var(--sans); fill: var(--l-heb-ink); }
.sch__lb--sav rect, .sch__lb--test rect { stroke: var(--l-sav); }
.sch__lb--sav text, .sch__lb--test text { fill: var(--l-sav-ink); }
.cs__f { fill: var(--station); stroke: var(--ink); stroke-width: 2.25; transition: fill .15s ease-out, stroke-width .15s ease-out; }
.cs[data-brique] { cursor: pointer; outline: none; }
.cs[data-brique]:hover .cs__f { fill: var(--sheet); stroke-width: 3; }
.cs__focus { fill: none; stroke: var(--l-pve); stroke-width: 3; opacity: 0; }
.cs[data-brique]:focus-visible .cs__focus { opacity: 1; }
.cs[aria-pressed='true'] .cs__f { fill: var(--sheet); stroke: var(--line); stroke-width: 3.5; }
.cs[aria-pressed='true'] .cs__an { stroke-width: 3; }
.cs--p .cs__f { stroke: var(--ink-3); stroke-dasharray: 5 4; }
.cs--delete .cs__f { stroke: var(--ink-3); stroke-dasharray: 5 4; opacity: .75; }
.cs--create .cs__f { stroke: var(--l-sav-ink); }
.cs--update .cs__f, .cs--replace .cs__f { stroke: var(--l-info-ink); }
.cs__an { stroke-width: 2; }
.cs__an--heb { fill: color-mix(in srgb, var(--l-heb) 13%, var(--station)); stroke: var(--l-heb); }
.cs__an--sav { fill: color-mix(in srgb, var(--l-sav) 15%, var(--station)); stroke: var(--l-sav); }
.cs__an--con { fill: color-mix(in srgb, var(--l-con) 13%, var(--station)); stroke: var(--l-con); }
.cs__an--ink { fill: var(--sheet); stroke: var(--ink); }
.cs__an--ink3 { fill: var(--sheet); stroke: var(--ink-3); }
.cs__ic { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cs__t { font: 680 14px var(--sans); font-stretch: 104%; fill: var(--ink); }
.cs__s { font: 450 12.5px var(--sans); fill: var(--ink-2); }
.cs__p { font: 450 12px var(--mono); fill: var(--ink-3); }
.cs__e { font: 600 12.5px var(--sans); fill: var(--ink-2); }
.cs__e--ok { fill: var(--l-sav-ink); }
.cs__e--attente { fill: var(--l-info-ink); }
.cs__e--erreur { fill: var(--l-heb-ink); }
.cs__filet { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 3; }
.cs__act rect { fill: var(--station); stroke-width: 1.5; }
.cs__act text { font: 600 12px var(--sans); }
.cs__act--create rect { stroke: var(--l-sav); } .cs__act--create text { fill: var(--l-sav-ink); }
.cs__act--update rect, .cs__act--replace rect { stroke: var(--l-info); }
.cs__act--update text, .cs__act--replace text { fill: var(--l-info-ink); }
.cs__act--delete rect { stroke: var(--ink-3); stroke-dasharray: 4 3; } .cs__act--delete text { fill: var(--ink-2); }

/* Survol ou focus : la brique, ses liens et ses voisines ressortent ; le reste s'atténue (sans flou). */
.sch .cs, .sch__l, .sch__lb, .sch__flux { transition: opacity .15s ease-out; }
.sch--trace .cs:not(.est-proche), .sch--trace .sch__l:not(.est-proche),
.sch--trace .sch__lb:not(.est-proche), .sch--trace .sch__flux:not(.est-proche) { opacity: .28; }
.sch--trace .sch__l.est-proche { stroke-width: 4.5; }
.sch--trace .sch__lb.est-proche rect { stroke-width: 2.25; }
.sch--trace .sch__lb.est-proche text { font-weight: 720; }
.sch__hit { fill: none; stroke: transparent; stroke-width: 16; stroke-linecap: round; pointer-events: stroke; }
.sch__lb { cursor: default; }

/* Le moment signature : le trafic réel avance sur le chemin des requêtes, à la vitesse du débit. */
.sch__flux { fill: none; stroke: var(--station); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1 12; pointer-events: none;
  animation: sch-flux 1.6s linear infinite; }
@keyframes sch-flux { to { stroke-dashoffset: -13; } }
@media (prefers-reduced-motion: reduce) { .sch__flux { animation: none; } }

/* Info-bulle d'un lien : sobre, encre et papier. */
.schema { position: relative; }
.sch-bulle { position: absolute; z-index: 5; pointer-events: none; max-width: 17rem; padding: 0.45rem 0.65rem; border-radius: 8px;
  background: var(--ink); color: var(--on-ink); font: 450 0.78rem/1.4 var(--sans); box-shadow: 0 8px 20px -10px rgba(16,33,58,.5); }
.sch-bulle b { display: block; font-weight: 680; color: var(--station); }
.sch-bulle .mono { display: block; color: var(--on-ink); }

/* Grand schéma : glisser pour se déplacer, + et − pour zoomer, « Ajuster » pour tout revoir. */
.sch-zoom { position: absolute; z-index: 4; top: 0.6rem; right: 0.6rem; display: flex; gap: 0.3rem; }
.sch-zoom[hidden] { display: none; }
.sch-zoom .btn { background: var(--station); min-width: 2rem; justify-content: center; }
.sch-zoom .btn:hover { background: var(--sheet); }
.vitrine--zoom { overflow: hidden; padding: 0; }
.vitrine--zoom .sch { width: 100%; height: 100%; max-width: none; cursor: grab; touch-action: none; }
.vitrine--zoom .sch.sch--glisse { cursor: grabbing; }

/* Rien en ligne : ce qui manque, la phrase pour l'agent, puis l'aperçu du schéma. */
.vide-projet > div > h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.vide-projet .stack > * + * { margin-top: 0.5rem; }
.vide-projet__l { margin: 0; font-weight: 600; }
.vide-projet .alerte { margin: 0; }
.vide-projet .copie code { white-space: pre-wrap; overflow-wrap: anywhere; }
.schema--apercu { margin-top: 1.5rem; }

/* Aperçu de ce qui sera mis en ligne : tout en pointillés, rien de cliquable. */
.sch--apercu .cs__f { stroke: var(--ink-3); stroke-dasharray: 5 4; fill: color-mix(in srgb, var(--station) 70%, transparent); }
.sch--apercu .sch__l { stroke-dasharray: 7 7; }
.sch--apercu .sch__l--test { stroke-dasharray: 1 6; }
.sch--apercu .cs__an { stroke-dasharray: 3 3; }


.etat-vide {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem 1.2rem; align-items: start;
  border: 1px dashed var(--rule-2); border-radius: 10px; padding: 1.25rem 1.35rem; color: var(--ink-2);
}
.etat-vide__plan { width: 5.5rem; height: auto; margin-top: 0.1rem; display: block; }
.etat-vide__corps { min-width: 0; }
.etat-vide h3 { font-size: 1.15rem; color: var(--ink); margin-bottom: 0.35rem; }
.etat-vide p { margin: 0 0 0.6rem; }
.etat-vide__corps > :last-child { margin-bottom: 0; }
.etat-vide .copie { max-width: 44rem; }
/* Une phrase pour l'agent se lit en entier : elle passe à la ligne au lieu de défiler. */
.etat-vide .copie { align-items: flex-start; }
.etat-vide .copie code { align-self: stretch; white-space: pre-wrap; overflow-wrap: anywhere; }
.etat-vide + form, .etat-vide + .filtres { margin-top: 1rem; }
.etat-vide .etat-vide__etiquette, .demarrage .etat-vide__etiquette { font: 600 var(--step--1)/1.4 var(--sans); color: var(--ink-3); margin: 0.75rem 0 0.35rem; }
.etat-vide .etat-vide__action { margin-top: 0.8rem; }
.etat-vide--compact { padding: 0.9rem 1rem; gap: 0.3rem 1rem; }
.etat-vide--compact .etat-vide__plan { width: 4rem; }
.etat-vide--compact h3 { font-size: 1rem; }
.etat-vide--compact p { font-size: 0.9375rem; }
* + .etat-vide { margin-top: 0.4rem; }
/* Dans une surface (.sheet), pas de seconde bordure : le bloc reste à plat. */
.sheet .etat-vide { border: 0; padding: 0.2rem 0 0; }
.compte-s { border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.compte-s h4 { margin: 0 0 0.5rem; font: 650 1rem/1.3 var(--sans); }
@media (max-width: 34rem) {
  .etat-vide { grid-template-columns: minmax(0, 1fr); }
  .etat-vide__plan { width: 4.5rem; }
  .etat-vide .copie { flex-direction: column; }
}

/* Démarrage guidé : trois stations reliées, la séquence est réelle (installer, demander, regarder). */
.demarrage { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.demarrage > li { position: relative; padding: 0 0 2rem 2.6rem; min-width: 0; }
.demarrage > li::before {
  content: ''; position: absolute; z-index: 1; left: 0; top: 0.1rem; box-sizing: border-box;
  width: 1.35rem; height: 1.35rem; border-radius: 999px; background: var(--station); border: 3.5px solid var(--ink);
}
.demarrage > li::after {
  content: ''; position: absolute; left: calc(0.675rem - 3px); top: 0.8rem; bottom: -0.8rem; width: 6px; background: var(--line);
}
.demarrage > li:last-child { padding-bottom: 0; }
.demarrage > li:last-child::after { display: none; }
.demarrage h2 { font-size: 1.3rem; font-stretch: 106%; margin-bottom: 0.45rem; }
.demarrage p { color: var(--ink-2); margin-bottom: 0.7rem; }
.demarrage .copie { margin-bottom: 0.6rem; flex-direction: column; align-items: stretch; }
.demarrage .copie code { white-space: pre-wrap; overflow-wrap: anywhere; }
.demarrage .copie button { align-self: flex-start; }
.demarrage__attente { display: inline-flex; align-items: center; gap: 0.55rem; font: 600 var(--step--1)/1.4 var(--sans); color: var(--wait-text);
  background: var(--wait-bg); border-radius: 999px; padding: 0.25rem 0.75rem 0.25rem 0.55rem; }
.demarrage__attente::before { content: ''; width: 0.55rem; height: 0.55rem; border-radius: 999px; background: var(--l-info-ink); }
.demarrage > li[data-etat='attente']::before { border-color: var(--l-info); }
/* L'animation signature de l'écran : la dernière station attend le premier projet. */
.demarrage > li[data-etat='attente']::before { animation: demarrage-attente 2.4s ease-in-out infinite; }
@keyframes demarrage-attente {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--l-info) 55%, transparent); }
  50% { box-shadow: 0 0 0 0.45rem color-mix(in srgb, var(--l-info) 0%, transparent); }
}
@media (min-width: 60rem) {
  .demarrage { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2.2rem; }
  .demarrage > li { padding: 2.6rem 0 0; }
  .demarrage > li::before { top: 0; }
  .demarrage > li::after { top: calc(0.675rem - 3px); bottom: auto; left: 0.6rem; right: -2.2rem; width: auto; height: 6px; }
}
.demarrage-suite { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.demarrage-suite > summary { cursor: pointer; font-weight: 650; }

/* Rappel discret de l'installation, sous la table des projets et en tête de /agent. */
.rappel-install { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; margin: 1.2rem 0 0; color: var(--ink-3); font-size: var(--step--1); max-width: none; }
.rappel-install .copie { flex: 1 1 24rem; min-width: 0; max-width: 40rem; }
.rappel-install .copie code { padding: 0.35rem 0.6rem; font-size: 0.78rem; background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); }
.install-rapide { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 1.2rem 1.3rem; }
.install-rapide h2 { margin-bottom: 0.5rem; }
.install-rapide p:last-child { margin-bottom: 0; }

/* Ligne « rien en ligne » de la table des projets : ce qui manque, en une ligne. */
.manque { display: block; margin-top: 0.25rem; font-size: var(--step--1); color: var(--ink-3); }


/* ---- Chargement : barre de navigation, squelettes, erreurs récupérables ---- */
.nav-barre {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; pointer-events: none;
  background: var(--line); border-radius: 0 999px 999px 0; transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
}
.nav-barre--active { opacity: 1; transform: scaleX(.86); transition: transform 9s cubic-bezier(.08, .75, .2, 1), opacity .12s linear; }

.sq-lu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sq-masque { display: none !important; }
section.sq-page { border-top: 0; }

.sq {
  display: block; height: 0.8rem; border-radius: 6px; background-color: var(--paper-2);
  background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--station) 60%, transparent) 50%, transparent 70%);
  background-size: 50vw 100%; background-repeat: no-repeat; background-attachment: fixed;
  animation: sq-balayage 1.6s ease-in-out infinite;
}
@keyframes sq-balayage { from { background-position: -50vw 0; } to { background-position: 100vw 0; } }
@media (prefers-reduced-motion: reduce) { .sq { animation: none; background-image: none; } }
.sq--fort { background-color: var(--rule); }
.sq--titre { height: 1.5rem; border-radius: 8px; }
.sq--h2 { height: 1.35rem; width: 9rem; border-radius: 8px; background-color: var(--rule); }
.sq--lede { height: 1.05rem; width: min(26rem, 60vw); max-width: 100%; margin-top: 0.7rem; }
.sq--seg { height: 1.9rem; width: 9rem; border-radius: 999px; }
.sq--champ { height: 2.6rem; width: 12rem; border-radius: 10px; }
.sq--pilule { height: 1.9rem; width: 5.5rem; border-radius: 999px; }
.sq--puce { height: 1.2rem; width: 6rem; border-radius: 999px; }

.sq-zone { display: grid; gap: 1.6rem; }
.sq-cadre { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.1rem; display: grid; gap: 0.7rem; min-width: 0; }
.sq-cadre .sq { background-color: var(--paper-2); }
.sq-col { display: grid; gap: 0.75rem; align-content: start; }
.sq-faits { display: grid; grid-template-columns: minmax(4rem, 2fr) 3fr; gap: 0.55rem 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.sq-graphique { display: flex; align-items: flex-end; gap: 3px; height: 64px; padding-top: 0.6rem; border-top: 1px solid var(--rule); margin-top: 0.3rem; }
.sq-graphique .sq { flex: 1; border-radius: 999px; height: var(--h); }

/* Vue d'ensemble : le schéma (une vitrine) et la colonne du panneau. */
.sq-schema { position: relative; min-height: 22rem; border-radius: 14px; padding: 2.2rem 1.6rem; display: grid; align-content: center;
  background: var(--sheet) radial-gradient(circle, var(--rule-2) 1.1px, transparent 1.3px) 0 0 / 20px 20px; border: 1px solid var(--rule); }
.sq-schema__rail { position: absolute; left: 12%; right: 12%; top: 50%; height: 6px; margin-top: -3px; }
.sq-schema__briques { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem 12%; }
.sq-schema__briques .sq { height: 4.2rem; border-radius: 12px; background-color: var(--paper-2); box-shadow: 0 0 0 1px var(--rule); }
.sq-bande { display: grid; gap: 1rem; padding-top: 0.6rem; }
.sq-bande__ligne { position: relative; height: 1.4rem; }
.sq-bande__ligne .sq { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 999px; }
.sq-bande__ligne i { position: absolute; top: 50%; left: var(--x); width: 1.15rem; height: 1.15rem; margin: -0.575rem 0 0 -0.575rem; border-radius: 999px; background: var(--station); border: 3px solid var(--rule-2); }

/* Activité : des stations sur un trait, deux lignes de texte chacune. */
.sq-filtres { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; }
.sq-filtres > div { display: grid; gap: 0.35rem; }
.sq-fil { list-style: none; margin: 0; padding: 0; }
.sq-fil li { position: relative; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); column-gap: 0.85rem; padding-bottom: 1.3rem; }
.sq-fil li::before { content: ''; grid-row: 1 / span 2; justify-self: center; position: relative; z-index: 1; width: 1.05rem; height: 1.05rem; border-radius: 999px; background: var(--station); border: 3px solid var(--rule-2); }
.sq-fil li::after { content: ''; position: absolute; left: calc(0.8rem - 3px); top: 0.5rem; bottom: -0.5rem; width: 6px; background: var(--rule); }
.sq-fil li:last-child::after { display: none; }
.sq-fil li .sq { grid-column: 2; }
.sq-fil li .sq + .sq { margin-top: 0.45rem; height: 0.65rem; }

/* Réglages et données : des sections, chacune un titre, une phrase et un tableau. */
.sq-section { display: grid; gap: 0.75rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--rule); }
.sq-section:last-child { border-bottom: 0; }
.sq-section__tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sq-table { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.sq-table > div { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; padding: 0.75rem 0.9rem; }
.sq-table > div + div { border-top: 1px solid var(--rule); }
.sq-table > div:first-child { background: var(--paper-2); }
.sq-table > div:first-child .sq { background-color: var(--rule); height: 0.7rem; }

/* En-tête d'un projet tant que la page n'est pas là (depuis la liste des projets). */
.onglets .sq-onglet { position: relative; padding: 0.55rem 0; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.onglets .sq-onglet[aria-current] { color: var(--ink); }
.onglets .sq-onglet[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; border-radius: 999px; background: var(--line); }

/* Fragments : impact, pile d'erreur. */
.sq-bloc { display: grid; gap: 0.5rem; padding-block: 0.4rem; }
.sq-bloc .sq--puce { margin-bottom: 0.2rem; }

/* Journal sombre en attente : des lignes de code esquissées, le texte reste lu par les lecteurs d'écran. */
.journal[aria-busy='true'] {
  position: relative; color: transparent; min-height: 8.5rem;
  --l: color-mix(in srgb, var(--on-ink) 16%, transparent);
  background-image: linear-gradient(var(--l), var(--l)), linear-gradient(var(--l), var(--l)), linear-gradient(var(--l), var(--l)),
    linear-gradient(var(--l), var(--l)), linear-gradient(var(--l), var(--l)), linear-gradient(var(--l), var(--l));
  background-repeat: no-repeat;
  background-size: 64% 0.5rem, 82% 0.5rem, 47% 0.5rem, 74% 0.5rem, 58% 0.5rem, 36% 0.5rem;
  background-position: 1rem 1.15rem, 1rem 2.35rem, 1rem 3.55rem, 1rem 4.75rem, 1rem 5.95rem, 1rem 7.15rem;
}
.journal[aria-busy='true']::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--on-ink) 10%, transparent) 50%, transparent 70%) no-repeat fixed;
  background-size: 50vw 100%; animation: sq-balayage 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .journal[aria-busy='true']::after { display: none; } }

/* Échec d'un chargement : le problème, et de quoi s'en sortir. */
.charge-err { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem 0.7rem; align-items: baseline; }
.charge-err::before { align-self: start; margin-top: 0.75em; transform: none; }
.charge-err__texte, .charge-err__actions { grid-column: 2; }
.charge-err__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.charge-err .btn--ghost { border-color: currentColor; color: inherit; }
.charge-err .btn--ghost:hover { background: var(--sheet); color: var(--ink); border-color: var(--ink); }
.journal + .charge-err { margin: -0.2rem 0 0.6rem; }

/* Fil d'activité en direct : l'état du flux, la pastille des nouveautés, un bref surlignage. */
.direct { margin: 0 0 0 auto; align-self: flex-end; min-height: 2.6rem; display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-3); }
.direct::before { content: ''; flex: none; width: 0.65rem; height: 0.65rem; border-radius: 999px; background: var(--station); border: 2px solid var(--rule-2); }
.direct[data-etat='direct']::before { background: var(--l-sav); border-color: var(--l-sav-ink); }
.direct[data-etat='reconnexion']::before { border-color: var(--l-info-ink); }
.direct[data-etat='coupe'] { color: var(--bad-text); }
.direct[data-etat='coupe']::before { border-color: var(--l-heb-ink); }
.fil-pastille {
  position: fixed; z-index: 30; left: 0; right: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 2 * var(--gutter));
  top: calc(env(safe-area-inset-top, 0px) + 4.3rem); box-shadow: 0 10px 24px -12px rgba(16,33,58,.55);
}
.fil-pastille[hidden], .direct[hidden], .vide[hidden] { display: none; }
.fil > li.fil__nouveau { border-radius: 8px; animation: fil-nouveau 3.2s ease-out; }
@keyframes fil-nouveau { from { background: var(--wait-bg); box-shadow: 0 0 0 6px var(--wait-bg); } to { background: transparent; box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .fil > li.fil__nouveau { animation: none; background: var(--wait-bg); box-shadow: 0 0 0 6px var(--wait-bg); } }


/* ---- Bouton de recherche de l'en-tête ---- */
.recherche {
  order: 3; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.35rem 0.3rem 0.7rem;
  border: 1px solid var(--rule-2); border-radius: 999px; background: var(--sheet); color: var(--ink-2);
  font: 560 0.9375rem/1.2 var(--sans); cursor: pointer; transition: border-color .15s ease-out, color .15s ease-out;
}
.recherche:hover { border-color: var(--ink); color: var(--ink); }
.recherche svg, .pal__ic { width: 1.05rem; height: 1.05rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.recherche kbd, .pal kbd {
  display: inline-block; min-width: 1.4rem; padding: 0.2rem 0.4rem; text-align: center;
  font: 500 0.75rem/1.1 var(--mono); color: var(--ink-2); background: var(--station);
  border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 6px; white-space: nowrap;
}
@media (max-width: 52rem) {
  .recherche { padding: 0.5rem; }
  .recherche__texte, .recherche kbd { display: none; }
}
@media (max-width: 40rem) {
  .recherche { order: 1; margin-left: auto; }
  header.top nav.top { order: 2; flex-basis: 100%; margin-left: 0; }
}

/* ---- Palette : une recherche légère en haut d'écran ---- */
.pal {
  padding: 0; margin: max(9vh, 0.75rem) auto auto; width: min(40rem, calc(100% - 2 * var(--gutter))); max-width: none;
  max-height: calc(100dvh - 1.5rem); overflow: hidden; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-2); border-radius: 14px;
  box-shadow: 0 1px 1px rgba(16,33,58,.06), 0 28px 56px -24px rgba(16,33,58,.5);
}
.pal[open] { animation: pal-entree .14s ease-out; }
.pal::backdrop { background: rgba(16,33,58,.3); }
@keyframes pal-entree { from { opacity: 0; transform: translateY(-0.5rem) scale(.985); } }
.pal__boite { display: flex; flex-direction: column; max-height: inherit; }
.pal__vue { display: flex; flex-direction: column; min-height: 0; }
.pal__vue[hidden] { display: none; }
.pal__sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pal__barre { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.6rem 0.55rem 1rem; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.pal__barre .pal__ic { width: 1.25rem; height: 1.25rem; }
.pal input.pal__champ {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.5rem 0; border-radius: 0;
  font: 500 1.125rem/1.4 var(--sans); color: var(--ink);
}
.pal input.pal__champ::placeholder { color: var(--ink-3); }
.pal input.pal__champ:focus-visible { outline: none; }
.pal__barre:focus-within { box-shadow: inset 0 -2px 0 var(--l-pve); }
.pal__fermer {
  flex: none; display: inline-grid; place-items: center; min-width: 2.25rem; height: 2.25rem; padding: 0 0.3rem;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.pal__fermer:hover { background: var(--paper-2); color: var(--ink); }
.pal__fermer .pal__ic { display: none; }
.pal__liste { overflow-y: auto; overscroll-behavior: contain; max-height: min(28rem, 62dvh); padding: 0.2rem 0 0.5rem; }
.pal__titre { padding: 0.7rem 1.4rem 0.3rem; font: 650 0.8125rem/1.3 var(--sans); color: var(--ink-3); }
.pal__o {
  display: flex; align-items: center; gap: 0.75rem; min-height: 2.6rem; margin: 0 0.4rem; padding: 0.4rem 1rem;
  border-radius: 8px; cursor: pointer;
}
.pal__o[aria-selected='true'] { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); }
.pal__m { flex: none; width: 0.9rem; height: 4px; border-radius: 999px; background: var(--dash, var(--rule-2)); }
.pal__m--station { height: 0.9rem; background: var(--station); border: 2.5px solid var(--ink); }
.pal__l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; }
.pal__ctx { color: var(--ink-3); font-weight: 500; }
.pal__ctx::after { content: ' · '; color: var(--rule-2); }
.pal__meta { flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--step--1); color: var(--ink-3); }
.pal__meta.mono { font-size: 0.75rem; }
.pal__o .chip { flex: none; }
.pal__info { margin: 0.3rem 1.4rem; font-size: 0.9375rem; color: var(--ink-2); }
.pal__info--charge::before {
  content: ''; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.55rem; vertical-align: -0.05em;
  border-radius: 999px; border: 2px solid var(--l-info); border-right-color: transparent; animation: pal-tour .8s linear infinite;
}
@keyframes pal-tour { to { transform: rotate(360deg); } }
.pal__vide { margin: 0.9rem 1.4rem 0.4rem; padding: 0.9rem 1rem; border: 1px dashed var(--rule-2); border-radius: 10px; color: var(--ink-2); font-size: 0.9375rem; }
.pal__vide p { margin: 0; }
.pal__vide p + p { margin-top: 0.35rem; }
.pal__pied { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.1rem; padding: 0.55rem 1rem; border-top: 1px solid var(--rule); background: var(--paper); font-size: var(--step--1); color: var(--ink-3); }
.pal__pied > span { display: inline-flex; align-items: center; gap: 0.3rem; }
.pal__lien { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.35rem; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font: 600 var(--step--1)/1.3 var(--sans); cursor: pointer; }
.pal__lien:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

/* Aide des raccourcis */
.pal__aide-tete { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.8rem 0.6rem 0.8rem 1.3rem; border-bottom: 1px solid var(--rule); }
.pal__aide-tete h2 { font-size: 1.25rem; }
.pal__aide-tete .btn { flex: none; white-space: nowrap; }
.pal__aide { overflow-y: auto; max-height: min(32rem, 70dvh); padding: 0.4rem 1.3rem 1.1rem; display: grid; gap: 0.2rem 2rem; }
@media (min-width: 40rem) { .pal__aide { grid-template-columns: 1fr 1fr; } .pal__aide section:first-child { grid-row: span 2; } }
.pal__aide section { padding: 0; border: 0; }
.pal__aide h3 { font-size: 0.9375rem; color: var(--ink-2); margin: 0.8rem 0 0.4rem; }
.pal__aide dl { margin: 0; display: grid; grid-template-columns: 8.6rem 1fr; gap: 0.35rem 0.8rem; align-items: center; font-size: 0.9375rem; }
.pal__aide dt { display: flex; gap: 0.25rem; align-items: center; white-space: nowrap; }
.pal__aide dd { margin: 0; }
.pal__aide .pal__puis { font-size: 0.75rem; color: var(--ink-3); }

@media (max-width: 40rem) {
  .pal { margin-top: 0.75rem; width: calc(100% - 1.5rem); }
  .pal__fermer kbd { display: none; }
  .pal__fermer .pal__ic { display: block; }
  .pal__pied, .pal__meta.mono { display: none; }
  .pal__liste { max-height: 72dvh; }
}

/* ---- Notifications : en bas, empilées, encre sur papier inversé ---- */
.toasts {
  position: fixed; z-index: 60; right: var(--gutter); bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: min(26rem, calc(100% - 2 * var(--gutter))); display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 0.75rem; max-width: 100%;
  padding: 0.5rem 0.4rem 0.5rem 0.9rem; border-radius: 10px; background: var(--ink); color: var(--on-ink);
  box-shadow: 0 18px 36px -18px rgba(16,33,58,.65); animation: toast-entree .16s ease-out;
  transition: opacity .15s ease-out;
}
.toast::before { content: ''; flex: none; width: 1rem; height: 4px; border-radius: 999px; background: var(--on-ink-2); }
.toast--ok::before { background: var(--l-sav); }
.toast--erreur::before { background: var(--l-heb); }
.toast p { flex: 1; margin: 0; padding-block: 0.25rem; font-size: 0.9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.toast__fermer {
  flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--on-ink-2); cursor: pointer;
}
.toast__fermer:hover { color: var(--on-ink); background: color-mix(in srgb, var(--on-ink) 12%, transparent); }
.toast__fermer svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.toast :focus-visible { outline-color: var(--on-ink); }
.toast--sortie { opacity: 0; }
@keyframes toast-entree { from { opacity: 0; transform: translateY(0.5rem); } }
@media (max-width: 40rem) { .toasts { left: var(--gutter); right: var(--gutter); width: auto; align-items: stretch; } }

@media (prefers-reduced-motion: reduce) {
  .pal[open], .toast { animation: none; }
  .pal__info--charge::before { animation: none; border-right-color: var(--l-info); }
}
