/* ===================================
   CHAT ASSISTANT STYLES
   AI-guided idea creation interface
   =================================== */

/* ===================================
   CHAT MODE PANEL
   =================================== */
.create-panel.chat-mode {
  width: 420px;
  max-width: 95vw;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Smooth transitions when not dragging */
  transition: box-shadow var(--duration-fast);
}

.create-panel.chat-mode:active {
  /* Visual feedback when interacting */
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--c-accent-soft);
}

.create-panel.chat-mode.fullscreen {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 60px);
  height: calc(100vh - 60px);
  margin: 0 auto;
  border-radius: 0;
}

/* ===================================
   ASSISTANT HEADER
   =================================== */
.create-panel.chat-mode .create-panel-header {
  cursor: grab;
  user-select: none;
  position: relative;
}

.create-panel.chat-mode .create-panel-header:active {
  cursor: grabbing;
}

/* Drag handle indicator */
.create-panel.chat-mode .create-panel-header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  opacity: 0.5;
  transition: opacity var(--duration-fast);
}

.create-panel.chat-mode .create-panel-header:hover::before {
  opacity: 1;
}

.create-panel.chat-mode.fullscreen .create-panel-header {
  cursor: default;
}

.create-panel.chat-mode.fullscreen .create-panel-header::before {
  display: none;
}

.assistant-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.assistant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-on-accent);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.assistant-avatar svg {
  width: 22px;
  height: 22px;
}

.assistant-info h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.assistant-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-reality);
  animation: status-pulse 2s ease-in-out infinite;
}

.status-dot.online {
  background: var(--c-reality);
}

.status-dot.offline {
  background: var(--c-danger);
}

.status-dot.connecting {
  background: var(--c-converge);
  animation: status-pulse 0.8s ease-in-out infinite;
}

.status-dot.analyzing,
.status-dot.thinking {
  background: var(--c-warning);
  animation: status-pulse 0.8s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* ===================================
   LOCATION BANNER
   =================================== */
.chat-location-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--c-accent-soft);
  border-bottom: 1px solid var(--c-border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--c-accent);
}

.chat-location-banner svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* ===================================
   CHAT CONTAINER
   =================================== */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

/* Custom scrollbar */
.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--c-text-muted);
}

/* ===================================
   CHAT MESSAGES
   =================================== */
.chat-message {
  display: flex;
  gap: var(--space-3);
  max-width: 90%;
  animation: message-in 0.3s var(--ease-out);
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message.system {
  align-self: center;
  max-width: 100%;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
}

.chat-message.assistant .message-avatar {
  background: var(--c-accent);
  color: var(--c-on-accent);
}

.chat-message.user .message-avatar {
  background: var(--c-surface);
  color: var(--c-text-soft);
}

.message-bubble,
.message-content {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  line-height: 1.5;
  font-size: var(--text-sm);
}

.chat-message.user .message-bubble,
.chat-message.user .message-content {
  background: var(--c-accent);
  color: var(--c-on-accent);
  border-bottom-right-radius: var(--space-1);
}

/* Selecting text in YOUR OWN messages: the global ::selection highlight
   (design-system.css) is accent-on-accent here - invisible, which read as
   "messages are not selectable". Invert the pair inside user bubbles. */
.chat-message.user .message-bubble::selection,
.chat-message.user .message-content::selection {
  background: var(--c-on-accent);
  color: var(--c-accent);
}

.chat-message.assistant .message-bubble,
.chat-message.assistant .message-content {
  background: var(--c-surface);
  color: var(--c-text);
  border-bottom-left-radius: var(--space-1);
  border: 1px solid var(--c-border);
}

.chat-message.system .message-bubble,
.chat-message.system .message-content {
  background: var(--c-idea-soft);
  color: var(--c-warning);
  border: 1px solid color-mix(in srgb, var(--c-warning) 30%, transparent);
  font-size: var(--text-xs);
  text-align: center;
}

/* Success message style */
.chat-message.success .message-bubble,
.chat-message.success .message-content {
  background: var(--c-reality-soft);
  color: var(--c-reality);
  border: 1px solid color-mix(in srgb, var(--c-reality) 30%, transparent);
}

/* Error message style */
.chat-message.error .message-bubble,
.chat-message.error .message-content {
  background: var(--c-danger-glow);
  color: var(--c-danger);
  border: 1px solid color-mix(in srgb, var(--c-danger) 30%, transparent);
}

/* ===================================
   TYPING INDICATOR
   =================================== */
.chat-message.typing {
  animation: none;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  border-bottom-left-radius: var(--space-1);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--c-text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ===================================
   QUICK ACTIONS
   =================================== */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
}

.quick-action-btn,
.quick-action-chip {
  padding: var(--space-2) var(--space-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--c-text-soft);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-body);
}

.quick-action-btn:hover,
.quick-action-chip:hover {
  background: var(--c-accent-soft);
  border-color: var(--c-accent);
  color: var(--c-accent);
  transform: translateY(-1px);
}

.quick-action-btn:active,
.quick-action-chip:active {
  transform: translateY(0);
}

/* ===================================
   EXTRACTED DATA PREVIEW
   =================================== */
.extracted-data-preview {
  border-top: 1px solid var(--c-border);
  background: var(--c-abyss);
}

.preview-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--c-text-soft);
  cursor: pointer;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--duration-fast);
}

.preview-toggle:hover {
  color: var(--c-text);
}

.preview-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.preview-toggle svg,
.preview-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-fast);
}

.preview-chevron.rotated {
  transform: rotate(180deg);
}

.preview-content {
  padding: 0 var(--space-4) var(--space-4);
  display: block;
}

.preview-content.collapsed {
  display: none;
}

.preview-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--c-border);
}

.preview-field:last-child {
  border-bottom: none;
}

.preview-field .field-label {
  width: 70px;
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.preview-field .field-value {
  flex: 1;
  color: var(--c-text);
}

.preview-field .field-value:empty::after {
  content: '-';
  color: var(--c-text-dim);
  font-style: italic;
}

.preview-field .edit-field {
  opacity: 0;
  padding: var(--space-1) var(--space-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.preview-field:hover .edit-field {
  opacity: 1;
}

.preview-field .edit-field:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* Tags in preview */
.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.preview-tag {
  padding: var(--space-1) var(--space-2);
  background: var(--c-accent-soft);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--c-accent);
}

/* ===================================
   ANALYSIS PANEL
   =================================== */
.analysis-panel {
  border-top: 1px solid var(--c-border);
  padding: var(--space-4);
  background: var(--c-abyss);
  animation: panel-slide-up 0.3s var(--ease-out);
}

@keyframes panel-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analysis-panel h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--c-text);
}

.analysis-panel h4 svg {
  width: 16px;
  height: 16px;
  color: var(--c-accent);
}

/* Feasibility Score */
.analysis-score {
  margin-bottom: var(--space-4);
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.score-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-value {
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-mono);
}

.score-value.high { color: var(--c-reality); }
.score-value.medium { color: var(--c-warning); }
.score-value.low { color: var(--c-danger); }

.score-bar {
  height: 6px;
  background: var(--c-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease-out);
}

.score-fill.high { background: var(--c-reality); }
.score-fill.medium { background: var(--c-warning); }
.score-fill.low { background: var(--c-danger); }

/* Analysis Sections */
.analysis-section {
  margin-bottom: var(--space-4);
}

.analysis-section:last-of-type {
  margin-bottom: 0;
}

.analysis-section h5 {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.analysis-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.analysis-list li {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--c-text-soft);
  line-height: 1.4;
}

.analysis-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.analysis-list.impact li::before,
.impact-list li::before {
  background: var(--c-reality);
}

.analysis-list.suggestions li::before,
.suggestions-list li::before {
  background: var(--c-converge);
}

/* Environmental impact section */
.environmental-impact,
.suggestions {
  margin-bottom: var(--space-4);
}

.environmental-impact h5,
.suggestions h5 {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.impact-list,
.suggestions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.impact-list li,
.suggestions-list li {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--c-text-soft);
  line-height: 1.4;
}

.impact-list li::before,
.suggestions-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Analysis Actions */
.analysis-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--c-border);
}

.analysis-actions .btn {
  flex: 1;
}

/* ===================================
   CHAT INPUT AREA
   =================================== */
.chat-input-area {
  border-top: 1px solid var(--c-border);
  padding: var(--space-4);
  background: var(--c-depth);
}

.chat-input-wrapper,
.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  transition: border-color var(--duration-fast);
}

.chat-input-wrapper:focus-within,
.input-wrapper:focus-within {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}

/* Safety net: if voice-input.js ever wraps a chat textarea in its own div
   again, keep the row fluid instead of freezing at the textarea's intrinsic
   width. */
.chat-input-wrapper .voice-input-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.chat-input-wrapper textarea,
.input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: var(--space-1) 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--c-text);
  line-height: 1.5;
}

.input-wrapper textarea::placeholder {
  color: var(--c-text-muted);
}

.input-wrapper textarea:focus {
  outline: none;
}

.input-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.input-actions .btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-actions .btn-send {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-on-accent);
}

.input-actions .btn-send:hover {
  background: var(--c-accent-bright);
  border-color: var(--c-accent-bright);
}

.input-actions .btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Voice input button styles */
.voice-btn {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.voice-btn:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.voice-btn.recording {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: var(--c-on-accent);
  animation: voice-pulse 1.5s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-danger) 40%, transparent); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* Send button styles */
.send-btn {
  background: var(--c-accent);
  border: 1px solid var(--c-accent);
  color: var(--c-on-accent);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.send-btn:hover {
  background: var(--c-accent-bright);
  border-color: var(--c-accent-bright);
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.95);
}

/* ===================================
   MOBILE RESPONSIVE
   =================================== */
@media (max-width: 768px) {
  .create-panel.chat-mode {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: slide-up 0.3s var(--ease-out);
  }

  @keyframes slide-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .create-panel.chat-mode.fullscreen {
    top: 0;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .quick-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
  }

  .quick-action-chip {
    flex-shrink: 0;
  }

  .analysis-actions {
    flex-direction: column;
  }
}

/* ===================================
   HIGH CONTRAST MODE
   =================================== */
[data-contrast="high"] .chat-message.assistant .message-content,
[data-contrast="high"] .chat-message.assistant .message-bubble {
  background: var(--c-surface);
  border-color: var(--c-border-bright);
}

[data-contrast="high"] .chat-message.user .message-content,
[data-contrast="high"] .chat-message.user .message-bubble {
  background: var(--c-accent);
  color: var(--c-on-accent);
}

[data-contrast="high"] .quick-action-chip,
[data-contrast="high"] .quick-action-btn {
  border-color: var(--c-border-bright);
}

[data-contrast="high"] .quick-action-chip:hover,
[data-contrast="high"] .quick-action-btn:hover {
  background: var(--c-accent);
  color: var(--c-on-accent);
}

/* ===================================
   CHAT LIST TOGGLE BUTTON
   =================================== */
.chat-list-toggle {
  position: absolute;
  top: 130px;
  right: 20px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-depth);
  border: 1px solid var(--c-border);
  color: var(--c-text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.chat-list-toggle:hover {
  background: var(--c-surface);
  border-color: var(--c-accent);
  color: var(--c-accent);
  transform: scale(1.05);
}

.chat-list-toggle svg {
  width: 20px;
  height: 20px;
}

.chat-list-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* `display: flex` above outranks the browser's [hidden] rule - restate it,
   or an empty count renders as a stray "0". */
.chat-list-badge[hidden] {
  display: none;
}

/* ===================================
   CHAT LIST PANEL
   =================================== */
.chat-list-panel {
  position: absolute;
  top: 130px;
  right: 74px;
  z-index: 1100;
  width: 340px;
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - 200px);
  background: var(--c-depth);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: all var(--duration-base) var(--ease-out);
}

.chat-list-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.chat-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--c-border);
}

.chat-list-header h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

.chat-list-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
}

.chat-list-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--c-text-muted);
}

.chat-list-empty .hint {
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  opacity: 0.7;
}

/* ===================================
   CHAT LIST ITEM
   =================================== */
.chat-list-item {
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.chat-list-item:hover {
  border-color: var(--c-accent);
  transform: translateX(4px);
}

.chat-list-item.active {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
}

.chat-list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

.chat-list-item-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.chat-list-item-status .status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.active {
  background: var(--c-reality);
}

.status-indicator.minimized {
  background: var(--c-warning);
}

.status-indicator.completed {
  background: transparent;
  color: var(--c-reality);
  font-size: 12px;
  width: auto;
  height: auto;
}

.chat-list-item-preview {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--space-2);
}

.chat-list-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--c-text-dim);
  margin-bottom: var(--space-2);
}

.chat-list-item-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
}

.chat-list-item-location svg {
  opacity: 0.5;
}

.chat-list-item-actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--c-border);
}

.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-soft);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-sm.btn-primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-on-accent);
}

.btn-sm.btn-primary:hover {
  background: var(--c-accent-bright);
}

.btn-sm.btn-secondary:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.btn-sm.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-text-muted);
}

.btn-sm.btn-ghost:hover {
  color: var(--c-danger);
}

/* ===================================
   CHAT MAP MARKERS
   =================================== */
.chat-marker {
  background: transparent;
  border: none;
}

.chat-marker-icon {
  position: relative;
  width: 30px;
  height: 30px;
  background: var(--c-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-on-accent);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--duration-fast);
}

.chat-marker-icon:hover {
  transform: scale(1.2);
}

.chat-marker-icon svg {
  width: 16px;
  height: 16px;
}

/* Anchor pin for the ACTIVE conversation (no pulse, slightly smaller, ring
   so it stays readable on any basemap). Non-interactive by construction. */
.chat-marker-icon.anchor {
  width: 22px;
  height: 22px;
  box-shadow: var(--shadow-sm), 0 0 0 2px var(--c-surface);
  cursor: default;
}

.chat-marker-icon.anchor:hover {
  transform: none;
}

.chat-marker-pulse {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: var(--c-accent);
  animation: marker-pulse 2s ease-out infinite;
}

@keyframes marker-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ===================================
   MOBILE RESPONSIVE - CHAT LIST
   =================================== */
@media (max-width: 768px) {
  .chat-list-toggle {
    top: auto;
    bottom: 100px;
    right: 16px;
  }

  .chat-list-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
  }

  .chat-list-panel.open {
    transform: translateY(0);
  }
}
