/* ==========================================================================
   MELIOR CHAT: NANO BANANA EDITION (TASK-MEL-210)
   Pixel-perfect implementation of the approved Nano Banana visual reference.
   File: melior_modules/css/chat_nanobanana.css
   ========================================================================== */

/* 1. Fullscreen Container */
#nbChatContainer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  
  /* Soft, warm, pastel multi-color gradient mesh matching reference 1:1 */
  background: 
    radial-gradient(circle at 12% 12%, rgba(190, 235, 255, 0.95), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(255, 232, 205, 0.92), transparent 48%),
    radial-gradient(circle at 18% 75%, rgba(255, 218, 228, 0.9), transparent 48%),
    radial-gradient(circle at 85% 82%, rgba(255, 242, 215, 0.95), transparent 45%),
    #eef5ff;
  background-attachment: fixed;
}

#nbChatContainer.is-hidden {
  display: none !important;
}

/* 2. Top Header Bar (Floating Glassmorphism) */
.nb-chat-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: calc(env(safe-area-inset-top, 10px) + 6px) 16px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  pointer-events: none;
}

.nb-header-btn {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.20) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.30) !important;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.12s ease, background 0.15s ease;
  user-select: none;
}

.nb-header-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.35) !important;
}

.nb-btn-back {
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
}

.nb-interlocutor-btn {
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 700;
  position: relative;
}

.nb-interlocutor-btn .nb-arrow {
  font-size: 12px;
  color: #64748b;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.nb-interlocutor-btn.is-active .nb-arrow {
  transform: rotate(180deg);
}

/* Dropdown Dialogue Menu */
.nb-dialogue-menu {
  position: absolute;
  top: 60px;
  right: 16px;
  min-width: 210px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 40;
}

.nb-dialogue-menu.is-hidden {
  display: none !important;
}

.nb-dialogue-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.nb-dialogue-option:hover,
.nb-dialogue-option.is-active {
  background: rgba(224, 242, 254, 0.85);
  color: #0284c7;
}

.nb-dialogue-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nb-dialogue-badge.is-zero {
  display: none;
}

/* 3. Messages History Area */
.nb-messages-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 86px 16px 160px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.nb-messages-area::-webkit-scrollbar {
  width: 4px;
}
.nb-messages-area::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

/* Message Bubble: User (Sender #27) */
.nb-msg-row-user {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.nb-msg-user-bubble {
  max-width: 84%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 20px 20px 4px 20px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}

.nb-msg-user-bubble .nb-msg-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  text-align: right;
  margin-top: 4px;
}

/* TASK-MEL-215: User Task Status Indicator */
.nb-user-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.12s ease;
  user-select: none;
}

.nb-user-task-badge:active {
  transform: scale(0.96);
}

.nb-user-task-badge.is-completed {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.nb-user-task-badge.is-in-progress {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.nb-user-task-badge.is-pending {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.nb-user-task-badge.is-error {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

/* Message Bubble: Semyon (Blueish lavender on the left) */
.nb-msg-row-semyon {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.nb-msg-semyon-bubble {
  max-width: 84%;
  background: rgba(219, 234, 254, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #0f172a;
  padding: 12px 16px;
  border-radius: 20px 20px 20px 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.nb-msg-semyon-bubble .nb-msg-sender {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}

.nb-msg-semyon-bubble .nb-msg-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: #0f172a;
}

/* Message Bubble: Antigravity plain text */
.nb-msg-row-agent {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.nb-msg-agent-bubble {
  max-width: 86%;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: #0f172a;
  padding: 12px 16px;
  border-radius: 20px 20px 20px 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  font-size: 15px;
  line-height: 1.45;
}

/* 4. ANTIGRAVITY REPORT CARD (Reference 1:1) */
.nb-report-card {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nb-report-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Card Top Row: Task ID badge on left, Status badge + Date on right */
.nb-card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.nb-card-task-pill {
  background: rgba(238, 230, 255, 0.85);
  border: 1px solid rgba(215, 195, 255, 0.7);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #4338ca;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nb-card-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.nb-card-status-pill {
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.3px;
}

.nb-card-status-pill.is-in-progress {
  background: rgba(254, 205, 205, 0.75);
  border: 1px solid rgba(252, 165, 165, 0.65);
  color: #dc2626;
}

.nb-card-status-pill.is-completed {
  background: rgba(187, 247, 208, 0.75);
  border: 1px solid rgba(134, 239, 172, 0.65);
  color: #16a34a;
}

.nb-card-status-pill.is-cancelled {
  background: rgba(226, 232, 240, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.7);
  color: #64748b;
}

.nb-card-status-dot {
  font-size: 10px;
}

.nb-card-status-date {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}

/* Card Body Row: Title & Event Timestamp */
.nb-card-body-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nb-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin: 2px 0;
}

.nb-card-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #64748b;
  font-weight: 500;
}

/* Card Action Row: 3 equal-height buttons */
.nb-card-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.nb-card-btn {
  flex: 1;
  height: 42px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: normal;
  text-align: left;
  padding: 0 6px;
}

.nb-card-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.7);
}

.nb-card-btn.is-copied {
  background: rgba(220, 252, 231, 0.9) !important;
  border-color: #86efac !important;
  color: #15803d !important;
}

.nb-card-btn.btn-has-images {
  color: #334155;
  font-size: 12px;
}

.nb-card-btn.btn-has-images.is-empty {
  opacity: 0.45;
  cursor: default;
}

/* 5. Fixed Bottom Input Bar */
.nb-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 12px) + 8px) 16px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 35;
  box-sizing: border-box;
}

/* Row 1: Textarea */
.nb-input-row {
  width: 100%;
}

.nb-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 16px;
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  outline: none;
  resize: none;
  min-height: 48px;
  max-height: 130px;
  line-height: 1.4;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.nb-textarea:focus {
  border-color: rgba(56, 189, 248, 0.6);
}

.nb-textarea::placeholder {
  color: #94a3b8;
  font-size: 15px;
}

/* Attach Preview Strip */
.nb-attach-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}
.nb-attach-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}
.nb-attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nb-attach-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
}

/* Row 2: Controls & Send Button */
.nb-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nb-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nb-tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  user-select: none;
}

.nb-tool-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.98);
}

.nb-tool-btn.is-active {
  background: rgba(224, 242, 254, 0.95);
  border-color: #38bdf8;
  color: #0284c7;
}

/* Filter Dropdown Menu (Pops up above tool button) */
.nb-filter-menu {
  position: absolute;
  bottom: 56px;
  left: 120px;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 45;
}

.nb-filter-menu.is-hidden {
  display: none !important;
}

.nb-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.12s ease;
  width: 100%;
  box-sizing: border-box;
}

.nb-filter-option:hover,
.nb-filter-option.is-active {
  background: rgba(224, 242, 254, 0.9);
  color: #0284c7;
}

/* Send Button: Horizontal gradient cyan to purple matching reference exactly */
.nb-btn-send {
  background: linear-gradient(135deg, #00c2ff 0%, #a855f7 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  padding: 0 28px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 194, 255, 0.38);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
  user-select: none;
}

.nb-btn-send:active {
  transform: scale(0.96);
  opacity: 0.92;
}

/* 6. Fullscreen Report Modal Viewer */
.nb-report-viewer-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.nb-report-viewer-modal.is-hidden {
  display: none !important;
}

.nb-report-viewer-card {
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nb-report-viewer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nb-report-viewer-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.6;
  color: #1e293b;
  word-break: break-word;
}

.nb-report-viewer-footer {
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

/* Guarantee classic modal is hidden when is-hidden is present */
#meliorChatModal.is-hidden,
.melior-modal-overlay.is-hidden {
  display: none !important;
}

/* TASK-MEL-215: Lightbox Modal z-index fix */
.chat-lightbox-modal {
  z-index: 200000 !important;
  background: rgba(0, 0, 0, 0.94) !important;
}

.chat-lightbox-modal img {
  max-width: 95vw !important;
  max-height: 85vh !important;
  object-fit: contain !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8) !important;
}

/* ==========================================================================
   TASK-MEL-219: Message Actions, Voice Notes & Round Video Notes
   ========================================================================== */

/* Message Bubble Action Trigger & Context Dropdown */
.nb-msg-bubble {
  position: relative;
}

.nb-msg-action-trigger {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  border-radius: 8px;
  padding: 2px 7px;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
  transition: opacity 0.15s ease, background 0.15s ease;
  margin-left: 6px;
  vertical-align: middle;
}

.nb-msg-bubble--me .nb-msg-action-trigger {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.nb-msg-action-trigger:hover,
.nb-msg-action-trigger:active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.45);
}

.nb-msg-actions-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  padding: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  gap: 4px;
}

.nb-msg-actions-dropdown.is-hidden {
  display: none !important;
}

.nb-msg-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.nb-msg-action-item:hover,
.nb-msg-action-item:active {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
}

.nb-msg-action-item.is-danger {
  color: #ef4444;
}

.nb-msg-action-item.is-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Voice Audio Notes */
.nb-voice-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  margin-top: 6px;
  min-width: 220px;
}

.nb-voice-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  user-select: none;
}

.nb-msg-bubble--me .nb-voice-play-btn {
  background: #ffffff;
  color: #0284c7;
}

.nb-voice-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nb-voice-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.nb-voice-progress-fill {
  height: 100%;
  background: #0284c7;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.nb-msg-bubble--me .nb-voice-progress-fill {
  background: #ffffff;
}

.nb-voice-time {
  font-size: 12px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.nb-voice-recording-banner.is-hidden {
  display: none !important;
}

.nb-voice-recording-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 14px;
  margin-bottom: 8px;
  animation: pulseRecording 1.5s infinite;
}

@keyframes pulseRecording {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.nb-voice-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  margin-right: 6px;
}

/* Round Video Notes */
.nb-video-note-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 6px 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  border: 3px solid rgba(255, 255, 255, 0.7);
  cursor: pointer;
  background: #000;
}

.nb-video-note-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.nb-video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 250000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.nb-video-modal.is-hidden {
  display: none !important;
}

.nb-video-circle-wrap {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #00f0ff;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
  background: #000;
  position: relative;
}

.nb-video-camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.nb-video-rec-timer {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nb-video-modal-controls {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nb-video-ctrl-btn {
  padding: 12px 20px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.nb-video-btn-rec { background: #ef4444; color: #fff; }
.nb-video-btn-stop { background: #f59e0b; color: #fff; }
.nb-video-btn-send { background: #0284c7; color: #fff; }
.nb-video-btn-cancel { background: #475569; color: #fff; }

/* Forward Message Modal */
.nb-forward-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 250000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nb-forward-modal.is-hidden {
  display: none !important;
}

.nb-forward-box {
  width: 90%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nb-forward-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.nb-forward-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: #475569;
  max-height: 80px;
  overflow-y: auto;
}

.nb-forward-targets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nb-forward-target-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  transition: all 0.15s ease;
}

.nb-forward-target-btn:hover,
.nb-forward-target-btn:active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}


/* TASK-MEL-230: Compact Outgoing User Messages (2 lines max + expand/collapse) */
.nb-msg-user-bubble {
  max-width: 84%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 10px 14px !important;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  font-size: 14.5px;
  line-height: 1.42;
  word-break: break-word;
}

.nb-msg-user-bubble .nb-user-header {
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 3px;
  letter-spacing: 0.2px;
}

.nb-msg-user-bubble .nb-msg-text-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: 2.8em;
  word-break: break-word;
}

.nb-msg-user-bubble .nb-msg-text-expanded {
  display: block;
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.nb-btn-expand-msg {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.nb-btn-expand-msg:hover, .nb-btn-expand-msg:active {
  background: rgba(255, 255, 255, 0.28);
}


/* TASK-MEL-231: Obshak Header Button & Popup Menu */
.nb-btn-obshak {
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 8px 14px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  z-index: 35 !important;
}

.nb-btn-obshak.is-hidden {
  display: none !important;
}

.nb-obshak-menu {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 270px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.nb-obshak-menu.is-hidden {
  display: none !important;
}

.nb-obshak-option {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.6);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nb-obshak-option:hover, .nb-obshak-option:active {
  background: rgba(224, 231, 255, 0.95);
  border-color: #818cf8;
  transform: translateY(-1px);
}

.nb-obshak-opt-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #1e1b4b;
}

.nb-obshak-opt-sub {
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
}

/* TASK-MEL-357: Video message windows and button strictly suppressed */
#nbVideoRecordModal, #meliorVideoRecordModal, .nb-video-modal, .melior-video-modal, #nbBtnMediaRecord {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
