/* ===== Assistant — chat UI, composer, setup card ===== */

/* ---- layout ---- */
.chat-wrap { display: flex; flex-direction: column; }
.chat-log {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 240px; max-height: 55vh; overflow-y: auto;
  padding: 4px 2px; scroll-behavior: smooth;
}
.chat-log .empty-hint { margin: auto; }

/* ---- bubbles ---- */
.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-bottom-right-radius: 4px;
  color: var(--text);
}
.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.chat-bubble.error {
  align-self: flex-start;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
  font-size: 12.5px;
}

/* ---- thinking indicator ---- */
.chat-thinking { display: inline-flex; align-items: center; gap: 5px; }
.chat-thinking .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint);
  animation: chat-pulse 1.2s infinite ease-in-out;
}
.chat-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking .dot:nth-child(3) { animation-delay: 0.4s; }
.chat-thinking .thinking-lbl { margin-left: 4px; font-size: 12px; color: var(--text-dim); }
@keyframes chat-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* ---- quick prompt chips ---- */
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 12.5px; font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chat-chip:hover:not(:disabled) { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.chat-chip:disabled { opacity: 0.5; cursor: default; }

/* ---- composer ---- */
.chat-composer { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.chat-input { flex: 1; resize: none; line-height: 1.5; }
.chat-input:disabled { opacity: 0.6; }
.chat-send { align-self: stretch; display: inline-flex; align-items: center; }
.chat-send:disabled { opacity: 0.5; cursor: default; }

/* model select in the page header */
.chat-model { max-width: 170px; }

/* ---- setup card (no API key yet) ---- */
.ai-setup { max-width: 620px; padding: 10px 4px; }
.ai-setup-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}
.ai-setup-title { margin: 0 0 8px; font-size: 18px; }
.ai-setup-sub { margin: 0 0 16px; font-size: 13.5px; line-height: 1.6; color: var(--text-dim); }
.ai-setup-sub a { color: var(--accent); }
.ai-setup-row { max-width: 480px; }
.ai-privacy {
  display: flex; align-items: baseline; gap: 6px;
  margin: 14px 0 0;
  font-size: 12px; line-height: 1.55;
  color: var(--text-faint);
}
