.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--pe-bg);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

.chat-stream {
  max-width: var(--pe-max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
}

.bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: bubblein 0.18s ease-out;
}

@keyframes bubblein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble--bot { align-self: flex-start; max-width: 85%; }
.bubble--user { align-self: flex-end; max-width: 85%; flex-direction: row-reverse; }

.bubble__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pe-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.bubble--user .bubble__avatar { background: #4b5563; }

.bubble__msg {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--pe-surface);
  border: 1px solid var(--pe-border);
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.bubble--bot .bubble__msg { border-top-left-radius: 4px; }
.bubble--user .bubble__msg {
  background: var(--pe-accent);
  color: #fff;
  border-color: var(--pe-accent);
  border-top-right-radius: 4px;
}
.bubble--user .bubble__msg a { color: #fff; text-decoration: underline; }

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  margin-left: 36px;
}

.quick-reply {
  border: 1px solid var(--pe-accent);
  color: var(--pe-accent);
  background: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.quick-reply:hover { background: var(--pe-accent); color: #fff; }
.quick-reply:disabled { opacity: 0.5; cursor: not-allowed; }

.typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
}
.typing span {
  width: 6px;
  height: 6px;
  background: var(--pe-muted);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.chat-input {
  border-top: 1px solid var(--pe-border);
  background: #fff;
  padding: 12px;
}
.chat-input form {
  max-width: var(--pe-max-w);
  margin: 0 auto;
  display: flex;
  gap: 8px;
}
.chat-input input { flex: 1; }

.cta-card {
  background: var(--pe-surface-alt);
  border: 1px solid var(--pe-border);
  border-radius: var(--pe-radius);
  padding: 14px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cta-card__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}
.cta-card__label { color: var(--pe-muted); min-width: 70px; }

.banner {
  background: var(--pe-success);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--pe-radius-sm);
  font-weight: 700;
  display: inline-block;
  margin-top: 4px;
}

.error-text {
  color: #c1121f;
  font-size: 0.875rem;
  margin-top: 4px;
}
