/* V5 · NAVIGATION — barre latérale calme et lisible, inspirée des espaces Claude et ChatGPT ;
   Cursor apporte les compteurs et statuts utiles. Sélection neutre, hiérarchie discrète, rail réduit accessible.
   Organisation : marque et contexte (comptes) en haut, sections groupées, réglages et compte en bas. */

.v5-lateral{
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--v5-fond-lateral); user-select: none;
}

/* ---- en-tête : marque + bouton de réduction, aligné sur la barre d'outils */
.v5-lateral-tete{
  display: flex; align-items: center; gap: 6px; flex: none;
  height: var(--v5-barre-h); padding: 0 8px 0 16px;
}
.v5-marque{ display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: var(--v5-t-15); font-weight: var(--v5-g-gras); letter-spacing: -.01em; }
.v5-marque-logo{ width: 22px; height: 22px; flex: none; object-fit: contain; }   /* la forme violette seule, la même que l'onglet et l'extension */
/* logo et nom « BDRD » retirés de l'en-tête de la barre latérale (demande de Lucas du 10/10) : il ne reste que le bouton de réduction, à droite */
.v5-marque{ display: none; }
.v5-lateral-tete{ padding: 0 8px; }

/* ---- outils de fenêtre, en haut à gauche comme dans Claude de bureau : ≡ · barre latérale · ← →.
   Symboles seuls, sans cadre. Dans l'en-tête de la barre latérale quand elle est développée, au début de la barre d'outils sinon. */
.v5-fenetre-outils{ display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1; min-width: 0; }
.v5-fenetre-nav{ display: flex; align-items: center; gap: 2px; flex: none; }
.v5-fenetre-outils .v5-fenetre-nav .v5-btn{ width: var(--v5-ctrl-l); height: var(--v5-ctrl-l); padding: 0; border-radius: var(--v5-r-ctrl); background: none; box-shadow: none; filter: none; color: var(--v5-texte-2); }
.v5-fenetre-outils .v5-fenetre-nav .v5-btn:hover{ background: var(--v5-survol); color: var(--v5-texte); filter: none; }
.v5-fenetre-outils .v5-fenetre-nav .v5-btn:active{ background: var(--v5-presse); filter: none; }
.v5-fenetre-outils .v5-fenetre-nav .v5-btn:disabled{ color: var(--v5-texte-inactif); background: none; }
.v5-fenetre-outils .v5-fenetre-nav .v5-btn svg{ width: 17px; height: 17px; }
/* commutateur Discussion / BDRD : deux symboles dans un petit cadre, celui de la partie ouverte est en relief */
.v5-fenetre-outils .v5-partie{ display: inline-flex; flex: none; gap: 2px; height: var(--v5-ctrl-l); padding: 2px; box-sizing: border-box; border-radius: var(--v5-r-sel); background: var(--v5-rempli-2); box-shadow: none; }
.v5-fenetre-outils .v5-partie button{ display: grid; place-items: center; width: 32px; height: 100%; padding: 0; border: 0; border-radius: var(--v5-r-ctrl); background: none; color: var(--v5-texte-3); cursor: default; }
.v5-fenetre-outils .v5-partie button::before{ content: none; }
.v5-fenetre-outils .v5-partie button svg{ width: 16px; height: 16px; }
.v5-fenetre-outils .v5-partie button:hover{ background: none; color: var(--v5-texte); }
.v5-fenetre-outils .v5-partie button[aria-pressed="true"]{ background: var(--v5-bouton-presse); color: var(--v5-texte); }
.v5-barre .v5-fenetre-outils{ flex: none; margin-right: 6px; }
/* la barre latérale ne montre que les pages de la partie choisie */
.v5-app[data-partie="outils"] .v5-lateral [data-partie]:not([data-partie="outils"]), .v5-app[data-partie="assistant"] .v5-lateral [data-partie]:not([data-partie="assistant"]){ display: none; }

.v5-app[data-partie="gestion"] .v5-lateral [data-partie="studio"], .v5-app[data-partie="studio"] .v5-lateral [data-partie="gestion"]{ display: none; }

/* ---- comptes Vinted suivis : bouton pop-up (points d'état + nombre), la liste s'ouvre dans un menu */
.v5-comptes{
  display: flex; align-items: center; gap: 7px; flex: none; box-sizing: border-box; height: var(--v5-ctrl-l); margin: 2px 10px 8px; padding: 0 6px 0 10px;
  border: 0; border-radius: var(--v5-r-sel); background: var(--v5-rempli-3); color: var(--v5-texte); text-align: left; cursor: default;
  font: var(--v5-g-moyen) var(--v5-t-13)/16px var(--v5-police);
}
.v5-comptes:hover{ background: var(--v5-rempli-2); }
.v5-comptes[aria-expanded="true"]{ background: var(--v5-presse); }
.v5-comptes-points{ display: inline-flex; gap: 3px; }
.v5-comptes-points .v5-point{ width: 7px; height: 7px; }
.v5-comptes-lib{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v5-comptes .v5-chevrons{ width: 14px; height: 14px; color: var(--v5-texte-2); }

/* ---- éléments de navigation */
.v5-lateral-nav{ flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 10px 10px; }
.v5-lateral-nav::-webkit-scrollbar{ display: none; }
@supports not selector(::-webkit-scrollbar){ .v5-lateral-nav{ scrollbar-width: none; } }
.v5-nav-groupe + .v5-nav-groupe{ margin-top: 18px; }   /* 13/10 : plus d’air entre les sections (Notion) */
.v5-nav-titre{
  height: 18px; padding: 0 6px 2px; display: flex; align-items: center;
  font-size: var(--v5-t-11); font-weight: var(--v5-g-gras); color: var(--v5-texte-3); white-space: nowrap;
}

.v5-nav-item{
  position: relative; display: flex; align-items: center; gap: 6px; box-sizing: border-box; width: 100%;
  height: var(--v5-ligne-h); padding: 0 6px; margin: 0; border: 0; border-radius: var(--v5-r-sel);
  background: none; text-align: left; white-space: nowrap; cursor: default;
  font-size: var(--v5-t-13); font-weight: var(--v5-g-normal); line-height: 16px; color: var(--v5-texte);
  transition: background-color var(--v5-duree);
}
.v5-nav-item svg{ width: 18px; height: 18px; margin: 0 1px; color: var(--v5-texte-2); }
/* Survol discret (Claude / ChatGPT) ; la page courante garde son fond neutre plus marqué. */
.v5-nav-item:hover{ background: var(--v5-survol); }
.v5-nav-item:active{ background: var(--v5-presse); }
.v5-nav-item[aria-current="page"]{ background: var(--v5-actif-nav); font-weight: var(--v5-g-moyen); }
.v5-nav-item[aria-current="page"] svg{ color: var(--v5-texte); }
.v5-nav-lib{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.v5-nav-item .v5-compteur{ padding-right: 4px; font-weight: var(--v5-g-normal); }
.v5-nav-item .v5-compteur:empty{ display: none; }
.v5-nav-item .v5-point{ margin-right: 4px; }
/* page hors formule : libellé atténué, petit cadenas à droite */
.v5-nav-item[data-verrou] .v5-nav-lib{ color: var(--v5-texte-3); }
.v5-nav-item .v5-nav-verrou{ display: inline-flex; margin-left: auto; margin-right: 2px; color: var(--v5-texte-3); }
.v5-nav-item .v5-nav-verrou svg{ width: 13px; height: 13px; }
.v5-app[data-lateral="reduite"] .v5-nav-item .v5-nav-verrou{ display: none; }
.v5-nav-item .v5-kbd{ margin-left: auto; opacity: 0; background: none; transition: opacity var(--v5-duree); }
.v5-nav-item:hover .v5-kbd, .v5-nav-item:focus-visible .v5-kbd{ opacity: 1; }

.v5-nav-nouveau{ margin-bottom: 0; }

/* ---- bas : le compte seul (13/10). Réglages, Abonnement et Extension sont dans son menu ; pas de filet : la barre se termine calmement */
.v5-lateral-pied{ flex: none; padding: 6px 10px 10px; }
.v5-compte{
  display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; height: 44px; margin-top: 4px; padding: 0 6px;
  border: 0; border-radius: var(--v5-r-sel); background: none; text-align: left; cursor: default; color: var(--v5-texte);
}
.v5-compte:hover{ background: var(--v5-survol); }
.v5-compte[aria-expanded="true"]{ background: var(--v5-presse); }
.v5-compte[aria-current="page"]{ background: var(--v5-actif-nav); }   /* Réglages, Abonnement, Extension : on y est entré par le compte */
.v5-avatar{
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--v5-rempli-1);
  font-size: var(--v5-t-13); font-weight: var(--v5-g-fort); color: var(--v5-texte-2);
}
.v5-compte-textes{ flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.v5-compte-nom{ font-size: var(--v5-t-13); font-weight: var(--v5-g-moyen); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v5-compte-offre{ font-size: var(--v5-t-11); color: var(--v5-texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v5-compte .v5-chevrons{ width: 14px; height: 14px; color: var(--v5-texte-2); }

/* ---- barre réduite : rail d'icônes, aucun texte (les bulles d'aide donnent les noms) */
.v5-app[data-lateral="reduite"] .v5-lateral-tete{ justify-content: center; padding: 0; }
.v5-app[data-lateral="reduite"] .v5-marque,
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-lib,
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-item .v5-compteur,
.v5-app[data-lateral="reduite"] .v5-compte-textes,
.v5-app[data-lateral="reduite"] .v5-compte .v5-chevrons{ display: none; }
.v5-app[data-lateral="reduite"] .v5-comptes,
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-item .v5-kbd{ display: none; }
.v5-app[data-lateral="reduite"] .v5-lateral-nav,
.v5-app[data-lateral="reduite"] .v5-lateral-pied{ padding-left: 10px; padding-right: 10px; }
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-item{ justify-content: center; padding: 0; }
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-titre{ height: 1px; margin: 7px 6px; padding: 0; font-size: 0; background: var(--v5-separateur); }
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-groupe + .v5-nav-groupe{ margin-top: 0; }
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-item .v5-point{ position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; margin: 0; }
.v5-app[data-lateral="reduite"] .v5-compte{ justify-content: center; padding: 0; }

/* Contraste élevé Windows : la page courante n'était marquée que par un fond d'auteur, non rendu dans ce mode. On reprend les couleurs « sélection »
   du système (Highlight / HighlightText), comme dans une liste native. Les enfants héritent la couleur. */
@media (forced-colors: active){
  .v5-nav-item[aria-current="page"]{ background: Highlight; color: HighlightText; }
  .v5-nav-item[aria-current="page"] *{ color: inherit; }
  .v5-compte[aria-current="page"]{ background: Highlight; color: HighlightText; }
  .v5-compte[aria-current="page"] *{ color: inherit; }
}

/* ---- crédits restants (js/v5/credits.js) : dans la ligne du compte, après la formule (« Pro · 1 000 crédits ») — comme le bas de la barre
   latérale de ChatGPT, une seule ligne. Orange sous 30 %, rouge sous 10 % : on le voit quand ça compte, pas avant. */
.v5-compte-offre .v5-compte-credits{ font-variant-numeric: tabular-nums; }
.v5-compte-offre .v5-compte-credits[data-niveau="moyen"]{ color: var(--v5-orange); }
.v5-compte-offre .v5-compte-credits[data-niveau="bas"]{ color: var(--v5-rouge); }
/* 15/10 — jauge des crédits du mois au-dessus du compte (« voir ce qui est consommé et où on en est ») : une ligne de texte et une
   barre de 4 px, sans carte ; la barre se remplit à mesure que les crédits du mois sont utilisés. Un clic ouvre Abonnement. */
.v5-credits-jauge{ display: flex; flex-direction: column; gap: 5px; box-sizing: border-box; width: 100%; margin: 0 0 2px; padding: 7px 8px; border: 0;
  border-radius: var(--v5-r-sel); background: none; color: var(--v5-texte-2); font: var(--v5-g-normal) var(--v5-t-11) / 14px var(--v5-police); text-align: left; cursor: default; }
.v5-credits-jauge[hidden]{ display: none; }
.v5-credits-jauge:hover{ background: var(--v5-survol); --v5-texte-3: var(--v5-texte-2); }   /* texte tertiaire remonté sur le fond de survol (contraste) */
.v5-credits-ligne{ display: flex; justify-content: space-between; gap: 8px; }
.v5-credits-chiffres{ color: var(--v5-texte); font-variant-numeric: tabular-nums; }
.v5-credits-barre{ display: block; height: 4px; border-radius: 2px; background: var(--v5-rempli-2); overflow: hidden; }
.v5-credits-barre i{ display: block; height: 100%; width: 0; border-radius: inherit; background: var(--v5-violet); }
.v5-credits-jauge[data-niveau="moyen"] .v5-credits-barre i{ background: var(--v5-orange); }
.v5-credits-jauge[data-niveau="bas"] .v5-credits-barre i{ background: var(--v5-rouge); }
.v5-credits-packs{ color: var(--v5-texte-3); font-variant-numeric: tabular-nums; }
.v5-app[data-lateral="reduite"] .v5-credits-jauge{ display: none; }
/* la barre latérale rogne ce qui dépasse : l'anneau de focus de ses boutons est tracé à l'intérieur (comme .v5-ligne), sinon il est coupé */
.v5-lateral :is(.v5-nav-item, .v5-comptes, .v5-compte){ --v5-focus-decalage: -3px; }

/* ---- sections repliables (13/10) : le titre est un bouton discret ; au survol, un chevron apparaît à droite (Finder, Notion). Repliée, la
   section ne montre plus ses lignes ; un point rappelle s'il y a dedans quelque chose qui presse. Le rail d'icônes montre toujours tout. */
.v5-nav-chevron{ display: grid; place-items: center; flex: none; margin-left: auto; color: var(--v5-texte-3); transition: transform var(--v5-duree) var(--v5-courbe), opacity var(--v5-duree); }
.v5-nav-chevron svg{ width: 11px; height: 11px; margin: 0; color: inherit; }
button.v5-nav-titre{
  position: relative; box-sizing: border-box; width: 100%; height: 26px; margin: 0; padding: 0 6px; gap: 6px; border: 0; border-radius: var(--v5-r-sel);
  background: none; text-align: left; cursor: default; font: var(--v5-g-fort) var(--v5-t-11)/14px var(--v5-police); color: var(--v5-texte-3);
}
button.v5-nav-titre > span:first-child{ flex: 1; min-width: 0; }
button.v5-nav-titre:hover{ color: var(--v5-texte-2); }
.v5-nav-titre .v5-nav-chevron{ opacity: 0; transform: rotate(90deg); }
.v5-nav-titre:is(:hover, :focus-visible) .v5-nav-chevron, .v5-nav-groupe[data-replie] .v5-nav-titre .v5-nav-chevron{ opacity: 1; }
.v5-nav-groupe[data-replie] .v5-nav-titre .v5-nav-chevron{ transform: none; }
.v5-nav-groupe[data-replie] > .v5-nav-item{ display: none; }
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-groupe[data-replie] > .v5-nav-item{ display: flex; }
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-titre > *{ display: none; }
.v5-app[data-lateral="reduite"] .v5-lateral button.v5-nav-titre{ pointer-events: none; }
/* la section de la page ouverte ne se replie pas : un petit refus, comme une fenêtre macOS qui ne veut pas se fermer */
.v5-nav-titre.v5-refus{ animation: v5-refus 260ms var(--v5-courbe); }
@keyframes v5-refus{ 25%{ transform: translateX(-3px); } 50%{ transform: translateX(3px); } 75%{ transform: translateX(-2px); } }
.v5-nav-groupe[data-replie][data-attention] .v5-nav-titre::after{
  content: ""; position: absolute; right: 24px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--v5-rouge-plein);
}
.v5-nav-groupe[data-replie][data-attention="attention"] .v5-nav-titre::after{ background: var(--v5-orange); }
@media (prefers-reduced-motion: reduce){ .v5-nav-chevron{ transition: none; } .v5-nav-titre.v5-refus{ animation: none; } }

/* ---- espaces de travail : deux symboles (triangle = Discussion, carré = BDRD), nom en infobulle et pour les lecteurs d'écran.
   La tuile neutre montre le choix actif ; le mouvement reste court et discret. */
.v5-fenetre-outils .v5-partie{ position: relative; isolation: isolate; flex: none; width: auto; height: 32px; padding: 2px; gap: 2px; border-radius: var(--v5-r-capsule); background: var(--v5-seg-piste); }
.v5-fenetre-outils .v5-partie button{ flex: none; display: grid; place-items: center; width: 36px; padding: 0; border-radius: var(--v5-r-capsule); color: var(--v5-texte-2); }
.v5-fenetre-outils .v5-partie button svg{ width: 16px; height: 16px; }
.v5-fenetre-outils .v5-partie button[aria-pressed="true"]{ color: var(--v5-texte); }
.v5-fenetre-outils .v5-partie::before{
  content: ""; position: absolute; z-index: -1; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 3px);
  border-radius: var(--v5-r-capsule); background: var(--v5-seg-choisi); box-shadow: var(--v5-seg-ombre);
  transition: left 100ms var(--v5-courbe);
}
.v5-fenetre-outils .v5-partie:not([data-actif])::before{ content: none; }
.v5-fenetre-outils .v5-partie[data-actif="1"]::before{ left: calc(50% + 1px); }
.v5-fenetre-outils .v5-partie[data-actif] button[aria-pressed="true"]{ background: none; }
.v5-app.sans-transition .v5-partie::before{ transition: none; }
@media (prefers-reduced-motion: reduce){ .v5-fenetre-outils .v5-partie::before{ transition: none; } }
html.sans-anim .v5-fenetre-outils .v5-partie::before{ transition: none; }

/* 12/10 — compteurs « à traiter » (js/v5/compteurs.js) : nombre gris à droite comme dans Mail. 15/10 (Lucas) : plus de pastille teintée
   quand ça presse ; le nombre seul, sans fond, passe en couleur et en gras (orange : colis urgents ; rouge : à débloquer). Une famille
   repliée montre un point de la couleur la plus urgente de ses pages. */
.v5-nav-item .v5-compteur{ margin-left: auto; font-size: var(--v5-t-12); color: var(--v5-texte-3); font-variant-numeric: tabular-nums; }
.v5-nav-item .v5-compteur:is([data-urgence="alerte"], [data-urgence="attention"]){ font-weight: var(--v5-g-fort); }
.v5-nav-item .v5-compteur[data-urgence="alerte"]{ background: none; color: var(--v5-rouge); }
.v5-nav-item .v5-compteur[data-urgence="attention"]{ background: none; color: var(--v5-orange); }
/* 22/10 : le seul signal rouge de la barre — un point de 6 px, sans chiffre, sur Aujourd'hui (js/v5/compteurs.js) */
.v5-nav-item .v5-compteur[data-point]{ display: inline-block; box-sizing: border-box; width: 6px; height: 6px; margin-right: 6px; padding: 0; border-radius: 50%; background: var(--v5-rouge); }
/* rail d'icônes : un compteur urgent devient un point sur l'icône (pastille de macOS) ; les nombres gris restent cachés */
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-item .v5-compteur:is([data-urgence="alerte"], [data-urgence="attention"]){
  display: block; position: absolute; top: 6px; right: 9px; min-width: 0; width: 7px; height: 7px; margin: 0; padding: 0; font-size: 0; box-shadow: 0 0 0 2px var(--v5-fond-lateral);
}
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-item .v5-compteur[data-urgence="alerte"]{ background: var(--v5-rouge-plein); }
.v5-app[data-lateral="reduite"] .v5-lateral .v5-nav-item .v5-compteur[data-urgence="attention"]{ background: var(--v5-orange); }

/* 13/10 — commutateur triangle / carré : géométrie FIGÉE en pixels. La tuile était calculée en pourcentage de la piste (50 % - 3 px) ; dès que la piste n'avait pas exactement la largeur des deux boutons
   (marges internes de .v5-barre .v5-segmente : 4 px, 3 px dans l'appli de bureau ; largeur héritée), la tuile débordait du triangle et le carré flottait loin du bord. Piste = 2 × 36 + écart 2 + 2 × 2 de marge = 78 px. */
html.v5 .v5-barre .v5-fenetre-outils .v5-partie{ box-sizing: border-box; flex: none; width: 78px; min-width: 78px; max-width: 78px; height: 32px; padding: 2px; gap: 2px; }
html.v5 .v5-barre .v5-fenetre-outils .v5-partie button{ box-sizing: border-box; flex: none; width: 36px; min-width: 36px; height: 28px; padding: 0; }
html.v5 .v5-barre .v5-fenetre-outils .v5-partie::before{ top: 2px; bottom: 2px; left: 2px; width: 36px; }
html.v5 .v5-barre .v5-fenetre-outils .v5-partie[data-actif="1"]::before{ left: 40px; }

/* 01/11 : Messages — le compte choisi dans la barre de dossiers ne se voyait qu'à sa graisse (600 contre 500) : on ne voyait pas que la
   liste était filtrée. Il prend le même fond que la boîte choisie. « Tous les comptes » (le cas normal) reste sans fond. */
.v5-nav-item[data-mm-compte][data-actif]:not([data-mm-compte="tous"]){ background: var(--v5-actif-nav); }
.v5-nav-item[data-mm-compte][data-actif]:not([data-mm-compte="tous"]) svg{ color: var(--v5-texte); }
