/* 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.
   ============================================================ */
:root, body[data-theme="givre"] {            /* A · Givre : clair, froid, verre laiteux */
  --police: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: var(--police); --titre-poids: 800;
  --bg: #e9eef5; --bg2: rgba(255,255,255,.55); --bg3: rgba(255,255,255,.6); --bg4: rgba(20,33,61,.07);
  --txt: #14213d; --txt2: #4a5670; --txt3: #8391a8;
  --accent: #2f6bff; --accent2: #7aa2ff; --moi-txt: #ffffff;
  --bord: rgba(20,33,61,.09); --ok: #22a06b; --warn: #e0961f; --dan: #e5484d;
  --survol: rgba(20,33,61,.05); --ombre: rgba(30,50,90,.16);
  --verre: rgba(255,255,255,.55); --verre-bord: rgba(255,255,255,.85); --verre-hi: rgba(255,255,255,.95);
  --verre-ombre: 0 20px 50px rgba(30,50,90,.10); --flou: 28px;
  --bulle: rgba(255,255,255,.82); --bulle-moi: linear-gradient(135deg,#2f6bff,#5b8cff);
  --fond: linear-gradient(160deg,#eef2f7 0%,#e4ebf5 50%,#eaf0f8 100%);
  --blob1: #c9dcff; --blob2: #dbe7ff; --blob3: #fbe7d6;
  --r: 14px; --rs: 9px; --r-carte: 22px;
}
body[data-theme="obsidienne"] {              /* B · Obsidienne : sombre, verre fumé, halo violet */
  --police: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: var(--police); --titre-poids: 700;
  --bg: #08080c; --bg2: rgba(255,255,255,.055); --bg3: rgba(255,255,255,.07); --bg4: rgba(255,255,255,.1);
  --txt: #f3f2fa; --txt2: #a8a6c2; --txt3: #6e6c88;
  --accent: #8b7cff; --accent2: #c4b5ff; --moi-txt: #ffffff;
  --bord: rgba(255,255,255,.09); --ok: #3ddc84; --warn: #ffb020; --dan: #ff5c5c;
  --survol: rgba(255,255,255,.06); --ombre: rgba(0,0,0,.6);
  --verre: rgba(255,255,255,.055); --verre-bord: rgba(255,255,255,.10); --verre-hi: rgba(255,255,255,.14);
  --verre-ombre: 0 30px 80px rgba(0,0,0,.5); --flou: 30px;
  --bulle: rgba(255,255,255,.07); --bulle-moi: linear-gradient(135deg,#7b6cf0,#9a8cff);
  --fond: #08080c;
  --blob1: #3b2a7a; --blob2: #1c3a6e; --blob3: #5a2b6e;
  --r: 14px; --rs: 9px; --r-carte: 22px;
}
body[data-theme="aurore"] {                  /* C · Aurore : clair, chaud, titres serif */
  --police: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: "DM Serif Display", Georgia, "Times New Roman", serif; --titre-poids: 400;
  --bg: #f7f1ec; --bg2: rgba(255,252,249,.6); --bg3: rgba(255,255,255,.65); --bg4: rgba(43,35,32,.07);
  --txt: #2b2320; --txt2: #6b5f5a; --txt3: #9c908a;
  --accent: #e8654a; --accent2: #c9502f; --moi-txt: #ffffff;
  --bord: rgba(43,35,32,.09); --ok: #2f9e6a; --warn: #d98c1f; --dan: #d9483f;
  --survol: rgba(43,35,32,.05); --ombre: rgba(120,80,60,.16);
  --verre: rgba(255,252,249,.6); --verre-bord: rgba(255,255,255,.85); --verre-hi: rgba(255,255,255,.95);
  --verre-ombre: 0 24px 60px rgba(120,80,60,.10); --flou: 26px;
  --bulle: rgba(255,255,255,.84); --bulle-moi: linear-gradient(135deg,#e8654a,#f08a70);
  --fond: linear-gradient(160deg,#fbf6f1 0%,#f6efe9 55%,#f3eef2 100%);
  --blob1: #ffd9c4; --blob2: #ffe7f0; --blob3: #e4ecff;
  --r: 16px; --rs: 10px; --r-carte: 22px;
}
body[data-theme="graphite"] {                /* D · Graphite : sombre, neutre, dense */
  --police: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: var(--police); --titre-poids: 600;
  --bg: #141518; --bg2: rgba(255,255,255,.04); --bg3: rgba(0,0,0,.25); --bg4: rgba(255,255,255,.08);
  --txt: #eceef1; --txt2: #9aa0aa; --txt3: #666c76;
  --accent: #3ddc84; --accent2: #8ff0b8; --moi-txt: #0b1a12;
  --bord: rgba(255,255,255,.08); --ok: #3ddc84; --warn: #ffb020; --dan: #ff5c5c;
  --survol: rgba(255,255,255,.05); --ombre: rgba(0,0,0,.5);
  --verre: rgba(255,255,255,.04); --verre-bord: rgba(255,255,255,.08); --verre-hi: rgba(255,255,255,.1);
  --verre-ombre: 0 18px 50px rgba(0,0,0,.45); --flou: 22px;
  --bulle: rgba(255,255,255,.06); --bulle-moi: #3ddc84;
  --fond: linear-gradient(180deg,#1a1c20,#121316);
  --blob1: #2a2e36; --blob2: #23272e; --blob3: #1d2026;
  --r: 12px; --rs: 8px; --r-carte: 18px;
}
body[data-theme="fluvo"] {                   /* E · Fluvo : clair, signature de la marque */
  --police: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: var(--police); --titre-poids: 800;
  --bg: #eef3fb; --bg2: rgba(255,255,255,.62); --bg3: rgba(255,255,255,.68); --bg4: rgba(24,38,72,.07);
  --txt: #16203a; --txt2: #4d5a76; --txt3: #8794ab;
  --accent: #5b8def; --accent2: #8b5cf6; --moi-txt: #ffffff;
  --bord: rgba(24,38,72,.09); --ok: #17a673; --warn: #dd961d; --dan: #e5484d;
  --survol: rgba(24,38,72,.05); --ombre: rgba(40,60,120,.16);
  --verre: rgba(255,255,255,.6); --verre-bord: rgba(255,255,255,.9); --verre-hi: rgba(255,255,255,.96);
  --verre-ombre: 0 22px 55px rgba(40,60,120,.12); --flou: 28px;
  --bulle: rgba(255,255,255,.85); --bulle-moi: linear-gradient(135deg,#6ee7f9,#5b8def 55%,#8b5cf6);
  --fond: linear-gradient(155deg,#f2f7ff 0%,#e9f0fc 48%,#f3eefe 100%);
  --blob1: #b8ecf7; --blob2: #cadcff; --blob3: #ded0fb;
  --r: 14px; --rs: 9px; --r-carte: 22px;
}
body[data-theme="fluvo-nuit"] {              /* F · Fluvo Nuit : sombre, dégradé de la marque */
  --police: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: var(--police); --titre-poids: 800;
  --bg: #0a0e1a; --bg2: rgba(255,255,255,.05); --bg3: rgba(255,255,255,.07); --bg4: rgba(255,255,255,.1);
  --txt: #eef2fb; --txt2: #a3adc6; --txt3: #6b7590;
  --accent: #6ee7f9; --accent2: #a78bfa; --moi-txt: #08131c;
  --bord: rgba(255,255,255,.09); --ok: #34d399; --warn: #fbbf24; --dan: #fb7185;
  --survol: rgba(255,255,255,.06); --ombre: rgba(0,0,0,.6);
  --verre: rgba(255,255,255,.05); --verre-bord: rgba(255,255,255,.1); --verre-hi: rgba(255,255,255,.14);
  --verre-ombre: 0 30px 80px rgba(0,0,0,.55); --flou: 30px;
  --bulle: rgba(255,255,255,.07); --bulle-moi: linear-gradient(135deg,#5b8def,#8b5cf6);
  --fond: linear-gradient(165deg,#0a0e1a 0%,#0c1224 55%,#120e22 100%);
  --blob1: #12405c; --blob2: #1e3a7a; --blob3: #3b2a6b;
  --r: 14px; --rs: 9px; --r-carte: 22px;
}
body[data-theme="prisme"] {                  /* G · Prisme : sombre, contrasté, cyan électrique */
  --police: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: var(--police); --titre-poids: 700;
  --bg: #05070d; --bg2: rgba(255,255,255,.045); --bg3: rgba(255,255,255,.065); --bg4: rgba(255,255,255,.1);
  --txt: #f4f8ff; --txt2: #9db0cc; --txt3: #61728c;
  --accent: #22d3ee; --accent2: #c084fc; --moi-txt: #04141a;
  --bord: rgba(255,255,255,.1); --ok: #22d3ee; --warn: #f59e0b; --dan: #f43f5e;
  --survol: rgba(255,255,255,.07); --ombre: rgba(0,0,0,.7);
  --verre: rgba(255,255,255,.045); --verre-bord: rgba(140,200,255,.16); --verre-hi: rgba(180,220,255,.2);
  --verre-ombre: 0 26px 70px rgba(0,10,30,.6); --flou: 24px;
  --bulle: rgba(255,255,255,.065); --bulle-moi: linear-gradient(135deg,#22d3ee,#818cf8 60%,#c084fc);
  --fond: radial-gradient(120% 90% at 15% 0%,#0b1b2e 0%,#05070d 55%),#05070d;
  --blob1: #0e5570; --blob2: #26307a; --blob3: #4a2170;
  --r: 12px; --rs: 8px; --r-carte: 20px;
}
body[data-theme="brume"] {                   /* H · Brume : clair, doux, violet pâle, texte confortable */
  --police: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: var(--police); --titre-poids: 600;
  --bg: #f4f2fa; --bg2: rgba(255,255,255,.6); --bg3: rgba(255,255,255,.66); --bg4: rgba(45,35,70,.06);
  --txt: #241f36; --txt2: #5c5478; --txt3: #938ca8;
  --accent: #8b5cf6; --accent2: #6ee7f9; --moi-txt: #ffffff;
  --bord: rgba(45,35,70,.09); --ok: #16a34a; --warn: #d97706; --dan: #e11d48;
  --survol: rgba(45,35,70,.05); --ombre: rgba(70,50,120,.15);
  --verre: rgba(255,255,255,.58); --verre-bord: rgba(255,255,255,.88); --verre-hi: rgba(255,255,255,.95);
  --verre-ombre: 0 20px 50px rgba(70,50,120,.1); --flou: 26px;
  --bulle: rgba(255,255,255,.85); --bulle-moi: linear-gradient(135deg,#8b5cf6,#a78bfa);
  --fond: linear-gradient(160deg,#f7f4fd 0%,#f1eefa 50%,#eef5fb 100%);
  --blob1: #ddd2fb; --blob2: #e7dcfd; --blob3: #cfe9f7;
  --r: 14px; --rs: 10px; --r-carte: 22px;
}
* { 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);
}
.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 ---------- */
.emoji-pick { width: 320px; padding: 8px; }
.emoji-rapides { display: flex; gap: 4px; justify-content: space-between; margin-bottom: 6px; }
.emoji-rech {
  width: 100%; background: var(--bg4); border: 1px solid var(--bord); border-radius: 8px;
  padding: 6px 9px; margin-bottom: 6px; outline: none;
}
.emoji-grille { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; }
.emoji { font-size: 19px; padding: 4px; border-radius: 7px; line-height: 1; }
.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; }

/* ---------- regroupement : onglets dans l'entête de la conversation ---------- */
/* ---------- choix du réseau pour répondre (façon « Envoyer à… » de Beeper) ---------- */
.choix-reseau { display: flex; align-items: center; gap: 6px; padding: 8px 12px 0; flex-wrap: wrap; }
.choix-reseau .lbl { font-size: 11.5px; color: var(--txt3); margin-right: 2px; }
.choix-reseau .res {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px;
  background: var(--bg3); border: 1px solid var(--bord); color: var(--txt2); font-size: 12px;
}
.choix-reseau .res:hover { background: var(--bg4); color: var(--txt); }
.choix-reseau .res.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--txt); font-weight: 600; }
.choix-reseau .res.envoi { border-color: var(--accent); border-style: dashed; }
.choix-reseau .res .ri { font-size: 14px; }
.choix-reseau .res .nb { font-size: 10.5px; color: var(--txt3); background: var(--bg4); border-radius: 999px; padding: 0 5px; }
.choix-reseau .res.on .nb { color: var(--txt); background: color-mix(in srgb, var(--txt) 16%, transparent); }
.choix-reseau .res img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.choix-reseau .res .pt { width: 8px; height: 8px; border-radius: 50%; flex: none; }
/* étiquette du réseau sous chaque message d'un fil fusionné */
.msg .h .via { margin-right: 6px; font-weight: 600; }
.msg.moi .h .via { color: color-mix(in srgb, var(--moi-txt) 92%, transparent) !important; }
.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); }

/* ---------- apparence : thème et couleurs (réglages) ---------- */
.themes { display: flex; gap: 8px; margin-bottom: 10px; }
.themes .th {
  flex: 1; padding: 9px 6px; border: 1px solid var(--bord); border-radius: 10px;
  background: var(--bg3); color: var(--txt2); font-size: 13px;
}
.themes .th.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--txt); font-weight: 600; }
.couleurs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.couleurs .co { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.couleurs .co.on { border-color: var(--txt); }

/* ---------- 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);
}
#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; }
#galerie .gfil { flex: 1; overflow-y: auto; padding: 10px; }
#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 16px; color: #fff;
  background: linear-gradient(rgba(0,0,0,.55), transparent);
}
#visio .vh .nom { font-weight: 600; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#visio .vh .meta { flex: 1; font-size: 13px; color: rgba(255,255,255,.7); }
#visio .vh .outils { display: flex; gap: 6px; }
#visio .icone {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; text-decoration: none; background: rgba(255,255,255,.1);
}
#visio .icone:hover { background: rgba(255,255,255,.22); }
#visio .scene { flex: 1; display: grid; place-items: center; overflow: hidden; padding: 8px 60px 20px; }
#visio .scene img { max-width: 100%; max-height: 100%; transform-origin: center; transition: transform .12s; }
#visio .scene video { max-width: 100%; max-height: 100%; border-radius: 8px; }
#visio .nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 66px;
  border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; font-size: 32px; line-height: 1;
}
#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 .fres { background: var(--bg3); border: 1px solid var(--bord); border-radius: 999px; padding: 6px 10px; outline: none; }
#gglobale .info { font-size: 12.5px; color: var(--txt2); margin-left: auto; }
#gglobale .gcorps { flex: 1; overflow-y: auto; padding: 12px 18px 40px; }
#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; }
.rech #b-dates {
  flex: none; width: 36px; height: 36px; border-radius: 10px; font-size: 16px;
  border: 1px solid var(--bord); background: var(--bg3); color: var(--txt2);
}
.rech #b-dates:hover { background: var(--bg4); color: var(--txt); }
.rech #b-dates.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--txt); }
#zone-dates:empty { display: none; }
#zone-dates { padding: 0 12px 8px; }
#zone-dates .etat { font-size: 12px; color: var(--txt2); padding: 6px 2px 0; }
.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; }

/* ---------- réglages : les quatre thèmes en cartes ---------- */
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.themes .th {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px;
  border: 2px solid transparent; background: var(--bg3); color: var(--txt2); text-align: left; font-size: 12.5px;
}
.themes .th .ap { height: 54px; border-radius: 10px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.35); }
.themes .th .ap i { position: absolute; border-radius: 6px; }
.themes .th b { color: var(--txt); font-size: 13px; }
.themes .th.on { border-color: var(--accent); }

/* 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; }
.ev-qui { font-size: 12px; opacity: .75; }

/* 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; }
/* 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); }
