/* Studio — feuille unique, sans préprocesseur.
   Les couleurs sont des variables : le thème sombre se contente de les redéfinir. */

:root {
  --fond: #f6f5f2;
  --fond-carte: #ffffff;
  --fond-creux: #eceae5;
  --texte: #1b1f23;
  --texte-doux: #5b6670;
  --trait: #d9d5cd;
  --accent: #1f6f5c;
  --accent-clair: #e6f0ec;
  --vert: #2f7d55;
  --orange: #b4621c;
  --rouge: #b4332a;
  --onde: #1f6f5c;
  --tete: #b4332a;
  --rayon: 10px;
  --ombre: 0 1px 2px rgba(20, 24, 28, .06), 0 6px 18px rgba(20, 24, 28, .05);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #14181c;
    --fond-carte: #1b2026;
    --fond-creux: #232a31;
    --texte: #e9ecef;
    --texte-doux: #9aa6b1;
    --trait: #313a43;
    --accent: #5ec2a4;
    --accent-clair: #1d2b28;
    --vert: #5ec285;
    --orange: #e0a158;
    --rouge: #e4796d;
    --onde: #5ec2a4;
    --tete: #e4796d;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; /* iPhone en paysage : ne pas grossir le texte */
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; font-weight: 650; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--fond-creux); padding: .1em .3em; border-radius: 4px; }

.chargement { padding: 2rem; color: var(--texte-doux); }

/* ───────── Bandeau ───────── */

.bandeau {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .6rem max(1rem, env(safe-area-inset-left)) .6rem max(1rem, env(safe-area-inset-left));
  background: var(--fond-carte);
  border-bottom: 1px solid var(--trait);
  position: sticky;
  top: 0;
  z-index: 10;
}

.titre-projet { display: flex; flex-direction: column; min-width: 0; }
.titre-projet strong { font-size: 1.05rem; }
.titre-projet .sous, .sous { color: var(--texte-doux); font-size: .85rem; }

.onglets { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.onglets button { position: relative; }
.onglets button.actif { background: var(--accent-clair); color: var(--accent); border-color: transparent; font-weight: 600; }
.pastille {
  display: inline-block; min-width: 1.3em; margin-left: .35em; padding: 0 .3em;
  background: var(--orange); color: #fff; border-radius: 1em; font-size: .72rem; line-height: 1.5;
}
.lien-retour { border: 0 !important; background: none !important; color: var(--texte-doux) !important; padding-left: 0 !important; }
.actions-bandeau { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
/* ⚠️ Sans cette ligne, `hidden` ne cache RIEN ici : la règle `[hidden]` du
   navigateur ne pose qu'un `display: none` d'agent utilisateur, que le
   `display: flex` ci-dessus écrase. L'élément reste visible et mis en page, et
   un contrôle qui se fierait à la propriété `hidden` passerait au vert sur un
   bandeau parfaitement affiché. */
.actions-bandeau[hidden] { display: none; }

/* ───────── Structure ───────── */

.vue {
  padding: 1rem max(1rem, env(safe-area-inset-left)) 3rem;
  max-width: 1500px;
  margin: 0 auto;
}

.colonne { display: flex; flex-direction: column; gap: 1rem; max-width: 900px; }

.deux-colonnes {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.deux-colonnes.inverse { grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); }

/* ⚠️ Un élément de grille vaut `min-width: auto` : il refuse de descendre sous la
   largeur minimale de son contenu, et c'est la COLONNE ENTIÈRE qui s'élargit. Sur
   un écran de 390 px, un <canvas> (largeur intrinsèque 300 px) poussait la colonne
   à 416 px : la moitié droite des boutons sortait de l'écran, sans barre de
   défilement visible ni le moindre signe. */
.deux-colonnes > * { min-width: 0; }

@media (max-width: 860px) {
  .deux-colonnes, .deux-colonnes.inverse { grid-template-columns: 1fr; }
  .colonne-laterale { order: 2; }
}

.carte {
  background: var(--fond-carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1rem;
}
.carte.vide { text-align: center; padding: 2.5rem 1rem; }
.actions-vide { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.25rem; }
.entete-carte { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.entete-carte h2 { margin: 0; }
.entete-carte .actions, .entete-carte .portee { margin-left: auto; }

.aide { color: var(--texte-doux); font-size: .88rem; }
.aide-longue summary { cursor: pointer; font-weight: 600; }
.aide-longue ol, .aide-longue ul { padding-left: 1.2rem; }
.aide-longue li { margin-bottom: .35em; }
.diagnostic { font-size: .9rem; color: var(--accent); font-weight: 500; }
/* ⚠️ Une RÉSERVE n'est pas une bonne nouvelle. Écrite dans la couleur d'accent,
   « ce tableau ne connaît que ce qui est arrivé » se lisait comme une
   confirmation — vu sur la capture du téléphone, en vert franc. Un filet à
   gauche et un ton sourd : on la lit, on ne la fête pas. */
.diagnostic.reserve {
  color: var(--texte-doux); font-weight: 400;
  border-left: 3px solid var(--trait); padding-left: .65rem;
}

/* ───────── Boutons et champs ───────── */

button {
  font: inherit;
  padding: .45rem .8rem;
  border: 1px solid var(--trait);
  border-radius: 8px;
  background: var(--fond-carte);
  color: var(--texte);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primaire { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.gros { padding: .7rem 1.2rem; font-size: 1.05rem; }
button.enregistre { background: var(--rouge); border-color: var(--rouge); color: #fff; font-weight: 700; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .78; } }
button.vert { border-color: var(--vert); color: var(--vert); font-weight: 600; }
button.vert.actif { background: var(--vert); color: #fff; }
button.orange { border-color: var(--orange); color: var(--orange); font-weight: 600; }
button.orange.actif { background: var(--orange); color: #fff; }
button.actif { background: var(--accent-clair); color: var(--accent); border-color: transparent; font-weight: 600; }
button.danger-discret { border-color: transparent; color: var(--rouge); }
button.lien { border: 0; background: none; padding: .1rem .3rem; text-decoration: underline; text-underline-offset: 2px; }
button.discret { color: var(--texte); }

.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.espace { flex: 1 1 auto; }

label.champ { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem; font-size: .9rem; font-weight: 600; }
label.champ.ligne { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; }
label.champ.ligne input[type="checkbox"], label.champ.ligne input[type="radio"] { margin-top: .3rem; flex: none; }
label.champ .aide { font-weight: 400; }

input[type="text"], input[type="file"], textarea, select {
  font: inherit;
  /* ⚠️ Répété ici EXPRÈS, malgré la règle générale plus bas : `input[type="text"]`
     est plus SPÉCIFIQUE que `input`, donc son `font: inherit` écrasait le
     `font-size` général et les champs restaient à 14,4 px. Corrigé une première
     fois sans effet, pour cette seule raison. */
  font-size: max(16px, 1em);
  padding: .45rem .6rem;
  border: 1px solid var(--trait);
  border-radius: 8px;
  background: var(--fond);
  color: var(--texte);
  width: 100%;
  font-weight: 400;
}
/* ⚠️ 16 px MINIMUM sur toute saisie, et ce n'est pas un choix de lisibilité :
   c'est le SEUIL exact sous lequel Safari et la WKWebView d'iOS décident de
   ZOOMER la page au moment où le doigt touche le champ. `label.champ` pose
   .9rem (14,4 px) et le `font: inherit` ci-dessus le reprenait : sur l'iPhone
   de Miran, le 25/11, la boîte de dialogue débordait à droite et le bouton
   « C'est moi » sortait de l'écran. Le `input[type="number"]`, absent de la
   liste ci-dessus, prenait même la police par défaut du navigateur.
   La règle vise `input` tout court : un type oublié retomberait dans le piège. */
input, select, textarea { font-size: max(16px, 1em); }
textarea { resize: vertical; min-height: 4rem; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

fieldset { border: 1px solid var(--trait); border-radius: var(--rayon); padding: .8rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .4rem; font-size: .9rem; }

/* ───────── Listes et tableaux ───────── */

.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th, .tableau td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }
.tableau td.rang { color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.tableau.petit th, .tableau.petit td { padding: .2rem .4rem; border: 0; }
.tableau .fleche { color: var(--texte-doux); }
.actions-cellule { white-space: nowrap; }
.actions-cellule button { padding: .2rem .45rem; }
.texte-item { overflow-wrap: anywhere; }
.note-cellule { color: var(--texte-doux); }
.groupe {
  display: inline-block; margin-left: .4em; padding: 0 .4em;
  background: var(--fond-creux); color: var(--texte-doux);
  border-radius: 4px; font-size: .75rem;
}

.etiquette { display: inline-block; padding: 0 .45em; border-radius: 4px; font-size: .75rem; font-weight: 600; margin-right: .3em; }
.etiquette.ok { background: var(--accent-clair); color: var(--vert); }
.etiquette.refaire { background: #f6e3d2; color: var(--orange); }
.etiquette.juger { background: var(--fond-creux); color: var(--texte-doux); }
.etiquette.vide { background: var(--fond-creux); color: var(--texte-doux); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .etiquette.refaire { background: #3a2a1b; } }

.grille-projets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.fiche-projet h3 { cursor: pointer; }
.fiche-projet h3:hover { color: var(--accent); }
.liste-projets { display: flex; flex-direction: column; gap: 1rem; }
.place { margin-top: .5rem; }

/* ───────── Barre latérale du studio ───────── */

.colonne-laterale {
  background: var(--fond-carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: .6rem;
  position: sticky;
  top: 4.2rem;
  max-height: calc(100vh - 5.5rem);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.filtres { display: flex; flex-wrap: wrap; gap: .25rem; }
.filtres button { padding: .2rem .5rem; font-size: .8rem; }
.barre-avancement { height: 5px; background: var(--fond-creux); border-radius: 3px; overflow: hidden; }
.barre-avancement > div { height: 100%; background: var(--vert); transition: width .3s; }
.titre-pile { margin: 0; }

.liste-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 120px; }
.liste-items li {
  display: flex; gap: .45rem; align-items: baseline;
  padding: .3rem .4rem; border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.liste-items li:hover { background: var(--fond-creux); }
.liste-items li.courant { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
.pastille-etat { flex: none; width: 1em; text-align: center; color: var(--texte-doux); }
.liste-items li.ok .pastille-etat { color: var(--vert); }
.liste-items li.a-refaire .pastille-etat { color: var(--orange); }
.panneau-micro { flex: none; }

/* ───────── Scène ───────── */

.scene { display: flex; flex-direction: column; gap: .7rem; }
.fil-ariane { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; color: var(--texte-doux); }
.fil-ariane .rang { font-variant-numeric: tabular-nums; }
.pistes { display: flex; gap: .25rem; }
.pistes button { padding: .2rem .55rem; font-size: .85rem; }

.texte-scene {
  font-size: clamp(1.5rem, 4.5vw, 2.4rem);
  line-height: 1.25;
  font-weight: 600;
  margin: .3em 0 0;
  overflow-wrap: anywhere;
}
.note-scene { color: var(--texte-doux); font-size: 1.05rem; margin-top: .2em; }

.zone-onde { background: var(--fond-creux); border-radius: 8px; padding: .5rem; }
canvas.onde { display: block; width: 100%; min-width: 0; height: 90px; }
.infos-onde { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .82rem; color: var(--texte-doux); padding-top: .3rem; }
.sature { color: var(--rouge); }
.autre-auteur { color: var(--accent); font-weight: 600; }

.vu { display: flex; align-items: center; gap: .6rem; }
/* `min-width: 0` pour la même raison : en contexte flex, un canvas ne rétrécit
   pas sous ses 300 px intrinsèques si on ne l'y autorise pas. */
canvas.vumetre { flex: 1 1 auto; min-width: 0; height: 16px; display: block; }
.chrono { font-variant-numeric: tabular-nums; color: var(--texte-doux); min-width: 4.5em; text-align: right; }

.commandes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.clavier { border-top: 1px dashed var(--trait); padding-top: .5rem; margin: 0; }

.prises ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.prises li { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .88rem; padding: .2rem .3rem; border-radius: 6px; }
.prises li.courante { background: var(--accent-clair); }

/* ───────── Retouches ───────── */

.reglages { display: flex; flex-direction: column; gap: .5rem; }
.bloc-effet { border: 1px solid var(--trait); border-radius: 8px; padding: .55rem .7rem; }
.bloc-effet.actif { border-color: var(--accent); background: var(--accent-clair); }
.bloc-effet .aide { margin: 0; }
.titre-effet { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; }
.curseurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem 1rem; margin-top: .5rem; }
label.champ.curseur { gap: .1rem; margin: 0; }
.libelle-curseur { display: flex; justify-content: space-between; font-size: .85rem; }
.libelle-curseur output { font-variant-numeric: tabular-nums; color: var(--accent); }
.portee { display: flex; gap: .25rem; flex-wrap: wrap; }
.modeles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem; }
.modele { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: .15rem; }
.surcharges { margin-top: .8rem; }
.surcharges ul { margin: 0; padding-left: 1rem; }

.carte-ecoute { position: sticky; top: 4.2rem; }
.paire-ondes { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .6rem; }
.paire-ondes canvas { background: var(--fond-creux); border-radius: 6px; }
.etapes { font-size: .85rem; color: var(--texte-doux); padding-left: 1.1rem; margin: .4rem 0; }
.rapport { display: flex; flex-direction: column; gap: .3rem; }

.apercu { list-style: none; margin: .3rem 0; padding: 0; font-size: .88rem; max-height: 9rem; overflow-y: auto; }
.apercu li { padding: .1rem 0; border-bottom: 1px solid var(--trait); }

.diag { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .85rem; margin: .5rem 0; }
.diag dt { color: var(--texte-doux); }
.diag dd { margin: 0; }
.journal { font-size: .72rem; max-height: 10rem; overflow: auto; background: var(--fond-creux); padding: .4rem; border-radius: 6px; white-space: pre-wrap; word-break: break-all; }

/* ───────── Dialogues et messages ───────── */

.voile {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 14, 18, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  overscroll-behavior: contain;
}
.dialogue, .chantier { width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.corps-dialogue { overflow-y: auto; }
.pied-dialogue { display: flex; justify-content: flex-end; gap: .5rem; padding-top: .8rem; }

.barre-progres { height: 8px; background: var(--fond-creux); border-radius: 4px; overflow: hidden; margin: .5rem 0; }
.barre-progres-interne { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.chantier-libelle { font-size: .88rem; color: var(--texte-doux); margin: 0; overflow-wrap: anywhere; }

.messages {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  /* ⚠️ EN HAUT, et pas en bas. Posés en bas au centre sur 560 px, ces bandeaux
     tombaient exactement sur la rangée d'actions — « Enregistrer », « OK »,
     « À refaire » — à TOUTES les tailles d'écran, pas seulement sur un téléphone
     couché. `pointer-events: none` les empêche de voler le doigt ; rien ne les
     empêchait de masquer le libellé de ce qu'on vise. En haut, ils ne recouvrent
     que l'entête, dont on n'a besoin pour aucun geste, et quelques secondes.
     (Les rangées d'actions sont en bas des cartes : c'est structurel, pas une
     coïncidence d'une mise en page particulière.) */
  top: max(.5rem, env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: .4rem; align-items: center;
  width: min(560px, calc(100% - 2rem));
  pointer-events: none;
}
.message {
  background: var(--texte); color: var(--fond);
  padding: .5rem .9rem; border-radius: 8px; font-size: .9rem;
  box-shadow: var(--ombre); transition: opacity .4s, transform .4s;
  /* ⚠️ `pointer-events: none`, et ce n'est pas un détail de goût. Ces bandeaux sont
     fixés en bas au centre, sur 560 px — exactement là où tombe le bouton
     « Enregistrer » de la scène. Avec `auto`, ils AVALAIENT le clic : l'avertissement
     sur la conservation des données reste 9 secondes à l'écran, et pendant ces
     9 secondes appuyer sur le bouton ne faisait rien, sans le moindre signe. Rien
     dans un bandeau n'est cliquable (ils s'effacent seuls), donc rien n'est perdu.
     Trouvé le 24/11 parce qu'une ligne de contenu en plus avait fait descendre le
     bouton sous le bandeau. */
  pointer-events: none;
}
.message.ok { background: var(--vert); color: #fff; }
.message.alerte { background: var(--rouge); color: #fff; }
.message.parti { opacity: 0; transform: translateY(6px); }

@media (max-width: 520px) {
  /* ⚠️ Sur un téléphone, le bandeau mangeait 500 px des 844 : titre, jauge, six
     onglets sur deux lignes, et le bouton du prénom SEUL sur une troisième. Un
     porteur qui valide debout dans un couloir voyait plus de navigation que de
     travail. On remet le prénom sur la ligne du titre (ordre des éléments) et on
     resserre les onglets — sans jamais en cacher un : ils restent tous visibles,
     sur deux lignes. */
  .bandeau { gap: .35rem .5rem; padding-top: .45rem; padding-bottom: .45rem; }
  .titre-projet { flex: 1 1 55%; order: 1; }
  .bandeau .moi { order: 2; margin-left: auto; flex: 0 0 auto; align-self: flex-start; }
  .onglets { width: 100%; margin-left: 0; order: 3; gap: .2rem; }
  .onglets button { flex: 1 1 auto; padding: .35rem .3rem; font-size: .82rem; }
  /* ⚠️ Les règles ci-dessus ont été écrites pour le bandeau d'un PROJET : titre,
     prénom, onglets. Celui de l'ACCUEIL porte autre chose — une rangée
     d'actions, qui n'avait reçu aucun `order` et gardait donc `order: 0`,
     c'est-à-dire AVANT `.titre-projet` passé à `order: 1`. On lisait les deux
     boutons empilés l'un sur l'autre, puis « Euphony » en dessous. Personne ne
     l'avait vu : un bandeau de message recouvrait l'entête à chaque ouverture,
     et c'est en le supprimant que le défaut est apparu. */
  .bandeau.accueil .actions-bandeau { order: 2; width: 100%; margin-left: 0; }
  .bandeau.accueil .actions-bandeau button { flex: 1 1 auto; }
  .chiffres { gap: .25rem .9rem; }
  .chiffres li { flex: 0 0 auto; }
  .commandes button { flex: 1 1 auto; }
  .vue { padding-left: max(.75rem, env(safe-area-inset-left)); padding-right: max(.75rem, env(safe-area-inset-right)); }
}

/* ⚠️ ÉCRAN COURT — le téléphone COUCHÉ, posé à plat contre un pupitre pour lire le
   texte en enregistrant. 390 px de haut : l'entête collant en mangeait un quart en
   permanence, et « Valider » tombait à 423 px, hors d'atteinte. Un écran court ne
   DÉBORDE pas, il ENTERRE — et aucun contrôle de largeur ne le voit.
   L'entête cesse d'être collant : on défile une fois, et toute la hauteur revient
   au travail. Rien n'est caché, tout remonte d'un geste. */
@media (max-height: 560px) {
  .bandeau { position: static; padding-top: .35rem; padding-bottom: .35rem; }
  .titre-projet strong { font-size: .95rem; }
  .vue { padding-top: .6rem; }
  .carte { padding: .6rem .75rem; }
  .texte-scene { margin: .2rem 0; }
  .filtres-ecoute { padding-top: .5rem; padding-bottom: .3rem; }

  /* Et surtout : la rangée d'actions se COLLE au bas de l'écran. Sur 390 px de
     haut, entête + filtres + texte ne laissent pas la place aux boutons — « Valider »
     finissait à 425 px. Rien n'est caché : c'est la barre dont on a besoin, elle
     est toujours là, et le reste défile dessous. (Les bandeaux de message sont en
     `pointer-events: none`, ils ne peuvent donc pas lui voler le doigt.) */
  .scene .commandes {
    position: sticky; bottom: 0; z-index: 5;
    margin: 0 -.75rem -.6rem; padding: .4rem .75rem;
    background: var(--fond-carte);
    border-top: 1px solid var(--trait);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ───────── Voix du projet ───────── */

.liste-voix { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.liste-voix li { display: flex; align-items: center; gap: .5rem; }
.liste-voix .rang { color: var(--texte-doux); width: 1.2em; font-variant-numeric: tabular-nums; }
.liste-voix input[type="text"] { max-width: 16rem; font-weight: 600; }
.liste-voix .aide { white-space: nowrap; }
.porte-par { color: var(--accent); font-weight: 600; }

/* ───────── Commentaires ───────── */

.commentaires { border-top: 1px dashed var(--trait); padding-top: .5rem; }
.commentaires > details > summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--texte-doux); }
.commentaires .fil { list-style: none; margin: .5rem 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.commentaires .fil li { background: var(--fond-creux); border-radius: 8px; padding: .45rem .6rem; }
.commentaires .fil li.resolu { opacity: .6; }
.tete-commentaire { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-size: .85rem; }
.corps-commentaire { margin: .25rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions-commentaire { display: flex; gap: .3rem; font-size: .82rem; }
.ajout-commentaire { display: flex; gap: .4rem; align-items: flex-start; flex-wrap: wrap; }
.ajout-commentaire textarea { flex: 1 1 14rem; min-height: 2.6rem; }

/* ───────── Bilans de fusion et de partage ───────── */

.bilan { margin: .3rem 0 .6rem; padding-left: 1.1rem; }
.bilan li { margin-bottom: .2em; }
.avertissement { color: var(--orange); font-weight: 500; }

/* ───────── Avancement : la jauge, et les deux jugements ───────── */

/* « 67/312 » se lit, la barre se VOIT. Elle est dans le bandeau, donc présente sur
   chaque écran : la première question de quelqu'un qui ouvre l'app après trois
   séances est « où j'en suis ? », et elle ne doit pas demander un clic. */
.jauge {
  height: 6px; background: var(--fond-creux); border-radius: 3px;
  overflow: hidden; min-width: 4rem;
}
.jauge-part { height: 100%; background: var(--accent); transition: width .3s; }
.jauge.sobre .jauge-part { background: var(--texte-doux); }

.avancement { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.avancement .jauge { flex: 0 0 5.5rem; }
.avancement .sous { white-space: nowrap; }
.pastille.vive { background: var(--rouge); }

/* ⚠️ Nommer les deux jugements n'est pas du confort : les confondre a produit un
   bug, puis son symétrique. À l'écran, ils ne partagent donc jamais une étiquette. */
.deux-jugements { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: .4rem 0 .2rem; }
.jugement { display: flex; flex-direction: column; gap: .15rem; }
.jugement .aide { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.etiquette.attente { background: var(--fond-creux); color: var(--texte-doux); }

.barre-avancement { position: relative; }
.barre-avancement .part-ok { position: absolute; inset: 0 auto 0 0; background: var(--accent); }

/* ───────── Écoute : les filtres ───────── */

.filtres-ecoute { padding-bottom: .5rem; }
.ligne-filtres { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .4rem; }
.ligne-filtres .champ.ligne { margin: 0; }
.segments { display: flex; gap: .25rem; flex-wrap: wrap; }
.segments button.actif { background: var(--accent-clair); color: var(--accent); border-color: transparent; font-weight: 600; }
.segments .compte {
  margin-left: .35em; padding: 0 .35em; border-radius: 1em;
  background: var(--fond-creux); color: var(--texte-doux); font-size: .74rem; font-weight: 600;
}
.segments button.actif .compte { background: #fff3; color: inherit; }
.repliee > summary { cursor: pointer; font-size: .85rem; color: var(--texte-doux); }
.repliee > p { margin-top: .4rem; }
.liste-items li .pastille-etat.ok { color: var(--vert); }
.liste-items li .pastille-etat.refaire { color: var(--orange); }

/* ───────── Suivi ───────── */

.suivi-tete .grand-chiffre { display: flex; align-items: baseline; gap: .4rem; margin: .2rem 0 .5rem; }
.suivi-tete .grand-chiffre strong { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.suivi-tete .grand-chiffre .sur { font-size: 1.2rem; color: var(--texte-doux); }
.suivi-tete .grand-chiffre .libelle { color: var(--texte-doux); }
.chiffres { list-style: none; margin: .6rem 0 .4rem; padding: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.chiffres li { color: var(--texte-doux); font-size: .9rem; }
.chiffres strong { color: var(--texte); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.chiffres .lien { margin-left: .3em; }

/* Un tableau de suivi a huit colonnes et se consulte aussi sur un téléphone — donc
   il défile LUI, dans son cadre, au lieu de pousser la page entière hors de l'écran
   (cf. le débordement de 39 px qu'aucun contrôle automatique n'avait vu). */
.table-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.2rem; }
.tableau-suivi { min-width: 46rem; }
.tableau-suivi th.nombre, .tableau-suivi td.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau-suivi td { vertical-align: middle; }
.tableau-suivi .cellule-jauge { min-width: 9rem; }
.tableau-suivi .cellule-jauge .jauge { margin-bottom: .2rem; }
.tableau-suivi .cellule-jauge .aide { font-size: .78rem; white-space: nowrap; }
.tableau-suivi tr.moi { background: var(--fond-creux); }
.tableau-suivi .groupe { display: block; font-weight: 400; }

@media (max-width: 520px) {
  /* Le porteur valide souvent debout, le téléphone à la main : la jauge du bandeau
     prend toute la largeur plutôt que d'écraser le nom du projet. */
  .avancement { width: 100%; }
  .avancement .jauge { flex: 1 1 auto; }
  .avancement .sous { white-space: normal; }
  .suivi-tete .grand-chiffre strong { font-size: 2rem; }
  .ligne-filtres { gap: .4rem; }
  .segments { width: 100%; }
  .segments button { flex: 1 1 auto; padding: .35rem .4rem; font-size: .85rem; }
  .filtres-ecoute { padding-top: .6rem; padding-bottom: .4rem; }
}
