/* ============================================================================
   FLUVO — COUCHE « CLASSIQUE » : une messagerie à l'ancienne, propre
   Deux colonnes bord à bord (liste | conversation), barre verte, liste à
   filets, bulles blanche / vert clair avec bec, heure DANS la bulle, images
   DANS la bulle du côté de l'expéditeur, composeur plat collé en bas.

   🔴 Chargée en DERNIER : à spécificité égale, c'est l'ordre qui tranche. C'est
   LA coque de l'application depuis le 13/10/2026 (le « studio » de net.css,
   §17-18, est retiré) ; net.css, sobre.css et style.css restent la base des
   composants (menus, réglages, galeries…).
   🔴 Couleurs propres à Fluvo (teal, vert d'eau) ; aucun papier peint ni logo
   tiers. Le fond du fil est un aplat.
   🔴 La TAILLE du texte des bulles n'est pas ici : c'est `densite.css`
   (`--fs-msg`, réglable). Tout ce qui touche aux bulles est donc en `em`.
   🔴 Contrastes : `design-systeme/verif-classique.py` les MESURE en clair et en
   sombre (texte des bulles ≥ 7:1, heure et barres ≥ 4,5:1) et rougit sur une
   palette illisible (`--casser`).
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. COULEURS
   --------------------------------------------------------------------------- */
body[data-theme="papier"] {
  --bg: #ffffff;  --bg2: #ffffff;  --bg3: #f0f2f5;  --bg4: rgba(17,27,33,.06);
  --txt: #111b21;  --txt2: #54656f;  --txt3: #667781;
  --accent: #008069;  --accent2: #008069;  --moi-txt: #111b21;
  --bord: rgba(17,27,33,.10);
  --survol: #f5f6f6;
  --bulle: #ffffff;  --bulle-moi: #d9fdd3;
  --fond: #efeae2;
  --n-surf: #ffffff;  --n-fil: #efeae2;  --n-champ: #f0f2f5;
  --n-filet: #e9edef;  --n-sel: #f0f2f5;
  --n-moi: #111b21;  --n-moi-2: #54656f;
  --sur-accent: #ffffff;
  --cl-barre: #017a64;  --cl-barre-txt: #ffffff;  --cl-barre-txt2: #e3f2ee;
  --cl-rail: #f0f2f5;
  --cl-cite: rgba(11,20,26,.05);  --cl-cite-moi: rgba(11,20,26,.06);  --cl-cite-bord: #06a37f;
  --cl-pastille: #ffffff;  --cl-pastille-txt: #54656f;
  --cl-ombre-bulle: 0 1px .5px rgba(11,20,26,.13);
  --cl-auteur-l: 38%;  --cl-auteur-s: 62%;
  --st-on: #d9fdd3;  --st-on-txt: #005c4b;
  --epure-elevation: 0 2px 5px rgba(11,20,26,.26), 0 2px 10px rgba(11,20,26,.16);
}
body[data-theme="encre"] {
  --bg: #111b21;  --bg2: #202c33;  --bg3: #2a3942;  --bg4: rgba(233,237,239,.08);
  --txt: #e9edef;  --txt2: #aebac1;  --txt3: #8696a0;
  --accent: #00a884;  --accent2: #00a884;  --moi-txt: #f2f5f6;
  --bord: rgba(233,237,239,.10);
  --survol: #202c33;
  --bulle: #202c33;  --bulle-moi: #005c4b;
  --fond: #0b141a;
  --n-surf: #111b21;  --n-fil: #0b141a;  --n-champ: #202c33;
  --n-filet: #222d34;  --n-sel: #2a3942;
  --n-moi: #f2f5f6;  --n-moi-2: #b7d6cf;
  --sur-accent: #0b141a;
  --cl-barre: #202c33;  --cl-barre-txt: #e9edef;  --cl-barre-txt2: #aebac1;
  --cl-rail: #202c33;
  --cl-cite: rgba(255,255,255,.06);  --cl-cite-moi: rgba(0,0,0,.18);  --cl-cite-bord: #06cf9c;
  --cl-pastille: #182229;  --cl-pastille-txt: #8696a0;
  --cl-ombre-bulle: 0 1px .5px rgba(0,0,0,.35);
  --cl-auteur-l: 70%;  --cl-auteur-s: 60%;
  --st-on: #005c4b;  --st-on-txt: #e9edef;
  --epure-elevation: 0 2px 8px rgba(0,0,0,.5);
}
:root {
  --n-r-bulle: 7.5px;
}

/* ---------------------------------------------------------------------------
   2. COQUE : rail | liste | conversation, bord à bord
   --------------------------------------------------------------------------- */
body { background: var(--n-surf); }
#app { padding: 0; gap: 0; background: var(--n-surf); }
#rail, #panneau, #vue { border-radius: 0; }
#panneau, #vue { border: 0; box-shadow: none; }
#panneau { border-right: 1px solid var(--n-filet); background: var(--n-surf); }
#vue { background: var(--n-fil); }

@media (min-width: 761px) {
  #app { display: flex; flex-direction: row; }
  #panneau { grid-column: auto; width: 400px; flex: 0 0 400px; min-width: 0; max-width: 38vw; }
  #vue { grid-column: auto; flex: 1 1 0; min-width: 0; }

  /* Rail : une colonne étroite d'ICÔNES, le nom au survol (title) — les
     libellés tronqués (« Priorité … », « Messen… ») faisaient brouillon. */
  #rail {
    grid-column: auto; grid-row: auto;
    flex: 0 0 64px; width: 64px; height: auto;
    flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 0; border-radius: 0;
    background: var(--cl-rail); color: var(--txt2);
    border: 0; border-right: 1px solid var(--n-filet); box-shadow: none;
  }
  #rail::before { content: none; }
  #logo-rail { order: 0; width: 36px; height: 36px; margin: 2px 0 10px; }
  #rail .rail-haut, #rail .rail-reseaux {
    flex-direction: column; align-items: center; gap: 4px; width: 100%;
    overflow-x: visible; overflow-y: auto; scrollbar-width: none;
  }
  #rail .rail-haut { flex: none; }
  #rail .rail-reseaux { flex: 1 1 0; min-height: 0; padding-top: 2px; }
  #rail .rail-sep { width: 32px; height: 1px; margin: 8px 0; background: var(--n-filet); flex: none; }
  .rail-item {
    flex-direction: column; justify-content: center;
    width: 44px; height: 44px; min-width: 0; min-height: 0;
    gap: 0; padding: 0; border-radius: 50%;
    color: var(--txt2); position: relative;
  }
  .rail-item .rl { display: none; }
  .rail-item .ri { font-size: 20px; }
  .rail-item:hover { background: var(--bg4); color: var(--txt); }
  .rail-item.on, .rail-item.on:hover { background: var(--bg4); color: var(--txt); }
  /* l'onglet ouvert : un repère d'accent à gauche, comme les messageries de bureau */
  .rail-item.on::after {
    content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
  }
  .rail-item .pastille-n {
    position: absolute; left: auto; right: -2px; top: -1px;
    min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
    background: var(--accent); color: var(--sur-accent);
    box-shadow: 0 0 0 2px var(--cl-rail); font-size: 10.5px; line-height: 18px;
  }
  .rail-item.on .pastille-n { background: var(--accent); color: var(--sur-accent); box-shadow: 0 0 0 2px var(--cl-rail); }
  #b-reglages { margin-top: auto; }

  /* La liste : une seule colonne de lignes. */
  .liste { display: block; padding: 0; }
  .liste .chat { margin: 0; }
  .saisie { width: auto; margin: 0; }
  /* Le menu « Tous les réseaux » double le rail sur ordinateur : on cache ce
     bouton-là, et la barre quand il n'y a rien d'autre. Les filtres de la vue
     Archive (réseau source, médias, tri) et le compteur des communautés restent. */
  #barre > .filtre-reseaux { display: none; }
  #barre:not(:has(> :not(.filtre-reseaux))) { display: none; }
  /* Une ligne qui a le focus (clavier, menu refermé) : le « ⋯ » prend la place
     de l'heure et du compteur, comme au survol */
  .chat:focus-within .date, .chat:focus-within .l2 .badge { visibility: hidden; }
  /* Panneaux de droite (médias, fil) et « Tous les médias » : bord à bord, plus
     de cartes flottantes décalées de 14 px (reste du style « verre ») */
  #galerie, #volet {
    top: 0; right: 0; bottom: 0; border-radius: 0; box-shadow: none; border: 0;
    border-left: 1px solid var(--n-filet); background: var(--n-surf);
  }
  #gglobale { inset: 0; border-radius: 0; box-shadow: none; border: 0; }
}

/* Panneau de droite ouvert sur un écran moyen (761–1279 px) : la liste s'efface
   au lieu d'écraser la conversation à une lettre par ligne (1024 px : 177 px
   de fil, 820 px : 50 px). */
@media (min-width: 761px) and (max-width: 1279px) {
  body.avec-panneau #panneau { display: none; }
}

/* ---------------------------------------------------------------------------
   3. BARRES VERTES (liste et conversation)
   --------------------------------------------------------------------------- */
#panneau > header.h, #vue > header.h {
  margin: 0; min-height: 60px; padding: 10px 16px; gap: 12px;
  background: var(--cl-barre); color: var(--cl-barre-txt);
  border: 0; border-radius: 0; box-shadow: none;
}
#panneau > header.h h1, #vue > header.h h1 {
  color: var(--cl-barre-txt); font-size: 17px; font-weight: 600; letter-spacing: 0; line-height: 1.25;
}
#panneau > header.h h1 { font-size: 19px; }
#vue > header.h .av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
#vue > header.h .titre { min-width: 0; cursor: pointer; }
#vue > header.h .titre h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#vue > header.h .sous {
  color: var(--cl-barre-txt2); font-size: 12.5px; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#panneau > header.h .icone, #vue > header.h .icone {
  width: 40px; height: 40px; border-radius: 50%; color: var(--cl-barre-txt); flex: none;
}
#panneau > header.h .icone:hover, #vue > header.h .icone:hover,
#vue > header.h .icone.actif { background: rgba(255,255,255,.14); color: var(--cl-barre-txt); }
/* La pastille d'état ne parle que s'il y a quelque chose à dire (hors ligne, reconnexion…). */
#panneau > header.h .pastille { background: rgba(255,255,255,.16); color: var(--cl-barre-txt); }
#etat:empty { display: none; }
.mob-retour { background: transparent; border: 0; color: var(--cl-barre-txt); border-radius: 50%; }

/* ---------------------------------------------------------------------------
   4. RECHERCHE ET LISTE
   --------------------------------------------------------------------------- */
#panneau .rech { padding: 7px 12px; background: var(--n-surf); border-bottom: 1px solid var(--n-filet); }
#panneau .rech input {
  background: var(--n-champ); border: 1px solid transparent; border-radius: 8px;
  min-height: 36px; padding: 6px 14px; font-size: 14.5px; width: 100%;
}
#panneau .rech input::placeholder { color: var(--txt3); }
#panneau .rech input:focus { background: var(--n-champ); border-color: transparent; outline: 2px solid var(--accent); outline-offset: 0; }
.barre { padding: 6px 12px; background: var(--n-surf); }
.filtre-res { border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; background: var(--n-champ); border-color: transparent; color: var(--txt2); }
.filtre-res.on { background: var(--st-on); color: var(--st-on-txt); border-color: transparent; }

/* Bandeau des chats unis à confirmer : une ligne sobre, comme « Archivées ». */
.fusion-l {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin: 0; padding: 12px 16px 12px 24px; border: 0; border-bottom: 1px solid var(--n-filet);
  border-radius: 0; background: transparent; color: var(--txt); text-align: left; font-size: 15px;
}
.fusion-l:hover { background: var(--survol); }
.fusion-l .fl-p {
  min-width: 22px; height: 22px; padding: 0 7px; box-sizing: border-box; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--accent); color: var(--sur-accent);
  font-size: 12px; font-weight: 600;
}

.chat {
  display: flex; align-items: center; margin: 0; gap: 14px; padding: 10px 16px;
  border: 0; border-radius: 0; box-shadow: none; background: transparent;
}
.chat:hover { background: var(--survol); border-color: transparent; }
.chat.on, .chat.on:hover { background: var(--n-sel); border-color: transparent; box-shadow: none; }
.chat.on .logo-res { box-shadow: 0 0 0 2px var(--n-sel); }
.chat::after { display: block; left: 79px; background: var(--n-filet); }
.chat:last-child::after { display: none; }
.chat .avw, .chat .av { width: 49px; height: 49px; }
.chat .txt { display: block; flex: 1 1 0; min-width: 0; }
.chat .l1, .chat .l2 { grid-column: auto; grid-row: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat .nom {
  display: block; -webkit-line-clamp: unset; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 16.5px; font-weight: 400; letter-spacing: 0; line-height: 1.3; min-width: 0;
}
.chat.nonlu .nom { font-weight: 600; }
.chat .date { margin-left: auto; align-self: center; padding-top: 0; font-size: 12px; color: var(--txt3); flex: none; }
.chat.nonlu .date { color: var(--accent); font-weight: 500; }
.chat .apercu {
  display: block; -webkit-line-clamp: unset; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 0; font-size: 14px; line-height: 1.35; color: var(--txt2); flex: 1 1 0; min-width: 0;
}
.chat .l2 { margin-top: 2px; }
.chat .badge {
  background: var(--accent); color: var(--sur-accent); min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; font-size: 12px; font-weight: 600; flex: none;
}
/* Badge des chats unis sur l'avatar : logos empilés, « +N » lisible */
.chat .avw .badge-fusion .plusn {
  min-width: 16px; height: 16px; box-sizing: border-box; display: inline-grid; place-items: center;
  font-size: 9.5px; font-weight: 600; color: var(--txt2); background: var(--n-champ);
  border-radius: 999px; padding: 0 3px; margin-left: -5px; box-shadow: 0 0 0 2px var(--n-surf);
}
/* Épingle et favori : de petites icônes grises devant le nom */
.chat .l1 .epingle, .chat .l1 .fav { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0; opacity: 1; color: var(--txt3); }
.chat .l1 .epingle svg, .chat .l1 .fav svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.chat .l1 .muet-ic { color: var(--txt3); }
/* Au survol, une seule action : le menu « ⋯ ». Archiver et Priorité basse y sont. */
.chat .actions { top: 50%; right: 10px; transform: translateY(-50%); background: var(--survol); box-shadow: none; border: 0; }
.chat .actions .act:not(:last-child) { display: none; }
.chat.on .actions { background: var(--n-sel); }
.liste { padding: 0; }

/* ---------------------------------------------------------------------------
   5. LE FIL
   --------------------------------------------------------------------------- */
#vue .fil { padding: 12px max(24px, 7%) 8px !important; gap: 2px !important; }

/* Séparateurs : jour, réseau (chats unis), messages non déchiffrés */
#vue .fil .jour {
  align-self: center; margin: 10px 0 8px; padding: 5px 12px;
  background: var(--cl-pastille); color: var(--cl-pastille-txt);
  border: 0; border-radius: 7.5px; box-shadow: var(--cl-ombre-bulle);
  font-size: 12.5px; font-weight: 400; letter-spacing: 0; text-transform: none;
}
#vue .jour span { background: none; border: 0; box-shadow: none; padding: 0; }
#vue .reseau-sep {
  align-self: center; display: inline-flex; align-items: center; gap: 6px;
  margin: 6px 0 4px; padding: 3px 10px;
  background: var(--cl-pastille); color: var(--cl-pastille-txt);
  border: 0; border-radius: 999px; box-shadow: var(--cl-ombre-bulle);
  font-size: 11.5px; font-weight: 500; letter-spacing: 0;
}
#vue .reseau-sep .pt { width: 7px; height: 7px; border-radius: 50%; flex: none; }
#vue .chiffre { color: var(--txt3); font-size: 12px; }

/* La bulle */
#vue .msg {
  position: relative;
  border: 0; border-radius: var(--n-r-bulle);
  box-shadow: var(--cl-ombre-bulle);
  padding: 6px 8px 7px 9px; line-height: 1.38;
  max-width: min(65%, 620px);
  background: var(--bulle); color: var(--txt);
}
#vue .msg.moi { border: 0; background: var(--bulle-moi); color: var(--n-moi); }
/* Une série : 2 px entre deux bulles du même auteur, de l'air quand on change. */
#vue .msg.suite, #vue .msg.moi.suite { margin-top: 2px; border-radius: var(--n-r-bulle); }
#vue .msg:not(.suite) { margin-top: 10px; }
#vue .fil > .jour + .msg, #vue .fil > .reseau-sep + .msg { margin-top: 2px; }

/* Le bec : sur la PREMIÈRE bulle d'une série seulement. */
#vue .msg:not(.suite) { border-top-left-radius: 0; }
#vue .msg.moi:not(.suite) { border-top-left-radius: var(--n-r-bulle); border-top-right-radius: 0; }
#vue .msg:not(.suite)::before {
  content: ""; display: block; position: absolute; top: 0; bottom: auto; left: -8px; right: auto;
  width: 8px; height: 13px; border-radius: 0; opacity: 1;
  background: var(--bulle);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
#vue .msg.moi:not(.suite)::before {
  left: auto; right: -8px; background: var(--bulle-moi);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
#vue .msg.suite::before { display: none; }

/* Nom de l'auteur (groupes) : une teinte par personne */
#vue .msg .exp {
  font-size: .9em; font-weight: 500; letter-spacing: 0; line-height: 1.3; margin: 0 0 2px;
  color: hsl(var(--t, 170) var(--cl-auteur-s) var(--cl-auteur-l));
}
/* Photo de l'auteur (groupes) : hors de la bulle, à gauche, en haut de la série */
#vue .fil { --av-exp: 38px; }
#vue .fil .msg.avec-av { margin-left: var(--av-exp); }
#vue .fil .msg .av-exp { left: calc(var(--av-exp) * -1 - 2px); top: 0; width: 28px; height: 28px; }

/* Le texte, et l'heure DANS la bulle, en bas à droite.
   🔴 Une cale invisible au bout du texte réserve la place de l'heure sur la
   dernière ligne : si elle tient, l'heure s'y pose ; sinon elle passe dessous
   d'elle-même. Pas de ligne vide pour une heure seule. */
#vue .msg .corps { white-space: pre-wrap; overflow-wrap: anywhere; }
#vue .msg .corps::after { content: ""; display: inline-block; width: 4.6em; height: 1px; }
#vue .msg:has(> .h .modif) .corps::after { width: 9.6em; }
#vue .msg > .h {
  position: absolute; right: 7px; bottom: 3px;
  display: flex; align-items: center; gap: 4px; margin: 0;
  font-size: .76em; line-height: 1.3; color: var(--txt3); opacity: 1;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
#vue .msg > .h [role="button"] { pointer-events: auto; }
#vue .msg.moi > .h, #vue .msg.moi > .h .modif { color: var(--n-moi-2); }
#vue .msg > .h .modif { font-style: italic; }
/* Sans texte en dernier (audio, fichier, sondage, carte, fil de réponses) :
   l'heure reprend sa ligne, à droite. */
#vue .msg:not(:has(> .corps)) > .h,
#vue .msg:has(> .corps ~ :not(.h):not(.actions):not(.reacts):not(.av-exp):not(.fil3)) > .h {
  position: static; justify-content: flex-end; margin-top: 3px;
}

/* Citation (réponse à un message) */
#vue .msg .cite {
  margin: 0 0 5px; padding: 5px 8px 6px; border: 0; border-left: 4px solid var(--cl-cite-bord);
  border-radius: 6px; background: var(--cl-cite); cursor: pointer;
}
#vue .msg.moi .cite { background: var(--cl-cite-moi); border-left-color: var(--accent); }
#vue .msg .cite .qui { color: var(--cl-cite-bord); font-size: .88em; font-weight: 500; margin-bottom: 1px; }
#vue .msg.moi .cite .qui { color: var(--accent); opacity: 1; }
#vue .msg .cite .txt {
  color: var(--txt2); font-size: .9em; white-space: normal;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
#vue .msg.moi .cite .txt { color: var(--n-moi-2); }

/* Images et vidéos DANS la bulle, du côté de l'expéditeur */
/* 🔴 Largeur FIXE (bornée par max-width) : une largeur en % laisse la taille
   intrinsèque de la photo (800 px…) gonfler la bulle jusqu'à son maximum. */
#vue .msg > img:not(.av), #vue .msg > .video-vign, #vue .msg > .media-absent {
  display: block; width: 330px; max-width: 100%; height: auto; max-height: 420px;
  margin: 0; border-radius: 5px; object-fit: cover; cursor: pointer;
}
#vue .msg:has(> img:not(.av)), #vue .msg:has(> .video-vign), #vue .msg:has(> .media-absent) { padding: 3px; }
#vue .msg:has(> img:not(.av)) > :is(.corps, .exp, .cite, .non-resolu),
#vue .msg:has(> .video-vign) > :is(.corps, .exp, .cite) { margin-left: 6px; margin-right: 6px; }
#vue .msg:has(> img:not(.av)) > .exp, #vue .msg:has(> .video-vign) > .exp { margin-top: 3px; }
#vue .msg:has(> img:not(.av)) > .corps, #vue .msg:has(> .video-vign) > .corps { padding: 4px 0 4px; }
/* Image seule : l'heure se pose SUR l'image, sur un voile sombre. */
#vue .msg:has(> img:not(.av)):not(:has(> .corps)) > .h,
#vue .msg:has(> .video-vign):not(:has(> .corps)) > .h {
  position: absolute; right: 9px; bottom: 7px; margin: 0;
  padding: 1px 6px; border-radius: 9px; color: #fff; background: rgba(11,20,26,.45);
}
#vue .msg > .video-vign { position: relative; background: #000; overflow: hidden; }
#vue .msg > .video-vign img { width: 100%; height: auto; display: block; margin: 0; border-radius: 0; }
#vue .msg > .media-absent { min-height: 120px; }

/* Fichier joint, audio */
#vue .msg > a.fichier {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 0;
  padding: 10px 12px; border-radius: 6px; background: var(--cl-cite);
  color: var(--txt); text-decoration: none; font-size: .95em; overflow-wrap: anywhere;
}
#vue .msg.moi > a.fichier { background: var(--cl-cite-moi); color: var(--n-moi); }
#vue .msg > a.fichier:hover { text-decoration: underline; }
#vue .msg > audio { display: block; width: 280px; max-width: 100%; height: 40px; margin: 2px 0 0 !important; }
/* Message vocal : bouton rond, barre, durée */
#vue .msg .lecteur-audio { display: flex; align-items: center; gap: 10px; width: 260px; max-width: 100%; padding: 2px 0; }
#vue .msg .lecteur-audio audio { display: none; }
#vue .msg .la-bouton {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--accent); color: var(--sur-accent); cursor: pointer;
}
#vue .msg .la-bouton .ico svg { width: 18px; height: 18px; }
#vue .msg .la-piste { flex: 1 1 auto; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--txt3) 35%, transparent); cursor: pointer; position: relative; }
#vue .msg .la-avance { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--accent); }
#vue .msg .la-temps { flex: none; font-size: .8em; color: var(--txt3); font-variant-numeric: tabular-nums; min-width: 2.6em; }
#vue .msg.moi .la-temps { color: var(--n-moi-2); }

/* En échec, « Échec · réessayer ⟳ » est trop long pour la cale de l'heure : il
   passe sous le texte au lieu de s'imprimer dessus. */
#vue .msg.echec > .h { position: static; justify-content: flex-end; margin-top: 3px; }
#vue .msg.echec .corps::after { display: none; }
/* Mention, échec, mise en évidence */
#vue .msg.mentionne { box-shadow: var(--cl-ombre-bulle), inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
#vue .msg.echec { box-shadow: inset 0 0 0 1px var(--dan); }
#vue .msg.surligne { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }

/* Réactions : à côté de la bulle (demande de Jérôme, 23/09), en pastilles nettes.
   🔴 La barre d'actions au survol tombait EXACTEMENT sur elles (même côté, même
   hauteur pour une bulle d'une ligne) : cliquer 🔥 armait « Répondre ». Elle se
   pose donc au-dessus du coin extérieur ; les réactions restent en bas. */
@media (hover: hover) {
  #vue .fil .msg > .actions { top: 0; transform: translateY(-62%); }
}
#vue .msg .react {
  background: var(--cl-pastille); color: var(--txt); border: 0;
  box-shadow: 0 1px 2px rgba(11,20,26,.18); border-radius: 999px;
  padding: 1px 7px; font-size: .85em; line-height: 1.5;
}
#vue .msg .react.mien { background: color-mix(in srgb, var(--accent) 18%, var(--cl-pastille)); }
#vue .msg.moi .react { color: var(--txt); }

/* Fil de réponses */
#vue .msg .fil3 {
  display: inline-flex; align-items: center; gap: 4px; min-height: 0;
  margin: 4px 0 0; padding: 2px 0; border: 0; background: none;
  color: var(--accent); font-size: .88em; font-weight: 500;
}
#vue .msg .fil3:hover { text-decoration: underline; }
/* « N réponses » partage sa ligne avec l'heure (posée en bas à droite) */
#vue .msg > .fil3 { margin-right: 4.6em; }

/* Actions au survol : une petite barre flottante, nette */
#vue .msg .actions {
  background: var(--cl-pastille); border: 0; border-radius: 999px;
  box-shadow: 0 1px 3px rgba(11,20,26,.25); padding: 2px;
}
#vue .msg .actions::before { display: none; }
#vue .msg .actions button {
  width: 28px; height: 28px; border-radius: 50%; color: var(--txt2); background: none;
  display: inline-grid; place-items: center; font-size: 15px;
}
#vue .msg .actions button:hover { background: var(--bg4); color: var(--txt); }

/* Sous le dernier message, l'état de lecture ; l'indicateur de frappe */
#vue .vupar { align-self: flex-end; margin: 3px 2px 4px; font-size: 11.5px; color: var(--txt3); }
#vue .vupar.lu { color: var(--accent); font-weight: 500; }
#vue .ecrit {
  align-self: flex-start; margin: 8px 0 4px; padding: 6px 12px; border-radius: 7.5px;
  background: var(--bulle); box-shadow: var(--cl-ombre-bulle); color: var(--txt2); font-size: 13px;
}
#vue .fil > .btn.gris { border-radius: 999px; background: var(--cl-pastille); color: var(--txt2); box-shadow: var(--cl-ombre-bulle); border: 0; min-height: 32px; font-size: 13px; }

/* Bandeau de fusion proposée, recherche dans le fil */
#vue > .bandeau-fusion {
  margin: 0; border: 0; border-bottom: 1px solid var(--n-filet); border-radius: 0;
  background: var(--n-surf); padding: 8px 16px;
}
.cherche-fil .bar { margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--n-filet); background: var(--n-surf); }

/* ---------------------------------------------------------------------------
   6. LE COMPOSEUR : une bande grise collée en bas, champ blanc arrondi
   --------------------------------------------------------------------------- */
/* Où l'on répond (chats unis) : une ligne discrète, dans la même bande */
#vue > .canal {
  margin: 0; padding: 6px 16px 0; background: var(--n-champ);
  font-size: 12px; color: var(--txt3);
}
#vue > .perte { margin: 0; border-radius: 0; background: var(--n-champ); padding: 6px 16px 0; }
#vue > .sugg.on { background: var(--n-champ); padding: 6px 16px 0; margin: 0; }
.saisie {
  margin: 0; padding: 8px 14px; gap: 4px; align-items: flex-end;
  background: var(--n-champ); border: 0;
  border-radius: 0; box-shadow: none;
}
.saisie:focus-within { border-color: transparent; box-shadow: none; }
.saisie .cible { order: 0; margin-right: 4px; }
.saisie .outils { order: 1; height: 42px; display: flex; align-items: center; gap: 0; }
.saisie textarea { order: 2; }
.saisie > .micro, .saisie > button.env { order: 3; }
.saisie textarea {
  flex: 1 1 auto; min-width: 0;
  background: var(--n-surf); color: var(--txt); border: 0; border-radius: 8px;
  min-height: 42px; padding: 11px 14px; line-height: 1.35; font-size: 15px;
  margin: 0 6px;
}
body[data-theme="encre"] .saisie textarea { background: #2a3942; }
.saisie textarea::placeholder { color: var(--txt3); }
.saisie textarea:focus, .saisie textarea:focus-visible { outline: none; }
.saisie .outil { width: 42px; height: 42px; border-radius: 50%; color: var(--txt2); background: transparent; flex: none; }
.saisie .outil:hover { background: var(--bg4); color: var(--txt); }
.saisie .outil .ico svg { width: 22px; height: 22px; }
.saisie button.env { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--sur-accent); flex: none; }
.prog-attente { margin: 0; border-radius: 0; border: 0; background: var(--n-champ); }

/* ---------------------------------------------------------------------------
   7. CE QUI FLOTTE : coins courts, une ombre
   --------------------------------------------------------------------------- */
.menu, .boite, #galerie, #volet, #gglobale { border-radius: 8px; box-shadow: var(--epure-elevation); }
.menu { padding: 6px 0; }
.menu button { border-radius: 0; padding: 9px 16px; }
.menu button:hover { background: var(--survol); }
.accueil-carte { border-radius: 8px; box-shadow: none; background: transparent; }
#vue > .accueil { background: var(--n-champ); }
body[data-theme="encre"] #vue > .accueil { background: #222e35; }
.accueil-titre { color: var(--txt); font-weight: 400; font-size: 26px; letter-spacing: 0; }
.accueil-texte, .accueil-astuces { color: var(--txt2); }

/* L'avis (« Texte copié », erreurs) : une pastille OPAQUE, centrée en bas.
   🔴 Elle était translucide (`--bg4`) : la liste se lisait au travers. */
/* 🔴 au-dessus des fenêtres (.modal 90, visionneuse 80) : un avis émis depuis
   une fenêtre était caché dessous */
.avis {
  z-index: 200;
  left: 50%; right: auto; bottom: 24px; transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px)); box-sizing: border-box;
  background: var(--txt); color: var(--n-surf); border: 0; border-radius: 8px;
  box-shadow: 0 2px 10px rgba(11,20,26,.3); padding: 12px 16px; font-size: 14px;
}
.avis .lien { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
/* Menus : action destructive en rouge */
.menu button.danger { color: var(--dan); }
/* Visionneuse : un fond opaque, comme WhatsApp — la conversation ne transparaît pas */
#visio { background: #0b141a; backdrop-filter: none; -webkit-backdrop-filter: none; }
/* Transférer : l'initiale d'un contact sans photo, dans le même rond que les photos */
.choix-ligne .av {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600;
  background: var(--bg4); color: var(--txt2);
}
/* Galerie, « Décrire l'image » : le champ « Dans la conversation… », lisible
   en clair comme en sombre (il était bleu nuit en dur) */
#gglobale .gportee {
  min-width: 180px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--n-filet); background: var(--n-champ); color: var(--txt);
}
/* Les champs natifs (cases, curseurs) prennent l'accent de Fluvo, pas le bleu du navigateur */
body { accent-color: var(--accent); }
/* Sur l'accent, toujours --sur-accent : --moi-txt (texte de MA bulle) y tombait
   à 3,6:1 en clair et 2,8:1 en sombre (flèche d'envoi, onglet Emoji, favoris) */
.env .ico svg { stroke: currentColor; }
.pick-onglets button.on, .favbar .fav-ic .pastille-n { color: var(--sur-accent); }
/* Pastille « +1 » des chats unis : la pile est en rtl, le nombre ne doit pas l'être */
.chat .avw .badge-fusion .plusn { direction: ltr; unicode-bidi: isolate; }
/* Menus : titres et lignes d'info alignés sur les entrées */
.menu .titre, .menu .ligne-info { padding-left: 16px; padding-right: 16px; }
/* Boutons secondaires des boîtes : un seul style (contour, texte accent), pieds à droite */
.modal .boite .btn.gris {
  background: transparent; color: var(--accent); border: 1px solid var(--n-filet);
  font-weight: 500; border-radius: 999px;
}
.modal .boite .btn { vertical-align: middle; }
.fiche-pied, .coffre-actions, .bq-pied { display: flex; justify-content: flex-end; gap: 10px; }
/* « Écrire à quelqu'un » : un vrai champ, et « Fermer » comme les autres boîtes */
.boite.ecrire .emoji-rech {
  box-sizing: border-box; width: 100%; padding: 9px 12px; font-size: 14.5px;
  background: var(--n-champ); color: var(--txt); border: 1px solid var(--n-filet); border-radius: 8px;
}
.boite.ecrire .emoji-rech:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.boite.ecrire > .btn { display: block; margin-left: auto; }
/* Rapprochements à confirmer : « Réunir » et « Séparés » sont des boutons */
.boite.fusion .fu-a { display: flex; gap: 8px; flex: none; }
.boite.fusion .fu-a .lien {
  padding: 6px 14px; border-radius: 999px; font-weight: 500; text-decoration: none;
  color: var(--accent); border: 1px solid var(--n-filet); background: transparent;
}
.boite.fusion .fu-a .lien.fort { background: var(--accent); color: var(--sur-accent); border-color: transparent; }
/* Confirmation et petite saisie maison (boiteConfirmer, boiteSaisir) */
.boite.boite-question {
  width: min(420px, calc(100vw - 32px)); padding: 22px 24px 16px; border-radius: 8px;
  background: var(--n-surf); color: var(--txt);
}
.boite-question .bq-texte { margin: 0 0 6px; font-size: 15.5px; line-height: 1.4; color: var(--txt); }
.boite-question .bq-detail { margin: 0 0 4px; font-size: 13.5px; line-height: 1.45; color: var(--txt2); }
.boite-question .bq-champ {
  width: 100%; box-sizing: border-box; margin: 10px 0 2px; padding: 9px 12px; font-size: 15px;
  border: 0; border-bottom: 2px solid var(--accent); border-radius: 0; background: transparent; color: var(--txt);
  outline: none;
}
.boite-question .bq-pied { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.boite-question .btn { min-height: 38px; padding: 0 18px; border-radius: 999px; font-weight: 500; }
.boite-question .btn.gris { background: transparent; color: var(--accent); border: 1px solid var(--n-filet); }
.boite-question .btn:not(.gris) { background: var(--accent); color: var(--sur-accent); border: 0; }
/* rouge foncé fixe : blanc dessus à 5,3:1 en clair comme en sombre */
.boite-question .btn.danger { background: #c23b3b; color: #fff; }

/* ---------------------------------------------------------------------------
   8. TÉLÉPHONE : barre d'onglets plate collée au bas
   --------------------------------------------------------------------------- */
@media (max-width: 760px) {
  #app { background: var(--n-surf); }
  #panneau { border-right: 0; }
  #rail {
    margin: 0 !important; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important; border-top: 1px solid var(--n-filet) !important;
    background: var(--n-surf); box-shadow: none; color: var(--txt2);
    justify-content: space-around;
  }
  /* Les réseaux passent par le menu « Tous les réseaux » : la barre du bas ne
     garde que les vues et les réglages, à parts égales. */
  #rail .rail-reseaux { display: none !important; }
  #rail .rail-haut { flex: 1 1 auto; justify-content: space-around; overflow: visible; }
  .rail-item { flex: 1 1 0; border-radius: 16px; color: var(--txt2); min-width: 0; }
  .rail-item .rl { font-size: 11px; font-weight: 500; }
  .rail-item.on, .rail-item.on:hover { background: transparent; color: var(--txt); }
  .rail-item.on .ri { background: var(--st-on); color: var(--st-on-txt); border-radius: 16px; padding: 2px 16px; }
  .rail-item .pastille-n { background: var(--accent); color: var(--sur-accent); box-shadow: 0 0 0 2px var(--n-surf); }
  #b-reglages { flex: 0 1 auto; }
  #panneau > header.h { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  #vue > header.h { margin: 0; min-height: 56px; padding: 6px 8px; gap: 8px; }
  #vue > header.h .av { width: 36px; height: 36px; }
  #vue .fil { padding: 8px 10px 6px !important; }
  #vue .msg { max-width: 85% !important; }
  #vue .fil .msg.avec-av { margin-left: 34px; }
  #vue .fil { --av-exp: 34px; }
  .saisie { margin: 0; padding: 6px 6px; }
  .saisie textarea { margin: 0 4px; }
  .saisie .outil-sondage { display: none; }
  .liste .chat { margin: 0; padding: 10px 16px; border-radius: 0; }
  .chat::after { left: 79px; }
  /* Tous les médias : les filtres tiennent en deux lignes qui défilent de côté,
     les dates exactes (Du / au) cèdent la place aux raccourcis 7 j, 30 j, Mois… */
  #gglobale .dates, #gglobale .gfiltres {
    flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none;
    padding: 6px 12px !important; gap: 6px !important; margin: 0 !important;
    border: 0 !important; border-radius: 0 !important; background: transparent !important;
  }
  #gglobale .dates input[type="date"], #gglobale .dates .lbl { display: none; }
  #gglobale .dates .rc, #gglobale .gfiltres .fl { flex: none; white-space: nowrap; }
  #gglobale .gfiltres .info { flex: none; white-space: nowrap; order: 9; }
  #gglobale .gfiltres .maj-index { flex: none; min-height: 32px; padding: 0 12px; }
  #gglobale .gh .q { font-size: 15px !important; }
  /* l'avis passe au-dessus de la barre d'onglets */
  .avis { bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.mob-conv .avis { bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* Médias de la conversation : même barre de dates compacte que la galerie globale */
  #galerie .dates { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
  #galerie .dates input[type="date"], #galerie .dates .lbl { display: none; }
  #galerie .dates .rc { flex: none; white-space: nowrap; }
  /* Confirmation et petite saisie : une boîte centrée sur un voile, pas une
     page blanche pleine hauteur (sobre.css et mobile.css étirent les modales) */
  .modal:has(> .boite-question) {
    place-items: center !important; padding: 16px !important;
    background: rgba(11, 20, 26, .5) !important;
  }
  .modal .boite.boite-question {
    width: calc(100vw - 32px) !important; max-width: 420px !important;
    height: auto !important; max-height: none !important;
    border-radius: 10px !important; padding: 20px 20px 14px !important;
  }
  /* Visionneuse : la barre passe sur deux lignes, les boutons restent dans
     l'écran ; le zoom se fait au pincement */
  #visio .vh { flex-wrap: wrap; gap: 6px 10px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  #visio .vh .nom:empty { display: none; }
  #visio .vh .outils { order: 1; margin-left: auto; }
  #visio .vh .meta { order: 2; flex: 1 1 100%; font-size: 12.5px; }
  #visio .vh .outils .zoomniv,
  #visio .vh .outils button:is([title^="Dézoomer"], [title^="Zoomer"], [title^="Ajuster"]) { display: none; }
  /* Rapprochements à confirmer : la liste prend la hauteur de l'écran */
  .boite.fusion { display: flex; flex-direction: column; }
  .boite.fusion .fu-l { max-height: none; flex: 1 1 auto; min-height: 0; }
  /* Photo seule avec réactions : les pastilles passent sous l'image, l'heure
     redevient du texte à côté d'elles (sa pastille sombre tombait sur le blanc) */
  #vue .msg:has(> .reacts):not(:has(> .corps)) > .h {
    background: none; color: var(--txt3); padding: 0; bottom: 6px; right: 8px;
  }
  /* Code du coffre : une boîte centrée, comme les confirmations */
  .modal.coffre-code { place-items: center !important; padding: 16px !important; background: rgba(11, 20, 26, .5) !important; }
  .modal.coffre-code .boite {
    width: calc(100vw - 32px) !important; max-width: 400px !important;
    height: auto !important; max-height: none !important; border-radius: 10px !important;
  }
  /* Emoji et GIF au téléphone aussi : le bouton était caché, et les GIF avec lui */
  .saisie .outil-emoji { display: inline-grid !important; }
  /* Panneaux de la conversation (médias, fil) : tout l'écran, sans bande résiduelle */
  #galerie, #volet { inset: 0 !important; width: auto !important; max-width: none !important; border-radius: 0 !important; border: 0 !important; }
  .barre { padding: 6px 12px 4px; }
}
/* Tactile : pas de survol, le « ⋯ » reste au bout de la ligne, discret
   (l'appui long ouvre aussi le menu). */
@media (hover: none) {
  .chat .actions {
    position: static; transform: none; order: 3; align-self: center; flex: none;
    grid-column: auto; grid-row: auto; background: transparent; padding: 0; margin: 0 -8px 0 0;
  }
  .chat .actions .act { width: 32px; height: 44px; color: var(--txt3); background: transparent; }
}

/* ---------- Fonds d'écran : le sélecteur (dialogueFond) ---------- */
.boite-fonds { max-width: 560px; }
.apercu-fond { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 10px;
  border: 1px solid var(--bord); background: var(--n-fil); margin: 4px 0 12px; }
.apercu-fond .b { max-width: 75%; padding: 6px 9px; border-radius: 7.5px; font-size: 13.5px;
  box-shadow: var(--cl-ombre-bulle); }
.apercu-fond .b.autre { align-self: flex-start; background: var(--bulle); color: var(--txt); }
.apercu-fond .b.moi { align-self: flex-end; background: var(--bulle-moi); color: var(--n-moi); }
.fonds-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px;
  max-height: 240px; overflow-y: auto; padding: 2px; }
.fond-tuile { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--bord); background: var(--n-fil);
  cursor: pointer; display: grid; place-items: center; font-size: 11px; color: var(--txt2); padding: 0; }
.fond-tuile.on, .fond-import.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.fond-ligne-import { margin: 12px 0; }
.fond-pied { display: flex; gap: 8px; flex-wrap: wrap; }
