/* ==========================================================================
   Agent comptable — interface
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --surface-3: #e8e5dc;
  --border: #e3e0d6;
  --border-strong: #cfcbbf;
  --text: #1c1d1b;
  --text-2: #565851;
  --text-3: #8a8c84;
  --accent: #1e5c4a;
  --accent-hover: #164638;
  --accent-soft: #e2eee8;
  --accent-text: #1e5c4a;
  --on-accent: #ffffff;
  --ok: #2c7a4b;      --ok-soft: #e3f1e7;
  --warn: #9a5c10;    --warn-soft: #faefdc;
  --danger: #b2352c;  --danger-soft: #fae5e2;
  --info: #34559f;    --info-soft: #e6ecf8;
  --logo-trait: #ffffff;
  --logo-point: #b9e4d3;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  --ombre-1: 0 1px 2px rgb(28 29 27 / 6%);
  --ombre-2: 0 2px 6px rgb(28 29 27 / 6%), 0 8px 24px rgb(28 29 27 / 6%);
  --ombre-3: 0 12px 48px rgb(28 29 27 / 18%);
  --r-1: 6px; --r-2: 10px; --r-3: 14px; --r-4: 20px;
  --police: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: "Source Serif 4", Georgia, "Times New Roman", serif;
  --police-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --laterale: 276px;
  --deroule: 420px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131412;
    --surface: #1b1c1a;
    --surface-2: #171816;
    --surface-3: #252723;
    --border: #2b2d29;
    --border-strong: #3b3d38;
    --text: #ecebe5;
    --text-2: #a8a9a1;
    --text-3: #777972;
    --accent: #5fb898;
    --accent-hover: #77c7aa;
    --accent-soft: #1d2f28;
    --accent-text: #82d0b4;
    --on-accent: #0d1a15;
    --ok: #6cc18e;      --ok-soft: #1b2d21;
    --warn: #e2a65b;    --warn-soft: #33281a;
    --danger: #ef8378;  --danger-soft: #3a1f1c;
    --info: #92abe8;    --info-soft: #1e2536;
    --logo-trait: #0d1a15;
    --logo-point: #1e5c4a;
    --ombre-1: 0 1px 2px rgb(0 0 0 / 30%);
    --ombre-2: 0 2px 6px rgb(0 0 0 / 25%), 0 8px 24px rgb(0 0 0 / 25%);
    --ombre-3: 0 12px 48px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14.5px/1.55 var(--police);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
code, kbd, pre { font-family: var(--police-mono); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-petit { width: 16px; height: 16px; }
.ic-grand { width: 32px; height: 32px; stroke-width: 1.4; }
.logo { width: 28px; height: 28px; color: var(--accent); flex: none; stroke: var(--logo-trait); stroke-linecap: round; }
.sous-titre { color: var(--text-2); font-size: 13.5px; }
.aide { color: var(--text-3); font-size: 12.5px; text-align: center; }
.mobile-seul { display: none; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-2); border: 1px solid transparent;
  font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primaire { background: var(--accent); color: var(--on-accent); box-shadow: var(--ombre-1); }
.btn-primaire:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondaire { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--ombre-1); }
.btn-secondaire:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.btn-fantome { background: transparent; color: var(--text-2); }
.btn-fantome:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-petit { height: 32px; padding: 0 11px; font-size: 13.5px; }
.btn-large { height: 44px; font-size: 15px; }
.btn-bloc { width: 100%; }
.btn-icone {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-2);
  border: 0; background: transparent; color: var(--text-2);
}
.btn-icone:hover { background: var(--surface-3); color: var(--text); }

/* ---------- champs ---------- */
.champ { display: grid; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.champ > span, .champ > legend { font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0; margin-bottom: 0; }
.champ small { color: var(--text-3); font-size: 12px; }
fieldset.champ > legend { margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="search"], input:not([type]), textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-2);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); }

.alerte { padding: 10px 12px; border-radius: var(--r-2); font-size: 13.5px; }
.alerte-danger { background: var(--danger-soft); color: var(--danger); }

.etiquette {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.etiquette-accent { background: var(--accent-soft); color: var(--accent-text); }
.etiquette-ok { background: var(--ok-soft); color: var(--ok); }
.etiquette-warn { background: var(--warn-soft); color: var(--warn); }
.etiquette-danger { background: var(--danger-soft); color: var(--danger); }
.etiquette-info { background: var(--info-soft); color: var(--info); }
.etiquette .puce { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #fff;
  background: var(--accent);
}

/* ---------- connexion ---------- */
.connexion { display: grid; grid-template-columns: minmax(380px, 1.05fr) 1fr; min-height: 100vh; }
.connexion-marque {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 56px; color: #eaf3ef;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgb(120 200 170 / 22%), transparent 60%),
    radial-gradient(800px 500px at -20% 110%, rgb(0 0 0 / 30%), transparent 60%),
    #173f33;
}
.connexion-marque::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(160deg, #000 10%, transparent 70%);
}
.connexion-marque > * { position: relative; z-index: 1; }
.marque { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; color: var(--text); letter-spacing: -0.01em; }
.marque-claire { color: #fff; }
.marque-claire .logo { color: #eaf3ef; --logo-trait: #173f33; --logo-point: #2f8a6c; }
.connexion-pitch h1 {
  font-family: var(--police-titre); font-weight: 500; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.15;
  letter-spacing: -0.02em; margin-bottom: 36px;
}
.connexion-pitch h1 em { font-style: italic; color: #a9dcc8; }
.pitch-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 440px; }
.pitch-liste li { display: flex; gap: 12px; align-items: flex-start; color: #cfe2da; font-size: 14.5px; }
.pitch-liste b { color: #fff; font-weight: 600; }
.pitch-liste .ic { margin-top: 2px; color: #8fd0b6; }
.connexion-pied { color: #8fb3a6; font-size: 12.5px; }

.connexion-form-zone { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }
.connexion-form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.connexion-form h2 { font-family: var(--police-titre); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.connexion-form .sous-titre { margin-top: -10px; margin-bottom: 8px; }
.marque-mobile { display: none; margin-bottom: 20px; }

.ecran-centre { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.carte { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-4); box-shadow: var(--ombre-2); padding: 32px; }
.carte-etroite { width: 100%; max-width: 420px; display: grid; gap: 14px; }
.carte-etroite h2 { font-family: var(--police-titre); font-size: 24px; }
.pastille-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.pastille-ok { background: var(--ok-soft); color: var(--ok); margin: 0 auto; }

/* ---------- application ---------- */
.app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: var(--laterale) minmax(0, 1fr) 0;
  transition: grid-template-columns .25s ease;
}
.app.avec-deroule { grid-template-columns: var(--laterale) minmax(0, 1fr) var(--deroule); }
.voile { display: none; }

/* barre latérale */
.laterale {
  display: flex; flex-direction: column; gap: 12px; min-height: 0;
  padding: 16px 12px 12px; background: var(--surface-2); border-right: 1px solid var(--border);
}
.laterale-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 6px; }
.laterale-haut .marque { white-space: nowrap; font-size: 15px; }
.espace-entreprise { font-size: 11.5px; color: var(--text-2); background: var(--surface-3); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.recherche { position: relative; display: block; }
.recherche .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.recherche input { height: 34px; padding-left: 32px; background: var(--surface); border-color: var(--border); font-size: 13.5px; }

.conversations { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.groupe-titre { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.conv {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%;
  height: 34px; padding: 0 6px 0 10px; border-radius: var(--r-1); color: var(--text-2);
  font-size: 13.5px; cursor: pointer; border: 0; background: transparent; text-align: left;
}
.conv:hover { background: var(--surface-3); color: var(--text); }
.conv.actif { background: var(--surface); color: var(--text); box-shadow: var(--ombre-1); font-weight: 500; }
.conv-titre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .btn-icone { width: 26px; height: 26px; opacity: 0; color: var(--text-3); }
.conv .btn-icone .ic { width: 15px; height: 15px; }
.conv:hover .btn-icone, .conv.actif .btn-icone { opacity: 1; }
.conv .btn-icone:hover { color: var(--danger); background: var(--danger-soft); }
.conversations-vide { padding: 24px 12px; text-align: center; color: var(--text-3); font-size: 13px; }

.laterale-bas { display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.budget { padding: 0 6px; }
.budget-ligne { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.budget-ligne span:last-child { font-variant-numeric: tabular-nums; color: var(--text-2); }
.jauge { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.jauge-remplie { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.jauge-remplie.alerte-haute { background: var(--warn); }
.jauge-remplie.alerte-max { background: var(--danger); }

.profil { position: relative; }
.profil-bouton {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: var(--r-2);
  border: 0; background: transparent; text-align: left;
}
.profil-bouton:hover, .profil-bouton[aria-expanded="true"] { background: var(--surface-3); }
.profil-texte { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.profil-texte b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil-texte small { color: var(--text-3); font-size: 12px; }

.menu {
  position: absolute; z-index: 40; min-width: 220px; padding: 6px; border-radius: var(--r-3);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--ombre-3);
  animation: apparition .12s ease-out;
}
#menu-profil { bottom: calc(100% + 6px); left: 0; right: 0; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--text); font-size: 13.5px; text-align: left;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item .ic { color: var(--text-2); width: 16px; height: 16px; }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-flottant { position: fixed; }

/* espace principal */
.principal { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.barre {
  display: flex; align-items: center; gap: 12px; height: 56px; flex: none; padding: 0 20px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
}
.barre-titre { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btn-deroule[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.point-vif { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulsation 1.4s ease-in-out infinite; }

.fil { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.fil-interieur { max-width: 780px; margin: 0 auto; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 22px; }

/* accueil */
.accueil { padding: 6vh 0 8px; animation: monte .35s ease-out; }
.accueil h2 { font-family: var(--police-titre); font-weight: 500; font-size: clamp(28px, 3.2vw, 38px); letter-spacing: -0.02em; line-height: 1.2; }
.accueil h2 em { font-style: normal; color: var(--accent-text); }
.accueil > p { color: var(--text-2); font-size: 15.5px; margin-top: 8px; max-width: 560px; }
.suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.suggestion {
  display: grid; gap: 10px; align-content: start; padding: 16px; min-height: 128px; text-align: left;
  border-radius: var(--r-3); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--ombre-1);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.suggestion:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--ombre-2); transform: translateY(-1px); }
.suggestion .pastille { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.suggestion .pastille .ic { width: 17px; height: 17px; }
.suggestion b { font-weight: 600; font-size: 14px; }
.suggestion small { color: var(--text-2); font-size: 12.5px; line-height: 1.45; }

/* messages */
.msg { animation: monte .25s ease-out; }
.msg-utilisateur { align-self: flex-end; max-width: 82%; }
.msg-utilisateur .bulle {
  padding: 11px 15px; border-radius: 16px 16px 4px 16px; background: var(--surface-3); color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
}
.msg-assistant { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; }
.msg-assistant > .logo { width: 30px; height: 30px; margin-top: 2px; }
.reponse { min-width: 0; }
.msg-assistant.selection .lien-deroule { background: var(--accent-soft); color: var(--accent-text); }
.reponse-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; color: var(--text-3); font-size: 12.5px; }
.reponse-meta .lien-deroule {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; margin-left: -8px; border: 0; border-radius: var(--r-1);
  background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500;
}
.reponse-meta .lien-deroule:hover { background: var(--surface-3); color: var(--text); }
.reponse-meta .lien-deroule .ic { width: 14px; height: 14px; }
.reponse-meta .num { font-variant-numeric: tabular-nums; }

/* texte riche */
.prose { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote { margin: 0 0 12px; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-size: 15.5px; font-weight: 600; margin: 20px 0 8px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--text-3); }
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -22px; display: flex; gap: 9px; align-items: flex-start; }
.prose input[type="checkbox"] {
  appearance: none; flex: none; width: 16px; height: 16px; margin: 4px 0 0; border-radius: 4px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
}
.prose input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.prose code { font-size: .86em; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); }
.prose pre { padding: 12px 14px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; font-size: 12.5px; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { padding: 2px 0 2px 14px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.prose table {
  display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-radius: var(--r-2); font-size: 13.5px; background: var(--surface);
}
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose td { font-variant-numeric: tabular-nums; }
.prose td:not(:last-child), .prose th { white-space: nowrap; }

/* carte de progression */
.progression {
  border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1);
  padding: 16px 18px; display: grid; gap: 14px;
}
.progression-tete { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; }
.progression-tete .chrono { margin-left: auto; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 400; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: tourne .8s linear infinite; flex: none; }
.etapes-phases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.etape-phase { display: grid; gap: 7px; }
.etape-phase .trait { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.etape-phase.faite .trait { background: var(--accent); }
.etape-phase.active .trait::after {
  content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--accent);
  animation: glisse 1.2s ease-in-out infinite;
}
.etape-phase span { font-size: 12px; color: var(--text-3); }
.etape-phase.active span, .etape-phase.faite span { color: var(--text); }
.etape-phase.active span { font-weight: 600; }
.progression-detail { font-size: 13px; color: var(--text-2); min-height: 20px; display: flex; gap: 8px; align-items: center; }
.progression-detail .ic { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.progression-detail > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.progression-detail .etiquette { flex: none; }
.etapes-phases.dense span { display: none; }
.etiquette-type { height: 20px; font-size: 11px; padding: 0 7px; text-transform: lowercase; }
.type-code { background: var(--info-soft); color: var(--info); }
.type-llm, .type-agent { background: var(--accent-soft); color: var(--accent-text); }
.type-validation_humaine { background: var(--warn-soft); color: var(--warn); }
.type-message { background: var(--surface-3); color: var(--text-2); }

/* workflows : lanceurs et choix */
.suggestion-workflow { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.suggestion-workflow b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.suggestion-workflow .etiquette { height: 19px; font-size: 11px; }
.suggestion.verrouille { opacity: .65; background: var(--surface); border-style: dashed; }
.suggestion.verrouille .pastille { background: var(--surface-3); color: var(--text-3); }
.suggestion.verrouille .etiquette { background: var(--surface-3); color: var(--text-2); }
.choix-workflow {
  max-width: 780px; margin: 0 auto 8px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px;
  border-radius: var(--r-2); background: var(--accent-soft); color: var(--accent-text); font-size: 13.5px; animation: monte .2s ease-out;
}
.choix-workflow > span { flex: 1; min-width: 0; }
.choix-workflow small { color: var(--text-2); }
.choix-workflow .btn-icone { width: 28px; height: 28px; color: var(--accent-text); }

/* validation humaine */
.carte-validation {
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); border-radius: var(--r-3); background: var(--surface);
  box-shadow: var(--ombre-2); padding: 16px 18px; display: grid; gap: 12px;
}
.carte-validation.validee { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); box-shadow: var(--ombre-1); }
.carte-validation.refusee { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); box-shadow: var(--ombre-1); }
.validation-tete { display: flex; align-items: center; gap: 12px; }
.validation-tete > div { display: grid; line-height: 1.35; }
.validation-tete b { font-size: 15px; font-weight: 600; }
.validation-tete small { color: var(--text-3); font-size: 12.5px; }
.validation-tete .pastille-ic { width: 36px; height: 36px; border-radius: 10px; flex: none; margin: 0; }
.pastille-attente { background: var(--warn-soft); color: var(--warn); }
.pastille-ko { background: var(--danger-soft); color: var(--danger); }
.carte-validation > p { color: var(--text-2); font-size: 14px; }
.validation-commentaire { height: auto; min-height: 60px; padding: 8px 12px; resize: vertical; font-size: 14px; }
.validation-actions { display: flex; justify-content: flex-end; gap: 10px; }
.validation-comment { font-style: italic; }
.alerte-info { background: var(--info-soft); color: var(--info); }
.plan-workflow { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin-bottom: 14px; border-radius: var(--r-2); background: var(--accent-soft); color: var(--accent-text); font-size: 12.5px; }
.plan-workflow .ic { width: 15px; height: 15px; margin-top: 2px; }
.puces-workflow { margin-bottom: 10px; }
/* navigation des espaces */
.nav-espaces { display: grid; gap: 2px; }
.nav-lien { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-1); color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.nav-lien:hover { background: var(--surface-3); color: var(--text); }
.nav-lien.actif { background: var(--surface); color: var(--text); box-shadow: var(--ombre-1); }
.nav-lien .ic { width: 17px; height: 17px; }
.nav-compteur { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }

/* pièces jointes */
.joindre { position: relative; align-self: flex-end; }
.btn-joindre { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); margin-left: -8px; }
.btn-joindre:hover, .btn-joindre[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.menu-joindre { bottom: calc(100% + 10px); left: -8px; width: 320px; max-height: 60vh; overflow-y: auto; }
.menu-titre { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 10px 4px; }
.menu-texte { display: grid; min-width: 0; line-height: 1.3; }
.menu-texte small { color: var(--text-3); font-size: 11.5px; }
.menu-joindre .menu-item { height: auto; min-height: 36px; padding: 6px 10px; }
.menu-joindre .menu-texte { overflow: hidden; }
.pieces-jointes { max-width: 780px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.piece-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 280px; height: 32px; padding: 0 4px 0 10px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--ombre-1); font-size: 12.5px; color: var(--text);
}
.piece-chip .ic { width: 15px; height: 15px; color: var(--accent-text); }
.piece-chip .spinner { width: 13px; height: 13px; }
.piece-chip small { color: var(--text-3); white-space: nowrap; }
.piece-chip .btn-icone { width: 24px; height: 24px; }
.piece-chip .btn-icone .ic { width: 14px; height: 14px; color: var(--text-3); }
.piece-chip.envoi { opacity: .75; }
.piece-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg-pieces { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.msg-pieces .piece-chip { padding-right: 10px; }
.msg-pieces .piece-chip:hover { border-color: var(--accent); }
.composeur-zone.depot .composeur { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); }

/* page Écritures */
.titre-page { font-family: var(--police-titre); font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 4px; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.onglet { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglet:hover { color: var(--text); }
.onglet.actif { color: var(--text); border-bottom-color: var(--accent); }
.onglet-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); font-size: 11.5px; display: grid; place-items: center; }
.liste-ecritures { display: grid; gap: 8px; }
.ecriture { border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface); box-shadow: var(--ombre-1); overflow: hidden; }
.ecriture > summary { list-style: none; display: grid; grid-template-columns: 96px 84px 52px minmax(0, 1fr) 120px 104px; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; font-size: 13.5px; }
.ecriture > summary::-webkit-details-marker { display: none; }
.ecriture > summary:hover { background: var(--surface-2); }
.ecriture.statut-rejetee > summary { opacity: .6; }
.ecr-num { font-family: var(--police-mono); font-size: 12.5px; color: var(--text-2); }
.ecr-date { color: var(--text-2); font-variant-numeric: tabular-nums; }
.ecr-journal { justify-content: center; font-family: var(--police-mono); }
.ecr-lib { display: grid; min-width: 0; line-height: 1.35; }
.ecr-lib b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecr-lib small { color: var(--text-3); font-size: 12px; }
.ecriture > summary .etiquette { justify-self: start; }
.ecr-montant { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ecr-corps { border-top: 1px solid var(--border); padding: 4px 0 10px; background: var(--surface-2); }
.table-lignes { background: transparent; }
.table-lignes th { background: transparent; }
.table-lignes td { padding: 8px 16px; }
.table-lignes td.mono { font-family: var(--police-mono); font-size: 12.5px; }
.ecr-meta { padding: 8px 16px 0; font-size: 12px; color: var(--text-3); }
.carte-vide { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-3); }
@media (max-width: 860px) {
  .ecriture > summary { grid-template-columns: 1fr auto; row-gap: 4px; }
  .ecr-num, .ecr-journal { display: none; }
  .ecr-date { grid-column: 1; font-size: 12px; }
  .ecr-lib { grid-column: 1 / -1; grid-row: 1; }
  .menu-joindre { width: min(320px, calc(100vw - 32px)); }
}
.app.en-admin, .app.en-admin.avec-deroule { grid-template-columns: var(--laterale) minmax(0, 1fr) 0; }
.app.en-admin .deroule { display: none; }

.msg-erreur { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-2); background: var(--danger-soft); color: var(--danger); font-size: 14px; }

/* composeur */
.composeur-zone { flex: none; padding: 8px 24px 16px; }
.composeur {
  position: relative; max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 10px 10px 16px; border-radius: var(--r-4); background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: var(--ombre-2); transition: border-color .15s, box-shadow .15s;
}
.composeur:focus-within { border-color: var(--accent); box-shadow: var(--ombre-2), var(--focus); }
.composeur textarea {
  flex: 1; height: auto; min-height: 26px; max-height: 220px; padding: 5px 0; border: 0; box-shadow: none !important;
  resize: none; background: transparent; font-size: 15px; line-height: 1.5;
}
.btn-envoyer {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); transition: background .15s, opacity .15s;
}
.btn-envoyer:hover:not(:disabled) { background: var(--accent-hover); }
.btn-envoyer:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.btn-envoyer .ic { stroke-width: 2.2; }
.composeur-note { max-width: 780px; margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--text-3); }
kbd { font-family: var(--police); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }

/* ---------- déroulé ---------- */
.deroule {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--surface); border-left: 1px solid var(--border);
}
.app:not(.avec-deroule) .deroule { visibility: hidden; }
.deroule-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--border); min-width: var(--deroule); }
.deroule-entete h2 { font-size: 15px; }
.deroule-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); min-width: var(--deroule); }
.stat { padding: 12px 8px 12px 20px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat small { display: block; font-size: 11.5px; color: var(--text-3); }
.stat b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.deroule-corps { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 32px 20px; min-width: var(--deroule); scrollbar-width: thin; }
.vide { display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--text-3); font-size: 13px; padding: 48px 24px; }

.chrono-phases { position: relative; display: grid; gap: 4px; }
.ph { position: relative; padding-left: 34px; padding-bottom: 14px; }
.ph::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--border); border-radius: 2px; }
.ph:last-child::before { display: none; }
.ph-num {
  position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); border: 2px solid var(--surface);
}
.ph.encours .ph-num { background: var(--accent-soft); color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ph.faite .ph-num { background: var(--accent); color: var(--on-accent); }
.ph.ko .ph-num { background: var(--danger); color: #fff; }
.ph-tete { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.ph-tete h3 { font-size: 14px; font-weight: 600; }
.ph-tete .spinner { width: 13px; height: 13px; }
.ph-tete .duree { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ph-desc { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.ph-contenu { display: grid; gap: 6px; margin-top: 8px; }

.puces { display: flex; flex-wrap: wrap; gap: 5px; }
.puce-skill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-family: var(--police-mono); background: var(--info-soft); color: var(--info); }

.bloc {
  border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface); overflow: hidden;
}
.bloc > summary, .bloc-tete {
  list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; min-width: 0;
}
.bloc > summary::-webkit-details-marker { display: none; }
.bloc > summary:hover { background: var(--surface-2); }
.bloc > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-left: auto; margin-right: 3px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s;
}
.bloc[open] > summary::after { transform: rotate(45deg); }
.bloc-titre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bloc-corps { border-top: 1px solid var(--border); padding: 10px; background: var(--surface-2); display: grid; gap: 8px; }
.bloc-etape { background: var(--surface); }
.bloc-etape > .bloc-corps { background: var(--surface); }
.bloc .ic { width: 15px; height: 15px; color: var(--text-3); }
.statut { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.statut.ok { background: var(--ok); }
.statut.ko { background: var(--danger); }
.statut.warn { background: var(--warn); }
.statut.encours { background: var(--accent); animation: pulsation 1.2s ease-in-out infinite; }

.ligne-outil {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-1);
  background: var(--surface-2); font-size: 12.5px; min-width: 0;
}
details.ligne-outil { display: block; padding: 0; }
details.ligne-outil > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; min-width: 0; }
details.ligne-outil > summary::-webkit-details-marker { display: none; }
.ligne-outil .ic { color: var(--accent-text); width: 14px; height: 14px; }
.ligne-outil.ko .ic { color: var(--danger); }
.outil-nom { font-family: var(--police-mono); font-weight: 500; color: var(--text); flex: none; }
.outil-arg { font-family: var(--police-mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.outil-arg { min-width: 70px; }
details.ligne-outil .outil-res { max-width: 45%; }
.outil-libelle { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outil-res { font-family: var(--police-mono); color: var(--accent-text); flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code {
  margin: 0; padding: 8px 10px; border-radius: var(--r-1); background: var(--surface); border: 1px solid var(--border);
  font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; color: var(--text-2);
}
.ligne-modele { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); padding: 2px 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; min-width: 0; }
.ligne-modele .ic { width: 13px; height: 13px; }
.ligne-modele .sep { opacity: .5; }
.resume-champ { font-size: 12.5px; color: var(--text-2); }
.resume-champ b { color: var(--text); font-weight: 500; }
.erreur-deroule { padding: 10px 12px; border-radius: var(--r-2); background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.controle { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; padding: 3px 0; }
.controle .statut { margin-top: 6px; }
.controle span { color: var(--text-2); }
.controle b { font-weight: 500; color: var(--text); }

/* ---------- administration ---------- */
.admin-defile { flex: 1; min-height: 0; overflow-y: auto; }
.admin { max-width: 1120px; margin: 0 auto; padding: 28px 28px 48px; display: grid; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--ombre-1); display: grid; gap: 4px; align-content: start; }
.kpi small { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi small .ic { width: 15px; height: 15px; color: var(--text-3); }
.kpi b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-sous { color: var(--text-3); font-size: 12px; }
.kpi .jauge { margin-top: 6px; }

.panneau { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--ombre-1); overflow: hidden; }
.panneau-entete { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panneau-entete h2 { font-size: 16px; }
.table-zone { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td:last-child { width: 48px; text-align: right; padding-right: 10px; }
.cellule-user { display: flex; align-items: center; gap: 12px; }
.cellule-user > div { display: grid; line-height: 1.35; }
.cellule-user b { font-weight: 500; }
.cellule-user small { color: var(--text-3); font-family: var(--police-mono); font-size: 12px; }
.ligne-inactive td:not(:last-child) { opacity: .55; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.discret { color: var(--text-3); }

.graphe { padding: 20px 20px 16px; }
.barres { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 8px; height: 180px; }
.barre-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; min-width: 0; }
.barre-val { align-self: end; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--accent) 80%, transparent); min-height: 2px; position: relative; transition: background .15s; }
.barre-col:hover .barre-val { background: var(--accent); }
.barre-val .infobulle {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; font-size: 12px; background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity .12s;
  font-variant-numeric: tabular-nums;
}
.barre-col:hover .infobulle { opacity: 1; }
.barre-jour { font-size: 11px; color: var(--text-3); text-align: center; white-space: nowrap; overflow: hidden; }
.graphe-vide { color: var(--text-3); font-size: 13px; text-align: center; padding: 48px 0; }
.graphe-pied { display: flex; gap: 24px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.graphe-pied b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- fenêtres ---------- */
.fenetre {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border);
  border-radius: var(--r-4); background: var(--surface); color: var(--text); box-shadow: var(--ombre-3);
}
.fenetre-etroite { width: min(420px, calc(100vw - 32px)); }
.fenetre[open] { animation: zoom .16s ease-out; }
.fenetre::backdrop { background: rgb(15 18 16 / 45%); backdrop-filter: blur(2px); }
.fenetre-entete { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px 24px; }
.fenetre-entete h2, .fenetre-corps h2 { font-size: 18px; font-weight: 600; }
.fenetre-corps { padding: 16px 24px 8px; display: grid; gap: 18px; }
.fenetre-corps.centre { text-align: center; justify-items: center; padding-top: 28px; gap: 12px; }
.fenetre-pied { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

.choix-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choix { position: relative; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix > span {
  display: grid; gap: 3px; height: 100%; padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--border-strong);
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.choix > span b { font-size: 13.5px; font-weight: 600; }
.choix > span small { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.choix:hover > span { border-color: var(--text-3); }
.choix input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choix input:focus-visible + span { box-shadow: var(--focus); }

.interrupteur { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; pointer-events: none; }
.interrupteur-piste { position: relative; flex: none; width: 36px; height: 20px; margin-top: 1px; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.interrupteur-piste::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--ombre-1); transition: transform .15s; }
.interrupteur input:checked + .interrupteur-piste { background: var(--accent); }
.interrupteur input:checked + .interrupteur-piste::after { transform: translateX(16px); }
.interrupteur input:focus-visible + .interrupteur-piste { box-shadow: var(--focus); }
.interrupteur > span:last-child { display: grid; gap: 2px; }
.interrupteur b { font-weight: 500; font-size: 14px; }
.interrupteur small { color: var(--text-2); font-size: 12.5px; }
.radio { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 3px 0; }
.radio input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
fieldset.champ input[name="mot_de_passe"] { margin-top: 6px; font-family: var(--police-mono); }

.identifiants { width: 100%; display: grid; gap: 1px; border-radius: var(--r-2); overflow: hidden; border: 1px solid var(--border); background: var(--border); text-align: left; margin-top: 6px; }
.identifiants > div { display: grid; gap: 2px; padding: 10px 14px; background: var(--surface-2); }
.identifiants small { font-size: 12px; color: var(--text-3); }
.identifiants code { font-size: 15px; font-weight: 500; color: var(--text); letter-spacing: .02em; }

/* ---------- notifications ---------- */
.toasts { position: fixed; z-index: 100; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; font-size: 13.5px;
  background: var(--text); color: var(--bg); box-shadow: var(--ombre-3); animation: monte .2s ease-out; pointer-events: auto; max-width: calc(100vw - 32px);
}
.toast .ic { width: 16px; height: 16px; }
.toast.erreur { background: var(--danger); color: #fff; }
.toast.sortie { animation: descend .2s ease-in forwards; }

/* ---------- animations ---------- */
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes pulsation { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes glisse { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes monte { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes descend { to { opacity: 0; transform: translateY(6px); } }
@keyframes apparition { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes zoom { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- adaptatif ---------- */
@media (max-width: 1280px) {
  .app.avec-deroule { grid-template-columns: var(--laterale) minmax(0, 1fr) 0; }
  .deroule {
    position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: min(var(--deroule), 100vw);
    box-shadow: var(--ombre-3); transform: translateX(100%); transition: transform .25s ease, visibility .25s;
  }
  .app.avec-deroule .deroule { transform: none; visibility: visible; }
  .deroule-entete, .deroule-stats, .deroule-corps { min-width: 0; }
}
@media (max-width: 1000px) {
  .suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .connexion { grid-template-columns: 1fr; }
  .connexion-marque { display: none; }
  .marque-mobile { display: inline-flex; }
  .app, .app.avec-deroule, .app.en-admin, .app.en-admin.avec-deroule { grid-template-columns: minmax(0, 1fr); }
  .mobile-seul { display: inline-grid; }
  .laterale {
    position: fixed; z-index: 35; top: 0; bottom: 0; left: 0; width: min(300px, 86vw);
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--ombre-3);
  }
  .app.menu-ouvert .laterale { transform: none; }
  .app.menu-ouvert .voile { display: block; position: fixed; inset: 0; z-index: 34; background: rgb(15 18 16 / 40%); }
  .barre { padding: 0 12px 0 8px; }
  .fil-interieur { padding: 20px 16px; }
  .composeur-zone { padding: 6px 12px 12px; }
  .composeur-note { display: none; }
  .msg-utilisateur { max-width: 92%; }
  .msg-assistant { grid-template-columns: minmax(0, 1fr); }
  .msg-assistant > .logo { display: none; }
  .admin { padding: 16px; }
  .texte-bouton { display: none; }
  .grille-2, .choix-roles { grid-template-columns: 1fr; }
  .etape-phase span { font-size: 10.5px; }
}
@media (max-width: 560px) {
  .suggestions { grid-template-columns: 1fr; }
  .suggestion { min-height: 0; grid-template-columns: 32px 1fr; align-items: start; column-gap: 12px; }
  .suggestion .pastille { grid-row: span 2; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 21px; }
  .panneau-entete { flex-wrap: wrap; }
  .deroule-stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
