/* ══════════════════════════════════════════════════════════════════════════
   v3/answer-stream.css — Antwort-Karte (Ask-Bar), Markdown, Chat-Bubbles
   (25.09.2026). Nur Raum und Flaeche; Bewegung (Eintritt, Text-Schimmer,
   Caret, neue Schritte) steht in v3/motion.css.
   ══════════════════════════════════════════════════════════════════════════ */
@layer components {

/* ── Antwort-Karte unter der Frageleiste (Perplexity) ───────────────────── */
.v3-answer {
  max-width: var(--measure);
  margin-top: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-5);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
}
.v3-answer[hidden] { display: none; }
.v3-ask-wrap.has-answer .v3-chips { display: none; }
.v3-answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.v3-answer-q {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-1);
}
.v3-answer-state { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.v3-answer-steps { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; gap: 6px; }
.v3-answer-steps:empty { display: none; }
.v3-step {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  color: var(--text-3);
}
.v3-step::before {
  content: '';
  flex: 0 0 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-3);
  translate: 0 -1px;
}
.v3-step.is-done::before { background: var(--text-4); }
.v3-step.is-active::before { background: var(--accent-1); }
.v3-step-label { color: var(--text-2); font-weight: var(--fw-medium); white-space: nowrap; }
.v3-step.is-note .v3-step-label { font-weight: var(--fw-normal); font-style: italic; white-space: normal; color: var(--text-3); }
.v3-step.is-more { color: var(--text-4); }
.v3-step.is-more::before { background: transparent; }
.v3-step-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-code);
  font-size: var(--fs-2xs);
  color: var(--text-3);
}
.v3-answer-body { font-size: var(--fs-base); line-height: 1.65; color: var(--text-1); }
.v3-answer-body:empty { display: none; }
.v3-answer.is-error { border-color: var(--danger-line); }
.v3-answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-1);
}
.v3-answer-actions[hidden] { display: none; }
.v3-answer-act {
  height: 30px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  cursor: pointer;
}
.v3-answer-act:hover { background: var(--fill-1); color: var(--text-1); }

/* ── Markdown (Antworten) ───────────────────────────────────────────────── */
.v3-md > :first-child { margin-top: 0; }
.v3-md p { margin: 0 0 .75em; }
.v3-md p:last-child, .v3-md ul:last-child, .v3-md ol:last-child { margin-bottom: 0; }
.v3-md ul, .v3-md ol { margin: 0 0 .75em; padding-left: 1.3em; }
.v3-md li { margin: .2em 0; }
.v3-md h3, .v3-md h4 { margin: 1em 0 .4em; font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -0.005em; }
.v3-md h4 { font-size: var(--fs-base); }
.v3-md code {
  font-family: var(--font-code);
  font-size: .86em;
  padding: .1em .38em;
  border-radius: 5px;
  background: var(--fill-1);
}
.v3-md pre {
  margin: 0 0 .75em;
  padding: var(--sp-3) var(--sp-4);
  overflow: auto;
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  line-height: 1.5;
}
.v3-md pre code { padding: 0; background: none; font-size: .84em; }
.v3-md a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.v3-md blockquote { margin: 0 0 .75em; padding-left: var(--sp-3); border-left: 2px solid var(--line-2); color: var(--text-2); }
.v3-md table { margin: 0 0 .75em; border-collapse: collapse; font-size: var(--fs-sm); display: block; overflow-x: auto; }
.v3-md th, .v3-md td { padding: 5px 9px; border: 1px solid var(--line-1); text-align: left; }
.v3-md th { font-weight: var(--fw-semibold); background: var(--fill-1); }
.v3-md hr { border: 0; border-top: 1px solid var(--line-1); margin: 1em 0; }

/* ── Chat-Bubbles (v3 hatte keine eigenen) ────────────────────────────────
   Apple Messages im Ruhigen: Frage rechts in Koralle, Antwort links als Karte. */
#tab-chats #messages { display: flex; flex-direction: column; gap: var(--sp-2); }
#tab-chats #messages .msg-bubble {
  max-width: min(760px, 86%);
  padding: 10px 14px;
  border-radius: 18px;
  font-size: var(--fs-base);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
#tab-chats #messages .msg-user {
  align-self: flex-end;
  background: var(--accent-1);
  color: var(--accent-on);
  border-bottom-right-radius: 6px;
}
#tab-chats #messages .msg-assistant {
  align-self: flex-start;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  color: var(--text-1);
  border-bottom-left-radius: 6px;
}
#tab-chats #messages .msg-meta { margin-top: 4px; font-size: var(--fs-2xs); color: var(--text-3); }
#tab-chats #messages .msg-user .msg-meta { color: inherit; opacity: .7; }
#tab-chats #messages .msg-stream-note { margin-bottom: 4px; font-size: var(--fs-xs); font-style: italic; color: var(--text-3); }
#tab-chats #messages .msg-bubble.is-error { border-color: var(--danger-line); }
#tab-chats #messages .msg-bubble.is-error .msg-meta { color: var(--danger); }

} /* @layer components */
