/* ═══════════════════════════════════════════════════════════════ */
/* Rainbow Live Chat UI — Input, Dropdowns, Modals, Panels       */
/* WhatsApp-style UI                                             */
/* ═══════════════════════════════════════════════════════════════ */

/* Input Area */
.lc-input-area {
  position: relative;
  padding: 8px 12px;
  background: #f0f2f5;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.lc-attach-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: #54656f;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-attach-btn:hover {
  background: #e9edef;
  color: #00a884;
}

/* WhatsApp-style '+' circle button (US-073) */
.lc-attach-plus {
  background: #00a884;
  color: #fff;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  transition: all 0.2s;
}

.lc-attach-plus:hover {
  background: #008f72;
  color: #fff;
}

/* Attachment menu (US-073) */
.lc-attach-wrap {
  position: relative;
}

.lc-attach-menu {
  position: absolute;
  bottom: 52px;
  left: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding: 8px 0;
  min-width: 200px;
  z-index: 100;
  animation: lc-attach-slide-up 0.15s ease-out;
}

@keyframes lc-attach-slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.lc-attach-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #111b21;
  text-align: left;
  transition: background 0.1s;
}

.lc-attach-option:hover {
  background: #f5f6f6;
}

.lc-attach-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-attach-doc-icon {
  background: #5157ae;
  color: #fff;
}

.lc-attach-photo-icon {
  background: #bf59cf;
  color: #fff;
}

.lc-attach-camera-icon {
  background: #ec407a;
  color: #fff;
}

.lc-attach-audio-icon {
  background: #f57c00;
  color: #fff;
}

.lc-attach-contact-icon {
  background: #009688;
  color: #fff;
}

.lc-send-btn {
  background: #00a884;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}

.lc-send-btn:hover:not(:disabled) {
  background: #008f72;
}

.lc-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.lc-send-btn svg {
  width: 20px;
  height: 20px;
}

/* ─── Schedule Button & Popover (US-020) ─── */
.lc-schedule-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: #54656f;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lc-schedule-btn:hover {
  background: #f0f2f5;
  color: #00a884;
}
.lc-schedule-popover {
  position: absolute;
  bottom: 52px;
  right: 48px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 16px;
  z-index: 50;
  min-width: 240px;
}
.lc-schedule-popover-header {
  font-size: 14px;
  font-weight: 600;
  color: #111b21;
  margin-bottom: 12px;
}
.lc-schedule-label {
  font-size: 12px;
  color: #667781;
  display: block;
  margin-bottom: 4px;
}
.lc-schedule-datetime {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.lc-schedule-datetime:focus {
  border-color: #00a884;
}
.lc-schedule-repeat {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}
.lc-schedule-repeat:focus {
  border-color: #00a884;
}
.lc-schedule-end-wrap {
  margin-top: 4px;
}
.lc-schedule-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.lc-schedule-cancel {
  background: none;
  border: 1px solid #d1d7db;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #54656f;
}
.lc-schedule-cancel:hover {
  background: #f0f2f5;
}
.lc-schedule-confirm {
  background: #00a884;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.lc-schedule-confirm:hover {
  background: #008f72;
}

/* Scheduled messages badge */
.lc-sched-badge {
  background: #00a884;
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 600;
}

/* Scheduled messages panel/modal */
.lc-scheduled-modal {
  max-width: 480px;
  max-height: 70vh;
}
.lc-scheduled-list {
  overflow-y: auto;
  max-height: 50vh;
  margin-bottom: 12px;
}
.lc-scheduled-empty {
  text-align: center;
  color: #667781;
  padding: 24px 16px;
  font-size: 14px;
}
.lc-sched-item {
  border: 1px solid #e9edef;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.lc-sched-item.lc-sched-sent {
  opacity: 0.6;
}
.lc-sched-item.lc-sched-cancelled {
  opacity: 0.4;
  text-decoration: line-through;
}
.lc-sched-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.lc-sched-phone {
  font-weight: 600;
  font-size: 13px;
  color: #111b21;
}
.lc-sched-status {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
}
.lc-sched-pending .lc-sched-status {
  background: #fff3cd;
  color: #856404;
}
.lc-sched-sent .lc-sched-status {
  background: #d4edda;
  color: #155724;
}
.lc-sched-cancelled .lc-sched-status {
  background: #f8d7da;
  color: #721c24;
}
.lc-sched-repeat {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #e8daef;
  color: #6c3483;
  font-weight: 500;
}
.lc-sched-item-msg {
  font-size: 13px;
  color: #3b4a54;
  margin-bottom: 4px;
  word-break: break-word;
}
.lc-sched-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lc-sched-time {
  font-size: 12px;
  color: #667781;
}
.lc-sched-sent-at {
  font-size: 11px;
  color: #00a884;
}
.lc-sched-item-actions {
  display: flex;
  gap: 4px;
}
.lc-sched-edit-btn, .lc-sched-cancel-btn {
  background: none;
  border: 1px solid #d1d7db;
  padding: 2px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #54656f;
}
.lc-sched-edit-btn:hover {
  background: #e8f4f8;
  border-color: #00a884;
  color: #00a884;
}
.lc-sched-cancel-btn:hover {
  background: #fde8e8;
  border-color: #dc3545;
  color: #dc3545;
}

/* ─── Payment Reminder (US-022) ─── */
.lc-reminder-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #e67e22;
  flex-shrink: 0;
}
.lc-reminder-bell:hover {
  color: #d35400;
}
.lc-reminder-bell-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  padding: 0 4px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
  font-weight: 700;
  line-height: 16px;
}
.lc-payment-reminder-active {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 8px 10px;
}
.lc-payment-reminder-active.lc-reminder-overdue {
  background: #fde8e8;
  border-color: #e74c3c;
}
.lc-payment-reminder-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.lc-payment-reminder-due {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.lc-reminder-overdue .lc-payment-reminder-due {
  color: #e74c3c;
}
.lc-payment-reminder-auto {
  font-size: 11px;
  color: #667781;
}
.lc-payment-reminder-actions {
  display: flex;
  gap: 6px;
}
.lc-payment-autosend-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #54656f;
  cursor: pointer;
  white-space: nowrap;
}
.lc-overdue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-left: 4px;
  flex-shrink: 0;
}

/* Help Me Button (Manual Mode) */
.lc-help-me-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  flex-shrink: 0;
}

.lc-help-me-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.lc-help-me-btn:active {
  transform: translateY(0);
}

.lc-help-me-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.lc-help-me-btn.loading svg {
  animation: lc-spin 1s linear infinite;
}

@keyframes lc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.lc-input-box {
  flex: 1;
  border: none;
  outline: none;
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  min-height: 42px;
  line-height: 1.4;
  overflow-y: auto;
}

.lc-input-box:focus {
  outline: none;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Voice Message Recording (US-074)                               */
/* ═══════════════════════════════════════════════════════════════ */

.lc-mic-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: #54656f;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-mic-btn:hover {
  background: #e9edef;
  color: #00a884;
}

.lc-mic-btn.recording {
  background: #fee2e2;
  color: #dc2626;
  animation: lc-mic-pulse 1.5s ease-in-out infinite;
}

@keyframes lc-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.lc-voice-recording {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 42px;
}

.lc-voice-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc2626;
  animation: lc-voice-pulse-dot 1s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes lc-voice-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.lc-voice-timer {
  font-size: 14px;
  font-weight: 500;
  color: #dc2626;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.lc-voice-cancel {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: #54656f;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-voice-cancel:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Skeleton Loading (US-145)                                     */
/* ═══════════════════════════════════════════════════════════════ */

.lc-skeleton-wrap {
  padding: 0;
}

.lc-skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
}

.lc-skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e9edef;
  flex-shrink: 0;
  animation: lc-skeleton-pulse 1.4s ease-in-out infinite;
}

.lc-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lc-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: #e9edef;
  animation: lc-skeleton-pulse 1.4s ease-in-out infinite;
}

.lc-skeleton-line-name {
  width: 45%;
}

.lc-skeleton-line-msg {
  width: 70%;
}

.lc-skeleton-item:nth-child(2) .lc-skeleton-line-name { width: 55%; }
.lc-skeleton-item:nth-child(2) .lc-skeleton-line-msg { width: 60%; }
.lc-skeleton-item:nth-child(3) .lc-skeleton-line-name { width: 40%; }
.lc-skeleton-item:nth-child(3) .lc-skeleton-line-msg { width: 75%; }
.lc-skeleton-item:nth-child(4) .lc-skeleton-line-name { width: 50%; }
.lc-skeleton-item:nth-child(4) .lc-skeleton-line-msg { width: 55%; }
.lc-skeleton-item:nth-child(5) .lc-skeleton-line-name { width: 35%; }
.lc-skeleton-item:nth-child(5) .lc-skeleton-line-msg { width: 65%; }

@keyframes lc-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Empty State */
.lc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  background: #f0f2f5;
  border-bottom: 6px solid #25d366;
  /* Accent strip */
}

.lc-empty-icon {
  margin-bottom: 24px;
}

.lc-empty-icon svg {
  width: 100px;
  height: 100px;
}

.lc-empty-state h3 {
  font-size: 28px;
  font-weight: 300;
  color: #41525d;
  margin-bottom: 12px;
}

.lc-empty-state p {
  font-size: 14px;
  color: #667781;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Sidebar Top Bar — WhatsApp Web style (US-071)                 */
/* ═══════════════════════════════════════════════════════════════ */

.lc-sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f0f2f5;
}

.lc-sidebar-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.lc-sidebar-title {
  font-size: 20px;
  font-weight: 700;
  color: #111b21;
  margin: 0;
  line-height: 1.2;
}

.lc-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lc-sidebar-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: #54656f;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-sidebar-action-btn:hover {
  background: #e9edef;
}

/* Instance selector inside dropdown menu */
.lc-instance-select-wrap {
  padding: 8px 16px;
}

.lc-instance-select-wrap select {
  flex: 1;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════ */
/* WhatsApp Status Dot — green/red/yellow indicator (US-077)      */
/* ═══════════════════════════════════════════════════════════════ */

.lc-wa-dot {
  position: relative;
  width: 10px;
  height: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-wa-dot-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8696a0;
  display: block;
  transition: background-color 0.3s ease;
}

/* Connected — green with pulse */
.lc-wa-dot.lc-wa-connected .lc-wa-dot-inner {
  background: #25d366;
  animation: lcWaPulse 2s ease-in-out infinite;
}

/* Disconnected — red */
.lc-wa-dot.lc-wa-disconnected .lc-wa-dot-inner {
  background: #ea0038;
  animation: none;
}

/* Connecting — amber with pulse (US-007) */
.lc-wa-dot.lc-wa-checking .lc-wa-dot-inner {
  background: #f59e0b;
  animation: lcWaAmberPulse 1.5s ease-in-out infinite;
}

@keyframes lcWaPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0);
  }
}

@keyframes lcWaAmberPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
  }
}

/* Staff name (US-011) */
.lc-staff-name {
  font-size: 12px;
  color: #667781;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.lc-staff-name:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111b21;
}

/* Tooltip */
.lc-wa-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  padding: 10px 14px;
  z-index: 100;
  min-width: 180px;
  font-size: 13px;
}

.lc-wa-tooltip-status {
  font-weight: 600;
  color: #111b21;
  margin-bottom: 4px;
}

.lc-wa-tooltip-phone {
  color: #667781;
  font-size: 12px;
}

/* Context Menu */
.lc-msg-context-menu {
  position: fixed;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  z-index: 9999;
  padding: 6px 0;
  min-width: 200px;
  animation: fadeIn 0.1s ease-out;
}

.lc-msg-action {
  width: 100%;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #3b4a54;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.lc-msg-action:hover {
  background: #f5f6f6;
}

/* Dropdowns (Header, Mode) */
.lc-mode-dropdown,
.lc-header-dropdown,
.lc-sidebar-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  z-index: 1000;
  padding: 6px 0;
  min-width: 180px;
}

.lc-mode-option,
.lc-header-dropdown-item,
.lc-sidebar-dropdown-item {
  width: 100%;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #111b21;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.lc-mode-option:hover,
.lc-header-dropdown-item:hover,
.lc-sidebar-dropdown-item:hover {
  background: #f5f6f6;
}

/* File Preview */
.lc-file-preview {
  position: absolute;
  bottom: 80px;
  left: 10px;
  right: 10px;
  background: #f0f2f5;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.lc-file-preview-inner {
  display: flex;
  gap: 12px;
  align-items: center;
}

.lc-file-caption {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d7db;
  border-radius: 4px;
  font-size: 14px;
}

/* Reply Preview */
.lc-reply-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f2f5;
  padding: 8px 16px;
  border-left: 4px solid #008069;
  border-radius: 4px;
  margin: 0 16px 8px 16px;
  font-size: 13px;
  color: #54656f;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Contact Details Panel                                         */
/* ═══════════════════════════════════════════════════════════════ */

.lc-contact-panel {
  width: 320px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lc-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #00a884;
  color: #fff;
  flex-shrink: 0;
}

.lc-contact-title {
  font-size: 15px;
  font-weight: 600;
}

.lc-contact-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: rgba(255, 255, 255, .85);
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-contact-close:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}

.lc-contact-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lc-contact-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.lc-contact-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 24px;
}

.lc-contact-phone {
  font-size: 13px;
  color: #667781;
}

.lc-field-divider {
  border-top: 1px solid #f0f2f5;
  margin: 4px 0;
}

.lc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lc-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #8696a0;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* US-088: Language lock button */
.lc-lang-lock-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 1px;
  color: #8696a0;
  opacity: 0.7;
  transition: opacity .2s, color .2s;
  display: inline-flex;
  align-items: center;
}
.lc-lang-lock-btn:hover {
  opacity: 1;
  color: #00a884;
}

/* US-090: AI generate notes button */
.lc-ai-gen-btn {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 6px;
  color: #00a884;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  transition: all .2s;
}
.lc-ai-gen-btn:hover {
  background: #e6f7f1;
  border-color: #00a884;
}
.lc-ai-gen-btn.loading {
  opacity: 0.5;
  pointer-events: none;
}
.lc-ai-gen-btn.loading svg {
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* US-091: Add to Context button */
.lc-context-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px dashed #d0d5dd;
  border-radius: 6px;
  background: none;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.lc-context-btn:hover {
  background: #f0fdf4;
  border-color: #00a884;
  color: #00a884;
}

/* US-005: Context file path indicator */
.lc-context-filepath {
  font-size: 11px;
  color: #00a884;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin: 4px 0 0;
  padding: 3px 6px;
  background: #f0fdf4;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .2s;
}
.lc-context-filepath:hover {
  background: #dcfce7;
}

/* US-091: Context editor modal */
.lc-context-modal {
  max-width: 560px;
}
.lc-modal-subtitle {
  font-size: 11px;
  color: #8696a0;
  margin: -4px 0 12px;
  font-family: monospace;
}
.lc-context-editor {
  width: 100%;
  min-height: 240px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  margin-bottom: 12px;
}
.lc-context-editor:focus {
  border-color: #00a884;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.1);
}

.lc-field-input {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  background: #fff;
  color: #111b21;
  width: 100%;
  box-sizing: border-box;
}

.lc-field-input:focus {
  border-color: #00a884;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, .12);
}

.lc-field-select {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  background: #fff;
  color: #111b21;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .2s;
}

.lc-field-select:focus {
  border-color: #00a884;
}

.lc-field-textarea {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color .2s;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

/* Notes textarea (US-008): allow full AI-generated content to show without clipping */
#lc-cd-notes {
  min-height: 100px;
  max-height: none;
}

.lc-field-textarea:focus {
  border-color: #00a884;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, .12);
}

.lc-field-row {
  display: flex;
  gap: 10px;
}

.lc-field-row .lc-field {
  flex: 1;
  min-width: 0;
}

/* Tags */
.lc-tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 4px;
}

.lc-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #d1fae5;
  color: #065f46;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
}

.lc-tag-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: #065f46;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: .6;
  transition: opacity .15s;
  display: flex;
  align-items: center;
}

.lc-tag-chip button:hover {
  opacity: 1;
}

.lc-tag-input {
  margin-top: 4px;
}

/* US-008: Tag autocomplete dropdown */
.lc-tag-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 2px;
}

.lc-tag-option {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  color: #1a1a1a;
  transition: background .1s;
}

.lc-tag-option:hover,
.lc-tag-option.highlighted {
  background: #d1fae5;
  color: #065f46;
}

/* US-009: Tag filter dropdown in filter chips row */
.lc-tag-filter-wrap {
  position: relative;
  display: inline-flex;
}

.lc-tag-filter-btn svg {
  flex-shrink: 0;
}

.lc-tag-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  min-width: 160px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
}

.lc-tag-filter-option {
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .1s;
}

.lc-tag-filter-option:hover {
  background: #f0f2f5;
}

.lc-tag-filter-option.selected {
  background: #e7fce3;
  color: #008069;
  font-weight: 500;
}

.lc-tag-filter-check {
  width: 16px;
  text-align: center;
  font-size: 12px;
  color: #008069;
  flex-shrink: 0;
}

.lc-tag-filter-clear {
  color: #ea0038;
  font-weight: 500;
  border-bottom: 1px solid #f0f2f5;
}

.lc-tag-filter-clear:hover {
  background: #fee2e2;
}

.lc-tag-filter-empty {
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: #8696a0;
}

/* Contact Footer & Save Indicator */
.lc-contact-footer {
  padding: 8px 16px;
  border-top: 1px solid #f0f2f5;
  text-align: center;
  flex-shrink: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-contact-save-indicator {
  font-size: 12px;
  font-weight: 500;
  transition: opacity .3s;
}

.lc-contact-save-indicator.saved {
  color: #059669;
}

.lc-contact-save-indicator.saving {
  color: #667781;
}

.lc-contact-save-indicator.error {
  color: #dc2626;
}

/* Header menu button active when search or contact panel is open */
.lc-header-actions button#lc-header-menu-btn.active {
  background: rgba(255, 255, 255, .25);
}

/* Approval Panel */
.lc-approval-panel {
  background: #fff;
  border: 1px solid #6366f1;
  border-radius: 8px;
  margin: 0 16px 8px 16px;
  padding: 12px;
  box-shadow: 0 4px 6px rgba(99, 102, 241, 0.1);
}

.lc-approval-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.lc-approval-meta {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  color: #4b5563;
  font-size: 11px;
}

.lc-approval-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.lc-approval-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.lc-approval-btn.approve {
  background: #6366f1;
  color: #fff;
}

.lc-approval-btn.reject {
  background: #fee2e2;
  color: #ef4444;
}

.lc-approval-textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px;
  font-size: 14px;
  resize: none;
}

/* Modal Overlay (Generic) */
.lc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.lc-modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.lc-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #111b21;
}

.lc-modal-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.lc-modal-btn-cancel {
  background: #fff;
  color: #008069;
  border: 1px solid #008069;
}

.lc-modal-btn-send {
  background: #008069;
  color: #fff;
  margin-left: 8px;
}

.lc-modal-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ─── WhatsApp Reconnection Modal ──────────────────────────── */
.lc-reconnect-modal { max-width: 440px; }
.lc-reconnect-desc {
  font-size: 13px; color: #667781; margin: -8px 0 16px; line-height: 1.4;
}
.lc-reconnect-instances {
  border: 1px solid #e9edef; border-radius: 8px; overflow: hidden; margin-bottom: 12px;
}
.lc-reconnect-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #f0f2f5;
}
.lc-reconnect-item:last-child { border-bottom: none; }
.lc-reconnect-item-info { display: flex; flex-direction: column; gap: 2px; }
.lc-reconnect-item-label { font-size: 14px; font-weight: 500; color: #111b21; }
.lc-reconnect-item-phone { font-size: 12px; color: #8696a0; }
.lc-reconnect-item-right { display: flex; align-items: center; gap: 10px; }
.lc-reconnect-state {
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px;
}
.lc-inst-connected { background: #d1fae5; color: #065f46; }
.lc-inst-connecting { background: #fef3c7; color: #92400e; }
.lc-inst-disconnected { background: #fee2e2; color: #991b1b; }
.lc-reconnect-btn {
  background: #008069; color: #fff; border: none; border-radius: 16px;
  padding: 5px 14px; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.lc-reconnect-btn:hover { background: #006b57; }
.lc-reconnect-ok {
  font-size: 12px; color: #25d366; font-weight: 500;
}
.lc-reconnect-empty {
  padding: 20px; text-align: center; font-size: 13px; color: #8696a0;
}
.lc-reconnect-loading {
  padding: 16px; text-align: center; font-size: 13px; color: #8696a0;
}
.lc-reconnect-qr-wrap {
  text-align: center; padding: 16px 0; border-top: 1px solid #e9edef; margin-top: 4px;
}
.lc-reconnect-qr-label {
  font-size: 14px; font-weight: 500; color: #111b21; margin-bottom: 12px;
}
.lc-reconnect-qr { min-height: 200px; display: flex; align-items: center; justify-content: center; }
.lc-reconnect-qr-img { width: 200px; height: 200px; border-radius: 8px; }
.lc-reconnect-qr-status {
  font-size: 12px; color: #8696a0; margin-top: 8px;
}
.lc-reconnect-success {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 500; color: #25d366;
}

/* Hover Actions in Sidebar */
.lc-hover-actions {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  gap: 2px;
  background: linear-gradient(to right, transparent 0%, #fff 25%);
  padding-left: 16px;
}

.lc-chat-item:hover .lc-hover-actions {
  display: flex;
}

.lc-chat-item.active:hover .lc-hover-actions {
  background: linear-gradient(to right, transparent 0%, #f0f2f5 25%);
}

.lc-ha-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: #8696a0;
  transition: all .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-ha-btn:hover {
  background: #e9edef;
  color: #54656f;
}

.lc-ha-pin.active {
  color: #00a884;
}

.lc-ha-pin.active:hover {
  color: #008f72;
}

.lc-ha-fav.active {
  color: #f59e0b;
}

.lc-ha-fav.active:hover {
  color: #d97706;
}

/* Sidebar Menu */
.lc-sidebar-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.lc-sidebar-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}

.lc-sidebar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #3b4a54;
  text-align: left;
}

.lc-sidebar-dropdown-item:hover {
  background: #f5f6f6;
}

.lc-sidebar-dropdown-item svg {
  color: #8696a0;
  flex-shrink: 0;
}

/* Chat Context Dropdown */
.lc-chat-dropdown {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
  min-width: 160px;
  overflow: hidden;
}

.lc-chat-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #3b4a54;
  text-align: left;
}

.lc-chat-dropdown button:hover {
  background: #f5f6f6;
}

.lc-chat-dropdown button svg {
  color: #8696a0;
  flex-shrink: 0;
}

/* Pin/Favourite Indicators */
.lc-pin-indicator {
  display: flex;
  align-items: center;
  color: #8696a0;
}

.lc-fav-indicator {
  display: flex;
  align-items: center;
}

/* Header Menu */
.lc-header-menu-wrap {
  position: relative;
}

.lc-header-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .15);
  min-width: 200px;
  z-index: 100;
  display: none;
  padding: 6px 0;
}

.lc-header-dropdown.open {
  display: block;
}

.lc-header-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #111b21;
  text-align: left;
}

.lc-header-dropdown-item:hover {
  background: #f5f6f6;
}

.lc-header-dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

.lc-menu-danger {
  color: #dc2626 !important;
}

.lc-menu-danger:hover {
  background: #fef2f2 !important;
}

.lc-menu-toggle-indicator {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  background: #e9edef;
  color: #667781;
}

.lc-menu-toggle-indicator.active {
  background: #dcfce7;
  color: #16a34a;
}

.lc-menu-mode-current {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #667781;
}

.lc-submenu-arrow {
  flex-shrink: 0;
  color: #8696a0;
}

.lc-header-dropdown-submenu-wrap {
  position: relative;
}

.lc-header-submenu {
  position: absolute;
  right: 100%;
  top: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .15);
  min-width: 160px;
  z-index: 1001;
  padding: 6px 0;
}

.lc-submenu-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
}

.lc-header-submenu .lc-header-dropdown-item.active-mode {
  background: #e7fce3;
  color: #008069;
}

.lc-date-filter-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: #00a884;
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

/* Translation Preview */
.lc-translate-preview,
.rc-translate-preview {
  background: #e8f5e9;
  border-top: 1px solid #c8e6c9;
  padding: 8px 12px 10px;
}

.lc-translate-preview-label,
.rc-translate-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: #388e3c;
  margin-bottom: 2px;
}

.lc-translate-preview-text,
.rc-translate-preview-text {
  font-size: 14px;
  color: #111b21;
}

.lc-translate-preview-hint,
.rc-translate-preview-hint {
  font-size: 11px;
  color: #8696a0;
  margin-top: 4px;
}

.lc-translate-preview-hint kbd,
.rc-translate-preview-hint kbd {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Message Search Bar                                            */
/* ═══════════════════════════════════════════════════════════════ */

.lc-msg-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f0f2f5;
  border-bottom: 1px solid #e5e7eb;
}

.lc-msg-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  transition: border-color .2s;
}

.lc-msg-search-input-wrap:focus-within {
  border-color: #00a884;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, .15);
}

.lc-msg-search-icon {
  width: 16px;
  height: 16px;
  color: #8696a0;
  flex-shrink: 0;
}

.lc-msg-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
}

.lc-msg-search-count {
  font-size: 12px;
  color: #667781;
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

.lc-msg-search-nav {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: #54656f;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-msg-search-nav:hover {
  background: #d1d7db;
  color: #111b21;
}

.lc-msg-search-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: #54656f;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-msg-search-close:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Search toggle active state */
.lc-header-actions button.active {
  background: rgba(255, 255, 255, .25);
}

/* Search highlights */
.lc-hl {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.lc-hl-focus {
  background: #f59e0b;
  color: #fff;
  border-radius: 2px;
  padding: 0 1px;
}

/* Search match bubble states */
.lc-bubble.lc-search-match {
  box-shadow: 0 0 0 1px #fbbf24;
}

.lc-bubble.lc-search-focus {
  box-shadow: 0 0 0 2px #f59e0b;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Focus Mode — maximized live chat (body.lc-maximized)          */
/* ═══════════════════════════════════════════════════════════════ */

body.lc-maximized #app-sidebar,
body.lc-maximized .app-topbar,
body.lc-maximized #hot-reload-indicator {
  display: none !important;
}

body.lc-maximized #app-main {
  margin-left: 0 !important;
  max-width: none;
  padding: 0;
}

body.lc-maximized #app-main > main {
  padding: 0 !important;
  overflow: hidden;
}

body.lc-maximized #tab-live-chat {
  height: 100vh;
}

body.lc-maximized #tab-live-chat .lc-container {
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

body.lc-maximized .lc-header-actions #lc-maximize-btn.active {
  background: rgba(255, 255, 255, .25);
}

/* ═══════════════════════════════════════════════════════════════ */
/* Toast Notifications                                           */
/* ═══════════════════════════════════════════════════════════════ */

.lc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #323232;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 400px;
  text-align: center;
}

.lc-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lc-toast-success {
  background: #059669;
}

.lc-toast-error {
  background: #dc2626;
}

.lc-toast-info {
  background: #0284c7;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Command Palette (US-015)                                       */
/* ═══════════════════════════════════════════════════════════════ */

.lc-cmd-palette {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,.12);
  max-height: 340px;
  overflow: hidden;
  z-index: 60;
  margin-bottom: -1px;
}

.lc-cmd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f2f5;
  background: #f8faf9;
}

.lc-cmd-title {
  font-size: 12px;
  font-weight: 600;
  color: #008069;
}

.lc-cmd-count {
  font-size: 11px;
  color: #8696a0;
}

.lc-cmd-list {
  max-height: 260px;
  overflow-y: auto;
}

.lc-cmd-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #f8f9fa;
}

.lc-cmd-item:hover,
.lc-cmd-item.lc-cmd-active {
  background: #e7fce3;
}

.lc-cmd-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #111b21;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lc-cmd-slash {
  color: #008069;
  font-weight: 700;
  font-size: 14px;
}

.lc-cmd-cat {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  color: #8696a0;
  background: #f0f2f5;
  padding: 1px 6px;
  border-radius: 8px;
}

.lc-cmd-item-preview {
  font-size: 12px;
  color: #667781;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lc-cmd-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #f0f2f5;
  font-size: 12px;
  color: #008069;
  cursor: pointer;
  transition: background .1s;
}

.lc-cmd-footer:hover {
  background: #e7fce3;
}

/* ═══════════════════════════════════════════════════════════════ */
/* // Workflow Palette (US-016) — Purple theme                    */
/* ═══════════════════════════════════════════════════════════════ */

.lc-wf-palette {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d8d0e8;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -4px 16px rgba(100,60,180,.12);
  max-height: 340px;
  overflow: hidden;
  z-index: 61;
  margin-bottom: -1px;
}

.lc-wf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #ede8f5;
  background: #f5f0fa;
}

.lc-wf-title {
  font-size: 12px;
  font-weight: 600;
  color: #7c3aed;
}

.lc-wf-count {
  font-size: 11px;
  color: #8696a0;
}

.lc-wf-list {
  max-height: 260px;
  overflow-y: auto;
}

.lc-wf-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #f8f9fa;
}

.lc-wf-item:hover,
.lc-wf-item.lc-wf-active {
  background: #ede9fe;
}

.lc-wf-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #111b21;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lc-wf-slash {
  color: #7c3aed;
  font-weight: 700;
  font-size: 14px;
}

.lc-wf-steps {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  color: #8696a0;
  background: #f0f2f5;
  padding: 1px 6px;
  border-radius: 8px;
}

.lc-wf-item-id {
  font-size: 11px;
  color: #8696a0;
  margin-top: 1px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Fullscreen Chat Mode                                          */
/* ═══════════════════════════════════════════════════════════════ */

.chat-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: white !important;
  border-radius: 0 !important;
  overflow-y: auto;
  padding: 1rem;
  margin: 0 !important;
}

.chat-fullscreen .fullscreen-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chat-fullscreen .fullscreen-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.fullscreen-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;  /* US-005: prevent squeezing against adjacent delete button */
  border-radius: 50%;
  color: #6b7280;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-toggle-btn:hover {
  background: #f3f4f6;
  color: #111b21;
}

.fullscreen-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Responsive                                                    */
/* ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════ */
/* Mobile Responsive (<768px) — US-092                           */
/* Single-column layout: sidebar OR conversation, never both     */
/* ═══════════════════════════════════════════════════════════════ */

/* Mobile back button (hidden on desktop) */
.lc-back-btn {
  display: none;
}

@media (max-width:768px) {
  /* Container: stack children */
  .lc-container {
    height: 100vh;
    height: 100dvh;
    position: relative;
  }

  /* Sidebar: full-width overlay, shown by default */
  .lc-sidebar {
    width: 100% !important;
    flex: 0 0 100% !important;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    height: 100%;
  }

  /* Main: full-width, hidden until conversation opened */
  .lc-main {
    width: 100%;
    flex: 1;
  }

  /* When chat is open: hide sidebar, show conversation */
  .lc-container.lc-mobile-show-chat .lc-sidebar {
    display: none;
  }

  /* When chat is closed: hide main area */
  .lc-container:not(.lc-mobile-show-chat) .lc-main {
    display: none;
  }

  /* Resizable divider: hide on mobile */
  .lc-divider {
    display: none !important;
  }

  /* Show mobile back button */
  .lc-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 4px;
    border-radius: 50%;
    color: #54656f;
    min-width: 44px;
    min-height: 44px;
  }

  .lc-back-btn:hover {
    background: #d9dce0;
  }

  /* Touch-friendly tap targets (min 44px) */
  .lc-sidebar-action-btn,
  .lc-sidebar-menu-btn,
  .lc-attach-btn,
  .lc-send-btn,
  .lc-mic-btn,
  .lc-header-actions button {
    min-width: 44px;
    min-height: 44px;
  }

  /* Chat items: taller for touch */
  .lc-chat-item {
    min-height: 72px;
  }

  /* Messages area: smaller padding */
  .lc-messages {
    padding: 12px 8px;
  }

  /* Input area: fixed at bottom, safe area inset */
  .lc-input-area {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* Contact panel: full-screen overlay on mobile */
  .lc-contact-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100% !important;
    z-index: 30;
    box-shadow: none;
    border-left: none;
  }

  /* Prevent horizontal scroll */
  .lc-container,
  .lc-sidebar,
  .lc-main {
    overflow-x: hidden;
  }

  /* Mode dropdown: make wider on mobile */
  .lc-mode-dropdown {
    min-width: 200px;
  }

  /* Hover actions: always show on mobile (no hover on touch) */
  .lc-hover-actions {
    display: flex;
    opacity: 0.5;
  }

  /* Empty state: smaller padding */
  .lc-empty-state {
    padding: 20px;
  }

  .lc-empty-state h3 {
    font-size: 22px;
  }

  .lc-empty-icon svg {
    width: 80px;
    height: 80px;
  }

  /* Header: compact on mobile */
  .lc-chat-header {
    padding: 8px 12px;
  }

  .lc-header-actions {
    gap: 4px;
  }

  /* Sidebar search: full width */
  .lc-search-wrap {
    flex: 1;
  }

  /* Approval panel: full width */
  .lc-approval-panel {
    margin: 0 8px 8px 8px;
  }

  /* Modal: full width with padding */
  .lc-modal-content {
    max-width: calc(100vw - 32px);
    margin: 16px;
  }

  /* File preview: adjust for mobile */
  .lc-file-preview {
    left: 8px;
    right: 8px;
    bottom: 70px;
  }

  /* Reply preview: smaller margins */
  .lc-reply-preview {
    margin: 0 8px 8px 8px;
  }

  /* Sidebar filter tabs: scrollable on mobile */
  .lc-filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .lc-filter-tabs::-webkit-scrollbar {
    display: none;
  }
}

/* Tablet breakpoint (768px-1024px) */
@media (min-width:769px) and (max-width:1024px) {
  .lc-sidebar {
    width: 300px !important;
    flex: 0 0 300px !important;
  }

  .lc-contact-panel {
    width: 280px;
  }
}

/* ─── US-014: Date-jump calendar popover ────────────────────────── */

.lc-msg-search-date-wrap { position: relative; display: inline-flex; align-items: center; }

.lc-date-jump-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 200;
}

.lc-date-jump-popover input[type="date"] {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.lc-date-jump-popover input[type="date"]:focus { border-color: #25d366; }

.lc-date-sep.lc-date-jump-highlight {
  animation: lc-date-jump-flash 1.5s ease-out forwards;
}

@keyframes lc-date-jump-flash {
  0%   { background: #25d366; color: #fff; }
  30%  { background: #fff3cd; color: #856404; }
  100% { background: transparent; color: #667781; }
}

/* ─── US-009/010: Prisma AI Floating Panel ─────────────────────── */

.prisma-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 340px;
  height: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  z-index: 1200;
  overflow: hidden;
  border: 1px solid rgba(99,70,255,0.12);
}

.prisma-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #6346ff 0%, #9b59b6 100%);
  color: #fff;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.prisma-header:active { cursor: grabbing; }

.prisma-title { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }

.prisma-header-actions { display: flex; gap: 4px; }

.prisma-btn-icon {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
}

.prisma-btn-icon:hover { background: rgba(255,255,255,0.2); color: #fff; }

.prisma-sources {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: #f8f6ff;
  border-bottom: 1px solid #ede9ff;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.prisma-source-chip {
  background: #fff;
  border: 1.5px solid #d0c9ff;
  color: #6346ff;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.prisma-source-chip:hover { background: #ede9ff; }

.prisma-source-chip.active { background: #6346ff; border-color: #6346ff; color: #fff; }

.prisma-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
}

.prisma-welcome {
  text-align: center;
  color: #aaa;
  font-size: 13px;
  margin: auto;
  padding: 20px;
  line-height: 1.5;
}

.prisma-msg { display: flex; flex-direction: column; max-width: 88%; }
.prisma-msg-user { align-self: flex-end; align-items: flex-end; }
.prisma-msg-assistant { align-self: flex-start; align-items: flex-start; }

.prisma-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.prisma-msg-user .prisma-bubble {
  background: #6346ff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.prisma-msg-assistant .prisma-bubble {
  background: #fff;
  color: #222;
  border: 1px solid #e8e4ff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.prisma-bubble-error {
  background: #fff1f0 !important;
  border-color: #ffccc7 !important;
  color: #cf1322 !important;
}

.prisma-typing { display: flex; align-items: center; gap: 4px; padding: 10px 14px; }

.prisma-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #9b8fff;
  animation: prisma-bounce 1.2s infinite;
}

.prisma-typing span:nth-child(2) { animation-delay: 0.2s; }
.prisma-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes prisma-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.prisma-source-label { font-size: 10.5px; color: #bbb; margin-top: 2px; padding-left: 2px; }

.prisma-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #ede9ff;
  background: #fff;
  flex-shrink: 0;
}

.prisma-input {
  flex: 1;
  border: 1.5px solid #d0c9ff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13.5px;
  resize: none;
  min-height: 36px;
  max-height: 100px;
  line-height: 1.4;
  outline: none;
  font-family: inherit;
  overflow-y: auto;
  transition: border-color 0.15s;
}

.prisma-input:focus { border-color: #6346ff; }

.prisma-send-btn {
  background: #6346ff;
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.prisma-send-btn:hover { background: #5238e0; transform: scale(1.05); }
.prisma-send-btn:active { transform: scale(0.96); }

.prisma-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: linear-gradient(135deg, #6346ff 0%, #9b59b6 100%);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  z-index: 1200;
  box-shadow: 0 4px 16px rgba(99,70,255,0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.prisma-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,70,255,0.45); }

.lc-prisma-menu-item { color: #6346ff !important; font-weight: 500; }
.lc-prisma-menu-item:hover { background: #f3f0ff !important; }
