/* Conversation parts: thread, bubbles, composer, chips, and the widget frame Clark replies with. */

/* ── Thread ─────────────────────────────────────────────── */
.thread { display: flex; flex-direction: column; gap: var(--space-5); text-align: left; }
.thread:empty { display: none; }
.msg { display: flex; gap: 0.75rem; animation: msg-in 380ms var(--ease-out) both; }
.msg--user { justify-content: flex-end; }
.msg--clark { align-items: flex-start; }
.msg--clark > .orb-mark { margin-top: 0.2rem; }
.msg__body { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; flex: 1; }
.msg__text { line-height: 1.6; text-wrap: pretty; }
.msg__text a { color: var(--text); text-underline-offset: 3px; }
.msg[data-thinking] .orb-mark { animation: breathe 1.4s ease-in-out infinite; }
.msg__thinking { display: inline-flex; gap: 4px; padding-top: 0.55rem; }
.msg__thinking span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); animation: blink 1.1s infinite both; }
.msg__thinking span:nth-child(2) { animation-delay: 0.15s; }
.msg__thinking span:nth-child(3) { animation-delay: 0.3s; }

@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes breathe { 50% { transform: scale(1.18); } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.bubble {
  display: inline-block; max-width: 85%;
  padding: 0.65rem 1rem; border-radius: 18px;
  font-size: 0.9375rem; line-height: 1.5; text-align: left;
}
.bubble--user { background: var(--user-bubble); border-bottom-right-radius: 6px; margin-left: auto; }
.bubble--clark { background: transparent; padding-left: 0; }

/* ── Composer ───────────────────────────────────────────── */
.composer {
  display: flex; align-items: flex-end; gap: 0.35rem;
  padding: 0.45rem 0.45rem 0.45rem 1.15rem;
  background: var(--elevated); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow);
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow-lift); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent;
  padding: 0.6rem 0; min-height: 2.6rem; max-height: 8rem; line-height: 1.45; font-size: 1rem;
}
.composer textarea::placeholder { color: var(--text-faint); }
.composer__mic, .composer__send {
  width: 2.6rem; height: 2.6rem; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 0; text-decoration: none;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) ease, opacity var(--dur-micro) ease;
}
.composer__mic { color: var(--text-muted); background: transparent; }
.composer__mic:hover { color: var(--text); background: var(--user-bubble); }
.composer__send { background: var(--text); color: var(--bg); }
.composer__send:disabled { opacity: 0.25; cursor: default; }
.composer__send:not(:disabled):active, .composer__mic:active { transform: scale(0.92); }
.composer svg { width: 1.2rem; height: 1.2rem; stroke-width: 1.9; }

/* ── Suggestion chips ───────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.chip {
  padding: 0.5rem 0.9rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 60%, transparent);
  font-size: 0.875rem; color: var(--text-muted);
  transition: color var(--dur-micro) ease, border-color var(--dur-micro) ease, transform var(--dur-micro) var(--ease-out);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.chip:active { transform: scale(0.97); }
.chip[disabled] { opacity: 0.45; pointer-events: none; }

/* ── Widget frame ───────────────────────────────────────── */
.widget {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  animation: widget-in 520ms var(--ease-spring) both;
  text-align: left;
}
@keyframes widget-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.widget__head {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line); font-size: 0.8125rem; color: var(--text-muted);
}
.widget__head svg { width: 0.95rem; height: 0.95rem; }
.widget__head .mono { margin-left: auto; font-size: 0.75rem; color: var(--text-faint); }
.widget__body { padding: 1rem; }
.widget__foot { padding: 0.65rem 1rem; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--text-faint); }

@media (prefers-reduced-motion: reduce) {
  .msg, .widget { animation: none; }
  .msg[data-thinking] .orb-mark, .msg__thinking span { animation: none; opacity: 0.6; }
}
