/* Thèmes ChatMeet : sombre (défaut), clair, moderne. */

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f1f5f9;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --panel-2: #f8fafc;
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.2);
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #64748b;
  --accent: #6d28d9;
  --accent-2: #0891b2;
  --accent-soft: rgba(109, 40, 217, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --ok: #059669;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

html[data-theme='light'] body,
html[data-theme='light'] .app-page,
html[data-theme='light'] .chat-shell,
html[data-theme='light'] .auth-body,
html[data-theme='light'] .lobby {
  background: #f1f5f9;
}

html[data-theme='light'] .auth-aside {
  background: #e9eef7;
  color: var(--text);
}

html[data-theme='light'] .app-header,
html[data-theme='light'] .lobby,
html[data-theme='light'] .room,
html[data-theme='light'] .auth-main {
  background: #f1f5f9;
  color: var(--text);
}

html[data-theme='light'] .app-header,
html[data-theme='light'] .lobby-top,
html[data-theme='light'] .room-top,
html[data-theme='light'] .chat-head,
html[data-theme='light'] .chat-sidebar,
html[data-theme='light'] .chat-people,
html[data-theme='light'] .side-panel,
html[data-theme='light'] .card,
html[data-theme='light'] .join-card,
html[data-theme='light'] .auth-card,
html[data-theme='light'] .modal-card,
html[data-theme='light'] .device-card,
html[data-theme='light'] .notif-panel,
html[data-theme='light'] .config-nav,
html[data-theme='light'] .admin-tabs,
html[data-theme='light'] .stat-card,
html[data-theme='light'] .meeting-card,
html[data-theme='light'] .group-card {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme='light'] .conversation-item.active,
html[data-theme='light'] .notif-item.unread {
  background: #ede9fe;
}

html[data-theme='light'] .conversation-item:hover,
html[data-theme='light'] .people-row:hover,
html[data-theme='light'] .notif-item:hover {
  background: #f1f5f9;
}

html[data-theme='light'] .chat-msg-body {
  background: #f1f5f9;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme='light'] .chat-msg.self .chat-msg-body {
  background: #ede9fe;
  border-color: #ddd6fe;
}

html[data-theme='light'] .chat-msg-name,
html[data-theme='light'] .chat-msg.self .chat-msg-name {
  color: #5b21b6;
}

html[data-theme='light'] input,
html[data-theme='light'] textarea,
html[data-theme='light'] select,
html[data-theme='light'] .input {
  background: #ffffff;
  color: #0f172a;
  border-color: var(--line-strong);
}

html[data-theme='light'] .app-nav a,
html[data-theme='light'] .brand-name,
html[data-theme='light'] .card-sub,
html[data-theme='light'] .hint,
html[data-theme='light'] .auth-foot,
html[data-theme='light'] .server-line {
  color: var(--muted);
}

html[data-theme='light'] .app-user-name {
  color: #0f172a;
}

html[data-theme='light'] .btn-secondary,
html[data-theme='light'] .ghost-btn {
  color: #0f172a;
  background: #f8fafc;
  border-color: var(--line-strong);
}

html[data-theme='light'] .btn-danger {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}

html[data-theme='light'] .btn-primary {
  color: #fff;
}

html[data-theme='light'] .app-nav a.active {
  color: #4c1d95;
  background: #ede9fe;
}

html[data-theme='light'] .modal-overlay,
html[data-theme='light'] .device-overlay {
  background: rgba(15, 23, 42, 0.45);
}

html[data-theme='modern'] {
  --bg: #06111d;
  --bg-soft: #0a1a2a;
  --panel: rgba(8, 25, 40, 0.78);
  --panel-solid: #0a1a2a;
  --panel-2: #102a40;
  --line: rgba(34, 211, 238, 0.16);
  --line-strong: rgba(34, 211, 238, 0.28);
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --shadow: 0 24px 70px rgba(0, 15, 30, 0.6);
}

html[data-theme='modern'] body {
  background:
    radial-gradient(900px 500px at 8% -5%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(900px 550px at 95% 100%, rgba(167, 139, 250, 0.14), transparent 60%),
    #06111d;
}

html[data-theme='modern'] .app-header,
html[data-theme='modern'] .chat-sidebar,
html[data-theme='modern'] .chat-people {
  background: rgba(6, 17, 29, 0.84);
  border-color: var(--line);
}

html[data-theme='modern'] .conversation-avatar:not(.ai),
html[data-theme='modern'] .brand-mark {
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
}

html[data-theme='modern'] .btn-primary,
html[data-theme='modern'] .send-btn {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
}

/* Statuts de présence */
.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 2px #0b1120;
}

.status-dot.available { background: #22c55e; }
.status-dot.busy { background: #ef4444; }
.status-dot.away { background: #fbbf24; }
.status-dot.in_meeting { background: #f472b6; }
.status-dot.offline { background: #64748b; }

html[data-theme='light'] .status-dot {
  box-shadow: 0 0 0 2px #fff;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-label .status-dot {
  box-shadow: none;
}

.chat-ticks {
  font-size: 11px;
  line-height: 1;
  letter-spacing: -3px;
  color: var(--muted-2);
  padding-right: 3px;
}

.chat-ticks.read {
  color: #38bdf8;
  letter-spacing: -4px;
}

.emoji-popover {
  overscroll-behavior: contain;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.version-badge.ready {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.3);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
}

.config-subtitle {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Profil et avatars */
.profile-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
}

.avatar-wrap .status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--bg);
  box-sizing: content-box;
}

.avatar-photo {
  overflow: hidden;
  padding: 0;
}

.avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.avatar-lg {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  overflow: hidden;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.profile-card {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #0b1120;
  box-shadow: var(--shadow);
}

.profile-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.profile-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.profile-head .card-sub {
  margin: 0;
}

.profile-head-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-main {
  max-width: 1080px;
  margin: 0 auto;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-photo-card {
  text-align: center;
  padding: 24px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-photo-card.drag-over {
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.06);
}

.profile-avatar-large {
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  width: 148px;
  height: 148px;
}

.avatar-profile {
  width: 148px;
  height: 148px;
  border-radius: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.4);
}

.avatar-profile.avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-photo-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}

.profile-drop-hint {
  margin: 16px 0 0;
  padding: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.profile-info-card {
  padding: 24px;
}

.profile-info-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.profile-info-head h2 {
  margin: 0;
  font-size: 24px;
}

.profile-info-head .card-sub {
  margin: 3px 0 0;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.profile-details > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.035);
}

.profile-details dt {
  color: var(--muted-2);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.profile-details dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-info-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

@media (max-width: 800px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-details {
    grid-template-columns: 1fr;
  }

  .profile-info-head {
    flex-direction: column;
  }
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 12px;
}

.profile-avatar-row > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
}

.profile-colors {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.avatar-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.avatar-color.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.profile-actions {
  margin-top: 16px;
}

html[data-theme='light'] .profile-card {
  background: #fff;
  color: var(--text);
}

/* Messages vocaux et réponses citées */
.voice-record-btn.recording {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.3);
}

.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: rgba(124, 92, 255, 0.08);
}

.chat-reply-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.chat-reply-info strong {
  color: var(--accent-2);
}

.chat-reply-info small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted-2);
}

.voice-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
  font-size: 12px;
  color: #fecaca;
}

.voice-bar strong {
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}

.voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: voicePulse 1s infinite;
}

@keyframes voicePulse {
  50% { opacity: 0.25; }
}

.chat-reply-quote {
  margin-bottom: 7px;
  padding: 5px 8px;
  border-left: 3px solid var(--accent-2);
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.08);
  font-size: 11.5px;
  color: var(--muted);
}

.chat-meeting-ended {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
}

.chat-reply-quote strong {
  display: block;
  color: var(--accent-2);
  font-size: 10.5px;
  margin-bottom: 2px;
}

.chat-reply-quote span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg-head {
  position: relative;
}

.chat-reply-btn {
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 6px;
  color: var(--muted-2);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chat-msg:hover .chat-reply-btn {
  opacity: 1;
}

.chat-reply-btn:hover {
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.1);
}

@media (max-width: 800px) {
  .chat-reply-btn {
    opacity: 1;
  }
}

.chat-audio-msg {
  display: flex;
  align-items: center;
  min-width: 230px;
}

.chat-audio-msg audio {
  width: 230px;
  max-width: 100%;
  height: 36px;
}

.chat-audio-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.chat-audio-player {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 250px;
}

.audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 22px;
  padding: 2px 0;
  cursor: pointer;
}

.audio-wave-bar {
  flex: 1;
  min-width: 1px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.35);
}

.audio-wave-bar.played {
  background: var(--accent-2);
}

.chat-audio-player audio {
  display: none;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.audio-play {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  font-size: 10px;
  cursor: pointer;
}

.audio-play:hover {
  background: rgba(34, 197, 94, 0.24);
}

.audio-time,
.audio-duration,
.audio-separator {
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.audio-duration {
  color: var(--muted-2);
}

.audio-rates {
  display: flex;
  gap: 3px;
}

.audio-rate {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  cursor: pointer;
}

.audio-rate.active {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.4);
}

.chat-pinned-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(124, 92, 255, 0.07);
  min-height: 36px;
}

.pinned-icon { font-size: 12px; }

.pinned-items {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  min-width: 0;
}

.pinned-item {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.45);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.typing-indicator {
  padding: 4px 18px 6px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-style: italic;
}

.chat-msg-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chat-main { position: relative; }
.chat-msg-head { align-items: center; }

.chat-msg:hover .chat-msg-actions {
  opacity: 1;
}

.chat-quick-react,
.chat-more-btn {
  width: 21px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
  cursor: pointer;
}

.chat-quick-react:hover,
.chat-more-btn:hover {
  background: rgba(124, 92, 255, 0.14);
}

.chat-pin-mark,
.chat-edited,
.chat-scheduled-mark {
  color: var(--muted-2);
  font-size: 9.5px;
}

.chat-forwarded {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 10px;
  font-style: italic;
}

.chat-deleted {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
  font-style: italic;
}

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

.chat-reaction-chip {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.07);
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}

.chat-reaction-chip.mine {
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(34, 211, 238, 0.1);
  color: #a5f3fc;
}

.chat-thread-link {
  margin-top: 5px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: 10.5px;
  cursor: pointer;
}

.chat-msg-scheduled {
  opacity: 0.62;
}

.chat-msg-scheduled .chat-msg-body {
  border-style: dashed;
}

.flash-message .chat-msg-body {
  animation: flashMessage 1.2s ease;
}

@keyframes flashMessage {
  25% { box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55); }
}

.message-menu {
  position: fixed;
  z-index: 800;
  width: 205px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1322;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.message-menu-item {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.message-menu-item:hover {
  background: rgba(124, 92, 255, 0.14);
}

.message-menu-item.danger { color: #fca5a5; }

html[data-theme='light'] .message-menu,
html[data-theme='light'] .mention-menu {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

html[data-theme='light'] .message-menu-item,
html[data-theme='light'] .mention-item {
  color: #0f172a;
}

html[data-theme='light'] .message-menu-item:hover,
html[data-theme='light'] .mention-item:hover {
  background: #f1f5f9;
}

html[data-theme='light'] .message-menu-item.danger {
  color: #b91c1c;
}

.chat-search-card,
.chat-media-card,
.chat-thread-card,
.chat-ai-card {
  width: min(680px, 100%);
}

.chat-ai-card {
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 24px 70px rgba(124, 92, 255, 0.14);
}

.ai-quick-actions,
.ai-question-row,
.ai-result-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.ai-question-row {
  margin-top: 10px;
}

.ai-question-row .input {
  flex: 1;
  min-width: 180px;
}

.ai-result {
  min-height: 130px;
  max-height: 45vh;
  overflow-y: auto;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.045);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.ai-result.is-loading {
  color: var(--muted);
  animation: aiPulse 1.2s ease infinite;
}

@keyframes aiPulse {
  50% { opacity: 0.45; }
}

.ai-result-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.ai-chat-btn {
  background: linear-gradient(135deg, #7c5cff, #8b5cf6);
}

.chat-search-card {
  position: relative;
}

.chat-search-card #aiSearchBtn {
  margin-top: 8px;
}

.chat-search-results,
.chat-media-list,
.thread-replies,
.forward-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 10px;
}

.search-result,
.forward-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2px;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.forward-item:hover {
  background: rgba(124, 92, 255, 0.09);
}

.search-result strong,
.forward-item strong { font-size: 11.5px; }
.search-result span,
.forward-item span { color: var(--muted-2); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.media-tabs {
  display: flex;
  gap: 5px;
  margin: 12px 0 4px;
}

.media-tab {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}

.media-tab.active {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.media-image-link img {
  width: 74px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
}

.thread-parent,
.thread-message {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.045);
  margin-bottom: 7px;
  font-size: 12px;
}

.thread-message strong {
  display: block;
  color: var(--accent-2);
  font-size: 10.5px;
  margin-bottom: 3px;
}

.thread-composer {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
}

.mention-menu {
  position: absolute;
  left: 16px;
  bottom: 66px;
  z-index: 90;
  width: 240px;
  max-height: 210px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1322;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.mention-item:hover { background: rgba(124, 92, 255, 0.12); }

.avatar-xs {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  overflow: hidden;
}

.avatar-xs img { width: 100%; height: 100%; object-fit: cover; }

.chat-composer.drag-over {
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.06);
}

.chat-sidebar-actions {
  display: flex;
  gap: 5px;
}

.chat-poll {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
  max-width: 420px;
}

.chat-poll-question {
  font-size: 12.5px;
  margin-bottom: 2px;
}

.chat-poll-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.chat-poll-option.selected {
  border-color: rgba(34, 211, 238, 0.45);
}

.chat-poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(34, 211, 238, 0.12);
  pointer-events: none;
}

.chat-poll-label,
.chat-poll-count {
  position: relative;
  z-index: 1;
}

.chat-poll-label { flex: 1; }
.chat-poll-count { color: var(--muted); font-size: 10px; }
.chat-poll-total { color: var(--muted-2); font-size: 10px; }

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0;
}

.onboarding-card {
  text-align: center;
}

.onboarding-mark {
  font-size: 42px;
  margin-bottom: 8px;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
  text-align: left;
}

.onboarding-steps > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.04);
}

.onboarding-steps strong {
  display: block;
  color: var(--accent-2);
  font-size: 12px;
}

.onboarding-steps span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.backup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.035);
}

.backup-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.backup-info strong {
  font-size: 12px;
}

.backup-info span {
  color: var(--muted-2);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.backup-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .backup-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 800px) {
  .chat-msg-actions {
    opacity: 1;
  }

  .chat-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
