/* Fluvo — messagerie unifiee (backend gomuks + compte Beeper) */
/* ============================================================
   THÈMES « liquid glass » — quatre jeux de variables, un seul CSS.
   Le JS pose data-theme sur <body> (et la classe .clair pour les deux
   thèmes clairs). Tout le reste de la feuille ne connaît que les variables.
   ============================================================ */
/* ============================================================
   THÈMES « NET » (19/09/2026) — le design par défaut de Fluvo.
   Plats : aucune matière, aucun halo. Les surfaces (panneau, champ, filet)
   sont déclarées dans `net.css`, qui porte tout le langage visuel.
   Police système : la même que celle des messageries du téléphone, et cinq
   familles Google en moins à charger.
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--fond); color: var(--txt);
  font: 15px/1.45 var(--police); -webkit-font-smoothing: antialiased;
  position: relative;
}
/* halos flous derrière le verre : c'est eux que le flou révèle */
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; opacity: .9;
}
body::before { left: -8vw; top: -16vh; width: 44vw; height: 70vh; background: var(--blob1); filter: blur(90px); }
body::after { right: -10vw; bottom: -20vh; width: 50vw; height: 72vh; background: var(--blob2); filter: blur(110px); }
#racine { position: relative; z-index: 1; height: 100%; }
#racine::before {
  content: ""; position: fixed; left: 38vw; top: -22vh; width: 36vw; height: 56vh; border-radius: 50%;
  background: var(--blob3); filter: blur(120px); opacity: .8; pointer-events: none; z-index: -1;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

/* ---------- ossature ---------- */
#app { display: flex; height: 100dvh; }

/* ---------- barre verticale (vues + réseaux), façon Beeper ---------- */
#rail {
  width: 72px; flex: 0 0 72px; background: var(--bg3); border-right: 1px solid var(--bord);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 10px;
  overflow-y: auto; scrollbar-width: none;
}
#rail::-webkit-scrollbar { display: none; }
#rail .rail-haut, #rail .rail-reseaux { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
#rail .rail-reseaux { flex: 1; }
#rail .rail-sep { width: 34px; height: 1px; background: var(--bord); margin: 6px 0; flex: none; }
.rail-item {
  width: 56px; padding: 7px 2px 5px; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; position: relative; color: var(--txt2); flex: none;
}
.rail-item:hover { background: var(--bg4); color: var(--txt); }
.rail-item.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--txt); }
.rail-item.on::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.rail-item .ri { font-size: 19px; line-height: 1; }
.rail-item .rl { font-size: 9.5px; text-align: center; line-height: 1.15; max-width: 54px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item img.ra { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.rail-item .pastille-n {
  position: absolute; top: 3px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: var(--moi-txt); font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
#b-reglages { margin-top: auto; }
#panneau { width: 400px; min-width: 340px; max-width: 460px; display: flex; flex-direction: column;
  background: var(--bg2); border-right: 1px solid var(--bord); }
#vue { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

/* ---------- entete ---------- */
header.h {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--bord); min-height: 56px;
}
header.h h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -.2px; }
.pastille { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg4); color: var(--txt2); }
.icone { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }
.icone:hover { background: var(--bg4); }

/* ---------- recherche ---------- */
.rech { padding: 8px 12px; }
.rech input {
  width: 100%; background: var(--bg3); border: 1px solid var(--bord);
  border-radius: 10px; padding: 9px 12px; outline: none;
}
.rech input:focus { border-color: var(--accent); }

/* ---------- barre d'outils de la liste ---------- */
.barre { display: flex; align-items: center; gap: 10px; padding: 0 14px 8px; min-height: 22px; }
.barre .info { font-size: 12px; color: var(--txt3); }
.barre .lien { margin-left: auto; font-size: 12.5px; color: var(--accent2); padding: 3px 8px; border-radius: 7px; }
.barre .lien:hover { background: var(--bg4); }

/* ---------- liste ---------- */
.liste { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 12px; }
.chat {
  display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r);
  cursor: pointer; position: relative; user-select: none;
}
.chat:hover { background: var(--survol); }
.chat .actions { display: none; gap: 2px; margin-left: auto; }
.chat:hover .actions { display: flex; }
.chat .actions .act {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-size: 14px; background: var(--bg4); opacity: .85;
}
.chat .actions .act:hover { opacity: 1; background: var(--accent); }
.chat:hover .date { display: none; }
.chat.on { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.chat .av {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 46px; object-fit: cover;
  background: var(--bg4); display: grid; place-items: center; font-weight: 600; color: var(--txt2);
  font-size: 16px; overflow: hidden;
}
.chat .txt { min-width: 0; flex: 1; }
.chat .l1 { display: flex; align-items: baseline; gap: 8px; }
.chat .nom { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat .fav { flex: none; display: inline-flex; align-items: center; line-height: 0; opacity: .9; }
.chat .fav svg { width: 13px; height: 13px; fill: var(--accent); }
.chat .date { margin-left: auto; font-size: 11.5px; color: var(--txt3); flex: none; }
.chat .apercu { font-size: 13px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat.nonlu .nom { color: var(--txt); }
.chat.nonlu .apercu { color: var(--txt); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent);
  color: var(--moi-txt); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.badge.muet { background: var(--bg4); color: var(--txt2); }
.puces { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.puce { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg4); color: var(--txt2); }
.puce.dossier { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent2); }
.vide { padding: 40px 20px; text-align: center; color: var(--txt3); font-size: 14px; }

/* ---------- menu contextuel ---------- */
.menu {  /* au-dessus des panneaux latéraux */
  position: fixed; z-index: 75; background: var(--bg3); border: 1px solid var(--bord);
  border-radius: var(--r); padding: 6px; min-width: 220px; box-shadow: 0 12px 40px var(--ombre);
  /* 🔴 Sans plafond ni defilement propre, un menu plus long que l'ecran
     (beaucoup de dossiers) etait simplement rogne par le bord de la fenetre :
     ses dernieres entrees n'existaient nulle part, ni visibles ni cliquables. */
  max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.menu button { display: flex; width: 100%; gap: 10px; padding: 9px 10px; border-radius: var(--rs);
  text-align: left; font-size: 14px; align-items: center; }
.menu button:hover { background: var(--bg4); }
.menu .sep { height: 1px; background: var(--bord); margin: 5px 2px; }
.menu .titre { font-size: 11px; color: var(--txt3); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .5px; }
.fond { position: fixed; inset: 0; z-index: 74; }   /* sous le menu (75), au-dessus des panneaux et de la galerie */

/* ---------- conversation ---------- */
.fil { flex: 1; overflow-y: auto; padding: 16px 76px 8px; display: flex; flex-direction: column; gap: 2px; }
.msg { max-width: min(560px, 70%); padding: 8px 12px; border-radius: 16px; background: var(--bg3);
  align-self: flex-start; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.moi { align-self: flex-end; background: var(--accent); color: var(--moi-txt); }
.msg .exp { font-size: 12px; color: var(--accent2); font-weight: 600; margin-bottom: 2px; }
.msg .h { font-size: 10.5px; color: var(--txt3); margin-top: 3px; text-align: right; }
.msg.moi .h { color: color-mix(in srgb, var(--moi-txt) 72%, transparent); }
.msg img { max-width: min(320px, 100%); max-height: 340px; object-fit: cover; border-radius: 10px;
  display: block; margin-top: 4px; cursor: zoom-in; background: var(--bg4); }
.msg a.lien-msg { color: var(--accent2); word-break: break-all; }
.msg.moi a.lien-msg { color: var(--moi-txt); text-decoration: underline; }
.msg a.fichier { display: inline-block; margin-top: 4px; color: var(--accent2); text-decoration: none; }
.msg a.fichier:hover { text-decoration: underline; }
.msg.moi a.fichier { color: var(--moi-txt); }
.msg + .msg { margin-top: 2px; }
.jour { align-self: center; font-size: 11.5px; color: var(--txt3); background: var(--bg2);
  padding: 3px 12px; border-radius: 999px; margin: 10px 0 6px; }
.saisie { display: flex; gap: 8px; padding: 10px 12px 10px; border-top: 1px solid var(--bord); }
.saisie textarea {
  flex: 1; resize: none; background: var(--bg3); border: 1px solid var(--bord); border-radius: 20px;
  padding: 10px 14px; max-height: 120px; outline: none;
}
.saisie textarea:focus { border-color: var(--accent); }
.saisie button.env { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--moi-txt); font-size: 17px; }
.accueil { flex: 1; display: grid; place-items: center; color: var(--txt3); text-align: center; padding: 24px; }

/* ---------- reglages ---------- */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.boite { background: var(--bg2); border: 1px solid var(--bord); border-radius: 16px; width: min(560px, 100%);
  max-height: 86dvh; overflow-y: auto; padding: 18px; }
.boite h2 { margin: 0 0 4px; font-size: 17px; }
.boite p.aide { color: var(--txt2); font-size: 13px; margin: 0 0 14px; }
.regle { display: flex; gap: 8px; align-items: center; padding: 8px; background: var(--bg3); border-radius: var(--rs); margin-bottom: 8px; flex-wrap: wrap; }
.regle select, .regle input { background: var(--bg4); border: 1px solid var(--bord); border-radius: 8px; padding: 6px 8px; outline: none; }
.btn { background: var(--accent); color: var(--moi-txt); padding: 9px 16px; border-radius: 10px; font-weight: 600; }
.btn.gris { background: var(--bg4); color: var(--txt); }

/* ---------- connexion ---------- */
.login { display: grid; place-items: center; height: 100dvh; }
.login form { width: min(360px, 90%); display: flex; flex-direction: column; gap: 10px; }
.login input { background: var(--bg3); border: 1px solid var(--bord); border-radius: 10px; padding: 11px 14px; outline: none; }
.login h1 { text-align: center; margin: 0 0 6px; }
.err { color: var(--dan); font-size: 13px; min-height: 18px; }

/* Tablette : on resserre simplement les colonnes. */
@media (max-width: 1000px) and (min-width: 761px) {
  #panneau { width: 320px; min-width: 280px; }
}

/* ---------- réactions ---------- */
.msg { position: relative; }
.msg .reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.msg .react {
  font-size: 12px; padding: 2px 7px; border-radius: 999px;
  background: var(--bg4); border: 1px solid var(--bord); color: var(--txt);
}
.msg .react.mien { background: color-mix(in srgb, var(--accent) 28%, transparent); border-color: var(--accent); }
.msg.moi .react { background: color-mix(in srgb, var(--moi-txt) 18%, transparent); border-color: transparent; }
/* Barre d'actions au survol. 🔴 Elle chevauche la bulle de quelques pixels : sans
   ça, le curseur traverse un vide, .msg:hover retombe et les boutons disparaissent
   avant qu'on ait pu cliquer. Le padding sert de zone tampon. */
.msg .actions {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: none; align-items: center; gap: 4px;
  padding: 10px 6px; right: -102px;
}
.msg.moi .actions { right: auto; left: -102px; }
.msg:hover .actions, .msg .actions:hover { display: flex; }
.msg .actions button {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--bg3); border: 1px solid var(--bord);
  display: grid; place-items: center; font-size: 13px;
}
.msg .actions button:hover { background: var(--accent); color: var(--moi-txt); }

/* ---------- sélecteur d'emoji ----------
   🔴 Tout est préfixé `.emoji-pick` : `.menu button` impose `display:flex`,
   `width:100%`, `gap:10px` et `padding:9px 10px` à TOUT bouton d'un menu. Sans
   ce préfixe, le bouton du teint prenait la largeur entière sous le champ de
   recherche et les onglets de catégories alignaient leur glyphe à gauche.
   🔴 Les colonnes sont en `minmax(0, 1fr)`, jamais `1fr` : `1fr` vaut
   `minmax(auto, 1fr)`, et un bouton ne peut alors pas descendre sous la largeur
   de son glyphe (37 à 47 px) — la grille débordait en largeur. */
/* 🔴 Colonne flexible bornée à la hauteur de la fenêtre : sur un écran court
   (portable, fenêtre réduite) le bas de la grille passait sous le bord. C'est
   la GRILLE qui se comprime, pas la boîte qui déborde ; `overflow: hidden`
   empêche `.menu { overflow-y: auto }` de faire défiler l'ensemble. */
.menu.emoji-pick {
  width: 336px; padding: 8px; overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100dvh - 16px);
}
.emoji-pick > .pick-onglets, .emoji-pick > .emoji-rapides,
.emoji-pick > .emoji-haut, .emoji-pick > .emoji-teints, .emoji-pick > .emoji-cats { flex: none; }
.emoji-rapides { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }

.emoji-haut { display: flex; gap: 6px; align-items: center; }
.emoji-champ {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; height: 34px;
  padding: 0 10px; background: var(--bg3); border: 1px solid var(--bord); border-radius: 10px;
}
.emoji-champ:focus-within { border-color: var(--accent); }
.emoji-champ .ico { display: grid; place-items: center; flex: none; }
.emoji-champ .ico svg { width: 15px; height: 15px; color: var(--txt3); }
.emoji-rech {
  flex: 1 1 auto; min-width: 0; width: auto; margin: 0; padding: 0;
  background: none; border: 0; outline: none; color: inherit; font: inherit;
}
.emoji-pick .emoji-teint {
  flex: none; width: 34px; height: 34px; padding: 0; gap: 0; justify-content: center;
  border: 1px solid var(--bord); background: var(--bg3); border-radius: 10px;
  font-size: 17px; line-height: 1;
}
.emoji-pick .emoji-teint:hover, .emoji-pick .emoji-teint.ouvert { background: var(--bg4); border-color: var(--accent); }
.emoji-teints {
  display: flex; gap: 3px; margin-top: 6px; padding: 4px;
  border: 1px solid var(--bord); border-radius: 10px; background: var(--bg3);
}
.emoji-teints .emoji { flex: 1 1 0; }

.emoji-cats { display: flex; gap: 2px; margin: 8px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--bord); }
.emoji-pick .emoji-cats button {
  flex: 1 1 0; width: auto; min-width: 0; padding: 5px 0; gap: 0; justify-content: center;
  border-radius: 8px; font-size: 16px; line-height: 1; opacity: .5;
}
.emoji-pick .emoji-cats button:hover { background: var(--bg4); opacity: 1; }
.emoji-pick .emoji-cats button.on { opacity: 1; background: var(--bg4); box-shadow: inset 0 -2px 0 var(--accent); }

/* hauteur fixe : la fenêtre ne doit pas sauter entre « rien trouvé » et 390 emojis */
.emoji-grille { flex: 1 1 232px; height: 232px; min-height: 84px; overflow-y: auto; overflow-x: hidden; }
.emoji-rang { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.emoji-titre { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt3); margin: 8px 2px 4px; }
.emoji-titre:first-child { margin-top: 2px; }
.emoji-aide { margin-top: 6px; font-size: 12px; color: var(--txt3); opacity: .8; }
.emoji-vide { padding: 30px 10px; text-align: center; color: var(--txt3); font-size: 13px; line-height: 1.5; }

.emoji { font-size: 19px; padding: 4px; border-radius: 7px; line-height: 1; }
.emoji-pick .emoji {
  width: 100%; min-width: 0; padding: 4px 0; gap: 0; justify-content: center;
  font-size: 20px; line-height: 1.2; border-radius: 8px;
}
.emoji.gros { font-size: 22px; }
.emoji:hover { background: var(--bg4); }

/* ---------- barre de saisie ---------- */
.saisie .outil {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg3); font-size: 16px;
  display: grid; place-items: center; flex: none; align-self: flex-end;
}
.saisie .outil:hover { background: var(--bg4); }
.fil.depot { outline: 2px dashed var(--accent); outline-offset: -8px; }

.puce.range { opacity: .5; }
.puce.actif { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent2); font-weight: 600; }
.puce { cursor: pointer; }

/* ---------- sélecteur : onglets Emoji / GIF ---------- */
.pick-onglets { display: flex; gap: 4px; margin-bottom: 6px; }
.pick-onglets button { flex: 1; padding: 5px; border-radius: 8px; font-size: 12.5px; background: var(--bg4); color: var(--txt2); }
.pick-onglets button.on { background: var(--accent); color: var(--moi-txt); font-weight: 600; }
.gif-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; max-height: 260px; overflow-y: auto; }
.gif-grille img { width: 100%; border-radius: 8px; cursor: pointer; display: block; }
.gif-grille .aide { grid-column: 1 / -1; color: var(--txt3); font-size: 12.5px; padding: 10px; text-align: center; }
.boite .aide { color: var(--txt2); font-size: 13px; }
.boite h2 { margin-top: 18px; }
.regle label, .regle span { font-size: 13px; }

/* ---------- dialogue de regroupement ---------- */
.liste-choix { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.choix-ligne {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer;
}
.choix-ligne:hover { background: var(--bg3); }
.choix-ligne.coche { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.choix-ligne input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.choix-ligne img, .choix-ligne .ini {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--bg4); display: grid; place-items: center; font-weight: 600; color: var(--txt2);
}
.choix-ligne .t { min-width: 0; }
.choix-ligne .n { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-ligne .s { font-size: 11.5px; color: var(--txt3); display: flex; align-items: center; gap: 5px; }
.choix-ligne .s .pt { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- conversation : lisibilité ---------- */
.fil > *:first-child { margin-top: auto; }          /* les messages restent collés en bas */
.msg.encours { opacity: .65; }
.msg.echec { background: rgba(255,92,92,.22); border: 1px solid var(--dan); }
.msg.surligne { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg .h { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* citation dans une bulle */
.msg .cite {
  border-left: 3px solid var(--accent2); background: rgba(0,0,0,.22);
  border-radius: 6px; padding: 4px 8px; margin-bottom: 5px; cursor: pointer;
}
.msg.moi .cite { background: color-mix(in srgb, var(--moi-txt) 16%, transparent); border-left-color: var(--moi-txt); }
.msg .cite .qui { font-size: 11.5px; font-weight: 700; color: var(--accent2); }
.msg.moi .cite .qui { color: var(--moi-txt); }
.msg .cite .txt { font-size: 12.5px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.moi .cite .txt { color: color-mix(in srgb, var(--moi-txt) 85%, transparent); }

/* bouton citer */

/* bandeau « réponse à » au-dessus de la saisie */
.reponse-a {
  display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 7px 10px;
  background: var(--bg3); border-left: 3px solid var(--accent); border-radius: 8px;
}
.reponse-a .t { min-width: 0; flex: 1; }
.reponse-a .qui { font-size: 11.5px; font-weight: 700; color: var(--accent2); }
.reponse-a .txt { font-size: 12.5px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reponse-a .x { width: 26px; height: 26px; border-radius: 50%; }
.reponse-a .x:hover { background: var(--bg4); }

.pastille.alerte { background: var(--warn); color: #221a00; font-weight: 600; }

/* ---------- bandeau d'annulation ---------- */
.avis {
  position: fixed; left: 90px; bottom: 18px; z-index: 70; display: flex; align-items: center; gap: 12px;
  background: var(--bg4); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 10px 30px var(--ombre); font-size: 13.5px;
}
.avis .lien { color: var(--accent2); font-weight: 600; }
.avis .lien:hover { text-decoration: underline; }

/* ---------- suggestions d'emoji pendant la frappe ---------- */
.sugg { display: none; gap: 4px; padding: 0 12px 8px 66px; }
.sugg.on { display: flex; }
.sugg .emoji { font-size: 20px; padding: 4px 7px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--bord); }
.sugg .emoji:hover { background: var(--bg4); }
.sugg .emoji.premier { border-color: var(--accent); }

/* ---------- accusés de lecture ---------- */
.msg .coche { font-size: 11px; letter-spacing: -1px; opacity: .7; }
/* ✓ envoyé (discret) · ✓✓ orange distribué · ✓✓ vert lu — lisibles sur toute bulle */
.msg .coche.dist { color: #ffb020; opacity: 1; font-weight: 700; text-shadow: 0 0 2px rgba(0,0,0,.25); }
.msg .coche.lu { color: #3ddc84; opacity: 1; font-weight: 700; text-shadow: 0 0 2px rgba(0,0,0,.25); }
.msg.moi .coche.dist { color: #ffc75a; }
.msg.moi .coche.lu { color: #6ff0a6; }

.choix-reseau .res .def { font-size: 10px; margin-left: 2px; }

/* ---------- résultats de recherche ---------- */
.sep-liste { font-size: 11px; color: var(--txt3); text-transform: uppercase; letter-spacing: .5px; padding: 10px 10px 4px; }
.chat.resultat .apercu mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--txt); border-radius: 3px; padding: 0 2px; }
.msg .h .modif { font-style: italic; opacity: .75; margin-right: 4px; }

/* ---------- « en train d'écrire » ---------- */
.ecrit { align-self: flex-start; display: flex; align-items: center; gap: 8px; color: var(--txt2);
  font-size: 12.5px; padding: 6px 12px; background: var(--bg3); border-radius: 14px; margin-top: 4px; }
.ecrit .pts { letter-spacing: 2px; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: .3 } 50% { opacity: 1 } }
.apercu-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bg4); }

/* ---------- sondages ---------- */
.sondage { min-width: 240px; max-width: 380px; }
.sondage .q { font-weight: 600; margin-bottom: 8px; }
.sondage .opt {
  display: block; width: 100%; text-align: left; position: relative; overflow: hidden;
  border: 1px solid var(--bord); border-radius: 9px; padding: 7px 10px; margin-bottom: 6px;
  background: var(--bg3);
}
.msg.moi .sondage .opt { background: color-mix(in srgb, var(--moi-txt) 14%, transparent); border-color: transparent; }
.sondage .opt .barre {
  position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 34%, transparent);
  transition: width .25s;
}
.msg.moi .sondage .opt .barre { background: color-mix(in srgb, var(--moi-txt) 24%, transparent); }
.sondage .opt .lb { position: relative; display: flex; justify-content: space-between; gap: 10px; }
.sondage .opt.mien { border-color: var(--accent); font-weight: 600; }
.sondage .pied { font-size: 12px; color: var(--txt2); margin-top: 2px; }
.msg.moi .sondage .pied { color: color-mix(in srgb, var(--moi-txt) 75%, transparent); }

/* ---------- fils de discussion ---------- */
.msg .fil3 {
  margin-top: 6px; font-size: 12.5px; color: var(--accent2); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 999px; padding: 3px 10px; display: inline-block;
}
.msg.moi .fil3 { background: color-mix(in srgb, var(--moi-txt) 18%, transparent); color: var(--moi-txt); }
#volet {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; z-index: 55;
  background: var(--bg2); border-left: 1px solid var(--bord); display: flex; flex-direction: column;
  box-shadow: -12px 0 40px var(--ombre);
}
/* `>` : le pied de chaque bulle du volet porte aussi la classe « h » */
#volet > .h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
#volet > .h b { flex: 1; }
#volet .fil { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- aide raccourcis ---------- */
.raccourcis { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: center; }
.raccourcis kbd {
  background: var(--bg4); border: 1px solid var(--bord); border-bottom-width: 2px; border-radius: 6px;
  padding: 2px 7px; font: 12px/1.4 ui-monospace, monospace; white-space: nowrap;
}

/* ---------- panneau média (galerie de la conversation) ---------- */
#galerie {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; z-index: 55;
  background: var(--bg2); border-left: 1px solid var(--bord); display: flex; flex-direction: column;
  box-shadow: -12px 0 40px var(--ombre);
}
#galerie .h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
#galerie .h b { flex: 1; }
#galerie .onglets { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--bord); }
#galerie .og {
  flex: 1; padding: 7px 4px; border-radius: 9px; font-size: 13px; color: var(--txt2);
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
#galerie .og:hover { background: var(--bg4); color: var(--txt); }
#galerie .og.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--txt); font-weight: 600; }
#galerie .og .nb { font-size: 11px; background: var(--bg4); border-radius: 999px; padding: 0 6px; }
/* 🔴 `env(safe-area-inset-bottom)` : ces deux panneaux descendent jusqu'au bord de
   l'écran. Sans lui, la dernière rangée de vignettes passe sous la barre de
   navigation du téléphone et reste coupée. */
#galerie .gfil { flex: 1; overflow-y: auto; padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
#galerie .grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
#galerie .vign {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg3); padding: 0;
}
#galerie .vign img { width: 100%; height: 100%; object-fit: cover; display: block; }
#galerie .vign:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
#galerie .vign .play {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px;
  color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); pointer-events: none;
}
#galerie .ligne-med {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px;
  color: inherit; text-decoration: none;
}
#galerie .ligne-med:hover { background: var(--bg4); }
#galerie .ligne-med .ic { font-size: 20px; flex: none; }
#galerie .ligne-med .t { min-width: 0; }
#galerie .ligne-med .n { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#galerie .ligne-med .d { font-size: 12px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#galerie .gpied { padding: 10px; border-top: 1px solid var(--bord); text-align: center; }

/* ---------- visionneuse plein écran ---------- */
#visio {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.95);
  backdrop-filter: blur(3px); display: flex; flex-direction: column;
}
#visio .vh {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px; color: #fff;
  background: linear-gradient(rgba(0,0,0,.62), transparent); flex: 0 0 auto;
}
#visio .vh .nom { font-weight: 600; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#visio .vh .meta { flex: 1; font-size: 13px; color: rgba(255,255,255,.72); }
#visio .vh .outils { display: flex; gap: 4px; align-items: center;
  background: rgba(255,255,255,.08); border-radius: 12px; padding: 4px; }
#visio .icone {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; text-decoration: none; background: transparent; font-size: 17px; line-height: 1;
  border: 0; cursor: pointer; transition: background .12s;
}
#visio .icone:hover { background: rgba(255,255,255,.2); }
#visio .icone:active { background: rgba(255,255,255,.3); }
#visio .zoomniv {
  min-width: 56px; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.85);
  font-variant-numeric: tabular-nums; cursor: pointer; user-select: none; padding: 0 2px;
}
/* 🔴 min-height/min-width 0 : sans ça l'enfant flex refuse de rétrécir, la photo
   déborde de l'écran et l'on n'en voit qu'un morceau (effet « déjà zoomée »). */
#visio .scene {
  flex: 1 1 auto; min-height: 0; min-width: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 6px 68px 16px; touch-action: none;
}
#visio .scene img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; transform-origin: center; transition: transform .12s ease-out;
  user-select: none; -webkit-user-drag: none;
}
#visio .scene video { max-width: 100%; max-height: 100%; border-radius: 8px; }
#visio .nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 62px;
  border-radius: 12px; background: rgba(255,255,255,.09); color: #fff; font-size: 30px; line-height: 1;
  border: 0; cursor: pointer; transition: background .12s;
}
#visio .nav:hover { background: rgba(255,255,255,.24); }
#visio .nav.gauche { left: 12px; }
#visio .nav.droite { right: 12px; }
#visio .legende {
  padding: 10px 20px 18px; color: rgba(255,255,255,.9); text-align: center; font-size: 14px;
  max-width: 900px; margin: 0 auto;
}

/* la conversation se rétrécit quand un panneau est ouvert (PC) */
:root { --pw: 0px; }
body.avec-panneau #app { padding-right: var(--pw); }

/* ---------- galerie de tous les médias ---------- */
#gglobale {
  position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; flex-direction: column;
}
#gglobale .gh { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--bord); }
#gglobale .gh b { font-size: 16px; flex: none; }
#gglobale .gh .q {
  flex: 1; max-width: 560px; background: var(--bg3); border: 1px solid var(--bord);
  border-radius: 10px; padding: 9px 14px; outline: none;
}
#gglobale .gh .q:focus { border-color: var(--accent); }
#gglobale .gh .icone { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
#gglobale .gh .icone:hover { background: var(--bg4); }
#gglobale .gfiltres { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--bord); flex-wrap: wrap; }
#gglobale .fl { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--bord); font-size: 13px; color: var(--txt2); }
#gglobale .fl:hover { background: var(--bg4); color: var(--txt); }
#gglobale .fl.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--txt); font-weight: 600; }
#gglobale .info { font-size: 12.5px; color: var(--txt2); margin-left: auto; }
#gglobale .gcorps { flex: 1; overflow-y: auto; padding: 12px 18px calc(40px + env(safe-area-inset-bottom, 0px)); }
#gglobale .gmois { font-weight: 600; margin: 18px 0 8px; text-transform: capitalize; color: var(--txt2); font-size: 13px; }
#gglobale .grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
#gglobale .vign {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--bg3); padding: 0; display: block;
}
#gglobale .vign img { width: 100%; height: 100%; object-fit: cover; display: block; }
#gglobale .vign:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
#gglobale .vign .play {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px;
  color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); pointer-events: none;
}
#gglobale .vign .doc { position: absolute; inset: 0 0 30% 0; display: grid; place-items: center; font-size: 30px; }
#gglobale .vign .nomf {
  position: absolute; left: 6px; right: 6px; bottom: 22px; font-size: 11px; color: var(--txt2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}
#gglobale .vign .qui {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 4px; font-size: 11px;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; pointer-events: none;
}
#gglobale .aide { padding: 16px 0; text-align: center; }

/* barre de suggestion d'emoji : libellé + choix actif */
.sugg .lbl { font-size: 12px; color: var(--txt3); align-self: center; margin-right: 2px; }
.sugg .emoji.actif { background: color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 8px; }

/* vignette sans aperçu disponible (vidéo sans miniature de la passerelle) */
#galerie .vign.sansapercu, #gglobale .vign.sansapercu {
  background: linear-gradient(140deg, var(--bg3), var(--bg4));
}
#galerie .vign.sansapercu::after, #gglobale .vign.sansapercu::after {
  content: "🖼️"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 22px; opacity: .35;
}
#gglobale .vign.sansapercu .play, #galerie .vign.sansapercu .play { z-index: 1; }

/* ---------- filtre par période ---------- */
.rech { display: flex; gap: 6px; align-items: center; }
.rech input { flex: 1; }
.dates {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; background: var(--bg3); border: 1px solid var(--bord); border-radius: 10px;
}
.dates .lbl { font-size: 12.5px; color: var(--txt2); }
.dates input[type="date"] {
  background: var(--bg); border: 1px solid var(--bord); border-radius: 8px;
  padding: 5px 8px; color: var(--txt); outline: none; font-size: 13px;
  color-scheme: dark;
}
body.clair .dates input[type="date"] { color-scheme: light; }
.dates input[type="date"]:focus { border-color: var(--accent); }
.dates .rc {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--bord); color: var(--txt2);
}
.dates .rc:hover { background: var(--bg4); color: var(--txt); }
#galerie .dates, #gglobale .dates { margin: 8px 10px 0; }
#gglobale .dates { margin: 10px 18px 0; }

/* ---------- archive Messenger (export Meta) ---------- */
.tuile-video {
  display: block; margin-top: 4px; padding: 22px 28px; border-radius: 10px;
  background: linear-gradient(140deg, var(--bg3), var(--bg4)); border: 1px solid var(--bord);
  color: var(--txt2); font-size: 14px;
}
.tuile-video:hover { border-color: var(--accent); color: var(--txt); }
.msg.moi .tuile-video { background: color-mix(in srgb, var(--moi-txt) 14%, transparent); border-color: transparent; color: var(--moi-txt); }

.retour-archive { display: grid; }

/* ---------- états vides : une icône, une phrase, pas un écran noir ---------- */
.etat-vide {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 48px 28px; text-align: center; color: var(--txt2);
}
.etat-vide .ic { font-size: 40px; opacity: .8; margin-bottom: 2px; }
.etat-vide .ti { font-size: 15px; font-weight: 600; color: var(--txt); }
.etat-vide .de { font-size: 13px; color: var(--txt3); max-width: 280px; line-height: 1.5; }
.fil .etat-vide { margin: auto; }

/* initiale d'un réseau sans avatar, dans la barre « Envoyer à… » */
.choix-reseau .res .ini {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--moi-txt); flex: none;
}
.choix-reseau .res .pt { display: none; }   /* l'avatar porte déjà la couleur */
.barre:empty { display: none; }

/* ---------- sonde de version : présence de cette feuille de style ----------
   Le JS crée un .sonde-css et vérifie qu'elle est bien « fixed ». Si un cache
   sert une vieille feuille, la règle manque et l'application se recharge. */
.sonde-css { position: fixed; left: -9999px; top: -9999px; width: 1px; height: 1px; }
.bandeau-cache {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
  background: var(--warn, #ffb020); color: #17171c; text-align: center;
  padding: 12px 14px;
  font-size: 14px; font-weight: 600;
}

/* « Afficher plus » de la galerie générale : la suite se charge par tranches */
#gglobale .plus-medias { display: block; margin: 18px auto 26px; padding: 10px 18px; }

/* fin de la galerie générale : repère quand tout est affiché */
#gglobale .gfin { text-align: center; color: var(--txt3); font-size: 12px; padding: 22px 0 30px; }
#gglobale .gsentinelle { height: 1px; }

/* fermée = cachée (le nœud est gardé pour rouvrir instantanément au même endroit) ;
   la règle d'identifiant l'emporterait sinon sur [hidden] du navigateur */
#gglobale[hidden] { display: none; }

/* ============================================================
   VERRE — les grands panneaux flottent sur les halos.
   Ossature : trois cartes (rail, liste, conversation) avec un espace entre elles.
   ============================================================ */
#app { padding: 14px; gap: 12px; height: 100dvh; }
#rail, #panneau, #vue, #volet, #galerie, #gglobale, .menu, .boite {
  background: var(--verre);
  backdrop-filter: blur(var(--flou)) saturate(1.35); -webkit-backdrop-filter: blur(var(--flou)) saturate(1.35);
  border: 1px solid var(--verre-bord);
  box-shadow: inset 0 1px 0 var(--verre-hi), var(--verre-ombre);
}
#rail { border-radius: var(--r-carte); padding: 12px 6px 12px; width: 76px; flex-basis: 76px; border-right: 1px solid var(--verre-bord); }
#panneau { border-radius: var(--r-carte); border-right: 1px solid var(--verre-bord); overflow: hidden; }
#vue { border-radius: var(--r-carte); overflow: hidden; }
#volet, #galerie { top: 14px; bottom: 14px; right: 14px; border-radius: var(--r-carte); border-left: 1px solid var(--verre-bord); }
#gglobale { inset: 14px; border-radius: var(--r-carte); }
.menu, .boite { border-radius: 18px; }
.rail-item { border-radius: 14px; }
.rail-item.on::before { display: none; }
.rail-item.on { box-shadow: inset 0 1px 0 var(--verre-hi); }
header.h { border-bottom-color: var(--bord); }
header.h h1 { font-family: var(--police-titre); font-weight: var(--titre-poids); font-size: 20px; letter-spacing: -.02em; }
#vue header.h h1 { font-size: 17px; }
.rech input, .saisie textarea { background: var(--bg3); border-color: transparent; box-shadow: inset 0 1px 0 var(--verre-hi); border-radius: 14px; }
.saisie textarea { border-radius: 22px; }
.rech input:focus, .saisie textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.chat { border-radius: var(--r); }
.chat.on { background: var(--bg3); box-shadow: inset 0 1px 0 var(--verre-hi); }
.chat .av { background: var(--bg3); box-shadow: inset 0 1px 0 var(--verre-hi); }
.msg { background: var(--bulle); border-radius: 18px; border-bottom-left-radius: 6px; box-shadow: inset 0 1px 0 var(--verre-hi), 0 6px 18px var(--ombre); }
.msg.moi { background: var(--bulle-moi); border-radius: 18px; border-bottom-right-radius: 6px; border-bottom-left-radius: 18px; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.saisie { border-top-color: var(--bord); }
.saisie button.env { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.badge, .pastille-n { box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.modal { background: color-mix(in srgb, var(--bg) 45%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.jour, .pastille, .puce { background: var(--bg4); }

/* logo dans le rail */
#logo-rail { width: 38px; height: 38px; margin: 2px 0 10px; display: block; flex: none; }

/* lien sous forme de pastille : le nom du site plutôt que l'adresse brute */
.pastille-lien {
  display: inline-flex; align-items: center; gap: 4px; margin: 4px 4px 2px 0; padding: 4px 11px;
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent2); font-size: 12.5px; font-weight: 600; text-decoration: none !important;
  box-shadow: inset 0 1px 0 var(--verre-hi);
}
.pastille-lien:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.msg.moi .pastille-lien { background: color-mix(in srgb, var(--moi-txt) 18%, transparent); color: var(--moi-txt); }

/* surnom : photos déjà connues des réseaux, au choix */
.photos-reseaux { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.photos-reseaux .pr { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px; border-radius: 12px; border: 2px solid transparent; background: var(--bg3); font-size: 11px; color: var(--txt2); }
.photos-reseaux .pr img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.photos-reseaux .pr.on { border-color: var(--accent); color: var(--txt); }

/* logos des réseaux d'un contact regroupé : ronds, serrés, nom au survol */
.logo-res {
  width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden;
  font-size: 10px; font-weight: 700; color: #fff; cursor: pointer; flex: none;
  box-shadow: 0 0 0 1.5px var(--bg2), 0 0 0 2.5px color-mix(in srgb, var(--c, var(--accent)) 60%, transparent);
  opacity: .8; transition: transform .12s, opacity .12s;
}
.logo-res img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-res:hover { transform: scale(1.18); opacity: 1; }
.logo-res.actif { opacity: 1; box-shadow: 0 0 0 1.5px var(--bg2), 0 0 0 2.5px var(--c, var(--accent)); }
.logo-res.range { opacity: .4; filter: grayscale(.6); }
.puces { align-items: center; }

/* ---------- événement (WhatsApp) : une carte plutôt qu'un bloc de texte ---------- */
.evenement { display: flex; flex-direction: column; gap: 10px; min-width: 280px; }
.ev-tete { display: flex; gap: 12px; align-items: center; }
.ev-date { width: 50px; height: 54px; border-radius: 12px; background: color-mix(in srgb, currentColor 14%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; box-shadow: inset 0 1px 0 var(--verre-hi); }
.ev-mois { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.ev-jour { font-size: 22px; font-weight: 800; line-height: 1; }
.ev-titre { font-family: var(--police-titre); font-weight: var(--titre-poids); font-size: 16px; }
.ev-quand { font-size: 13px; opacity: .85; }
.ev-lieu { font-size: 12.5px; opacity: .8; }
.ev-desc { font-size: 13.5px; white-space: pre-line; opacity: .9; }
.ev-rsvp { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-btn { padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, currentColor 12%, transparent); box-shadow: inset 0 1px 0 var(--verre-hi); }
.ev-btn:hover { background: color-mix(in srgb, currentColor 20%, transparent); }
.ev-btn.on { background: #3ddc84; color: #0b1a12; }
.ev-btn.on.non { background: #ff5c5c; color: #fff; }
.ev-btn.cal { margin-left: auto; }

/* mentions : pastille dans le texte, bulle surlignée quand c'est moi */
.mention { display: inline-block; padding: 1px 7px; border-radius: 999px; font-weight: 600; font-size: .92em;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent2); }
.msg.moi .mention { background: color-mix(in srgb, var(--moi-txt) 18%, transparent); color: var(--moi-txt); }
.mention.moi { background: #ffb020; color: #17171c; }
.msg.mentionne { box-shadow: inset 3px 0 0 #ffb020, inset 0 1px 0 var(--verre-hi), 0 6px 18px var(--ombre); }
.sugg .mention-sugg { padding: 4px 10px; border-radius: 999px; background: var(--bg4); font-size: 13px; }
.sugg .mention-sugg.premier { outline: 2px solid var(--accent); outline-offset: -2px; }

/* pièce jointe en attente, au-dessus de la saisie */
.pj-attente { display: flex; align-items: center; gap: 12px; margin: 0 12px 6px; padding: 8px 10px; border-radius: 14px; background: var(--bg3); box-shadow: inset 0 1px 0 var(--verre-hi); }
.pj-attente img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.pj-attente .pj-ic { width: 64px; height: 64px; border-radius: 10px; display: grid; place-items: center; font-size: 26px; background: var(--bg4); }
.pj-attente .pj-inf { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 12.5px; color: var(--txt2); }
.pj-attente .pj-inf b { color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-attente.envoi { opacity: .5; }

/* texte des bulles : les retours à la ligne comptent (grilles SUTOM, listes…) */
.msg > div:not(.h):not(.cite):not(.reacts):not(.actions):not(.exp):not(.sondage):not(.evenement) { white-space: pre-wrap; }
.msg .pastille-lien { white-space: nowrap; }
/* « Vu par … » sous mon dernier message lu */
.vupar { align-self: flex-end; font-size: 11px; color: var(--txt3); margin: 0 6px 6px; }
/* accusé en texte (17/09/2026) : « Vu » ressort, « Envoyé »/« Distribué » restent discrets */
.vupar.lu { color: var(--ok); font-weight: 600; }
/* sondage : qui a voté quoi */
.sondage .opt .qui { font-size: 11px; color: var(--txt3); margin: 2px 0 0 18px; text-align: left; position: relative; }
.msg.moi .sondage .opt .qui { color: color-mix(in srgb, var(--moi-txt) 75%, transparent); }

/* ---------- photo de l'auteur à gauche des bulles reçues ---------- */
/* 🔴 L'avatar est en position absolue HORS de la bulle, pas dans une rangée
   flex : le fil est reconstruit par réconciliation et chaque `.msg` est un
   nœud comparé tel quel — l'envelopper dans une ligne aurait fait tout
   remplacer à chaque accusé de lecture. La place est prise par la marge. */
.fil { --av-exp: 36px; }
.fil .msg.avec-av { margin-left: var(--av-exp); }
.fil .msg .av-exp {
  position: absolute; left: calc(var(--av-exp) * -1); bottom: 0;
  width: calc(var(--av-exp) - 8px); height: calc(var(--av-exp) - 8px);
}
.fil .msg .av-exp .av {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: var(--bg4); color: var(--txt2);
  display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
/* la photo suit la PREMIÈRE bulle de la série : elle se cale en haut, à la
   hauteur du nom de l'auteur, et non au pied d'un message de vingt lignes */
.fil .msg .av-exp { bottom: auto; top: 0; }
@media (max-width: 760px) { .fil { --av-exp: 30px; } }

/* ---------- fiche de la conversation (le nom, en haut du fil) ---------- */
#vue header.h .titre { cursor: pointer; border-radius: 10px; padding: 2px 6px; margin: -2px -6px; }
#vue header.h .titre:hover { background: var(--bg3); }
.boite.fiche { width: min(420px, 100%); max-height: min(86vh, 760px); display: flex;
  flex-direction: column; padding: 0; overflow: hidden; }
.fiche-tete { display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 22px 16px 18px; text-align: center; }
.fiche-tete .av { width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  background: var(--bg4); color: var(--txt2); display: grid; place-items: center;
  font-size: 34px; font-weight: 600; }
.fiche-tete .n { font-size: 19px; font-weight: 700; color: var(--txt); margin-top: 4px; }
.fiche-tete .r { font-size: 12.5px; color: var(--txt3); }
.fiche-act { display: flex; align-items: center; gap: 12px; width: 100%; flex: none;
  padding: 11px 20px; text-align: left; font-size: 14px; color: var(--txt2); }
.fiche-act:hover { background: var(--bg3); color: var(--txt); }
.fiche-act .ico svg { width: 18px; height: 18px; }
.fiche-titre { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--txt3); padding: 12px 20px 6px; margin-top: 6px; border-top: 1px solid var(--bord); }
.fiche-groupes { overflow-y: auto; min-height: 0; }
.fiche-gr { display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 20px; text-align: left; color: var(--txt2); }
.fiche-gr:hover { background: var(--bg3); color: var(--txt); }
.fiche-gr .av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--bg4); display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.fiche-gr .t { min-width: 0; }
.fiche-gr .n { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fiche-gr .s { font-size: 11.5px; color: var(--txt3); }
.fiche-pied { display: flex; justify-content: flex-end; padding: 12px 16px;
  border-top: 1px solid var(--bord); flex: none; }

/* ---------- état de mon dernier message, dans la liste ---------- */
.chat .etiq .etat-msg { font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
  padding: 1px 6px; border-radius: 999px; background: var(--bg4); color: var(--txt3); }
.chat .etiq .etat-msg.lu { color: var(--ok, #3ddc84); background: color-mix(in srgb, var(--ok, #3ddc84) 16%, transparent); }
.chat .etiq .etat-msg.dist { color: var(--warn, #ffb020); background: color-mix(in srgb, var(--warn, #ffb020) 14%, transparent); }
