/* ==========================================================================
   Interface v2 — espace Énergie : Portefeuille, Veille client, Consultations
   (refonte UX, 25/08/2026)
   ==========================================================================
   Compagnon de ui-v2-energie.js. Tout est scopé html.ui-v2 et préfixé v2e-
   (e comme énergie) : sans le drapeau "sobria-ui-v2", ce fichier ne change
   RIEN. Jetons de design-tokens.css (thème clair posé par la coquille) et
   variables de ui-v2.css (--v2-bordure-douce). Règles du cahier : cartes
   blanches radius 12, boutons/champs radius 8, pastilles radius 4, grille
   8 pt, cibles 44 px, un seul bouton primaire cuivre par écran, H1 PT Serif.
   ========================================================================== */

/* ------------------------------------------------------- en-tête d'écran */
html.ui-v2 .v2e-entete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
html.ui-v2 .v2e-entete h1 {
  margin: 0;
  font-family: var(--font-head, "PT Serif", Georgia, serif);
  font-size: 28px;
  line-height: 1.2;
  color: var(--sobria-nuit);
}
html.ui-v2 .v2e-entete-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ----------------------------------------------------------------- boutons */
/* Un seul primaire cuivre par écran ; les autres restent blancs bordés. */
html.ui-v2 .v2e-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 8px;
  background: var(--fond-surface, #fff);
  color: var(--texte);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
html.ui-v2 .v2e-btn:hover { background: #faf8f3; }
html.ui-v2 .v2e-btn svg { width: 18px; height: 18px; flex: none; }
html.ui-v2 .v2e-btn-primaire {
  border: 0;
  background: var(--sobria-cuivre);
  color: #fff;
  font-weight: 600;
}
html.ui-v2 .v2e-btn-primaire:hover { background: #b06c33; }
html.ui-v2 .v2e-btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
/* Boutons-icônes des lignes de tableau (corriger / supprimer un dossier). */
html.ui-v2 .v2e-btn-icone {
  width: 36px;
  height: 36px;
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 8px;
  background: var(--fond-surface, #fff);
  color: var(--texte-attenue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html.ui-v2 .v2e-btn-icone:hover { background: #faf8f3; color: var(--texte); }
html.ui-v2 .v2e-btn-icone svg { width: 16px; height: 16px; }
/* #a3392b : rouge assombri lisible sur blanc — le jeton --erreur est calibré
   pour les fonds sombres et ne tient pas 4,5:1 ici (mesure du 07/08). */
html.ui-v2 .v2e-btn-icone.v2e-danger:hover { color: #a3392b; border-color: #a3392b; }
/* Décisions du panneau signal : approuver vert, rejeter rouge — bordés,
   jamais cuivre (le primaire de l'écran est « Relever maintenant »). */
html.ui-v2 .v2e-btn-approuver { color: #3f8f5f; border-color: #3f8f5f; }
html.ui-v2 .v2e-btn-approuver:hover { background: #eaf5ee; }
html.ui-v2 .v2e-btn-rejeter { color: #a3392b; border-color: #d8b6b0; }
html.ui-v2 .v2e-btn-rejeter:hover { background: #fbeeec; }

/* ---------------------------------------------------------------- cartes */
html.ui-v2 .v2e-carte {
  background: var(--fond-surface, #fff);
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 12px;
  box-shadow: var(--ombre-1, 0 1px 2px rgba(20, 33, 59, .06));
  overflow: hidden;
}
html.ui-v2 .v2e-carte-pleine { margin-top: 16px; padding: 16px; overflow: visible; }
html.ui-v2 .v2e-carte-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
html.ui-v2 .v2e-carte-tete h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--sobria-nuit);
}
/* La carte-table a son en-tête DANS la carte (padding local). */
html.ui-v2 .v2e-carte-table .v2e-carte-tete { padding: 14px 16px 6px; margin: 0; }
html.ui-v2 .v2e-outils { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Piège documenté du dépôt : [hidden] perd contre un display posé par
   classe. La garde ci-dessous rend les deux compatibles. */
html.ui-v2 .v2e-perso { display: inline-flex; align-items: center; gap: 6px; }
html.ui-v2 .v2e-perso[hidden] { display: none; }

html.ui-v2 .v2e-vide {
  padding: 32px 24px;
  text-align: center;
  color: var(--texte-attenue);
  font-size: 14px;
}
html.ui-v2 .v2e-vide-compact { padding: 16px 12px; }
html.ui-v2 .v2e-vide-action { margin-top: 12px; }

/* --------------------------------------------------------------- champs */
html.ui-v2 .v2e-select {
  width: auto;
  max-width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 8px;
  background: var(--fond-surface, #fff);
  color: var(--texte);
  font-size: 13.5px;
}
html.ui-v2 .v2e-recherche {
  flex: 1 1 240px;
  min-width: 200px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 8px;
  background: var(--fond-surface, #fff);
  color: var(--texte);
  font-size: 14px;
}
html.ui-v2 .v2e-visuallyhidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ texte */
html.ui-v2 .v2e-meta { font-size: 12.5px; color: var(--texte-attenue); }
html.ui-v2 p.v2e-meta { margin: 4px 0; }
html.ui-v2 .v2e-attenue { color: var(--texte-attenue); }
html.ui-v2 .v2e-nom {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sobria-nuit);
  text-decoration: none;
}
html.ui-v2 a.v2e-nom:hover { color: var(--cuivre-clair, #a05f27); }
html.ui-v2 .v2e-unite { font-size: 11.5px; color: var(--texte-attenue); }
html.ui-v2 .v2e-lien {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cuivre-clair, #a05f27);
  text-decoration: none;
}
html.ui-v2 .v2e-lien:hover { text-decoration: underline; }
html.ui-v2 .v2e-lien svg { width: 14px; height: 14px; }
html.ui-v2 .v2e-texte-rouge { color: #a3392b; }
html.ui-v2 .v2e-texte-ambre { color: #9a6b1a; }
html.ui-v2 .v2e-italique { font-style: italic; }
html.ui-v2 .v2e-chapo { max-width: 74ch; margin: 0 0 12px; }
html.ui-v2 .v2e-manques { margin: 10px 0 0; }
html.ui-v2 .v2e-compteur { margin-left: auto; white-space: nowrap; }

/* -------------------------------------------------------------- pastilles */
/* Radius 4, pastel — jamais un pictogramme seul, toujours un mot. */
html.ui-v2 .v2e-pastille {
  display: inline-block;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  white-space: nowrap;
}
html.ui-v2 .v2e-pastille-vert   { background: #eaf5ee; color: #3f8f5f; }
html.ui-v2 .v2e-pastille-ambre  { background: #fdf3e3; color: #9a6b1a; }
html.ui-v2 .v2e-pastille-bleu   { background: #eef3fb; color: #2f5fa8; }
html.ui-v2 .v2e-pastille-rouge  { background: #fbeeec; color: #a3392b; }
html.ui-v2 .v2e-pastille-neutre { background: #efeeec; color: #676d7c; }
html.ui-v2 .v2e-pastille-borde {
  background: transparent;
  border: 1px solid var(--v2-bordure-douce);
  color: var(--texte-attenue);
  font-weight: 500;
}

/* ------------------------------------------------------------------ tableau */
html.ui-v2 .v2e-tableau {
  width: 100%;
  border-collapse: collapse;
}
html.ui-v2 .v2e-tableau th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--texte-attenue);
  padding: 12px;
  border-bottom: 1px solid var(--v2-bordure-douce);
  white-space: nowrap;
}
html.ui-v2 .v2e-tableau td {
  padding: 10px 12px;
  border-top: 1px solid var(--v2-bordure-douce);
  font-size: 14px;
  vertical-align: middle;
}
html.ui-v2 .v2e-tableau tbody tr:first-child td { border-top: 0; }
html.ui-v2 .v2e-tableau tbody tr[data-nav],
html.ui-v2 .v2e-tableau tbody tr.v2e-ligne-signal { cursor: pointer; }
html.ui-v2 .v2e-tableau tbody tr[data-nav]:hover,
html.ui-v2 .v2e-tableau tbody tr.v2e-ligne-signal:hover { background: #faf8f3; }
html.ui-v2 .v2e-tableau tbody tr:focus-visible {
  outline: 2px solid var(--sobria-cuivre);
  outline-offset: -2px;
}
html.ui-v2 .v2e-tableau a { color: var(--cuivre-clair, #a05f27); }
html.ui-v2 .v2e-tableau a.v2e-nom { color: var(--sobria-nuit); }
html.ui-v2 .v2e-c-num { text-align: right; white-space: nowrap; }
html.ui-v2 .v2e-c-numero { white-space: nowrap; font-size: 13px; color: var(--texte-attenue); }
html.ui-v2 .v2e-c-actions { white-space: nowrap; text-align: right; }
html.ui-v2 .v2e-c-echeance, html.ui-v2 .v2e-c-date { white-space: nowrap; }
html.ui-v2 .v2e-tableau-compact th, html.ui-v2 .v2e-tableau-compact td {
  padding: 6px 10px;
  font-size: 13px;
}
html.ui-v2 .v2e-table-defile { overflow-x: auto; margin-top: 10px; }

/* Icône + libellé d'énergie (éclair / flamme, jamais un emoji). */
html.ui-v2 .v2e-energie {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--texte);
  white-space: nowrap;
}
html.ui-v2 .v2e-energie svg { width: 16px; height: 16px; color: var(--sobria-cuivre); flex: none; }

/* Pastille d'initiales du responsable (nom complet au survol). */
html.ui-v2 .v2e-initiales {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sobria-creme, #F4F1E9);
  border: 1px solid var(--v2-bordure-douce);
  color: var(--sobria-nuit);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .02em;
}

/* Lignes de liste simples (détail des renouvellements). */
html.ui-v2 .v2e-ligne-liste {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 4px;
  border-top: 1px solid var(--v2-bordure-douce);
  cursor: pointer;
}
html.ui-v2 .v2e-ligne-liste:hover { background: #faf8f3; }
html.ui-v2 .v2e-ligne-liste:focus-visible {
  outline: 2px solid var(--sobria-cuivre);
  outline-offset: -2px;
}
html.ui-v2 .v2e-grandit { flex: 1; min-width: 0; }
html.ui-v2 .v2e-detail-titre { margin: 14px 0 4px; font-size: 14px; color: var(--sobria-nuit); }

/* ==========================================================================
   ÉCRAN 1 — Portefeuille énergie
   ========================================================================== */

/* Rangée de 4 KPI : pastille ronde crème-cuivre, chiffre PT Serif 28. */
html.ui-v2 .v2e-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
html.ui-v2 .v2e-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--fond-surface, #fff);
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--ombre-1, 0 1px 2px rgba(20, 33, 59, .06));
}
html.ui-v2 .v2e-kpi-icone {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sobria-creme, #F4F1E9);
  border: 1px solid var(--v2-bordure-douce);
  color: var(--sobria-cuivre);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
html.ui-v2 .v2e-kpi-icone svg { width: 22px; height: 22px; }
html.ui-v2 .v2e-kpi-num {
  font-family: var(--font-head, "PT Serif", Georgia, serif);
  font-size: 28px;
  line-height: 1.1;
  color: var(--sobria-nuit);
}
html.ui-v2 .v2e-kpi-lbl { font-size: 12.5px; color: var(--texte-attenue); margin-top: 2px; }
html.ui-v2 .v2e-kpi-lbl span { display: block; font-size: 11px; opacity: .85; }
html.ui-v2 .v2e-kpi-sous { margin: 8px 0 0; }

/* Grille principale : la table des dossiers + la colonne des échéances. */
html.ui-v2 .v2e-pf-grille {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
html.ui-v2 .v2e-pf-aside { min-width: 0; }
html.ui-v2 .v2e-aside-titre {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--sobria-nuit);
}

/* Bandeau d'alerte des échéances — l'information de la v1, conservée. */
html.ui-v2 .v2e-alerte-echeances {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fdf3e3;
  border: 1px solid #ecd9b4;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: #6b4a10;
  margin-bottom: 12px;
}
html.ui-v2 .v2e-alerte-echeances svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* Cartes d'échéance : le jour en gros PT Serif, le mois dessous. */
html.ui-v2 .v2e-echeance {
  display: flex;
  gap: 14px;
  background: var(--fond-surface, #fff);
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--ombre-1, 0 1px 2px rgba(20, 33, 59, .06));
}
html.ui-v2 .v2e-echeance-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--sobria-creme, #F4F1E9);
  border: 1px solid var(--v2-bordure-douce);
  flex: none;
  align-self: flex-start;
}
html.ui-v2 .v2e-echeance-jour {
  font-family: var(--font-head, "PT Serif", Georgia, serif);
  font-size: 24px;
  line-height: 1.1;
  color: var(--sobria-nuit);
}
html.ui-v2 .v2e-echeance-mois { font-size: 12px; color: var(--texte-attenue); }
html.ui-v2 .v2e-echeance-annee { font-size: 10.5px; color: var(--texte-attenue); opacity: .8; }
html.ui-v2 .v2e-echeance-corps { flex: 1; min-width: 0; }
html.ui-v2 .v2e-echeance-societe {
  font-size: 14px;
  font-weight: 600;
  color: var(--sobria-nuit);
  margin-bottom: 2px;
}
html.ui-v2 .v2e-echeance-corps .v2e-meta { margin-top: 2px; }
html.ui-v2 .v2e-echeance-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Mini-tuiles de la section « Négocié … ». */
html.ui-v2 .v2e-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
html.ui-v2 .v2e-stat {
  background: var(--fond-surface-2, #faf8f1);
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 8px;
  padding: 10px 12px;
}
html.ui-v2 .v2e-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--sobria-nuit);
  line-height: 1.2;
}
html.ui-v2 .v2e-stat-lbl { font-size: 12px; color: var(--texte-attenue); margin-top: 2px; }
html.ui-v2 .v2e-stat-sous { font-size: 11px; color: var(--texte-attenue); opacity: .85; margin-top: 2px; }

/* Graphiques en barres (historique mensuel, renouvellements 24 mois). */
html.ui-v2 .v2e-graph {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding: 8px 0 0;
  overflow-x: auto;
}
html.ui-v2 .v2e-graph-col {
  flex: 1 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}
html.ui-v2 .v2e-graph-cliquable { cursor: pointer; }
html.ui-v2 .v2e-graph-cliquable:hover .v2e-graph-baton > div { background: #b06c33; }
html.ui-v2 .v2e-graph-baton {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
html.ui-v2 .v2e-graph-baton > div {
  width: 60%;
  min-width: 10px;
  border-radius: 4px 4px 0 0;
  background: var(--sobria-cuivre);
}
html.ui-v2 .v2e-graph-vide .v2e-graph-baton > div { background: transparent; }
html.ui-v2 .v2e-graph-lbl {
  font-size: 10px;
  line-height: 1.25;
  color: var(--texte-attenue);
  text-align: center;
  white-space: nowrap;
}

/* ==========================================================================
   ÉCRAN 2 — Veille client
   ========================================================================== */

/* Onglets des deux veilles — soulignés cuivre, cibles 44 px. */
html.ui-v2 .v2e-onglets {
  display: flex;
  gap: 22px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--v2-bordure-douce);
}
html.ui-v2 .v2e-onglets a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  font-size: 14px;
  color: var(--texte-attenue);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
html.ui-v2 .v2e-onglets a:hover { color: var(--sobria-nuit); }
html.ui-v2 .v2e-onglets a.v2e-onglet-actif {
  color: var(--sobria-nuit);
  font-weight: 600;
  border-bottom-color: var(--sobria-cuivre);
}

/* Bandeau d'état du module (coupe-circuit) — jamais fermable. */
html.ui-v2 .v2e-bandeau {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 12px;
  border: 1px solid var(--v2-bordure-douce);
  background: var(--fond-surface, #fff);
  color: var(--texte);
}
html.ui-v2 .v2e-bandeau-vert  { border-left: 4px solid #3f8f5f; }
html.ui-v2 .v2e-bandeau-rouge { border-left: 4px solid #a3392b; background: #fbeeec; color: #5d2a23; }
html.ui-v2 .v2e-bandeau-ambre { border-left: 4px solid #ca8522; background: #fdf3e3; color: #5c430e; }

/* Filtres en pilules. */
html.ui-v2 .v2e-filtres {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
html.ui-v2 .v2e-pilules { display: inline-flex; gap: 6px; flex-wrap: wrap; }
html.ui-v2 .v2e-pilule {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 18px;
  background: var(--fond-surface, #fff);
  color: var(--texte);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
html.ui-v2 .v2e-pilule:hover { background: #faf8f3; }
html.ui-v2 .v2e-pilule-active {
  background: var(--sobria-nuit);
  border-color: var(--sobria-nuit);
  color: #fff;
  font-weight: 600;
}
html.ui-v2 .v2e-pilule-nb {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9px;
  background: rgba(20, 33, 59, .08);
}
html.ui-v2 .v2e-pilule-active .v2e-pilule-nb { background: rgba(255, 255, 255, .18); }

html.ui-v2 .v2e-c-motif { max-width: 320px; }
html.ui-v2 .v2e-extrait {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
html.ui-v2 .v2e-confiance { white-space: nowrap; }

/* -------------------------------------------------------- panneau latéral */
html.ui-v2 .v2e-panneau {
  position: fixed;
  top: calc(var(--banniere-env-h, 0px) + var(--v2-topbar-hauteur, 64px));
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  background: var(--fond-surface, #fff);
  border-left: 1px solid var(--v2-bordure-douce);
  box-shadow: -12px 0 32px rgba(20, 33, 59, .12);
  transform: translateX(105%);
  transition: transform var(--duree-moyenne, 200ms) var(--courbe, ease-out);
  z-index: 70;                       /* sous les modales, sur le contenu */
  overflow-y: auto;
  padding: 24px;
}
html.ui-v2 .v2e-panneau.v2e-ouvert { transform: none; }
html.ui-v2 .v2e-panneau-fermer {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--texte);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html.ui-v2 .v2e-panneau-fermer:hover { background: var(--fond-survol, #efeade); }
html.ui-v2 .v2e-panneau-fermer svg { width: 20px; height: 20px; }
html.ui-v2 .v2e-panneau h2 {
  margin: 0 44px 2px 0;
  font-size: 20px;
  font-family: var(--font-head, "PT Serif", Georgia, serif);
  color: var(--sobria-nuit);
}
html.ui-v2 .v2e-panneau-sous {
  font-size: 13px;
  color: var(--texte-attenue);
  margin-bottom: 12px;
}
html.ui-v2 .v2e-panneau-bloc {
  border-top: 1px solid var(--v2-bordure-douce);
  padding: 14px 0;
}
html.ui-v2 .v2e-panneau-bloc h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--texte-attenue);
}

/* Le score en grand : jauge en arc, un seul trait. */
html.ui-v2 .v2e-bloc-score { text-align: center; }
html.ui-v2 .v2e-jauge { position: relative; width: 180px; margin: 0 auto 6px; }
html.ui-v2 .v2e-jauge svg { width: 100%; height: auto; display: block; }
html.ui-v2 .v2e-jauge-num {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  font-family: var(--font-head, "PT Serif", Georgia, serif);
  font-size: 30px;
  line-height: 1;
  color: var(--sobria-nuit);
}
html.ui-v2 .v2e-jauge-num span { font-size: 14px; color: var(--texte-attenue); }
html.ui-v2 .v2e-jauge-vide { padding: 12px 0; }
html.ui-v2 .v2e-jauge-vide .v2e-jauge-num {
  position: static;
  font-size: 30px;
}

/* Barres du détail du score, critère par critère. */
html.ui-v2 .v2e-critere { margin-bottom: 10px; text-align: left; }
html.ui-v2 .v2e-critere-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--texte);
  margin-bottom: 3px;
}
html.ui-v2 .v2e-critere-barre {
  height: 6px;
  border-radius: 3px;
  background: var(--sobria-creme, #F4F1E9);
  border: 1px solid var(--v2-bordure-douce);
  overflow: hidden;
}
html.ui-v2 .v2e-critere-barre > div {
  height: 100%;
  background: var(--sobria-cuivre);
  border-radius: 3px;
}

/* Blocs dépliables du panneau (nature, provenance, solvabilité…). */
html.ui-v2 .v2e-pli { margin: 8px 0; }
html.ui-v2 .v2e-pli summary {
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sobria-nuit);
}
html.ui-v2 .v2e-pli summary:hover { color: var(--cuivre-clair, #a05f27); }
html.ui-v2 .v2e-dl {
  margin: 6px 0 0;
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
html.ui-v2 .v2e-dl dt { color: var(--texte-attenue); }
html.ui-v2 .v2e-dl dd { margin: 0; color: var(--texte); overflow-wrap: anywhere; }
html.ui-v2 .v2e-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  background: var(--fond-surface-2, #faf8f1);
  border: 1px solid var(--v2-bordure-douce);
  border-radius: 8px;
  padding: 10px;
  margin: 6px 0;
  max-height: 220px;
  overflow-y: auto;
}
html.ui-v2 .v2e-panneau-actions-decision {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--v2-bordure-douce);
  padding-top: 14px;
}
html.ui-v2 .v2e-panneau-actions-decision .v2e-btn { padding: 0 8px; font-size: 13px; }
html.ui-v2 .v2e-verrou-envoi { margin-top: 10px; }

/* --------------------------------------------------------- accessibilité */
html.ui-v2 .v2e-btn:focus-visible,
html.ui-v2 .v2e-pilule:focus-visible,
html.ui-v2 .v2e-select:focus-visible,
html.ui-v2 .v2e-recherche:focus-visible,
html.ui-v2 .v2e-btn-icone:focus-visible {
  outline: 2px solid var(--sobria-cuivre);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 1100px) {
  /* La colonne des échéances passe sous la table avant l'écran téléphone. */
  html.ui-v2 .v2e-pf-grille { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  html.ui-v2 .v2e-entete { align-items: flex-start; flex-direction: column; }
  html.ui-v2 .v2e-entete h1 { font-size: 24px; }
  html.ui-v2 .v2e-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  html.ui-v2 .v2e-kpi { padding: 12px; gap: 10px; }
  html.ui-v2 .v2e-kpi-num { font-size: 22px; }
  html.ui-v2 .v2e-kpi-icone { width: 38px; height: 38px; }
  html.ui-v2 .v2e-compteur { margin-left: 0; }
  html.ui-v2 .v2e-select, html.ui-v2 .v2e-recherche { min-height: 44px; }

  /* Tableaux → cartes empilées ; les colonnes secondaires s'effacent,
     l'essentiel reste : nom, statut, échéance / économie / offres. */
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact) thead { display: none; }
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact),
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact) tbody,
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact) tr,
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact) td { display: block; }
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact) tbody tr {
    padding: 12px 16px;
    border-top: 1px solid var(--v2-bordure-douce);
  }
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact) tbody tr:first-child { border-top: 0; }
  html.ui-v2 .v2e-tableau:not(.v2e-tableau-compact) td {
    padding: 2px 0;
    border: 0;
  }
  html.ui-v2 .v2e-c-num { text-align: left; }
  html.ui-v2 .v2e-c-actions { text-align: left; }
  /* Colonnes reléguées au panneau ou au détail sur téléphone. */
  html.ui-v2 .v2e-c-resp,
  html.ui-v2 .v2e-c-source,
  html.ui-v2 .v2e-c-numero,
  html.ui-v2 .v2e-c-action { display: none; }
  html.ui-v2 .v2e-c-motif { max-width: none; }

  /* Le panneau devient une feuille plein écran. */
  html.ui-v2 .v2e-panneau {
    top: var(--banniere-env-h, 0px);
    width: 100vw;
    border-left: 0;
    z-index: 80;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }
  html.ui-v2 .v2e-panneau-actions-decision .v2e-btn { font-size: 12.5px; }

  /* Le graphique défile dans sa carte, jamais la page. */
  html.ui-v2 .v2e-graph-col { flex: 0 0 34px; }
}
