/* DOZ Messenger — full responsive layout, dark/light, no inline styles. */
:root { --sidebar-w: 340px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; height: 100vh; height: 100dvh; overflow: hidden; overflow-x: hidden; max-width: 100vw; }

/* Auth */
.auth-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; height: 100dvh; padding: 16px; overflow-y: auto; }
.auth-card { width: 100%; max-width: 380px; }

/* App shell */
#app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; height: 100dvh; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--bs-border-color); overflow: hidden; }
.sb-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--bs-border-color); }
.sb-tabs { display: flex; border-bottom: 1px solid var(--bs-border-color); }
.sb-tab { flex: 1; padding: 8px 0; border: none; background: none; font-size: 13px; cursor: pointer; color: var(--bs-secondary-color); transition: background .1s; }
.sb-tab:active { background: var(--bs-secondary-bg); }
.sb-tab.active { color: var(--bs-primary); border-bottom: 2px solid var(--bs-primary); font-weight: 600; }
.sb-panel { flex: 1; overflow-y: auto; }
.sb-search { margin: 8px; width: calc(100% - 16px); }

/* Avatars */
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--bs-secondary-bg); flex-shrink: 0; }
.avatar-md { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bs-secondary-bg); flex-shrink: 0; }

/* Conversation list items */
.conv-list { display: flex; flex-direction: column; }
.conv-item { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; align-items: center; border-bottom: 1px solid var(--bs-border-color-translucent); }
.conv-item:hover, .conv-item.active { background: var(--bs-primary-bg-subtle); }
.conv-item .info { flex: 1; min-width: 0; }
.conv-item .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .preview { font-size: 12px; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .meta { text-align: right; flex-shrink: 0; }
.conv-item .meta .time { font-size: 11px; color: var(--bs-secondary-color); }
.conv-item .badge { font-size: 10px; }

/* Chat area */
.chat-area { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.chat-active { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--bs-border-color); flex-shrink: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }

/* Message bubbles */
.msg { max-width: 72%; padding: 8px 12px; border-radius: 14px; word-break: break-word; white-space: pre-wrap; position: relative; font-size: 14px; }
.msg.mine { align-self: flex-end; background: var(--bs-primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--bs-secondary-bg); border-bottom-left-radius: 4px; }
.msg .msg-time { font-size: 10px; opacity: .7; margin-top: 2px; text-align: right; }
.msg .msg-sender { font-size: 11px; font-weight: 600; margin-bottom: 2px; opacity: .9; }
.msg .msg-reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.msg .msg-reactions span { font-size: 14px; cursor: pointer; background: var(--bs-secondary-bg); border-radius: 10px; padding: 0 5px; }
.msg .secret-lock { margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.msg .secret-lock input { flex: 1; padding: 4px 8px; border-radius: 8px; border: 1px solid #ccc; font-size: 13px; }
.msg-img { max-width: 260px; border-radius: 8px; cursor: pointer; }
.msg-audio { width: 100%; max-width: 240px; }
.msg-file { display: flex; gap: 8px; align-items: center; }
.msg-file i { font-size: 24px; }
.system-msg { align-self: center; font-size: 12px; color: var(--bs-secondary-color); background: var(--bs-secondary-bg); border-radius: 10px; padding: 4px 12px; }

/* Composer */
.composer { border-top: 1px solid var(--bs-border-color); padding: 6px 12px; flex-shrink: 0; }
.composer-secret { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.composer-row .form-control { border-radius: 20px; }
#msgInput { resize: none; max-height: 120px; overflow-y: auto; line-height: 1.4; padding-top: 8px; padding-bottom: 8px; transition: height .1s ease; }

/* Voice recording indicator */
.recording-indicator { color: #dc2626; font-size: 13px; display: flex; align-items: center; gap: 6px; flex: 1; }
.recording-dot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* Icon buttons */
.icon-btn { background: none; border: none; padding: 6px; border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--bs-body-color); transition: background .1s, transform .1s; }
.icon-btn:hover { background: var(--bs-secondary-bg); }
.icon-btn:active { background: var(--bs-primary-bg-subtle); transform: scale(0.92); }
.icon-btn.toggled-on { background: var(--bs-primary); color: #fff; }
.flex-1 { flex: 1; min-width: 0; }

/* Emoji picker */
.emoji-picker { position: absolute; bottom: 70px; left: 60px; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: 12px; padding: 10px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 240px; overflow-y: auto; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.emoji-picker span { font-size: 22px; cursor: pointer; text-align: center; padding: 2px; border-radius: 6px; }
.emoji-picker span:hover { background: var(--bs-secondary-bg); }

/* Modals */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; }
.modal-box { background: var(--bs-body-bg); border-radius: 14px; padding: 20px; width: 100%; max-width: 440px; }

/* Status */
.status-item { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; align-items: center; }
.status-item:hover { background: var(--bs-secondary-bg); }
.status-ring { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--bs-primary); padding: 2px; }
.status-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.status-view-box { background: #000; width: 100%; max-width: 420px; border-radius: 14px; position: relative; overflow: hidden; }
.status-content { min-height: 300px; display: flex; align-items: center; justify-content: center; }
.status-content img, .status-content video { max-width: 100%; max-height: 70vh; }
.status-content .text-status { font-size: 22px; font-weight: 600; color: #fff; padding: 40px; text-align: center; }
.status-caption { color: #fff; padding: 12px; text-align: center; font-size: 14px; }

/* Contact items */
.friend-item { display: flex; gap: 10px; padding: 8px 14px; align-items: center; }
.friend-item .info { flex: 1; }
.pending-card { background: var(--bs-warning-bg-subtle); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.pending-card .info { flex: 1; font-size: 13px; }

/* Call overlay */
#callOverlay { position: fixed; inset: 0; background: #0b0f14; z-index: 1200; display: flex; align-items: center; justify-content: center; }
.call-box { width: 100%; height: 100%; display: flex; flex-direction: column; }
.call-videos { position: relative; flex: 1; background: #000; overflow: hidden; }
#remoteVid { width: 100%; height: 100%; object-fit: cover; background: #111; }
#localVid.local { position: absolute; bottom: 100px; right: 16px; width: 130px; height: 180px; object-fit: cover; border-radius: 12px; border: 2px solid #fff; background: #222; }
.call-videos.audio-only #remoteVid, .call-videos.audio-only #localVid { display: none; }
.call-info { position: absolute; top: 24px; left: 0; right: 0; text-align: center; color: #fff; }
.call-info .peer-name { font-size: 22px; font-weight: 600; }
.call-info .call-status { opacity: .8; margin-top: 4px; }
.call-controls { display: flex; gap: 16px; justify-content: center; padding: 22px; background: #111827; }
.cc { width: 56px; height: 56px; border-radius: 50%; border: none; font-size: 20px; color: #fff; background: #374151; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s, transform .1s; }
.cc:active { transform: scale(0.9); }
.cc:hover { background: #4b5563; }
.cc-green { background: #16a34a; } .cc-red { background: #dc2626; }
.cc-off { background: #fff; color: #111827; } .cc-active { background: #2563eb; }

/* ============================================================
   RESPONSIVE DESIGN — Tablet (992px) and Mobile (768px / 480px)
   ============================================================ */

/* Tablet: narrower sidebar, tighter spacing */
@media (max-width: 992px) {
  :root { --sidebar-w: 300px; }
  .msg { max-width: 78%; }
  .modal-box { max-width: 400px; }
}

/* Mobile: single-column, sidebar becomes a full-screen overlay */
@media (max-width: 768px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: absolute; inset: 0; z-index: 40; background: var(--bs-body-bg); width: 100%; }
  .sidebar.hidden { display: none; }
  .chat-area.no-chat .chat-active { display: none; }
  .chat-area.no-chat .chat-empty { display: flex; }
  #localVid.local { width: 96px; height: 132px; bottom: 96px; }

  .msg { max-width: 85%; font-size: 14px; }
  .chat-header { padding: 8px 10px; gap: 6px; }
  .chat-header .fw-bold { font-size: 14px; }
  .composer { padding: 6px 8px; }
  .composer-row { gap: 4px; }
  .icon-btn { width: 38px; height: 38px; font-size: 16px; }

  /* Emoji picker: constrain to viewport instead of a fixed left offset */
  .emoji-picker { left: 8px; right: 8px; width: auto; max-width: none; bottom: 64px; }

  /* Modals: full-width with small side margins, less top padding */
  .modal-bg { padding: 24px 10px; align-items: center; }
  .modal-box { max-width: 100%; padding: 16px; border-radius: 12px; max-height: 85vh; overflow-y: auto; }

  /* Call UI: shrink controls + avatar so everything fits on small screens */
  .call-controls { gap: 10px; padding: 14px; flex-wrap: wrap; }
  .cc { width: 52px; height: 52px; font-size: 18px; }
  .call-avatar { width: 56px; height: 56px; }

  /* Sidebar header / tabs: tighter */
  .sb-header { padding: 8px 10px; }
  .sb-tab { font-size: 12px; padding: 8px 0; }
  .sb-tab i { font-size: 14px; }

  /* Group info / forward modal member rows: allow wrap on very narrow screens */
  .group-member-row { flex-wrap: wrap; }
  .group-member-row .gm-actions { width: 100%; justify-content: flex-end; margin-top: 4px; }

  /* Status viewer takes full width on mobile */
  .status-view-box { max-width: 100%; }

  /* Lightbox close button stays reachable */
  .lightbox-close { top: 8px; right: 8px; }
}

/* Small phones */
@media (max-width: 480px) {
  .msg { max-width: 90%; }
  .avatar-md { width: 40px; height: 40px; }
  .avatar-sm { width: 32px; height: 32px; }
  .conv-item { padding: 8px 10px; gap: 8px; }
  .conv-item .name { font-size: 13px; }
  .conv-item .preview { font-size: 11px; }
  .auth-card { max-width: 100%; }
  .composer-secret { flex-wrap: nowrap; gap: 6px; overflow: hidden; }
  .composer-secret .form-check-label { font-size: 12px; white-space: nowrap; }
  .composer-secret #expiry { font-size: 12px; padding: 2px 22px 2px 8px; min-width: 0; flex-shrink: 1; width: auto !important; }
}

/* ====== NEW STYLES: Online dot, message status, lightbox, reply bar, call avatar ====== */

/* Online status dot */
.avatar-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.online-dot { position: absolute; bottom: 2px; right: 2px; width: 10px; height: 10px; background: #16a34a; border-radius: 50%; border: 2px solid var(--bs-body-bg); }

/* Message delivery/seen status */
.msg-status { font-size: 11px; margin-left: 4px; }
.msg-status.sent { color: #9ca3af; }
.msg-status.delivered { color: #9ca3af; }
.msg-status.seen { color: #3b82f6; }

/* Sender name in group chats */
.msg-sender { font-size: 11px; font-weight: 600; color: var(--bs-primary); margin-bottom: 2px; }

/* Reply bar above composer */
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--bs-tertiary-bg); border-left: 3px solid var(--bs-primary); border-radius: 6px 6px 0 0; font-size: 12px; }
.reply-bar .reply-preview { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .reply-sender { font-weight: 600; color: var(--bs-primary); }

/* Lightbox overlay */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 1300; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.lightbox-content { position: relative; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-media { max-width: 95vw; max-height: 82vh; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: -36px; right: 0; background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; z-index: 10; padding: 4px 12px; }

/* Message image click hint */
.msg-img.lightbox-trigger { cursor: zoom-in; transition: opacity .15s; }
.msg-img.lightbox-trigger:hover { opacity: .85; }

/* Download button in file messages */
.msg-file { display: flex; align-items: center; gap: 6px; }
.msg-file a { text-decoration: none; }
.msg-file .btn { padding: 2px 6px; font-size: 12px; }

/* Call avatar */
.call-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); object-fit: cover; margin-bottom: 8px; }
.call-videos.audio-only .call-avatar { width: 120px; height: 120px; }

/* Recording indicator */
.recording-indicator { display: flex; align-items: center; gap: 8px; flex: 1; padding: 0 12px; font-size: 14px; color: var(--bs-danger); }
.recording-dot { width: 10px; height: 10px; background: #dc2626; border-radius: 50%; animation: blink 1s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Forgot password link */
.forgot-link { font-size: 13px; color: var(--bs-primary); cursor: pointer; text-decoration: underline; }

/* Settings avatar section */
.settings-avatar-section { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.settings-avatar-section img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bs-border-color); }

/* ====== NEW FEATURE STYLES: chat menu, search bar, group info, forward ====== */

/* Chat header dropdown menu */
.chat-menu-wrap { position: relative; }
.chat-menu-dropdown { position: absolute; top: 100%; right: 0; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.15); min-width: 200px; z-index: 150; padding: 6px 0; margin-top: 4px; }
.cm-item { padding: 8px 14px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.cm-item:hover { background: var(--bs-tertiary-bg); }

/* In-chat search bar */
.chat-search-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); }
.chat-search-bar input { flex: 1; }
.chat-search-results { max-height: 260px; overflow-y: auto; border-bottom: 1px solid var(--bs-border-color); }
.search-result-item { padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--bs-border-color); cursor: pointer; }
.search-result-item:hover { background: var(--bs-tertiary-bg); }
.search-result-item .sr-sender { font-weight: 600; font-size: 12px; }
.search-result-item .sr-time { font-size: 11px; color: var(--bs-secondary); float: right; }
.search-highlight { background: #ffe58f; border-radius: 2px; padding: 0 2px; }

/* Group info modal */
.group-member-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--bs-border-color); }
.group-member-row .gm-name { flex: 1; font-size: 14px; }
.group-member-row .gm-role { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bs-tertiary-bg); }
.group-member-row .gm-actions { display: flex; gap: 4px; }

/* Forward list checkboxes */
.forward-pick { cursor: pointer; }
.forward-pick.selected { background: var(--bs-primary-bg-subtle); }
.forward-pick .fwd-check { margin-left: auto; }

/* Message forwarded label */
.msg-forwarded-label { font-size: 11px; font-style: italic; color: var(--bs-secondary); margin-bottom: 2px; }

/* Disappearing message indicator in chat header */
.disappearing-badge { font-size: 11px; color: var(--bs-warning); display: flex; align-items: center; gap: 3px; }

/* ====== Custom Voice Message Player (replaces native <audio controls>) ====== */
.voice-player { display: flex; align-items: center; gap: 8px; min-width: 200px; padding: 2px 4px; }
.voice-play-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(255,255,255,.25); color: inherit; font-size: 16px;
}
.msg.theirs .voice-play-btn { background: var(--bs-primary); color: #fff; }
.voice-play-btn:hover { filter: brightness(1.1); }
.voice-progress {
  flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35);
  position: relative; cursor: pointer; min-width: 80px;
}
.msg.theirs .voice-progress { background: var(--bs-border-color); }
.voice-progress-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 2px;
  background: currentColor; opacity: .9;
}
.voice-duration { font-size: 11px; opacity: .85; flex-shrink: 0; min-width: 32px; text-align: right; }
.voice-audio-el { display: none; }

/* ====== Inline message edit icon (inside the bubble, sitting next to the timestamp) ====== */
/* Placed as a normal inline element inside .msg-time (not absolutely
   positioned), so it can never overlap the timestamp/checkmarks — it just
   sits in the same row, to the left of them. Always visible (not hover-only)
   since hover never reliably triggers on touch/mobile devices. */
.msg-edit-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.25); color: inherit; font-size: 9px;
  cursor: pointer; opacity: 0.8; margin-right: 4px; vertical-align: middle;
  transition: opacity .15s, transform .1s;
}
.msg.theirs .msg-edit-icon { background: rgba(0,0,0,.12); }
.msg-edit-icon:hover, .msg-edit-icon:active { opacity: 1; transform: scale(1.15); }

/* ====== Optimistic send states: pending (sending…) and failed ====== */
.msg.pending { opacity: 0.65; }
.msg-status.pending i { font-size: 10px; }
.msg-status.failed { color: #dc2626; cursor: pointer; }

/* ====== 7 Themes: light, dark, system (built into Bootstrap) + 4 new accent themes ====== */
[data-theme-accent="blue"] {
  --bs-primary: #2563eb; --bs-primary-rgb: 37,99,235;
  --bs-primary-bg-subtle: #1e3a5f; --bs-link-color: #60a5fa;
}
[data-theme-accent="blue"] .btn-primary { background: #2563eb; border-color: #2563eb; }
[data-theme-accent="blue"] .cc-active, [data-theme-accent="blue"] .conv-item.active { background: #1e3a5f; }

[data-theme-accent="green"] {
  --bs-primary: #16a34a; --bs-primary-rgb: 22,163,74;
  --bs-primary-bg-subtle: #14432a; --bs-link-color: #4ade80;
}
[data-theme-accent="green"] .btn-primary { background: #16a34a; border-color: #16a34a; }
[data-theme-accent="green"] .cc-active, [data-theme-accent="green"] .conv-item.active { background: #14432a; }

[data-theme-accent="purple"] {
  --bs-primary: #9333ea; --bs-primary-rgb: 147,51,234;
  --bs-primary-bg-subtle: #3b1f5c; --bs-link-color: #c084fc;
}
[data-theme-accent="purple"] .btn-primary { background: #9333ea; border-color: #9333ea; }
[data-theme-accent="purple"] .cc-active, [data-theme-accent="purple"] .conv-item.active { background: #3b1f5c; }

/* AMOLED: pure black backgrounds — saves battery on OLED screens and gives
   a crisper, higher-contrast look than the standard dark theme's dark gray. */
[data-theme-accent="amoled"] {
  --bs-body-bg: #000000; --bs-body-bg-rgb: 0,0,0;
  --bs-tertiary-bg: #0a0a0a; --bs-secondary-bg: #121212;
  --bs-border-color: #1f1f1f; --bs-border-color-translucent: #1f1f1f;
  --bs-primary: #3b82f6; --bs-primary-rgb: 59,130,246;
  --bs-primary-bg-subtle: #0d1b2e;
}
[data-theme-accent="amoled"] body,
[data-theme-accent="amoled"] .sidebar,
[data-theme-accent="amoled"] .chat-area { background: #000000; }
[data-theme-accent="amoled"] .msg.theirs { background: #121212; }
[data-theme-accent="amoled"] .conv-item.active { background: #0d1b2e; }

/* ====== Smooth, WhatsApp-style motion & soft effects ====== */
.msg { animation: msgIn 0.18s ease-out; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.conv-item { transition: background .15s ease; }
.conv-item:active { background: var(--bs-secondary-bg); }

.modal-bg { animation: fadeIn .15s ease; }
.modal-box, .status-view-box { animation: modalPop .18s cubic-bezier(.34,1.56,.64,1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.sb-panel { animation: fadeIn .15s ease; }

.btn, .icon-btn, .cc, .voice-play-btn { transition: transform .1s ease, background .15s ease, opacity .15s ease; }
.btn:active { transform: scale(0.97); }

.chat-active { animation: fadeIn .15s ease; }

/* Soft shadow lift on hover for cards/avatars (subtle depth, WhatsApp-like polish) */
.avatar-sm, .avatar-md, .avatar-lg { transition: transform .15s ease; }
.status-item:hover .status-ring img { transform: scale(1.04); }
.status-ring img { transition: transform .15s ease; }

/* Smooth typing indicator dots (used for "typing…" if adopted visually later) */
@keyframes typingDot { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* ====== Mobile message-action bottom sheet (replaces coordinate-positioned menu) ====== */
.msg-menu-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 300; animation: fadeIn .15s ease; }
.msg-menu-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 301;
  background: var(--bs-body-bg); border-radius: 16px 16px 0 0;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom)) 0;
  max-height: 70vh; overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
  animation: sheetUp .2s cubic-bezier(.32,.72,.35,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.msg-menu-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--bs-border-color); margin: 4px auto 8px; }
.msg-menu-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; font-size: 15px; cursor: pointer; }
.msg-menu-row:active { background: var(--bs-secondary-bg); }
.msg-menu-row i { font-size: 18px; width: 22px; text-align: center; color: var(--bs-secondary-color); }
