/* Police auto-hebergee (alphabet latin, graisses 400 a 800 dans un seul fichier variable) */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("vendor/manrope-latin.b222d83cc274.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Boris - tableau de bord.
   Direction : fond gris chaud, cartes blanches tres arrondies, noir pour la structure,
   vert citron comme unique accent, barres hachurees, carte principale vert profond. */

:root {
  color-scheme: light;
  --page: #eeeeea;
  --surface: #ffffff;
  --surface-2: #f4f4f1;
  --surface-3: #e9e9e4;
  --encre: #121211;
  --encre-2: #4c4b47;
  --muet: #84837c;
  --trait: rgba(18, 18, 17, 0.07);
  --trait-fort: rgba(18, 18, 17, 0.18);
  --citron: #d6f34f;
  --citron-fort: #a9d61b;
  --citron-texte: #4a6a00;
  --citron-doux: #f1f9d2;
  --nuit: #121211;
  --piste-a: #e6e6e0;
  --piste-b: #f0f0ec;
  --points: #e2e2dc;
  --bon-texte: #2d7310;
  --bon-fond: #e5f5d3;
  --alerte-texte: #8a5800;
  --alerte-fond: #fcf0cf;
  --critique: #ef6b4f;
  --critique-texte: #b9361c;
  --critique-fond: #fde6df;
  --concurrent-texte: #5443c9;
  --concurrent-fond: #ecebfc;
  --ombre: 0 1px 2px rgba(18, 18, 17, 0.03), 0 10px 30px rgba(18, 18, 17, 0.04);
  --rayon: 22px;
  --rayon-s: 14px;
  --police: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b0c0b;
    --surface: #161715;
    --surface-2: #1e1f1d;
    --surface-3: #282926;
    --encre: #f2f2ed;
    --encre-2: #c3c2bb;
    --muet: #8a8982;
    --trait: rgba(255, 255, 255, 0.07);
    --trait-fort: rgba(255, 255, 255, 0.2);
    --citron-fort: #c4ea38;
    --citron-texte: #d6f34f;
    --citron-doux: #222b10;
    --nuit: #20211f;
    --piste-a: #2b2c29;
    --piste-b: #232421;
    --points: #2c2d2a;
    --bon-texte: #9fdc6a;
    --bon-fond: #1b2a12;
    --alerte-texte: #f5c451;
    --alerte-fond: #2d2410;
    --critique-texte: #ff9b85;
    --critique-fond: #33170f;
    --concurrent-texte: #b3a9ff;
    --concurrent-fond: #221f3d;
    --ombre: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0c0b;
  --surface: #161715;
  --surface-2: #1e1f1d;
  --surface-3: #282926;
  --encre: #f2f2ed;
  --encre-2: #c3c2bb;
  --muet: #8a8982;
  --trait: rgba(255, 255, 255, 0.07);
  --trait-fort: rgba(255, 255, 255, 0.2);
  --citron-fort: #c4ea38;
  --citron-texte: #d6f34f;
  --citron-doux: #222b10;
  --nuit: #20211f;
  --piste-a: #2b2c29;
  --piste-b: #232421;
  --points: #2c2d2a;
  --bon-texte: #9fdc6a;
  --bon-fond: #1b2a12;
  --alerte-texte: #f5c451;
  --alerte-fond: #2d2410;
  --critique-texte: #ff9b85;
  --critique-fond: #33170f;
  --concurrent-texte: #b3a9ff;
  --concurrent-fond: #221f3d;
  --ombre: none;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--encre);
  font: 500 14px/1.45 var(--police);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
small { font-size: 0.85em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muet { color: var(--muet); }
.dec { opacity: 0.45; }
:focus-visible { outline: 2px solid var(--citron-fort); outline-offset: 2px; }

svg:has(> use) {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.si-sombre { display: none; }
:root[data-theme="dark"] .si-clair { display: none; }
:root[data-theme="dark"] .si-sombre { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .si-clair { display: none; }
  :root:not([data-theme="light"]) .si-sombre { display: block; }
}

/* ---------- Charpente ---------- */

.appli { display: grid; grid-template-columns: 76px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 20px;
}
.logo { display: inline-flex; border-radius: 14px; }
.logo img { display: block; width: 38px; height: 38px; border-radius: 12px; }
.rail-liens { display: flex; flex-direction: column; gap: 8px; margin-top: 40px; }
.rail-bas { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.rail-bas form { margin: 0; }

.rond {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--encre);
  cursor: pointer; text-decoration: none; flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
.rond:hover { background: var(--surface-3); }
.rond.actif { background: var(--encre); color: var(--page); }
.carte .rond { width: 34px; height: 34px; background: var(--surface-2); }
.carte .rond:hover { background: var(--surface-3); transform: rotate(45deg); }

.corps { min-width: 0; }

.barre {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px 10px 4px;
  background: color-mix(in srgb, var(--page) 84%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.logo-mobile { display: none; }
.logo-connexion { display: block; width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 6px; box-shadow: 0 10px 30px rgba(18, 18, 17, 0.18); }
.onglets { display: flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; }
.onglets a {
  padding: 7px 16px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 13px; color: var(--encre-2); white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.onglets a:hover { color: var(--encre); background: var(--surface-2); }
.onglets a.actif { background: var(--encre); color: var(--page); }
.barre-droite { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rond-barre { display: none; }

.pilule {
  display: inline-flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--surface); color: var(--encre);
  font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer;
  position: relative;
}
.pilule:hover { background: color-mix(in srgb, var(--surface) 70%, var(--surface-3)); }
.pilule svg:has(> use) { width: 16px; height: 16px; }
.pilule .chevron { width: 16px; height: 16px; color: var(--muet); pointer-events: none; }
.pilule select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  font-weight: 600; cursor: pointer; padding: 0 22px 0 0; margin-right: -22px;
  outline: none; max-width: 230px; text-overflow: ellipsis;
}
.pilule select:focus-visible { outline: none; }
.pilule:focus-within { box-shadow: 0 0 0 2px var(--citron-fort); }
.pilule-ws { padding-left: 4px; }
.pilule-ws .avatar { width: 30px; height: 30px; font-size: 12px; }
.pilule-recherche { cursor: text; }
.pilule-recherche input { border: 0; background: transparent; outline: none; width: 150px; font-weight: 500; }
.pilule-recherche input::placeholder { color: var(--muet); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); color: var(--encre);
  font-weight: 700; font-size: 12.5px;
}
.avatar.citron { background: var(--citron); color: #121211; }

/* ---------- Page ---------- */

.page { padding: 2px 28px 56px 4px; max-width: 1680px; }
.page-seule { margin: 10vh auto 0; max-width: 640px; padding: 0 20px; }

.entete {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 14px 28px; flex-wrap: wrap; margin: 8px 0 16px;
}
.fil { display: flex; align-items: center; gap: 8px; color: var(--muet); font-size: 12.5px; }
.fil a, .fil span { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.fil a:hover { color: var(--encre); }
.fil svg:has(> use) { width: 15px; height: 15px; }
.fil .fil-sep { width: 16px; height: 16px; }
h1 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin: 6px 0 2px; }
.sous-titre { margin: 0; color: var(--muet); font-size: 13px; }

.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--encre); color: var(--page); }
details.menu[open] > summary .chevron { color: inherit; transform: rotate(180deg); }
.menu-liste {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  min-width: 240px; padding: 8px; border-radius: 22px;
  background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
  border: 1px solid var(--trait);
}
.menu-liste label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; cursor: pointer; font-size: 14px; }
.menu-liste label:hover { background: var(--surface-2); }
.menu-liste input { accent-color: var(--encre); width: 16px; height: 16px; }
.menu-liste small { color: var(--muet); }
.compte { background: var(--citron); color: #121211; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
details.menu[open] .compte { background: var(--citron); }
.lien-discret { color: var(--muet); font-size: 14px; text-decoration: none; padding: 0 6px; }
.lien-discret:hover { color: var(--encre); text-decoration: underline; }

.bandeau {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; margin-bottom: 16px; border-radius: var(--rayon-s);
  background: var(--surface); font-size: 14px;
}
.bandeau a { font-weight: 700; margin-left: auto; }
.bandeau.success { background: var(--bon-fond); color: var(--bon-texte); }
.bandeau.warning { background: var(--alerte-fond); color: var(--alerte-texte); }
.bandeau.error { background: var(--critique-fond); color: var(--critique-texte); }
.bandeau.info { background: var(--citron-doux); color: var(--encre); }
.point-anime { width: 10px; height: 10px; border-radius: 50%; background: var(--citron-fort); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(169, 214, 27, 0.6); } 100% { box-shadow: 0 0 0 12px rgba(169, 214, 27, 0); } }

/* ---------- Cartes ---------- */

.grille { display: grid; gap: 12px; margin-bottom: 12px; }
.g-8-4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.g-6-6 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.carte {
  background: var(--surface); border-radius: var(--rayon);
  padding: 18px 20px; box-shadow: var(--ombre); min-width: 0;
}
.page > .carte { margin-bottom: 12px; }
.carte-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.carte h2 { font-size: 16px; font-weight: 700; }
.carte-entete:has(> .rond) { flex-wrap: nowrap; }
.carte-entete > div:first-child { min-width: 0; }
.aide { margin: 2px 0 0; color: var(--muet); font-size: 12.5px; font-weight: 500; }
.note { margin: 0 0 8px; color: var(--muet); font-size: 13px; }

.segment { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.segment a, .segment button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--encre-2); text-decoration: none; cursor: pointer;
}
.segment a:hover, .segment button:hover { color: var(--encre); }
.segment .actif { background: var(--encre); color: var(--page); }

.legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muet); }
.legende span { display: inline-flex; align-items: center; gap: 7px; }
.cle-plein, .cle-hachure { display: inline-block; width: 22px; height: 10px; border-radius: 999px; }
.cle-plein { background: var(--encre); }
.cle-hachure, .hachure { background: repeating-linear-gradient(135deg, var(--citron-fort) 0 4px, var(--citron) 4px 8px); }

/* ---------- Tuiles d'indicateurs ---------- */

.tuiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.tuile {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  padding: 14px 16px; border: 0; border-radius: var(--rayon);
  background: var(--surface); color: var(--encre); box-shadow: var(--ombre);
  text-align: left; cursor: pointer;
  transition: transform 0.18s, background 0.18s, color 0.18s;
}
.tuile:hover { transform: translateY(-2px); }
.tuile-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.tuile-icone { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); }
.tuile-valeur { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.tuile-valeur small { font-size: 14px; font-weight: 600; color: var(--muet); margin-left: 3px; letter-spacing: 0; }
.tuile-titre { font-weight: 700; font-size: 13px; margin-top: 4px; }
.tuile-detail { font-size: 12px; color: var(--muet); }
.tuile.actif { background: var(--encre); color: var(--page); }
.tuile.actif .tuile-icone { background: var(--citron); color: #121211; }
.tuile.actif .tuile-valeur small, .tuile.actif .tuile-detail { color: color-mix(in srgb, var(--page) 58%, transparent); }
.tuile.actif .ecart.stable { background: color-mix(in srgb, var(--page) 12%, transparent); color: color-mix(in srgb, var(--page) 70%, transparent); }

.ecart { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ecart.hausse { background: var(--bon-fond); color: var(--bon-texte); }
.ecart.baisse { background: var(--critique-fond); color: var(--critique-texte); }
.ecart.stable { background: var(--surface-2); color: var(--muet); }
.tuile.actif .ecart.hausse { background: var(--citron); color: #121211; }

/* ---------- Carte principale (evolution) ---------- */

.hero {
  position: relative; overflow: hidden; color: #eef3ea;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(214, 243, 79, 0.18), transparent 60%),
    radial-gradient(60% 60% at 0% 100%, rgba(80, 160, 90, 0.18), transparent 70%),
    linear-gradient(160deg, #15301f 0%, #0c1a12 100%);
  padding-bottom: 14px;
}
.hero-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.surtitre { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.62); }
.surtitre svg:has(> use) { width: 16px; height: 16px; color: var(--citron); }
.hero h2 { font-size: 18px; color: #fff; margin-top: 2px; }
.segment-sombre { background: rgba(255, 255, 255, 0.08); }
.segment-sombre a { color: rgba(255, 255, 255, 0.7); }
.segment-sombre a:hover { color: #fff; }
.segment-sombre .actif { background: var(--citron); color: #121211; }
.hero-chiffre { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 10px 0 10px; }
.hero-chiffre strong { font-size: 46px; font-weight: 700; letter-spacing: -0.045em; line-height: 0.95; color: #fff; }
.hero-chiffre strong small { font-size: 20px; color: rgba(255, 255, 255, 0.55); margin-left: 4px; letter-spacing: 0; }
.hero .ecart.hausse { background: rgba(214, 243, 79, 0.16); color: var(--citron); }
.hero .ecart.baisse { background: rgba(255, 130, 105, 0.16); color: #ffab97; }
.hero .ecart.stable { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.7); }
.hero-faits { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fait { display: inline-flex; align-items: baseline; gap: 7px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); font-size: 12px; }
.fait span { color: rgba(255, 255, 255, 0.6); }
.fait b { color: #fff; font-weight: 700; }
.hero .note { color: rgba(255, 255, 255, 0.6); }
.graphe { position: relative; height: 200px; margin: 0 -6px; }

.vue-tableau { margin-top: 10px; font-size: 13px; }
.vue-tableau summary { cursor: pointer; color: rgba(255, 255, 255, 0.6); width: max-content; }
.vue-tableau summary:hover { color: #fff; }
.hero .tableau th { background: transparent; color: rgba(255, 255, 255, 0.55); }
.hero .tableau td { background: rgba(255, 255, 255, 0.06); color: #eef3ea; }
.hero .tableau tbody tr:hover td { background: rgba(255, 255, 255, 0.1); }

/* ---------- Perception (jauge en points) ---------- */

.perception { display: flex; flex-direction: column; }
.jauge-points { position: relative; width: 100%; max-width: 250px; margin: auto; padding: 8px 0; }
.jauge-points svg { display: block; width: 100%; height: auto; overflow: visible; }
.points-fond path, .points-valeur path { fill: none; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 0 1; }
.points-fond path { stroke: var(--points); }
.points-valeur path { stroke: var(--citron-fort); }
.jauge-texte { position: absolute; left: 0; right: 0; bottom: -2px; text-align: center; }
.jauge-texte strong { display: block; font-size: 34px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.jauge-texte strong small { font-size: 14px; color: var(--muet); letter-spacing: 0; margin-left: 2px; }
.jauge-texte > span { font-size: 12px; color: var(--muet); }
.repartition { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.repartition li { display: flex; flex-direction: column; gap: 0; padding: 8px 12px; border-radius: var(--rayon-s); background: var(--surface-2); font-size: 12px; color: var(--muet); }
.repartition b { font-size: 18px; color: var(--encre); font-weight: 700; letter-spacing: -0.02em; }
.pt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pt-positif { background: var(--citron-fort); }
.pt-neutre { background: var(--trait-fort); }
.pt-negatif { background: var(--critique); }

/* ---------- Par moteur ---------- */

.moteurs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.moteur { padding: 10px 12px 12px; border-radius: 16px; background: var(--surface-2); }
.moteur.meilleur { background: var(--citron-doux); }
.moteur-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.moteur-tete .avatar { width: 28px; height: 28px; font-size: 12px; }
.moteur.meilleur .avatar { background: var(--citron); color: #121211; }
.moteur-nom { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.moteur-nom strong { font-size: 13.5px; }
.moteur-nom small { font-size: 11.5px; color: var(--muet); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.barre-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 62px; align-items: center; gap: 10px; margin-top: 5px; }
.barre-ligne b { text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barre-ligne b small { color: var(--muet); font-weight: 600; }
.piste {
  display: block; height: 8px; border-radius: 999px; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--piste-a) 0 4px, var(--piste-b) 4px 8px);
}
.moteur .piste { background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, var(--surface) 4px 8px); }
.plein { display: block; height: 100%; border-radius: 999px; background: var(--encre); }
.plein.hachure { background: repeating-linear-gradient(135deg, var(--citron-fort) 0 4px, var(--citron) 4px 8px); }

/* ---------- Collecte (carte noire) ---------- */

.collecte { background: var(--nuit); color: #f3f3ef; display: flex; flex-direction: column; }
.collecte h2 { color: #fff; }
.collecte .aide { color: rgba(255, 255, 255, 0.55); }
.carte .rond-sombre { background: rgba(255, 255, 255, 0.1); color: #fff; }
.carte .rond-sombre:hover { background: rgba(255, 255, 255, 0.18); }
.prochain { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); }
.prochain-icone { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--citron); color: #121211; }
.prochain strong { display: block; font-size: 14px; }
.prochain strong::first-letter { text-transform: uppercase; }
.prochain span { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 8px 0 12px; }
.stats div { padding: 7px 12px; border-radius: var(--rayon-s); background: rgba(255, 255, 255, 0.05); }
.stats dt { font-size: 11.5px; color: rgba(255, 255, 255, 0.55); }
.stats dd { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.stats dd small { color: rgba(255, 255, 255, 0.55); font-size: 12px; }
.collecte form { margin: auto 0 0; }

.bouton {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 14px;
  height: 44px; padding: 0 6px 0 18px; border: 0; border-radius: 999px;
  background: var(--encre); color: var(--page);
  font-weight: 700; font-size: 13.5px; cursor: pointer; transition: transform 0.15s, filter 0.15s;
}
.bouton:hover { transform: translateY(-1px); filter: brightness(1.05); }
.bouton:disabled { opacity: 0.5; cursor: progress; transform: none; }
.bouton-icone { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--citron); color: #121211; }
.bouton-icone svg:has(> use) { width: 18px; height: 18px; }
.bouton-citron { width: 100%; background: var(--citron); color: #121211; }
.bouton-citron .bouton-icone { background: #121211; color: var(--citron); }

/* ---------- Tableaux en lignes arrondies ---------- */

.defile { overflow: auto; margin: 0 -6px; padding: 0 6px; }
.defile.haut { max-height: 430px; }
.tableau { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.tableau th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muet);
  padding: 2px 10px 4px; white-space: nowrap;
}
.tableau td { padding: 6px 10px; background: var(--surface-2); vertical-align: middle; }
.tableau td:first-child { border-radius: 12px 0 0 12px; }
.tableau td:last-child { border-radius: 0 12px 12px 0; }
.tableau td:only-child { border-radius: 12px; }
.tableau tbody tr:hover td { background: var(--surface-3); }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau .num small { color: var(--muet); }
.tableau .centre { text-align: center; }
.tableau.compact td { padding: 5px 8px; }
.ligne-cible td, .tableau tbody tr.ligne-cible:hover td { background: var(--citron-doux); }
.separateur td, .tableau tbody tr.separateur:hover td { background: transparent; text-align: center; color: var(--muet); padding: 0; }
.aucun td { text-align: center; color: var(--muet); }

.rang { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 8px; background: var(--surface); font-weight: 700; font-size: 11.5px; color: var(--encre-2); }
.ligne-cible .rang { background: var(--citron); color: #121211; }

.entite { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entite strong, .entite a { display: block; font-weight: 700; font-size: 13px; text-decoration: none; }
.entite a:hover { text-decoration: underline; }
.entite small { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11.5px; color: var(--muet); }
.entite.petite { display: inline-flex; gap: 8px; }
.entite.petite .avatar { width: 24px; height: 24px; font-size: 11px; }

.score { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 999px; background: var(--surface); text-align: center; font-weight: 700; font-size: 12.5px; }
.score.bon { background: var(--bon-fond); color: var(--bon-texte); }
.score.mauvais { background: var(--critique-fond); color: var(--critique-texte); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; white-space: nowrap; font-style: normal; }
.badge.cible { background: var(--citron); color: #121211; }
.badge.concurrent { background: var(--concurrent-fond); color: var(--concurrent-texte); }
.badge.neutre { background: var(--surface-3); color: var(--encre-2); }
.badge.avertissement { background: var(--alerte-fond); color: var(--alerte-texte); }

.col-barre { min-width: 180px; }
.col-barre .barre-ligne { margin: 0; }

/* ---------- Matrice des prompts ---------- */

.matrice td { padding: 5px 8px; }
.matrice .prompt { min-width: 260px; max-width: 480px; line-height: 1.35; font-weight: 600; font-size: 12.5px; }
.matrice tr.groupe td, .matrice tbody tr.groupe:hover td { background: transparent; padding: 10px 4px 0; }
.groupe span { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muet); }
.etat {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s;
}
a.etat:hover { transform: scale(1.06); }
.etat svg:has(> use) { width: 13px; height: 13px; stroke-width: 2.2; }
.etat-mention { background: var(--citron); color: #121211; }
.etat-cite { background: var(--surface); color: var(--citron-texte); box-shadow: inset 0 0 0 1.5px var(--citron-fort); }
.etat-absent { background: var(--surface); color: var(--muet); }
.etat-refus { background: var(--alerte-fond); color: var(--alerte-texte); }
.etat-sans_ia { background: transparent; color: var(--muet); box-shadow: inset 0 0 0 1.5px var(--trait-fort); }
.etat-erreur { background: var(--critique-fond); color: var(--critique-texte); }
.presence { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.presence.forte { background: var(--citron); color: #121211; }
.presence.moyenne { background: var(--citron-doux); color: var(--citron-texte); }
.concurrents { font-size: 12px; color: var(--encre-2); min-width: 200px; }
.legende-etats { gap: 8px; }
.legende-etats .etat { margin-left: 6px; }

/* ---------- Etat vide ---------- */

.vide { text-align: center; padding: 56px 28px; }
.vide h1, .vide h2 { font-size: 24px; margin: 0 0 8px; }
.vide p { color: var(--muet); margin: 0 auto 22px; max-width: 460px; }
.vide-icone { display: inline-flex; align-items: center; justify-content: center; width: 68px; height: 68px; border-radius: 50%; background: var(--citron); color: #121211; margin-bottom: 18px; }
.vide-icone svg:has(> use) { width: 30px; height: 30px; }

/* ---------- Adaptation ---------- */

@media (max-width: 1320px) {
  .tuiles { gap: 12px; }
  .tuile { padding: 12px 14px; }
  .tuile-valeur { font-size: clamp(24px, 2.3vw, 30px); }
}
@media (max-width: 1240px) {
  .g-6-6 { grid-template-columns: minmax(0, 1fr); }
  .g-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-hero .hero { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .g-8-4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .g-hero { grid-template-columns: minmax(0, 1fr); }
  .perception .repartition { margin-top: 0; }
}
@media (max-width: 900px) {
  .appli { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .logo-mobile { display: inline-flex; }
  .rond-barre { display: inline-flex; width: 38px; height: 38px; }
  .barre { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .onglets { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .onglets::-webkit-scrollbar { display: none; }
  .pilule-ws select { max-width: 150px; }
  .page { padding: 0 16px 48px; }
  .moteurs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .carte { padding: 16px 14px; border-radius: 20px; }
  .tuiles {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
    margin: 0 -16px 16px; padding: 0 16px 4px; scrollbar-width: none;
  }
  .tuiles::-webkit-scrollbar { display: none; }
  .tuile { flex: 0 0 150px; scroll-snap-align: start; padding: 12px; border-radius: 18px; }
  .tuile-valeur { font-size: 26px; }
  .tuile-haut .ecart { font-size: 11px; padding: 3px 8px; }
  .hero-chiffre strong { font-size: 40px; }
  .graphe { height: 180px; }
  .filtres { width: 100%; }
  .pilule-recherche { flex: 1; }
  .pilule-recherche input { width: 100%; }
  .barre-droite .pilule-ws .avatar { display: none; }
}
.legende-etats .etat-absent, .legende-etats .etat-cite { background: var(--surface-2); }

.tuile-icone svg:has(> use) { width: 17px; height: 17px; }
.rond svg:has(> use) { width: 18px; height: 18px; }
.prochain-icone svg:has(> use) { width: 18px; height: 18px; }

/* Passage en cours : actions du bandeau */
.bandeau-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.bandeau-actions a { margin-left: 0; }
.bandeau-actions form { margin: 0; }
.bouton-discret {
  font: inherit; font-weight: 700; color: inherit; cursor: pointer;
  background: transparent; border: 1.5px solid currentColor; border-radius: 999px; padding: 4px 12px;
}
.bouton-discret:hover { background: var(--encre); color: var(--page); border-color: var(--encre); }
@media (max-width: 700px) { .bandeau { flex-wrap: wrap; } .bandeau-actions { margin-left: 0; } }

#passage-en-cours > span:nth-child(2) { flex: 1 1 320px; }

.sprite { position: absolute; }

/* Page de connexion */
.page-connexion { max-width: 420px; }
.connexion { text-align: center; padding: 36px 32px; }
.connexion h1 { margin: 0; }
.connexion .aide { margin: 4px 0 22px; }
.formulaire { display: grid; gap: 8px; text-align: left; }
.formulaire label { font-weight: 700; font-size: 13px; margin-top: 6px; }
.formulaire input {
  height: 44px; padding: 0 14px; border-radius: var(--rayon-s); border: 1.5px solid var(--surface-3);
  background: var(--surface-2); color: var(--encre); font: inherit;
}
.formulaire input:focus { outline: 2px solid var(--citron-fort); outline-offset: 1px; border-color: transparent; }
.formulaire .bouton { margin-top: 14px; }

/* =====================================================================
   Pages de gestion (portefeuille, fiches, listes) - remplacent l'admin
   ===================================================================== */

/* ---------- Rail ---------- */
.rail-sep { width: 22px; height: 1.5px; margin: 4px auto; border-radius: 2px; background: var(--trait-fort); }
.rond { position: relative; }
.pastille {
  position: absolute; top: -3px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--citron); color: #121211; border: 2px solid var(--page);
  font-size: 10px; font-weight: 800; line-height: 14px; text-align: center;
}
.pastille-point { min-width: 12px; width: 12px; height: 12px; padding: 0; top: -1px; right: -1px; animation: pulse 1.6s infinite; }

/* ---------- Mise en page ---------- */
.surtitre-page { margin: 0; color: var(--muet); font-size: 13px; font-weight: 600; }
.surtitre-page::first-letter { text-transform: uppercase; }
.aligne-haut { align-items: start; }
.colonne { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.entete > .bouton { flex-shrink: 0; }
a.bouton { text-decoration: none; }
.compte-neutre { background: var(--surface-3); color: var(--encre-2); }

.tuiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tuile-fixe { cursor: default; text-decoration: none; }
a.tuile-fixe { cursor: pointer; }
.tuile-fixe:not(a):hover { transform: none; }
.tuile-alerte { background: var(--citron-doux); }
.tuile-alerte .tuile-icone { background: var(--citron); color: #121211; }

.avatar.grand { width: 42px; height: 42px; font-size: 17px; border-radius: 14px; }
.vide-icone.petite { width: 34px; height: 34px; margin: 0; }
.vide-icone.petite svg:has(> use) { width: 18px; height: 18px; }

/* ---------- Cartes clients ---------- */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.client { position: relative; display: flex; flex-direction: column; gap: 10px; transition: transform 0.18s, box-shadow 0.18s; }
.client:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(18, 18, 17, 0.08); }
.client-lien { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.client a:not(.client-lien), .client [data-bulle] { position: relative; z-index: 2; }
.client-tete { display: flex; align-items: center; gap: 12px; }
.client-nom { min-width: 0; margin-right: auto; }
.client-nom h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-nom small { color: var(--muet); font-size: 12px; }
.statut { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--encre-2); white-space: nowrap; }
.statut-actif { background: var(--citron-doux); color: var(--citron-texte); }
.statut-actif .point-anime { width: 7px; height: 7px; }
.statut-attente { background: var(--alerte-fond); color: var(--alerte-texte); }
.client.en-cours { box-shadow: inset 0 0 0 1.5px var(--citron-fort), var(--ombre); }
.client-chiffre { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.client-chiffre strong { display: block; font-size: 38px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.client-chiffre strong small { font-size: 16px; color: var(--muet); margin-left: 2px; letter-spacing: 0; }
.client-chiffre > div > span { font-size: 12px; color: var(--muet); }
.courbe { width: 46%; max-width: 150px; height: 42px; overflow: visible; }
.courbe polyline { fill: none; stroke: var(--encre); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.courbe polygon { fill: var(--citron); opacity: 0.35; }
.courbe circle { fill: var(--citron-fort); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.client > .ecart { align-self: flex-start; }
.client-faits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.client-faits div { padding: 7px 10px; border-radius: 12px; background: var(--surface-2); }
.client-faits dt { font-size: 11px; color: var(--muet); }
.client-faits dd { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.client-faits dd small { color: var(--muet); font-weight: 600; font-size: 11px; }
.client-leader { margin: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--trait); }
.puces { display: flex; flex-wrap: wrap; gap: 4px; }
.puce { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--encre-2); }
.puce-alerte { background: var(--alerte-fond); color: var(--alerte-texte); }
.client-raccourcis { display: flex; gap: 10px; font-size: 12px; font-weight: 700; }
.client-raccourcis a { text-decoration: none; color: var(--encre-2); }
.client-raccourcis a:hover { color: var(--encre); text-decoration: underline; }
.client-raccourcis .a-trier { color: var(--citron-texte); }
.client-nouveau {
  align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 260px;
  background: transparent; box-shadow: none; border: 2px dashed var(--trait-fort); text-decoration: none;
}
.client-nouveau:hover { background: var(--surface); border-color: transparent; }
.client-nouveau .vide-icone { margin-bottom: 6px; }
.client-nouveau strong { font-size: 16px; }
.client-nouveau .muet { font-size: 12.5px; max-width: 220px; }

.archives { margin-top: 12px; }
.archives summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; list-style: none; }
.archives summary::-webkit-details-marker { display: none; }
.liste-simple { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.liste-simple li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.liste-simple li > span:nth-child(2) { margin-right: auto; }

/* ---------- A faire ---------- */
.a-faire { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.a-faire a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); text-decoration: none; transition: background 0.15s; }
.a-faire a:hover { background: var(--surface-3); }
.a-faire b { display: block; font-size: 13px; }
.a-faire small { display: block; color: var(--muet); font-size: 12px; line-height: 1.35; }
.a-faire-icone { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; background: var(--surface); flex-shrink: 0; }
.a-faire-icone svg:has(> use) { width: 17px; height: 17px; }
.a-faire-fleche { margin-left: auto; color: var(--muet); }
.niveau-alerte .a-faire-icone { background: var(--alerte-fond); color: var(--alerte-texte); }
.niveau-critique .a-faire-icone { background: var(--critique-fond); color: var(--critique-texte); }
.niveau-info .a-faire-icone { background: var(--citron); color: #121211; }
.tout-va-bien { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--encre-2); font-weight: 600; }

/* ---------- Carte sombre, agenda, etapes ---------- */
.carte-nuit { background: var(--nuit); color: #f3f3ef; }
.carte-nuit h2 { color: #fff; }
.carte-nuit .aide { color: rgba(255, 255, 255, 0.55); }
.carte-nuit .surtitre { margin-bottom: 10px; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.agenda li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.agenda b { display: block; font-size: 13.5px; }
.agenda small { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.agenda-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--citron); color: #121211; flex-shrink: 0; }
.agenda-date b { font-size: 17px; line-height: 1; }
.agenda .agenda-date small { color: #121211; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: etape; }
.etapes li { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; counter-increment: etape; }
.etapes li::before { content: counter(etape); grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--citron); color: #121211; font-weight: 800; font-size: 13px; }
.etapes-simples li::before { content: ""; width: 10px; height: 10px; margin: 5px 10px; }
.etapes b { font-size: 13.5px; }
.etapes span { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }

/* ---------- Formulaires ---------- */
.formulaire-page { padding: 6px 24px 20px; }
.formulaire-page fieldset { border: 0; margin: 0; padding: 18px 0; border-bottom: 1px solid var(--trait); display: grid; gap: 14px; min-width: 0; }
.formulaire-page fieldset:last-of-type { border-bottom: 0; }
.formulaire-page legend { display: flex; align-items: center; gap: 10px; float: left; width: 100%; margin-bottom: 4px; font-weight: 700; font-size: 15px; }
.formulaire-page legend + * { clear: both; }
.etape { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--encre); color: var(--page); font-size: 12px; font-weight: 800; }
.champs-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ-titre { font-weight: 700; font-size: 13px; }
.champ .aide { margin: 0; }
.champ ul, .champ .aide ul { margin: 4px 0 0; padding-left: 18px; }
.erreur { margin: 0; color: var(--critique-texte); font-size: 12.5px; font-weight: 600; }
.champ input:not([type=checkbox]):not([type=radio]), .champ textarea, .champ select,
.formulaire input:not([type=checkbox]):not([type=radio]), .formulaire textarea, .formulaire select, .saisie {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--rayon-s);
  border: 1.5px solid var(--surface-3); background: var(--surface-2); color: var(--encre); font: inherit; line-height: 1.45;
}
.champ textarea, .formulaire textarea, textarea.saisie { resize: vertical; min-height: 80px; }
.champ input:focus, .champ textarea:focus, .champ select:focus, .formulaire input:focus, .formulaire textarea:focus, .saisie:focus {
  outline: 2px solid var(--citron-fort); outline-offset: 1px; border-color: transparent; background: var(--surface);
}
.champ-erreur input, .champ-erreur textarea { border-color: var(--critique); }
.actions-form { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding-top: 16px; }

.choix-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.choix-carte { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--rayon-s); background: var(--surface-2); cursor: pointer; font-weight: 700; font-size: 13px; transition: background 0.15s, box-shadow 0.15s; }
.choix-carte:hover { background: var(--surface-3); }
.choix-carte input { position: absolute; opacity: 0; pointer-events: none; }
.choix-coche { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--trait-fort); flex-shrink: 0; }
.choix-coche svg:has(> use) { width: 14px; height: 14px; stroke-width: 2.6; opacity: 0; }
.choix-carte:has(input:checked) { background: var(--citron-doux); box-shadow: inset 0 0 0 1.5px var(--citron-fort); }
.choix-carte:has(input:checked) .choix-coche { background: var(--encre); color: var(--page); box-shadow: none; }
.choix-carte:has(input:checked) .choix-coche svg { opacity: 1; }
.choix-carte:has(input:focus-visible) { outline: 2px solid var(--citron-fort); outline-offset: 2px; }

.segment-choix { flex-wrap: wrap; align-self: flex-start; }
.segment-choix label { position: relative; cursor: pointer; }
.segment-choix input { position: absolute; opacity: 0; pointer-events: none; }
.segment-choix span { display: inline-block; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--encre-2); }
.segment-choix label:hover span { color: var(--encre); }
.segment-choix input:checked + span { background: var(--encre); color: var(--page); }
.segment-choix input:focus-visible + span { outline: 2px solid var(--citron-fort); }

.interrupteur { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; pointer-events: none; }
.glissiere { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3); flex-shrink: 0; transition: background 0.18s; }
.glissiere::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.18s; }
.interrupteur input:checked + .glissiere { background: var(--encre); }
.interrupteur input:checked + .glissiere::after { transform: translateX(16px); background: var(--citron); }
.interrupteur input:focus-visible + .glissiere { outline: 2px solid var(--citron-fort); outline-offset: 2px; }

.bouton-danger { background: var(--critique); color: #fff; }
.bouton-danger .bouton-icone { background: #fff; color: var(--critique-texte); }
.bouton-clair { background: var(--surface-2); color: var(--encre); }
.bouton-clair:hover { background: var(--surface-3); }
.bouton-petit { height: 36px; padding: 0 5px 0 14px; font-size: 12.5px; gap: 10px; }
.bouton-petit .bouton-icone { width: 26px; height: 26px; }
.bouton-petit .bouton-icone svg:has(> use) { width: 15px; height: 15px; }
.zone-danger { box-shadow: inset 0 0 0 1.5px var(--critique-fond), var(--ombre); }
.zone-danger .bouton { width: 100%; margin-top: 8px; }

.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.chiffres div { padding: 10px 12px; border-radius: var(--rayon-s); background: var(--surface-2); }
.chiffres dt { font-size: 11.5px; color: var(--muet); }
.chiffres dd { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.ligne-cout { display: flex; justify-content: space-between; margin: 10px 0 0; padding: 10px 12px; border-radius: var(--rayon-s); background: var(--citron-doux); font-size: 13px; }

/* ---------- Reglages ---------- */
.budget { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.budget-total { flex: 1 1 180px; padding: 14px 16px; border-radius: 16px; background: var(--encre); color: var(--page); }
.budget-total > span { display: block; font-size: 12px; opacity: 0.6; }
.budget-total strong { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; }
.budget-total strong small { font-size: 14px; opacity: 0.6; }
.budget-total.secondaire { background: var(--surface-2); color: var(--encre); }
.ligne-eteinte td { opacity: 0.6; }
.moteurs-reglages { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.moteurs-reglages li { padding: 10px 12px; border-radius: var(--rayon-s); background: var(--surface-2); }
.moteurs-reglages .moteur-nom small { white-space: normal; }
.moteurs-reglages .aide { margin: 6px 0 0 52px; }

@media (max-width: 1100px) { .tuiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .champs-2 { grid-template-columns: minmax(0, 1fr); }
  .formulaire-page { padding: 0 16px 16px; }
  .tuiles-4 .tuile { flex-basis: 170px; }
  .clients { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Prompts ---------- */
.legende-page { margin: 0 0 12px 4px; }
.categorie { padding: 16px 18px; }
.categorie-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.categorie-titre { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.categorie-titre h2 { font-size: 17px; }
.categorie-titre .aide { margin: 0; }
.outils { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.outils form { margin: 0; }
.rond.rond-petit, .carte .rond.rond-petit { width: 32px; height: 32px; }
.rond-petit svg:has(> use) { width: 16px; height: 16px; }
.rond:disabled { opacity: 0.35; cursor: default; }
.carte .rond:disabled:hover { transform: none; background: var(--surface-2); }
.tourne-haut { transform: rotate(180deg); }
.menu-outil > summary { list-style: none; }
.menu-outil > summary::-webkit-details-marker { display: none; }
.carte details.menu-outil[open] > summary { background: var(--encre); color: var(--page); transform: none; }
.menu-formulaire { width: 300px; padding: 14px; display: grid; gap: 10px; }
.menu-formulaire.large { width: min(440px, 86vw); }
.menu-formulaire .formulaire { gap: 8px; }
.menu-formulaire .formulaire label { margin-top: 0; }
.menu-formulaire .bouton { justify-self: start; }
.lien-danger { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 0; color: var(--critique-texte); font-weight: 700; font-size: 13px; cursor: pointer; }
.lien-danger svg:has(> use) { width: 16px; height: 16px; }
.lien-danger:hover { text-decoration: underline; }

.prompts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.prompt-ligne { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 64px auto; align-items: center; gap: 14px; padding: 8px 10px 8px 12px; border-radius: 14px; background: var(--surface-2); transition: background 0.15s; }
.prompt-ligne:hover { background: var(--surface-3); }
.prompt-ligne:target { box-shadow: inset 0 0 0 1.5px var(--citron-fort); }
.prompt-ligne.en-pause .prompt-texte p { color: var(--muet); }
.prompt-interrupteur { margin: 0; }
.prompt-interrupteur .glissiere { width: 34px; height: 20px; }
.prompt-interrupteur .glissiere::after { width: 14px; height: 14px; }
.prompt-interrupteur input:checked + .glissiere::after { transform: translateX(14px); }
.prompt-texte { min-width: 0; }
.prompt-texte p { margin: 0; font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.prompt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; }
.prompt-meta:empty { display: none; }
.prompt-etats { display: flex; gap: 4px; }
.prompt-etats .etat { min-width: 30px; justify-content: center; padding: 3px 7px; }
.etat-vide { background: transparent; color: var(--muet); }
.prompt-presence { text-align: right; font-size: 12px; }

.ajout { margin-top: 8px; }
.ajout summary { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--encre-2); list-style: none; }
.ajout summary::-webkit-details-marker { display: none; }
.ajout summary:hover { background: var(--surface-2); color: var(--encre); }
.ajout[open] summary { color: var(--encre); }
.ajout form { margin-top: 8px; }
.ajout .actions-form { padding-top: 4px; }
.ajout-icone { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--citron); color: #121211; flex-shrink: 0; }
.ajout-icone svg:has(> use) { width: 16px; height: 16px; }
.categorie-nouvelle { background: transparent; box-shadow: none; border: 2px dashed var(--trait-fort); }
.ligne-formulaire { display: flex; align-items: center; gap: 12px; margin: 0; }
.ligne-formulaire .saisie { flex: 1; }

@media (max-width: 900px) {
  .prompt-ligne { grid-template-columns: auto minmax(0, 1fr) auto; }
  .prompt-etats { grid-column: 2 / 3; flex-wrap: wrap; }
  .prompt-presence { grid-column: 3; grid-row: 2; }
  .prompt-ligne > details { grid-row: 1; grid-column: 3; }
}
@media (max-width: 600px) { .ligne-formulaire { flex-wrap: wrap; } .ligne-formulaire .bouton { width: 100%; } }
.prompts-entete, .prompts-entete:hover { background: transparent; padding-top: 0; padding-bottom: 0; font-size: 11px; font-weight: 700; color: var(--muet); }
.prompts-entete > span:first-child { width: 34px; }
.prompts-entete .prompt-etats span { min-width: 30px; text-align: center; }
.rond-petit-place { width: 32px; }
@media (max-width: 900px) { .prompts-entete { display: none; } }

/* ---------- Marques ---------- */
.barre-filtres { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.segment-grand { background: var(--surface); padding: 4px; }
.segment-grand a { padding: 7px 14px; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.segment-grand .compte { font-size: 11px; }
.segment .actif .compte-neutre { background: var(--citron); color: #121211; }
.astuce svg:has(> use) { color: var(--citron-texte); flex-shrink: 0; }
.col-case { width: 36px; }
.col-case input, .tableau input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--encre); cursor: pointer; }
.marques .entite { text-decoration: none; }
.marques .entite:hover strong { text-decoration: underline; }
.tri-rapide { display: inline-flex; gap: 4px; }
.carte .rond-oui { background: var(--citron); color: #121211; }
.carte .rond-oui:hover { background: var(--citron-fort); transform: none; }
.carte .rond-non:hover { background: var(--critique-fond); color: var(--critique-texte); transform: none; }
.carte .tri-rapide .rond:hover { transform: none; }
.actions-groupees {
  position: sticky; bottom: 16px; z-index: 15; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  width: max-content; max-width: 100%; margin: 12px auto 0; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--encre); color: var(--page); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.actions-groupees[hidden] { display: none; }
.actions-groupees [data-compte] { font-weight: 700; font-size: 13px; margin-right: 8px; }
.bouton-citron-plein { background: var(--citron); color: #121211; }
.bouton-citron-plein .bouton-icone { background: #121211; color: var(--citron); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muet); }
.pagination b { color: var(--encre); }
.titre-avatar { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.titre-avatar h1 { margin: 0; }
.titre-avatar .sous-titre a { color: inherit; }
.extraits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.extraits a { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--rayon-s); background: var(--surface-2); text-decoration: none; transition: background 0.15s; }
.extraits a:hover { background: var(--surface-3); }
.extrait-tete { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.extrait-tete .pt { margin: 0; }
.extraits q { font-size: 13.5px; line-height: 1.5; quotes: "« " " »"; }
.extraits small { color: var(--muet); font-size: 12px; }
.liens-pages { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.liens-pages li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.liens-pages a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .barre-filtres .segment-grand { overflow-x: auto; max-width: 100%; } }

/* ---------- Passages ---------- */
.frise-passages { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.passage-ligne { display: grid; grid-template-columns: 44px minmax(160px, 1.2fr) auto minmax(180px, 1fr) 80px 20px; align-items: center; gap: 16px; padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--surface-2); text-decoration: none; transition: background 0.15s; }
.passage-ligne:hover { background: var(--surface-3); }
.passage-titre b { display: block; font-size: 13.5px; }
.passage-titre b::first-letter { text-transform: uppercase; }
.passage-titre small, .passage-qualite small { color: var(--muet); font-size: 12px; }
.passage-qualite b { color: var(--encre); }
.passage-cout { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.passage-cout small { color: var(--muet); }
.statut-ok { background: var(--bon-fond); color: var(--bon-texte); }
.statut-erreur { background: var(--critique-fond); color: var(--critique-texte); }
.empile { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin-bottom: 5px; }
.empile span { display: block; height: 100%; }
.empile-ok { background: var(--encre); }
.empile-attente { background: var(--citron); }
.empile-refus { background: var(--alerte-texte); }
.empile-sans_ia { background: var(--trait-fort); }
.empile-erreurs { background: var(--critique); }
.legende-empile { margin-top: 12px; }
.legende-empile i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.journal { list-style: none; margin: 0; padding: 0; position: relative; }
.journal::before { content: ""; position: absolute; left: 61px; top: 8px; bottom: 8px; width: 2px; background: var(--surface-3); }
.journal li { position: relative; display: grid; grid-template-columns: 44px 36px minmax(0, 1fr); align-items: start; gap: 4px 8px; padding: 6px 0; }
.journal-heure { font-size: 12px; font-weight: 700; color: var(--muet); padding-top: 7px; font-variant-numeric: tabular-nums; }
.journal-point { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--encre-2); box-shadow: 0 0 0 4px var(--surface); }
.journal-point svg:has(> use) { width: 15px; height: 15px; }
.journal-texte { font-size: 13.5px; line-height: 1.45; padding-top: 5px; }
.ton-bon .journal-point { background: var(--bon-fond); color: var(--bon-texte); }
.ton-alerte .journal-point { background: var(--alerte-fond); color: var(--alerte-texte); }
.ton-critique .journal-point { background: var(--critique-fond); color: var(--critique-texte); }
.ton-critique .journal-texte { color: var(--critique-texte); font-weight: 600; }
.ton-debut .journal-point, .ton-fin .journal-point { background: var(--citron); color: #121211; }
.ton-fin .journal-texte { font-weight: 700; }
.moteurs-passage { grid-template-columns: minmax(0, 1fr); }
.moteurs-passage .barre-ligne b small { font-size: 11px; }

@media (max-width: 900px) {
  .passage-ligne { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .passage-qualite { grid-column: 2 / 4; }
  .passage-cout { grid-column: 3; grid-row: 1; display: none; }
  .passage-ligne > .a-faire-fleche { display: none; }
}

/* ---------- Reponses ---------- */
.barre-filtres-reponses { margin-bottom: 12px; }
.barre-filtres-reponses .pilule select { max-width: 190px; }
.reponses { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.reponse-ligne { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto 190px 64px; align-items: center; gap: 14px; padding: 9px 14px 9px 10px; border-radius: 14px; background: var(--surface-2); text-decoration: none; transition: background 0.15s; }
.reponse-ligne:hover { background: var(--surface-3); }
.reponse-verdict { display: flex; }
.reponse-prompt { min-width: 0; }
.reponse-prompt b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reponse-prompt small, .reponse-chiffres { font-size: 12px; color: var(--muet); }
.reponse-chiffres { display: flex; align-items: center; gap: 2px; }
.reponse-date { text-align: right; font-size: 12.5px; font-weight: 700; }
.reponse-date small { display: block; font-weight: 500; color: var(--muet); }

.titre-prompt { font-size: clamp(22px, 2.2vw, 30px); max-width: 980px; }
.sous-titre a { color: inherit; }
.comparaison { margin-bottom: 12px; overflow-x: auto; max-width: 100%; }
.comparaison a { white-space: nowrap; }
.comparaison .etat { font-size: 10.5px; padding: 2px 7px; }
.comparaison a.actif .etat-absent, .comparaison a.actif .etat-cite { background: var(--surface-3); color: var(--encre); }

.reponse-carte { padding: 20px 24px; }
.texte-ia { font-size: 14.5px; line-height: 1.7; max-width: 76ch; color: var(--encre); }
.texte-ia p { margin: 0 0 12px; }
.texte-ia h3, .texte-ia h4, .texte-ia h5 { margin: 20px 0 8px; font-size: 16px; letter-spacing: -0.01em; }
.texte-ia ul, .texte-ia ol { margin: 0 0 12px; padding-left: 22px; }
.texte-ia li { margin-bottom: 4px; }
.texte-ia hr { border: 0; border-top: 1px solid var(--trait); margin: 16px 0; }
.texte-ia a { color: var(--encre-2); font-size: 0.86em; text-decoration: none; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.texte-ia a:hover { background: var(--surface-3); color: var(--encre); }
.texte-ia code { font-size: 0.9em; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); }
.texte-ia table { border-collapse: collapse; margin: 0 0 14px; font-size: 13px; }
.texte-ia th, .texte-ia td { border: 1px solid var(--trait-fort); padding: 6px 10px; text-align: left; vertical-align: top; }
.texte-ia th { background: var(--surface-2); }
mark { color: inherit; border-radius: 5px; padding: 0 3px; }
.m-cible { background: var(--citron); color: #121211; font-weight: 700; }
.m-concurrent { background: var(--concurrent-fond); color: var(--concurrent-texte); font-weight: 600; }

.mentions, .sources-liste, .historique { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mentions li, .sources-liste li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.mentions .rang, .sources-liste .rang { flex-shrink: 0; }
.mention-corps, .source-corps { min-width: 0; display: grid; gap: 2px; }
.mention-nom { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.mention-nom a { text-decoration: none; }
.mention-nom a:hover { text-decoration: underline; }
.mention-nom .pt { margin: 0; }
.mention-corps small, .source-corps small { color: var(--muet); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.source-corps a { font-weight: 700; font-size: 13px; text-decoration: none; }
.source-corps a:hover { text-decoration: underline; }
.historique a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.historique a:hover { background: var(--surface-3); }
.historique a[aria-current] { box-shadow: inset 0 0 0 1.5px var(--encre); }

@media (max-width: 900px) {
  .reponse-ligne { grid-template-columns: auto minmax(0, 1fr) auto; }
  .reponse-chiffres { display: none; }
  .reponse-ligne .puce { grid-row: 2; grid-column: 2; justify-self: start; }
  .reponse-prompt b { white-space: normal; }
}
.source-corps .badge, .mention-nom .badge { justify-self: start; }

/* ---------- Partage ---------- */
.pilule-partage { text-decoration: none; }
.lien-partage.eteint { opacity: 0.72; }
.lien-copie { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--surface-2); }
.lien-copie code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--encre-2); }
.lien-pied { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.lien-pied .outils { gap: 12px; }
.lien-pied form { display: flex; align-items: center; gap: 12px; }
.formulaire .option { margin-top: 10px; font-weight: 600; font-size: 13px; }
.formulaire > .bouton { margin-top: 12px; justify-self: start; }

.barre-rapport { padding: 14px 28px; }
.rapport-marque { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: 8px; }
.rapport-marque b { display: block; font-size: 15px; }
.rapport-marque small { display: block; color: var(--muet); font-size: 12px; }
.signature { font-size: 12.5px; color: var(--muet); white-space: nowrap; }
.signature b { color: var(--encre); }
.page-rapport { margin: 0 auto; padding: 2px 28px 40px; }
.pied-rapport { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; max-width: 1680px; margin: 0 auto; padding: 0 28px 32px; font-size: 12px; color: var(--muet); }
.signature-carte { margin: auto 0 0; padding-top: 10px; font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.signature-carte b { color: #fff; }
span.etat { cursor: default; }

@media (max-width: 900px) {
  .barre-rapport { padding: 12px 16px; flex-wrap: wrap; }
  .barre-rapport .onglets { order: 3; width: 100%; overflow-x: auto; }
  .signature { display: none; }
  .page-rapport { padding: 0 16px 32px; }
  .pied-rapport { padding: 0 16px 24px; }
}

/* ---------- Bulles d'aide (survol des indicateurs) ---------- */
.bulle {
  position: fixed; z-index: 100; max-width: 270px; padding: 9px 12px; border-radius: 12px;
  background: var(--encre); color: var(--surface); font-size: 12.5px; font-weight: 500; line-height: 1.45;
  text-align: left; text-transform: none; letter-spacing: 0; white-space: normal;
  box-shadow: 0 10px 30px rgba(18, 18, 17, 0.22); pointer-events: none;
  animation: bulle-entree 0.14s ease-out;
}
.bulle::after {
  content: ""; position: absolute; left: var(--fleche, 50%); top: 100%; width: 10px; height: 10px;
  background: inherit; transform: translate(-50%, -5px) rotate(45deg); border-radius: 2px;
}
.bulle.dessous::after { top: auto; bottom: 100%; transform: translate(-50%, 5px) rotate(45deg); }
.bulle[hidden] { display: none; }
@keyframes bulle-entree { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bulle { animation: none; } }
th[data-bulle], dl [data-bulle] dt, .legende [data-bulle], .repartition [data-bulle], .fait[data-bulle] > span:first-child,
.client-faits [data-bulle] dt, .jauge-texte[data-bulle] span, #hero-titre[data-bulle] {
  text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 3px;
}
[data-bulle]:not(a):not(button) { cursor: help; }

@media print {
  .barre, .rail, .filtres, .segment, [data-imprimer], [data-theme-bascule], .vue-tableau, .bulle { display: none !important; }
  body { background: #fff; }
  .page, .page-rapport { padding: 0; max-width: none; }
  .carte, .tuile { box-shadow: none; border: 1px solid #e3e3de; break-inside: avoid; }
  .defile.haut { max-height: none; overflow: visible; }
  .appli { display: block; }
}
