/* =========================================================
   Lubrege - style.css
   Thème clair élégant : Orange (#f57c00), Blanc, Bleu (#1976d2)
   Design épuré, sans dégradé, avec ombres douces.
   ========================================================= */

:root {
  /* Palettes */
  --lb-bg: #f4f6f9;
  --lb-panel: #ffffff;
  --lb-panel-2: #f8fafc;
  --lb-line: #e2e8f0;
  --lb-text: #1a202c;
  --lb-muted: #64748b;
  --lb-brand: #f57c00;        /* Orange principal */
  --lb-brand-2: #e65100;      /* Orange foncé (hover) */
  --lb-blue: #1976d2;         /* Bleu pour liens, statuts, accusés */
  --lb-blue-light: #e3f2fd;
  --lb-bubble-in: #ffffff;
  --lb-bubble-out: #f57c00;
  --lb-radius: 16px;
  --lb-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --lb-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--lb-bg);
  color: var(--lb-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  line-height: 1.4;
}

/* ---------- Authentification ---------- */
.auth-body {
  overflow: auto;
  background: var(--lb-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--lb-panel);
  border: 1px solid var(--lb-line);
  border-radius: 24px;
  padding: 36px 28px;
  box-shadow: var(--lb-shadow);
  max-width: 420px;
  width: 100%;
}

.brand-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--lb-brand);
  color: #fff;
  font-size: 28px;
  margin-bottom: 8px;
}

.auth-tabs .nav-link {
  color: var(--lb-muted);
  border-radius: 10px;
  font-weight: 500;
  padding: 8px 16px;
}

.auth-tabs .nav-link.active {
  background: var(--lb-brand);
  color: #fff;
}

.auth-card .form-control,
.auth-card .input-group-text {
  background: var(--lb-panel-2);
  border: 1px solid var(--lb-line);
  color: var(--lb-text);
  border-radius: 12px;
  padding: 10px 14px;
}

.auth-card .form-control:focus {
  background: var(--lb-panel-2);
  border-color: var(--lb-brand);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.2);
  color: var(--lb-text);
}

.btn-brand {
  background: var(--lb-brand);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 18px;
  transition: background 0.2s;
}

.btn-brand:hover {
  background: var(--lb-brand-2);
  color: #fff;
}

/* ---------- Layout principal ---------- */
.app-shell {
  display: flex;
  height: 100dvh;
  width: 100%;
}

/* ---------- Sidebar (gauche) ---------- */
.sidebar {
  width: 360px;
  flex: 0 0 360px;
  background: var(--lb-panel);
  border-right: 1px solid var(--lb-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lb-line);
  background: var(--lb-panel);
}

.avatar-btn {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.avatar-btn img,
.chat-head img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lb-panel);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--lb-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.icon-btn:hover {
  background: var(--lb-panel-2);
  color: var(--lb-text);
}

/* ---------- Stories ---------- */
.stories-bar {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--lb-line);
  scrollbar-width: none;
  background: var(--lb-panel);
}

.stories-bar::-webkit-scrollbar {
  display: none;
}

.story-chip {
  flex: 0 0 auto;
  width: 68px;
  text-align: center;
  cursor: pointer;
}

.story-chip .ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 3px;
  margin: 0 auto;
  background: var(--lb-brand); /* orange */
}

.story-chip.seen .ring {
  background: var(--lb-line);
}

.story-chip img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lb-panel);
}

.story-chip span {
  display: block;
  font-size: 11px;
  color: var(--lb-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-chip .add {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lb-panel-2);
  color: var(--lb-brand);
  font-size: 22px;
  border: 2px dashed var(--lb-line);
}

/* ---------- Recherche & liste ---------- */
.search-wrap {
  position: relative;
  padding: 10px 16px;
  background: var(--lb-panel);
}

.search-wrap i {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lb-muted);
  font-size: 14px;
}

.search-wrap input {
  background: var(--lb-panel-2);
  border: 1px solid var(--lb-line);
  color: var(--lb-text);
  padding-left: 38px;
  border-radius: 30px;
  height: 40px;
  font-size: 14px;
}

.search-wrap input:focus {
  background: var(--lb-panel-2);
  border-color: var(--lb-brand);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.15);
  color: var(--lb-text);
}

.conv-list {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  background: var(--lb-panel);
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--lb-line);
  transition: background 0.15s;
}

.conv-item:hover {
  background: var(--lb-panel-2);
}

.conv-item.active {
  background: var(--lb-blue-light);
  border-left: 4px solid var(--lb-blue);
}

.conv-item img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.conv-item .name {
  font-weight: 600;
  font-size: 15px;
  color: var(--lb-text);
}

.conv-item .preview {
  font-size: 13px;
  color: var(--lb-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-item .meta {
  text-align: right;
  font-size: 11px;
  color: var(--lb-muted);
  flex-shrink: 0;
}

.badge-unread {
  background: var(--lb-brand);
  color: #fff;
  border-radius: 30px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}

.list-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lb-muted);
  padding: 12px 16px 4px;
  font-weight: 600;
}

.dot-online {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--lb-panel);
  position: absolute;
  bottom: 0;
  right: 0;
}

.av-wrap {
  position: relative;
  flex: 0 0 auto;
}

/* ---------- Zone de chat ---------- */
.chat-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--lb-bg);
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--lb-muted);
  padding: 20px;
}

.chat-empty i {
  font-size: 72px;
  color: var(--lb-line);
}

.chat-empty h2 {
  color: var(--lb-text);
  font-weight: 500;
}

.chat-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* ---------- En‑tête du chat ---------- */
.chat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--lb-panel);
  border-bottom: 1px solid var(--lb-line);
  flex-shrink: 0;
}

.chat-head .flex-grow-1 {
  min-width: 0;
}

.chat-head .fw-semibold {
  font-size: 16px;
}

.chat-head .small {
  font-size: 12px;
  color: var(--lb-muted);
}

.pinned-bar {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 13px;
  background: var(--lb-blue-light);
  color: var(--lb-blue);
  border-bottom: 1px solid var(--lb-line);
  flex-shrink: 0;
}

/* ---------- Messages ---------- */
.messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 16px 8px;
  min-height: 0;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  background: var(--lb-bg);
}

.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-thumb {
  background: var(--lb-line);
  border-radius: 6px;
}

.msg-row {
  display: flex;
  margin-bottom: 10px;
}

.msg-row.out {
  justify-content: flex-end;
}

.bubble {
  max-width: min(80%, 580px);
  background: var(--lb-bubble-in);
  border-radius: var(--lb-radius);
  padding: 10px 14px 8px;
  position: relative;
  font-size: 14.5px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-shadow: var(--lb-shadow);
  border: 1px solid var(--lb-line);
}

.msg-row.out .bubble {
  background: var(--lb-brand);
  color: #fff;
  border-color: var(--lb-brand);
}

.msg-row.out .bubble .time {
  color: rgba(255, 255, 255, 0.8);
}

.bubble .sender {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--lb-brand);
  margin-bottom: 3px;
}

.msg-row.out .bubble .sender {
  color: rgba(255, 255, 255, 0.9);
}

.bubble .time {
  font-size: 10.5px;
  color: var(--lb-muted);
  float: right;
  margin: 6px 0 0 10px;
  white-space: nowrap;
}

.bubble .ticks {
  font-size: 13px;
  margin-left: 4px;
}

.bubble .ticks.read {
  color: var(--lb-blue);
}

.bubble .quoted {
  border-left: 3px solid var(--lb-brand);
  background: var(--lb-panel-2);
  border-radius: 8px;
  padding: 4px 10px;
  margin-bottom: 5px;
  font-size: 13px;
}

.msg-row.out .bubble .quoted {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: #fff;
}

.bubble img.media,
.bubble video.media {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  margin: 4px 0 6px;
}

.bubble .doc {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--lb-panel-2);
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--lb-text);
  text-decoration: none;
  border: 1px solid var(--lb-line);
}

.msg-row.out .bubble .doc {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.bubble.deleted {
  font-style: italic;
  color: var(--lb-muted);
  background: var(--lb-panel-2);
}

.reactions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.reactions span {
  background: var(--lb-panel-2);
  border-radius: 20px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--lb-line);
}

.msg-row.out .reactions span {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.date-sep {
  text-align: center;
  margin: 12px 0 16px;
}

.date-sep span {
  background: var(--lb-panel);
  color: var(--lb-muted);
  padding: 4px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--lb-line);
  box-shadow: var(--lb-shadow);
}

/* ---------- Barres basses ---------- */
.typing-bar {
  display: flex;
  align-items: center;
  padding: 2px 16px 6px;
  color: var(--lb-brand);
  background: var(--lb-bg);
}

.typing-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lb-brand);
  margin-right: 4px;
  animation: blink 1.4s infinite;
}

.typing-bar .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-bar .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--lb-panel);
  border-top: 1px solid var(--lb-line);
  flex-shrink: 0;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--lb-panel);
  border-top: 1px solid var(--lb-line);
  flex-shrink: 0;
}

.composer textarea {
  background: var(--lb-panel-2);
  border: 1px solid var(--lb-line);
  color: var(--lb-text);
  border-radius: 30px;
  resize: none;
  max-height: 120px;
  padding: 9px 16px;
  font-size: 14px;
  line-height: 1.4;
}

.composer textarea:focus {
  background: var(--lb-panel-2);
  border-color: var(--lb-brand);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.15);
  color: var(--lb-text);
}

.send-btn {
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--lb-brand);
  color: #fff;
  flex: 0 0 auto;
  transition: background 0.2s, transform 0.1s;
  display: grid;
  place-items: center;
}

.send-btn:hover {
  background: var(--lb-brand-2);
}

.send-btn:active {
  transform: scale(0.92);
}

.recording {
  background: #e03131 !important;
  color: #fff !important;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.6;
  }
}

.emoji-panel {
  position: absolute;
  bottom: 74px;
  left: 12px;
  right: 12px;
  max-width: 340px;
  background: var(--lb-panel);
  border: 1px solid var(--lb-line);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: var(--lb-shadow-hover);
}

.emoji-panel button {
  border: 0;
  background: none;
  font-size: 22px;
  width: 40px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.emoji-panel button:hover {
  background: var(--lb-panel-2);
}

.chat-active {
  position: relative;
}

/* ---------- Modales et recadrage ---------- */
.modal-content {
  background: var(--lb-panel);
  color: var(--lb-text);
  border: 1px solid var(--lb-line);
  border-radius: 20px;
  box-shadow: var(--lb-shadow-hover);
}

.modal-header,
.modal-footer {
  border-color: var(--lb-line);
  padding: 16px 20px;
}

.btn-close {
  filter: none;
  opacity: 0.6;
}

.btn-close:hover {
  opacity: 1;
}

.crop-stage {
  position: relative;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.crop-stage canvas {
  display: block;
  width: 100%;
}

.crop-box {
  position: absolute;
  border: 2px solid var(--lb-brand);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
}

.crop-box .handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  background: var(--lb-brand);
  border-radius: 4px;
  cursor: nwse-resize;
}

/* ---------- Visionneuse de stories ---------- */
.story-viewer {
  position: fixed;
  inset: 0;
  background: #0f1117;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.story-progress {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
}

.story-progress .seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  overflow: hidden;
}

.story-progress .seg i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}

.story-top {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #fff;
}

.story-top img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.story-stage {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.story-stage img,
.story-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.story-caption {
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
  min-height: 24px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.story-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.story-actions input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 30px;
  padding: 8px 14px;
  font-size: 14px;
}

.story-actions input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.story-actions input:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--lb-brand);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.3);
  color: #fff;
}

.liked i {
  color: #ff6b6b;
}

.tiny {
  font-size: 11px;
  opacity: 0.8;
}

/* ---------- Appels ---------- */
.call-overlay {
  position: fixed;
  inset: 0;
  background: #0a0c10;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
}

#remoteVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0c10;
}

#localVideo {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 120px;
  height: 170px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: #000;
  box-shadow: var(--lb-shadow);
}

.call-info {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.call-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(32px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 20px;
}

.call-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 20px;
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  transition: background 0.2s;
  cursor: pointer;
}

.call-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.call-btn.off {
  background: #fff;
  color: #111;
}

.call-btn.danger {
  background: #e03131;
}

.call-btn.danger:hover {
  background: #c62828;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar {
    width: 100%;
    flex: 1 1 auto;
  }

  .chat-pane {
    display: none;
  }

  .app-shell.show-chat .sidebar {
    display: none;
  }

  .app-shell.show-chat .chat-pane {
    display: flex;
  }

  .bubble {
    max-width: 90%;
  }
}

@media (min-width: 992px) {
  #btnBack {
    display: none;
  }
}

/* ---------- Corrections de détail ---------- */
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flex-grow-1 {
  flex: 1 1 auto;
}

.ms-2 {
  margin-left: 8px;
}

.me-2 {
  margin-right: 8px;
}

.me-1 {
  margin-right: 4px;
}

.w-100 {
  width: 100%;
}

.rounded {
  border-radius: 12px;
}

/* Pour les petits écrans en mode paysage */
@media (max-height: 600px) {
  .sidebar-head {
    padding: 6px 12px;
  }
  .conv-item {
    padding: 8px 12px;
  }
  .chat-head {
    padding: 6px 12px;
  }
  .composer {
    padding: 6px 12px;
  }
  .messages {
    padding: 10px 12px;
  }
}
/* Réactions rapides Font Awesome */
.reactions-rapid {
    display: flex;
    gap: 2px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.reactions-rapid .react-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lb-muted);
    transition: 0.15s;
    cursor: pointer;
    font-size: 14px;
}

.reactions-rapid .react-btn:hover {
    background: var(--lb-panel-2);
    border-color: var(--lb-line);
    transform: scale(1.1);
}

.msg-row.out .reactions-rapid .react-btn {
    color: rgba(255,255,255,0.7);
}

.msg-row.out .reactions-rapid .react-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

/* Citation cliquable */
.quoted[data-reply-id] {
    cursor: pointer;
    transition: background 0.2s;
}

.quoted[data-reply-id]:hover {
    background: rgba(245, 124, 0, 0.15);
}

/* Compteur d'enregistrement */
#timerDisplay {
    font-size: 14px;
    font-weight: 600;
    color: var(--lb-brand);
    background: var(--lb-panel-2);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--lb-line);
    display: none;
    user-select: none;
}

/* Panneau d'icônes Font Awesome (remplace emoji-panel) */
.emoji-panel button {
    border: 0;
    background: none;
    border-radius: 8px;
    padding: 4px 6px;
    transition: 0.15s;
}

.emoji-panel button:hover {
    background: var(--lb-panel-2);
}

/* Message mis en évidence lors du scroll */
.msg-row.highlight {
    background: rgba(245, 124, 0, 0.2);
    border-radius: 8px;
}
.reactions .reaction-icon {
  background: var(--lb-panel-2);
  border-radius: 20px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--lb-line);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.msg-row.out .reactions .reaction-icon {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
/* =========================================================
   COMPLÉMENTS POUR LES NOUVELLES FONCTIONNALITÉS
   (émojis catégorisés, speed, pré-écoute, sélecteurs, sondages)
   ========================================================= */

/* ---- Émojis catégorisés (onglets) ---- */
#emojiPanel .nav-tabs {
  border-bottom: 1px solid var(--lb-line);
  gap: 2px;
}
#emojiPanel .nav-link {
  padding: 4px 10px;
  font-size: 14px;
  color: var(--lb-muted);
  border: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  cursor: pointer;
}
#emojiPanel .nav-link.active {
  background: var(--lb-brand);
  color: #fff;
}
#emojiPanel .tab-pane {
  display: none;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}
#emojiPanel .tab-pane.show.active {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
#emojiPanel .tab-pane button {
  width: 34px;
  height: 34px;
  font-size: 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}
#emojiPanel .tab-pane button:hover {
  background: var(--lb-panel-2);
}

/* ---- Contrôles de vitesse audio ---- */
.speed-controls {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}
.speed-btn {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 12px;
  border: 1px solid var(--lb-line);
  background: transparent;
  color: var(--lb-muted);
  cursor: pointer;
}
.speed-btn.active {
  background: var(--lb-brand);
  color: #fff;
  border-color: var(--lb-brand);
}
.speed-btn:hover {
  background: var(--lb-panel-2);
}

/* ---- Pré-écoute audio (avant envoi) ---- */
#audioPreview {
  background: var(--lb-panel-2);
  border: 1px solid var(--lb-line);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 0 12px 6px;
}
#audioPreview audio {
  max-width: 100%;
}

/* ---- Sélecteur d'expiration et vue unique ---- */
#expireSelector {
  background: var(--lb-panel-2);
  border: 1px solid var(--lb-line);
  color: var(--lb-text);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}
#viewOnceCheck {
  accent-color: var(--lb-brand);
}
#viewOnceCheck + label {
  font-size: 12px;
  color: var(--lb-muted);
  margin-left: 2px;
}

/* ---- Bouton micro verrouillé ---- */
#btnMic.locked {
  background: var(--lb-brand);
  color: #fff;
}
#btnMic.locked::after {
  content: "🔒";
  font-size: 14px;
  position: absolute;
  top: -4px;
  right: -4px;
}

/* ---- Animation de verrouillage (optionnelle) ---- */
@keyframes lockPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
#btnMic.locked {
  animation: lockPulse 1.2s infinite;
}

/* ---- Sondages (affichage des options) ---- */
.vote-option {
  text-align: left !important;
  background: var(--lb-panel-2);
  border: 1px solid var(--lb-line);
  transition: background 0.15s;
}
.vote-option:hover {
  background: var(--lb-brand);
  color: #fff !important;
}

/* ---- Indicateur de vue unique ---- */
.view-once {
  position: relative;
  cursor: pointer;
}
.view-once::after {
  content: "👁️";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 18px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  padding: 2px 4px;
  color: #fff;
}

/* ---- Compteur de temps restant (éphémère) ---- */
.countdown {
  font-weight: 600;
  color: var(--lb-brand);
}

/* ---- Adaptations mobiles ---- */
@media (max-width: 576px) {
  #expireSelector {
    font-size: 10px;
    padding: 2px 6px;
  }
  #viewOnceCheck + label {
    font-size: 10px;
  }
  .speed-btn {
    font-size: 10px;
    padding: 0 6px;
  }
  #emojiPanel .tab-pane button {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}