/* ============================================================
   Chiffré — feuille de style (thème sombre premium)
   ============================================================ */
:root {
  --bg: #0a0c12;
  --bg-2: #0e1119;
  --panel: #12151f;
  --panel-2: #171b28;
  --panel-3: #1e2434;
  --panel-hover: #212739;
  --border: #232a3d;
  --border-soft: #1b2130;
  --text: #eef1f7;
  --text-2: #aab2c5;
  --text-dim: #6b7488;
  --accent: #7c5cff;
  --accent-2: #9b7bff;
  --accent-hover: #6b49f0;
  --accent-soft: rgba(124, 92, 255, .14);
  --grad: linear-gradient(135deg, #7c5cff 0%, #5a7bff 100%);
  --bubble-me: linear-gradient(135deg, #6b4bf0 0%, #5257e6 100%);
  --bubble-them: #1c2234;
  --green: #34d399;
  --amber: #f5b544;
  --red: #f4614e;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
  --shadow: 0 10px 30px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;   /* iOS : pas de redimensionnement/zoom auto du texte */
  overscroll-behavior: none;        /* iOS : pas de rebond qui déplace toute la page */
}

button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--text-dim); font-weight: 400; font-size: .85em; }

/* Barres de défilement */
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #2b3350; background-clip: padding-box; }

/* ============================ Authentification ============================ */
.auth-view {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(90,123,255,.16), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 430px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 34px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo {
  width: 66px; height: 66px; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; border-radius: 20px;
  background: var(--grad);
  box-shadow: 0 12px 30px rgba(124,92,255,.4);
}
.auth-card h1 { margin: 14px 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.auth-tagline { color: var(--text-dim); font-size: 13px; line-height: 1.6; margin-bottom: 26px; }
.auth-tabs {
  display: flex; gap: 4px; background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 13px; padding: 5px; margin-bottom: 22px;
}
.auth-tab {
  flex: 1; padding: 11px; border: none; border-radius: 9px;
  background: transparent; color: var(--text-dim); font-size: 14px; font-weight: 600;
  transition: all .18s ease;
}
.auth-tab.active { background: var(--panel-3); color: #fff; box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 15px; text-align: left; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.auth-form input {
  padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 15px; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-warning, .auth-notice {
  font-size: 12px; border-radius: var(--radius-sm); padding: 11px 13px; line-height: 1.5;
}
.auth-warning { color: #f0c674; background: rgba(240,198,116,.07); border: 1px solid rgba(240,198,116,.22); }
.auth-notice { color: #9fd8c4; background: rgba(52,211,153,.07); border: 1px solid rgba(52,211,153,.22); }
.btn-primary {
  padding: 14px; border: none; border-radius: var(--radius-sm);
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(124,92,255,.32); transition: transform .12s, box-shadow .16s, filter .16s;
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 10px 28px rgba(124,92,255,.42); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: wait; filter: none; }
.btn-secondary {
  padding: 13px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text); font-size: 14px; transition: background .15s;
}
.btn-secondary:hover { background: var(--panel-3); }
.auth-error { margin-top: 14px; color: var(--red); font-size: 13px; }
.auth-busy { margin-top: 14px; color: var(--text-dim); font-size: 13px; }

/* ============================ Application ============================ */
.app-view { display: flex; height: 100dvh; background: var(--bg); overflow: hidden; }  /* 📱 l'app ne scroll pas en entier ; seule la liste .messages défile */

.sidebar {
  width: 340px; min-width: 280px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: relative;
}
.sidebar-header {
  display: flex; align-items: center; gap: 11px;
  padding: calc(15px + env(safe-area-inset-top, 0px)) 16px 15px; border-bottom: 1px solid var(--border);
}
.avatar {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff; flex-shrink: 0;
  text-transform: uppercase; user-select: none;
  box-shadow: 0 4px 12px rgba(124,92,255,.28);
}
.sidebar-me { flex: 1; min-width: 0; }
.me-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-status { font-size: 11px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-status.offline { color: var(--amber); }
.sidebar-actions { display: flex; gap: 1px; flex-shrink: 0; }
.icon-btn {
  background: transparent; border: none; font-size: 18px;
  width: 38px; height: 38px; border-radius: 11px; color: var(--text-2); line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

.search-box { position: relative; padding: 13px 14px 10px; }
.search-box input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--text); font-size: 14px; outline: none; transition: border-color .16s, box-shadow .16s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-results {
  position: absolute; left: 14px; right: 14px; top: calc(100% - 2px);
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; z-index: 30; box-shadow: var(--shadow);
}
.search-result {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; cursor: pointer; border: none; width: 100%;
  background: transparent; color: var(--text); font-size: 14px; text-align: left; transition: background .13s;
}
.search-result:hover { background: var(--panel-2); }
.search-result .avatar { width: 33px; height: 33px; font-size: 13px; border-radius: 10px; }

.conv-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.conv-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; cursor: pointer; border: none; width: 100%;
  background: transparent; text-align: left; color: var(--text);
  border-radius: 13px; transition: background .13s;
}
.conv-item:hover { background: var(--panel-2); }
.conv-item.active { background: var(--accent-soft); }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.conv-preview {
  font-size: 12.5px; color: var(--text-dim); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-badge {
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(124,92,255,.35);
}
.avatar-wrap { position: relative; flex-shrink: 0; }
.presence-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #4a5268; border: 2.5px solid var(--panel);
}
.presence-dot.online { background: var(--green); box-shadow: 0 0 0 2px rgba(52,211,153,.25); }
.conv-empty { padding: 34px 24px; text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1.7; }

/* Panneau « Mes amis » : avatar + pastille de présence en bas à droite */
.friends-list { display: flex; flex-direction: column; gap: 2px; }
.friend-row { align-items: center; gap: 11px; }
.friend-av { position: relative; flex-shrink: 0; }

/* ============================ Zone de chat ============================ */
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-2); }
.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  color: var(--text-dim); text-align: center; line-height: 1.7;
}
.chat-empty-icon {
  width: 92px; height: 92px; border-radius: 28px; font-size: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--border);
}
.chat-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px; border-bottom: 1px solid var(--border);
  background: rgba(18,21,31,.82); backdrop-filter: blur(12px);
}
.chat-header .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
.chat-back { display: flex; } /* toujours visible : permet de sortir d'une conversation */
.chat-peer { flex: 1; min-width: 0; }
.peer-name { font-weight: 700; font-size: 15px; }
.peer-status { font-size: 12px; color: var(--text-dim); min-height: 15px; }
.peer-status.online { color: var(--green); }
.chat-actions { display: flex; gap: 4px; }
.chat-actions .icon-btn { font-size: 19px; }

.messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px 8px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(124,92,255,.05), transparent 60%);
}
.day-sep {
  align-self: center; margin: 14px 0 10px;
  font-size: 11.5px; font-weight: 600; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--border-soft);
  padding: 4px 13px; border-radius: 999px; text-transform: capitalize;
}
.btn-load-more {
  align-self: center; margin: 4px 0 12px;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: 999px; font-size: 12.5px; transition: background .15s;
}
.btn-load-more:hover { background: var(--panel-3); }
.btn-load-more:disabled { opacity: .6; }
.sys-row {
  align-self: center; margin: 10px 0; padding: 6px 14px;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 999px;
  color: var(--text-dim); font-size: 12.5px; text-align: center;
}
.msg-row { display: flex; margin-top: 3px; align-items: flex-end; gap: 5px; }
.msg-row.them { justify-content: flex-start; }
.msg-row.me { justify-content: flex-end; }
/* Sur mes messages, le bouton menu passe à gauche de la bulle (sans casser l'alignement à droite) */
.msg-row.me .msg-menu-btn { order: -1; }
/* Regroupement : plus d'espace quand l'expéditeur change */
.msg-row.me + .msg-row.them, .msg-row.them + .msg-row.me { margin-top: 12px; }
.day-sep + .msg-row { margin-top: 2px; }
.msg-col { display: flex; flex-direction: column; max-width: min(78%, 560px); min-width: 0; }
.msg-row.me .msg-col { align-items: flex-end; }
.msg-row.them .msg-col { align-items: flex-start; }
.bubble {
  max-width: 100%;
  padding: 9px 13px 7px; border-radius: 18px;
  background: var(--bubble-them); font-size: 14.5px; line-height: 1.45;
  word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
  box-shadow: var(--shadow-sm); position: relative;
}
.msg-row.flash .bubble { animation: flash-bubble 1.3s ease; }
@keyframes flash-bubble {
  0%, 100% { box-shadow: var(--shadow-sm); }
  30% { box-shadow: 0 0 0 3px var(--accent); }
}

/* Bouton de menu contextuel du message */
.msg-menu-btn {
  background: transparent; border: none; color: var(--text-dim);
  width: 28px; height: 28px; border-radius: 8px; font-size: 18px; line-height: 1;
  opacity: 0; transition: opacity .14s, background .14s; flex-shrink: 0;
}
.msg-row:hover .msg-menu-btn { opacity: 1; }
.msg-menu-btn:hover { background: var(--panel-3); color: var(--text); }
@media (hover: none) { .msg-menu-btn { opacity: .55; } }

/* Réactions */
.reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.react-chip {
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; font-size: 12.5px; cursor: pointer; line-height: 1.5;
  transition: background .13s, border-color .13s;
}
.react-chip:hover { background: var(--panel-hover); }
.react-chip.mine { background: var(--accent-soft); border-color: var(--accent); }

/* Citation de réponse */
.reply-quote {
  border-left: 3px solid rgba(255,255,255,.45); padding: 3px 9px; margin-bottom: 6px;
  font-size: 12.5px; border-radius: 5px; background: rgba(0,0,0,.16); cursor: pointer;
  max-width: 100%; overflow: hidden;
}
.msg-row.them .reply-quote { border-left-color: var(--accent); }
.reply-quote .reply-author { display: block; font-weight: 700; font-size: 11px; opacity: .9; }
.reply-quote span:last-child { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Barre de réponse (composer) */
.reply-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-top: 1px solid var(--border); background: var(--panel);
}
.reply-bar-icon { font-size: 16px; }
.reply-bar-body { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 10px; }
.reply-bar-author { display: block; font-size: 11.5px; font-weight: 700; color: var(--accent-2); }
.reply-bar-text { display: block; font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 📌 Barre du message épinglé (sous l'en-tête du chat) */
.pinned-bar {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 14px; border: none; border-bottom: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); text-align: left; cursor: pointer;
  font: inherit; transition: background .15s;
}
.pinned-bar:hover { background: var(--panel-hover); }
.pinned-bar[hidden] { display: none; }
.pinned-ic { font-size: 15px; flex-shrink: 0; }
.pinned-body { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 10px; }
.pinned-label { display: block; font-size: 11.5px; font-weight: 700; color: var(--accent-2); }
.pinned-text { display: block; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinned-x {
  flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-dim); font-size: 13px; transition: background .15s, color .15s;
}
.pinned-x:hover { background: var(--panel-3); color: var(--text); }
.pinned-x[hidden] { display: none; }
.pinned-list-btn {
  flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-dim); font-size: 13px; transition: background .15s, color .15s;
}
.pinned-list-btn:hover { background: var(--panel-3); color: var(--text); }
.pinned-list-btn[hidden] { display: none; }

/* 📌 Modale « voir toutes les épingles » */
.pin-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; margin-top: 6px; }
.pin-list-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.pin-list-text { flex: 1; min-width: 0; font-size: 14px; color: var(--text); cursor: pointer;
  border-left: 3px solid var(--accent); padding-left: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-list-badge { margin-right: 4px; }
.pin-list-x {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; color: var(--text-dim);
  font-size: 13px; transition: background .15s, color .15s;
}
.pin-list-x:hover { background: var(--panel-3); color: var(--text); }
.pin-list-empty { color: var(--text-dim); font-size: 14px; text-align: center; padding: 16px; }

/* Popup de menu (réagir / répondre / supprimer) */
.msg-popup {
  position: fixed; z-index: 250;
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 170px;
  animation: pop-in .13s ease;
}
.msg-popup .emoji-row {
  display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px;
}
.msg-popup .emoji-row button {
  background: transparent; border: none; font-size: 20px; padding: 5px; border-radius: 9px;
  transition: transform .1s, background .12s;
}
.msg-popup .emoji-row button:hover { background: var(--panel-hover); transform: scale(1.2); }
.popup-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); font-size: 13.5px; padding: 9px 11px; border-radius: 9px; transition: background .12s;
}
.popup-item:hover { background: var(--panel-2); }
.popup-item.danger { color: var(--red); }
.msg-row.me .bubble { background: var(--bubble-me); border-bottom-right-radius: 6px; color: #fff; }
.msg-row.them .bubble { border-bottom-left-radius: 6px; }
.bubble .msg-time {
  display: block; font-size: 10px; color: rgba(255,255,255,.5);
  margin-top: 3px; text-align: right; user-select: none;
}
.msg-row.them .bubble .msg-time { color: var(--text-dim); }
.bubble img, .bubble video {
  max-width: 100%; max-height: 400px; border-radius: 12px; display: block; margin-bottom: 4px;
}
.media-download {
  display: flex; align-items: center; gap: 9px;
  background: rgba(0,0,0,.22); padding: 11px 13px; border-radius: 12px;
  border: none; color: inherit; font-size: 13.5px; cursor: pointer; width: 100%;
  text-align: left; transition: background .14s;
}
.media-download:hover { background: rgba(0,0,0,.34); }
.media-error { color: #ffb0a8; font-size: 13px; font-style: italic; }

.upload-progress { padding: 9px 18px; font-size: 13px; color: var(--accent-2); background: var(--panel); }
.mod-notice {
  padding: 8px 18px; font-size: 11.5px; color: var(--text-dim);
  background: var(--bg-2); border-top: 1px solid var(--border-soft); text-align: center;
}

.composer {
  display: flex; align-items: flex-end; gap: 9px;
  padding: 13px 16px; border-top: 1px solid var(--border); background: var(--panel);
}
.composer .icon-btn { width: 42px; height: 42px; font-size: 19px; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg-2); color: var(--text); padding: 12px 15px;
  font-size: 14.5px; outline: none; max-height: 150px; line-height: 1.45;
  transition: border-color .16s, box-shadow .16s;
}
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-send {
  background: var(--grad); border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 14px; font-size: 17px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(124,92,255,.35); transition: transform .12s, filter .15s;
}
.btn-send:hover { filter: brightness(1.08); }
/* 📌 Petite épingle sur une conversation épinglée */
.conv-pin-ic { font-size: 12px; flex-shrink: 0; opacity: .85; margin-left: 2px; }
/* ⬇️ Bouton « descendre en bas » de la conversation (flottant au-dessus du composer) */
.chat-pane { position: relative; }
.scroll-down {
  position: absolute; right: 16px; bottom: 84px; z-index: 15;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel-3); color: var(--text); font-size: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, background .15s, opacity .15s;
}
.scroll-down:hover { background: var(--panel-hover); }
.scroll-down:active { transform: scale(.93); }
.scroll-down[hidden] { display: none; }
.btn-send:active { transform: scale(.94); }

/* Barre d'enregistrement vocal */
.rec-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-top: 1px solid var(--border); background: var(--panel);
}
.rec-bar .rec-label { flex: 1; color: var(--text-2); font-size: 14px; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); min-width: 44px; }
.rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 rgba(244,97,78,.6); animation: rec-pulse 1.2s infinite;
}
@keyframes rec-pulse {
  0% { box-shadow: 0 0 0 0 rgba(244,97,78,.6); }
  70% { box-shadow: 0 0 0 10px rgba(244,97,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(244,97,78,0); }
}

/* Message vocal dans une bulle */
.audio-msg { display: flex; align-items: center; gap: 8px; }
.audio-mic { font-size: 18px; flex-shrink: 0; }
.bubble audio { height: 40px; max-width: 240px; }
.msg-row.me .bubble audio { filter: invert(1) hue-rotate(180deg) brightness(1.1); }

/* ============================ Administration ============================ */
.admin-view { height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.admin-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.admin-header h2 { font-size: 18px; font-weight: 700; }
.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 13px; padding: 22px;
}
.stat-card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; text-align: center;
}
.stat-value { font-size: 27px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

.admin-tabs { display: flex; gap: 6px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.admin-tab {
  padding: 12px 18px; border: none; background: transparent; color: var(--text-dim);
  font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--text-2); }
.admin-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.admin-panel { flex: 1; overflow: auto; display: flex; flex-direction: column; }

.admin-table-wrap { flex: 1; overflow: auto; padding: 6px 22px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td {
  text-align: left; padding: 12px 13px; border-bottom: 1px solid var(--border-soft);
}
.admin-table th { color: var(--text-dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; position: sticky; top: 0; background: var(--bg); }
.admin-table tr:hover td { background: var(--panel); }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; display: inline-block; }
.badge.admin { background: var(--accent-soft); color: var(--accent-2); }
.badge.user { background: rgba(138,147,168,.14); color: var(--text-dim); }
.badge.bot { background: rgba(59,130,246,.16); color: #7cb0ff; }
.badge.ok { background: rgba(52,211,153,.14); color: var(--green); }
.badge.banned { background: rgba(244,97,78,.14); color: var(--red); }
.badge.premium { background: linear-gradient(135deg, rgba(245,197,24,.20), rgba(168,85,247,.18)); color: #f5c518; }
.premium-badge { color: #f5c518; font-weight: 700; margin-left: 4px; text-shadow: 0 0 6px rgba(245,197,24,.5); display: inline-block; animation: ultcGlow 2.4s ease-in-out infinite; }
@keyframes ultcGlow { 0%,100% { text-shadow: 0 0 5px rgba(245,197,24,.45); transform: scale(1); } 50% { text-shadow: 0 0 11px rgba(245,197,24,.95); transform: scale(1.16); } }
.premium-name { background: linear-gradient(90deg,#f5c518,#ffdf7e,#e0a800); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
.ultc-perks { list-style: none; padding: 10px 12px; margin: 8px 0 4px; display: grid; gap: 6px; font-size: 13px; color: var(--text-dim); background: rgba(245,197,24,.06); border: 1px solid rgba(245,197,24,.18); border-radius: 10px; }
.ultc-perks li { line-height: 1.4; }
.accent-picker { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.accent-lock { font-size: 12.5px; color: var(--text-dim); margin-right: 2px; }
.accent-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.16); cursor: pointer; padding: 0; }
.accent-sw.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.ultc-status { font-size: 13px; margin: 6px 0 10px; color: var(--text-dim); }
.ultc-status.ok { color: #f5c518; font-weight: 700; }
.ultc-refresh { background: rgba(138,147,168,.16); color: var(--text); border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; margin-top: 6px; }
.ultc-or { text-align: center; color: var(--text-dim); font-size: 12px; margin: 14px 0 8px; }
.ultc-fsox-row { display: flex; gap: 8px; margin-top: 6px; }
.ultc-fsox-row input { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border, rgba(138,147,168,.28)); background: rgba(0,0,0,.18); color: var(--text); font-size: 13px; }
.ultc-chooser { display: grid; gap: 8px; margin-top: 8px; }
.ultc-wallet-opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border, rgba(138,147,168,.28)); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; }
.ultc-wallet-opt:hover { background: rgba(255,255,255,.06); }
.ultc-wopt-ic { font-size: 22px; line-height: 1; }
.ultc-wopt-txt { display: flex; flex-direction: column; }
.ultc-wopt-txt small { color: var(--text-dim); font-size: 12px; margin-top: 1px; }
.admin-actions button {
  margin-right: 6px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 12px; transition: background .14s;
}
.admin-actions button:hover { background: var(--panel-3); }
.admin-actions .danger { color: var(--red); border-color: rgba(244,97,78,.4); }
.admin-note { padding: 16px 22px; color: var(--text-dim); font-size: 12.5px; line-height: 1.6; }

/* Grille de médias (modération) */
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px; padding: 8px 22px 24px;
}
.media-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 15px;
  overflow: hidden; display: flex; flex-direction: column;
}
.media-card-preview {
  aspect-ratio: 4/3; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--text-dim);
  overflow: hidden;
}
.media-card-preview img, .media-card-preview video { width: 100%; height: 100%; object-fit: cover; }
.media-card-meta { padding: 11px 13px 4px; }
.media-card-who { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card-date { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.media-card-btn {
  margin: 9px 13px 6px; padding: 8px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 12.5px; text-align: center;
  text-decoration: none; display: block; transition: background .14s;
}
.media-card-btn:hover { background: var(--panel-3); }
.media-card-del {
  margin: 0 13px 12px; padding: 6px; border-radius: 10px; border: 1px solid rgba(244,97,78,.35);
  background: transparent; color: var(--red); font-size: 12px; text-align: center;
  display: block; width: calc(100% - 26px); transition: background .14s;
}
.media-card-del:hover { background: rgba(244,97,78,.12); }

/* ============================ Appels ============================ */
.call-overlay {
  position: fixed; inset: 0; background: #04060b; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.remote-video { width: 100%; height: 100%; object-fit: contain; background: #04060b; }
.call-info {
  position: absolute; top: 28px; left: 0; right: 0; text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,.85); pointer-events: none;
}
.call-peer-name { font-size: 23px; font-weight: 800; }
.call-status { font-size: 14px; color: #c3cbe0; margin-top: 5px; }
.local-video {
  position: absolute; right: 20px; bottom: 116px;
  width: 230px; max-width: 32vw; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 14px; border: 2px solid rgba(255,255,255,.22);
  background: #0d1018; box-shadow: var(--shadow-lg);
}

/* 🆔 « Ton ID » — bloc privé (profil + réglages), visible seulement par soi. */
.profile-myid {
  margin: 12px auto 2px; padding: 10px 14px; max-width: 330px;
  background: rgba(113, 89, 242, .10); border: 1px solid rgba(113, 89, 242, .35);
  border-radius: 12px; text-align: center;
}
.profile-myid .myid-value { font-size: 18px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.profile-myid .copy-username-btn { margin-left: 6px; }
.profile-myid .myid-hint { margin-top: 6px; font-size: 11.5px; opacity: .78; line-height: 1.4; }

/* 🗕 Appel réduit — petite fenêtre flottante pour continuer à écrire pendant l'appel. */
.call-mini-bar { display: none; }
.call-overlay.minimized {
  inset: auto; left: 14px; bottom: 96px;
  width: 132px; height: 188px;
  border-radius: 16px; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .28);
  box-shadow: var(--shadow-lg);
  cursor: pointer; z-index: 90;
}
.call-overlay.minimized .remote-video { object-fit: cover; }
.call-overlay.minimized .call-info,
.call-overlay.minimized .call-controls,
.call-overlay.minimized .call-filter-row { display: none; }
.call-overlay.minimized .local-video {
  right: 6px; bottom: 6px; width: 44px; max-width: 44px;
  border-width: 1px; border-radius: 8px;
}
.call-overlay.minimized .call-mini-bar {
  display: block; position: absolute; top: 0; left: 0; right: 0;
  padding: 5px 8px; font-size: 10.5px; font-weight: 700; color: #fff; text-align: center;
  background: linear-gradient(rgba(0, 0, 0, .72), transparent); pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .9);
}
.call-controls {
  position: absolute; bottom: 30px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 16px;
}
.call-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.13); color: #fff; font-size: 23px;
  backdrop-filter: blur(10px); transition: background .15s, transform .12s;
}
.call-btn:hover { background: rgba(255,255,255,.24); }
.call-btn:active { transform: scale(.93); }
.call-btn.off { background: rgba(244,97,78,.9); }
.call-btn-end { background: var(--red); }
.call-btn-end:hover { background: #d94a38; }

/* ============================ Modales ============================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,6,11,.72); backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in .16s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 30px; width: 100%; max-width: 410px; box-shadow: var(--shadow-lg);
  animation: pop-in .18s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes pop-in { from { transform: scale(.94); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin-bottom: 18px; font-size: 19px; }
.settings-section { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.settings-section h4 { margin-bottom: 6px; color: var(--text); font-size: 14px; }
.settings-hint { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; margin-bottom: 12px; }
.modal h4 { margin-bottom: 4px; font-size: 13.5px; color: var(--text-dim); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.incoming-modal { text-align: center; }
.incoming-icon {
  width: 78px; height: 78px; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  background: var(--accent-soft); animation: ring-shake 1s infinite;
}
@keyframes ring-shake {
  0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); }
}
.incoming-modal h3 { margin: 14px 0 3px; }
.incoming-modal p { color: var(--text-dim); margin-bottom: 22px; }
.incoming-actions { display: flex; gap: 12px; justify-content: center; }
.btn-accept, .btn-decline {
  padding: 13px 24px; border: none; border-radius: 13px; font-size: 15px; font-weight: 700; color: #fff;
  transition: filter .15s, transform .12s;
}
.btn-accept { background: linear-gradient(135deg, #34d399, #10b981); }
.btn-decline { background: linear-gradient(135deg, #f4614e, #e0412c); }
.btn-accept:hover, .btn-decline:hover { filter: brightness(1.08); }
.btn-accept:active, .btn-decline:active { transform: translateY(1px); }

/* ============================ Toast ============================ */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--panel-3); border: 1px solid var(--border); color: var(--text);
  padding: 13px 22px; border-radius: 13px; font-size: 14px; z-index: 300;
  box-shadow: var(--shadow-lg); max-width: 90vw; animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================ Mobile ============================ */
@media (max-width: 760px) {
  .sidebar { width: 100%; min-width: 0; }
  .app-view.chat-open .sidebar { display: none; }
  .app-view:not(.chat-open) .chat-area { display: none; }
  .chat-back { display: flex; }
  .local-video { width: 128px; bottom: 122px; }
  /* 📱 Messages plus LARGES = plus coupés/cramés à lire sur téléphone */
  .msg-col { max-width: 90%; }
  .bubble { max-width: 100%; }
  .messages { padding: 14px 12px 6px; }
  /* 📱 Composer façon Telegram : le champ texte a de la place, boutons compacts, caméra cachée (📎 la couvre) */
  .composer { gap: 5px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .composer .icon-btn { width: 38px; height: 38px; font-size: 18px; flex-shrink: 0; }
  .composer #btnCamera { display: none; }
  .composer textarea { padding: 9px 13px; min-width: 0; font-size: 16px; }
  /* 📱 iOS : tous les champs à 16px = plus de zoom automatique au focus (fini le « zoom weird ») */
  .search input, input[type="text"], input[type="search"], input[type="password"], input[type="email"] { font-size: 16px; }
  .btn-send { width: 40px; height: 40px; flex-shrink: 0; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Thème clair
   ============================================================ */
:root[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #e3e8f1;
  --panel: #ffffff;
  --panel-2: #f3f5fa;
  --panel-3: #e8ecf4;
  --panel-hover: #dfe5f0;
  --border: #d7dde9;
  --border-soft: #e6eaf2;
  --text: #131824;
  --text-2: #41496040;
  --text-2: #444d63;
  --text-dim: #7b8398;
  --bubble-them: #eaeef6;
  --shadow-sm: 0 1px 4px rgba(20,30,60,.08);
  --shadow: 0 8px 24px rgba(20,30,60,.12);
  --shadow-lg: 0 18px 50px rgba(20,30,60,.18);
}
:root[data-theme="light"] .auth-view {
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(124,92,255,.16), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(90,123,255,.12), transparent 55%),
    var(--bg);
}
:root[data-theme="light"] .chat-header { background: rgba(255,255,255,.82); }
:root[data-theme="light"] .bubble .msg-time { color: rgba(255,255,255,.75); }
:root[data-theme="light"] .msg-row.them .bubble .msg-time { color: var(--text-dim); }

/* ============================================================
   Bouton + (FAB) et menu de création
   ============================================================ */
.fab {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: var(--grad); color: #fff; font-size: 22px;
  box-shadow: 0 8px 24px rgba(124,92,255,.5); z-index: 20; transition: transform .12s, filter .15s;
}
.fab:hover { filter: brightness(1.08); }
.fab:active { transform: translateX(-50%) scale(.94); }
.new-menu {
  position: absolute; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 25; min-width: 210px; animation: pop-in .13s ease;
}
.new-menu button {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); font-size: 14px; padding: 11px 13px; border-radius: 10px; transition: background .12s;
}
.new-menu button:hover { background: var(--panel-2); }

/* ============================================================
   Modales de création / infos de groupe
   ============================================================ */
.modal-scroll { max-height: 88vh; overflow-y: auto; }
.avatar-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 26px; }
.create-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.create-avatar { cursor: pointer; flex-shrink: 0; overflow: hidden; }
.create-name {
  flex: 1; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 15px; outline: none;
}
.create-name:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.member-search { position: relative; margin-bottom: 10px; }
.member-search input {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 14px; outline: none;
}
.member-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.member-search .search-results { left: 0; right: 0; }
.selected-members { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; min-height: 4px; }
.member-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--accent);
  border-radius: 999px; padding: 4px 10px; font-size: 13px;
}
.member-chip button { background: transparent; border: none; color: inherit; font-size: 13px; cursor: pointer; padding: 0; }

.group-info-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.group-info-head h3 { margin: 0; }
.group-members { max-height: 320px; overflow-y: auto; margin-bottom: 12px; }
.member-row { display: flex; align-items: center; gap: 11px; padding: 8px 4px; border-bottom: 1px solid var(--border-soft); }
.member-row .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: 14px; }
.member-role { font-size: 11.5px; color: var(--text-dim); }
.member-remove {
  background: transparent; border: 1px solid var(--border); color: var(--red);
  width: 30px; height: 30px; border-radius: 9px; font-size: 13px; cursor: pointer;
}
.member-remove:hover { background: rgba(244,97,78,.12); }

/* Nom de l'expéditeur dans un groupe */
.group-sender { font-size: 11.5px; font-weight: 700; color: var(--accent-2); margin: 0 0 2px 4px; }
.chat-peer-btn { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; cursor: pointer; }
.channel-readonly {
  padding: 12px 16px; text-align: center; font-size: 13px; color: var(--text-dim);
  background: var(--panel); border-top: 1px solid var(--border);
}

/* Paramètres : profil, thème, danger */
.settings-label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.settings-label input {
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 14px; outline: none;
}
.settings-label input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-toggle { display: flex; gap: 8px; }
.theme-btn {
  flex: 1; padding: 11px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 14px; font-weight: 600; transition: all .15s;
}
.theme-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.btn-danger {
  padding: 11px 16px; border: 1px solid rgba(244,97,78,.4); border-radius: 11px;
  background: rgba(244,97,78,.08); color: var(--red); font-size: 14px; font-weight: 600; width: 100%;
}
.btn-danger:hover { background: rgba(244,97,78,.16); }
.danger-zone { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

/* ============================================================
   Demandes de contact (anti-spam)
   ============================================================ */
.icon-btn-badge { position: relative; }
.badge-dot {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  border: 2px solid var(--panel);
}
.contact-banner {
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  padding: 16px; border-top: 1px solid var(--border); background: var(--panel); text-align: center;
}
.contact-banner #contactBannerText { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.contact-banner-actions { display: flex; gap: 10px; }
.contact-banner-actions .btn-primary,
.contact-banner-actions .btn-accept,
.contact-banner-actions .btn-decline { padding: 10px 18px; font-size: 14px; }

.requests-list { max-height: 340px; overflow-y: auto; margin-bottom: 12px; }
.req-accept, .req-decline {
  width: 38px; height: 38px; border-radius: 11px; border: none; font-size: 15px; cursor: pointer; flex-shrink: 0;
}
.req-accept { background: rgba(52,211,153,.15); }
.req-decline { background: rgba(244,97,78,.15); margin-left: 6px; }
.req-accept:hover { background: rgba(52,211,153,.28); }
.req-decline:hover { background: rgba(244,97,78,.28); }

/* ============================================================
   Caméra (photo en direct) + filtres
   ============================================================ */
.camera-modal {
  position: fixed; inset: 0; z-index: 150; background: #05070c;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.camera-preview { width: 100%; height: 100%; object-fit: contain; background: #05070c; }
.camera-hint {
  position: absolute; top: 22px; left: 0; right: 0; text-align: center;
  color: #cfd6e6; font-size: 13px; text-shadow: 0 2px 8px rgba(0,0,0,.8); pointer-events: none;
}
.camera-controls {
  position: absolute; bottom: 28px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 26px;
}
.camera-shutter {
  width: 72px; height: 72px; border-radius: 50%; border: 5px solid rgba(255,255,255,.85);
  background: #fff; cursor: pointer; transition: transform .1s;
  box-shadow: 0 0 0 3px rgba(0,0,0,.35);
}
.camera-shutter:active { transform: scale(.9); }

.filter-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.camera-modal .filter-row {
  position: absolute; bottom: 116px; left: 0; right: 0; justify-content: center; flex-wrap: nowrap;
}
.filter-chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12); color: #fff; font-size: 13px; cursor: pointer;
  backdrop-filter: blur(6px); transition: background .14s, border-color .14s;
}
.filter-chip:hover { background: rgba(255,255,255,.22); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); }
.call-filter-row {
  position: absolute; bottom: 100px; left: 0; right: 0; justify-content: center;
}

.live-badge {
  display: inline-block; margin-top: 5px; padding: 3px 9px; border-radius: 999px;
  background: rgba(244,97,78,.9); color: #fff; font-size: 11px; font-weight: 700;
}

/* ============================ Fiche profil ============================ */
.chat-header .avatar, #chatPeer { cursor: pointer; }
.avatar-xl { width: 96px; height: 96px; border-radius: 30px; font-size: 40px; }
.profile-modal { text-align: center; max-width: 380px; }
.profile-modal .avatar-xl { margin: 4px auto 14px; }
.profile-name { font-size: 22px; font-weight: 800; margin: 0; line-height: 1.2; }
.profile-username { font-size: 14px; color: var(--accent); font-weight: 600; margin-top: 3px; }
.profile-bio {
  margin: 14px auto 4px; color: var(--text-2); font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; max-width: 300px;
}
.profile-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.profile-actions button { width: 100%; }
.profile-status {
  padding: 12px; border-radius: 12px; background: var(--panel-3);
  color: var(--text-dim); font-size: 14px; font-weight: 600;
}

/* Recherche : nom + @pseudo */
.search-result-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.search-result-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-username { font-size: 12px; color: var(--text-dim); }

/* Paramètres : pseudo + rangée de boutons + bloqués */
.settings-username { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 6px; }
.settings-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 10px; }
.settings-row button { flex: 1; min-width: 130px; }
#bioInput {
  width: 100%; padding: 10px 12px; border-radius: 12px; resize: vertical;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .16s, box-shadow .16s;
}
#bioInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.blocked-list { display: flex; flex-direction: column; gap: 6px; }
.blocked-empty { color: var(--text-dim); font-size: 13px; }
.blocked-row { display: flex; align-items: center; gap: 11px; padding: 6px 0; }
.blocked-row .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 14px; }
.blocked-info { flex: 1; min-width: 0; }
.blocked-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blocked-username { font-size: 12px; color: var(--text-dim); }
.blocked-row button { padding: 7px 13px; font-size: 13px; flex-shrink: 0; }

/* ============================ Stories ============================ */
.stories-bar {
  display: flex; gap: 12px; padding: 10px 14px 12px; overflow-x: auto;
  border-bottom: 1px solid var(--border-soft); scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }
.story-tile {
  flex-shrink: 0; width: 62px; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--text-2);
}
.story-ring {
  width: 54px; height: 54px; border-radius: 50%; padding: 2px;
  background: linear-gradient(135deg, #7c5cff, #f4614e, #ffb020);
  display: flex; align-items: center; justify-content: center;
}
.story-ring.seen { background: var(--border); }
.story-ring .avatar {
  width: 100%; height: 100%; border-radius: 50%; font-size: 18px;
  border: 2px solid var(--panel); box-shadow: none;
}
.story-ring-add {
  background: var(--panel-3); border: 2px dashed var(--accent);
  color: var(--accent); padding: 0;
}
.story-plus { font-size: 26px; font-weight: 300; line-height: 1; }
.story-label {
  font-size: 11px; max-width: 60px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-align: center;
}

/* Composer une story */
.story-preview {
  width: 100%; max-height: 320px; border-radius: 14px; overflow: hidden;
  background: #000; display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.story-preview img, .story-preview video { width: 100%; max-height: 320px; object-fit: contain; }
.story-audience { display: flex; flex-direction: column; gap: 2px; max-height: 210px; overflow-y: auto; }
.audience-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 2px; cursor: pointer;
}
.audience-row input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.audience-row .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }
.audience-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Visionneuse plein écran */
.story-viewer {
  position: fixed; inset: 0; z-index: 300; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fade-in .16s ease;
}
.story-progress {
  position: absolute; top: 10px; left: 12px; right: 12px; z-index: 3;
  display: flex; gap: 4px;
}
.story-seg { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.28); overflow: hidden; }
.story-seg-fill { height: 100%; width: 0; background: #fff; border-radius: 3px; }
.story-vhead {
  position: absolute; top: 24px; left: 14px; right: 14px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
}
.story-vhead .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 14px; }
.story-vinfo { flex: 1; min-width: 0; color: #fff; }
.story-vname { font-weight: 700; font-size: 14px; }
.story-vtime { font-size: 12px; color: rgba(255,255,255,.7); }
.story-vbtn {
  background: rgba(255,255,255,.14); border: none; color: #fff; width: 38px; height: 38px;
  border-radius: 50%; font-size: 17px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.story-vbtn:hover { background: rgba(255,255,255,.26); }
.story-stage {
  width: 100%; max-width: 520px; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 6px 72px; /* dégage la barre/entête en haut et la légende en bas */
}
.story-stage img, .story-stage video {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 12px; object-fit: contain; /* image entière, jamais rognée ni débordante */
}
.story-loading { color: rgba(255,255,255,.7); font-size: 30px; }
.story-caption-view {
  position: absolute; bottom: 30px; left: 0; right: 0; z-index: 3; text-align: center;
  color: #fff; font-size: 15px; padding: 10px 26px; text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.story-caption-view:empty { display: none; }
.story-nav {
  position: absolute; top: 70px; bottom: 70px; width: 34%; z-index: 2;
  background: transparent; border: none; cursor: pointer;
}
.story-nav-prev { left: 0; }
.story-nav-next { right: 0; }

/* ============================================================
   Nouveaux composants + refonte premium (v2)
   ============================================================ */

/* Profondeur ambiante derrière toute l'app */
.app-view {
  background:
    radial-gradient(1100px 700px at 82% -10%, rgba(124,92,255,.10), transparent 60%),
    radial-gradient(900px 600px at -5% 108%, rgba(90,123,255,.08), transparent 55%),
    var(--bg);
}
.sidebar {
  background: linear-gradient(180deg, #121620 0%, var(--panel) 100%);
  backdrop-filter: blur(6px);
}
.sidebar-header {
  background: linear-gradient(180deg, rgba(124,92,255,.06), transparent);
}
#myAvatar { cursor: pointer; transition: transform .15s ease; }
#myAvatar:hover { transform: scale(1.06); }

/* Conversations : état actif avec barre d'accent + survol plus vivant */
.conv-item { position: relative; transition: background .15s ease, transform .08s ease; }
.conv-item:hover { background: var(--panel-2); }
.conv-item:active { transform: scale(.99); }
.conv-item.active {
  background: linear-gradient(90deg, var(--accent-soft), transparent 85%);
}
.conv-item.active::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px; background: var(--grad);
}
.conv-item .conv-name { font-weight: 650; }
.conv-mute-ic { font-size: 12px; opacity: .6; margin-left: 2px; }

/* Bouton ⋯ sur une conversation */
.conv-menu-btn {
  flex-shrink: 0; width: 30px; height: 30px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-dim);
  font-size: 20px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: .45; transition: opacity .13s, background .13s, color .13s;
}
.conv-item:hover .conv-menu-btn, .conv-item.active .conv-menu-btn { opacity: 1; }
.conv-menu-btn:hover { background: var(--panel-3); color: var(--text); }

/* Menu contextuel flottant */
.ctx-menu {
  position: fixed; z-index: 320; min-width: 210px;
  background: var(--panel-3); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg);
  animation: pop-in .13s ease;
}
.ctx-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px; background: transparent;
  color: var(--text); font-size: 14px; text-align: left; transition: background .12s;
}
.ctx-item:hover { background: var(--panel-hover); }
.ctx-item.danger { color: var(--red); }
.ctx-ic { width: 20px; text-align: center; }

/* Modale de suppression de conversation */
.conv-del-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.conv-del-actions button { width: 100%; padding: 12px; }

/* Copier le pseudo */
.profile-username { display: inline-flex; align-items: center; gap: 7px; justify-content: center; }
.copy-username-btn {
  border: none; background: var(--accent-soft); color: var(--accent);
  width: 26px; height: 26px; border-radius: 8px; font-size: 13px; line-height: 1;
  transition: background .13s, transform .1s;
}
.copy-username-btn:hover { background: var(--accent); color: #fff; }
.copy-username-btn:active { transform: scale(.9); }

/* Badge musique dans le composer */
.story-music-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(4px);
  max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.story-preview { position: relative; }

/* Section installation PWA */
#installSection h4 { color: var(--accent-2); }
#btnInstallApp { width: 100%; }
.install-guide { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; border-radius: 12px; transition: box-shadow .2s; }
.install-step {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; line-height: 1.45; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border-soft);
  border-radius: 11px; padding: 9px 11px;
}
.install-step b { color: var(--text); }
.install-ic { font-size: 17px; flex-shrink: 0; }
.install-guide.flash .install-step { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Connexions récentes (sécurité du compte) */
.session-list { display: flex; flex-direction: column; gap: 7px; }
.session-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 11px;
}
.session-ic { font-size: 18px; flex-shrink: 0; }
.session-info { flex: 1; min-width: 0; }
.session-dev { font-weight: 600; font-size: 13.5px; }
.session-meta { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.session-badge {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: var(--green);
  background: rgba(52,211,153,.12); border-radius: 999px; padding: 3px 9px;
}
.session-revoke { flex-shrink: 0; width: auto; padding: 6px 12px; font-size: 12.5px; }
.session-dev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bouton « Annuler » dans un toast */
.toast-undo {
  border: none; background: var(--accent); color: #fff; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; margin-left: 4px;
}
.toast-undo:hover { filter: brightness(1.1); }

/* Bannissement d'IP (admin) */
.ipban-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.ipban-title { font-size: 14px; margin-bottom: 6px; }
.ipban-add { display: flex; gap: 8px; margin: 10px 0 14px; }
.ipban-add input {
  flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 14px; outline: none;
}
.ipban-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ipban-list { display: flex; flex-direction: column; gap: 6px; }
.ipban-empty { color: var(--text-dim); font-size: 13px; }
.ipban-row {
  display: flex; align-items: center; gap: 11px; padding: 8px 11px;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 10px;
}
.ipban-ip { font-weight: 700; font-family: ui-monospace, monospace; }
.ipban-meta { flex: 1; font-size: 12px; color: var(--text-dim); }
.ipban-row button { padding: 6px 12px; font-size: 12.5px; }

/* Gestion de groupe : rôle + droits des co-gérants */
.member-rolebtn {
  flex-shrink: 0; width: 30px; height: 30px; border: none; border-radius: 9px;
  background: var(--panel-3); color: var(--text-2); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; margin-left: 4px;
  transition: background .13s, transform .1s;
}
.member-rolebtn:hover { background: var(--accent); color: #fff; }
.member-rolebtn:active { transform: scale(.9); }
.group-perms {
  margin-top: 6px; padding: 14px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--border-soft);
}
.group-perms h4 { margin-bottom: 6px; font-size: 14px; color: var(--accent-2); }
.perm-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 2px;
  font-size: 14px; cursor: pointer; color: var(--text);
}
.perm-row input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.invite-row { display: flex; gap: 8px; margin: 8px 0 10px; }
.invite-row input {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 12.5px; font-family: ui-monospace, monospace; outline: none;
}
.invite-row button { flex-shrink: 0; padding: 9px 14px; }
.join-requests { display: flex; flex-direction: column; }
#groupRequestsSection h4 { color: var(--amber); }

/* ---------- Éditeur de story ---------- */
.story-editor {
  position: fixed; inset: 0; z-index: 310; background: #05070c;
  display: flex; flex-direction: column; align-items: center;
  animation: fade-in .16s ease;
}
.se-stage {
  flex: 1; width: 100%; display: flex; align-items: center; justify-content: center;
  padding: 66px 8px 150px; overflow: hidden;
}
#seCanvas {
  max-width: 100%; max-height: 100%; border-radius: 14px; touch-action: none;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); cursor: crosshair;
}
.se-top {
  position: absolute; top: 16px; left: 14px; right: 14px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.se-tools { display: flex; gap: 8px; }
.se-tool {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.14); color: #fff; font-size: 19px;
  display: flex; align-items: center; justify-content: center; transition: background .13s, transform .1s;
}
.se-tool:hover { background: rgba(255,255,255,.26); }
.se-tool:active { transform: scale(.92); }
.se-tool.active { background: var(--accent); }
.se-colors {
  position: absolute; top: 74px; left: 0; right: 0; z-index: 3;
  display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; padding: 0 14px;
}
.se-color {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5);
  padding: 0; transition: transform .1s;
}
.se-color.active { transform: scale(1.25); border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.se-panel {
  position: absolute; bottom: 84px; left: 0; right: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.se-row { display: flex; align-items: center; gap: 10px; }
.se-lbl { color: rgba(255,255,255,.8); font-size: 13px; font-weight: 600; }
.se-durations { display: flex; gap: 7px; }
.se-dur {
  padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1); color: #fff; font-size: 13px; font-weight: 600; transition: background .12s;
}
.se-dur.active { background: var(--accent); border-color: var(--accent); }
.se-dur-locked { opacity: .45; }   /* ◈ durées premium, verrouillées pour les autres */
.se-music-name {
  color: #fff; font-size: 12px; background: rgba(0,0,0,.5); padding: 5px 12px;
  border-radius: 999px; max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.se-bottom {
  position: absolute; bottom: 20px; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: center; padding: 0 20px;
}
.se-bottom .btn-primary { min-width: 200px; padding: 14px; font-size: 15px; }

/* Boutons : léger relief premium */
.btn-primary { box-shadow: 0 8px 22px rgba(124,92,255,.35); }
.btn-secondary { transition: background .15s, transform .08s; }
.btn-secondary:active { transform: translateY(1px); }

/* Bulles : ombre douce pour du relief */
.bubble { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.msg-row.me .bubble { box-shadow: 0 4px 16px rgba(107,75,240,.3); }

/* Story : anneau « ajouter » plus vivant + tuiles cliquables */
.story-tile { transition: transform .1s ease; }
.story-tile:active { transform: scale(.94); }

/* Accusé de lecture « Vu » */
.seen-marker {
  text-align: right; font-size: 11px; font-weight: 600; color: var(--accent-2);
  padding: 1px 6px 5px 0; letter-spacing: .2px;
}

/* Bouton retour toujours cliquable et net */
.chat-back { color: var(--text); }
.chat-back:hover { background: var(--panel-3); }


/* ============================================================
   ✦ REFONTE « VAULT » (2026-07-28) — dark premium, façon Proton/Signal
   Palette cool-neutre + UN seul accent indigo désaturé. Zéro glow,
   zéro arc-en-ciel : la sécurité se lit dans la retenue. Remplace
   l'ancien thème « couleur » (surcharge propre, gagne sur le reste).
   ============================================================ */
:root {
  /* Neutres profonds, légère teinte froide/indigo */
  --bg: #0a0c11;
  --bg-2: #0d1017;
  --panel: #111420;
  --panel-2: #161a26;
  --panel-3: #1c2130;
  --panel-hover: #1f2533;
  /* Bordures fines — la profondeur vient des traits, pas du glow */
  --border: #242a39;
  --border-soft: #191e2b;
  --text: #eef1f7;
  --text-2: #a6adbe;
  --text-dim: #6b7385;
  /* UN seul accent : indigo-violet sobre (dérivé de la marque, désaturé) */
  --accent: #7159f2;
  --accent-2: #9a86ff;
  --accent-hover: #6047e0;
  --accent-soft: rgba(113,89,242,.13);
  --grad: linear-gradient(135deg, #8065ff, #6249e6);
  --bubble-me: linear-gradient(160deg, #5d4ae0, #4b3fb0);
  --bubble-them: #191f30;
  /* Statuts calmes (jamais néon) */
  --green: #3ecf8e;
  --amber: #e8b25a;
  --red: #ef5c4d;
  --radius: 14px;
  --radius-sm: 10px;
  /* Ombres douces + anneau de focus calme (profondeur sans glow) */
  --shadow-soft: 0 1px 0 rgba(255,255,255,.02) inset, 0 1px 2px rgba(0,0,0,.35);
  --shadow: 0 8px 24px -12px rgba(0,0,0,.65), 0 2px 6px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.75);
  --ring: 0 0 0 3px var(--accent-soft);
}

/* Surface de lecture : léger dégradé mono (fini les couleurs criardes) */
.messages { background: radial-gradient(120% 80% at 50% 0%, #12151f 0%, var(--bg) 60%) !important; }

/* En-tête latéral : ne peut JAMAIS écraser le nom/statut.
   nowrap+ellipsis interdit l'enroulement vertical ; flex-wrap fait
   passer la barre d'actions sur sa propre ligne si l'espace manque. */
.sidebar-header {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  /* 📱 safe-area : descend le menu principal sous la barre d'état / encoche iPhone (0 sur desktop). */
  padding: calc(13px + env(safe-area-inset-top, 0px)) 14px 13px; border-bottom: 1px solid var(--border-soft);
  background: var(--panel); position: relative;
}
.sidebar-header::after { content: none !important; } /* supprime la barre arc-en-ciel */
.sidebar-me { flex: 1 1 55%; min-width: 0; }
.me-name {
  font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; line-height: 1.2; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-status {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
  font-size: 11px; font-weight: 550; line-height: 1.2; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: none;
}
.me-status::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: none; }
.me-status.offline { color: var(--text-dim); }
.me-status.offline::before { background: var(--text-dim); }

.avatar { box-shadow: var(--shadow-soft); }

.sidebar-actions { display: flex; gap: 2px; margin-left: auto; flex-shrink: 0; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: 10px;
  background: transparent; color: var(--text-2); font-size: 17px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--panel-hover); color: var(--text); }
.icon-btn:active { background: var(--panel-3); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); color: var(--text); }

.search-box input {
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box input:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: var(--ring); }

/* Avatars par contact — MÊME famille froide (indigo/bleu/sarcelle), fini l'arc-en-ciel */
.conv-item .avatar, .search-result .avatar { box-shadow: inset 0 1px 0 rgba(255,255,255,.10); }
.conv-item:nth-child(8n+1) .avatar, .search-result:nth-child(8n+1) .avatar { background: linear-gradient(135deg,#6d5cf0,#5647c9); }
.conv-item:nth-child(8n+2) .avatar, .search-result:nth-child(8n+2) .avatar { background: linear-gradient(135deg,#4f7ef0,#3f5fd6); }
.conv-item:nth-child(8n+3) .avatar, .search-result:nth-child(8n+3) .avatar { background: linear-gradient(135deg,#3fa3c9,#3577b5); }
.conv-item:nth-child(8n+4) .avatar, .search-result:nth-child(8n+4) .avatar { background: linear-gradient(135deg,#5aa9a0,#3f8a86); }
.conv-item:nth-child(8n+5) .avatar, .search-result:nth-child(8n+5) .avatar { background: linear-gradient(135deg,#8168e6,#6149c9); }
.conv-item:nth-child(8n+6) .avatar, .search-result:nth-child(8n+6) .avatar { background: linear-gradient(135deg,#5b74e0,#4657c4); }
.conv-item:nth-child(8n+7) .avatar, .search-result:nth-child(8n+7) .avatar { background: linear-gradient(135deg,#4b8fd6,#3f6fc0); }
.conv-item:nth-child(8n+8) .avatar, .search-result:nth-child(8n+8) .avatar { background: linear-gradient(135deg,#6f6ad6,#514fb8); }

/* Conversation active : rail 2px accent (discipline « accent-as-punctuation ») */
.conv-item.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }

/* Bouton primaire : ACCENT PLAT (fini le dégradé criard) */
.btn-primary { background: var(--accent); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--accent-hover); filter: none; box-shadow: var(--shadow-soft); }

/* Focus calme et cohérent partout (anneau accent, jamais un glow) */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--ring); }

/* Modales : bordure fine + ombre nette */
.modal { border: 1px solid var(--border); box-shadow: var(--shadow-lg); background: var(--panel); }

/* ============================ 🐉 botDragonFather (style BotFather) ============================ */
.bots-list { display: flex; flex-direction: column; gap: 14px; }
.bot-card {
  padding: 16px; background: var(--bg-2);
  border: 1px solid var(--border-soft); border-radius: 16px;
}
.bot-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.bot-av {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, #4aa3ff, #2f7be6);
}
.bot-id { min-width: 0; }
.bot-name { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-user { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.bot-token-box {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 13px; cursor: pointer; transition: border-color .15s;
}
.bot-token-box:hover { border-color: var(--accent); }
.bot-token-key { flex-shrink: 0; font-size: 15px; opacity: .75; }
.bot-token {
  flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--text); word-break: break-all; line-height: 1.45;
}
.bot-btn-row { display: flex; gap: 9px; margin-top: 11px; }
.bot-copy, .bot-revoke {
  flex: 1; padding: 11px; border-radius: 11px; border: none;
  font-size: 13.5px; font-weight: 700; cursor: pointer; transition: filter .15s, background .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.bot-copy { background: var(--accent); color: #fff; }
.bot-copy:hover { filter: brightness(1.08); }
.bot-revoke { background: rgba(244,97,78,.14); color: var(--red); }
.bot-revoke:hover { background: rgba(244,97,78,.24); }
.bot-hint { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; margin-top: 12px; }
.bot-delete {
  width: 100%; margin-top: 13px; padding: 10px; border-radius: 11px;
  border: 1px solid rgba(244,97,78,.42); background: transparent; color: var(--red);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.bot-delete:hover { background: rgba(244,97,78,.12); }
/* Token masqué : œil + révélation */
.bot-token-box { justify-content: space-between; }
.bot-token-eye { flex-shrink: 0; font-size: 14px; opacity: .8; }
.bot-token:not(.revealed) { letter-spacing: 1px; color: var(--text-dim); }
/* « Comment l'utiliser » */
.bot-how { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.bot-how li { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.bot-how code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: 6px; padding: 1px 6px; color: var(--accent-2); word-break: break-all;
}

/* ============================ Recherches récentes ============================ */
.search-recent-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--text-dim);
}
.search-recent-clear {
  border: none; background: transparent; color: var(--accent-2);
  font-size: 11.5px; font-weight: 700; text-transform: none; letter-spacing: 0; padding: 2px 4px;
}
.search-recent-clear:hover { text-decoration: underline; }
.search-hint { color: var(--text-dim); font-size: 13px; }

/* ============================ Prompt « activer les notifications » ============================ */
.notif-prompt {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 260; width: min(440px, calc(100vw - 28px));
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 15px; padding: 13px 15px; box-shadow: var(--shadow-lg);
  animation: notif-rise .25s ease;
}
@keyframes notif-rise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.notif-prompt-ic { font-size: 24px; flex-shrink: 0; }
.notif-prompt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-prompt-text b { font-size: 13.5px; }
.notif-prompt-text span { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.notif-prompt-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.notif-prompt-later { background: transparent; border: none; color: var(--text-dim); font-size: 12.5px; font-weight: 600; padding: 6px; }
.notif-prompt-later:hover { color: var(--text); }
.notif-prompt .btn-primary { padding: 9px 14px; font-size: 13px; border-radius: 10px; }
@media (max-width: 480px) {
  .notif-prompt { flex-wrap: wrap; }
  .notif-prompt-actions { width: 100%; justify-content: flex-end; }
}

/* ===== Barre multicolore animée sous l'en-tête (rebranchée, plus grosse, avec du rouge) ===== */
.sidebar-header { position: relative; }
.sidebar-header::after {
  content: '' !important; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px;
  background: linear-gradient(90deg, #7159f2, #4f8bff, #22d3ee, #34d399, #f5b544, #ef5c4d, #f472b6, #7159f2);
  background-size: 300% 100%; opacity: .95; border-radius: 0 0 2px 2px;
  animation: rainbowbar 12s linear infinite;
}
@keyframes rainbowbar { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { .sidebar-header::after { animation: none; } }

/* ============================ ✨ Animations (sobres, respectent reduced-motion) ============================ */

/* --- Écran de connexion / inscription : aura vivante + entrée + logo qui flotte --- */
.auth-view { position: relative; overflow: hidden; }
.auth-view::before {
  content: ''; position: absolute; inset: -30%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 50% 42%, rgba(113,89,242,.16), transparent 55%);
  animation: auth-aura 15s ease-in-out infinite alternate;
}
.auth-card { position: relative; z-index: 1; animation: auth-card-in .55s cubic-bezier(.2,.8,.25,1) both; }
.auth-logo { animation: logo-float 4.5s ease-in-out infinite; }
.auth-form label { animation: rise-in .5s ease both; }
.auth-form label:nth-of-type(2) { animation-delay: .06s; }
.auth-form label:nth-of-type(3) { animation-delay: .12s; }
.auth-form .btn-primary { animation: rise-in .5s ease both; animation-delay: .17s; }
@keyframes auth-aura { from { transform: translate(-4%, -2%) scale(1); } to { transform: translate(4%, 3%) scale(1.14); } }
@keyframes auth-card-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Entrée dans l'app --- */
.app-view:not([hidden]) { animation: fade-in .3s ease; }

/* --- Bulles de message : arrivée en douceur (glissent du bon côté) --- */
.msg-row.them { animation: msg-in-them .24s cubic-bezier(.2,.8,.25,1) both; }
.msg-row.me { animation: msg-in-me .24s cubic-bezier(.2,.8,.25,1) both; }
@keyframes msg-in-them { from { opacity: 0; transform: translate(-8px, 5px); } to { opacity: 1; transform: none; } }
@keyframes msg-in-me { from { opacity: 0; transform: translate(8px, 5px); } to { opacity: 1; transform: none; } }

/* --- Résultats de recherche + cartes bot : apparition douce --- */
.search-results { animation: fade-in .15s ease; }
.bot-card { animation: rise-in .3s ease both; }

/* --- Micro-interactions (survol / clic) --- */
.conv-item:hover { transform: translateX(3px); }
.icon-btn { transition: background .15s ease, color .15s ease, transform .1s ease; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: scale(.88); }
.btn-primary { transition: transform .12s ease, box-shadow .16s, filter .16s, background .16s; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px) scale(.99); }
.avatar { transition: transform .15s ease; }
.conv-item:hover .avatar, .search-result:hover .avatar { transform: scale(1.06); }
.story-tile { transition: transform .15s ease; }
.story-tile:hover { transform: translateY(-2px); }
.story-tile:active { transform: scale(.94); }
.msg-menu-btn, .reaction-btn { transition: transform .1s ease, opacity .15s ease, background .15s ease; }
.msg-menu-btn:active, .reaction-btn:active { transform: scale(.9); }

/* ============================ Audience des stories (Amis / Public) ============================ */
.story-audience-seg { display: flex; gap: 6px; margin-bottom: 12px; }
.story-aud-opt {
  flex: 1; padding: 10px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-2); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.story-aud-opt:hover { border-color: var(--panel-hover); }
.story-aud-opt:active { transform: scale(.97); }
.story-aud-opt.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.story-aud-info {
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 11px; padding: 11px 13px;
}

/* ======================= ✨✨ Animations « qui bougent » : couleur + 3D ======================= */

/* Fond de connexion : blobs colorés qui dérivent (en plus de l'aura) */
.auth-view::after {
  content: ''; position: absolute; inset: -20%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(430px 430px at 20% 30%, rgba(61,139,255,.22), transparent 60%),
    radial-gradient(390px 390px at 82% 66%, rgba(224,90,255,.18), transparent 60%),
    radial-gradient(360px 360px at 62% 12%, rgba(52,211,153,.14), transparent 60%);
  animation: blobs 20s ease-in-out infinite alternate;
}
@keyframes blobs {
  0%   { transform: translate(0,0) scale(1) rotate(0deg); }
  50%  { transform: translate(3%,-3%) scale(1.12) rotate(6deg); }
  100% { transform: translate(-3%,4%) scale(1.06) rotate(-5deg); }
}
.auth-card { perspective: 900px; }
.auth-logo { animation: logo-3d 6s ease-in-out infinite; transform-style: preserve-3d; }
@keyframes logo-3d {
  0%,100% { transform: translateY(0) rotateY(0deg) rotateX(0deg); }
  25%     { transform: translateY(-5px) rotateY(14deg) rotateX(7deg); }
  75%     { transform: translateY(-3px) rotateY(-14deg) rotateX(-5deg); }
}

/* Boutons primaires : dégradé coloré qui glisse en continu */
.btn-primary {
  background: linear-gradient(120deg, #7159f2, #3d8bff, #22d3ee, #a06bff, #7159f2) !important;
  background-size: 320% 100% !important;
  animation: btn-flow 7s ease infinite;
}
.btn-primary:hover { animation-duration: 2.8s; }
@keyframes btn-flow { to { background-position: 320% 0; } }

/* Anneaux de story : bordure conique colorée qui TOURNE (façon Insta) */
.story-ring { position: relative; padding: 3px; }
.story-ring:not(.seen) { background: transparent; }
.story-ring:not(.seen)::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 0deg, #7159f2, #3d8bff, #22d3ee, #34d399, #f5b544, #ef5c4d, #f472b6, #7159f2);
  animation: ring-spin 4s linear infinite;
}
.story-ring .avatar { position: relative; z-index: 1; }
@keyframes ring-spin { to { transform: rotate(360deg); } }

/* Avatars : léger relief 3D au survol */
.conv-item:hover .avatar, .search-result:hover .avatar { transform: perspective(420px) rotateY(-9deg) scale(1.06); }

/* Bouton « activer la caméra » (appel audio) : accent qui pulse pour attirer l'œil */
.call-btn.cam-activate {
  background: var(--accent-soft); color: #fff;
  box-shadow: 0 0 0 0 rgba(113,89,242,.55); animation: cam-pulse 1.8s ease-in-out infinite;
}
@keyframes cam-pulse { 50% { box-shadow: 0 0 0 9px rgba(113,89,242,0); } }

/* ======================= 🤖 Boutons inline des bots (façon Telegram) ======================= */
.bot-kb { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; max-width: 80%; }
.bot-kb-row { display: flex; gap: 5px; }
.bot-kb-btn {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--accent-2);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  white-space: normal; line-height: 1.25; text-align: center;
}
.bot-kb-btn:hover { background: var(--panel-hover); border-color: var(--accent); }
.bot-kb-btn:active, .bot-kb-btn.bot-kb-tap { transform: scale(.97); background: var(--accent-soft); }
.bot-kb-btn:disabled { opacity: .55; cursor: default; }
.media-caption { margin-top: 6px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }

/* ======================= 🔐 Double authentification (2FA) ======================= */
.twofa-setup { margin-top: 8px; }
.twofa-qr-wrap { display: flex; justify-content: center; margin: 10px 0; }
.twofa-qr-wrap img { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; }
.twofa-secret-row { display: flex; align-items: center; gap: 8px; }
.twofa-secret { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 1px; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 9px; padding: 9px 11px; word-break: break-all; color: var(--accent-2); }
.twofa-copy { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--panel-2); font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s; }
.twofa-copy:hover { background: var(--accent-soft); border-color: var(--accent); }
.twofa-status { font-size: 13px; color: var(--green); margin-bottom: 10px; }
.totp-intro { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin-bottom: 14px; text-align: center; }
#totpCode, #twofaCode { text-align: center; letter-spacing: 6px; font-size: 20px; font-weight: 700; }

/* --- Respect de la préférence système « moins d'animations » --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* --- Visualiseur photo (lightbox) : clic sur une photo du chat → plein écran + zoom + ✕ --- */
.chat-photo { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, .93);
  display: flex; align-items: center; justify-content: center;
  touch-action: none; overscroll-behavior: contain;
  animation: lbFade .15s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lb-img {
  max-width: 100vw; max-height: 100vh; object-fit: contain;
  transform: translate(0, 0) scale(1); transform-origin: center center;
  transition: transform .15s ease;
  cursor: zoom-in; user-select: none; -webkit-user-select: none;
  -webkit-user-drag: none; touch-action: none;
}
.lb-img.zoomed { cursor: grab; }
.lb-img.grabbing { cursor: grabbing; transition: none; }
.lb-close {
  position: fixed; right: 16px; z-index: 1001;
  top: 12px; top: calc(env(safe-area-inset-top, 0px) + 12px);
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(20, 20, 28, .6); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lb-close:hover { background: rgba(40, 40, 55, .85); }

/* --- 😀🔥 Clavier d'émojis + stickers animés (façon Telegram) --- */
.emoji-panel { display: none; flex-direction: column; height: 46vh; max-height: 340px; background: var(--panel); border-top: 1px solid var(--border); }
.emoji-panel:not([hidden]) { display: flex; }
.ep-tabs { display: flex; gap: 2px; padding: 6px 8px; overflow-x: auto; border-bottom: 1px solid var(--border-soft); -webkit-overflow-scrolling: touch; }
.ep-tab { flex: 0 0 auto; background: none; border: none; font-size: 20px; line-height: 1; padding: 6px 9px; border-radius: 9px; cursor: pointer; opacity: .55; transition: opacity .12s, background .12s; }
.ep-tab:hover { opacity: .85; }
.ep-tab.active { opacity: 1; background: var(--panel-3); }
.ep-search { margin: 7px 10px; padding: 9px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: 14px; font-family: inherit; }
.ep-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; padding: 4px 8px 12px; align-content: start; }
.ep-cat-title { grid-column: 1 / -1; font-size: 11px; color: var(--text-dim); letter-spacing: .4px; padding: 8px 3px 2px; }
.ep-emoji { font-size: 26px; line-height: 1; background: none; border: none; cursor: pointer; padding: 6px 0; border-radius: 9px; }
.ep-emoji:hover { background: var(--panel-3); }
.ep-emoji img { width: 34px; height: 34px; display: block; margin: 0 auto; }
/* Message tout-émoji : gros, sans fond de bulle. */
.bubble.jumbo { background: transparent !important; box-shadow: none !important; padding: 2px 2px 0 !important; }
.jumbo-emoji { display: flex; gap: 2px; align-items: center; }
.jumbo-emoji span { font-size: 54px; line-height: 1.05; }
.jumbo-emoji img { width: 110px; height: 110px; display: block; }

/* 🏷️🔗🎵 Stories : identifier des amis, lien, bibliothèque musicale (2026-08-22) */
.story-mentions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mention-chip { border: 1px solid var(--border, #2a2f3d); background: transparent; color: inherit; border-radius: 999px; padding: 6px 11px; font-size: 13px; cursor: pointer; }
.mention-chip.active { background: var(--accent, #7159f2); border-color: var(--accent, #7159f2); color: #fff; }
.story-extras { position: absolute; bottom: 74px; left: 0; right: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0 20px; pointer-events: none; }
.story-extras:empty { display: none; }
.story-tag, .story-link { pointer-events: auto; border: none; border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.story-tag { background: rgba(255,255,255,.92); color: #111; }
.story-link { background: var(--accent, #7159f2); color: #fff; }
.music-list { display: flex; flex-direction: column; gap: 8px; max-height: 48vh; overflow-y: auto; margin: 8px 0; }
.music-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border, #2a2f3d); border-radius: 12px; }
.music-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-btn { border: none; background: transparent; color: inherit; font-size: 18px; cursor: pointer; padding: 4px 6px; }
.music-use { padding: 6px 12px; font-size: 13px; }
.music-del { opacity: .7; }

/* 2026-08-22 : modal musique AU-DESSUS de l'éditeur de story (z 310) ; en-tête de story cliquable */
#musicModal { z-index: 320; }
#musicSearch, #storyMentionSearch { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border, #2a2f3d); background: transparent; color: inherit; font-size: 14px; }
#musicSearch { margin: 6px 0 4px; }
.story-vhead { z-index: 6; }
#storyVAvatar, #storyVName { cursor: pointer; pointer-events: auto; }
