/* Polices embarquées (licence SIL OFL, voir fonts/) : aucune dépendance à Google. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/chakra-petch-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/chakra-petch-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/chakra-petch-latin-700-normal.woff2') format('woff2'); }

/* ===== Thème « Arcade » (néon) : valeurs de base. Le thème « Sobre », par défaut, les remplace plus bas. ===== */
:root {
  --bg-0: #08080e;      /* panneaux du bas, fonds les plus sombres */
  --bg-1: #0e0e18;      /* colonnes latérales */
  --bg-2: #0a0a12;      /* zone centrale */
  --bg-3: #161626;      /* boutons, champs */
  --hover: #151526;
  --active: #0c2a33;
  --line: #24243c;
  --text: #ececff;
  --text-2: #d2d2f0;
  --muted: #9393bd;
  --cyan: #00e5ff;
  --cyan-soft: #7df3ff;
  --magenta: #ff3da6;
  --yellow: #ffd23f;
  --green: #2bf08a;
  --red: #ff6b8b;
  --r-s: 4px;
  --r-m: 6px;
  --r-avatar: 50%;      /* arrondi des photos de profil (50% = rond) */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Chakra Petch', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
  /* Réglages d'ambiance (un thème les change pour tout l'affichage) */
  --glow: 1;                 /* intensité des halos lumineux (0 = aucun) */
  --speak: var(--cyan);      /* couleur de « quelqu'un parle » */
  --track: 1;                /* espacement des lettres des titres */
  --on-accent-0a0a12: #0a0a12;  /* texte posé sur la couleur d'accent */
  --on-accent-04040a: #04040a;
  --c-06060c: #06060c;
  --c-04040a: #04040a;
  --bg-raise-12121f: #12121f;   /* encarts légèrement relevés */
  --bg-raise-10101c: #10101c;
  --line-strong: #2a2a48;
  --btn-hover: #1d1d33;
  --bot: #c77dff;               /* bot : violet */
  --bot-2: #b15cff;
  --bot-3: #7b2cbf;
  --bot-text-e9d5ff: #e9d5ff;
  --bot-text-d8b4fe: #d8b4fe;
  --bot-text-f3e8ff: #f3e8ff;
  --bot-text-e0b0ff: #e0b0ff;
  --bot-text-c9b8ff: #c9b8ff;
}


/* ===== Thème « Sobre » (par défaut) : gris neutres, accent bleu doux, pas de halo ni de majuscules ===== */
:root:not([data-theme="arcade"]) {
  --bg-0: #121316;
  --bg-1: #18191c;
  --bg-2: #1e1f23;
  --bg-3: #2a2b30;
  --hover: #25262a;
  --active: #2d3038;
  --line: #2c2d32;
  --text: #ececef;
  --text-2: #c9cacf;
  --muted: #8e9098;
  --cyan: #6f8ff7;          /* couleur d'accent */
  --cyan-soft: #a6b8fb;
  --magenta: #a28bf5;
  --yellow: #e2b14d;
  --green: #3fbf7c;
  --red: #e5646f;
  --r-s: 6px;
  --r-m: 8px;
  --font-title: var(--font);
  --glow: 0;
  --track: .15;
  --caps: none;
  --fx-text: none;
  --speak: var(--green);
  --on-accent-0a0a12: #ffffff;
  --on-accent-04040a: #ffffff;
  --c-06060c: #101114;
  --c-04040a: #0e0f11;
  --bg-raise-12121f: #222327;
  --bg-raise-10101c: #222327;
  --line-strong: #36383e;
  --btn-hover: #33353b;
  --bot: #9d8af5;
  --bot-2: #8b6cf0;
  --bot-3: #6f52d9;
  --bot-text-e9d5ff: #e4ddff;
  --bot-text-d8b4fe: #c9bcfb;
  --bot-text-f3e8ff: #f1edff;
  --bot-text-e0b0ff: #d9cdfc;
  --bot-text-c9b8ff: #c9bcfb;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-2);
  color: var(--text-2);
  font: 15px/1.4 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: var(--bg-3); border: 0; border-radius: var(--r-s); padding: 8px 14px; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s, transform .1s var(--ease);
}
button:hover { background: var(--btn-hover); }
button:active:not(:disabled) { transform: scale(.96); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
button.primary {
  background: var(--cyan); color: var(--on-accent-04040a); font-weight: 700; font-family: var(--font-title); letter-spacing: calc(.04em * var(--track, 1));
}
button.primary:hover { background: var(--cyan-soft); box-shadow: 0 0 18px color-mix(in srgb, var(--cyan) calc(33.3333% * var(--glow)), transparent); }
button.danger { background: var(--red); color: var(--on-accent-0a0a12); font-weight: 700; }
button:disabled { opacity: .5; cursor: default; }
button.with-icon { display: inline-flex; align-items: center; gap: 8px; }
input, select, textarea {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 13.3333%, transparent); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.ico { display: block; flex: none; }

.icon-btn {
  background: transparent; padding: 0; width: 34px; height: 34px; border-radius: var(--r-s);
  display: inline-grid; place-items: center; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.off { color: var(--red); background: color-mix(in srgb, var(--red) 10.1961%, transparent); }
.icon-btn.danger { background: transparent; color: var(--red); }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--red) 14.902%, transparent); }

.avatar {
  width: 40px; height: 40px; border-radius: var(--r-avatar); flex: none; display: grid; place-items: center;
  color: var(--on-accent-0a0a12); font-weight: 700; font-family: var(--font-title); font-size: 17px; user-select: none; position: relative;
  transition: box-shadow .15s;
}
.avatar.small { width: 32px; height: 32px; font-size: 14px; }
.avatar.tiny { width: 22px; height: 22px; font-size: 11px; }
.avatar .dot {
  position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); border: 3px solid var(--bg-1); box-sizing: border-box; z-index: 1;
}
.speaking .avatar, .avatar.speaking { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--speak), 0 0 14px color-mix(in srgb, var(--speak) calc(53.3333% * var(--glow)), transparent); }

/* ===== Connexion ===== */
#auth {
  height: 100%; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden;
  background:
    linear-gradient(color-mix(in srgb, var(--cyan) 5.098%, transparent) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, color-mix(in srgb, var(--cyan) 5.098%, transparent) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg-0);
}
.auth-card {
  position: relative; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 32px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cyan) 7.8431%, transparent), 0 20px 60px #000a; animation: rise .35s var(--ease);
}
.auth-logo { display: flex; justify-content: center; animation: glow 3s ease-in-out infinite; color: var(--cyan); }
.auth-logo circle { fill: var(--magenta); }
.auth-card h1 {
  margin: 0; text-align: center; color: var(--text); font: 700 26px var(--font-title); letter-spacing: calc(.06em * var(--track, 1)); text-transform: var(--caps, uppercase);
}
.auth-card label {
  display: flex; flex-direction: column; gap: 6px; font: 600 12px var(--font-title);
  text-transform: var(--caps, uppercase); color: var(--muted); letter-spacing: calc(.12em * var(--track, 1));
}
.auth-card label input { font: 400 16px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); }
.auth-card button[type=submit] { padding: 12px; margin-top: 4px; text-transform: var(--caps, uppercase); }
.tabs { display: flex; gap: 4px; background: var(--bg-0); padding: 4px; border-radius: var(--r-m); border: 1px solid var(--line); }
.tabs button { flex: 1; background: transparent; padding: 8px; font-family: var(--font-title); letter-spacing: calc(.06em * var(--track, 1)); color: var(--muted); }
.tabs button.active { background: var(--active); color: var(--cyan-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 33.3333%, transparent); }
#auth:not(.register) .register-only { display: none; }
.error { color: var(--red); font-size: 14px; margin: 0; min-height: 1.2em; }
.hint { color: var(--muted); font-size: 13px; }

/* ===== Mise en page ===== */
#app { display: grid; grid-template-columns: var(--side-w, 322px) 1fr 240px; height: 100vh; animation: fade .3s ease; }
#app.no-members { grid-template-columns: var(--side-w, 322px) 1fr; }
#app.no-members #members { display: none; }

#sidebar { display: flex; min-height: 0; border-right: 1px solid var(--line); position: relative; }
/* Poignée pour élargir la colonne des salons */
.side-resizer { position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; cursor: col-resize; z-index: 20; }
.side-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: var(--cyan); opacity: 0; transition: opacity .15s; }
.side-resizer:hover::after, body.resizing-side .side-resizer::after { opacity: .7; }
body.resizing-side { cursor: col-resize; user-select: none; }
body.resizing-side * { cursor: col-resize !important; }
@media (max-width: 700px) { .side-resizer { display: none; } }
#sidePane { background: var(--bg-1); display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; position: relative; }

/* ===== Barre des serveurs (à gauche) ===== */
#rail {
  width: 72px; flex: none; background: var(--c-06060c); display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 12px 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
#rail::-webkit-scrollbar { display: none; }
.rail-item { position: relative; width: 48px; height: 48px; flex: none; }
.rail-btn {
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 24px; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: var(--bg-2); color: var(--text);
  font: 700 16px var(--font); letter-spacing: 0; text-transform: none;
  transition: border-radius .18s var(--ease, ease), background .18s, color .18s;
}
.rail-btn.small-text { font-size: 13px; }
.rail-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-btn .avatar { width: 48px; height: 48px; font-size: 18px; border-radius: 0; }
.rail-item.active .rail-btn, .rail-btn:focus-visible { border-radius: 16px; }
.rail-item:not(.rail-home):not(.rail-add).active .rail-btn { background: var(--cyan); color: var(--on-accent-0a0a12); }
.rail-home .rail-btn svg { width: 30px; height: 30px; }
.rail-home.active .rail-btn { background: color-mix(in srgb, var(--cyan) 24%, var(--bg-2)); }
.rail-add .rail-btn { color: var(--cyan); }
.rail-pill {
  position: absolute; left: -12px; top: 50%; width: 4px; height: 0; margin-top: 0; border-radius: 0 4px 4px 0;
  background: var(--text); transition: height .18s, margin-top .18s; pointer-events: none;
}
.rail-item.unread .rail-pill { height: 8px; margin-top: -4px; }
.rail-item.active .rail-pill { height: 40px; margin-top: -20px; }
.rail-badge {
  position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px var(--font); text-align: center;
  box-shadow: 0 0 0 3px var(--c-06060c); pointer-events: none;
}
.rail-voice {
  position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green);
  color: #0e1a12; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--c-06060c); pointer-events: none;
}
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--line-strong); flex: none; }
@media (hover: hover) {
  .rail-btn:hover { border-radius: 16px; }
  .rail-item:not(.rail-home):not(.rail-add) .rail-btn:hover { background: var(--cyan); color: var(--on-accent-0a0a12); }
  .rail-item:not(.active) .rail-btn:hover ~ .rail-pill, .rail-item:not(.active):hover .rail-pill { height: 20px; margin-top: -10px; }
  .rail-add .rail-btn:hover { background: var(--cyan); color: var(--on-accent-0a0a12); }
  .rail-home:not(.active) .rail-btn:hover { background: color-mix(in srgb, var(--cyan) 24%, var(--bg-2)); }
}
#railTip {
  position: fixed; z-index: 60; padding: 7px 11px; border-radius: var(--r-s); background: var(--c-04040a); color: var(--text);
  font: 600 14px var(--font); box-shadow: 0 6px 20px #0008; pointer-events: none; white-space: nowrap; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; transform: translateY(-50%); animation: fade .12s ease;
}
#railTip::before {
  content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  background: var(--c-04040a); transform: rotate(45deg);
}
#railTip.hidden { display: none; }

/* Accueil (messages privés) et serveur sans salon */
.empty-view { flex: 1; display: grid; place-items: center; padding: 24px; min-height: 0; }
.empty-view.hidden { display: none; }
.empty-card { max-width: 380px; text-align: center; }
.empty-card h2 { margin: 14px 0 6px; font: 700 20px var(--font-title); color: var(--text); }
.empty-card p { margin: 0; line-height: 1.5; }
.empty-logo svg { width: 64px; height: 64px; }
.home-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 6px 16px; }
.home-head .name { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: calc(.04em * var(--track, 1)); text-transform: var(--caps, uppercase); }
.home-empty { padding: 6px 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Ajouter un serveur, paramètres du serveur */
.add-server { display: grid; gap: 12px; }
.add-server form { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-m); background: var(--bg-3); border: 1px solid var(--line); }
.add-server h3 { margin: 0; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.add-server .row { display: flex; gap: 8px; }
.add-server .row input { flex: 1; min-width: 0; }
.add-server .error { min-height: 0; }
.srv-settings { display: grid; gap: 14px; margin-top: 6px; }
.srv-icon-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.srv-icon-row .rail-btn { width: 72px; height: 72px; border-radius: 22px; font-size: 24px; cursor: default; }
.srv-danger { padding-top: 12px; border-top: 1px solid var(--line); }
.member .crown.srv-owner, .member .crown.srv-owner svg { color: var(--yellow); }
#serverHeader {
  height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; flex: none;
  border-bottom: 1px solid var(--line); color: var(--cyan);
  font: 700 17px var(--font-title); letter-spacing: calc(.06em * var(--track, 1)); text-transform: var(--caps, uppercase);
  transition: background .15s;
}
#serverHeader:hover { background: var(--hover); }
#serverName { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { display: grid; transition: transform .2s var(--ease); }
#serverHeader.open .chevron { transform: rotate(180deg); }

.menu {
  position: absolute; z-index: 20; background: var(--c-06060c); border: 1px solid var(--line); border-radius: var(--r-m); padding: 6px;
  min-width: 220px; box-shadow: 0 12px 30px #000c, 0 0 0 1px color-mix(in srgb, var(--cyan) 6.2745%, transparent); display: flex; flex-direction: column;
  transform-origin: top center; animation: drop .16s var(--ease);
}
#serverMenu { top: 60px; left: 10px; right: 10px; }
.menu button {
  background: transparent; text-align: left; padding: 9px 10px; font-size: 14px; border-radius: var(--r-s);
  display: flex; align-items: center; gap: 10px; color: var(--text-2);
}
.menu button .ico { color: var(--muted); transition: color .15s; }
.menu button:hover { background: var(--active); color: var(--cyan-soft); }
.menu button:hover .ico { color: var(--cyan); }
.menu button.danger-text, .menu button.danger-text .ico { color: var(--red); }
.menu button.danger-text:hover { background: color-mix(in srgb, var(--red) 13.3333%, transparent); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; width: auto; }

#channelList { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
#channelList::-webkit-scrollbar, #members::-webkit-scrollbar { width: 6px; }
#channelList::-webkit-scrollbar-thumb, #members::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.category {
  display: flex; align-items: center; gap: 4px; padding: 16px 6px 4px; cursor: pointer; user-select: none;
  font: 600 11.5px var(--font-title); text-transform: var(--caps, uppercase); letter-spacing: calc(.14em * var(--track, 1)); color: var(--muted);
  transition: color .15s;
}
.category:hover { color: var(--text); }
.category .arrow { display: grid; transition: transform .2s var(--ease); }
.category.collapsed .arrow { transform: rotate(-90deg); }
.category .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
/* Effets de survol réservés aux souris : sur iPhone, un élément qui apparaît au survol oblige à appuyer deux fois. */
@media (hover: hover) { .category:hover .admin-actions, .channel:hover .admin-actions { opacity: 1; } }
/* Écran tactile : boutons admin visibles sur le salon ouvert seulement. */
@media (hover: none) { .channel.active .admin-actions { opacity: 1; } }
.admin-actions button { padding: 3px; background: transparent; color: var(--muted); display: grid; }
.admin-actions button:hover { background: var(--bg-3); color: var(--cyan); }

.channel {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 1px 0; border-radius: var(--r-s);
  color: var(--muted); cursor: pointer; position: relative; transition: background .15s, color .15s, box-shadow .15s;
}
.channel .name { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .15s var(--ease); }
@media (hover: hover) {
  .channel:hover { background: var(--hover); color: var(--text-2); }
  .channel:hover .name { transform: translateX(2px); }
}
.channel:active { background: var(--hover); }
.channel.active { background: var(--active); color: var(--cyan-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 33.3333%, transparent); }
.channel.unread { color: var(--text); font-weight: 600; }
.channel.unread::after {
  content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--cyan); flex: none;
  box-shadow: 0 0 8px var(--cyan);
}
.channel.unread.fresh::after { animation: blink 1.6s ease-in-out 3; }
.channel .icon { display: grid; opacity: .85; flex: none; }
.voice-members { padding-left: 28px; }
.voice-member {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--r-s); color: var(--muted); font-size: 14px;
}
/* Animations seulement quand quelque chose apparaît vraiment (pas à chaque redessin de la liste). */
.voice-member.fresh { animation: slide-in .22s var(--ease); }
.voice-member:hover { background: var(--hover); color: var(--text-2); }
.voice-member .vm-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-member .vm-icons { display: flex; gap: 4px; align-items: center; }
.state-off { color: var(--red); display: grid; }
.live {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--magenta); color: var(--on-accent-0a0a12); font: 700 10px var(--font-title); padding: 2px 6px; border-radius: 3px; letter-spacing: calc(.08em * var(--track, 1));
}
.live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--bg-2); animation: blink 1.2s ease-in-out infinite;
}

#voicePanel {
  display: flex; align-items: center; gap: 2px; padding: 8px 8px 8px 14px; border-top: 1px solid var(--line);
  background: var(--bg-0); flex: none; animation: rise .25s var(--ease);
}
.vp-info { flex: 1; min-width: 0; }
.vp-status { color: var(--green); font: 600 13px var(--font-title); letter-spacing: calc(.04em * var(--track, 1)); display: flex; align-items: center; gap: 6px; }
.vp-status::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2s ease-in-out infinite; }
.vp-channel { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.vp-channel:hover { color: var(--cyan); }

#userPanel {
  height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; background: var(--bg-0); flex: none;
  border-top: 1px solid var(--line);
}
.up-name { flex: 1; min-width: 0; font-weight: 700; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Zone centrale ===== */
#main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
#chanHeader {
  height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line); color: var(--text); font: 700 17px var(--font-title); letter-spacing: calc(.04em * var(--track, 1));
}
.chan-icon { color: var(--muted); display: grid; }
.spacer { flex: 1; }

#chatView { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
#messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; }
#messages::-webkit-scrollbar { width: 10px; }
#messages::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; border: 2px solid var(--bg-2); }
.welcome { padding: 16px 20px; margin-bottom: 8px; animation: fade .3s ease; }
.welcome .big {
  width: 68px; height: 68px; border-radius: var(--r-m); background: var(--active); color: var(--cyan);
  display: grid; place-items: center; margin-bottom: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 33.3333%, transparent), 0 0 24px color-mix(in srgb, var(--cyan) calc(13.3333% * var(--glow)), transparent);
}
.welcome h2 { color: var(--text); margin: 0 0 4px; font: 700 28px var(--font-title); letter-spacing: calc(.02em * var(--track, 1)); }
.welcome p { color: var(--muted); margin: 0; }
.load-more { display: block; margin: 0 auto 12px; font-size: 13px; }
.day-sep {
  display: flex; align-items: center; margin: 16px 20px 8px; color: var(--muted);
  font: 600 11.5px var(--font-title); letter-spacing: calc(.12em * var(--track, 1)); text-transform: var(--caps, uppercase);
}
.day-sep::before, .day-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.day-sep span { padding: 0 10px; }

.msg { display: grid; grid-template-columns: 64px 1fr; padding: 2px 48px 2px 0; position: relative; transition: background .12s; }
.msg:hover { background: var(--bg-raise-10101c); }
.msg.head { margin-top: 14px; }
.msg.new { animation: msg-in .22s var(--ease); }
.msg .gutter { display: flex; justify-content: center; padding-top: 2px; }
.msg .time-small { color: var(--muted); font-size: 10.5px; opacity: 0; padding-top: 4px; transition: opacity .12s; }
@media (hover: hover) { .msg:hover .time-small { opacity: 1; } }
.msg.touched .time-small { opacity: 1; }
.msg .meta { display: flex; align-items: baseline; gap: 8px; }
.msg .author { font: 700 15.5px var(--font-title); letter-spacing: calc(.02em * var(--track, 1)); }
.msg .time { color: var(--muted); font-size: 12px; }
.msg .content { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.msg .content.emoji-only { font-size: 44px; line-height: 1.2; }
.msg img.attachment {
  display: block; max-width: min(420px, 100%); max-height: 320px; border-radius: var(--r-m); margin: 6px 0 2px; cursor: zoom-in;
  background: var(--bg-1); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s;
}
.msg img.attachment:hover { border-color: var(--cyan); box-shadow: 0 0 18px color-mix(in srgb, var(--cyan) calc(20% * var(--glow)), transparent); }

/* ---------- Sondages (dans le salon) ---------- */
.poll { width: min(440px, 100%); margin-top: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 10px; }
.poll-q { font-weight: 700; font-size: 15.5px; color: var(--text); overflow-wrap: anywhere; padding: 0 4px; }
.poll-sub { font-size: 12px; color: var(--muted); margin: 3px 4px 8px; }
.poll-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .12s, border-color .12s;
}
button.poll-opt:hover { background: var(--hover); }
.poll-opt.me { border-color: color-mix(in srgb, var(--cyan) 45%, transparent); background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.poll.closed .poll-opt { cursor: default; }
.poll-em { width: 28px; flex: none; text-align: center; font-size: 20px; line-height: 1; }
.poll-mid { flex: 1; min-width: 0; }
.poll-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.poll-text { color: var(--text); overflow-wrap: anywhere; }
.poll-opt.me .poll-text { color: var(--cyan-soft); font-weight: 600; }
.poll-pct { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.poll-bar { height: 6px; border-radius: 999px; background: var(--bg-3); margin-top: 5px; overflow: hidden; }
.poll-bar i { display: block; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--text) 30%, transparent); transition: width .75s cubic-bezier(.22,1,.36,1), background .3s; position: relative; overflow: hidden; }
.poll-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-100%); animation: poll-sheen 1.1s .15s ease-out 1; }
@keyframes poll-sheen { to { transform: translateX(100%); } }
.poll-opt.bump-up { animation: poll-bump-up .7s ease-out; }
.poll-opt.bump-down { animation: poll-bump-down .5s ease-out; }
@keyframes poll-bump-up { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cyan) 55%, transparent); transform: scale(1.015); } 100% { box-shadow: 0 0 0 10px transparent; transform: scale(1); } }
@keyframes poll-bump-down { 0% { background: color-mix(in srgb, var(--text) 8%, transparent); } 100% { background: transparent; } }
.poll-faces .face-in { animation: face-in .45s cubic-bezier(.34,1.56,.64,1) both; }
.poll-faces .face-in.late { animation-delay: .35s; }
@keyframes face-in { 0% { opacity: 0; transform: scale(.2) translateY(6px); } 100% { opacity: 1; transform: none; } }
.poll-opt.win-pop .poll-em { animation: trophy-pop .8s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes trophy-pop { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .poll-bar i, .poll-bar i::after, .poll-opt, .poll-faces .avatar, .poll-em { animation: none !important; transition: none !important; } }
.poll-opt.me .poll-bar i { background: var(--cyan); }
.poll-opt.win .poll-text { color: var(--yellow); font-weight: 700; }
.poll-opt.win .poll-bar i { background: var(--yellow); }
.poll-faces { display: flex; align-items: center; flex: none; min-width: 20px; justify-content: flex-end; }
.poll-faces .avatar { width: 22px; height: 22px; font-size: 10px; margin-left: -7px; box-shadow: 0 0 0 2px var(--bg-2); }
.poll-faces .avatar:first-child { margin-left: 0; }
.poll-more { font-size: 11.5px; color: var(--muted); margin-left: 5px; }
.poll-foot { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.poll-foot span { margin-right: auto; }
.poll-link { background: none; border: 0; padding: 0; color: var(--cyan-soft); font-size: 12px; cursor: pointer; }
.poll-link:hover { text-decoration: underline; }

/* Liste des membres : pastille de couleur du rôle dans le titre de son groupe */
#members h3 .role-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
#composer.no-perm { opacity: .6; }

/* Ligne d'information : fin d'un sondage */
.msg.system-msg { display: flex; align-items: flex-start; gap: 10px; padding-top: 6px; padding-bottom: 6px; }
.sys-ic { width: 40px; flex: none; display: grid; place-items: center; color: var(--cyan); padding-top: 1px; }
.sys-text { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.sys-link { background: none; border: 0; padding: 0; margin-left: 4px; color: var(--cyan-soft); font-size: 13.5px; cursor: pointer; }
.sys-link:hover { text-decoration: underline; }
.sys-time { color: var(--muted); font-size: 11.5px; margin-left: 8px; }
.msg.system-msg .msg-actions { display: none; }

/* ---------- Fenêtre de création d'un sondage (formulaire + aperçu) ---------- */
dialog.poll-dialog { padding: 0; width: min(760px, calc(100vw - 32px)); max-width: none; }
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 330px); position: relative; padding: 0 !important; gap: 0 !important; }
.pd-left { padding: 22px; display: flex; flex-direction: column; min-width: 0; }
.pd-right { padding: 22px; background: var(--bg-0); border-left: 1px solid var(--line); }
.pd h2 { margin: 0 0 4px; }
.pd-cap { font: 700 11.5px var(--font-title); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 7px; }
.pd-right .pd-cap { margin-top: 2px; }
.pd-in { height: 44px; border-radius: 10px; padding: 0 14px; font-size: 15px; width: 100%; min-width: 0; box-sizing: border-box; }
.pd-opts { display: flex; flex-direction: column; gap: 7px; }
.pd-opt { display: flex; align-items: center; gap: 7px; }
.pd-em { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.pd-em.empty { color: var(--muted); font-size: 18px; }
.pd-em:hover { border-color: var(--cyan); }
.pd-x { width: 30px; height: 30px; flex: none; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.pd-x:hover { color: var(--red); background: var(--hover); }
.pd-opts.min .pd-x { visibility: hidden; }
.pd-add { margin-top: 7px; height: 42px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; cursor: pointer; }
.pd-add:hover { color: var(--text); border-color: var(--muted); }
.pd-add[hidden] { display: none; }
.pd-seg { display: flex; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.pd-seg button { flex: 1; border: 0; background: transparent; color: var(--text-2); padding: 8px 0; border-radius: 7px; font-size: 13.5px; cursor: pointer; }
.pd-seg button:hover { color: var(--text); }
.pd-seg button.on { background: var(--cyan); color: var(--on-accent-04040a); font-weight: 700; }
dialog label.pd-tg { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; font: 400 14.5px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; }
.pd-tg small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pd-sw { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; flex: none; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.pd-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: left .15s, background .15s; }
.pd-sw:checked { background: var(--cyan); border-color: var(--cyan); }
.pd-sw:checked::after { left: 21px; background: #fff; }
.pd-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }
.pd-actions { display: flex; gap: 10px; margin-top: 4px; }
.pd-cancel { height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; font-size: 14.5px; }
.pd-cancel:hover { color: var(--text); background: var(--hover); }
.pd-publish { flex: 1; height: 46px; border-radius: 10px; border: 0; background: var(--cyan); color: var(--on-accent-04040a); font: 700 15px var(--font); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.pd-publish:hover { background: var(--cyan-soft); }
.pd-publish:disabled { opacity: .6; }
.pd-preview .poll { width: 100%; margin: 0; }
.pd-hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 12px 2px 0; }
.pd-picker { position: absolute; z-index: 5; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; padding: 8px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px #0008; }
.pd-picker button { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 6px; font-size: 19px; cursor: pointer; }
.pd-picker button:hover { background: var(--hover); }
.pd-picker .pd-picker-none { grid-column: 1 / -1; width: auto; height: 30px; font-size: 12.5px; color: var(--muted); }
.pd-picker.hidden { display: none; }
@media (max-width: 720px) { .pd { grid-template-columns: 1fr; } .pd-right { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- Aperçus des liens (carte : image en haut, texte dessous) ---------- */
.embeds { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; align-items: flex-start; }
.embed {
  --embed-color: var(--line);
  width: min(420px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.embed-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.embed-site { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.embed-site > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--embed-color); flex: none; }
.embed-fav { width: 14px; height: 14px; border-radius: 3px; flex: none; object-fit: contain; }
.embed-title { color: var(--text); font-weight: 600; font-size: 14.5px; line-height: 1.35; text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
a.embed-title:hover { text-decoration: underline; color: var(--cyan); }
.embed-desc { color: var(--text-2); font-size: 13px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.embed-desc.tweet-text { -webkit-line-clamp: 8; line-clamp: 8; white-space: pre-line; color: var(--text); font-size: 14px; }
.embed-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-3); cursor: zoom-in; }
.embed.with-thumb { flex-direction: row; align-items: flex-start; }
.embed.with-thumb .embed-body { flex: 1; }
.embed-thumb { width: 84px; height: 84px; margin: 12px 12px 12px 0; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-3); cursor: zoom-in; }
.msg img.attachment.embed-image { margin-top: 0; }
/* YouTube : miniature avec bouton de lecture, puis le lecteur à la même place */
.embed-yt { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
.embed-yt .embed-cover { height: 100%; cursor: pointer; transition: filter .15s; }
.embed-yt:hover .embed-cover { filter: brightness(.85); }
.embed-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 64px; height: 44px; border: 0; border-radius: 12px;
  background: #ff0033e6; color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .15s;
}
.embed-yt:hover .embed-play { transform: scale(1.08); background: #ff0033; }
.embed-play svg { fill: currentColor; stroke: none; }
.embed-youtube { width: min(480px, 100%); }
/* X / Twitter */
.embed-author { display: flex; align-items: center; gap: 10px; }
.embed-author-av { width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover; }
.embed-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.embed-who .embed-title { -webkit-line-clamp: 1; line-clamp: 1; }
.embed-handle { color: var(--muted); font-size: 12.5px; }
.embed-x { font-size: 18px; color: var(--text); opacity: .8; }
.embed-media { position: relative; }
.embed-media .embed-cover { aspect-ratio: auto; max-height: 360px; object-fit: cover; }
.embed-badge { position: absolute; left: 10px; bottom: 10px; background: #000b; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.embed-foot { padding: 8px 12px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.msg .msg-actions {
  position: absolute; right: 16px; top: -14px; display: flex; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 2px;
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .12s, transform .12s var(--ease);
}
@media (hover: hover) { .msg:hover .msg-actions { opacity: 1; transform: none; pointer-events: auto; } }
.msg .msg-actions button { background: transparent; padding: 5px 7px; color: var(--muted); display: grid; }
.msg .msg-actions button:hover { background: color-mix(in srgb, var(--red) 13.3333%, transparent); color: var(--red); }

#composerWrap { padding: 0 20px 6px; flex: none; }
#composer {
  display: flex; align-items: flex-end; gap: 4px; background: var(--bg-raise-12121f); border-radius: var(--r-m); padding: 6px;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .2s;
}
#composer:focus-within { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 0 3px color-mix(in srgb, var(--cyan) 10.1961%, transparent); }
#composer textarea {
  flex: 1; background: transparent; border: 0; box-shadow: none; resize: none; max-height: 40vh; padding: 7px 4px; line-height: 1.4;
}
#composer textarea:focus { box-shadow: none; outline: none; }
#composer .icon-btn { color: var(--text-2); }
.send-btn { color: var(--cyan) !important; }
.send-btn:hover { background: var(--active) !important; }
#pendingImage {
  background: var(--bg-raise-12121f); border-radius: var(--r-m) var(--r-m) 0 0; padding: 12px; display: flex; align-items: flex-start; gap: 8px;
  box-shadow: inset 0 0 0 1px var(--line-strong); animation: rise .2s var(--ease);
}
#pendingImage:not(.hidden) ~ #composer { border-radius: 0 0 var(--r-m) var(--r-m); }
#pendingImage img { max-height: 140px; max-width: 240px; border-radius: var(--r-s); }
#typing { height: 22px; font-size: 12.5px; color: var(--muted); padding: 3px 4px; display: flex; align-items: center; gap: 4px; }
#typing b { font-weight: 700; color: var(--text-2); }
.typing-dots { display: inline-flex; gap: 3px; margin-right: 4px; }
.typing-dots i { width: 4px; height: 4px; border-radius: 1px; background: var(--cyan); animation: bounce 1s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
#dropZone {
  position: absolute; inset: 8px; border: 2px dashed var(--cyan); border-radius: var(--r-m); background: color-mix(in srgb, var(--bg-2) 90.9804%, transparent);
  display: grid; place-items: center; font: 700 22px var(--font-title); letter-spacing: calc(.06em * var(--track, 1)); color: var(--cyan);
  z-index: 5; pointer-events: none; animation: fade .12s ease;
}

/* ===== Vue vocale ===== */
#voiceView { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #06060b; }
#stage {
  flex: 1; min-height: 0; padding: 12px; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); grid-auto-rows: minmax(0, 1fr);
}
#stage:empty, #stage.empty { display: none; }
.tile[hidden] { display: none !important; }
.tile.multi { cursor: zoom-in; }
.tile.multi:hover { border-color: color-mix(in srgb, var(--cyan) 46.6667%, transparent); }
.tile .unview {
  position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; padding: 0; display: none; place-items: center;
  background: color-mix(in srgb, var(--bg-2) 85.098%, transparent); color: var(--text-2); border-radius: var(--r-s);
}
.tile.multi .unview { display: grid; }
.tile .unview:hover { background: var(--red); color: var(--on-accent-0a0a12); }
#voiceParticipants { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-content: center; padding: 12px; }
#stage:empty + #voiceParticipants, #stage.empty + #voiceParticipants { flex: 1; }
.vcard {
  width: 220px; height: 130px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-m);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.vcard.fresh { animation: pop .25s var(--ease); }
.vcard.speaking { border-color: var(--speak); box-shadow: 0 0 0 1px var(--speak), 0 0 22px color-mix(in srgb, var(--speak) calc(26.6667% * var(--glow)), transparent); }
.vcard.speaking .avatar { box-shadow: none; }
.vcard .avatar { width: 64px; height: 64px; font-size: 26px; }
/* Paramètres */
#settingsDialog .settings-link { align-self: flex-start; padding: 0; }
.link-btn { background: transparent; color: var(--muted); }
.link-btn:hover { color: var(--cyan); text-decoration: underline; background: transparent; }
.dialog-actions button.danger-link { margin-right: auto; background: transparent; color: var(--red); padding-left: 0; }
.dialog-actions button.danger-link:hover { text-decoration: underline; background: transparent; }

/* Portraits cliquables quand la personne partage son écran */
.vcard.clickable { cursor: pointer; }
.vcard.clickable:hover { border-color: color-mix(in srgb, var(--magenta) 53.3333%, transparent); }
.vcard.viewing { border-color: var(--magenta); box-shadow: 0 0 0 1px var(--magenta), 0 0 18px color-mix(in srgb, var(--magenta) calc(20% * var(--glow)), transparent); }
.vcard.clickable:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.vcard .add-view {
  position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; font: 700 10px var(--font-title); letter-spacing: calc(.05em * var(--track, 1)); text-transform: var(--caps, uppercase);
  background: var(--bg-3); color: var(--muted); border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line);
  transition: color .15s, box-shadow .15s;
}
.vcard .add-view:hover { color: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--cyan); }

/* Nom centré sur une ligne, badges (EN DIRECT, micro coupé) en dessous : plus de décalage. */
.vcard .vc-name {
  font: 600 14px var(--font-title); letter-spacing: calc(.03em * var(--track, 1)); color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: calc(100% - 16px);
}
.vcard .vc-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard .vc-name .vm-icons:empty { display: none; }
.vcard .live { white-space: nowrap; }
.vcard.me .vc-label { color: var(--cyan-soft); } /* ta propre carte : ton nom en cyan */
#stage:not(:empty):not(.empty) + #voiceParticipants .vcard { width: 170px; height: 96px; gap: 6px; }
#stage:not(:empty):not(.empty) + #voiceParticipants .vcard .avatar { width: 40px; height: 40px; font-size: 16px; }
#voiceJoin { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-2); gap: 12px; }
#voiceControls { display: flex; justify-content: center; gap: 8px; padding: 12px; flex: none; }
#voiceControls button {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bg-3); border-radius: var(--r-m); padding: 11px 16px;
  font-weight: 600; box-shadow: inset 0 0 0 1px var(--line);
}
#voiceControls button:hover { box-shadow: inset 0 0 0 1px var(--cyan); color: var(--cyan-soft); }
#voiceControls button.off { background: color-mix(in srgb, var(--red) 13.3333%, transparent); color: var(--red); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 40%, transparent); }
#voiceControls button.danger { background: var(--red); color: var(--on-accent-0a0a12); box-shadow: none; }
#voiceControls button.danger:hover { box-shadow: 0 0 18px color-mix(in srgb, var(--red) calc(40% * var(--glow)), transparent); color: var(--on-accent-0a0a12); }
#voiceControls button.sharing { background: var(--magenta); color: var(--on-accent-0a0a12); box-shadow: 0 0 18px color-mix(in srgb, var(--magenta) calc(33.3333% * var(--glow)), transparent); }

.tile {
  position: relative; background: #000; border-radius: var(--r-m); overflow: hidden; min-height: 0; display: flex;
  border: 1px solid var(--line); animation: fade .3s ease;
}
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile .label, .tile .stats {
  position: absolute; left: 8px; background: color-mix(in srgb, var(--bg-2) 85.098%, transparent); padding: 4px 9px; border-radius: var(--r-s); font-size: 12.5px; pointer-events: none;
}
.tile .label { bottom: 8px; font: 600 13px var(--font-title); color: #fff; display: flex; align-items: center; gap: 6px; letter-spacing: calc(.03em * var(--track, 1)); }
.tile:not(.local) .label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); animation: blink 1.2s ease-in-out infinite; }
body:not(.show-stats) .tile .stats { display: none; }
.tile .stats { top: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; white-space: pre; color: var(--cyan-soft); }
.tile .fs {
  position: absolute; right: 8px; bottom: 8px; padding: 5px 10px; font-size: 13px; background: color-mix(in srgb, var(--bg-2) 85.098%, transparent);
  display: inline-flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .15s;
}
@media (hover: hover) { .tile:hover .fs { opacity: 1; } }
.tile.local { border: 1px dashed var(--line); }
.tile:fullscreen { border-radius: 0; border: 0; }

/* ===== Membres ===== */
#members { background: var(--bg-1); overflow-y: auto; padding: 8px 8px 16px; border-left: 1px solid var(--line); }
#members h3 { font: 600 11.5px var(--font-title); text-transform: var(--caps, uppercase); color: var(--muted); margin: 18px 8px 6px; letter-spacing: calc(.14em * var(--track, 1)); }
.member { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: var(--r-s); transition: background .12s; }
.member:hover { background: var(--hover); }
.member .m-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 600; }
.member.offline { opacity: .4; }
.member .crown { color: var(--yellow); display: grid; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--yellow) calc(40% * var(--glow)), transparent)); }

/* ===== Boîtes de dialogue ===== */
dialog {
  background: var(--bg-1); color: var(--text-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0;
  width: min(460px, 92vw); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cyan) 7.8431%, transparent), 0 20px 60px #000c;
}
dialog[open] { animation: pop .18s var(--ease); }
dialog::backdrop { background: color-mix(in srgb, var(--c-04040a) 80%, transparent); animation: fade .18s ease; }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { margin: 0; color: var(--text); font: 700 20px var(--font-title); letter-spacing: calc(.04em * var(--track, 1)); text-transform: var(--caps, uppercase); }
dialog label { display: flex; flex-direction: column; gap: 6px; font: 600 12px var(--font-title); text-transform: var(--caps, uppercase); color: var(--muted); letter-spacing: calc(.12em * var(--track, 1)); }
dialog label input, dialog label select { font: 400 15px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); }
.dialog-actions { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; }
.dialog-actions button:not(.primary) { background: transparent; color: var(--muted); }
.dialog-actions button:not(.primary):hover { color: var(--text); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; color: var(--text); }
.radio-row { display: flex; gap: 8px; }
.radio-row label {
  flex: 1; flex-direction: row; align-items: center; gap: 8px; background: var(--bg-3); padding: 11px; border-radius: var(--r-s);
  cursor: pointer; font: 600 14px var(--font-title); letter-spacing: calc(.06em * var(--track, 1)); color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, background .15s;
}
.radio-row label:has(input:checked) { background: var(--active); box-shadow: inset 0 0 0 1px var(--cyan); color: var(--cyan-soft); }
.radio-row input { accent-color: var(--cyan); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.settings-grid label { min-width: 0; }
.settings-grid select { width: 100%; min-width: 0; text-overflow: ellipsis; }
#qualityDialog { width: min(640px, 94vw); }
dialog { overflow-x: hidden; }
@media (max-width: 520px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }

/* ===== Panneau de partage d'écran ===== */
#shareDialog { width: min(920px, 95vw); padding: 0; overflow: hidden; }
.choice-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.choice-set legend {
  padding: 0; margin-bottom: 8px; font: 600 12px var(--font-title); letter-spacing: calc(.12em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--muted);
}
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-grid.three { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
dialog label.choice {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer;
  padding: 14px; border-radius: var(--r-m); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line);
  text-transform: none; letter-spacing: 0; font: 400 14px var(--font); color: var(--text-2);
  transition: box-shadow .15s, background .15s, transform .12s var(--ease);
}
dialog label.choice.compact { padding: 11px 12px; }
dialog label.choice:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 46.6667%, transparent); }
dialog label.choice:active { transform: scale(.98); }
dialog label.choice:has(input:checked) { background: var(--active); box-shadow: inset 0 0 0 1px var(--cyan), 0 0 18px color-mix(in srgb, var(--cyan) calc(13.3333% * var(--glow)), transparent); }
dialog label.choice:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-icon { color: var(--muted); margin-bottom: 6px; transition: color .15s; }
.choice:has(input:checked) .choice-icon { color: var(--cyan); }
.choice-title { font: 700 14.5px var(--font-title); letter-spacing: calc(.03em * var(--track, 1)); color: var(--text); }
.choice:has(input:checked) .choice-title { color: var(--cyan-soft); }
.choice-sub { font-size: 12.5px; color: var(--muted); }
.choice-set .hint { margin: 2px 0 0; }
.choice-set .hint b { color: var(--text-2); }

.toggles { display: flex; flex-direction: column; gap: 10px; }
dialog label.toggle {
  flex-direction: row; align-items: center; gap: 12px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font: 400 14px var(--font); color: var(--text-2);
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track {
  flex: none; width: 40px; height: 22px; border-radius: 11px; background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line);
  position: relative; transition: background .18s, box-shadow .18s;
}
.toggle .track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); transition: transform .18s var(--ease), background .18s;
}
.toggle input:checked + .track { background: var(--active); box-shadow: inset 0 0 0 1px var(--cyan); }
.toggle input:checked + .track::after { transform: translateX(18px); background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.toggle input:focus-visible + .track { outline: 2px solid var(--cyan); outline-offset: 2px; }
.toggle b { display: block; color: var(--text); font-weight: 600; }
.toggle small { display: block; color: var(--muted); font-size: 12.5px; }

button.live-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--magenta); color: var(--on-accent-0a0a12); }
button.live-btn:hover { background: var(--magenta); box-shadow: 0 0 20px color-mix(in srgb, var(--magenta) calc(40% * var(--glow)), transparent); }
.dialog-actions .link-btn { margin-right: auto; background: transparent; color: var(--muted); padding-left: 0; }
.dialog-actions .link-btn:hover { color: var(--cyan); text-decoration: underline; }

/* Sélecteur d'écran intégré (application de bureau) */
.source-tabs { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-tabs [role=tablist] { display: flex; gap: 4px; background: var(--bg-0); padding: 3px; border-radius: var(--r-m); border: 1px solid var(--line); }
.source-tabs [role=tab] { background: transparent; padding: 6px 14px; font: 600 13px var(--font-title); letter-spacing: calc(.06em * var(--track, 1)); color: var(--muted); }
.source-tabs [role=tab][aria-selected=true] { background: var(--active); color: var(--cyan-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 33.3333%, transparent); }
.source-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
  max-height: 290px; overflow-y: auto; padding: 2px; margin-top: 4px;
}
.source-empty { grid-column: 1 / -1; text-align: center; padding: 30px 0; margin: 0; }
dialog label.source {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; cursor: pointer; border-radius: var(--r-m);
  background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line); text-transform: none; letter-spacing: 0;
  font: 500 13px var(--font); color: var(--text-2); transition: box-shadow .15s, transform .12s var(--ease); animation: pop .2s var(--ease);
}
dialog label.source:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 46.6667%, transparent); }
dialog label.source:has(input:checked) { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 18px color-mix(in srgb, var(--cyan) calc(20% * var(--glow)), transparent); background: var(--active); }
dialog label.source:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.source input { position: absolute; opacity: 0; pointer-events: none; }
.source-thumb {
  aspect-ratio: 16 / 9; border-radius: var(--r-s); background: #000; overflow: hidden; display: grid; place-items: center; color: var(--muted);
}
.source-thumb img { width: 100%; height: 100%; object-fit: contain; }
.source-name { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 2px 2px; }
.source-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source:has(input:checked) .source-name { color: var(--cyan-soft); }
.source-icon { width: 16px; height: 16px; flex: none; }

dialog label.choice .reco {
  position: absolute; top: 8px; right: 8px; font: 700 9.5px var(--font-title); letter-spacing: calc(.08em * var(--track, 1)); text-transform: var(--caps, uppercase);
  color: var(--on-accent-0a0a12); background: var(--green); padding: 2px 6px; border-radius: 3px;
}
dialog label.choice.disabled { opacity: .45; cursor: not-allowed; box-shadow: inset 0 0 0 1px var(--line); }

@media (max-width: 520px) { .choice-grid, .choice-grid.three { grid-template-columns: minmax(0, 1fr); } }

/* ===== Divers ===== */
#lightbox {
  position: fixed; inset: 0; background: color-mix(in srgb, var(--c-04040a) 90.1961%, transparent); display: grid; place-items: center; z-index: 50; cursor: zoom-out;
  animation: fade .15s ease;
}
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: var(--r-m); animation: pop .2s var(--ease); }
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  background: var(--c-06060c); color: var(--text); padding: 10px 16px; border-radius: var(--r-s); max-width: 440px;
  border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--cyan), 0 10px 30px #000c; animation: drop .2s var(--ease);
}
.toast.warn { box-shadow: inset 3px 0 0 var(--yellow), 0 10px 30px #000c; }
.toast.err { box-shadow: inset 3px 0 0 var(--red), 0 10px 30px #000c; }

/* ===== Animations (légères : opacité et déplacements uniquement) ===== */
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-6px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }
@keyframes glow { 50% { opacity: .75; } }

/* Respecte le réglage système « réduire les animations ». */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 900px) {
  #app, #app.no-members { grid-template-columns: min(var(--side-w, 282px), 45vw) 1fr; }
  #members { display: none; }
}

/* ===== Pas de sélection de texte sur l'interface (seuls les messages restent sélectionnables) ===== */
#sidebar, #members, #chanHeader, #voiceView, #voiceControls, .tile, .vcard, .menu, #serverHeader, #userPanel, #voicePanel,
dialog label.choice, dialog label.source, .toggle, .tabs, #auth .tabs {
  -webkit-user-select: none; user-select: none;
}
.tile video, .source-thumb img, .msg img.attachment { -webkit-user-drag: none; }
.msg .content { -webkit-user-select: text; user-select: text; }

/* ===== Glisser-déposer des salons et catégories ===== */
.channel[draggable=true], .category[draggable=true] { cursor: grab; }
.channel[draggable=true]:active, .category[draggable=true]:active { cursor: grabbing; }
.dragging { opacity: .35; }
.channel.drop-before { box-shadow: inset 0 2px 0 var(--cyan); }
.channel.drop-after { box-shadow: inset 0 -2px 0 var(--cyan); }
.category.drop-before { box-shadow: inset 0 2px 0 var(--cyan); }
.category.drop-after { box-shadow: inset 0 -2px 0 var(--cyan); }
.category.drop-into { background: var(--active); color: var(--cyan-soft); border-radius: var(--r-s); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 46.6667%, transparent); }
.drop-top { height: 0; transition: height .12s; border-radius: var(--r-s); }
#channelList.dragging-channel .drop-top { height: 14px; margin-bottom: 2px; }
.drop-top.drop-into { box-shadow: inset 0 2px 0 var(--cyan); background: color-mix(in srgb, var(--cyan) 6.2745%, transparent); }

/* ===== Photos de profil ===== */
.avatar.has-img { background: var(--bg-3); }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* Carte « moi » en bas à gauche : ouvre le profil */
#meCard {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; margin-left: -4px;
  background: transparent; border-radius: var(--r-m); text-align: left;
}
#meCard:hover { background: var(--hover); }
#meCard .up-name { flex: 1; }

/* ===== Fenêtre Paramètres ===== */
dialog#options { width: min(920px, 95vw); height: min(640px, 90vh); padding: 0; overflow: hidden; }
dialog#srvSettings { width: min(1120px, 96vw); height: min(760px, 92vh); padding: 0; overflow: hidden; max-width: none; }
dialog#srvSettings .opt-content { padding: 0; display: flex; overflow: hidden; }
dialog#srvSettings .ss-body { flex: 1; min-width: 0; min-height: 0; height: 100%; display: flex; overflow: hidden; }
dialog#srvSettings .ss-roles { min-height: 0; height: 100%; }
dialog#srvSettings .opt-close { position: absolute; z-index: 2; background: var(--bg-2); border-radius: 50%; box-shadow: 0 0 0 6px var(--bg-2); }
dialog#srvSettings .ss-editor > h3 { padding-right: 48px; }
dialog#srvSettings .ss-body > .opt-pane { padding: 28px 36px; overflow-y: auto; flex: 1; max-width: 760px; }
.ss-card { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r-m); background: var(--bg-0); border: 1px solid var(--line); }
.ss-card b { display: block; font-size: 16px; color: var(--text); }
.ss-card small { color: var(--muted); }
.ss-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ss-roles { display: flex; flex: 1; min-width: 0; }
.ss-role-list { width: 260px; flex: none; border-right: 1px solid var(--line); padding: 24px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.ss-role-list h3, .ss-editor h3 { margin: 0 0 4px; font: 700 18px var(--font-title); color: var(--text); text-transform: var(--caps, uppercase); letter-spacing: calc(.04em * var(--track, 1)); }
.ss-role-list .hint { margin: 0 4px 10px; font-size: 12.5px; }
.ss-role { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 14px; text-align: left; border: 1px solid transparent; }
.ss-role:hover { background: var(--hover); }
.ss-role.on { background: var(--active); color: var(--text); }
.ss-role.over { border-color: var(--cyan); }
.ss-role.dragging { opacity: .4; }
.ss-role .grip { width: 8px; color: var(--muted); font-size: 11px; letter-spacing: -2px; cursor: grab; }
.ss-role .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.ss-role .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-role .n { color: var(--muted); font-size: 12px; }
.ss-role.locked .nm { opacity: .75; }
.ss-new-role { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px dashed var(--line); border-radius: 8px; padding: 9px; background: transparent; color: var(--muted); }
.ss-new-role:hover { color: var(--text); border-color: var(--muted); }
.ss-editor { flex: 1; min-width: 0; padding: 24px 32px 32px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ss-locked { color: var(--yellow) !important; }
.ss-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 6px 0 10px; }
.ss-tabs button { background: none; border: 0; padding: 8px 0; color: var(--muted); font-size: 14px; border-radius: 0; }
.ss-tabs button.on { color: var(--text); box-shadow: inset 0 -2px var(--cyan); }
.ss-row2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; margin-bottom: 6px; }
.ss-cap { font: 700 11.5px var(--font-title); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px; }
.ss-in { height: 40px; border-radius: 8px; width: 100%; box-sizing: border-box; font-size: 14.5px; }
select.ss-in { padding: 0 10px; }
.ss-swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ss-swatches .sw { width: 26px; height: 26px; border-radius: 50%; padding: 0; border: 0; cursor: pointer; }
.ss-swatches .sw.none { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); position: relative; }
.ss-swatches .sw.none::after { content: ""; position: absolute; left: 4px; right: 4px; top: 12px; height: 2px; background: var(--muted); transform: rotate(-45deg); }
.ss-swatches .sw.on { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--text); }
.ss-swatches .sw.custom { width: 30px; height: 30px; background: none; -webkit-appearance: none; appearance: none; border-radius: 50%; overflow: hidden; }
.ss-swatches .sw:disabled { cursor: default; opacity: .6; }
.ss-group { font: 700 11.5px var(--font-title); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 2px; }
label.toggle.ss-perm { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); text-transform: none; letter-spacing: 0; font: 400 14px var(--font); color: var(--text-2); cursor: pointer; }
label.toggle.ss-perm > span:first-child { flex: 1; }
label.toggle.ss-perm.disabled { cursor: default; opacity: .55; }
.ss-del { margin-top: 18px; align-self: flex-start; background: transparent; }
.ss-mem { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.ss-mem b { font-weight: 600; color: var(--text); }
.ss-mem .icon-btn { margin-left: auto; }
.ss-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; align-items: center; justify-content: flex-end; }
.ss-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 8px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.ss-chip i { width: 9px; height: 9px; border-radius: 50%; }
.ss-chip .x { background: none; border: 0; padding: 0 2px; color: var(--muted); font-size: 11px; cursor: pointer; }
.ss-chip .x:hover { color: var(--red); }
.ss-add { width: 26px; height: 26px; border-radius: 50%; border: 1px dashed var(--line); background: transparent; color: var(--muted); padding: 0; font-size: 14px; display: grid; place-items: center; }
.ss-add:hover { color: var(--text); border-color: var(--muted); }
.ss-role-members { display: flex; flex-direction: column; gap: 4px; }
.ss-role-members select { margin-bottom: 8px; }
.ctx-menu .role-dot, .vis-role .role-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chan-lock { color: var(--muted); display: inline-grid; margin-left: 4px; opacity: .8; }
.vis-chooser { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.vis-cap { font: 600 12px var(--font-title); text-transform: var(--caps, uppercase); color: var(--muted); letter-spacing: calc(.12em * var(--track, 1)); }
.vis-roles { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 0 4px; }
.vis-roles[hidden] { display: none; }
dialog label.vis-role { flex-direction: row; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); font: 400 13.5px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; }
@media (max-width: 800px) { .ss-roles { flex-direction: column; } .ss-role-list { width: auto; border-right: 0; border-bottom: 1px solid var(--line); } }
.opt-layout { display: flex; height: 100%; }
.opt-nav {
  flex: 0 0 230px; background: var(--bg-0); border-right: 1px solid var(--line); padding: 22px 12px 16px;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.opt-title { margin: 0 10px 14px; font: 700 18px var(--font-title); letter-spacing: calc(.06em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--text); }
.opt-group { margin: 12px 10px 6px; font: 600 11px var(--font-title); letter-spacing: calc(.14em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--muted); }
.opt-tab {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent;
  padding: 9px 10px; border-radius: var(--r-s); color: var(--text-2); font-weight: 500;
}
.opt-tab .ico { color: var(--muted); }
.opt-tab:hover { background: var(--hover); }
.opt-tab.active { background: var(--active); color: var(--cyan-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 33.3333%, transparent); }
.opt-tab.active .ico { color: var(--cyan); }
.opt-tab.opt-logout, .opt-tab.opt-logout .ico { color: var(--red); }
.opt-tab.opt-logout:hover { background: color-mix(in srgb, var(--red) 12.1569%, transparent); }
.opt-spacer { flex: 1; }
.opt-content { flex: 1; min-width: 0; position: relative; overflow-y: auto; padding: 28px 36px; }
.opt-close { position: absolute; top: 18px; right: 18px; }
.opt-pane { display: flex; flex-direction: column; gap: 16px; max-width: 600px; animation: fade .2s ease; }
.opt-pane[hidden] { display: none; }
.opt-pane h3 { margin: 0 0 4px; font: 700 20px var(--font-title); letter-spacing: calc(.04em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--text); }
.opt-pane h4 { margin: 10px 0 0; font: 600 12px var(--font-title); letter-spacing: calc(.12em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--muted); }
.opt-pane .hint { margin: 0; }
.opt-pane label:not(.toggle):not(.choice) { display: flex; flex-direction: column; gap: 6px; font: 600 12px var(--font-title); text-transform: var(--caps, uppercase); color: var(--muted); letter-spacing: calc(.12em * var(--track, 1)); }
.opt-pane label input:not([type=checkbox]), .opt-pane label select { font: 400 15px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); }

/* Profil */
.profile-card {
  display: flex; align-items: center; gap: 22px; padding: 20px; border-radius: var(--r-m);
  background: var(--bg-0); border: 1px solid var(--line);
}
.profile-avatar-wrap { position: relative; flex: none; }
.avatar.profile-avatar { width: 96px; height: 96px; font-size: 40px; border-radius: calc(var(--r-avatar) * 2); }
.profile-avatar-edit {
  position: absolute; right: -6px; bottom: -6px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; background: var(--cyan); color: var(--on-accent-04040a); box-shadow: 0 0 0 3px var(--bg-0);
}
.profile-avatar-edit:hover { background: var(--cyan-soft); }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-actions .hint { flex-basis: 100%; }
.opt-pane form.profile-form { display: flex; flex-direction: row; align-items: flex-end; gap: 10px; padding: 0; }
.profile-form label { flex: 1; }
.profile-form button { padding: 10px 16px; }

@media (max-width: 700px) {
  .opt-layout { flex-direction: column; }
  .opt-nav { flex: none; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .opt-title, .opt-group, .opt-spacer { display: none; }
  .opt-tab { width: auto; }
  .opt-content { padding: 20px; }
}

/* ===== Détection de la voix ===== */
.chan-meta { font: 500 12px var(--font); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.vad-box { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-m); background: var(--bg-0); border: 1px solid var(--line); }
.vad-meter {
  --thr: 45%;
  position: relative; height: 28px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--yellow) 20%, transparent) 0 var(--thr), color-mix(in srgb, var(--green) 20%, transparent) var(--thr) 100%);
}
.vad-level {
  position: absolute; inset: 0 auto 0 0; width: 0; transition: width .05s linear;
  opacity: .9;
}
.vad-meter .vad-level { background: var(--yellow); }
.vad-meter.open .vad-level { background: var(--green); box-shadow: 0 0 14px color-mix(in srgb, var(--green) calc(53.3333% * var(--glow)), transparent); }
.vad-meter input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; padding: 0; border: 0;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.vad-meter input[type=range]:disabled { cursor: default; }
.vad-meter input[type=range]::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.vad-meter input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 6px; height: 28px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 2px var(--bg-2), 0 0 10px #fff8;
}
.vad-meter.auto input[type=range]::-webkit-slider-thumb { background: var(--cyan); box-shadow: 0 0 0 2px var(--bg-2), 0 0 10px var(--cyan); }
.vad-meter input[type=range]::-moz-range-thumb { width: 6px; height: 28px; border-radius: 3px; background: #fff; border: 0; }
.vad-legend { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.vad-legend #vadStatus { color: var(--text-2); text-align: center; }

/* ===== Messages : mise en forme ===== */
.msg .content strong { color: var(--text); font-weight: 700; }
.msg .content em { font-style: italic; }
.msg .content s { opacity: .7; }
.inline-code {
  font: 13px ui-monospace, Consolas, monospace; background: color-mix(in srgb, var(--cyan) 7.0588%, transparent); color: var(--cyan-soft);
  padding: 1px 5px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--cyan) 13.3333%, transparent);
}
.code-block {
  margin: 6px 0; padding: 10px 12px; background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-m);
  font: 13px/1.5 ui-monospace, Consolas, monospace; color: var(--text-2); white-space: pre-wrap; overflow-x: auto; max-width: 720px;
}
.mention {
  background: #8c6cff2e; color: var(--bot-text-c9b8ff); padding: 0 3px; border-radius: 3px; font-weight: 600; cursor: default;
}
.mention.me { background: color-mix(in srgb, var(--yellow) 18.0392%, transparent); color: var(--yellow); }
.msg.mentioned { background: color-mix(in srgb, var(--yellow) 5.098%, transparent); box-shadow: inset 2px 0 0 var(--yellow); }
.msg.mentioned:hover { background: color-mix(in srgb, var(--yellow) 7.8431%, transparent); }
.msg .edited { color: var(--muted); font-size: 11px; }
.msg .pinned-tag { color: var(--magenta); display: inline-grid; align-self: center; }
.msg.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 35% { background: color-mix(in srgb, var(--cyan) 14.902%, transparent); } }

/* Ligne « en réponse à » */
.msg .reply-line {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 0 0 2px 30px; font-size: 13px;
  color: var(--muted); cursor: pointer; min-width: 0;
}
.reply-curve { width: 26px; height: 10px; margin-top: 8px; border: 2px solid var(--line); border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; flex: none; }
.reply-line:hover .reply-text { color: var(--text); }
.reply-author { font-weight: 600; flex: none; }
.reply-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-deleted { font-style: italic; }
.avatar.micro { width: 16px; height: 16px; font-size: 9px; }

/* Réactions */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reactions:empty { display: none; }
.reaction {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; height: 26px; border-radius: 6px;
  background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--text-2);
}
.reaction .emoji { font-size: 15px; line-height: 1; }
.reaction .count { font-weight: 700; font-size: 12.5px; }
.reaction:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 46.6667%, transparent); }
.reaction.mine { background: var(--active); box-shadow: inset 0 0 0 1px var(--cyan); color: var(--cyan-soft); }
.reaction.add { color: var(--muted); gap: 0; padding: 2px 6px; opacity: 0; transition: opacity .12s; }
@media (hover: hover) { .msg:hover .reaction.add { opacity: 1; } }
.msg.touched .reaction.add { opacity: 1; }

/* Barre d'actions au survol (remplace l'ancienne) */
.msg .msg-actions { gap: 1px; }
.msg .msg-actions button { padding: 5px 7px; width: auto; height: auto; color: var(--muted); }
.msg .msg-actions button:hover { background: var(--hover); color: var(--cyan-soft); }
.msg .msg-actions button.danger-act:hover { background: color-mix(in srgb, var(--red) 13.3333%, transparent); color: var(--red); }
.msg.editing .msg-actions { display: none; }

/* Modification en place */
.edit-box { margin: 4px 0; }
.edit-box textarea {
  width: 100%; resize: none; background: var(--bg-raise-12121f); border: 1px solid var(--cyan); border-radius: var(--r-m);
  padding: 8px 10px; line-height: 1.4; box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 10.1961%, transparent);
  max-height: 45vh; overflow-y: auto; scroll-margin: 8px;
}
.edit-box { scroll-margin: 10px; }
.edit-help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.edit-help b { color: var(--cyan-soft); font-weight: 600; }

/* Barre « Réponse à » et autocomplétion des mentions */
#composerWrap { position: relative; }
#replyBar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 14px;
  background: var(--bg-1); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-m) var(--r-m) 0 0;
  font-size: 13px; color: var(--muted); animation: rise .15s var(--ease);
}
#replyBar b { color: var(--text); }
#replyBar + #pendingImage, #replyBar:not(.hidden) ~ #composer { border-top-left-radius: 0; border-top-right-radius: 0; }
#mentionPopup {
  position: absolute; left: 20px; right: 20px; bottom: calc(100% + 4px); max-width: 420px; z-index: 15;
  background: var(--c-06060c); border: 1px solid var(--line); border-radius: var(--r-m); padding: 6px; box-shadow: 0 10px 30px #000c;
  display: flex; flex-direction: column; animation: drop .12s var(--ease);
}
.mention-head { font: 600 11px var(--font-title); letter-spacing: calc(.12em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--muted); padding: 4px 8px 6px; }
.mention-item { display: flex; align-items: center; gap: 10px; background: transparent; padding: 6px 8px; text-align: left; border-radius: var(--r-s); }
.mention-item.active, .mention-item:hover { background: var(--active); color: var(--cyan-soft); }

/* Sélecteur d'emoji */
#emojiPicker {
  position: fixed; z-index: 40; display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 8px;
  background: var(--c-06060c); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 12px 30px #000c;
  animation: pop .12s var(--ease);
}
#emojiPicker button { width: 36px; height: 36px; padding: 0; font-size: 20px; background: transparent; border-radius: var(--r-s); }
#emojiPicker button:hover { background: var(--active); transform: scale(1.15); }

/* En-tête : épingles et recherche */
#pinsBtn.on { color: var(--cyan); background: var(--active); }
.search-box {
  display: flex; align-items: center; gap: 6px; background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 0 8px; height: 30px; color: var(--muted); font: 400 13px var(--font); letter-spacing: 0; transition: border-color .15s, width .2s;
  width: 170px;
}
.search-box:focus-within { border-color: var(--cyan); width: 240px; }
.search-box input { background: transparent; border: 0; padding: 0; width: 100%; font-size: 13px; box-shadow: none; }
.search-box input:focus { box-shadow: none; }

/* Panneau latéral (épingles, résultats de recherche) */
#chatView { position: relative; }
#sidePanel {
  position: absolute; top: 8px; right: 8px; bottom: 8px; width: min(420px, 90%); z-index: 12; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--c-06060c) 94.902%, transparent); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 12px 40px #000c;
  animation: slide-left .18s var(--ease);
}
@keyframes slide-left { from { opacity: 0; transform: translateX(10px); } }
#sidePanel header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--line); font: 700 14px var(--font-title); letter-spacing: calc(.04em * var(--track, 1)); color: var(--text);
}
#sideList { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.side-empty { text-align: center; padding: 24px 12px; margin: 0; }
.result {
  display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--bg-1); padding: 10px 12px;
  border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--line); width: 100%;
}
.result:hover { box-shadow: inset 0 0 0 1px var(--cyan); }
.result-top { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.result-chan { color: var(--cyan-soft); font-size: 12px; }
.result-time { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.result-body { font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.5em; overflow: hidden; }

/* Pastille de mentions non lues */
.mention-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: var(--on-accent-0a0a12);
  font: 700 11px var(--font); display: inline-grid; place-items: center; flex: none;
}
.mention-badge.fresh { animation: pop .2s var(--ease); }
.channel .mention-badge { margin-left: auto; }

/* ===================================================================
   Téléphone (écrans étroits)
   =================================================================== */
#menuBtn { display: none; }
#drawerShade { display: none; }
.msg.touched { background: var(--bg-raise-10101c); }
.msg.touched .msg-actions { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: none) {
  .tile .fs { opacity: 1; }
  .msg:hover:not(.touched) { background: transparent; }
  .msg:hover:not(.touched) .msg-actions { opacity: 0; transform: translateY(4px); pointer-events: none; }
}
body.no-screen-share .opt-tab[data-pane="partage"],
body.no-screen-share #vcShare, body.no-screen-share #vpShare, body.no-screen-share #vcQuality { display: none; }

@media (max-width: 760px) {
  #app, #app.no-members { grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }

  /* Liste des salons : menu qui glisse depuis la gauche */
  #sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(392px, 92vw); z-index: 40;
    transform: translateX(-102%); transition: transform .24s var(--ease);
    padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left);
  }
  #app.drawer-left #sidebar { transform: none; box-shadow: 12px 0 40px #000a; }
  /* Membres : menu qui glisse depuis la droite */
  #app #members, #app.no-members #members {
    display: block; position: fixed; top: 0; bottom: 0; right: 0; width: min(280px, 80vw); z-index: 40;
    transform: translateX(102%); transition: transform .24s var(--ease); padding-top: calc(8px + env(safe-area-inset-top));
  }
  #app.drawer-right #members { transform: none; box-shadow: -12px 0 40px #000a; }
  #drawerShade {
    display: block; position: fixed; inset: 0; z-index: 39; background: color-mix(in srgb, var(--c-04040a) 80%, transparent);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  #app.drawer-left #drawerShade, #app.drawer-right #drawerShade { opacity: 1; pointer-events: auto; }

  /* En-tête compact */
  #chanHeader {
    position: relative; gap: 4px; padding: env(safe-area-inset-top) 6px 0 4px;
    height: calc(52px + env(safe-area-inset-top)); font-size: 16px;
  }
  #menuBtn { display: grid; }
  #chanName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #chanMeta { display: none; }
  .search-box { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: transparent; height: 36px; }
  .search-box input { width: 0; }
  .search-box:focus-within {
    position: absolute; left: 8px; right: 8px; bottom: 8px; width: auto; height: 36px; z-index: 6;
    padding: 0 10px; justify-content: flex-start; background: var(--bg-0); border-color: var(--cyan);
  }
  .search-box:focus-within input { width: 100%; }
  .search-box input:focus, .search-box input:focus-visible { outline: none; box-shadow: none; }

  /* Messages */
  .welcome { padding: 12px 14px; }
  .welcome h2 { font-size: 22px; }
  .welcome .big { transform: scale(.8); transform-origin: left center; }
  .day-sep { margin: 14px 12px 6px; }
  .msg { grid-template-columns: 52px minmax(0, 1fr); padding: 2px 12px 2px 0; }
  .msg .meta { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
  .msg .msg-actions { right: 8px; top: -18px; box-shadow: 0 6px 20px #000a; }
  .msg .msg-actions button { padding: 8px 10px; }
  .msg img.attachment { max-height: 260px; }
  #composerWrap { padding: 0 8px calc(4px + env(safe-area-inset-bottom)); }
  #composer textarea, input, select, textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
  .search-box input { font-size: 16px; }
  #sidePanel { inset: 0; width: auto; border-radius: 0; border: 0; background: var(--bg-2); animation: none; }
  #emojiPicker { max-width: calc(100vw - 16px); }

  /* Panneau utilisateur en bas du menu */
  #userPanel { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }

  /* Vocal */
  #stage { grid-template-columns: minmax(0, 1fr); padding: 6px; gap: 6px; }
  #voiceParticipants { gap: 8px; padding: 8px; }
  .vcard { width: calc(50% - 4px); height: 118px; }
  #stage:not(:empty):not(.empty) + #voiceParticipants .vcard { width: calc(33% - 6px); height: auto; min-height: 92px; padding: 8px 4px; }
  #stage:not(:empty):not(.empty) { flex: none; grid-auto-rows: auto; }
  #stage .tile { aspect-ratio: 16 / 9; min-height: 0; }
  #stage:not(:empty):not(.empty) + #voiceParticipants { flex: 1; align-content: flex-start; overflow-y: auto; }
  #voiceControls { gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  #voiceControls button { padding: 13px 16px; }
  #voiceControls button span { display: none; }

  /* Fenêtres */
  dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  dialog form { padding: 18px; }
  dialog#options { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .opt-nav { padding: calc(10px + env(safe-area-inset-top)) 10px 10px; overflow-x: auto; flex-wrap: nowrap; }
  .opt-tab { flex: none; }
  .opt-content { padding: 16px; }
  #toasts { width: calc(100vw - 24px); top: calc(10px + env(safe-area-inset-top)); }
  .auth-card { width: calc(100vw - 24px); }
}

/* Partage : menus Qualité / Images par seconde */
.quality-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.select-wrap { position: relative; display: block; }
.select-wrap select {
  width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  padding: 12px 40px 12px 14px; border-radius: 10px; font-weight: 600;
  background: var(--bg-0); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.select-wrap select:hover { border-color: color-mix(in srgb, var(--cyan) 46.6667%, transparent); }
.select-wrap select:focus-visible { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 13.3333%, transparent); }
.select-wrap::after {
  content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: translateY(-70%) rotate(45deg);
}
.select-wrap select option { background: var(--bg-1); color: var(--text); font-weight: 400; }
.select-wrap select option:disabled { color: var(--muted); }
#shareForm .auto-note { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 0; }
#shareForm .auto-note svg { flex: none; margin-top: 2px; color: var(--cyan); }
#shareForm .auto-note b { color: var(--cyan); font-weight: 600; }
@media (max-width: 560px) { .quality-row { grid-template-columns: minmax(0, 1fr); } }

/* Raccourcis clavier */
.kb-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.kb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 11px 14px; background: var(--bg-3); }
.kb-row + .kb-row { border-top: 1px solid var(--line); }
.kb-row .kb-label b { display: block; font-weight: 600; color: var(--text); }
.kb-row .kb-label small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kb-row .kb-label .kb-warn { color: var(--yellow); }
button.kb-key {
  min-width: 150px; justify-content: center; font: 600 13px var(--font-title); letter-spacing: calc(.04em * var(--track, 1));
  background: var(--bg-0); border: 1px solid var(--line); color: var(--cyan-soft); padding: 8px 12px; border-radius: 8px;
}
button.kb-key.empty { color: var(--muted); font-weight: 400; }
button.kb-key.recording { border-color: var(--magenta); color: var(--magenta); box-shadow: 0 0 0 3px color-mix(in srgb, var(--magenta) 13.3333%, transparent); animation: kbPulse 1s ease-in-out infinite; }
@keyframes kbPulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--magenta) 6.6667%, transparent); } }
@media (prefers-reduced-motion: reduce) { button.kb-key.recording { animation: none; } }
.kb-key kbd { font: inherit; }
.kb-foot { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
@media (max-width: 760px) { .kb-row { grid-template-columns: minmax(0, 1fr) auto; } button.kb-key { min-width: 0; } }

/* Menu « volume de cette personne » (clic droit en vocal) */
.user-menu {
  position: fixed; z-index: 60; width: 270px; padding: 14px; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 18px 50px #000c;
  animation: umIn .14s var(--ease);
}
@keyframes umIn { from { opacity: 0; transform: scale(.96); } }
.user-menu.hidden { display: none; }
.um-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.um-head b { font: 700 15px var(--font-title); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.um-row output { font: 700 13px var(--font-title); color: var(--cyan-soft); }
.user-menu input[type=range] { width: 100%; accent-color: var(--cyan); cursor: pointer; }
.user-menu input[type=range].boost { accent-color: var(--magenta); }
.user-menu .um-mute { margin-top: 4px; display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 13px; }
.user-menu .um-mute small { display: block; color: var(--muted); font-size: 12px; }
.user-menu.muted input[type=range] { opacity: .4; }
#umReset { align-self: flex-start; font-size: 12.5px; }
.state-off.local { color: var(--yellow); }
@media (prefers-reduced-motion: reduce) { .user-menu { animation: none; } }

/* Volume des sons de l'application */
.sfx-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px 48px; align-items: center; gap: 12px; }
.opt-pane .sfx-row label.sfx-label { text-transform: none; letter-spacing: 0; font: 400 14px var(--font); color: var(--text-2); }
.sfx-row input[type=range] { width: 100%; accent-color: var(--cyan); cursor: pointer; }
.sfx-row output { font: 700 13px var(--font-title); color: var(--cyan-soft); text-align: right; }
@media (max-width: 560px) { .sfx-row { grid-template-columns: minmax(0, 1fr) 48px; } .sfx-row .sfx-label { grid-column: 1 / -1; } }

/* Menu clic droit : partie administrateur */
.um-admin { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
/* Administration en cartes par thème */
.um-card { display: flex; flex-direction: column; gap: 1px; padding: 6px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); }
.um-card[hidden], .um-item[hidden] { display: none; }
.um-card-lbl { display: flex; align-items: center; gap: 10px; padding: 4px 8px 5px; font: 700 11px var(--font-title); letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-card-lbl svg { width: 13px; height: 13px; flex: none; margin: 0 1.5px; } /* même axe que les icônes des actions (16 px) */
.um-card-lbl span:last-child { overflow: hidden; text-overflow: ellipsis; }
.um-live { width: 7px; height: 7px; margin: 0 4.5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); flex: none; }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 8px; background: transparent; border: 0; color: var(--text-2);
  font: 500 14px var(--font); text-align: left; cursor: pointer; }
.um-item svg { width: 16px; height: 16px; flex: none; }
.um-item:hover { background: var(--active); color: var(--cyan-soft); }
.um-item.um-del { background: transparent; color: var(--red); font-weight: 500; }
.um-item.um-del:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.um-switch input { position: absolute; opacity: 0; pointer-events: none; }
.um-switch .track { margin-left: auto; position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); flex: none; transition: background .15s; }
.um-switch .track::after { content: ''; position: absolute; left: 3px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.um-switch input:checked + .track { background: var(--red); border-color: var(--red); }
.um-switch input:checked + .track::after { transform: translateX(14px); background: #fff; }
.um-switch input:focus-visible + .track { outline: 2px solid var(--cyan); outline-offset: 2px; }
#umModBox.muted-on .um-switch > span:not(.track) { color: var(--text); }
.um-danger { background: color-mix(in srgb, var(--red) 6%, var(--bg-2)); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.um-card .um-roles { padding: 0 6px 4px; margin-top: 0; }
.um-card button.um-role { background: var(--bg-2); }
.um-card button.um-role.on { background: color-mix(in srgb, var(--c) 16%, var(--bg-2)); }
@media (prefers-reduced-motion: reduce) { .um-switch .track, .um-switch .track::after { transition: none; } }
.um-admin[hidden], #umMoveBox[hidden] { display: none; }
.um-title { font: 600 11px var(--font-title); letter-spacing: calc(.12em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--yellow); }
.um-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 4px; }
.um-moves { display: flex; flex-direction: column; gap: 2px; max-height: 160px; overflow-y: auto; }
button.um-move { display: flex; align-items: center; gap: 8px; background: transparent; color: var(--text-2); padding: 7px 8px; border-radius: var(--r-s); font-size: 14px; text-align: left; }
button.um-move:hover { background: var(--active); color: var(--cyan-soft); }
.state-off.server { color: var(--red); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--red) calc(53.3333% * var(--glow)), transparent)); }
button.server-muted { box-shadow: inset 0 0 0 1px var(--red); }
.voice-member[draggable=true] { cursor: grab; }
#channelList.dragging-member .channel.drop-into { background: var(--active); color: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--cyan); }

/* Rôles et modération des comptes */
.crown.owner { color: var(--yellow); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--yellow) calc(53.3333% * var(--glow)), transparent)); }
.member .crown:not(.owner) { color: var(--cyan-soft); }
.um-note { font-size: 12px; font-weight: 500; color: var(--yellow); } /* rôle, sous le nom */
.um-note:empty { display: none; }
.um-vol[hidden], #umModBox[hidden], #umVoiceMod[hidden], #umRole[hidden], #umVoiceKick[hidden] { display: none; }
#umVoiceKick { margin-top: 4px; }
.um-vol { display: flex; flex-direction: column; gap: 8px; }
.um-actions { display: flex; flex-direction: column; gap: 2px; }
button.um-act { background: transparent; text-align: left; padding: 8px; border-radius: var(--r-s); font-size: 14px; color: var(--text-2); }
button.um-act b { display: block; font-weight: 500; }
button.um-act small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; font-weight: 400; }
button.um-act small:empty { display: none; }
button.um-act.danger-act small { color: color-mix(in srgb, var(--red) 70%, var(--muted)); }
.um-roles-box { margin: 4px 0 8px; }
.um-roles-box[hidden] { display: none; }
.um-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
button.um-role { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--bg-3); color: var(--text-2); border: 1px solid var(--line); }
button.um-role:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); }
.um-role-check { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--c); color: transparent; flex: none; }
button.um-role.on { color: var(--text); background: color-mix(in srgb, var(--c) 16%, var(--bg-3)); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
button.um-role.on .um-role-check { background: var(--c); color: #0b0b10; }
button.um-act:hover { background: var(--active); color: var(--cyan-soft); }
button.um-act.danger-act { color: var(--red); }
button.um-act.danger-act:hover { background: color-mix(in srgb, var(--red) 10.1961%, transparent); color: var(--red); }
#userMenu:not(.can-mod) [data-mod] { display: none; }
#umVolBox[hidden] ~ .um-admin { border-top: 0; margin-top: 0; padding-top: 2px; }

/* ---------- Personne qui parle : son pseudo s'allume en cyan néon ---------- */
.voice-member .vm-name, .vcard .vc-label { transition: color .12s, text-shadow .12s; }
.voice-member.speaking .vm-name, .vcard.speaking .vc-label { color: var(--speak); text-shadow: var(--fx-text, 0 0 6px color-mix(in srgb, var(--speak) calc(80% * var(--glow)), transparent), 0 0 16px color-mix(in srgb, var(--speak) calc(40% * var(--glow)), transparent)); font-weight: 600; }

/* ---------- Fichiers et vidéos ---------- */
#pendingFile {
  background: var(--bg-raise-12121f); border-radius: var(--r-m) var(--r-m) 0 0; padding: 12px; display: flex; align-items: center; gap: 12px;
  box-shadow: inset 0 0 0 1px var(--line-strong); animation: rise .2s var(--ease);
}
#pendingFile.hidden { display: none; }
#pendingFile:not(.hidden) + #composer { border-radius: 0 0 var(--r-m) var(--r-m); }
.pf-icon { color: var(--cyan); display: grid; flex: none; }
.pf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pf-top { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.pf-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pf-top span { color: var(--muted); font-size: 12.5px; flex: none; }
.pf-bar { height: 6px; border-radius: 3px; background: var(--bg-0); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.pf-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--magenta)); transition: width .25s linear; }
#pendingFile[data-status="done"] .pf-bar i { background: var(--green); }
#pendingFile[data-status="paused"] .pf-bar i, #pendingFile[data-status="error"] .pf-bar i { background: var(--yellow); }
.pf-status { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
#pendingFile[data-status="error"] .pf-status { color: var(--red); }
#pendingFile[data-status="done"] .pf-status { color: var(--green); }
.file-wrap { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: min(560px, 100%); }
.file-video { width: 100%; max-height: 360px; border-radius: var(--r-m); background: #000; border: 1px solid var(--line); }
.file-audio { width: 100%; }
.file-note { font-size: 12.5px; color: var(--muted); }
.file-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-m);
  background: var(--bg-2); border: 1px solid var(--line); max-width: 420px;
}
.file-ico { color: var(--cyan); display: grid; flex: none; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font-size: 12.5px; }
a.file-dl { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-s); color: var(--text-2); background: var(--bg-3); flex: none; }
a.file-dl:hover { color: var(--on-accent-0a0a12); background: var(--cyan); }

/* Regarder / arrêter de regarder un partage */
.watch-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.watch-acts button {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font: 600 12px var(--font);
  background: var(--bg-3); color: var(--text-2); border: 1px solid var(--line);
}
.watch-acts button.watch-btn { background: var(--magenta); color: var(--on-accent-0a0a12); border-color: transparent; box-shadow: 0 0 14px color-mix(in srgb, var(--magenta) calc(33.3333% * var(--glow)), transparent); }
.watch-acts button.watch-btn:hover { filter: brightness(1.1); }
.watch-acts button.unwatch-btn:hover { background: var(--red); color: var(--on-accent-0a0a12); border-color: transparent; }
.watch-acts button.add-view:hover { border-color: var(--cyan); color: var(--cyan-soft); }
.vcard .watchers { font-size: 11.5px; color: var(--muted); }
.tile .unview { display: inline-flex !important; align-items: center; gap: 4px; width: auto; padding: 0 10px; font: 600 12px var(--font); }
.vcard .watch-acts .add-view { position: static; text-transform: none; letter-spacing: 0; font: 600 12px var(--font); box-shadow: none; }
.vcard.clickable { height: auto; min-height: 130px; padding: 12px 8px; gap: 8px; }

/* Icônes personnalisées des salons et catégories */
.custom-icon.emoji { display: inline-grid; place-items: center; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.custom-icon.img { object-fit: cover; border-radius: 4px; display: block; }
.channel .icon { width: 22px; justify-content: center; }
.channel .custom-icon.img { width: 22px; height: 22px; border-radius: 5px; }
.category .custom-icon { margin: -4px 1px -4px 0; flex: none; }
.category .custom-icon.emoji { font-size: 21px !important; }
.category .custom-icon.img { width: 26px; height: 26px; border-radius: 6px; box-shadow: 0 0 0 1px #ffffff14; }
#chanIcon { display: grid; place-items: center; }
.icon-chooser { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ic-head { display: flex; align-items: center; gap: 10px; }
.ic-label { font: 600 12px var(--font-title); text-transform: var(--caps, uppercase); letter-spacing: calc(.12em * var(--track, 1)); color: var(--muted); }
.ic-preview { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-m); background: var(--bg-0); border: 1px solid var(--line); color: var(--muted); }
.ic-preview .custom-icon.img { width: 32px; height: 32px; }
.ic-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ic-row input { flex: 1; min-width: 120px; }
button.ic-btn { padding: 8px 12px; font-size: 13px; }

/* Ping (survol de « En vocal ») */
.vp-info { position: relative; }
.vp-status { cursor: help; outline: none; }
.vp-status.medium { color: var(--yellow); }
.vp-status.medium::before { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.vp-status.bad { color: var(--red); }
.vp-status.bad::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
.ping-card {
  position: absolute; left: -4px; bottom: calc(100% + 10px); z-index: 50; width: 250px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 16px 40px #000c;
  display: flex; flex-direction: column; gap: 6px; animation: rise .14s var(--ease); pointer-events: none;
}
.ping-card.hidden { display: none; }
.pc-title { font: 600 11px var(--font-title); letter-spacing: calc(.12em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--muted); }
.pc-title.sub { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.pc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.pc-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-val { font: 700 13.5px var(--font-title); font-variant-numeric: tabular-nums; color: var(--text); flex: none; }
.pc-val.good { color: var(--green); }
.pc-val.medium { color: var(--yellow); }
.pc-val.bad { color: var(--red); }
.pc-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.35; }

#messages { overflow-anchor: none; } /* le suivi du bas est géré par l'application */

/* ---------- Activité (jeu en cours) ---------- */
.up-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.up-text .up-name { flex: none; }
.up-act, .m-act, .um-game {
  display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; font-weight: 500; color: var(--green);
  overflow: hidden; white-space: nowrap;
}
.up-act[hidden], .um-game[hidden] { display: none; }
.up-act span, .m-act span, .um-game span { overflow: hidden; text-overflow: ellipsis; }
.up-act svg, .m-act svg, .um-game svg { flex: none; }
.member .m-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member .m-text .m-name { flex: none; display: flex; align-items: center; gap: 5px; min-width: 0; }
.member .m-name .m-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.member .m-name .role-badge { margin-left: 0; top: 0; }
.member .m-act { margin-top: 1px; }
.member.offline .m-act { display: none; }
.um-who { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.um-game { font-size: 12.5px; }
.um-game small { color: var(--muted); font-weight: 500; margin-left: 2px; }

.act-now { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-m); }
.act-now .act-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-m); background: color-mix(in srgb, var(--green) 10.1961%, transparent); color: var(--green); flex: none; }
.act-now.idle .act-ico { background: var(--bg-2, #1a1a2a); color: var(--muted); }
.act-now .act-txt { flex: 1; min-width: 0; }
.act-now .act-txt b { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-now .act-txt small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-now .act-btns { display: flex; gap: 6px; flex: none; }
.act-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; max-height: 290px; overflow-y: auto; }
.act-list:empty { display: none; }
.act-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 14px; background: var(--bg-3); }
.act-row + .act-row { border-top: 1px solid var(--line); }
.act-row b { display: block; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-row small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-row .act-mem { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.act-row.ignored b { color: var(--muted); text-decoration: line-through; }
.act-row button { padding: 5px 10px; font-size: 13px; }
.act-foot { margin-top: 8px; }
.act-foot button { display: inline-flex; align-items: center; gap: 6px; }
.act-empty { padding: 10px 14px; color: var(--muted); font-size: 13px; background: var(--bg-3); }

/* ---------- Expiration des fichiers ---------- */
.file-size.soon { color: var(--red); }
.file-perm { color: var(--cyan); font-weight: 600; }
.file-wrap.expired .file-card { opacity: .6; border-style: dashed; }
.file-wrap.expired .file-ico { color: var(--muted); }
.file-wrap.expired .file-name { color: var(--text-2); text-decoration: line-through; }
.msg-menu { width: 240px; padding: 8px; gap: 2px; }
.mm-reacts { display: flex; gap: 2px; justify-content: space-between; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.mm-emoji { width: 30px; height: 32px; padding: 0; display: grid; place-items: center; font-size: 18px; background: transparent; border-radius: var(--r-s); color: var(--text-2); }
.mm-emoji:hover { background: var(--active); transform: scale(1.12); }
.mm-emoji.on { background: color-mix(in srgb, var(--cyan) 13.3333%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 40%, transparent); }
.mm-items { display: flex; flex-direction: column; gap: 1px; }
.mm-items[hidden], .mm-file[hidden] { display: none; }
button.mm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; }
.mm-file, .mm-danger { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.mm-file .fm-head { border-bottom: 0; margin-bottom: 0; padding: 0 8px 4px; }
.fm-head { display: flex; flex-direction: column; gap: 3px; }
.fm-head b { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.fm-head span { color: var(--muted); font-size: 12px; }
#fmPermanent[hidden] { display: none; }
.fm-note { color: var(--muted); font-size: 12px; padding: 2px 8px 0; }
.fm-note:empty { display: none; }

/* Vidéo jointe : juste le lecteur, infos et téléchargement en haut à droite */
.file-vbox { position: relative; width: fit-content; max-width: 100%; }
.file-vbox .file-video { display: block; width: auto; max-width: 100%; max-height: 420px; }
.file-vbar {
  position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 6px;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.file-vbox:focus-within .file-vbar, .file-vbar:has(.soon) { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .file-vbox:hover .file-vbar { opacity: 1; pointer-events: auto; } }
@media (hover: none) { .file-vbar { opacity: 1; pointer-events: auto; } }
.file-vbar .file-size {
  padding: 4px 9px; border-radius: 999px; background: color-mix(in srgb, var(--bg-2) 80%, transparent); backdrop-filter: blur(6px);
  color: var(--text-2); font-size: 12px; white-space: nowrap;
}
.file-vbar .file-size.soon { color: var(--red); }
.file-vbar a.file-dl { background: color-mix(in srgb, var(--bg-2) 80%, transparent); backdrop-filter: blur(6px); color: var(--text); }
.file-vbar a.file-dl:hover { background: var(--cyan); color: var(--on-accent-0a0a12); }

/* ---------- Bots : étiquette BOT violet néon ---------- */
.bot-tag {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 6px 0; border-radius: 4px; vertical-align: 1px;
  font: 700 10px/16px var(--font-title); letter-spacing: calc(.1em * var(--track, 1)); color: var(--bot-text-f3e8ff);
  background: color-mix(in srgb, var(--bot-2) 18.0392%, transparent); border: 1px solid var(--bot);
  text-shadow: var(--fx-text, 0 0 4px color-mix(in srgb, var(--bot-text-e0b0ff) calc(100% * var(--glow)), transparent), 0 0 10px color-mix(in srgb, var(--bot) calc(93.3333% * var(--glow)), transparent), 0 0 20px color-mix(in srgb, var(--bot-2) calc(66.6667% * var(--glow)), transparent));
  box-shadow: 0 0 6px color-mix(in srgb, var(--bot) calc(66.6667% * var(--glow)), transparent), 0 0 16px color-mix(in srgb, var(--bot-2) calc(40% * var(--glow)), transparent), inset 0 0 8px color-mix(in srgb, var(--bot-2) calc(33.3333% * var(--glow)), transparent);
  flex: none;
}
.member.offline .bot-tag { opacity: .6; }
#umName { display: inline-flex; align-items: center; }
#umBotRename[hidden] { display: none; }
.avatar.bot-av { background: linear-gradient(135deg, var(--bot-3), var(--bot-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 0 10px color-mix(in srgb, var(--bot-2) calc(40% * var(--glow)), transparent); }
.avatar.bot-av svg { filter: drop-shadow(0 0 3px #fff8); }

/* ---------- Statut ---------- */
.avatar .dot.st-idle { background: var(--yellow); }
.avatar .dot.st-dnd { background: var(--red); }
.avatar .dot.st-invisible { background: var(--bg-1); box-shadow: inset 0 0 0 2px var(--muted); }
#userPanel .avatar .dot { border-color: var(--bg-0); }
.status-menu { width: 270px; padding: 6px; gap: 0; }
.st-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; background: transparent; border-radius: var(--r-s); text-align: left; color: var(--text-2); }
.st-item:hover { background: var(--active); color: var(--cyan-soft); }
.st-item.on { background: color-mix(in srgb, var(--cyan) 7.8431%, transparent); }
.st-item.on b { color: var(--cyan-soft); }
.st-item .dot { flex: none; width: 12px; height: 12px; border: 0; border-radius: 50%; position: relative; }
.st-item .dot.st-online { background: var(--green); }
.st-item .dot.st-idle { background: var(--yellow); }
.st-item .dot.st-dnd { background: var(--red); }
.st-item .dot.st-invisible { box-shadow: inset 0 0 0 3px var(--muted); background: transparent; }
.st-text { display: flex; flex-direction: column; min-width: 0; }
.st-text b { font-size: 14px; color: var(--text); font-weight: 600; }
.st-text small { font-size: 12px; color: var(--muted); margin-top: 1px; }
.st-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.st-profile svg { margin: 0 -2px; }

/* Changement de statut : la pastille rebondit, puis une onde de sa nouvelle couleur s'élargit. */
@keyframes dot-pop { 0% { transform: scale(1); } 35% { transform: scale(0); } 65% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes dot-ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
.avatar .dot.changed { animation: dot-pop .5s cubic-bezier(.2, .8, .2, 1) var(--dot-t, 0ms) both; }
.avatar .dot.changed::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; background: inherit; pointer-events: none; opacity: 0;
  animation: dot-ripple .7s ease-out calc(var(--dot-t, 0ms) + 230ms) both;
}
.avatar .dot.st-invisible.changed::before { background: var(--muted); }
@media (prefers-reduced-motion: reduce) { .avatar .dot.changed, .avatar .dot.changed::before { animation: none; } }

/* ---------- Bot musique ---------- */
#umMusicBox[hidden] { display: none; }
.voice-member.bot-member .vm-name { display: inline-flex; align-items: center; min-width: 0; }
.bot-now { display: flex; align-items: center; gap: 6px; margin: -2px 0 4px 38px; font-size: 12px; color: var(--bot-text-d8b4fe); min-width: 0; }
.bot-now span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-now svg { flex: none; }
.vcard.bot-card { width: 300px; height: auto; min-height: 130px; padding: 14px 16px; gap: 8px; border-color: color-mix(in srgb, var(--bot-3) 53.3333%, transparent); }
.vcard.bot-card.speaking { border-color: var(--bot); box-shadow: 0 0 0 1px var(--bot), 0 0 22px color-mix(in srgb, var(--bot-2) calc(26.6667% * var(--glow)), transparent); }
.vcard.bot-card .vc-name { display: flex; align-items: center; justify-content: center; }
.bot-info { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.bot-title { color: var(--text); font-weight: 600; font-size: 13px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.bot-title:hover { color: var(--bot-text-e9d5ff); text-decoration: underline; }
.bot-bar { height: 4px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.bot-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--bot-3), var(--bot)); border-radius: 2px; transition: width .5s linear; }
.bot-bar.bot-dl span { transition: width .4s ease-out; }
.bot-bar.indeterminate { position: relative; }
.bot-bar.indeterminate span { position: absolute; inset: 0 auto 0 0; width: 35% !important; animation: botdl 1.3s ease-in-out infinite; }
@keyframes botdl { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .bot-bar.indeterminate span { animation: none; width: 100% !important; opacity: .5; } }
.bot-time { font-size: 11.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

.vcard.bot-card .vc-name { flex-direction: row; flex-wrap: nowrap; gap: 0; }
.vcard.bot-card.speaking .vc-label, .voice-member.bot-member.speaking .vm-name { color: var(--bot-text-e9d5ff); text-shadow: var(--fx-text, 0 0 6px color-mix(in srgb, var(--bot) calc(80% * var(--glow)), transparent), 0 0 16px color-mix(in srgb, var(--bot-2) calc(40% * var(--glow)), transparent)); }
.voice-member.bot-member.speaking .avatar { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--bot), 0 0 14px color-mix(in srgb, var(--bot-2) calc(53.3333% * var(--glow)), transparent); }
/* Liste des salons : petites photos rapprochées. Anneau plus fin (1,5 px d'écart + 1,5 px de couleur) et un peu
   d'air entre les lignes, pour que les anneaux de deux personnes qui parlent en même temps ne se touchent pas. */
.voice-members .voice-member + .voice-member { margin-top: 2px; }
.voice-member.speaking .avatar { box-shadow: 0 0 0 1.5px var(--bg-1), 0 0 0 3px var(--speak), 0 0 10px color-mix(in srgb, var(--speak) calc(53.3333% * var(--glow)), transparent); }
.voice-member.bot-member.speaking .avatar { box-shadow: 0 0 0 1.5px var(--bg-1), 0 0 0 3px var(--bot), 0 0 10px color-mix(in srgb, var(--bot-2) calc(53.3333% * var(--glow)), transparent); }
.member .m-act.bot-listen { color: var(--bot-text-d8b4fe); }

/* ---------- Jauge d'expiration (fond teinté + liseré qui reculent) ---------- */
.file-card { position: relative; overflow: hidden; }
.file-card > * { position: relative; z-index: 1; }
.file-card[data-exp] { --exp-c: var(--cyan); }
.file-card[data-exp="warn"], .file-vbox[data-exp="warn"] { --exp-c: var(--yellow); }
.file-card[data-exp="crit"], .file-vbox[data-exp="crit"] { --exp-c: var(--red); }
.file-card[data-exp]::before, .file-card[data-exp]::after {
  content: ''; position: absolute; left: 0; width: calc(var(--exp, 1) * 100%); pointer-events: none;
  transition: width 1s linear, background .4s;
}
.file-card[data-exp]::before { top: 0; bottom: 0; background: color-mix(in srgb, var(--exp-c) 8%, transparent); z-index: 0; }
.file-card[data-exp]::after { bottom: 0; height: 2px; background: var(--exp-c); z-index: 2; }
/* Vidéo : liseré sous le lecteur (pas de teinte sur l'image). */
.file-vbox[data-exp] { --exp-c: var(--cyan); padding-bottom: 5px; }
.file-vbox[data-exp]::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; border-radius: 1px; width: calc(var(--exp, 1) * 100%);
  background: var(--exp-c); transition: width 1s linear, background .4s;
}

/* ---------- Envoi en cours : l'inverse, la carte se remplit (fond teinté + liseré qui avancent) ---------- */
#pendingFile { position: relative; overflow: hidden; --pf-c: var(--cyan); }
#pendingFile > * { position: relative; z-index: 1; }
#pendingFile[data-status="paused"], #pendingFile[data-status="error"] { --pf-c: var(--yellow); }
#pendingFile[data-status="error"] { --pf-c: var(--red); }
#pendingFile[data-status="done"] { --pf-c: var(--green); }
#pendingFile .pf-bar { position: absolute; inset: 0; z-index: 0; height: auto; border-radius: 0; background: none; box-shadow: none; pointer-events: none; }
#pendingFile .pf-bar i { position: relative; height: 100%; background: color-mix(in srgb, var(--pf-c) 10%, transparent); transition: width .25s linear, background .3s; }
#pendingFile .pf-bar i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--pf-c); }
#pendingFile[data-status] .pf-bar i { background: color-mix(in srgb, var(--pf-c) 10%, transparent); }
#pendingFile > .pf-main { position: static; }
#pendingFile .pf-top, #pendingFile .pf-status { position: relative; z-index: 1; }

/* ---------- Messages privés ---------- */
.category.dm-head { cursor: default; padding-left: 10px; }
.channel.dm-row { gap: 10px; padding: 5px 10px; }
.channel.dm-row .dm-close { margin-left: auto; flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); display: none; place-items: center; cursor: pointer; }
.channel.dm-row:hover .dm-close, .channel.dm-row .dm-close:focus-visible { display: grid; }
.channel.dm-row .dm-close:hover { color: var(--text); background: color-mix(in srgb, var(--text) 12%, transparent); }
.channel.dm-row:hover .mention-badge, .channel.dm-row:hover .mute-ico { display: none; }
.channel.dm-row .avatar.tiny { width: 26px; height: 26px; font-size: 12px; }
.channel.dm-row .avatar .dot { width: 11px; height: 11px; right: -3px; bottom: -3px; border-width: 2px; border-color: var(--bg-1); }
.channel.dm-row.active .avatar .dot { border-color: var(--active); }
#chanIcon .avatar.tiny { width: 26px; height: 26px; }
.welcome .avatar.welcome-av { width: 72px; height: 72px; font-size: 30px; margin-bottom: 10px; }
#umDm[hidden] { display: none; }
button.um-act.um-dm { display: flex; align-items: center; gap: 8px; color: var(--cyan-soft); }

/* ---------- Recadrage de la photo de profil ---------- */
#dialog.wide { width: min(620px, calc(100vw - 24px)); max-width: none; }
.crop { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.crop-left { display: flex; flex-direction: column; gap: 12px; }
.crop-stage { position: relative; width: 280px; height: 280px; border-radius: var(--r-m); overflow: hidden; background: #000; cursor: grab; touch-action: none; user-select: none; }
.crop-stage.dragging { cursor: grabbing; }
.crop-stage:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.crop-canvas { width: 280px; height: 280px; display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: var(--r-avatar); pointer-events: none;
  box-shadow: 0 0 0 999px color-mix(in srgb, var(--c-04040a) 60%, transparent), inset 0 0 0 2px var(--cyan); }
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--cyan); }
.crop-right { display: flex; flex-direction: column; gap: 14px; min-width: 200px; flex: 1; }
.crop-title { font: 600 11px var(--font-title); letter-spacing: calc(.12em * var(--track, 1)); text-transform: var(--caps, uppercase); color: var(--muted); }
.crop-previews { display: flex; align-items: flex-end; gap: 18px; }
.crop-previews figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.crop-previews figcaption { font-size: 11.5px; color: var(--muted); }
.crop-pv { border-radius: var(--r-avatar); background: var(--bg-3); display: block; }
.crop-hint { margin: 0; font-size: 12.5px; }
.crop-gif { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 13px; }
.crop-gif small { display: block; color: var(--muted); font-size: 12px; }
#dialogBody label.crop-zoom { flex-direction: row; align-items: center; margin: 0; }
#dialogBody label.crop-gif { flex-direction: row; margin: 0; }

/* ---------- Apparence : choix du thème ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.theme-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; text-align: left;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-m); }
.theme-card:hover { border-color: var(--muted); background: var(--bg-3); }
.theme-card.on { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.theme-name { font-weight: 600; color: var(--text); margin-top: 6px; }
.theme-card small { color: var(--muted); font-size: 12px; }
/* Mini-aperçus (couleurs fixes : ce sont des vignettes des thèmes, pas le thème actuel) */
.theme-prev { position: relative; display: block; width: 100%; height: 86px; border-radius: 6px; overflow: hidden; }
.theme-prev i { position: absolute; top: 0; bottom: 0; }
.theme-prev i:nth-child(1) { left: 0; width: 26%; }
.theme-prev i:nth-child(2) { left: 26%; right: 22%; }
.theme-prev i:nth-child(3) { right: 0; width: 22%; }
.theme-prev b { position: absolute; left: 32%; right: 28%; bottom: 10px; height: 14px; border-radius: 4px; }
.tp-sobre i:nth-child(1) { background: #18191c; } .tp-sobre i:nth-child(2) { background: #1e1f23; } .tp-sobre i:nth-child(3) { background: #18191c; }
.tp-sobre b { background: #2a2b30; box-shadow: inset 0 0 0 1px #6f8ff7; }
.tp-sobre::after { content: ''; position: absolute; left: 4%; top: 14px; width: 16%; height: 8px; border-radius: 3px; background: #2d3038; box-shadow: 0 16px 0 #25262a, 0 32px 0 #25262a; }
.tp-arcade i:nth-child(1) { background: #0e0e18; } .tp-arcade i:nth-child(2) { background: #0a0a12; } .tp-arcade i:nth-child(3) { background: #0e0e18; }
.tp-arcade b { background: #161626; box-shadow: inset 0 0 0 1px #00e5ff, 0 0 10px #00e5ff66; }
.tp-arcade::after { content: ''; position: absolute; left: 4%; top: 14px; width: 16%; height: 8px; border-radius: 2px; background: #0c2a33; box-shadow: 0 0 0 1px #00e5ff88, 0 16px 0 #ff3da6, 0 32px 0 #151526; }

/* ---------- Sobre : retouches (ce que les variables ne suffisent pas à changer) ---------- */
:root:not([data-theme="arcade"]) #auth { background: var(--bg-0); }
:root:not([data-theme="arcade"]) .auth-logo { animation: none; }
:root:not([data-theme="arcade"]) #serverHeader { color: var(--text); }
:root:not([data-theme="arcade"]) .auth-card { box-shadow: 0 20px 60px #0008; }
/* Recadrage de l'image d'un serveur : carré arrondi, comme dans la barre de gauche */
.crop.square .crop-ring, .crop.square .crop-pv { border-radius: 30%; }

/* Carte du bot musique : miniature de la vidéo en fond, floutée et assombrie */
.vcard.bot-card { position: relative; overflow: hidden; isolation: isolate; }
.vcard.bot-card .bot-bg {
  position: absolute; inset: -24px; z-index: -1; background: center / cover no-repeat;
  filter: blur(1px) saturate(1.25) brightness(.9); transform: scale(1.08); animation: fade .5s ease;
}
.vcard.bot-card.has-thumb::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #0000 35%, #000b);
}
.vcard.bot-card.has-thumb .bot-time { color: #e6e7ea; }
.vcard.bot-card.has-thumb .bot-title { color: #fff; text-shadow: 0 1px 3px #000c; }
.vcard.bot-card.has-thumb .vc-label { text-shadow: 0 1px 3px #000c; }
.vcard.bot-card.has-thumb .bot-bar { background: #ffffff2e; }

/* Scène vocale : chaque carte garde sa taille ; sur une rangée, elles sont centrées verticalement entre elles
   (le bot musique, plus haut, ne fait plus remonter les autres en haut). Icônes micro / son côte à côte sous le nom. */
#voiceParticipants { align-items: center; }
.vcard .vc-name .vm-icons { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; }

/* Salons et serveurs muets */
.channel.muted .name, .channel.muted .icon { opacity: .5; }
.channel .mute-ico { display: inline-flex; color: var(--muted); opacity: .8; margin-left: 4px; flex: none; }
.rail-item.muted .rail-btn { opacity: .55; }
.rail-item.muted:hover .rail-btn, .rail-item.muted.active .rail-btn { opacity: 1; }
#muteBtn.on { color: var(--muted); background: var(--active); }
#muteBtn[hidden] { display: none; }
.ctx-menu { position: fixed; z-index: 70; width: 240px; }
.ctx-menu.hidden { display: none; }
.ctx-title { padding: 6px 10px 2px; font-weight: 700; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-sub { padding: 6px 10px 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ctx-note { padding: 4px 10px 6px; font-size: 13px; color: var(--muted); }

/* Fiche d'une personne : le jeu en cours en entier (retour à la ligne), la durée en dessous */
.um-game { flex-wrap: wrap; white-space: normal; row-gap: 1px; }
.um-game span { flex: 1 1 0; min-width: 0; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.um-game small { flex-basis: 100%; margin-left: 18px; }
#members .member[data-member] { cursor: pointer; }
.um-game { align-items: flex-start; } .um-game svg { margin-top: 2px; }

/* Carte « Joue à » (fiche d'une personne) */
.act-card { margin-top: 10px; padding: 10px 12px 12px; border-radius: var(--r-m); background: var(--bg-3); border: 1px solid var(--line); }
.act-card[hidden] { display: none; }
.pc-act { margin: 12px 0 0; text-align: left; align-self: stretch; width: 100%; box-sizing: border-box; }
.act-card-head { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.act-card-body { display: flex; align-items: center; gap: 12px; min-width: 0; }
.act-card-ico { flex: none; width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.act-card-ico img { width: 56px; height: 56px; object-fit: contain; display: block; }
.act-card-ico.placeholder { background: var(--bg-2); color: var(--green); border: 1px solid var(--line); }
.act-card-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.act-card-txt b { font-size: 15px; color: var(--text); overflow-wrap: anywhere; line-height: 1.25; }
.act-card-time { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font: 600 13px var(--font-mono, ui-monospace, monospace); }
img.game-ico { border-radius: 3px; object-fit: contain; flex: none; }

/* Carte du bot avec miniature : plus grande (format vidéo 16:9), icône du bot sans fond pour laisser voir l'image */
#stage:empty + #voiceParticipants .vcard.bot-card.has-thumb, #stage.empty + #voiceParticipants .vcard.bot-card.has-thumb {
  width: 440px; max-width: 100%; min-height: 0; aspect-ratio: 16 / 9; justify-content: flex-end; padding: 16px 18px 14px;
}
.vcard.bot-card.has-thumb .avatar { background: transparent; box-shadow: none; }
.vcard.bot-card.has-thumb .avatar svg { width: 34px; height: 34px; filter: drop-shadow(0 1px 4px #000c); }

/* Taille des cartes du vocal : elles grandissent avec la place disponible (grand écran WQHD, 4K) et avec le peu
   de monde dans l'appel (--k : 1,5 à deux, 1 vers six personnes, plus petit au-delà). Écran normal : taille de base. */
#voiceParticipants { container-type: inline-size; --k: 1; }
#stage:empty + #voiceParticipants, #stage.empty + #voiceParticipants { gap: clamp(10px, calc(1.2cqi * var(--k)), 28px); }
#stage:empty + #voiceParticipants .vcard, #stage.empty + #voiceParticipants .vcard {
  width: clamp(220px, calc(19cqi * var(--k)), calc(460px * var(--k))); height: clamp(130px, calc(11.2cqi * var(--k)), calc(272px * var(--k)));
  max-width: 100%; gap: clamp(10px, calc(1cqi * var(--k)), 22px); border-radius: clamp(8px, calc(.7cqi * var(--k)), 16px);
}
#stage:empty + #voiceParticipants .vcard .avatar, #stage.empty + #voiceParticipants .vcard .avatar {
  width: clamp(64px, calc(6cqi * var(--k)), calc(136px * var(--k))); height: clamp(64px, calc(6cqi * var(--k)), calc(136px * var(--k)));
  font-size: clamp(26px, calc(2.4cqi * var(--k)), calc(54px * var(--k)));
}
#stage:empty + #voiceParticipants .vcard .vc-name, #stage.empty + #voiceParticipants .vcard .vc-name { font-size: clamp(14px, calc(1.05cqi * var(--k)), 26px); }
#stage:empty + #voiceParticipants .vcard .vm-icons svg, #stage.empty + #voiceParticipants .vcard .vm-icons svg { width: clamp(14px, calc(1cqi * var(--k)), 24px); height: clamp(14px, calc(1cqi * var(--k)), 24px); }
/* Carte du bot : même logique (plus large, format vidéo quand il y a une miniature) */
#stage:empty + #voiceParticipants .vcard.bot-card, #stage.empty + #voiceParticipants .vcard.bot-card {
  width: clamp(300px, calc(26cqi * var(--k)), calc(640px * var(--k))); height: auto; min-height: clamp(130px, calc(11.2cqi * var(--k)), calc(272px * var(--k)));
}
#stage:empty + #voiceParticipants .vcard.bot-card.has-thumb, #stage.empty + #voiceParticipants .vcard.bot-card.has-thumb {
  width: clamp(440px, calc(34cqi * var(--k)), calc(820px * var(--k))); max-width: 100%; height: auto;
}
#stage:empty + #voiceParticipants .vcard.bot-card .bot-title, #stage.empty + #voiceParticipants .vcard.bot-card .bot-title { font-size: clamp(14px, calc(1cqi * var(--k)), 24px); }
#stage:empty + #voiceParticipants .vcard.bot-card .bot-time, #stage.empty + #voiceParticipants .vcard.bot-card .bot-time { font-size: clamp(12px, calc(.85cqi * var(--k)), 19px); }
#stage:empty + #voiceParticipants .vcard.bot-card .bot-bar, #stage.empty + #voiceParticipants .vcard.bot-card .bot-bar { height: clamp(4px, calc(.35cqi * var(--k)), 8px); }
#stage:empty + #voiceParticipants .vcard.bot-card.has-thumb .avatar svg, #stage.empty + #voiceParticipants .vcard.bot-card.has-thumb .avatar svg { width: clamp(34px, calc(2.6cqi * var(--k)), 64px); height: clamp(34px, calc(2.6cqi * var(--k)), 64px); }
@media (max-width: 760px) {
  #stage:empty + #voiceParticipants .vcard:not(.bot-card), #stage.empty + #voiceParticipants .vcard:not(.bot-card) { width: calc(50% - 4px); height: 118px; }
}

/* Qualité du son du bot (ex. « AAC · 129 kb/s ») */
.bot-quality { align-self: center; padding: 1px 8px; border-radius: 999px; font: 600 11px var(--font); color: var(--bot-text-c9b8ff);
  background: color-mix(in srgb, var(--bot-3) 22%, transparent); border: 1px solid color-mix(in srgb, var(--bot) 35%, transparent); }
.vcard.bot-card.has-thumb .bot-quality { color: #fff; background: #0006; border-color: #fff3; }

/* Boutons du bot musique sous « ▶️ Lecture : … » */
.music-ctrl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.music-ctrl:empty { display: none; }
.mc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-s); font: 600 13px var(--font);
  background: var(--bg-3); color: var(--text-2); border: 1px solid var(--line); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.mc-btn:hover { background: var(--active); color: var(--text); border-color: var(--line-strong); }
.mc-btn.primary-ish { color: var(--bot-text-c9b8ff); border-color: color-mix(in srgb, var(--bot) 45%, transparent); }
.mc-btn.danger-ish:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.mc-btn:disabled { opacity: .5; cursor: default; }

/* Commande du bot : « ce message disparaît dans 5 s », puis désintégration */
.msg.ephemeral .content { opacity: .8; }
.ephemeral-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); font-style: italic; }
.ephemeral-note svg { flex: none; }
.msg.vanishing { pointer-events: none; will-change: filter, opacity; }
.msg.vanishing > .body { will-change: transform; }
.msg.collapsing { transition: height .4s cubic-bezier(.4, 0, .2, 1), padding .4s, margin .4s; padding-top: 0 !important; padding-bottom: 0 !important; margin: 0 !important; }
/* Fiche du bot (clic droit) : boutons de la musique de mon salon vocal */
.um-music-ctrl { margin: 2px 0 6px; }
.um-music-ctrl[hidden] { display: none; }
.um-music-ctrl .mc-btn { flex: 1; justify-content: center; padding: 6px 8px; }
.um-music-ctrl { flex-wrap: nowrap; gap: 5px; }
.um-music-ctrl .mc-btn { min-width: 0; padding: 6px 4px; gap: 4px; font-size: 12.5px; }

/* Image du bot musique : casque audio (fichiers bot-musique.svg et bot-musique-transparent.svg) */
.avatar.bot-av { background: none; }
.avatar.bot-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard.bot-card.has-thumb .avatar img { filter: drop-shadow(0 2px 6px #000b); }

/* ===== Vidéo regardée ensemble (/video) ===== */
#botVideo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 0; }
#botVideo.hidden { display: none; }
.bv-frame { position: relative; flex: 1; min-height: 0; background: #000; border-radius: var(--r-m); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bv-frame video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; background: #000; }
.bv-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 28px 14px 10px;
  background: linear-gradient(180deg, #0000, #000c); color: #fff; opacity: 0; transition: opacity .2s;
}
.bv-frame:hover .bv-bar, .bv-frame:focus-within .bv-bar, #botVideo.paused .bv-bar, .bv-frame.paused .bv-bar { opacity: 1; }
@media (hover: none) { .bv-bar { opacity: 1; } }
.bv-btn { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #ffffff22; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.bv-btn:hover { background: #ffffff3d; }
.bv-time { font: 600 13px var(--font-mono, ui-monospace, monospace); white-space: nowrap; flex: none; }
/* Curseurs du lecteur dessinés à la main : la partie remplie s'arrête pile au centre du rond
   (à 0, rien de rempli et le rond collé à gauche). La barre est réduite d'un rond de large pour que
   0 % et 100 % tombent sur les positions extrêmes du centre du rond. */
.bv-seek, .bv-vol input {
  --th: 14px; --fill: var(--bot, #9d8af5);
  -webkit-appearance: none; appearance: none; height: 20px; margin: 0; padding: 0; cursor: pointer; outline: none; border: 0;
  background:
    linear-gradient(to right, var(--fill) var(--p, 0%), #ffffff3a var(--p, 0%)) center / calc(100% - var(--th)) 4px no-repeat;
}
.bv-seek { flex: 1; min-width: 60px; }
.bv-vol { display: flex; align-items: center; gap: 6px; flex: none; }
.bv-vol input { width: 90px; --fill: #fff; }
.bv-seek::-webkit-slider-runnable-track, .bv-vol input::-webkit-slider-runnable-track { height: 100%; background: transparent; border: 0; }
.bv-seek::-webkit-slider-thumb, .bv-vol input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: var(--th); height: var(--th); margin-top: calc((20px - var(--th)) / 2);
  border: 0; border-radius: 50%; background: var(--fill); box-shadow: 0 1px 4px #0008; transition: transform .12s;
}
.bv-seek::-moz-range-track, .bv-vol input::-moz-range-track { background: transparent; border: 0; }
.bv-seek::-moz-range-thumb, .bv-vol input::-moz-range-thumb { width: var(--th); height: var(--th); border: 0; border-radius: 50%; background: var(--fill); box-shadow: 0 1px 4px #0008; }
.bv-seek:hover::-webkit-slider-thumb, .bv-vol input:hover::-webkit-slider-thumb, .bv-seek:active::-webkit-slider-thumb, .bv-vol input:active::-webkit-slider-thumb { transform: scale(1.2); }
.bv-seek:focus-visible::-webkit-slider-thumb, .bv-vol input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #ffffff55; }
.bv-title { font-size: 14px; color: var(--text-2); padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.bv-title b { color: var(--text); }
.bv-frame:fullscreen { border-radius: 0; }
/* Pendant une vidéo : les cartes des participants passent en petit, sous la vidéo */
#voiceView.with-video #stage:empty + #voiceParticipants, #voiceView.with-video #stage.empty + #voiceParticipants { flex: none; padding: 10px 12px; }
#voiceView.with-video #stage:empty + #voiceParticipants .vcard, #voiceView.with-video #stage.empty + #voiceParticipants .vcard { width: 170px; height: 96px; min-height: 0; gap: 6px; padding: 8px; aspect-ratio: auto; }
#voiceView.with-video #stage:empty + #voiceParticipants .vcard .avatar, #voiceView.with-video #stage.empty + #voiceParticipants .vcard .avatar { width: 40px; height: 40px; font-size: 16px; }
#voiceView.with-video #stage:empty + #voiceParticipants .vcard .vc-name, #voiceView.with-video #stage.empty + #voiceParticipants .vcard .vc-name { font-size: 13px; }
#voiceView.with-video .vcard.bot-card .bot-info, #voiceView.with-video .vcard.bot-card .bot-bg { display: none; }
@media (max-width: 760px) { .bv-vol { display: none; } .bv-bar { gap: 8px; padding: 22px 10px 8px; } }

.bv-vol .bv-mute { width: 30px; height: 30px; background: transparent; }
.bv-vol .bv-mute:hover { background: #ffffff2e; }


.bv-loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 10px; color: #fff; font: 600 15px var(--font); background: #0007; pointer-events: none; }
#botVideo.loading .bv-loading, .bv-frame.loading .bv-loading { display: flex; }
.bv-spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #ffffff40; border-top-color: #fff; animation: bvspin .8s linear infinite; }
@keyframes bvspin { to { transform: rotate(360deg); } }

/* Badges de rôle */
.role-badge { display: inline-block; vertical-align: middle; margin-left: 5px; line-height: 1; flex: none; position: relative; top: -.08em; }
span.role-badge.custom-icon.emoji { display: inline-block; height: 1em; line-height: 1; }
img.role-badge, img.role-icon { display: inline-block !important; border-radius: 4px; object-fit: contain; flex: none; }

.meta .role-badge { margin-left: 0; margin-right: 2px; }
.role-icon { flex: none; line-height: 1; }
img.role-icon { border-radius: 3px; object-fit: contain; }
#members h3:has(.role-icon, .role-dot) { display: flex; align-items: center; }
#members h3 .role-icon { margin-right: 6px; display: inline-grid; place-items: center; line-height: 1; height: 1.2em; }
.ss-role span.dot.role-icon { width: auto; height: auto; border-radius: 0; background: none !important; }
.ss-role img.dot.role-icon { border-radius: 3px; background: none !important; }
.ss-chip .role-icon { font-size: 12px; }
.ss-badge { margin: 4px 0 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg-0); display: flex; flex-direction: column; gap: 10px; }
.ss-badge-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.ss-badge-head small { display: block; font-size: 12.5px; max-width: 420px; }
.ss-badge-prev { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: var(--bg-2); flex: none; }
.ss-badge-prev b { font-weight: 600; }
.ss-badge-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.ss-badge-grid button { width: 36px; height: 36px; padding: 0; font-size: 19px; border-radius: 8px; background: transparent; border: 1px solid transparent; }
.ss-badge-grid button:hover { background: var(--hover); }
.ss-badge-grid button.on { border-color: var(--cyan); background: var(--active); }
.ss-badge-acts { display: flex; gap: 8px; }
.ss-badge-acts .ss-in { flex: 1; height: 36px; }
.ss-badge-acts .ic-btn { height: 36px; white-space: nowrap; }
label.toggle.ss-perm.ss-admin { margin-top: 12px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--red) 40%, var(--line)); border-radius: var(--r-m); background: color-mix(in srgb, var(--red) 7%, var(--bg-0)); }
label.toggle.ss-perm.ss-admin b { color: var(--text); }

/* ===== Nouveautés ===== */
.roadmap { display: flex; flex-direction: column; gap: 14px; }
.rm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rm-sum { margin: 0; color: var(--muted); font-size: 13px; }
.rm-seg { display: flex; background: var(--bg-0); border-radius: 10px; padding: 3px; flex: none; }
.rm-seg button { background: none; border: 0; padding: 6px 14px; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.rm-seg button.on { background: var(--bg-3); color: var(--text); font-weight: 600; }
.rm-tag { --c: var(--cyan); align-self: flex-start; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.rm-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.rm-new { align-self: flex-start; font-size: 11px; font-weight: 700; color: #06140c; background: #3fe08f; padding: 3px 8px; border-radius: 99px; }
.rm-art svg { display: block; width: 100%; height: auto; }
.rm-tx { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rm-tx h5 { margin: 0; font-size: 14.5px; color: var(--text); }
.rm-tx p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.rm-tx small, .rm-top small { color: var(--muted); font-size: 12px; }
/* Mosaïque */
.rm-hero { display: grid; grid-template-columns: 1.25fr 1fr; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rm-hero .rm-art { min-height: 100%; }
.rm-hero .rm-art svg { height: 100%; min-height: 200px; }
.rm-hero .rm-tx { padding: 22px 24px; justify-content: center; gap: 9px; }
.rm-hero .rm-tx h5 { font-size: 21px; }
.rm-hero .rm-tx p { font-size: 14px; line-height: 1.5; }
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.rm-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s var(--ease, ease), border-color .18s; }
.rm-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--text) 18%, var(--line)); }
.rm-card .rm-tx { padding: 11px 13px 13px; gap: 5px; }
.rm-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* Journal */
.rm-days { display: flex; flex-direction: column; gap: 10px; }
.rm-dayc { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rm-dh { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.rm-dh:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.rm-dd { display: flex; flex-direction: column; min-width: 160px; }
.rm-dd b { font-size: 15px; color: var(--text); }
.rm-dd small { color: var(--muted); font-size: 12px; }
.rm-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.rm-chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; flex: none; margin-right: 4px; }
.rm-dayc.open .rm-chev { transform: rotate(45deg); }
.rm-imp { display: flex; gap: 14px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); }
.rm-imp .rm-art { width: 128px; flex: none; border-radius: 9px; overflow: hidden; }
.rm-small { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 22px; padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.rm-li { --c: var(--cyan); display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13px; }
.rm-li time { color: var(--muted); font-size: 11.5px; width: 50px; flex: none; white-space: nowrap; }
.rm-li i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; transform: translateY(-1px); }
.rm-li div { display: flex; flex-direction: column; min-width: 0; }
.rm-li span { color: var(--text); }
.rm-li small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
/* À venir */
.roadmap h4 { margin: 6px 0 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rm-next { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rm-nx { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); background: transparent; }
.rm-nx i { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; border: 2px dashed var(--c); flex: none; box-sizing: border-box; }
.rm-nx b { display: block; font-size: 13.5px; color: var(--text); }
.rm-nx small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .rm-hero { grid-template-columns: 1fr; }
  .rm-hero .rm-tx { padding: 14px 16px 16px; }
  .rm-hero .rm-tx h5 { font-size: 18px; }
  .rm-bar { flex-direction: column; align-items: flex-start; }
  .rm-dh { flex-wrap: wrap; gap: 8px; }
  .rm-imp .rm-art { width: 96px; }
}
@media (prefers-reduced-motion: reduce) { .rm-card, .rm-chev { transition: none; } }

.role-tip { position: fixed; z-index: 9999; pointer-events: none; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--line); box-shadow: 0 6px 20px rgb(0 0 0 / .35); font: 600 13px var(--font); color: var(--text); white-space: nowrap; }
.role-tip i { width: 9px; height: 9px; border-radius: 50%; }
.role-tip.hidden { display: none; }
.role-badge[data-role] { cursor: default; }

.app-badge { display: inline-grid !important; place-items: center; vertical-align: middle; }
.app-badge svg { width: 100%; height: 100%; display: block; }
.role-tip .tip-logo { width: 14px; height: 14px; display: inline-grid; }
.role-tip .tip-logo svg { width: 100%; height: 100%; }
/* Emoji des badges : boîte carrée centrée, quelle que soit la police d'emoji (Segoe sous Windows). */
span.role-badge.custom-icon.emoji { display: inline-grid !important; place-items: center; width: 1.15em; height: 1.15em; line-height: 1; overflow: visible; }
.msg .meta .role-badge { align-self: center; top: 0; margin: 0; }
.member .app-badge.m-app { margin-left: auto; flex: none; position: static; }

/* Logo Braise : halo qui respire */
.app-badge { cursor: pointer !important; animation: braiseBreath 2.8s ease-in-out infinite; }
.member .app-badge.m-app { width: 18px !important; height: 18px !important; }
@keyframes braiseBreath {
  0%, 100% { filter: drop-shadow(0 0 1px rgb(111 143 247 / .35)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 3px rgb(111 143 247 / .55)) drop-shadow(0 0 6px rgb(166 184 251 / .25)); transform: scale(1.04); }
}
.app-badge:hover { animation-duration: 1.2s; }
.role-tip:has(.tip-logo) { border-color: rgb(111 143 247 / .55); background: linear-gradient(180deg, #1d2240, #171a2b); }
@media (prefers-reduced-motion: reduce) { .app-badge { animation: none; filter: drop-shadow(0 0 2px rgb(111 143 247 / .5)); } }

/* Présentation d'un administrateur (clic sur le logo) */
.br-veil { position: fixed; inset: 0; z-index: 100000; cursor: pointer; overflow: hidden; }
.br-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, #1b2038 0, #141518 55%); clip-path: circle(0% at 50% 46%); }
.br-veil.on .br-bg { animation: brOpen 1.5s cubic-bezier(.7,0,.2,1) .5s forwards; }
.br-veil.closing .br-bg { animation: brClose 1.1s cubic-bezier(.6,0,.4,1) forwards; clip-path: circle(80% at 50% 46%); }
@keyframes brOpen { to { clip-path: circle(80% at 50% 46%); } }
@keyframes brClose { from { clip-path: circle(80% at 50% 46%); } to { clip-path: circle(0% at 50% 46%); } }
.br-flame { position: absolute; left: 50%; top: 46%; width: 120px; height: 120px; margin: -60px 0 0 -60px; z-index: 2; }
.br-flame svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 14px rgb(111 143 247 / .7)) drop-shadow(0 0 40px rgb(111 143 247 / .35)); }
.br-veil.on:not(.closing) .br-flame svg { animation: brGlow 3s ease-in-out 1.4s infinite; }
@keyframes brGlow { 50% { filter: drop-shadow(0 0 22px #6f8ff7) drop-shadow(0 0 70px rgb(166 184 251 / .55)); } }
.br-rings { position: absolute; left: 50%; top: 46%; z-index: 1; }
.br-rings i { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgb(111 143 247 / .6); opacity: 0; }
.br-veil.on:not(.closing) .br-rings i { animation: brRing 3.2s ease-out 1.4s infinite; }
.br-veil.on:not(.closing) .br-rings i + i { animation-delay: 3s; }
@keyframes brRing { 0% { transform: scale(.8); opacity: .8; } 100% { transform: scale(3.2); opacity: 0; } }
.br-embers { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.br-embers i { position: absolute; bottom: -10px; border-radius: 50%; background: #a6b8fb; box-shadow: 0 0 8px #6f8ff7; opacity: 0; }
.br-veil.on:not(.closing) .br-embers i { animation-name: brEmber; animation-timing-function: ease-out; animation-iteration-count: infinite; }
.br-veil.closing .br-embers { opacity: 0; transition: opacity .5s; }
@keyframes brEmber { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(var(--dx), -70vh); opacity: 0; } }
.br-text { position: absolute; left: 0; right: 0; top: calc(46% + 92px); z-index: 2; text-align: center; pointer-events: none; }
.br-name { font: 800 clamp(34px, 6vw, 60px) var(--font-title); color: #eef1ff; letter-spacing: .04em; text-shadow: 0 0 24px rgb(111 143 247 / .55); }
.br-name span { display: inline-block; opacity: 0; transform: translateY(18px); filter: blur(6px); }
.br-veil.on .br-name span { animation: brChar .8s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes brChar { to { opacity: 1; transform: none; filter: none; } }
.br-sub { margin-top: 10px; padding-left: .5em; font: 700 15px var(--font-title); text-transform: uppercase; letter-spacing: .5em; color: #a6b8fb; opacity: 0; }
.br-veil.on .br-sub { animation: brSub 1.2s ease 2.3s forwards; }
@keyframes brSub { from { opacity: 0; letter-spacing: 1.1em; } to { opacity: 1; letter-spacing: .5em; } }
.br-line { margin-top: 14px; font: 400 14px var(--font); color: #8e93a8; opacity: 0; }
.br-veil.on .br-line { animation: brFade 1s ease 3.1s forwards; }
@keyframes brFade { to { opacity: 1; } }
.br-veil.closing .br-text { opacity: 0; transition: opacity .5s; }
.br-veil.reduced .br-bg { clip-path: none; opacity: 0; transition: opacity .3s; }
.br-veil.reduced.on .br-bg { opacity: 1; animation: none; }
.br-veil.reduced * { animation-duration: .01s !important; animation-delay: 0s !important; }
/* Badges dans l'en-tête d'un message : même boîte, même centre */
.msg .meta .role-badge, .msg .meta .app-badge { align-self: center; width: 16px; height: 16px; margin: 0 -3px 0 -2px; top: 0; vertical-align: middle; }

/* ===== Partage : icônes discrètes ===== */
.watch-acts { gap: 6px; flex-wrap: nowrap; }
.watch-acts button.wa { width: 36px; height: 30px; padding: 0; border-radius: 9px; display: grid; place-items: center; background: var(--bg-3); color: var(--text-2); border: 1px solid var(--line); box-shadow: none; }
.watch-acts button.wa:hover { color: var(--text); border-color: var(--muted); }
.watch-acts button.wa.watch-btn { background: var(--magenta); color: var(--on-accent-0a0a12); border-color: transparent; box-shadow: 0 0 12px color-mix(in srgb, var(--magenta) calc(30% * var(--glow)), transparent); }
.watch-acts button.wa.watch-btn:hover { filter: brightness(1.1); color: var(--on-accent-0a0a12); }
.watch-acts button.wa.unwatch-btn { background: color-mix(in srgb, var(--magenta) 16%, var(--bg-3)); color: var(--magenta); border-color: color-mix(in srgb, var(--magenta) 45%, transparent); }
.watch-acts button.wa.unwatch-btn:hover { background: var(--red); color: var(--on-accent-0a0a12); border-color: transparent; }
.watch-acts button.wa.add-view { position: static; }
.watch-acts button.wa.add-view:hover { color: var(--cyan-soft); border-color: var(--cyan); }
.tile .tile-acts { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 3; opacity: 0; transition: opacity .15s; }
@media (hover: hover) { .tile:hover .tile-acts, .tile:focus-within .tile-acts { opacity: 1; } }
@media (hover: none) { .tile .tile-acts { opacity: 1; } }
.tile .tile-acts button, .tile .tile-acts .unview, .tile .tile-acts .fs { position: static; opacity: 1; display: grid !important; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px; background: rgb(15 16 22 / .72); color: #fff; border: 1px solid rgb(255 255 255 / .12); backdrop-filter: blur(6px); font-size: 0; gap: 0; }
.tile .tile-acts button:hover { background: rgb(30 32 44 / .9); }
.tile .tile-acts .unview:hover { background: var(--red); color: var(--on-accent-0a0a12); border-color: transparent; }
/* Carte d'un partage : elle s'agrandit pour contenir les icônes (plus rien ne dépasse). */
#voiceParticipants .vcard.clickable { height: auto !important; padding-top: 12px; padding-bottom: 12px; }
#stage:not(:empty):not(.empty) + #voiceParticipants .vcard.clickable { min-height: 96px; padding-top: 8px; padding-bottom: 8px; gap: 5px; }
#stage:not(:empty):not(.empty) + #voiceParticipants .vcard .watch-acts button.wa { width: 32px; height: 26px; }

/* ===== Panneau de partage : grille + barre ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#shareForm { display: flex; flex-direction: column; gap: 0; max-height: min(86vh, 860px); }
#shareForm fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.share-head { display: flex; align-items: center; gap: 16px; padding: 22px 70px 0 28px; position: relative; }
.share-head > div:first-child { flex: 1; min-width: 0; }
.share-head h2 { margin: 0; font: 700 21px var(--font-title); color: var(--text); }
.share-sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.share-head .share-x { position: absolute; top: 16px; right: 16px; }
#shareDialog .source-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-0); border: 1px solid var(--line); flex: none; }
#shareDialog .source-tabs.hidden { display: none; }
#shareDialog .source-tabs [role=tab] { padding: 7px 14px; border-radius: 8px; font: 600 13.5px var(--font); letter-spacing: 0; color: var(--muted); background: transparent; box-shadow: none; }
#shareDialog .source-tabs [role=tab][aria-selected=true] { background: var(--bg-3); color: var(--text); box-shadow: 0 2px 6px #0005; }
#shareDialog .choice-set { overflow-y: auto; padding: 18px 28px 22px; flex: 1; min-height: 0; }
#shareDialog .source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#shareDialog label.source { position: relative; display: flex; flex-direction: column; gap: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--bg-1); border: 2px solid transparent; box-shadow: none; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
#shareDialog label.source:hover { border-color: color-mix(in srgb, var(--magenta) 45%, transparent); box-shadow: none; }
#shareDialog label.source:has(input:checked) { border-color: var(--magenta); background: var(--bg-1); box-shadow: 0 0 18px color-mix(in srgb, var(--magenta) calc(30% * var(--glow)), transparent); }
#shareDialog label.source:has(input:checked)::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--magenta); color: var(--on-accent-0a0a12); font: 800 13px var(--font); box-shadow: 0 2px 8px #0006; }
#shareDialog .source-thumb { aspect-ratio: 16 / 9; width: 100%; height: auto; border-radius: 0; background: var(--bg-0); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
#shareDialog .source-thumb img { width: 100%; height: 100%; object-fit: cover; }
#shareDialog .source-name { padding: 10px 12px; font: 600 14px var(--font); color: var(--text-2); }
#shareDialog .source:has(input:checked) .source-name { color: var(--text); }
#shareDialog .source.surface .source-thumb { color: var(--text-2); }
#shareDialog .source.surface:has(input:checked) .source-thumb { color: var(--magenta); }
.share-bar { display: flex; align-items: center; gap: 14px; padding: 14px 22px 14px 28px; background: var(--bg-0); border-top: 1px solid var(--line); flex-wrap: wrap; }
.share-bar .seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.share-bar .seg button { padding: 7px 13px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font: 600 13.5px var(--font); box-shadow: none; }
.share-bar .seg button:hover { color: var(--text); }
.share-bar .seg button.on { background: var(--bg-3); color: var(--text); box-shadow: 0 2px 6px #0005; }
.share-bar label.toggle.share-audio { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0; padding: 0; text-transform: none; letter-spacing: 0; font: 600 14px var(--font); color: var(--text); cursor: pointer; }
.share-bar label.toggle.share-audio b { font-weight: 600; }
.share-sp { flex: 1; }
.share-bar .share-cancel { height: 42px; padding: 0 16px; border-radius: 11px; background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.share-bar .share-cancel:hover { color: var(--text); border-color: var(--muted); }
.share-bar #shareGo { height: 42px; padding: 0 20px; border-radius: 11px; font: 700 15px var(--font); box-shadow: 0 0 20px color-mix(in srgb, var(--magenta) calc(35% * var(--glow)), transparent); }
.share-bar #shareGo .live-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgb(0 0 0 / .15); }
.share-bar #shareGo:disabled { opacity: .5; box-shadow: none; }
@media (max-width: 760px) {
  #shareDialog .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-head { flex-wrap: wrap; }
  .share-bar .share-sp { display: none; }
  .share-bar #shareGo { margin-left: auto; }
}
dialog form#shareForm { padding: 0; gap: 0; }
#shareForm small[hidden] { display: none !important; }
.share-head h2 { text-transform: none; letter-spacing: 0; }
.share-bar { flex-wrap: nowrap; }
@media (max-width: 860px) { .share-bar { flex-wrap: wrap; } }

/* ===== Lecteur des vidéos du tchat (même style que celui du bot) ===== */
.bv-frame.cv { display: block; flex: none; border-radius: var(--r-m); border: 1px solid var(--line); line-height: 0; }
.bv-frame.cv video.file-video { display: block; width: auto; max-width: 100%; max-height: 420px; min-width: 320px; min-height: 180px; border: 0; border-radius: 0; object-fit: contain; cursor: pointer; }
.bv-frame.cv .bv-bar { line-height: normal; padding: 30px 12px 9px; gap: 10px; }
.bv-frame.cv .bv-btn { width: 32px; height: 32px; }
.bv-frame.cv .bv-time { font-size: 12px; }
.bv-frame.cv .bv-vol input { width: 70px; }
.bv-big { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bot, #9d8af5) 88%, transparent); color: #fff; cursor: pointer; line-height: 0;
  box-shadow: 0 0 0 6px rgb(0 0 0 / .25), 0 0 26px color-mix(in srgb, var(--bot, #9d8af5) 55%, transparent); transition: transform .15s, opacity .2s; }
.bv-big:hover { transform: scale(1.08); }
.bv-big svg { margin-left: 3px; }
.bv-frame.cv:not(.paused) .bv-big { opacity: 0; pointer-events: none; transform: scale(.8); }
.bv-frame.cv.loading .bv-big { opacity: 0; }
.bv-frame.cv .bv-loading { line-height: normal; font-size: 13.5px; }
.bv-frame.cv:fullscreen { border: 0; }
.bv-frame.cv:fullscreen video.file-video { width: 100%; height: 100%; max-height: none; max-width: none; }
.file-vbox .file-vbar { z-index: 3; }
@media (max-width: 760px) { .bv-frame.cv video.file-video { min-width: 0; } }

/* Alignement optique des badges : centrés sur la hauteur des majuscules du texte (pas sur la boîte de la ligne,
   qui inclut la place des jambages et place l'icône trop bas). Bas de l'icône sur la ligne de base, puis
   descente de (taille − hauteur des majuscules) / 2. */
.msg .meta .role-badge, .msg .meta .app-badge,
.member .m-name .role-badge,
#members h3 .role-icon, #members h3 .role-dot {
  align-self: baseline !important; vertical-align: baseline !important; top: 0 !important;
  transform: translateY(calc((var(--bs, 1em) - .72em) / 2));
}
#members h3:has(.role-icon, .role-dot) { align-items: baseline; }
.member .m-text .m-name { align-items: baseline; }
.app-badge { animation-name: braiseBreathB; }
@keyframes braiseBreathB {
  0%, 100% { filter: drop-shadow(0 0 1px rgb(111 143 247 / .35)); }
  50% { filter: drop-shadow(0 0 3px rgb(111 143 247 / .55)) drop-shadow(0 0 6px rgb(166 184 251 / .25)); }
}
#members h3 .role-dot { --bs: 8px; }
.ctx-menu .ctx-sep { height: 1px; margin: 5px 6px; background: var(--line); }
.ctx-menu button.danger { color: var(--red); }
.ctx-menu button.danger:hover { background: var(--red); color: var(--on-accent-0a0a12); }
.ctx-menu button.danger svg { color: inherit !important; }

/* Sous-menus des menus contextuels */
.ctx-menu button.ctx-has-sub { display: flex; align-items: center; gap: 10px; }
.ctx-has-sub .ctx-sub-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.ctx-has-sub .ctx-sub-txt small { font-size: 11.5px; color: var(--muted); }
.ctx-has-sub > svg:last-child { transform: rotate(-90deg); color: var(--muted); flex: none; }
.ctx-menu button.ctx-has-sub.open { background: var(--active); color: var(--cyan-soft); }
.ctx-sub-menu { width: 250px; z-index: 71; }
.ctx-sub-menu button { padding-left: 12px; }

/* ===== Fiche de profil ===== */
#messages [data-profile] { cursor: pointer; }
#messages .author[data-profile]:hover { text-decoration: underline; }
.pcard { position: fixed; z-index: 65; width: 340px; border-radius: 16px; overflow: hidden; background: #13151d; border: 1px solid var(--line);
  box-shadow: 0 18px 50px #000c; color: var(--text-2); animation: pcIn .16s var(--ease); }
@keyframes pcIn { from { opacity: 0; transform: translate3d(0, 6px, 0); } to { opacity: 1; transform: none; } }
.pcard.no-anim { animation: none; }
.pc-banner { height: 140px; background-size: cover; background-position: center; position: relative; }
.pc-banner::after { content: ""; position: absolute; inset: 0 0 -1px; background: linear-gradient(180deg, transparent 45%, #13151d); }
.pcard .pc-av { position: absolute; left: 50%; top: 82px; margin-left: -46px; width: 92px; height: 92px; font-size: 36px; z-index: 2;
  border: 6px solid #13151d; box-sizing: content-box; margin-left: -52px; box-shadow: 0 0 0 2px rgb(111 143 247 / .55), 0 0 22px rgb(111 143 247 / .4); }
.pcard .pc-av > .dot { transform: scale(1.6); transform-origin: 85% 85%; }
.pc-body { padding: 58px 14px 14px; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.pc-name { font: 800 21px var(--font-title); color: var(--text); line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
.pc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: -3px; }
.pc-badges { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 8px; background: var(--bg-0); border: 1px solid var(--line); }
.pc-badges .app-badge { margin: 0; transform: none; }
.pc-since { font-size: 12px; color: var(--muted); }
.pc-login { font-size: 12px; color: var(--muted); margin-top: -4px; }
.pc-box { align-self: stretch; text-align: left; padding: 12px; border-radius: 12px; background: rgb(255 255 255 / .035); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pc-box hr { border: 0; height: 1px; background: var(--line); margin: 2px 0; }
.pc-sec { font: 700 11px var(--font-title); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: -3px; }
.pc-bio { font-size: 13.5px; line-height: 1.45; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.pc-addbio { align-self: flex-start; padding: 0; background: none; border: 0; color: var(--cyan-soft); font: 600 13px var(--font); }
.pc-addbio:hover { text-decoration: underline; background: none; }
.pc-roles { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-role { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; border-radius: 8px; background: var(--bg-0); border: 1px solid var(--line); font: 600 12.5px var(--font); color: var(--text-2); }
.pc-role .role-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pc-row { display: flex; gap: 8px; align-self: stretch; }
.pc-main { flex: 1; height: 40px; border-radius: 10px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--magenta); color: var(--on-accent-0a0a12); font: 700 14px var(--font);
  box-shadow: 0 0 16px color-mix(in srgb, var(--magenta) calc(30% * var(--glow)), transparent); }
.pc-main:hover { filter: brightness(1.08); background: var(--magenta); }
.pc-more { width: 40px; height: 40px; flex: none; padding: 0; border-radius: 10px; display: grid; place-items: center; background: var(--bg-3); color: var(--text); border: 1px solid var(--line); }
.pc-more:hover { border-color: var(--muted); }
@media (max-width: 520px) { .pcard { width: calc(100vw - 16px); } }
/* Paramètres : bannière et bio */
.banner-edit { display: flex; gap: 16px; align-items: center; margin: 6px 0 14px; }
.banner-preview { width: 250px; height: 100px; border-radius: 12px; background-size: cover; background-position: center; border: 1px solid var(--line); flex: none; }
.banner-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.banner-side b { color: var(--text); }
.profile-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
label.bio-field textarea { min-height: 76px; resize: vertical; font: 400 14.5px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); padding: 10px 12px; border-radius: 10px; }
.bio-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 4px; }
.crop.rect .crop-ring { border-radius: 10px; }
.crop.rect .crop-pv { border-radius: 8px; }
@media (max-width: 560px) { .banner-edit { flex-direction: column; align-items: stretch; } .banner-preview { width: 100%; } }

.pc-line .bot-tag { margin: 0; }
.pc-cmds { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: baseline; }
.pc-cmd { display: contents; font-size: 13px; }
.pc-cmd code { font: 700 12.5px var(--font-mono, ui-monospace, monospace); color: var(--bot, #a28bf5); background: color-mix(in srgb, var(--bot, #a28bf5) 14%, transparent); padding: 1px 6px; border-radius: 5px; }
.pc-cmd .arg { font-size: 12px; color: var(--muted); font-style: italic; }
.pc-cmd .what { color: var(--text-2); font-size: 13px; }
.pc-cmd code { justify-self: start; }
.pc-second { flex: 1; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg-3); color: var(--text); border: 1px solid var(--line); font: 600 14px var(--font); }
.pc-second:hover { border-color: var(--muted); }

/* ===== Catégorie en bannière ===== */
.cat-frame { margin: 10px 2px 8px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--bg-0); }
/* 64 px ouverte, bande de 34 px fermée. Dégradé sombre sur toutes les bannières (nom affiché ou non) pour
   harmoniser les images ; flèche dans une pastille sombre, lisible sur n'importe quelle image. */
.cat-frame .category.cat-banner { height: 64px; padding: 0 38px 8px 12px; align-items: flex-end; background-size: cover; background-position: center; position: relative;
  text-transform: none; letter-spacing: 0; color: #fff; gap: 6px; }
.cat-frame .category.cat-banner.collapsed { height: 34px; align-items: center; padding-bottom: 0; }
.cat-frame .category.cat-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .08) 0%, rgb(0 0 0 / .18) 50%, rgb(0 0 0 / .58) 100%); }
.cat-frame .category.cat-banner > * { position: relative; }
.cat-frame .category.cat-banner .name { display: flex; align-items: center; gap: 7px; font: 800 14.5px var(--font-title); text-shadow: 0 1px 6px #000c; min-width: 0; }
.cat-frame .category.cat-banner .cat-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-frame .category.cat-banner > .arrow { position: absolute; right: 6px; bottom: 5px; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #fff;
  background: rgb(10 11 14 / .62); border: 1px solid rgb(255 255 255 / .16); box-shadow: 0 2px 6px #0007; transform: none; transition: none; }
.cat-frame .category.cat-banner > .arrow svg { display: block; transition: transform .2s var(--ease); }
.cat-frame .category.cat-banner.collapsed > .arrow svg { transform: rotate(-90deg); }
.cat-frame .category.cat-banner:hover { color: #fff; filter: brightness(1.08); }
.cat-frame .category.cat-banner.no-name .name { display: none; }
.cat-frame-body { padding: 5px 4px; }
.cat-frame.collapsed .cat-frame-body:empty { display: none; }
.cat-frame .category.drop-into { box-shadow: inset 0 0 0 2px var(--cyan); }
/* Fenêtre « Modifier la catégorie » */
.cat-style { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cat-style-opts { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-0); border: 1px solid var(--line); align-self: flex-start; }
.cat-style-opt { padding: 7px 14px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font: 600 13.5px var(--font); box-shadow: none; }
.cat-style-opt.on { background: var(--bg-3); color: var(--text); box-shadow: 0 2px 6px #0005; }
.cat-banner-edit { display: flex; flex-direction: column; gap: 8px; }
.cat-banner-edit[hidden] { display: none; }
.cat-style-prev { height: 64px; width: 250px; max-width: 100%; border-radius: 12px; background-size: cover; background-position: center; position: relative; display: flex; align-items: flex-end; padding: 0 12px 8px; box-sizing: border-box; overflow: hidden; border: 1px solid var(--line); }
.cat-style-prev span { position: relative; font: 800 14.5px var(--font-title); color: #fff; text-shadow: 0 1px 6px #000c; }
.cat-style-prev::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .08) 0%, rgb(0 0 0 / .18) 50%, rgb(0 0 0 / .58) 100%); }
dialog .cat-banner-edit label.toggle { flex-direction: row; align-items: center; gap: 12px; text-transform: none; letter-spacing: 0; font: 500 14px var(--font); color: var(--text); }
dialog .cat-banner-edit label.toggle > span:first-child { flex: 1; }

/* Recadrage : vide transparent autour d'une image dézoomée */
.crop.alpha .crop-canvas, .crop.alpha .crop-pv {
  background-color: #2a2a30;
  background-image: linear-gradient(45deg, #3a3a42 25%, transparent 25%, transparent 75%, #3a3a42 75%), linear-gradient(45deg, #3a3a42 25%, transparent 25%, transparent 75%, #3a3a42 75%);
  background-size: 14px 14px; background-position: 0 0, 7px 7px;
}

.rail-dl .rail-btn { color: var(--muted); }
.rail-dl .rail-btn:hover { color: var(--on-accent-0a0a12); }

/* YouTube Shorts : cadre vertical à gauche, infos à droite */
/* Short : la vidéo verticale seule, titre et chaîne posés dessus (façon appli Shorts) */
.embed-youtube.embed-short { width: 200px; border-radius: 14px; }
.embed-yt.short { width: 100%; flex: none; aspect-ratio: 9 / 16; }
.embed-yt.short .embed-cover { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: center; }
.embed-yt.short .embed-play { width: 48px; height: 34px; border-radius: 10px; top: 46%; }
.embed-short-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgb(0 0 0 / .45) 0, transparent 22%, transparent 48%, rgb(0 0 0 / .85) 100%); }
.embed-short-tag { position: absolute; left: 9px; top: 9px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: 999px;
  background: #ff0033; color: #fff; font: 800 11px var(--font-title); letter-spacing: .04em; text-transform: uppercase; pointer-events: none; }
.embed-short-tag svg { fill: currentColor; stroke: none; }
.embed-short-over { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.embed-short-title { color: #fff; font-weight: 700; font-size: 13.5px; line-height: 1.3; text-shadow: 0 1px 4px rgb(0 0 0 / .8);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.embed-short-by { display: flex; align-items: center; gap: 6px; color: #e4e4e8; font-size: 12px; text-shadow: 0 1px 3px rgb(0 0 0 / .8); }
.embed-short-by::before { content: ''; width: 11px; height: 11px; border-radius: 3px; background: #ff0033; flex: none; }
@media (max-width: 480px) { .embed-youtube.embed-short { width: 160px; } .embed-short-title { font-size: 12.5px; } }

/* Conversation privée : « Vu » */
.seen-mark { display: flex; align-items: center; justify-content: flex-end; gap: 5px; padding: 0 22px 4px 0; margin-top: -2px; font-size: 11.5px; color: var(--muted); animation: seen-in .35s ease-out; }
.seen-mark svg { color: var(--cyan); }
@keyframes seen-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .seen-mark { animation: none; } }

/* Short : bouton agrandir + lecteur en grand */
.embed-expand { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: #000a; color: #fff;
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; z-index: 2; }
.embed-yt.short:hover .embed-expand, .embed-expand:focus-visible { opacity: 1; }
.embed-expand:hover { background: #000d; }
.embed-expand svg, .short-close svg { display: block; }
@media (hover: none) { .embed-expand { opacity: 1; } }
.short-viewer { position: fixed; inset: 0; z-index: 9000; background: rgb(0 0 0 / .86); display: grid; place-items: center; animation: seen-in .2s ease-out; }
.short-stage { position: relative; height: min(92vh, 900px); aspect-ratio: 9 / 16; max-width: 94vw; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 20px 80px #000a; }
.short-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.short-cap { position: absolute; left: 0; right: 0; top: 0; padding: 12px 56px 28px 14px; display: flex; flex-direction: column; gap: 2px; pointer-events: none;
  background: linear-gradient(180deg, rgb(0 0 0 / .7), transparent); color: #fff; font-size: 13px; opacity: 0; animation: short-cap 4s .4s ease both; }
.short-cap b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.short-cap span { opacity: .75; font-size: 12px; }
@keyframes short-cap { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.short-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 0; background: #ffffff22; color: #fff; display: grid; place-items: center; cursor: pointer; }
.short-close:hover { background: #ffffff44; }

/* Statut personnalisé */
.m-custom, .pc-custom, .up-act.custom { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--muted); font-weight: 500; overflow: hidden; white-space: nowrap; }
.m-custom .cs-text, .up-act.custom .cs-text { overflow: hidden; text-overflow: ellipsis; }
.up-act.custom { color: var(--muted); }
.cs-emoji { flex: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 13px; line-height: 1; }
.pc-custom { align-self: center; justify-content: center; margin: 8px auto 0; padding: 4px 12px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); max-width: 100%; }
.member.offline .m-custom { display: none; }
.st-custom .st-cs-ic { width: 12px; flex: none; text-align: center; font-size: 15px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cs-dialog { display: flex; flex-direction: column; gap: 10px; min-width: min(420px, 80vw); }
.cs-row { display: flex; gap: 8px; }
.cs-emoji-in { width: 52px; text-align: center; font-size: 20px; padding: 8px 4px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cs-text-in { flex: 1; min-width: 0; }
.cs-count { align-self: flex-end; margin-top: -6px; color: var(--muted); font-size: 11.5px; }
.cs-quick { display: flex; flex-wrap: wrap; gap: 2px; }
.cs-quick button { width: 32px; height: 32px; padding: 0; font-size: 18px; background: transparent; border-radius: var(--r-s); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cs-quick button:hover { background: var(--hover); }
.cs-sugg { display: flex; flex-direction: column; gap: 4px; }
.cs-pre { display: flex; align-items: center; gap: 10px; justify-content: flex-start; text-align: left; padding: 7px 10px; background: transparent; border: 1px solid var(--line); border-radius: var(--r-m); }
.cs-pre:hover { background: var(--hover); }
.cs-durrow { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 13px; }
.cs-clear { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--red, #f04a4a); font-size: 12.5px; cursor: pointer; }
.cs-clear:hover { text-decoration: underline; }

/* Bandeaux : mise à jour de l'application, client à recompiler (administrateur) */
#noticeStack { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 9500; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.notice { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg-3); border: 1px solid var(--line);
  box-shadow: 0 14px 40px #0009; animation: notice-in .35s cubic-bezier(.22,1,.36,1); }
@keyframes notice-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.notice.update { border-color: color-mix(in srgb, var(--cyan) 50%, var(--line)); }
.notice.compile { border-color: color-mix(in srgb, #e2b14d 55%, var(--line)); }
.notice-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--cyan) 18%, var(--bg-2)); color: var(--cyan); }
.notice.compile .notice-ic { background: color-mix(in srgb, #e2b14d 18%, var(--bg-2)); color: #e2b14d; }
.notice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notice-text b { font-size: 14px; color: var(--text); }
.notice-text small { color: var(--muted); font-size: 12.5px; }
.notice-acts { display: flex; gap: 8px; flex: none; }
.notice button { padding: 7px 14px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .notice { animation: none; } }

/* Mise à jour : bouton vert dans le rail (reste tant que la mise à jour n'est pas faite) et sa bulle */
@keyframes updIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.upd-call { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 7px 10px; border-radius: 9px; }
.upd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.upd-row { display: flex; gap: 8px; justify-content: flex-end; }
.rail-upd .rail-btn { color: var(--green); background: color-mix(in srgb, var(--green) 18%, var(--bg-2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 55%, transparent); animation: updPulse 1.8s ease-in-out infinite; }
.rail-upd .rail-btn:hover { background: var(--green); color: #06140c; }
@keyframes updPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 0%, transparent); } }
.upd-tip { position: fixed; z-index: 9600; width: 280px; padding: 14px; border-radius: 14px; background: var(--bg-3); border: 1px solid var(--line); box-shadow: 0 12px 34px #0009;
  display: flex; flex-direction: column; gap: 8px; animation: updIn .2s ease; }
.upd-tip::before { content: ''; position: absolute; left: -7px; top: 22px; width: 12px; height: 12px; background: var(--bg-3); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.upd-tip b { font-size: 14px; color: var(--text); }
.upd-tip small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.upd-green { border: 0; border-radius: 9px; padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; background: var(--green); color: #06140c; }
.upd-green:disabled { opacity: .6; cursor: default; }
@media (prefers-reduced-motion: reduce) { .upd-tip, .rail-upd .rail-btn { animation: none; } }

/* Sélecteur de GIF (GIPHY) */
.gif-btn span { font: 800 11px var(--font-title); letter-spacing: .03em; padding: 2px 5px; border-radius: 5px; border: 1.6px solid currentColor; line-height: 1; }
.gif-btn.on { color: var(--cyan) !important; background: var(--active); }
.gif-picker { position: absolute; right: 20px; bottom: calc(100% + 8px); z-index: 60; width: 420px; height: min(460px, 62vh); display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line-strong, var(--line)); border-radius: 14px; box-shadow: 0 16px 48px #000a; overflow: hidden;
  animation: gifIn .18s cubic-bezier(.2,.8,.2,1); }
.gif-picker.hidden { display: none; }
@keyframes gifIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.gif-head { display: flex; gap: 6px; align-items: center; padding: 10px 10px 6px; }
.gif-search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border-radius: 9px; background: var(--bg-0); color: var(--muted); }
.gif-search input { flex: 1; min-width: 0; background: none; border: 0; box-shadow: none; padding: 0; height: 100%; color: var(--text); font-size: 14px; }
.gif-search input:focus { outline: none; box-shadow: none; }
.gif-tabs { display: flex; gap: 4px; padding: 0 10px 8px; }
.gif-tabs.hidden { display: none; }
.gif-tabs button { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: transparent; color: var(--muted); }
.gif-tabs button.on { background: var(--active); color: var(--text); }
.gif-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 10px; }
.gif-cols { columns: 2; column-gap: 6px; }
.gif-tile { position: relative; display: block; width: 100%; padding: 0; margin: 0 0 6px; border-radius: 8px; overflow: hidden; background: var(--bg-3); break-inside: avoid; cursor: pointer; }
.gif-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gif-tile:hover { outline: 2px solid var(--cyan); outline-offset: -2px; }
.gif-tile:active:not(:disabled) { transform: scale(.98); }
.gif-star { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #000a; color: #fff;
  opacity: 0; transition: opacity .12s, transform .12s; }
.gif-tile:hover .gif-star, .gif-star.on { opacity: 1; }
.gif-star:hover { transform: scale(1.1); }
.gif-star.on { color: #ffd24d; }
.gif-star.on svg { fill: currentColor; }
.gif-empty { column-span: all; padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gif-foot { flex: none; padding: 6px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-align: right; border-top: 1px solid var(--line); text-transform: uppercase; }
@media (hover: none) { .gif-star { opacity: 1; } }
@media (max-width: 760px) {
  .gif-picker { left: 8px; right: 8px; width: auto; height: min(70vh, 520px); }
}
@media (prefers-reduced-motion: reduce) { .gif-picker { animation: none; } }

/* ===== Médiathèque (Plex) ===== */
#rail .rail-item.rail-media .rail-btn { color: #e5a00d; }
#rail .rail-item.rail-media.active .rail-btn, #rail .rail-item.rail-media .rail-btn:hover { background: #e5a00d; color: #15120a; }
#mediaView { position: fixed; top: 0; bottom: 0; left: 72px; right: 0; z-index: 30; display: grid; grid-template-columns: var(--side-w, 322px) minmax(0, 1fr); background: var(--bg-2); }
#mediaView[hidden] { display: none; }
/* Ambiance Plex : anthracite, lueur dorée en haut à droite et braise en bas à gauche, accents dorés. */
#mediaView { --md-bg: #141516; --md-line: #26282b;
  background: radial-gradient(1100px 560px at 75% -15%, #e5a00d4d, transparent 62%), radial-gradient(800px 520px at 5% 115%, #c2410c2e, transparent 60%), var(--md-bg); }
#mediaView .md-side { background: linear-gradient(180deg, #e5a00d2e, transparent 260px), #0e0f10; border-right-color: var(--md-line); }
#mediaView .md-head, #mediaView .md-src { border-color: var(--md-line); }
#mediaView .md-plex { background: #e5a00d; color: #1a1406; }
#mediaView .md-top { background: rgb(20 21 22 / .72); backdrop-filter: blur(14px); border-bottom-color: var(--md-line); }
#mediaView .md-link:hover { background: #ffffff0a; }
#mediaView .md-link.on { background: linear-gradient(90deg, #e5a00d33, #e5a00d08); color: #f6cf6e; }
#mediaView .md-tab.on { background: #e5a00d; color: #1a1406; }
#mediaView .md-search, #mediaView .md-genre { background: #0c0d0e; border-color: var(--md-line); }
#mediaView .md-card:hover .md-p, #mediaView .md-card:focus-visible .md-p { box-shadow: 0 0 0 2px #e5a00d, 0 12px 28px #e5a00d33; }
#mediaView .md-wide { background: #0e0f10; border-color: var(--md-line); }
#mediaView .md-wide:hover { border-color: #e5a00d; }
#mediaView .md-btn.play { background: #e5a00d; color: #1a1406; }
#mediaView .md-btn.play:hover { background: #f0b232; }
#mediaView .md-ep:hover { background: #ffffff0a; }
#mediaView .md-hero::after { background: linear-gradient(90deg, var(--md-bg) 6%, rgb(20 21 22 / .8) 42%, rgb(20 21 22 / .3)), linear-gradient(0deg, var(--md-bg), transparent 50%); }
.md-side { background: var(--bg-1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.md-head { height: 48px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.md-plex { font-size: 11px; font-weight: 700; color: #e5a00d; background: #e5a00d1f; padding: 2px 7px; border-radius: 6px; }
.md-head .md-close { margin-left: auto; }
.md-nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.md-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); color: var(--muted); font: 500 14px var(--font); background: none; border: 0; box-shadow: none; text-align: left; cursor: pointer; }
.md-link:hover { background: var(--hover); color: var(--text-2); }
.md-link.on { background: var(--active); color: var(--text); }
.md-link small { margin-left: auto; font-size: 12px; color: var(--muted); }
.md-src { margin-top: auto; padding: 12px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.md-main { overflow-y: auto; min-height: 0; position: relative; }
.md-top { position: sticky; top: 0; z-index: 2; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.md-top h1 { font-size: 16px; margin: 0; white-space: nowrap; }
.md-tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.md-top .md-tabs { margin-left: 10px; }
.md-tab { padding: 5px 12px; border-radius: 7px; font: 600 13.5px var(--font); color: var(--muted); background: none; border: 0; box-shadow: none; cursor: pointer; }
.md-tab:hover { color: var(--text-2); }
.md-tab.on { background: var(--bg-3); color: var(--text); }
.md-genre { height: 30px; margin-left: 6px; border-radius: 7px; background: var(--bg-0); border: 1px solid var(--line); color: var(--text-2); font: 500 13px var(--font); padding: 0 8px; }
.md-search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; width: 260px; height: 34px; color: var(--muted); }
.md-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 400 13.5px var(--font); padding: 0; box-shadow: none; }
.md-body { padding: 18px 22px 30px; }
.md-row { margin-bottom: 22px; }
.md-row-t { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 12px; }
.md-row-t h2 { font-size: 15px; margin: 0; }
.md-row-t span { font-size: 12.5px; color: var(--muted); }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; }
.md-card { display: block; text-align: left; background: none; border: 0; padding: 0; box-shadow: none; color: inherit; cursor: pointer; min-width: 0; }
.md-p { aspect-ratio: 2/3; border-radius: 9px; overflow: hidden; position: relative; background: var(--bg-3); box-shadow: 0 4px 14px #0006; transition: transform .15s var(--ease), box-shadow .15s; }
.md-p img, .md-art img, .md-pp img, .md-ep-art img, .md-hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.md-p img, .md-art img, .md-pp img, .md-ep-art img, .md-hero-bg img { opacity: 0; transition: opacity .35s var(--ease); }
.md-p img.ok, .md-art img.ok, .md-pp img.ok, .md-ep-art img.ok, .md-hero-bg img.ok { opacity: 1; }
.md-card:hover .md-p, .md-card:focus-visible .md-p { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--cyan), 0 10px 22px #0008; }
.md-n { font-size: 13.5px; font-weight: 600; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-y { font-size: 12px; color: var(--muted); }
.md-seen { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 50%; background: #e5a00d; display: grid; place-items: center; color: #15120a; box-shadow: 0 1px 4px #0008; }
.md-seen.inline { position: static; width: 16px; height: 16px; }
.md-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #ffffff2e; }
.md-bar i { display: block; height: 100%; background: #e5a00d; }
.md-cont { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.md-cont.all { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.md-wide { display: block; text-align: left; padding: 0; border-radius: 10px; overflow: hidden; background: var(--bg-0); border: 1px solid var(--line); color: inherit; cursor: pointer; box-shadow: none; }
.md-wide:hover { border-color: var(--cyan); }
.md-art { aspect-ratio: 16/9; position: relative; background: var(--bg-3); }
.md-wplay { position: absolute; inset: 0; margin: auto; width: 42px; height: 42px; border-radius: 50%; background: #000a; color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.md-wide:hover .md-wplay, .md-ep-art:hover .md-wplay { opacity: 1; }
.md-wt { padding: 8px 11px 10px; }
.md-wt b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-wt small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.md-none { color: var(--muted); font-size: 14px; }
.md-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; padding: 30px; }
.md-empty h2 { color: var(--text); margin: 6px 0 0; font-size: 18px; }
.md-empty p { margin: 0 0 10px; max-width: 420px; }
.md-loading { height: 160px; display: grid; place-items: center; }
.md-loading::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #ffffff26; border-top-color: #e5a00d; animation: md-spin .8s linear infinite; }
@keyframes md-spin { to { transform: rotate(360deg); } }
/* Fiche */
.md-hero { position: relative; min-height: 380px; overflow: hidden; }
.md-hero-bg { position: absolute; inset: -40px; filter: blur(18px) saturate(1.2); opacity: .75; }
.md-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg-2) 6%, rgb(30 31 35 / .82) 42%, rgb(30 31 35 / .35)), linear-gradient(0deg, var(--bg-2), transparent 50%); }
.md-hero-in { position: relative; z-index: 1; display: flex; gap: 28px; padding: 26px 30px 24px; align-items: flex-end; }
.md-pp { width: 200px; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px #000a; flex: none; background: var(--bg-3); }
.md-info { min-width: 0; }
.md-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; padding: 4px 8px 4px 4px; border-radius: 6px; background: #ffffff12; border: 0; box-shadow: none; color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; }
.md-back svg { transform: rotate(90deg); }
.md-back:hover { background: #ffffff22; color: var(--text); }
.md-info h1 { font-size: 30px; margin: 0 0 4px; line-height: 1.15; }
.md-tagline { color: var(--text-2); font-style: italic; margin-bottom: 8px; }
.md-meta { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 13.5px; margin: 6px 0 12px; flex-wrap: wrap; }
.md-dot { color: var(--muted); }
.md-chip { border: 1px solid #ffffff33; border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.md-syn { max-width: 640px; color: var(--text-2); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }
.md-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.md-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 9px; font: 600 14px var(--font); border: 0; cursor: pointer; box-shadow: none; }
.md-btn.play { background: #fff; color: #111; }
.md-btn.play:hover { background: #e9e9ee; }
.md-btn.ghost { background: #ffffff1a; color: #fff; border: 1px solid #ffffff26; }
.md-btn.ghost:hover { background: #ffffff2a; }
.md-cast { display: flex; gap: 14px 30px; padding: 4px 30px 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.md-cast b { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }
.md-eps { padding: 18px 30px 30px; }
.md-eplist { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.md-ep { display: flex; gap: 16px; padding: 10px; border-radius: 10px; align-items: flex-start; }
.md-ep:hover { background: var(--hover); }
.md-ep.seen .md-ep-t b { color: var(--text-2); }
.md-ep-art { width: 200px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; position: relative; flex: none; background: var(--bg-3); cursor: pointer; }
.md-ep-t { min-width: 0; flex: 1; }
.md-ep-dl { margin-left: auto; opacity: 0; transition: opacity .15s; }
.md-ep:hover .md-ep-dl, .md-ep-dl:focus-visible { opacity: 1; }
@media (hover: none) { .md-ep-dl { opacity: 1; } }
.md-ep-h { display: flex; align-items: center; gap: 10px; }
.md-ep-h b { font-size: 14.5px; }
.md-ep-h span:not(.md-seen) { color: var(--muted); font-size: 12.5px; }
.md-ep-t p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Lecteur */
.md-player { position: fixed; inset: 0; z-index: 55; background: #000; outline: none; }
.md-player[hidden] { display: none; }
.md-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.md-player .mp-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 14px 16px 30px; background: linear-gradient(0deg, #0000, #000b); color: #fff; opacity: 0; transition: opacity .2s; }
.mp-title { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-title span { color: #ffffffb0; }
.md-player .mp-bar { opacity: 0; }
.md-player.active .mp-top, .md-player.active .mp-bar, .md-player.paused .mp-top, .md-player.paused .mp-bar, .md-player:focus-within .mp-bar:hover { opacity: 1; }
.md-player:not(.active):not(.paused) { cursor: none; }
.md-player .bv-seek { --fill: #e5a00d; }
.md-player.muted .mp-mute { background: #e5646f88; }
.mp-wait { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
/* Avancement de la conversion de Plex : barre à couches (vu · reçu · converti) et carte de préparation */
.mp-track { flex: 1; min-width: 60px; position: relative; display: flex; align-items: center; --b0: 0; --b1: 0; --c0: 0; --c1: 0; }
.mp-track::before, .mp-conv, .mp-buf { content: ""; position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; pointer-events: none; }
.mp-track::before { left: 7px; right: 7px; background: #ffffff26; }
.mp-conv { display: none; left: calc(7px + (100% - 14px) * var(--c0)); width: calc((100% - 14px) * (var(--c1) - var(--c0)));
  background: repeating-linear-gradient(135deg, #ffffff40 0 6px, #ffffff1c 6px 12px); }
.mp-track.has-conv .mp-conv { display: block; }
.mp-buf { left: calc(7px + (100% - 14px) * var(--b0)); width: calc((100% - 14px) * (var(--b1) - var(--b0))); background: #ffffff66; }
.md-player .mp-track .bv-seek { flex: 1; position: relative; z-index: 1;
  background: linear-gradient(to right, var(--fill) var(--p, 0%), transparent var(--p, 0%)) center / calc(100% - var(--th)) 4px no-repeat; }
.mp-tip { display: none; position: absolute; bottom: 22px; left: calc(7px + (100% - 14px) * var(--c1)); transform: translateX(-50%); z-index: 2;
  background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 9px; font-size: 12px; color: var(--text-2);
  white-space: nowrap; box-shadow: 0 6px 18px #0009; pointer-events: none; }
.mp-tip b { color: #f6cf6e; }
.mp-track.has-conv:hover .mp-tip { display: block; }
.mp-card { display: none; width: 340px; max-width: calc(100% - 40px); background: #0e0f10e6; border: 1px solid #ffffff1a; border-radius: 14px;
  padding: 18px 20px; text-align: center; color: #fff; backdrop-filter: blur(6px); box-shadow: 0 12px 40px #000a; }
.mp-wait.card > .mp-spin { display: none; }
.mp-wait.card .mp-card { display: block; }
.mp-card .mp-spin { display: block; width: 34px; height: 34px; margin: 0 auto 12px; border-width: 4px; }
.mp-card b { font-size: 15px; }
.mp-why { margin: 4px 0 12px; color: #c9cacf; font-size: 13px; }
.mp-prog { height: 6px; border-radius: 3px; background: #ffffff1f; overflow: hidden; }
.mp-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e5a00d, #f6cf6e); transition: width .6s var(--ease); }
.mp-prog.busy i { width: 35%; animation: mp-busy 1.2s ease-in-out infinite; }
@keyframes mp-busy { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.mp-info { display: block; margin-top: 8px; color: #8e9098; font-size: 12px; line-height: 1.4; }
.mp-info.slow { color: #f0a36b; }
.mp-wait.hidden, .mp-err.hidden, .mp-menu.hidden { display: none; }
.mp-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #ffffff2a; border-top-color: #e5a00d; animation: md-spin .8s linear infinite; }
.mp-err { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; background: #000c; text-align: center; padding: 20px; }
.mp-err p { margin: 0; max-width: 560px; user-select: text; }
.mp-menu { position: absolute; right: 14px; bottom: 66px; width: 270px; max-height: 60vh; overflow-y: auto; background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px #000a; z-index: 2; }
.mp-mh { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 10px 4px; }
.mp-mi { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; background: none; border: 0; box-shadow: none; color: var(--text-2); font: 500 13.5px var(--font); text-align: left; cursor: pointer; }
.mp-mi span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-mi:hover { background: var(--hover); color: var(--text); }
.mp-mi.on { color: var(--text); }
.mp-mi svg { color: #e5a00d; }
@media (max-width: 760px) {
  #mediaView { left: 0; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .md-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .md-nav { flex-direction: row; overflow-x: auto; padding: 6px 8px; }
  .md-link { white-space: nowrap; }
  .md-src { display: none; }
  .md-top { height: auto; flex-wrap: wrap; padding: 10px 14px; }
  .md-search { width: 100%; margin-left: 0; }
  .md-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px 10px; }
  .md-cont { grid-template-columns: 1fr; }
  .md-hero-in { flex-direction: column; align-items: flex-start; padding: 18px; }
  .md-pp { width: 130px; }
  .md-ep-art { width: 130px; }
  .md-cast, .md-eps { padding-left: 18px; padding-right: 18px; }
}
