/* ── MESSAGE ROWS ────────────────────────────── */
.message { padding: 12px 0; animation: fadeSlideIn 0.2s ease; }

.message.user { display: flex; justify-content: flex-end; }
.message.user .msg-bubble {
  background: var(--bg-user-msg);
  border-radius: 18px 18px 6px 18px;
  padding: 10px 16px;
  max-width: 80%;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.message.assistant { display: flex; gap: 12px; align-items: flex-start; }
.assistant-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.assistant-icon svg { color: #000; }

/* ── MESSAGE CONTENT ─────────────────────────── */
.msg-content {
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.7;
  word-break: break-word;
}
.msg-content p { margin-bottom: 12px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content strong { font-weight: 600; }
.msg-content em { font-style: italic; }
.msg-content ul, .msg-content ol { padding-left: 20px; margin-bottom: 12px; }
.msg-content li { margin-bottom: 4px; }
.msg-content code {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}
.msg-content pre {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 12px 0;
}
.msg-content pre code { background: none; border: none; padding: 0; }
.msg-content h1, .msg-content h2, .msg-content h3 { font-weight: 600; margin: 16px 0 8px; }
.msg-content.streaming { white-space: pre-wrap; }

/* ── MESSAGE ACTIONS ─────────────────────────── */
.msg-actions { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity 0.15s; }
.message:hover .msg-actions { opacity: 1; }
.msg-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-size: 13px;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}
.msg-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.msg-action-btn.liked { color: var(--accent); }
.msg-action-btn.disliked { color: #ff5f5f; }

/* ── TYPING INDICATOR ────────────────────────── */
.typing-indicator { display: flex; gap: 4px; padding: 8px 0; align-items: center; }
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── STREAMING CURSOR ────────────────────────── */
.stream-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--text-primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}

/* ── SEARCH / THINK STATUS ───────────────────── */
.think-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  animation: fadeSlideIn 0.2s ease;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: statusPulse 1.4s ease-in-out infinite;
}

/* ── SOURCES BLOCK ───────────────────────────── */
.sources-block { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.sources-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sources-list { display: flex; flex-direction: column; gap: 6px; }
.source-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  transition: background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.source-chip:hover { background: var(--bg-active); border-color: #484848; }
.source-num { font-size: 11px; font-weight: 700; color: var(--accent); flex-shrink: 0; min-width: 14px; }
.source-domain { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.source-title { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
