/* Console Kreomnis Cloud : composants. Valeurs tirées de jetons.css seulement.
   Aucune règle en ligne dans le HTML (CSP style-src 'self'). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--fond);
	color: var(--texte);
	font: var(--taille-m)/var(--interligne) var(--police);
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-survol); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.012em; margin: 0; }
h1 { font-size: var(--taille-xl); font-weight: var(--graisse-forte); }
h2 { font-size: var(--taille-l); font-weight: var(--graisse-forte); }
h3 { font-size: var(--taille-m); font-weight: var(--graisse-forte); }
p { margin: 0; }
code, pre, kbd, .mono { font-family: var(--police-mono); font-size: .86em; }
code {
	background: var(--code-fond); border: 1px solid var(--bord); border-radius: var(--r-s);
	padding: 0 .35em; word-break: break-all;
}
kbd {
	border: 1px solid var(--bord-fort); border-bottom-width: 2px; border-radius: var(--r-s);
	padding: 0 .4em; font-size: var(--taille-xs); color: var(--discret); background: var(--surface);
}
svg.icone { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
	stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.visuellement-cache {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
	clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-s); }
[hidden] { display: none !important; }
.discret { color: var(--discret); }
.aide { font-size: var(--taille-s); color: var(--discret); }

.lien-evitement {
	position: absolute; left: var(--e-2); top: -100px; z-index: 50; background: var(--surface);
	padding: var(--e-2) var(--e-3); border-radius: var(--r-m); box-shadow: var(--ombre-2);
}
.lien-evitement:focus { top: var(--e-2); }

/* --- Pages seules (accueil, connexion, messages) ------------------------------------------- */
body.seul {
	min-height: 100vh; display: grid; place-items: center; padding: var(--e-4);
	background: radial-gradient(1200px 600px at 50% -10%, var(--accent-doux), transparent 70%), var(--fond);
}
.carte-seule {
	width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--bord);
	border-radius: var(--r-xl); padding: var(--e-8) var(--e-6); display: grid; gap: var(--e-5);
	text-align: center; box-shadow: var(--ombre-2);
}
.carte-seule h2 { font-size: var(--taille-l); }
.carte-seule p { color: var(--discret); }
.carte-seule .si-auto { display: none; }
body[data-auto="1"] .carte-seule .si-auto { display: block; }
.carte-seule .sous-titre { font-size: var(--taille-s); color: var(--discret); margin-top: calc(-1 * var(--e-3)); }
.marque {
	display: flex; align-items: center; justify-content: center; gap: var(--e-2);
	font-size: var(--taille-l); font-weight: var(--graisse-forte); letter-spacing: -.02em; margin: 0;
	color: var(--texte); text-decoration: none;
}
.marque img { display: block; }
.marque:hover { color: var(--texte); }
details.secours { text-align: left; border-top: 1px solid var(--bord); padding-top: var(--e-4); }
details.secours summary { cursor: pointer; color: var(--discret); font-size: var(--taille-s); }
details.secours form { display: grid; gap: var(--e-2); margin-top: var(--e-3); }
.pied-seul { font-size: var(--taille-xs); color: var(--discret); }

/* --- Coquille de l'application -------------------------------------------------------------- */
.coquille { display: grid; grid-template-columns: var(--largeur-laterale) minmax(0, 1fr); min-height: 100vh; }
.laterale {
	position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface);
	border-right: 1px solid var(--bord); display: flex; flex-direction: column; gap: var(--e-2);
	padding: var(--e-3);
}
.laterale .marque { justify-content: flex-start; padding: var(--e-2) var(--e-2) var(--e-3); font-size: var(--taille-m); }
.laterale nav { display: grid; gap: 2px; }
.laterale .titre-groupe {
	font-size: var(--taille-xs); color: var(--discret); text-transform: uppercase; letter-spacing: .06em;
	padding: var(--e-3) var(--e-2) var(--e-1); font-weight: var(--graisse-moyenne);
}
.lien-nav {
	display: flex; align-items: center; gap: var(--e-2); padding: 5px var(--e-2); border-radius: var(--r-m); min-height: 32px;
	color: var(--texte-2); text-decoration: none; font-size: var(--taille-s); font-weight: 500;
	transition: background var(--duree) var(--courbe), color var(--duree) var(--courbe);
}
.lien-nav:hover { background: var(--surface-2); color: var(--texte); }
.lien-nav[aria-current="page"] { background: var(--accent-doux); color: var(--accent-doux-texte); }
.lien-nav .compteur { margin-left: auto; }
.lien-nav .titre-nav { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.laterale nav .titre-groupe { padding: var(--e-4) var(--e-2) var(--e-1); }
.laterale nav .titre-groupe:first-child { padding-top: 0; }
.laterale .bas { margin-top: auto; display: grid; gap: var(--e-2); border-top: 1px solid var(--bord); padding-top: var(--e-3); }
.qui { display: flex; align-items: center; gap: var(--e-2); padding: 0 var(--e-2); min-width: 0; }
.qui .avatar {
	width: 28px; height: 28px; border-radius: var(--r-plein); background: var(--accent-doux); color: var(--accent-doux-texte);
	display: grid; place-items: center; font-weight: var(--graisse-forte); font-size: var(--taille-s); flex: none;
}
.qui .noms { min-width: 0; line-height: 1.25; }
.qui .noms span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qui .noms .role { font-size: var(--taille-xs); color: var(--discret); }

.colonne { min-width: 0; display: flex; flex-direction: column; }
/* Rôle de la machine (js/coquille.js, poserRole) : bandeau en tête de page (PROD discret,
   PRÉPROD orange plein) et pastille dans la barre du haut, qui reste visible au défilement. */
.bandeau-role {
	display: flex; flex-wrap: wrap; align-items: baseline; padding: var(--e-1) var(--e-6);
	font-size: var(--taille-xs); background: var(--neutre-doux); color: var(--neutre); border-bottom: 1px solid var(--bord);
	overflow-wrap: anywhere;
}
.bandeau-role strong, .pastille-role { letter-spacing: .06em; font-weight: var(--graisse-forte); }
.bandeau-role.preprod { padding-block: var(--e-2); font-size: var(--taille-s); background: var(--preprod-fond); color: var(--preprod-texte); border-bottom: 0; }
.pastille-role {
	flex: none; padding: 2px var(--e-2); border-radius: var(--r-s); font-size: var(--taille-xs);
	background: var(--neutre-doux); color: var(--neutre); border: 1px solid var(--bord);
}
.pastille-role.preprod { background: var(--preprod-fond); color: var(--preprod-texte); border-color: var(--preprod-fond); }
@media (max-width: 860px) { .bandeau-role { padding-inline: var(--e-4); } .bandeau-role .aide-role { display: none; } }
.barre-haut {
	position: sticky; top: 0; z-index: 10; height: var(--hauteur-barre); display: flex; align-items: center;
	gap: var(--e-3); padding: 0 var(--e-6); background: color-mix(in srgb, var(--fond) 88%, transparent);
	backdrop-filter: blur(8px); border-bottom: 1px solid var(--bord);
}
.barre-haut .fil { flex: 1; min-width: 0; }
.bouton-menu { display: none; }
.bouton-recherche {
	display: inline-flex; align-items: center; gap: var(--e-2); min-width: 220px; justify-content: flex-start;
	color: var(--discret); background: var(--surface); border: 1px solid var(--bord-fort); border-radius: var(--r-m);
	padding: 6px var(--e-3); font: inherit; font-size: var(--taille-s); cursor: pointer;
}
.bouton-recherche:hover { border-color: var(--discret); color: var(--texte); }
.bouton-recherche kbd { margin-left: auto; }
main#contenu {
	width: 100%; max-width: var(--largeur-lecture); margin: 0 auto; padding: var(--e-6) var(--e-6) var(--e-10);
	display: grid; gap: var(--e-5); align-content: start;
}
main#contenu:focus { outline: none; }

.fil { font-size: var(--taille-s); color: var(--discret); display: flex; align-items: center; gap: var(--e-1); overflow: hidden; white-space: nowrap; }
.fil ol { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--e-1); align-items: center; min-width: 0; }
.fil li { display: flex; align-items: center; gap: var(--e-1); min-width: 0; }
.fil li + li::before { content: "/"; color: var(--bord-fort); }
.fil a { color: var(--discret); text-decoration: none; }
.fil a:hover { color: var(--texte); text-decoration: underline; }
.fil [aria-current] { color: var(--texte); font-weight: var(--graisse-moyenne); overflow: hidden; text-overflow: ellipsis; }

.voile-lateral { display: none; }

@media (max-width: 860px) {
	.coquille { grid-template-columns: minmax(0, 1fr); }
	.laterale {
		position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%);
		transition: transform var(--duree) var(--courbe); box-shadow: var(--ombre-3);
	}
	.coquille.menu-ouvert .laterale { transform: none; }
	.coquille.menu-ouvert .voile-lateral { display: block; position: fixed; inset: 0; background: var(--voile); z-index: 30; }
	.bouton-menu { display: inline-flex; }
	.barre-haut { padding: 0 var(--e-4); gap: var(--e-2); }
	.bouton-recherche { min-width: 0; }
	.bouton-recherche .libelle, .bouton-recherche kbd { display: none; }
	main#contenu { padding: var(--e-4) var(--e-4) var(--e-10); }
}

/* --- Titres d'écran -------------------------------------------------------------------------- */
.entete { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e-4); flex-wrap: wrap; }
.entete .titres { display: grid; gap: var(--e-1); min-width: 0; }
.entete .titres p { color: var(--discret); display: flex; flex-wrap: wrap; gap: var(--e-2); align-items: center; }
.entete h1 { display: flex; align-items: center; gap: var(--e-3); flex-wrap: wrap; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-4); color: var(--discret); font-size: var(--taille-s); align-items: center; }
.meta > * { display: inline-flex; align-items: center; gap: var(--e-1); min-width: 0; }

/* --- Cartes, grilles, tables ---------------------------------------------------------------- */
.carte {
	background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); padding: var(--e-5);
	min-width: 0; box-shadow: var(--ombre-1); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e-4); align-content: start;
}
.carte > header { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); flex-wrap: wrap; }
.carte > header p { color: var(--discret); font-size: var(--taille-s); width: 100%; }
.carte.plate { box-shadow: none; }
.grille { display: grid; gap: var(--e-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grille.deux { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.defile { overflow-x: auto; margin: 0 calc(-1 * var(--e-5)); padding: 0 var(--e-5); }
table { border-collapse: collapse; width: 100%; font-size: var(--taille-s); }
th, td { text-align: left; padding: 10px var(--e-3); border-bottom: 1px solid var(--bord); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { font-weight: var(--graisse-moyenne); color: var(--discret); font-size: var(--taille-xs); text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.actions { white-space: nowrap; text-align: right; }
dl.proprietes { display: grid; grid-template-columns: max-content 1fr; gap: var(--e-2) var(--e-5); margin: 0; font-size: var(--taille-s); }
dl.proprietes dt { color: var(--discret); }
dl.proprietes dd { margin: 0; min-width: 0; word-break: break-word; }
@media (max-width: 600px) {
	/* Tableaux en fiches : plus de défilement horizontal qui cache les actions. */
	.defile { overflow-x: visible; margin: 0; padding: 0; }
	.defile > table > thead { display: none; }
	.defile > table, .defile > table > tbody, .defile > table > tbody > tr, .defile > table > tbody > tr > td { display: block; width: 100%; }
	.defile > table > tbody > tr { border: 1px solid var(--bord); border-radius: var(--r-m); padding: var(--e-2) var(--e-3); margin-bottom: var(--e-2); }
	.defile > table > tbody > tr > td { border: 0; padding: 3px 0 !important; display: flex; gap: var(--e-3); justify-content: space-between; align-items: center; text-align: right; min-width: 0; }
	.defile > table > tbody > tr > td[data-libelle]::before { content: attr(data-libelle); color: var(--discret); font-size: var(--taille-xs); text-transform: uppercase; letter-spacing: .05em; text-align: left; flex: none; }
	.defile > table > tbody > tr > td.actions { justify-content: flex-end; padding-top: var(--e-2) !important; }
	.defile > table > tbody > tr > td.actions .boutons { flex-wrap: wrap; }
	.fil li:not(:last-child) { display: none; }
	.fil li:last-child::before { display: none; }
	.bouton { white-space: normal; text-align: center; max-width: 100%; }
}
@media (max-width: 560px) {
	dl.proprietes { grid-template-columns: 1fr; gap: 2px; }
	dl.proprietes dd { margin-bottom: var(--e-2); }
	th, td { padding: var(--e-2) 6px; }
}

/* --- Compteurs du tableau de bord ------------------------------------------------------------ */
.compteurs { display: grid; gap: var(--e-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.compteur-carte {
	background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); padding: var(--e-4);
	display: grid; gap: var(--e-1); text-decoration: none; color: var(--texte); box-shadow: var(--ombre-1);
}
a.compteur-carte:hover { border-color: var(--bord-fort); color: var(--texte); }
.compteur-carte .libelle { font-size: var(--taille-s); color: var(--discret); display: flex; align-items: center; gap: var(--e-2); }
.compteur-carte .valeur { font-size: var(--taille-xxl); font-weight: var(--graisse-forte); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.compteur-carte.ok .libelle svg { color: var(--ok); }
.compteur-carte.danger .libelle svg { color: var(--danger); }
.compteur-carte.attente .libelle svg { color: var(--attente); }

/* --- Cartes de projet ------------------------------------------------------------------------ */
.outils { display: flex; gap: var(--e-2); flex-wrap: wrap; align-items: center; }
.outils .filtre { flex: 1 1 240px; position: relative; }
.outils .filtre svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--discret); pointer-events: none; }
.outils .filtre input { padding-left: 34px; }
.projet-carte {
	position: relative; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l);
	padding: var(--e-4) var(--e-5); display: grid; gap: var(--e-3); box-shadow: var(--ombre-1); min-width: 0;
	transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe);
}
.projet-carte:hover { border-color: var(--bord-fort); box-shadow: var(--ombre-2); }
.projet-carte:focus-within { border-color: var(--accent); }
.projet-carte .tete { display: flex; align-items: center; gap: var(--e-3); justify-content: space-between; min-width: 0; }
.projet-carte h2 { font-size: var(--taille-m); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projet-carte h2 a { color: var(--texte); text-decoration: none; }
/* Toute la carte est cliquable, sans imbriquer de liens : le lien du titre s'étend. */
.projet-carte h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.projet-carte .lignes { display: grid; gap: 6px; font-size: var(--taille-s); color: var(--discret); min-width: 0; }
.projet-carte .ligne { display: flex; align-items: center; gap: var(--e-2); min-width: 0; }
.projet-carte .ligne > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.projet-carte .ligne a { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projet-carte .ligne svg { color: var(--discret); }

/* --- Onglets -------------------------------------------------------------------------------- */
.onglets { display: flex; gap: var(--e-1); border-bottom: 1px solid var(--bord); overflow-x: auto; scrollbar-width: thin; scroll-behavior: auto; }
.onglets a {
	padding: var(--e-2) var(--e-3); color: var(--discret); text-decoration: none; white-space: nowrap; font-weight: 500;
	border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: var(--r-s) var(--r-s) 0 0;
}
.onglets a:hover { color: var(--texte); background: var(--surface-2); }
.onglets a[aria-selected="true"] { color: var(--texte); border-bottom-color: var(--accent); }
.selecteurs { display: flex; gap: var(--e-2); flex-wrap: wrap; align-items: center; }
.segments { display: inline-flex; background: var(--surface-2); border: 1px solid var(--bord); border-radius: var(--r-m); padding: 2px; gap: 2px; flex-wrap: wrap; }
.segments a, .segments button {
	border: 0; background: none; font: inherit; font-size: var(--taille-s); color: var(--discret); padding: 4px var(--e-3);
	border-radius: var(--r-s); cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center;
}
.segments a:hover, .segments button:hover { color: var(--texte); }
.segments [aria-current="true"], .segments [aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }

/* --- Badges d'état ------------------------------------------------------------------------- */
.badge {
	display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-plein); padding: 1px 9px 1px 8px;
	font-size: var(--taille-xs); font-weight: var(--graisse-moyenne); white-space: nowrap; line-height: 1.6;
	background: var(--neutre-doux); color: var(--neutre);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.sans-point::before { display: none; }
.badge.ok { background: var(--ok-doux); color: var(--ok); }
.badge.info { background: var(--info-doux); color: var(--info); }
.badge.attente { background: var(--attente-doux); color: var(--attente); }
.badge.danger { background: var(--danger-doux); color: var(--danger); }
.badge.prod { background: var(--accent-doux); color: var(--accent-doux-texte); }
.badge.info::before { animation: pulsation 1.4s ease-in-out infinite; }
@keyframes pulsation { 50% { opacity: .35; } }
.compteur {
	background: var(--danger); color: var(--danger-texte); border-radius: var(--r-plein); font-size: var(--taille-xs);
	padding: 0 7px; line-height: 1.6; font-weight: var(--graisse-forte); font-variant-numeric: tabular-nums;
}
.compteur.doux { background: var(--attente-doux); color: var(--attente); }

/* --- Formulaires ---------------------------------------------------------------------------- */
form.ligne { display: flex; gap: var(--e-2) var(--e-3); flex-wrap: wrap; align-items: flex-end; }
form.ligne .champ { display: grid; gap: var(--e-1); flex: 1 1 170px; min-width: 0; }
/* minmax(0, 1fr) : une ligne longue sans césure (encadré des problèmes, journal) ne peut plus
   élargir la colonne au-delà de la carte (min-width: auto des éléments de grille). */
form.pile, .pile { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e-3); }
.champ { display: grid; gap: var(--e-1); min-width: 0; }
label, .etiquette { font-size: var(--taille-s); color: var(--texte-2); font-weight: 500; }
/* :where() : la règle garde la spécificité d’un simple « input » (les règles d’écran la surchargent). */
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"])), select, textarea {
	font: inherit; font-size: var(--taille-m); color: var(--texte); background: var(--surface); border: 1px solid var(--bord-fort);
	border-radius: var(--r-m); padding: 7px var(--e-3); width: 100%; min-width: 0; min-height: 38px;
	transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe);
}
input:hover, select:hover, textarea:hover { border-color: var(--discret); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent);
}
input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
textarea { resize: vertical; min-height: 4.5em; font-family: var(--police-mono); font-size: var(--taille-s); }
.case { display: inline-flex; gap: var(--e-2); align-items: center; color: var(--texte); font-weight: 400; cursor: pointer; }
/* Cases et boutons radio dessinés (même rendu sur chaque système, couleurs du thème) ; la case
   role=switch a son propre dessin (interrupteur), les radios des tuiles et segments sont cachées. */
input:where([type="checkbox"]:not([role="switch"]), [type="radio"]) {
	appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; padding: 0;
	border: 1.5px solid var(--bord-fort); background: var(--surface); border-radius: 5px; cursor: pointer;
	display: inline-grid; place-content: center; vertical-align: -.25em;
	transition: background var(--duree) var(--courbe), border-color var(--duree) var(--courbe);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:not([role="switch"]):hover, input[type="radio"]:hover { border-color: var(--discret); }
input[type="checkbox"]:not([role="switch"]):checked, input[type="radio"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:not([role="switch"]):checked::after {
	content: ""; width: 5px; height: 9px; border: solid var(--accent-texte); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg);
}
input[type="radio"]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-texte); }
input[type="checkbox"]:not([role="switch"]):disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }
fieldset.cases { border: 1px solid var(--bord); border-radius: var(--r-m); padding: var(--e-2) var(--e-3) var(--e-3); margin: 0; display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-4); min-width: 0; }
fieldset.cases legend { font-size: var(--taille-s); color: var(--texte-2); font-weight: 500; padding: 0 var(--e-1); }

.bouton {
	font: inherit; font-size: var(--taille-s); font-weight: var(--graisse-moyenne); cursor: pointer; text-decoration: none;
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; white-space: nowrap;
	border-radius: var(--r-m); padding: 6px 14px; border: 1px solid var(--bord-fort); background: var(--surface); color: var(--texte);
	transition: background var(--duree) var(--courbe), border-color var(--duree) var(--courbe);
}
.bouton:hover { background: var(--surface-2); color: var(--texte); }
.bouton.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.bouton.principal:hover { background: var(--accent-survol); border-color: var(--accent-survol); color: var(--accent-texte); }
.bouton.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--bord)); }
.bouton.danger:hover { background: var(--danger-doux); }
.bouton.danger.plein { background: var(--danger); border-color: var(--danger); color: var(--danger-texte); }
.bouton.fantome { border-color: transparent; background: none; }
.bouton.fantome:hover { background: var(--surface-2); }
.bouton.petit { min-height: 30px; padding: 3px 10px; font-size: var(--taille-xs); }
.bouton.icone-seule { padding: 6px; min-width: 36px; }
.bouton.large { width: 100%; min-height: 44px; font-size: var(--taille-m); }
.bouton:disabled, .bouton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.boutons { display: flex; gap: var(--e-2); flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.boutons.gauche { justify-content: flex-start; }

/* Sélecteurs : plus de flèche native (rendu différent sur chaque système). Chevron dessiné par
   deux dégradés (pas d'image : suit la couleur du thème), texte tronqué proprement. */
select:not([multiple]) {
	appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
	text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
	background-image: linear-gradient(45deg, transparent 50%, var(--discret) 50%), linear-gradient(135deg, var(--discret) 50%, transparent 50%);
	background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
	background-size: 5px 5px; background-repeat: no-repeat;
}
select:not([multiple]):hover { background-color: var(--surface-2); }
select option { background: var(--surface); color: var(--texte); }
/* Dans une ligne de formulaire, champs et boutons partagent la même hauteur et la même ligne de
   base, que le champ ait une aide ou non (l'aide passe sous la ligne). */
form.ligne > .bouton, form.ligne > button { min-height: 38px; }
form.ligne .champ .aide { order: 3; }

/* Bouton occupé : roue à la place de l'icône, largeur conservée, libellé gardé (pas de saut). */
.bouton[aria-busy="true"] { cursor: progress; opacity: .85; }
.bouton[aria-busy="true"] > svg.icone { display: none; }
.bouton[aria-busy="true"]::before, .roue {
	content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block;
	border: 2px solid currentColor; border-right-color: transparent; animation: tourne .7s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bouton[aria-busy="true"]::before, .roue { animation-duration: 2.4s; } }

/* Interrupteur (case à cocher role=switch) : pour les réglages oui/non. */
.interrupteur { display: inline-flex; align-items: center; gap: var(--e-2); cursor: pointer; color: var(--texte); font-weight: 400; }
.interrupteur input {
	appearance: none; -webkit-appearance: none; margin: 0; width: 38px; height: 22px; min-height: 0; padding: 0;
	border-radius: var(--r-plein); border: 1px solid var(--bord-fort); background: var(--surface-3); position: relative; cursor: pointer; flex: none;
	transition: background var(--duree) var(--courbe), border-color var(--duree) var(--courbe);
}
.interrupteur input::after {
	content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
	background: var(--surface); box-shadow: var(--ombre-1); transition: transform var(--duree) var(--courbe);
}
.interrupteur input:checked { background: var(--accent); border-color: var(--accent); }
.interrupteur input:checked::after { transform: translateX(16px); }
.interrupteur .etat { font-size: var(--taille-s); color: var(--discret); min-width: 6ch; }

/* Choix exclusif en tuiles (peu d'options, chacune expliquée) : boutons radio stylés. */
.tuiles { display: grid; gap: var(--e-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.tuile {
	display: grid; gap: 2px; padding: var(--e-3); border: 1px solid var(--bord-fort); border-radius: var(--r-m);
	cursor: pointer; background: var(--surface); position: relative; font-weight: 400;
	transition: border-color var(--duree) var(--courbe), background var(--duree) var(--courbe);
}
.tuile:hover { border-color: var(--discret); }
.tuile input { position: absolute; opacity: 0; pointer-events: none; }
.tuile strong { font-size: var(--taille-s); font-weight: var(--graisse-moyenne); color: var(--texte); }
.tuile span { font-size: var(--taille-xs); color: var(--discret); }
.tuile:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); box-shadow: 0 0 0 1px var(--accent) inset; }
.tuile:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Réglages : une ligne par réglage, explication à gauche, contrôle à droite ; empilé en étroit.
   Remplace l'affichage « valeurs lues + formulaire en vrac » : la valeur EST le contrôle. */
.reglages { display: grid; gap: 0; }
.reglage {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--e-2) var(--e-6); align-items: start;
	padding: var(--e-4) 0; border-bottom: 1px solid var(--bord);
}
.reglage:first-child { padding-top: 0; }
.reglage .texte-reglage { display: grid; gap: 2px; }
.reglage .texte-reglage label, .reglage .texte-reglage .titre-reglage { font-size: var(--taille-m); color: var(--texte); font-weight: var(--graisse-moyenne); }
.reglage .controle { display: grid; gap: var(--e-1); min-width: 0; }
.reglage .controle .unite { display: flex; align-items: center; gap: var(--e-2); }
.reglage .controle .unite input { max-width: 12ch; }
.reglage .controle .unite span { color: var(--discret); font-size: var(--taille-s); }
.reglage[hidden] { display: none; }
.pied-reglages { display: flex; gap: var(--e-3); align-items: center; justify-content: flex-end; padding-top: var(--e-4); flex-wrap: wrap; }
.pied-reglages .etat-modif { margin-right: auto; font-size: var(--taille-s); color: var(--discret); }
.pied-reglages .etat-modif.modifie { color: var(--attente); }
@media (max-width: 760px) { .reglage { grid-template-columns: minmax(0, 1fr); } }

/* Suivi d'une opération (déploiement…) : étape, barre, temps écoulé, estimation. */
.suivi-op { display: grid; gap: var(--e-3); padding: var(--e-4); border: 1px solid var(--info); border-radius: var(--r-l); background: var(--info-doux); }
.suivi-op.ok { border-color: var(--ok); background: var(--ok-doux); }
.suivi-op.echec { border-color: var(--danger); background: var(--danger-doux); }
.suivi-op .tete-suivi { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2) var(--e-3); }
.suivi-op .tete-suivi strong { font-size: var(--taille-m); }
.suivi-op .temps { margin-left: auto; font-variant-numeric: tabular-nums; font-size: var(--taille-s); color: var(--texte-2); display: flex; gap: var(--e-3); flex-wrap: wrap; }
.barre-progres { height: 8px; border-radius: var(--r-plein); background: color-mix(in srgb, var(--surface) 70%, transparent); overflow: hidden; border: 1px solid var(--bord); }
.barre-progres > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .6s var(--courbe); }
.suivi-op.ok .barre-progres > span { background: var(--ok); }
.suivi-op.echec .barre-progres > span { background: var(--danger); }
.barre-progres.indetermine > span { width: 35% !important; animation: glisse 1.3s ease-in-out infinite; }
@keyframes glisse { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.etapes-suivi { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-2); font-size: var(--taille-xs); }
.etapes-suivi li { display: inline-flex; align-items: center; gap: 4px; padding: 1px var(--e-2); border-radius: var(--r-plein); border: 1px solid var(--bord); background: var(--surface); color: var(--discret); }
.etapes-suivi li.fait { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--bord)); }
.etapes-suivi li.cours { color: var(--accent-doux-texte); border-color: var(--accent); font-weight: var(--graisse-moyenne); }
.etapes-suivi li.echec { color: var(--danger); border-color: var(--danger); font-weight: var(--graisse-moyenne); }
@media (prefers-reduced-motion: reduce) { .barre-progres.indetermine > span { animation: none; } }

/* --- États vides et squelettes ---------------------------------------------------------------- */
.vide {
	display: grid; justify-items: center; text-align: center; gap: var(--e-2); padding: var(--e-8) var(--e-4);
	color: var(--discret); border: 1px dashed var(--bord-fort); border-radius: var(--r-l);
}
.vide .pictogramme {
	width: 44px; height: 44px; border-radius: var(--r-l); display: grid; place-items: center;
	background: var(--surface-2); color: var(--texte-2); margin-bottom: var(--e-1);
}
.vide .pictogramme svg { width: 22px; height: 22px; }
.vide strong { color: var(--texte); font-weight: var(--graisse-moyenne); }
.vide p { max-width: 46ch; font-size: var(--taille-s); }
.vide.compact { padding: var(--e-5) var(--e-4); }
.squelette {
	display: block; border-radius: var(--r-s); min-height: 12px;
	background: linear-gradient(90deg, var(--squelette) 25%, var(--squelette-reflet) 50%, var(--squelette) 75%);
	background-size: 200% 100%; animation: reflet 1.3s linear infinite;
}
.squelette.texte { height: 12px; width: 60%; }
.squelette.titre { height: 18px; width: 40%; }
.squelette.bloc { height: 120px; border-radius: var(--r-l); }
.squelette.court { width: 30%; }
@keyframes reflet { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Notifications (toasts) ------------------------------------------------------------------ */
.toasts {
	position: fixed; right: var(--e-4); bottom: var(--e-4); z-index: 60; display: grid; gap: var(--e-2);
	width: min(420px, calc(100vw - 2 * var(--e-4))); pointer-events: none;
}
.toast {
	pointer-events: auto; display: flex; gap: var(--e-3); align-items: flex-start; background: var(--surface);
	color: var(--texte); border: 1px solid var(--bord); border-left: 4px solid var(--ok); border-radius: var(--r-m);
	padding: var(--e-3) var(--e-3) var(--e-3) var(--e-4); box-shadow: var(--ombre-3); font-size: var(--taille-s);
	animation: entree var(--duree) var(--courbe);
}
.toast > svg { color: var(--ok); margin-top: 2px; }
.toast.erreur { border-left-color: var(--danger); }
.toast.erreur > svg { color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast.info > svg { color: var(--info); }
.toast .texte { flex: 1; min-width: 0; word-break: break-word; }
.toast button { background: none; border: 0; color: var(--discret); cursor: pointer; padding: 2px; border-radius: var(--r-s); }
.toast button:hover { color: var(--texte); }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } }

/* --- Journal de build ----------------------------------------------------------------------- */
.journal {
	background: var(--journal-fond); color: var(--journal-texte); border-radius: var(--r-m); padding: var(--e-3) var(--e-4);
	max-height: 62vh; min-height: 120px; overflow: auto; margin: 0; white-space: pre-wrap; word-break: break-word;
	font-family: var(--police-mono); font-size: .78rem; line-height: 1.55;
}
.journal .n { color: var(--journal-discret); user-select: none; }
.journal .etape { color: var(--journal-etape); }
.journal .erreur { color: var(--journal-erreur); }
.journal .avert { color: var(--journal-avert); }
.journal .reussi { color: var(--journal-ok); }
.journal:focus-visible { outline-offset: 0; }
/* Frise des étapes et encadré des problèmes (journal-analyse.js), au-dessus du journal. */
.analyse { display: flex; flex-direction: column; gap: var(--e-2); }
.frise { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-2); }
.etape-frise {
	display: inline-flex; align-items: center; gap: var(--e-1); padding: 2px var(--e-2); border-radius: var(--r-plein);
	border: 1px solid var(--bord); background: var(--surface); font-size: var(--taille-s); max-width: 100%;
}
.etape-frise .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.etape-frise .duree, .etape-frise .compte { color: var(--discret); font-variant-numeric: tabular-nums; }
.etape-frise.ok .signe { color: var(--ok); }
.etape-frise.cours { border-color: var(--accent); }
.etape-frise.cours .signe { color: var(--accent); animation: battement 1.2s ease-in-out infinite; }
.etape-frise.signale .signe { color: var(--attente); }
.etape-frise.echec { border-color: var(--danger); background: var(--danger-doux); color: var(--danger-texte); font-weight: var(--graisse-moyenne); }
.etape-frise[role="button"] { cursor: pointer; }
.etape-frise[role="button"]:hover { border-color: var(--bord-fort); }
@keyframes battement { 50% { opacity: .35; } }
.problemes details { border: 1px solid var(--bord); border-radius: var(--r-m); padding: var(--e-2) var(--e-3); background: var(--surface); }
.problemes details.danger { border-color: var(--danger); background: var(--danger-doux); }
.problemes details.avert { border-color: var(--attente); background: var(--attente-doux); }
.problemes summary { cursor: pointer; font-weight: var(--graisse-moyenne); }
.problemes ul { list-style: none; margin: var(--e-2) 0 0; padding: 0; max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.problemes button.lien {
	all: unset; cursor: pointer; display: flex; gap: var(--e-2); align-items: baseline; width: 100%; box-sizing: border-box;
	padding: 2px var(--e-1); border-radius: var(--r-s); font-size: var(--taille-s);
}
.problemes button.lien:hover, .problemes button.lien:focus-visible { background: var(--voile); outline: 2px solid var(--focus); outline-offset: -2px; }
.analyse, .problemes, .problemes details, .problemes li { min-width: 0; max-width: 100%; }
.problemes .motif { font-weight: var(--graisse-moyenne); white-space: nowrap; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.problemes button.erreur .motif { color: var(--danger-texte); }
.problemes .etape { color: var(--discret); white-space: nowrap; flex: none; }
.problemes code { font-family: var(--police-mono); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 0; }
.journal .vise { outline: 2px solid var(--journal-avert); border-radius: 2px; animation: vise 1.6s ease-out; }
@keyframes vise { from { background: color-mix(in srgb, var(--journal-avert) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .etape-frise.cours .signe, .journal .vise { animation: none; } }
pre.donnees {
	background: var(--code-fond); border: 1px solid var(--bord); border-radius: var(--r-m); padding: var(--e-3);
	margin: 0; overflow: auto; font-size: .78rem; max-height: 280px;
}

/* --- Zones ---------------------------------------------------------------------------------- */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--bord)); }
.danger-zone > header h2 { color: var(--danger); }
.avertissement {
	background: var(--attente-doux); color: var(--attente); border-radius: var(--r-m); padding: var(--e-2) var(--e-3);
	font-size: var(--taille-s); display: flex; gap: var(--e-2); align-items: flex-start;
}
.avertissement.danger { background: var(--danger-doux); color: var(--danger); }
/* Bandeau « push sans déploiement » (services externes, L80) : action poussée à droite. */
.avertissement.bandeau { align-items: center; flex-wrap: wrap; margin: 0; }
.avertissement.bandeau > .bouton, .avertissement.bandeau > a.bouton { margin-left: auto; }
.liste-commits { margin: var(--e-2) 0 0; padding-left: 1.2em; font-size: var(--taille-s); display: grid; gap: 2px; }
.avertissement.succes { background: var(--ok-doux); color: var(--ok); }
.avertissement.liste { flex-direction: column; gap: var(--e-1); }
.avertissement.liste ul { margin: 0; padding-left: var(--e-4); }
.encart { background: var(--surface-2); border-radius: var(--r-m); padding: var(--e-3) var(--e-4); font-size: var(--taille-s); }

/* --- Approbations --------------------------------------------------------------------------- */
.barre-selection {
	position: sticky; top: calc(var(--hauteur-barre) + var(--e-2)); z-index: 5; display: flex; align-items: center;
	gap: var(--e-3); flex-wrap: wrap; background: var(--surface); border: 1px solid var(--bord-fort);
	border-radius: var(--r-l); padding: var(--e-2) var(--e-3); box-shadow: var(--ombre-2);
}
.barre-selection .boutons { margin-left: auto; }
.approbation { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--e-3) var(--e-4); }
.approbation > .case { align-self: start; margin-top: 2px; }
.approbation .corps { display: grid; gap: var(--e-3); min-width: 0; }
.approbation .titre-ligne { display: flex; gap: var(--e-2); align-items: center; flex-wrap: wrap; }
.approbation .resume { font-size: var(--taille-m); }
.approbation.selectionnee { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.impact { display: flex; flex-wrap: wrap; gap: var(--e-2); }
.impact .puce {
	display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--bord); border-radius: var(--r-m);
	padding: 2px var(--e-2); font-size: var(--taille-xs); background: var(--surface-2);
}
.impact .puce b { font-weight: var(--graisse-moyenne); color: var(--discret); }
.liste-confirmation { margin: 0; padding-left: 1.2em; max-height: 40vh; overflow: auto; font-size: var(--taille-s); display: grid; gap: var(--e-1); }

/* --- Dialogues et palette ------------------------------------------------------------------- */
dialog {
	border: 1px solid var(--bord); border-radius: var(--r-xl); background: var(--surface); color: var(--texte);
	padding: var(--e-6); width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
	box-shadow: var(--ombre-3);
}
dialog::backdrop { background: var(--voile); }
dialog form { display: grid; gap: var(--e-4); }
dialog h2 { font-size: var(--taille-l); }
.secret-une-fois { display: grid; gap: 6px; }
.secret-une-fois code { display: block; padding: var(--e-2); font-size: var(--taille-s); user-select: all; }
dialog.palette { padding: 0; width: min(620px, calc(100vw - 32px)); margin-top: 12vh; overflow: hidden; }
.palette .saisie { display: flex; align-items: center; gap: var(--e-2); padding: var(--e-3) var(--e-4); border-bottom: 1px solid var(--bord); }
.palette .saisie svg { color: var(--discret); }
.palette .saisie input { border: 0; padding: var(--e-1) 0; box-shadow: none; background: none; font-size: var(--taille-l); }
.palette .saisie input:focus-visible { box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: var(--e-2); max-height: 50vh; overflow-y: auto; }
.palette li {
	display: flex; align-items: center; gap: var(--e-3); padding: var(--e-2) var(--e-3); border-radius: var(--r-m);
	cursor: pointer; color: var(--texte-2);
}
.palette li .groupe { margin-left: auto; font-size: var(--taille-xs); color: var(--discret); }
.palette li[aria-selected="true"] { background: var(--accent-doux); color: var(--accent-doux-texte); }
.palette li[aria-selected="true"] .groupe { color: var(--accent-doux-texte); }
.palette .rien { padding: var(--e-5); text-align: center; color: var(--discret); }
.palette .pied { display: flex; gap: var(--e-4); padding: var(--e-2) var(--e-4); border-top: 1px solid var(--bord); font-size: var(--taille-xs); color: var(--discret); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
}

/* Centre de notifications (L70) */
/* Liste dense : une ligne par notification (gravité | titre et contexte | actions), détail dessous. */
.liste-notifications { gap: 0; padding-block: var(--e-2); }
.notification {
	display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--e-1) var(--e-3); align-items: start;
	padding: var(--e-3) 0; border-bottom: 1px solid var(--bord);
}
.notification:last-child { border-bottom: 0; }
.notification > .gravite { padding-top: 1px; }
.notification > .avertissement, .notification > .pile { grid-column: 2 / -1; }
.notification .corps-notification { display: grid; gap: 2px; min-width: 0; }
.notification .titre-notification { font-weight: var(--graisse-moyenne); overflow-wrap: anywhere; }
.notification .meta { color: var(--discret); font-size: var(--taille-xs); display: flex; flex-wrap: wrap; gap: var(--e-1); align-items: center; }
.notification > .boutons { flex-wrap: nowrap; }
.notification.acquittee { opacity: .7; }
.notification.en-avant { background: var(--accent-doux); margin-inline: calc(-1 * var(--e-5)); padding-inline: var(--e-5); }
@media (max-width: 600px) {
	.notification { grid-template-columns: minmax(0, 1fr); }
	.notification > .avertissement, .notification > .pile { grid-column: 1; }
	.notification > .boutons { justify-content: flex-start; }
}
.barre-filtres { gap: var(--e-2) var(--e-3); }
.barre-filtres > .bouton:last-child { margin-left: auto; }

/* Journal d'exécution (onglet Journal) */
.journal-barre { display: flex; gap: var(--e-2) var(--e-4); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.journal-execution .niveau { font-weight: var(--graisse-moyenne); }

/* Stockage & Redis : jauge d'utilisation, liste des objets, zone dangereuse dans une carte. */
meter { width: 8rem; height: .7rem; vertical-align: middle; }
.objets:empty { display: none; }
.carte .danger-zone { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--bord); }

/* Analyse du code (L66) */
.filtres-analyse select { min-width: 180px; }
.message-github { white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Lot G : ergonomie générale (menu d'actions, sections, choix, suivis en fond) ---------- */

/* Bouton occupé depuis plus de 2 s : temps écoulé (js/ui.js chronoOccupe). */
.chrono-occupe { font-variant-numeric: tabular-nums; font-weight: 400; opacity: .8; font-size: .92em; }
.chrono-occupe::before { content: "· "; }

/* Ligne d'options sous un formulaire en pile (portée, case « stricte ») : alignées sur une ligne. */
form.pile > div.ligne { display: flex; flex-wrap: wrap; gap: var(--e-3) var(--e-6); align-items: center; }

/* Oui/non avec explication (assistant) : l'aide s'aligne sous le libellé, pas sous l'interrupteur. */
.oui-non { display: grid; gap: 2px; }
.oui-non > .aide { padding-left: 46px; }
.oui-non .interrupteur > span:not(.etat) { color: var(--texte); font-size: var(--taille-m); }

/* Actions d'une ligne de tableau : sur une seule ligne en écran large (geste principal + « ⋯ »). */
@media (min-width: 601px) { td.actions > .boutons { flex-wrap: nowrap; } }

/* Note d'une ligne de tableau : deux lignes au plus (entière au survol, title). */
.note-ligne { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 36ch; }

/* Carte de projet : le badge d'un déploiement en cours n'est jamais rogné (le texte l'est). */
.projet-carte .ligne > .badge { flex: none; overflow: visible; margin-left: auto; }

/* Compteurs : valeur alignée en bas quelle que soit la longueur du libellé. */
.compteur-carte { grid-template-rows: 1fr auto; }
.compteur-carte .libelle { align-items: flex-start; }
.compteur-carte .libelle svg { margin-top: 2px; }

/* État vide dans une carte : pas de second cadre en pointillés, un fond discret. */
.carte > .vide, .carte .defile + .vide, .carte > div > .vide { border-color: transparent; background: var(--surface-2); }

/* Longues listes (js/dom.js tableLongue) : filtre et compte au-dessus, « Afficher plus » dessous. */
.table-longue { display: grid; gap: var(--e-3); min-width: 0; }
.table-longue > .outils .filtre { flex: 0 1 360px; }
.table-longue > .outils .aide { margin-left: auto; font-variant-numeric: tabular-nums; }
.table-longue > .boutons:has(> [hidden]:only-child) { display: none; }

/* Menu d'actions (js/ui.js menuActions) : bouton « Actions ▾ », liste sous le bouton. */
.conteneur-menu { position: relative; display: inline-flex; }
.chevron-menu {
	width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg);
	margin-left: 2px; flex: none; opacity: .7; transition: transform var(--duree) var(--courbe);
}
.icone-seule > .chevron-menu { display: none; }
.declencheur-menu[aria-expanded="true"] { background: var(--surface-2); }
[aria-expanded="true"] > .chevron-menu { transform: translateY(1px) rotate(-135deg); }
.menu-actions {
	position: fixed; z-index: 45; min-width: 280px; max-width: min(360px, calc(100vw - 32px));
	background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); box-shadow: var(--ombre-3);
	padding: var(--e-1); display: grid; gap: 2px; animation: entree var(--duree) var(--courbe);
}
.element-menu {
	all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--e-2); align-items: center;
	padding: var(--e-2) var(--e-3); border-radius: var(--r-m); cursor: pointer; font-size: var(--taille-s); font-weight: var(--graisse-moyenne); color: var(--texte);
}
.element-menu > svg.icone { grid-row: span 2; color: var(--discret); }
.element-menu .aide-menu { grid-column: 2; font-size: var(--taille-xs); font-weight: 400; color: var(--discret); }
.element-menu:hover, .element-menu:focus-visible { background: var(--surface-2); outline: none; }
.element-menu:focus-visible { box-shadow: 0 0 0 2px var(--focus) inset; }
.element-menu.danger, .element-menu.danger > svg.icone { color: var(--danger); }
.element-menu.danger:hover, .element-menu.danger:focus-visible { background: var(--danger-doux); }
.element-menu[aria-busy="true"] { cursor: progress; }
.element-menu[aria-busy="true"] > svg.icone { display: none; }
.element-menu[aria-busy="true"]::before {
	content: ""; grid-row: span 2; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor;
	border-right-color: transparent; animation: tourne .7s linear infinite;
}
@media (max-width: 600px) { .menu-actions { position: fixed; left: var(--e-4); right: var(--e-4); top: auto; bottom: var(--e-4); max-width: none; min-width: 0; } }

/* Choix en segments (js/ui.js choix) : boutons radio cachés, libellés en segments. */
.segments.choix { display: inline-flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.segments.choix label {
	position: relative; display: inline-flex; align-items: center; min-height: 30px; padding: 4px var(--e-3); border-radius: var(--r-s);
	font-size: var(--taille-s); color: var(--discret); cursor: pointer; font-weight: 500;
}
.segments.choix label:hover { color: var(--texte); }
.segments.choix input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.segments.choix label:has(input:checked) { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.segments.choix label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.segments.choix label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
form.ligne .champ:has(> .segments.choix) { flex: 0 0 auto; }
form.ligne .segments.choix { min-height: 38px; align-items: center; }

/* Formulaires en ligne : boutons et cases calés sur la ligne des champs. Un formulaire qui suit
   un tableau dans une carte en est séparé par un filet. */
form.ligne > .case { min-height: 38px; }
form.ligne > .boutons { flex: 0 0 auto; }
.carte > .defile + form.ligne, .carte > .vide + form.ligne { padding-top: var(--e-4); border-top: 1px solid var(--bord); }

/* Page projet : en-tête compact, contexte (environnement, service), sections à gauche. */
.selecteurs { gap: var(--e-2) var(--e-5); }
.selecteur { display: inline-flex; align-items: center; gap: var(--e-2); min-width: 0; flex-wrap: wrap; }
.selecteur > .etiquette { font-size: var(--taille-xs); color: var(--discret); text-transform: uppercase; letter-spacing: .05em; }
.page-sections { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: var(--e-5); align-items: start; }
/* Colonne collante, bornée à la fenêtre : au-delà, elle défile seule (ascenseur fin), sans
   entraîner la page. */
.sections {
	position: sticky; top: calc(var(--hauteur-barre) + var(--e-4)); min-width: 0;
	max-height: calc(100vh - var(--hauteur-barre) - 2 * var(--e-4)); overflow-y: auto; overscroll-behavior: contain;
	scrollbar-width: thin; padding-right: 2px;
}
.liste-sections { display: grid; gap: 1px; }
.onglets-groupe { display: grid; gap: 1px; }
.onglets-groupe[hidden] { display: none; }
.groupe-sections {
	display: flex; align-items: center; gap: var(--e-1); width: 100%; background: none; border: 0; border-radius: var(--r-m); cursor: pointer; text-align: left;
	font: inherit; font-size: var(--taille-xs); color: var(--discret); text-transform: uppercase; letter-spacing: .06em; font-weight: var(--graisse-moyenne);
	padding: var(--e-4) var(--e-3) var(--e-1);
}
.groupe-sections:hover { color: var(--texte); }
.groupe-sections::after {
	content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px); transition: transform .15s;
}
.groupe-sections[aria-expanded="false"]::after { transform: rotate(-45deg); }
.groupe-sections:first-child { padding-top: var(--e-1); }
.liste-sections a {
	display: block; padding: 6px var(--e-3); border-radius: var(--r-m); color: var(--texte-2); text-decoration: none; font-size: var(--taille-s);
	font-weight: 500; overflow-wrap: anywhere; line-height: 1.35;
}
.liste-sections a:hover { background: var(--surface-2); color: var(--texte); }
.liste-sections a[aria-selected="true"] { background: var(--accent-doux); color: var(--accent-doux-texte); box-shadow: 2px 0 0 var(--accent) inset; }
.deplier-sections { display: none; }
@media (max-width: 1100px) {
	.page-sections { grid-template-columns: minmax(0, 1fr); gap: var(--e-4); }
	.sections { position: relative; top: 0; max-height: none; overflow: visible; padding-right: 0; }
	.deplier-sections {
		display: flex; align-items: center; gap: var(--e-1); width: 100%; font: inherit; font-size: var(--taille-s); cursor: pointer; color: var(--texte);
		background: var(--surface); border: 1px solid var(--bord-fort); border-radius: var(--r-m); padding: var(--e-2) var(--e-3); min-height: 42px; text-align: left;
	}
	.deplier-sections .chevron-menu { margin-left: auto; }
	.sections:not(.ouverte) .liste-sections { display: none; }
	.sections.ouverte .liste-sections {
		margin-top: var(--e-2); padding: var(--e-3); background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l);
		box-shadow: var(--ombre-2); column-gap: var(--e-3); max-height: 70vh; overflow-y: auto; overscroll-behavior: contain;
	}
	.sections.ouverte .onglets-groupe { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); column-gap: var(--e-3); }
	.sections.ouverte .groupe-sections { padding-inline: var(--e-1); }
}

/* Suivis de tâches en fond (js/ui.js suivreTache) : en bas à gauche du contenu. */
.suivis {
	position: fixed; left: calc(var(--largeur-laterale) + var(--e-4)); bottom: var(--e-4); z-index: 55; display: grid; gap: var(--e-2);
	width: min(440px, calc(100vw - var(--largeur-laterale) - 2 * var(--e-4)));
}
.suivis:empty { display: none; }
.suivi-fond { position: relative; box-shadow: var(--ombre-3); border-radius: var(--r-l); background: var(--surface); animation: entree var(--duree) var(--courbe); }
.suivi-fond > .suivi-op { padding-right: var(--e-10); }
.suivi-fond > button { position: absolute; top: var(--e-2); right: var(--e-2); }
@media (max-width: 860px) { .suivis { left: var(--e-4); right: var(--e-4); width: auto; } }

/* --- Bandeau « Cookies et préférences » (js/cookies.js) : toutes les pages ------------------ */
.kc-cookies {
	position: fixed; inset: auto var(--e-4) var(--e-4) var(--e-4); z-index: 60; margin-inline: auto; max-width: 880px;
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--e-3) var(--e-5);
	padding: var(--e-4) var(--e-5); border: 1px solid var(--bord-fort); border-radius: var(--r-l);
	background: var(--surface); color: var(--texte); box-shadow: var(--ombre-3); font-size: var(--taille-s);
	max-height: calc(100vh - 2 * var(--e-4)); overflow: auto;
}
.kc-cookies-texte { flex: 1 1 420px; display: grid; gap: var(--e-2); }
.kc-cookies-texte p { margin: 0; }
.kc-cookies-titre { font-size: var(--taille-m); font-weight: var(--graisse-forte); }
.kc-cookies-sla { color: var(--discret); }
.kc-cookies-actions { display: flex; flex-wrap: wrap; gap: var(--e-2); justify-content: flex-end; margin-left: auto; }
.kc-cookies-lien {
	border: 0; padding: 0; background: none; color: var(--discret); font: inherit; cursor: pointer;
	text-decoration: underline; text-underline-offset: 2px;
}
.kc-cookies-lien:hover { color: var(--texte); }
.laterale .kc-cookies-lien { font-size: var(--taille-xs); text-align: left; padding: var(--e-1) var(--e-3); }
.kc-cookies-dialogue {
	width: min(680px, calc(100vw - 2 * var(--e-4))); max-height: calc(100vh - 2 * var(--e-4)); overflow: auto;
	padding: var(--e-5); border: 1px solid var(--bord-fort); border-radius: var(--r-l);
	background: var(--surface); color: var(--texte); box-shadow: var(--ombre-3); font-size: var(--taille-s);
}
.kc-cookies-dialogue::backdrop { background: var(--voile); }
.kc-cookies-dialogue h2 { margin: 0 0 var(--e-2); font-size: var(--taille-l); }
.kc-cookies-dialogue p { margin: var(--e-2) 0 0; }
.kc-cookies-dialogue ul { margin: var(--e-2) 0 0; padding-left: var(--e-5); display: grid; gap: var(--e-1); }
.kc-cookies-dialogue code { font-family: var(--police-mono); font-size: var(--taille-xs); overflow-wrap: anywhere; }
.kc-cookies-categorie { margin-top: var(--e-4); padding-top: var(--e-4); border-top: 1px solid var(--bord); }
.kc-cookies-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e-2) var(--e-4); }
.kc-cookies-tete h3 { margin: 0; font-size: var(--taille-m); }
.kc-cookies-etat { color: var(--discret); font-size: var(--taille-xs); }
.kc-cookies-bascule { display: inline-flex; align-items: center; gap: var(--e-2); cursor: pointer; font-weight: var(--graisse-moyenne); }
.kc-cookies-bascule input { width: 18px; height: 18px; accent-color: var(--accent); }
.kc-cookies-dialogue .kc-cookies-actions { margin-top: var(--e-5); }
@media (max-width: 560px) {
	.kc-cookies { inset: auto var(--e-2) var(--e-2) var(--e-2); padding: var(--e-3) var(--e-4); }
	.kc-cookies-actions { width: 100%; }
	.kc-cookies-actions .bouton { flex: 1 1 auto; }
	.kc-cookies > .kc-cookies-actions .bouton:first-child { flex-basis: 100%; }
}
