*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #3538CD;
  --primary-dark: #2A2DA4;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --user-bubble: #3538CD;
  --user-text: #ffffff;
  --bot-bubble: #f0f1f5;
  --bot-text: #1a1a2e;
  --error: #dc2626;
  --radius: 16px;
  --radius-sm: 8px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Header ──────────────────────────────────────────── */
.chat-header {
  background: #3538CD;
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
}

.chat-header-avatar svg {
  display: block;
  width: 40px;
  height: 40px;
}

.chat-header-info {
  flex: 1;
}

.chat-header-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.chat-header-status {
  font-size: 11px;
  opacity: 0.75;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot-header {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-header-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

/* ── Language globe dropdown ─────────────────────────── */
.lang-globe-wrap {
  position: relative;
  flex-shrink: 0;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 130px;
  z-index: 100;
  overflow: hidden;
  animation: fadeIn 0.12s ease;
}

.lang-option {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.lang-option:hover { background: var(--bg); }
.lang-option.active { font-weight: 600; color: var(--primary); }

/* ── Burger menu ─────────────────────────────────────── */
.burger-wrap {
  position: relative;
  flex-shrink: 0;
}

.burger-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
  animation: fadeIn 0.12s ease;
}

.burger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.burger-item:hover { background: var(--bg); }
.burger-item svg { flex-shrink: 0; opacity: 0.7; }

/* ── Messages ─────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.msg {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fadeIn 0.2s ease;
}

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

.msg.user { align-items: flex-end; }
.msg.bot  { align-items: flex-start; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 14px;
  max-width: 100%;
}

.msg.user .msg-bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: 4px;
  max-width: 80%;
}

.msg.bot .msg-bubble {
  background: var(--bot-bubble);
  color: var(--bot-text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  width: 100%;
  position: relative;
}

/* Copy button on bot messages */
.msg-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1;
}
.msg.bot:hover .msg-copy-btn { opacity: 1; }
.msg-copy-btn:hover { background: var(--bg); border-color: var(--text-muted); }
.msg-copy-btn.copied {
  opacity: 1;
  color: #16a34a;
  border-color: #86efac;
  background: #f0fdf4;
}

/* Links inside bot bubbles */
.msg.bot .msg-bubble a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.msg.bot .msg-bubble a:hover { color: var(--primary-dark); }

/* Source links under bot messages */
.msg-sources {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8f9fb;
  border-radius: var(--radius-sm);
}

.msg-sources-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.msg-source-row {
  padding: 3px 0;
}

.msg-source-row::before {
  content: "→ ";
  opacity: 0.5;
}

.msg-sources a {
  color: var(--primary);
  text-decoration: none;
}

.msg-sources a:hover {
  text-decoration: underline;
}

/* Feedback — always visible under bot messages */
.msg-feedback {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  padding-left: 2px;
}

.feedback-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s;
}

.feedback-btn:hover { background: var(--bg); border-color: var(--text-muted); }
.feedback-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.feedback-btn:disabled:not(.active) { opacity: 0.35; cursor: default; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bot-bubble);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  align-self: flex-start;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ── Input ───────────────────────────────────────────── */
.chat-input-area {
  padding: 10px 8px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 42px;
  line-height: 1.4;
  transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--primary); }
.chat-input:disabled { background: var(--bg); }

.send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.send-btn:hover:not(:disabled) { background: var(--primary-dark); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Toasts & banners ────────────────────────────────── */
.error-toast {
  background: var(--error);
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  text-align: center;
  display: none;
  flex-shrink: 0;
}

.ticket-banner {
  background: #f0fdf4;
  border-bottom: 1px solid #86efac;
  padding: 10px 14px;
  font-size: 13px;
  color: #166534;
  display: none;
  flex-shrink: 0;
}

/* ── Loading / Error screens ─────────────────────────── */
.chat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  color: var(--text-muted);
}

.error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 0;
  padding: 32px 24px;
  text-align: center;
  background: var(--bg);
}

.error-screen-icon {
  margin-bottom: 20px;
  opacity: 0.7;
  animation: fadeIn 0.4s ease;
}

.error-screen-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.error-screen-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 260px;
  margin-bottom: 24px;
}

.error-screen-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.error-screen-retry:hover { background: var(--primary-dark); }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── History panel ───────────────────────────────────── */
.history-panel {
  position: absolute;
  inset: 56px 0 0 0; /* below header */
  background: var(--surface);
  display: flex;
  flex-direction: column;
  z-index: 10;
  animation: slideUp 0.2s ease;
}

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

.history-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  flex-shrink: 0;
}

.history-panel-header span { flex: 1; }

/* Buttons inside history/transcript panel headers are on white bg — override white color */
.history-panel-header .chat-header-btn {
  color: var(--text-muted);
}
.history-panel-header .chat-header-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.history-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.history-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.history-item:hover { background: var(--bg); }
.history-item:last-child { border-bottom: none; }

.history-item-date {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-item-badge {
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
}

.history-item-badge.ticket {
  background: #dcfce7;
  color: #166534;
}

.history-item-preview {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Transcript read-only view */
.transcript-readonly {
  background: var(--bg);
  opacity: 0.92;
}

/* Low confidence disclaimer */
.msg-low-confidence {
  font-size: 11px;
  color: #92400e;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 6px 10px;
  margin-top: 6px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.4;
}

/* Resolution card */
.resolution-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.resolution-card p {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
}

.resolution-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.resolution-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.resolution-btn.yes {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}
.resolution-btn.yes:hover {
  background: #dcfce7;
}

.resolution-btn.no {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}
.resolution-btn.no:hover {
  background: #fee2e2;
}

/* Video rich cards (YouTube, Vimeo) */
.video-card {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 6px 0;
  max-width: 100%;
}

.video-card a {
  display: block;
  position: relative;
  text-decoration: none;
}

.video-thumb {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: var(--radius-sm);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  pointer-events: none;
  transition: background 0.2s;
}

.video-card a:hover .video-play {
  background: rgba(220, 38, 38, 0.9);
}

.video-card.vimeo a:hover .video-play {
  background: rgba(0, 173, 239, 0.9);
}

/* Vimeo inline embed (responsive 16:9) */
.vimeo-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin: 6px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.vimeo-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-sm);
}

/* Read receipts */
.msg-receipt {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  text-align: right;
  margin-top: 2px;
  padding-right: 2px;
  line-height: 1;
}

.msg-receipt.delivered {
  color: rgba(255,255,255,0.85);
}

/* Attachment button & preview */
.attach-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}

.attach-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.attach-preview {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.attach-preview-item {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.attach-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attach-preview-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--error);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Character counter */
.char-counter {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  padding: 0 14px 2px;
  flex-shrink: 0;
}

.char-counter.near-limit {
  color: #dc2626;
  font-weight: 600;
}

#chat-screen { position: relative; }

/* ── Confetti (Konami code easter egg) ───────────────── */
.confetti {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 1;
  pointer-events: none;
  z-index: 9999;
  animation: confettiFall 2.8s ease-in forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ── Bot "read receipt" (Vu / Gesehen) ───────────────── */
.msg-read-receipt {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 4px;
  align-self: flex-start;
  animation: fadeIn 0.15s ease;
  line-height: 1.4;
}

/* ── Satisfaction survey card ────────────────────────── */
.satisfaction-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.satisfaction-card p {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
}

.satisfaction-emojis {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.satisfaction-emoji-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
}

.satisfaction-emoji-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  transform: scale(1.15);
}

/* ── Share toast (success notification) ─────────────── */
.share-toast {
  background: #166534;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  text-align: center;
  border-radius: var(--radius-sm);
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  white-space: nowrap;
  animation: fadeIn 0.2s ease;
}

/* ── Shared conversation view ────────────────────────── */
.shared-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.shared-header {
  background: #3538CD;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.shared-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
}

.shared-header-title {
  flex: 1;
}

.shared-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.shared-messages::-webkit-scrollbar { width: 4px; }
.shared-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.shared-footer {
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

/* ── Feature 1: Message timestamps ──────────────────── */
.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  opacity: 0.6;
}

.msg.user .msg-time { text-align: right; }
.msg.bot  .msg-time { text-align: left; }

/* ── Feature 6: Auto-suggestions ────────────────────── */
.suggestions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  flex-shrink: 0;
}

.suggestion-btn {
  background: var(--surface);
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.suggestion-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Feature 8: Voice button recording state ─────────── */
.attach-btn.recording {
  border-color: var(--error);
  color: var(--error);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Feature 9: QR code modal ───────────────────────── */
.qr-modal {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: fadeIn 0.2s ease;
}

.qr-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.qr-card img {
  margin: 12px 0;
  border-radius: var(--radius-sm);
}

.qr-card p {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  margin: 8px 0;
}

.qr-close-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
  transition: background 0.2s;
}

.qr-close-btn:hover {
  background: var(--primary-dark);
}

/* ── Feature: Typing cursor (blinking | during streaming) ── */
.typing-cursor {
  display: inline-block;
  margin-left: 1px;
  color: var(--text-muted);
  animation: blink 0.6s step-end infinite;
  user-select: none;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ── Feature: Sian breathing animation ─────────────────── */
#sian-avatar {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-2px); }
}

/* ── Feature: Welcome particles ─────────────────────────── */
.welcome-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 1;
  animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
  0%   { opacity: 1; transform: translateY(0) translateX(0); }
  100% { opacity: 0; transform: translateY(-80px) translateX(var(--drift, 0px)); }
}

/* ── Feature: Confidence bar ────────────────────────────── */
.confidence-bar {
  height: 3px;
  width: 40px;
  border-radius: 2px;
  margin-top: 5px;
  opacity: 0;
  animation: confidenceFadeIn 0.5s ease 0.2s forwards;
}

@keyframes confidenceFadeIn {
  to { opacity: 1; }
}

.confidence-bar.confidence-high { background: #22c55e; }
.confidence-bar.confidence-mid  { background: #f59e0b; }
.confidence-bar.confidence-low  { background: #ef4444; }

/* Status dot pulse during thinking stages */
.status-dot-header.pulsing {
  animation: statusPulse 1s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

/* Ensure messages container is position:relative for particles */
.chat-messages {
  position: relative;
}

/* ── Feature: Scroll-down "new message" button ───────── */
#scroll-down-btn {
  transition: opacity 0.2s ease;
}

#scroll-down-btn:hover {
  background: var(--primary-dark) !important;
}

/* ── Feature: Response time in message timestamp ─────── */
.msg-time {
  /* already defined above; this block just documents the feature */
}
