/* ═══════════════════════════════════════════════
   My Assistant — Design System
   Dark mode, glassmorphism, premium aesthetics
   ═══════════════════════════════════════════════ */

/* ─── Login Screen ──────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}

.login-card {
  text-align: center;
  padding: 48px 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: 360px;
  width: 90%;
  animation: fadeInUp 0.5s ease-out;
}

.login-icon {
  font-size: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 16px var(--accent-primary-glow));
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.pin-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.pin-input-group .btn {
  white-space: nowrap;
  min-width: 72px;
  padding: 12px 20px;
  font-size: 15px;
}

.pin-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.3em;
  outline: none;
  transition: border-color var(--transition-fast);
}

.pin-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-primary-glow); }

.login-error {
  color: var(--accent-danger);
  font-size: 13px;
  margin-top: 12px;
}

/* ─── Settings ──────────────────────────────── */
.settings-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-glass-border);
}

.settings-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.settings-status {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── CSS Variables ─────────────────────────── */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-glass: rgba(26, 26, 46, 0.6);
  --bg-glass-hover: rgba(26, 26, 46, 0.8);
  --bg-glass-border: rgba(255, 255, 255, 0.06);

  --text-primary: #e8e8f0;
  --text-secondary: #8b8ba3;
  --text-muted: #555570;
  --text-accent: #a78bfa;

  --accent-primary: #7c3aed;
  --accent-primary-glow: rgba(124, 58, 237, 0.3);
  --accent-secondary: #06b6d4;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  --user-bubble: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  --assistant-bubble: rgba(30, 30, 50, 0.7);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --sidebar-width: 300px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* 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.2); }

/* ─── App Layout ────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--bg-glass-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

.sidebar.hidden {
  transform: translateX(-100%);
  opacity: 0;
  min-width: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-glass-border);
}

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

.logo-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--accent-primary-glow));
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-glass-border);
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.section-title:hover { color: var(--text-primary); }

.chevron {
  transition: transform var(--transition-fast);
  font-size: 10px;
}

.collapsible:not(.collapsed) ~ .section-title .chevron,
.section-title.open .chevron {
  transform: rotate(90deg);
}

/* ─── Provider Selector ─────────────────────── */
.provider-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238b8ba3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.provider-select:focus {
  border-color: var(--accent-primary);
}

.provider-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.provider-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-danger);
  transition: background var(--transition-fast);
}

.status-dot.connected { background: var(--accent-success); box-shadow: 0 0 6px var(--accent-success); }
.status-dot.disconnected { background: var(--accent-danger); }
.status-dot.pending { background: var(--accent-warning); animation: pulse 1.5s infinite; }

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

.api-key-group {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.input-sm {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 12px;
  outline: none;
}

.input-sm:focus { border-color: var(--accent-primary); }

/* ─── Buttons ───────────────────────────────── */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent-primary);
  color: white;
}
.btn-primary:hover {
  background: #6d28d9;
  box-shadow: 0 4px 12px var(--accent-primary-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--bg-glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

.btn-danger {
  background: var(--accent-danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-glass {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--bg-glass-border);
  backdrop-filter: blur(12px);
}
.btn-glass:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-primary);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 18px;
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

/* ─── Memory Panel ──────────────────────────── */
.collapsible {
  overflow: hidden;
  max-height: 400px;
  transition: max-height var(--transition-smooth);
}

.collapsible.collapsed {
  max-height: 0;
}

.memory-tab-bar {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.memory-tab {
  flex: 1;
  padding: 6px 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.memory-tab.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.memory-tab:hover:not(.active) { color: var(--text-secondary); }

.memory-content {
  max-height: 250px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
}

.memory-item {
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--bg-primary);
  border: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.memory-item:hover { border-color: var(--bg-glass-border); }

.memory-key {
  color: var(--text-accent);
  font-weight: 500;
}

.memory-value {
  color: var(--text-secondary);
}

/* ─── Activity Log ──────────────────────────── */
.log-content {
  max-height: 250px;
  overflow-y: auto;
  font-size: 11px;
}

.log-entry {
  padding: 4px 8px;
  margin-bottom: 2px;
  border-radius: 4px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-family: var(--font-mono);
  line-height: 1.5;
}

.log-time {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.log-action {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.log-action.user_message { background: rgba(124,58,237,0.2); color: var(--accent-primary); }
.log-action.assistant_message { background: rgba(6,182,212,0.2); color: var(--accent-secondary); }
.log-action.tool_call { background: rgba(245,158,11,0.2); color: var(--accent-warning); }
.log-action.tool_result { background: rgba(16,185,129,0.2); color: var(--accent-success); }

.log-detail {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Chat Main ─────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  background: var(--bg-primary);
}

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

/* Welcome Screen */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

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

.welcome-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 24px var(--accent-primary-glow));
  animation: float 3s ease-in-out infinite;
}

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

.welcome-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 32px;
}

.welcome-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 600px;
}

.suggestion-chip {
  padding: 10px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.suggestion-chip:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Message Bubbles */
.message {
  display: flex;
  gap: 12px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

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

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--user-bubble);
}

.message.assistant .message-avatar {
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-glass-border);
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  line-height: 1.7;
  font-size: 14px;
  word-wrap: break-word;
}

.message.user .message-content {
  background: var(--user-bubble);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: var(--assistant-bubble);
  border: 1px solid var(--bg-glass-border);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(8px);
}

/* Markdown in messages */
.message-content h1, .message-content h2, .message-content h3 {
  margin: 12px 0 6px;
  font-weight: 600;
}
.message-content h1 { font-size: 18px; }
.message-content h2 { font-size: 16px; }
.message-content h3 { font-size: 14px; }

.message-content p { margin: 6px 0; }

.message-content code {
  background: rgba(124, 58, 237, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.message-content pre {
  background: var(--bg-primary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}

.message-content pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}

.message-content ul, .message-content ol {
  margin: 6px 0;
  padding-left: 20px;
}

.message-content li { margin: 3px 0; }

.message-content a {
  color: var(--accent-secondary);
  text-decoration: none;
}
.message-content a:hover { text-decoration: underline; }

.message-content strong { color: var(--text-primary); font-weight: 600; }
.message-content em { color: var(--text-secondary); }

.message-content table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  width: 100%;
}

.message-content th, .message-content td {
  border: 1px solid var(--bg-glass-border);
  padding: 6px 10px;
  text-align: left;
}

.message-content th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

/* Tool call / result indicators */
.tool-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent-warning);
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

.tool-indicator.result {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
}

.tool-indicator .tool-name {
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

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

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

@keyframes typing {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* ─── Chat Input ────────────────────────────── */
.chat-input-area {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--bg-glass-border);
  background: linear-gradient(to top, var(--bg-secondary), transparent);
}

.input-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 200px;
  padding: 6px 0;
}

.chat-input::placeholder { color: var(--text-muted); }

.input-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.send-btn {
  width: 36px;
  height: 36px;
  background: var(--accent-primary) !important;
  color: white !important;
  border-radius: 50% !important;
  transition: all var(--transition-fast);
}

.send-btn:hover {
  background: #6d28d9 !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--accent-primary-glow);
}

.stop-btn {
  color: var(--accent-danger) !important;
  font-size: 20px;
}

.input-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── Approval Modal ────────────────────────── */
.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 ease-out;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-body p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.approval-details {
  background: var(--bg-primary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
  color: var(--accent-warning);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ─── Utilities ─────────────────────────────── */
.muted { color: var(--text-muted); font-size: 12px; }
.hidden { display: none !important; }

/* ─── Mobile Header (hidden on desktop) ────── */
.mobile-header {
  display: none; /* hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-glass-border);
  z-index: 200;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.mobile-spacer { flex: 1; }

/* ─── Sidebar Backdrop ──────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 90;
}

.sidebar-backdrop.visible {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.sidebar-close-btn { display: none; }

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

  /* Push app content below mobile header */
  #app {
    padding-top: 52px;
  }

  /* Sidebar as overlay drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    width: 85vw;
    max-width: 320px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    transform: translateX(-100%);
    transition: transform var(--transition-smooth);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.hidden {
    transform: translateX(-100%);
    width: 85vw;
    min-width: 85vw;
    opacity: 1;
  }

  /* Hide desktop toggle, show mobile close */
  #sidebarToggle { display: none; }
  .sidebar-close-btn {
    display: flex;
    font-size: 20px;
    color: var(--text-secondary);
  }

  /* Chat area full width */
  .chat-main {
    width: 100%;
  }

  .chat-messages {
    padding: 16px 12px;
    gap: 12px;
  }

  /* Message bubbles */
  .message { gap: 8px; }

  .message-content {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: var(--radius-md);
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  /* Welcome screen */
  .welcome-icon { font-size: 48px; }
  .welcome-title { font-size: 24px; }
  .welcome-subtitle { font-size: 14px; margin-bottom: 24px; }

  .welcome-suggestions {
    flex-direction: column;
    width: 100%;
    padding: 0 12px;
  }

  .suggestion-chip {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Input area */
  .chat-input-area {
    padding: 10px 12px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .input-container {
    border-radius: var(--radius-md);
    padding: 4px 6px 4px 12px;
  }

  .chat-input {
    font-size: 16px; /* Prevent iOS zoom on focus */
  }

  .send-btn {
    width: 40px;
    height: 40px;
  }

  .input-hint { display: none; }

  /* Tool indicators */
  .tool-indicator {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* Modal */
  .modal {
    width: 95%;
    max-width: none;
    margin: 0 12px;
    padding: 20px;
  }

  /* Memory panel */
  .memory-content { max-height: 200px; }
  .log-content { max-height: 200px; }

  /* Provider section */
  .provider-select { font-size: 14px; padding: 10px 12px; }
}

/* Small phones */
@media (max-width: 380px) {
  .sidebar { width: 100vw; max-width: 100vw; }
  .welcome-title { font-size: 20px; }
  .message-content { max-width: 90%; font-size: 13px; }
}
