/* ══════════════════════════════════════════════════════════════
   Groq Copilot — Design System & Styles
   ══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  /* Core Palette – Dark (default) */
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #12121a;
  --bg-tertiary:   #1a1a28;
  --bg-elevated:   #22223a;
  --surface:       rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.06);
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --text-primary:   #e8e8ed;
  --text-secondary: #9d9db5;
  --text-muted:     #5e5e7a;

  --accent:         #a78bfa;
  --accent-hover:   #c4b5fd;
  --accent-dim:     rgba(167,139,250,0.12);
  --accent2:        #06b6d4;
  --accent-gradient: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);

  --success: #34d399;
  --warning: #fbbf24;
  --error:   #f87171;

  /* Sizing */
  --sidebar-width: 280px;
  --topbar-height: 52px;
  --radius-sm:  8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(167,139,250,0.15);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Glassmorphism */
  --glass-bg: rgba(18,18,26,0.75);
  --glass-blur: blur(16px);
}

/* ── Light Mode ─────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:    #f5f5f9;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #eeeef4;
  --bg-elevated:   #e4e4ed;
  --surface:       rgba(0,0,0,0.02);
  --surface-hover: rgba(0,0,0,0.05);
  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);

  --text-primary:   #1a1a2e;
  --text-secondary: #555574;
  --text-muted:     #8888a4;

  --accent:        #7c3aed;
  --accent-hover:  #6d28d9;
  --accent-dim:    rgba(124,58,237,0.08);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(124,58,237,0.08);

  --glass-bg: rgba(255,255,255,0.75);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

/* ── App Container ──────────────────────────────────────────── */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── New Chat Button ────────────────────────────────────────── */
.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 16px 4px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-new-chat:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Sidebar Sections ───────────────────────────────────────── */
.sidebar-section {
  padding: 12px 16px 4px;
}

.section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.select-wrapper {
  position: relative;
}

.model-select {
  width: 100%;
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
  outline: none;
}
.model-select:focus { border-color: var(--accent); }
.model-select option { background: var(--bg-secondary); color: var(--text-primary); }

.select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

/* ── Mode Pills ─────────────────────────────────────────────── */
.mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mode-pill {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.mode-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mode-pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ── Chat History ───────────────────────────────────────────── */
.chat-history-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

.chat-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.chat-history-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.chat-history-item.active { background: var(--accent-dim); color: var(--accent); }

.chat-history-item .hist-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-item .hist-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  transition: opacity 0.15s, color 0.15s;
  display: flex;
}
.chat-history-item:hover .hist-delete { opacity: 1; }
.chat-history-item .hist-delete:hover { color: var(--error); }

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
  display: flex;
  gap: 2px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-footer-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: var(--bg-primary);
}

/* ── Top Bar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  flex-shrink: 0;
}

.topbar-model {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
}

.topbar-mode {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-tokens {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Icon Button ────────────────────────────────────────────── */
.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════════
   MESSAGES
   ══════════════════════════════════════════════════════════════ */
.messages-container {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 0;
}

.messages-list {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

/* ── Welcome Screen ─────────────────────────────────────────── */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.6s var(--ease);
}

.welcome-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-glow);
}

.welcome-title {
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.welcome-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 420px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 540px;
}

.welcome-chip {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.welcome-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ── Message Bubble ─────────────────────────────────────────── */
.message {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  animation: fadeInUp 0.35s var(--ease);
}

.message.user { justify-content: flex-end; }
.message.assistant { justify-content: flex-start; }

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  font-weight: 700;
}

.message.user .message-avatar {
  background: var(--accent-gradient);
  color: #fff;
  order: 2;
}

.message.assistant .message-avatar {
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border);
}

.message-body {
  max-width: 75%;
  min-width: 60px;
}

.message-content {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message.user .message-content {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Message images */
.message-image {
  max-width: 320px;
  max-height: 240px;
  border-radius: var(--radius-md);
  margin-top: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  object-fit: contain;
}
.message-image:hover { transform: scale(1.03); }

/* Message actions */
.message-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.message:hover .message-actions { opacity: 1; }

.msg-action-btn {
  padding: 4px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.msg-action-btn:hover { background: var(--surface-hover); color: var(--text-primary); }

/* ── Collapsed previous response ────────────────────────────── */
.collapsed-response {
  margin-bottom: 8px;
}
.collapsed-toggle {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.collapsed-toggle:hover { border-color: var(--accent); color: var(--accent); }
.collapsed-content {
  display: none;
  padding: 8px 12px;
  margin-top: 6px;
  border-left: 2px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.collapsed-content.show { display: block; }

/* ── Typing Indicator ───────────────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Markdown Content Styling ───────────────────────────────── */
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
  margin: 16px 0 8px;
  font-weight: 600;
  line-height: 1.3;
}
.message-content h1 { font-size: 1.3rem; }
.message-content h2 { font-size: 1.15rem; }
.message-content h3 { font-size: 1.05rem; }

.message-content p { margin: 8px 0; }
.message-content ul, .message-content ol { margin: 8px 0; padding-left: 20px; }
.message-content li { margin: 4px 0; }
.message-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 12px;
  margin: 8px 0;
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.message-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.message-content a:hover { color: var(--accent-hover); }

.message-content table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
  font-size: 0.85rem;
}
.message-content th, .message-content td {
  border: 1px solid var(--border-strong);
  padding: 8px 12px;
  text-align: left;
}
.message-content th {
  background: var(--bg-elevated);
  font-weight: 600;
}

.message-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* ── Code Blocks ────────────────────────────────────────────── */
.code-block-wrapper {
  position: relative;
  margin: 12px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-elevated);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.code-copy-btn {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s;
}
.code-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.code-copy-btn.copied { border-color: var(--success); color: var(--success); }

.code-block-wrapper pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--bg-secondary) !important;
}

.code-block-wrapper code {
  font-family: 'JetBrains Mono', monospace;
  background: transparent !important;
}

.message-content code:not(pre code) {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  border: 1px solid var(--border);
}

.message.user .message-content code:not(pre code) {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.25);
}

/* ══════════════════════════════════════════════════════════════
   INPUT AREA
   ══════════════════════════════════════════════════════════════ */
.input-area {
  padding: 0 20px 16px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.attachment-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  animation: fadeInUp 0.2s var(--ease);
}

.attachment-preview img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.attachment-preview .att-info {
  display: flex;
  flex-direction: column;
}
.attachment-preview .att-name {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-preview .att-size {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.attachment-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  line-height: 1;
}
.attachment-remove:hover { transform: scale(1.2); }

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}
.input-wrapper:focus-within { border-color: var(--accent); box-shadow: var(--shadow-glow); }

.attachment-tray + .input-wrapper {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.chat-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: none;
  max-height: 200px;
  min-height: 24px;
}
.chat-input::placeholder { color: var(--text-muted); }

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.char-counter {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  min-width: 28px;
  text-align: center;
}

.send-btn { color: var(--accent); }
.send-btn:hover { background: var(--accent-dim); }
.stop-btn { color: var(--error); }
.stop-btn:hover { background: rgba(248,113,113,0.1); }

.input-hint {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  font-size: 1.2rem;
  border: 1px solid var(--border);
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 300px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.export-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.export-option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.btn-cancel {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cancel:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   DROP ZONE OVERLAY
   ══════════════════════════════════════════════════════════════ */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(167,139,250,0.08);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.drop-overlay.show {
  display: flex;
}

.drop-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 60px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════════════════════════
   FILE LOADING INDICATOR
   ══════════════════════════════════════════════════════════════ */
.file-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.file-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Error toast ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 2000;
  transition: transform 0.3s var(--ease);
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--error); color: #fff; }
.toast.success { background: var(--success); color: #000; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .message-body { max-width: 88%; }
  .messages-list { padding: 16px 12px 80px; }
  .input-area { padding: 0 10px 10px; }
  .welcome-title { font-size: 1.5rem; }
  .welcome-chips { gap: 6px; }
  .welcome-chip { font-size: 0.75rem; padding: 8px 12px; }
}

@media (max-width: 480px) {
  .message-body { max-width: 92%; }
  .topbar-mode { display: none; }
}
