/* ═══════════════════════════════════════════════════════════════════════════
   ATLAS — Premium Dark Theme Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-deepest:     #0a0a0f;
  --bg-deep:        #0f0f1a;
  --bg-base:        #13132a;
  --bg-surface:     #1a1a2e;
  --bg-elevated:    #222240;
  --bg-hover:       #2a2a4a;

  /* Glass */
  --glass-bg:       rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border:   rgba(255, 255, 255, 0.08);
  --glass-border-l: rgba(255, 255, 255, 0.12);
  --glass-blur:     20px;

  /* Accent gradient */
  --accent-start:   #7c3aed;
  --accent-end:     #06b6d4;
  --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  --accent-glow:    0 0 30px rgba(124, 58, 237, 0.25), 0 0 60px rgba(6, 182, 212, 0.12);

  /* Text */
  --text-primary:   #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted:     #686888;
  --text-accent:    #a78bfa;

  /* Status */
  --success:        #34d399;
  --warning:        #fbbf24;
  --error:          #f87171;

  /* Layout */
  --sidebar-width:  280px;
  --header-height:  60px;
  --input-height:   80px;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-xl:      24px;

  /* Transitions */
  --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;

  /* Shadows */
  --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 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: var(--accent-glow);

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-deepest);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient glow behind everything */
body::before {
  content: '';
  position: fixed;
  top: -40%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  right: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── App Layout ──────────────────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Mobile Header ───────────────────────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  align-items: center;
  padding: 0 16px;
  z-index: 200;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-title {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 12px;
  flex: 1;
}

/* ── Sidebar Overlay ─────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 299;
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow-y: auto;
  z-index: 300;
  transition: transform var(--transition);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 20px;
}
.brand-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  animation: glow-pulse 4s ease-in-out infinite;
}
.brand-icon svg {
  width: 100%;
  height: 100%;
}
.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--glass-bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--glass-border);
}

/* New Chat button */
.btn-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--glass-border-l);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}
.btn-new-chat:hover {
  background: var(--glass-bg-hover);
  border-color: var(--accent-start);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

.btn-trading-terminal {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.05);
  color: #06b6d4;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 16px;
  justify-content: center;
}
.btn-trading-terminal:hover {
  background: #06b6d4;
  color: #000;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
  border-color: #06b6d4;
}

/* Section labels */
.sidebar-section {
  margin-bottom: 12px;
}
.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 6px 8px;
  font-weight: 600;
}

/* Conversation list */
.conversations-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 40vh;
  overflow-y: auto;
}
.conv-item {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}
.conv-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--text-accent);
}

.sidebar-spacer { flex: 1; }

/* Voice toggle */
.voice-section {
  padding: 8px 0;
}
.voice-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.voice-toggle-row span {
  flex: 1;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border-radius: 11px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--glass-border);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-start);
  border-color: var(--accent-start);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}

/* System status */
.status-section {
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.status-item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}
.status-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}
.status-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.offline { background: var(--error);   box-shadow: 0 0 8px var(--error); }
.status-dot.loading { background: var(--warning);  animation: blink 1.2s infinite; }

/* ── Chat Area ───────────────────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  background: var(--bg-deepest);
  position: relative;
}

/* Chat header */
.chat-header {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-left h1 {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 10px;
}
.connection-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  transition: background var(--transition);
}
.connection-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

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

/* Welcome card */
.welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 0.8s ease;
}
.welcome-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  animation: glow-pulse 4s ease-in-out infinite;
}
.welcome-icon svg { width: 100%; height: 100%; }
.welcome-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-card p {
  color: var(--text-secondary);
  max-width: 440px;
  font-size: 0.95rem;
  margin-bottom: 28px;
}
.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chip {
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-l);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}
.chip:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-start);
  transform: translateY(-1px);
}

/* Message bubbles */
.message {
  display: flex;
  gap: 12px;
  max-width: 82%;
  animation: slideUp 0.35s ease;
}
.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.message.assistant {
  align-self: flex-start;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.message.user .message-avatar {
  background: var(--accent-gradient);
  color: #fff;
}
.message.assistant .message-avatar {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-l);
  color: var(--text-accent);
}

.message-bubble {
  padding: 12px 16px;
  line-height: 1.65;
  font-size: 0.92rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.message.user .message-bubble {
  background: var(--accent-gradient);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: var(--shadow-sm);
}
.message.assistant .message-bubble {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 18px 18px 18px 4px;
  color: var(--text-primary);
}

/* Markdown content inside bubbles */
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  margin: 12px 0 6px;
  font-weight: 600;
}
.message-bubble h1 { font-size: 1.2rem; }
.message-bubble h2 { font-size: 1.05rem; }
.message-bubble h3 { font-size: 0.95rem; }

.message-bubble p {
  margin: 4px 0;
}
.message-bubble ul, .message-bubble ol {
  margin: 6px 0;
  padding-left: 20px;
}
.message-bubble a {
  color: var(--text-accent);
  text-decoration: none;
}
.message-bubble a:hover {
  text-decoration: underline;
}
.message-bubble img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 8px 0;
}

/* Inline code */
.message-bubble code:not(pre code) {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Code blocks */
.message-bubble pre {
  background: #1e1e2e;
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 10px 0;
  overflow-x: auto;
  position: relative;
  border: 1px solid var(--glass-border);
}
.message-bubble pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Copy button area for code blocks */
.code-block-wrapper {
  position: relative;
}
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition-fast);
  opacity: 0;
  z-index: 2;
}
.code-block-wrapper:hover .code-copy-btn {
  opacity: 1;
}
.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* ── Tool Cards ──────────────────────────────────────────────────────────── */
.tool-card {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-md);
  margin: 8px 0;
  overflow: hidden;
  animation: slideUp 0.35s ease;
  max-width: 82%;
}
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.tool-card-header:hover {
  background: rgba(124, 58, 237, 0.08);
}
.tool-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.tool-icon svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
}
.tool-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-accent);
}
.tool-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.tool-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--glass-border-l);
  border-top-color: var(--accent-start);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.tool-chevron {
  color: var(--text-muted);
  transition: transform var(--transition);
  font-size: 0.8rem;
}
.tool-card.expanded .tool-chevron {
  transform: rotate(180deg);
}
.tool-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.tool-card.expanded .tool-card-body {
  max-height: 600px;
}
.tool-card-content {
  padding: 0 14px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.tool-card-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  overflow-x: auto;
  font-size: 0.78rem;
}
.tool-result-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 600;
}

/* ── Typing Indicator ────────────────────────────────────────────────────── */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 28px 12px;
}
.typing-indicator.visible {
  display: flex;
}
.typing-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-l);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-accent);
}
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px 18px 18px 4px;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

/* ── Input Area ──────────────────────────────────────────────────────────── */
.input-area {
  padding: 12px 28px 16px;
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-l);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-container:focus-within {
  border-color: var(--accent-start);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.12), 0 0 40px rgba(124, 58, 237, 0.05);
}

.input-container textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.92rem;
  resize: none;
  max-height: 140px;
  padding: 8px 4px;
  line-height: 1.5;
}
.input-container textarea::placeholder {
  color: var(--text-muted);
}

.btn-attach {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-attach:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition);
}
.btn-send:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-glow);
}
.btn-send:active {
  transform: scale(0.95);
}

.input-hint {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.6;
}
.input-hint kbd {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--glass-border);
  font-family: var(--font);
  font-size: 0.65rem;
}

/* ── Keyframe Animations ─────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-8px); }
}

@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.4)); }
  50%      { filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.5)); }
}

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

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

/* ── Error message ───────────────────────────────────────────────────────── */
.message.error .message-bubble {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--error);
}

/* ── Status message (thinking...) ────────────────────────────────────────── */
.status-msg {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 6px 0;
  animation: fadeIn 0.3s ease;
}

/* ── Responsive — Mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .chat-area {
    padding-top: 56px;
  }

  .chat-header {
    display: none;
  }

  .messages {
    padding: 16px;
  }

  .input-area {
    padding: 10px 12px 14px;
  }

  .message {
    max-width: 95%;
  }

  .welcome-card {
    padding: 40px 16px;
  }
  .welcome-card h2 {
    font-size: 1.3rem;
  }

  .tool-card {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  .welcome-chips {
    flex-direction: column;
  }
  .chip {
    width: 100%;
    text-align: center;
  }
}
