/* ==========================================================================
   Etsycars Brand Theme & Design System for Voice AI Concierge
   Brand Palette:
   --ink: #222222 | --ink-2: #6a6a6a | --ink-3: #929292
   --surface: #f7f7f7 | --white: #ffffff | --line: #dddddd | --line-2: #ebebeb
   --accent: #d5460e (Etsycars Terracotta Orange)
   --accent-hover: #b93c0b
   --success: #16a34a (Moroccan Emerald / Zero Deposit verification)
   ========================================================================== */

:root {
  /* Default Clean Brand Theme (Matching main site) */
  --chat-bg: #ffffff;
  --chat-surface: #f7f7f7;
  --chat-surface-hover: #eeeeee;
  --chat-sidebar: #fafafa;
  --chat-sidebar-hover: #f0f0f0;
  --chat-sidebar-border: #ebebeb;
  --chat-border: #e5e5e5;
  --chat-text: #222222;
  --chat-text-muted: #6a6a6a;
  --chat-text-faint: #929292;
  --chat-user-bubble: #f2f2f2;
  --chat-brand: #d5460e;
  --chat-brand-hover: #b93c0b;
  --chat-accent: #d5460e;
  --chat-pill-bg: #ffffff;
  --chat-pill-border: #dcdcdc;
  --chat-success: #16a34a;
  --chat-font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --chat-max-w: 48rem;
  --radius-full: 999px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Elegant Brand Night/Dark Mode (Rich Obsidian with Etsycars Warm Accents) */
[data-theme="dark"] {
  --chat-bg: #141414;
  --chat-surface: #1e1e1e;
  --chat-surface-hover: #282828;
  --chat-sidebar: #181818;
  --chat-sidebar-hover: #222222;
  --chat-sidebar-border: rgba(255, 255, 255, 0.08);
  --chat-border: rgba(255, 255, 255, 0.1);
  --chat-text: #f5f5f5;
  --chat-text-muted: #a3a3a3;
  --chat-text-faint: #737373;
  --chat-user-bubble: #252525;
  --chat-brand: #d5460e;
  --chat-brand-hover: #e0531b;
  --chat-accent: #d5460e;
  --chat-pill-bg: #1e1e1e;
  --chat-pill-border: rgba(255, 255, 255, 0.15);
  --chat-success: #22c55e;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--chat-font);
  background-color: var(--chat-bg);
  color: var(--chat-text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

/* App Container */
.chat-app {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Sidebar (Clean Etsycars Panel)
   -------------------------------------------------------------------------- */
.chat-sidebar {
  width: 270px;
  background-color: var(--chat-sidebar);
  border-right: 1px solid var(--chat-sidebar-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s ease, opacity 0.2s ease;
  z-index: 50;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.chat-sidebar.collapsed {
  transform: translateX(-100%);
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  overflow: hidden !important;
}

.chat-sidebar.collapsed * {
  display: none !important;
}

.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--chat-sidebar-border);
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--chat-brand);
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.12s ease;
}

.new-chat-btn:hover {
  background: var(--chat-brand-hover);
  transform: translateY(-1px);
}

.new-chat-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 120, 120, 0.2) transparent;
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--chat-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 10px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--chat-text);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover {
  background: var(--chat-sidebar-hover);
  color: var(--chat-brand);
}

.sidebar-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--chat-text-muted);
  stroke-width: 2;
  fill: none;
  transition: stroke 0.15s ease;
}

.sidebar-item:hover svg {
  stroke: var(--chat-brand);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--chat-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--chat-text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-footer-link:hover {
  background: var(--chat-sidebar-hover);
  color: var(--chat-text);
}

.sidebar-footer-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* --------------------------------------------------------------------------
   Main Workspace
   -------------------------------------------------------------------------- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  position: relative;
  background-color: var(--chat-bg);
}

/* Top Navigation Bar */
.chat-topbar {
  height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--chat-border);
  z-index: 20;
  background: var(--chat-bg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-wordmark-link {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--chat-brand);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chat-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--chat-surface);
  color: var(--chat-text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.agent-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--chat-text);
  padding: 6px 10px;
  border-radius: var(--radius-md);
}

.agent-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--chat-brand);
  background: rgba(213, 70, 14, 0.1);
  border: 1px solid rgba(213, 70, 14, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deposit-badge-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(22, 163, 74, 0.1);
  color: var(--chat-success);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.deposit-badge-top svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* --------------------------------------------------------------------------
   Messages Stream & Scroll Canvas
   -------------------------------------------------------------------------- */
.chat-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 165px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 120, 120, 0.2) transparent;
}

.chat-center-container {
  width: 100%;
  max-width: var(--chat-max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

/* Welcome Greeting */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 58vh;
  text-align: center;
  padding: 40px 16px 20px;
}

.welcome-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--chat-brand);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 6px 24px rgba(213, 70, 14, 0.35);
}

.welcome-avatar svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.welcome-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--chat-text);
}

.welcome-subtitle {
  font-size: 0.98rem;
  color: var(--chat-text-muted);
  max-width: 530px;
  line-height: 1.55;
  margin-bottom: 36px;
}

/* Starter Prompts Grid */
.prompt-starters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 680px;
}

@media (max-width: 640px) {
  .prompt-starters-grid {
    grid-template-columns: 1fr;
  }
}

.prompt-starter-card {
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prompt-starter-card:hover {
  background: var(--chat-surface-hover);
  border-color: var(--chat-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.prompt-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--chat-text);
}

.prompt-card-desc {
  font-size: 0.82rem;
  color: var(--chat-text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Chat Stream Messages
   -------------------------------------------------------------------------- */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 24px;
}

.chat-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-bubble-user {
  max-width: 78%;
  background: var(--chat-user-bubble);
  border: 1px solid var(--chat-border);
  padding: 13px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--chat-text);
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

.chat-row.assistant {
  justify-content: flex-start;
}

.assistant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--chat-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(213, 70, 14, 0.3);
}

.assistant-avatar svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

.assistant-content {
  flex: 1;
  min-width: 0;
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--chat-text);
}

.assistant-prose p {
  margin-bottom: 12px;
}

.assistant-prose p:last-child {
  margin-bottom: 0;
}

.assistant-prose strong {
  font-weight: 700;
  color: var(--chat-text);
}

/* Typing cursor animation */
.typing-cursor {
  display: inline-block;
  width: 7px;
  height: 16px;
  background-color: var(--chat-brand);
  vertical-align: middle;
  margin-left: 4px;
  animation: blink 0.8s infinite;
}

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

/* --------------------------------------------------------------------------
   Rich Vehicle Recommendation Card inside Chat Stream
   -------------------------------------------------------------------------- */
.chat-car-card {
  margin-top: 18px;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-car-card:hover {
  box-shadow: var(--shadow-lg);
}

.car-card-header {
  padding: 13px 18px;
  background: rgba(213, 70, 14, 0.04);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.car-card-header .match-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--chat-brand);
}

.car-card-header .match-badge svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}

.car-card-header .terminal-badge {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--chat-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.car-card-header .terminal-badge svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.car-card-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 680px) {
  .car-card-body {
    grid-template-columns: 1fr;
  }
}

.car-card-image-wrap {
  position: relative;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 145px;
}

.car-card-image-wrap img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.car-card-image-wrap:hover img {
  transform: scale(1.04);
}

.car-gear-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--chat-text);
  color: var(--chat-bg);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.car-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.car-details-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.car-details-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--chat-text);
  letter-spacing: -0.01em;
}

.car-details-price {
  text-align: right;
}

.car-details-price b {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--chat-brand);
}

.car-details-price small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--chat-text-muted);
}

.car-specs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--chat-text-muted);
}

.spec-chip svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.spec-chip.highlight {
  color: var(--chat-success);
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.25);
  font-weight: 700;
}

.car-card-quote {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--chat-text-muted);
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--chat-brand);
}

.car-card-footer {
  padding: 14px 18px;
  background: var(--chat-bg);
  border-top: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.price-breakdown {
  display: flex;
  flex-direction: column;
}

.price-breakdown-label {
  font-size: 0.72rem;
  color: var(--chat-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.price-breakdown-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--chat-text);
}

.car-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 700;
  transition: all 0.18s ease;
  text-decoration: none;
}

.action-btn.primary {
  background: var(--chat-brand);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(213, 70, 14, 0.3);
}

.action-btn.primary:hover {
  background: var(--chat-brand-hover);
  transform: translateY(-1px);
}

.action-btn.whatsapp {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
}

.action-btn.whatsapp:hover {
  background: #20bd5a;
  transform: translateY(-1px);
}

.action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* --------------------------------------------------------------------------
   Floating Bottom Dock & Input Capsule
   -------------------------------------------------------------------------- */
.chat-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 24%, var(--chat-bg) 100%);
  padding: 12px 16px 20px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
}

[data-theme="dark"] .chat-dock {
  background: linear-gradient(180deg, rgba(20, 20, 20, 0) 0%, rgba(20, 20, 20, 0.95) 24%, var(--chat-bg) 100%);
}

.dock-container {
  width: 100%;
  max-width: var(--chat-max-w);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Live Detected Intent Tags */
.live-intent-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.intent-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--chat-surface);
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  animation: fadeIn 0.2s ease;
}

.intent-pill.brand {
  background: rgba(213, 70, 14, 0.1);
  border-color: rgba(213, 70, 14, 0.25);
  color: var(--chat-brand);
  font-weight: 700;
}

.intent-pill.green {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.25);
  color: var(--chat-success);
  font-weight: 700;
}

.intent-pill svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* Input Capsule */
.input-capsule {
  position: relative;
  background: var(--chat-pill-bg);
  border: 1.5px solid var(--chat-pill-border);
  border-radius: 28px;
  padding: 8px 12px 8px 18px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-capsule:focus-within {
  border-color: var(--chat-brand);
  box-shadow: 0 4px 24px rgba(213, 70, 14, 0.18);
}

.capsule-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--chat-text);
  resize: none;
  max-height: 200px;
  line-height: 1.5;
  padding: 6px 0;
  scrollbar-width: thin;
}

.capsule-textarea::placeholder {
  color: var(--chat-text-faint);
}

/* Controls inside capsule */
.capsule-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

/* Voice Mic Button */
.capsule-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chat-text);
  background: transparent;
  position: relative;
  transition: all 0.2s ease;
}

.capsule-mic-btn:hover {
  background: var(--chat-surface-hover);
  color: var(--chat-brand);
}

.capsule-mic-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.capsule-mic-btn.recording {
  background: var(--chat-brand);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(213, 70, 14, 0.6);
  animation: pulse-brand 1.5s infinite;
}

@keyframes pulse-brand {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Send Submit Button */
.capsule-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chat-brand);
  color: #ffffff;
  transition: opacity 0.2s ease, transform 0.15s ease, background 0.15s ease;
}

.capsule-send-btn:hover:not(:disabled) {
  background: var(--chat-brand-hover);
  transform: scale(1.05);
}

.capsule-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--chat-text-faint);
}

.capsule-send-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* Live Waveform Indicator */
.capsule-waveform {
  display: none;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 6px;
}

.capsule-waveform.active {
  display: flex;
}

.capsule-waveform span {
  width: 3px;
  height: 6px;
  background: var(--chat-brand);
  border-radius: 3px;
  animation: soundWave 0.8s ease-in-out infinite alternate;
}

.capsule-waveform span:nth-child(2) { animation-delay: 0.15s; height: 12px; }
.capsule-waveform span:nth-child(3) { animation-delay: 0.3s; height: 18px; }
.capsule-waveform span:nth-child(4) { animation-delay: 0.45s; height: 10px; }
.capsule-waveform span:nth-child(5) { animation-delay: 0.6s; height: 15px; }

@keyframes soundWave {
  0% { height: 4px; }
  100% { height: 20px; }
}

.dock-disclaimer {
  font-size: 0.74rem;
  color: var(--chat-text-faint);
  text-align: center;
  padding-top: 4px;
}

/* Toast */
.chat-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #222222;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.chat-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

/* Mobile responsive drawer overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 40;
}

@media (max-width: 768px) {
  .chat-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px !important;
    transform: translateX(-100%) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
  }
  .chat-sidebar:not(.active) * {
    display: none !important;
  }
  .chat-sidebar.active {
    transform: translateX(0) !important;
    width: 280px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .sidebar-overlay.active {
    display: block;
  }
}
