/* --- FLOATING CHAT BUTTON --- */
.chat-fab-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1d4ed8;
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  
  .chat-fab-btn:hover {
    transform: scale(1.08);
    background: #1e40af;
  }
  
  .unread-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 99px;
    border: 2px solid #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    line-height: 1;
  }
  
  /* --- SLIDE-OUT CHAT DRAWER --- */
  .admin-chat-drawer {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }
  
  .admin-chat-drawer.open {
    left: 0;
  }
  
  /* Overlay Backdrop */
  .chat-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .chat-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* --- DRAWER HEADER --- */
  .chat-drawer-header {
    padding: 16px 20px;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .chat-header-info h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
  }
  
  .chat-status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
  }
  
  .chat-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
  }
  
  .chat-close-btn:hover {
    color: #ffffff;
  }
  
  /* --- MESSAGES BODY --- */
  .chat-messages-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden !important;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  /* BUBBLE WRAPPERS & RELATIVE CONTAINERS */
  .chat-bubble-wrapper {
    display: flex !important;
    width: 100% !important;
    margin-bottom: 4px;
    position: relative;
  }
  
  .chat-bubble-wrapper.mine {
    justify-content: flex-start !important; /* Flush Right in RTL */
  }
  
  .chat-bubble-wrapper.other {
    justify-content: flex-end !important; /* Flush Left in RTL */
    width: 100% !important;
  }
  
  .chat-bubble-relative {
    position: relative !important;
    display: inline-flex !important;
    max-width: 82% !important;
    width: fit-content !important;
    min-width: 0;
  }
  
  /* SINGLE BUBBLE STYLES */
  .chat-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    max-width: 100% !important;
    margin: 0 !important;
    touch-action: pan-y;
    min-width: 0;
  }
  
  .chat-bubble.mine {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border-bottom-right-radius: 2px !important;
  }
  
  .chat-bubble.other {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom-left-radius: 2px !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  
  .chat-sender-tag {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 3px;
    text-align: left !important;
  direction: ltr !important;
  }
  
  .chat-time-tag {
    display: block;
    font-size: 0.65rem;
    margin-top: 4px;
    opacity: 0.75;
    text-align: left;
  }
  
  .chat-text-content {
    unicode-bidi: plaintext;
    text-align: start;
    word-wrap: break-word;
    white-space: pre-wrap !important; /* Preserves newlines and multiple line breaks */
  word-break: break-word;
  overflow-wrap: break-word;
  }
  
  /* --- INCOMING YELLOW MENTION BUBBLE --- */
  .chat-bubble.mentioned,
  .chat-bubble.other.mentioned {
    background-color: #fef08a !important;
    border: 1.5px solid #eab308 !important;
    color: #854d0e !important;
    border-radius: 14px 14px 14px 2px !important;
  }
  
  .chat-bubble.mentioned .chat-sender-tag,
  .chat-bubble.other.mentioned .chat-sender-tag {
    color: #a16207 !important;
    font-weight: 800 !important;
  }
  
  .chat-bubble.mentioned .chat-time-tag,
  .chat-bubble.other.mentioned .chat-time-tag {
    color: #854d0e !important;
    text-align: left !important;
  }
  
  /* Inline @Mention Highlight */
  .mention-tag-highlight {
    font-weight: 800;
    color: #1d4ed8;
    background: rgba(29, 78, 216, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    direction: ltr;
    display: inline-block;
  }
  
  .chat-bubble.mine .mention-tag-highlight {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.25) !important;
  }
  
  .chat-bubble.mentioned .mention-tag-highlight {
    color: #1d4ed8 !important;
    background: rgba(29, 78, 216, 0.15) !important;
  }
  
  /* --- CHAT DATE SEPARATOR PILL --- */
  .chat-date-separator {
    align-self: center !important;
    margin: 16px auto 8px auto !important;
    padding: 4px 14px;
    background-color: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 99px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
    user-select: none;
  }
  
  /* --- AUTO-EXPANDING TEXTAREA FOOTER INPUT --- */
/* --- AUTO-EXPANDING TEXTAREA FOOTER INPUT --- */
.chat-input-footer {
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  position: relative !important;
}

#chatTextInput,
.chat-input-footer textarea {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  resize: none !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
  outline: none !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  unicode-bidi: plaintext;
  text-align: start;
  max-height: 120px;
  min-height: 42px;
  height: 42px;
}

#chatTextInput:focus,
.chat-input-footer textarea:focus {
  border-color: #1d4ed8 !important;
}
  
  .chat-send-btn {
    flex-shrink: 0 !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
  }

  .chat-send-btn:hover {
    background: #1e40af;
  }
  
  /* Red Notification Dot */
  .unread-chat-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background-color: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red-dot 1.8s infinite;
  }
  
  @keyframes pulse-red-dot {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  }
  
  /* --- MENTION DROPDOWN POPUP --- */
  .mention-dropdown-popup {
    position: absolute;
    bottom: 56px;
    right: 16px;
    left: 16px;
    max-height: 160px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.12);
    z-index: 1010;
    direction: rtl;
  }
  
  .mention-item {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
  }
  
  .mention-item:last-child {
    border-bottom: none;
  }
  
  .mention-item:hover, .mention-item.active {
    background: #eff6ff;
  }
  
  .mention-item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
  }
  
  .mention-item-username {
    font-size: 0.76rem;
    color: #64748b;
    direction: ltr;
  }
  
  /* --- REPLY & EDIT PREVIEW BARS --- */
  .reply-preview-bar {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #f1f5f9;
    border-top: 1px solid #cbd5e1;
    border-bottom: 2px solid #1d4ed8;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1005;
    direction: rtl;
  }
  
  .reply-preview-bar.edit-mode-bar {
    border-bottom-color: #f59e0b !important;
    background: #fef3c7 !important;
  }
  
  .reply-preview-content {
    flex: 1;
    overflow: hidden;
    padding-left: 8px;
  }
  
  .reply-preview-sender {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #1d4ed8;
  }
  
  .reply-preview-text {
    margin: 2px 0 0 0;
    font-size: 0.8rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .reply-cancel-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
  }
  
  .reply-cancel-btn:hover {
    color: #0f172a;
  }
  
  /* --- QUOTED MESSAGE INSIDE BUBBLE --- */
  .quoted-reply-box {
    min-width: 0;
    background: rgba(15, 23, 42, 0.06);
    border-right: 3px solid #1d4ed8;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.78rem;
    direction: rtl;
    cursor: pointer;
    transition: opacity 0.15s ease;
  }
  
  .quoted-reply-box:hover {
    opacity: 0.85;
  }
  
  .chat-bubble.mine .quoted-reply-box {
    background: rgba(255, 255, 255, 0.2);
    border-right-color: #ffffff;
  }
  
  .quoted-reply-sender {
    font-weight: 800;
    color: #1d4ed8;
    display: block;
    font-size: 0.72rem;
  }
  
  .chat-bubble.mine .quoted-reply-sender {
    color: #ffffff;
  }
  
  .quoted-reply-text {
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }
  
  .chat-bubble.mine .quoted-reply-text {
    color: #f1f5f9;
  }
  
  /* --- EDITED TAG NEXT TO TIMESTAMP --- */
  .chat-edited-tag {
    font-size: 0.62rem;
    opacity: 0.75;
    margin-right: 4px;
    font-weight: 600;
  }
  
  /* --- HOVER ACTION BUTTONS (DESKTOP) --- */
  .chat-action-btns {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    z-index: 10 !important;
  }
  
  /* Position action buttons directly to the LEFT of sent blue bubbles */
  .chat-bubble-wrapper.mine .chat-action-btns {
    right: 100% !important;
    left: auto !important;
    padding-right: 6px !important;
  }
  
  /* Position action buttons directly to the RIGHT of incoming white/yellow bubbles */
  .chat-bubble-wrapper.other .chat-action-btns {
    left: 100% !important;
    right: auto !important;
    padding-left: 6px !important;
  }
  
  .hover-reply-btn,
  .hover-edit-btn,
  .hover-delete-btn {
    opacity: 0;
    pointer-events: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin: 0 2px;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  
  .hover-reply-btn:hover,
  .hover-edit-btn:hover {
    transform: scale(1.1);
    background: #f1f5f9;
  }
  
  .hover-delete-btn:hover {
    transform: scale(1.1);
    background: #fef2f2;
  }
  
  /* Enable hover buttons on Desktop */
  @media (hover: hover) and (pointer: fine) {
    .chat-bubble-relative:hover .hover-reply-btn,
    .chat-bubble-relative:hover .hover-edit-btn,
    .chat-bubble-relative:hover .hover-delete-btn {
      opacity: 1;
      pointer-events: auto;
    }
  }
  
  /* Hide hover buttons on Mobile */
  @media (max-width: 768px), (pointer: coarse) {
    .hover-reply-btn,
    .hover-edit-btn,
    .hover-delete-btn {
      display: none !important;
    }
  }
  
  /* --- SWIPE-TO-REPLY (MOBILE) --- */
  .chat-bubble.swiping {
    transition: none !important;
  }
  
  .swipe-reply-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    opacity: 0;
    color: #1d4ed8;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
  }
  
  .swipe-reply-icon.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
  }
  
  /* --- SCROLL-TO-REPLY HIGHLIGHT EFFECT --- */
  .chat-bubble-wrapper.target-highlight .chat-bubble {
    animation: replyPulse 1.5s ease-in-out;
  }
  
  @keyframes replyPulse {
    0% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.4);
    }
    30% {
      transform: scale(1.03);
      box-shadow: 0 0 0 6px rgba(29, 78, 216, 0.25);
    }
    100% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(29, 78, 216, 0);
    }
  }
  
  /* --- SWIPE-LEFT ACTION POPUP (MOBILE) --- */
.swipe-actions-popup {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scale(0.85);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.swipe-actions-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.swipe-action-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.swipe-action-btn.edit {
  color: #d97706;
}

.swipe-action-btn.delete {
  color: #ef4444;
  background: #fef2f2;
}

.swipe-action-btn:active {
  background: #e2e8f0;
}

/* =====================================================
   ATTACHMENTS
   ===================================================== */

/* Stack that holds reply / edit / attachment previews above the input */
.chat-footer-stack {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  z-index: 1005;
}

.chat-footer-stack .reply-preview-bar {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Attach button */
.chat-attach-btn {
  flex-shrink: 0 !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f1f5f9 !important;
  border: none !important;
  cursor: pointer !important;
  color: #64748b !important;
}

#chatTextInput {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  resize: none !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
  outline: none !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
}


.chat-attach-btn:hover {
  background: #f1f5f9;
  color: #1d4ed8;
}

.chat-attach-btn:disabled,
.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Staged files tray */
.chat-attachment-tray {
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  overflow-x: auto;
  direction: rtl;
}

.tray-item {
  position: relative;
  flex: 0 0 auto;
  width: 168px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.tray-item.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.tray-thumb {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tray-thumb.video {
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
}

.tray-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tray-item.uploading .tray-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.tray-item.uploading .tray-thumb::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: chatSpin 0.8s linear infinite;
  z-index: 2;
}

@keyframes chatSpin {
  to { transform: rotate(360deg); }
}

.tray-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tray-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}

.tray-size {
  font-size: 0.68rem;
  color: #64748b;
}

.tray-item.error .tray-size {
  color: #dc2626;
  font-weight: 700;
}

.tray-remove {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.chat-attachment-tray.is-sending .tray-remove {
  display: none;
}

/* Attachments inside bubbles */
.chat-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  min-width: 0;
}

.chat-att-img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
  cursor: zoom-in;
}

.chat-att-video {
  display: block;
  width: 220px;
  max-width: 100%;
  max-height: 300px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000000;
  object-fit: contain;
}

.chat-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.chat-bubble.mine .chat-file-card {
  background: rgba(255, 255, 255, 0.2);
}

.chat-file-badge {
  flex-shrink: 0;
  min-width: 38px;
  height: 38px;
  padding: 0 4px;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-bubble.mine .chat-file-badge {
  background: #ffffff;
  color: #1d4ed8;
}

.chat-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.chat-file-name {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  unicode-bidi: plaintext;
}

.chat-file-size {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Drag & drop overlay */
.chat-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(239, 246, 255, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.chat-drop-overlay.show {
  opacity: 1;
}

.chat-drop-box {
  width: 100%;
  height: 100%;
  border: 3px dashed #1d4ed8;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.95rem;
}

/* Toast */
.chat-toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 84px;
  padding: 10px 14px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 10px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1120;
}

.chat-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Image lightbox */
.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.chat-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.chat-lightbox-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.chat-lightbox-open {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

/* Mobile Viewport Adjustments */
  @media screen and (max-width: 480px) {
    .admin-chat-drawer {
      width: 100vw;
      left: -100vw;
    }
    
    .chat-input-footer {
      padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
  }

  /* Group Mention Highlight Badge (@all, @Ikhwan, @Akhwat) */
.mention-tag-highlight.group-mention {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
}