/* ╔══════════════════════════════════════════╗
   ║  Chrxmaticc Copilot — Complete Styles   ║
   ║  9 Themes • Glass • Chrome Edition      ║
   ║  Pika Aesthetic • Author: Chrxmee       ║
   ╚══════════════════════════════════════════╝ */

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ═══════════════════════════════════════════
   LOADING SCREEN (Chrome)
   ═══════════════════════════════════════════ */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: #0a0a0a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  opacity: 1; visibility: visible;
}
.loading-screen.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.loading-chrome-ring {
  position: relative;
  width: 100px; height: 100px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(200,200,220,0.12), 0 0 80px rgba(180,180,200,0.06);
  animation: chromePulse 2s ease-in-out infinite;
}
.loading-chrome-ring::before {
  content: '';
  position: absolute; inset: -2px; border-radius: 50%;
  background: linear-gradient(135deg, #666, #aaa, #888, #999, #777, #666);
  background-size: 300% 300%;
  animation: chromeShimmer 2s ease-in-out infinite;
  z-index: -1;
}
.loading-gif {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0.8;
}
.loading-texture-overlay {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: url('chrome2.jpeg') center/cover;
  opacity: 0.15;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.loading-icon-center {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 12px rgba(200,200,220,0.3));
  animation: chromePulse 2s ease-in-out infinite;
  animation-delay: 0.3s;
}
.loading-icon-img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.loading-text {
  font-size: 16px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(135deg, #999, #ccc, #aaa, #bbb, #999);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: chromeShimmer 2s ease-in-out infinite;
}
@keyframes chromePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes chromeShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ═══════════════════════════════════════════
   CHROME AVATARS & ICONS
   ═══════════════════════════════════════════ */
.avatar-icon {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.sidebar-avatar, .sidebar-profile-avatar, #profileAvatar {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}
.topbar-avatar-sm.chrome-logo-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(180,180,200,0.2);
  flex-shrink: 0;
}
.chrome-logo-sm img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.chrome-text {
  background: linear-gradient(135deg, #a0a0a0, #d0d0d0, #b0b0b0, #c8c8c8, #a8a8a8);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: chromeShimmer 3s ease-in-out infinite;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.mini-chat-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.mini-chat-avatar img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.chat-item-avatar {
  width: 36px; height: 36px;
  font-size: 28px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}
.chat-item-avatar img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════
   THEMES (9)
   ═══════════════════════════════════════════ */

/* ── Midnight — Default (Pika Deep) ── */
body.theme-midnight { background: #0a0a0a; color: #e0e0e0; }
.theme-midnight .topbar, .theme-midnight .inputbar, .theme-midnight .sidebar, .theme-midnight .mini-sidebar { background: #0d0d0d; border-color: #1a1a1a; }
.theme-midnight .bubble-row.ai .bubble { background: #141414; color: #e0e0e0; border: 1px solid #1a1a1a; }
.theme-midnight .bubble-row.user .bubble { background: #1a1a2e; color: #e0e0e0; border: 1px solid #2a2a3e; }
.theme-midnight .input-wrap { background: #0f0f0f; border: 1px solid #1a1a1a; border-radius: 24px; }
.theme-midnight .input-wrap:focus-within { border-color: #333; box-shadow: 0 0 20px rgba(150,150,180,0.06); }
.theme-midnight .quick-cmd { background: #0f0f0f; border: 1px solid #1a1a1a; color: #b0b0b0; transition: all 0.2s ease; }
.theme-midnight .quick-cmd:hover { background: #1a1a1a; border-color: #333; color: #e0e0e0; }
.theme-midnight .send-btn { background: linear-gradient(135deg, #3a3a4a, #2a2a3a); box-shadow: 0 0 16px rgba(150,150,200,0.1); }
.theme-midnight .send-btn:hover { box-shadow: 0 0 24px rgba(180,180,220,0.2); }
.theme-midnight .modal-content, .theme-midnight .settings-card, .theme-midnight .landing-card { background: #0d0d0d; border: 1px solid #1a1a1a; }
.theme-midnight .sidebar-new-chat { background: linear-gradient(135deg, #4a4a5a, #3a3a4a); color: #fff; box-shadow: 0 0 16px rgba(150,150,200,0.1); }
.theme-midnight .sidebar-fold, .theme-midnight .mini-sidebar-expand, .theme-midnight .mini-settings { background: #0f0f0f; color: #8e8e93; border: 1px solid #1a1a1a; }
.theme-midnight .mini-new-chat { background: linear-gradient(135deg, #4a4a5a, #3a3a4a); color: #fff; }
.theme-midnight .mini-chat-avatar { background: #141414; }
.theme-midnight .chat-item-actions-btn { color: #8e8e93; }
.theme-midnight .chat-item-actions-btn:hover { background: #1a1a1a; }
.theme-midnight .personality-select { background: #0f0f0f; color: #b0b0b0; border: 1px solid #1a1a1a; border-radius: 10px; }
.theme-midnight .code-block { background: #0a0a0f; border: 1px solid #1a1a1a; border-radius: 12px; }
.theme-midnight .code-header { background: #0d0d14; color: #8e8e93; border-bottom: 1px solid #1a1a1a; }
.theme-midnight .code-block pre { color: #e0e0e0; }
.theme-midnight .inline-code { background: #141414; }
.theme-midnight .code-copy { background: #141414; color: #b0b0b0; border: 1px solid #1a1a1a; }
.theme-midnight .code-copy:hover { background: #1a1a1a; }
.theme-midnight #userInput { color: #e0e0e0; }
.theme-midnight #userInput::placeholder { color: #555; }
.theme-midnight .chat-item:hover, .theme-midnight .chat-item.active { background: #141414; }
.theme-midnight .sidebar-search-input { background: #0f0f0f; border: 1px solid #1a1a1a; color: #e0e0e0; border-radius: 10px; }
.theme-midnight .status-dot { background: #30d158; }
.theme-midnight .settings-row { border-bottom: 1px solid #1a1a1a; }

/* ── Liquid Glass (Apple Style) ── */
body.theme-glass { background: #0a0a0f; color: #e0e0e0; }
.theme-glass .topbar, .theme-glass .inputbar {
  background: rgba(20,20,30,0.5); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-color: rgba(255,255,255,0.06);
}
.theme-glass .sidebar, .theme-glass .mini-sidebar {
  background: rgba(15,15,22,0.6); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-color: rgba(255,255,255,0.06);
}
.theme-glass .bubble-row.ai .bubble {
  background: rgba(30,30,40,0.5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: #e0e0e0; border: 1px solid rgba(255,255,255,0.08);
}
.theme-glass .bubble-row.user .bubble {
  background: rgba(60,60,100,0.4); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: #fff; border: 1px solid rgba(255,255,255,0.1);
}
.theme-glass .input-wrap {
  background: rgba(25,25,35,0.5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 24px;
}
.theme-glass .input-wrap:focus-within { border-color: rgba(255,255,255,0.2); box-shadow: 0 0 30px rgba(150,150,200,0.08); }
.theme-glass .quick-cmd { background: rgba(25,25,35,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.06); color: #b0b0b0; }
.theme-glass .quick-cmd:hover { background: rgba(40,40,55,0.5); border-color: rgba(255,255,255,0.15); }
.theme-glass .send-btn { background: rgba(80,80,120,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 20px rgba(150,150,200,0.1); }
.theme-glass .modal-content, .theme-glass .settings-card, .theme-glass .landing-card { background: rgba(20,20,30,0.6); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid rgba(255,255,255,0.08); }
.theme-glass .sidebar-new-chat { background: rgba(80,80,120,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; }
.theme-glass .mini-new-chat { background: rgba(80,80,120,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; }
.theme-glass .sidebar-fold, .theme-glass .mini-sidebar-expand, .theme-glass .mini-settings { background: rgba(25,25,35,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #b0b0b0; border: 1px solid rgba(255,255,255,0.06); }
.theme-glass .mini-chat-avatar { background: rgba(30,30,40,0.4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.theme-glass .chat-item-actions-btn { color: #b0b0b0; }
.theme-glass .chat-item-actions-btn:hover { background: rgba(255,255,255,0.06); }
.theme-glass .personality-select { background: rgba(25,25,35,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #b0b0b0; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; }
.theme-glass .code-block { background: rgba(15,15,22,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; }
.theme-glass .code-header { background: rgba(20,20,28,0.5); color: #999; border-bottom: 1px solid rgba(255,255,255,0.06); }
.theme-glass .code-block pre { color: #e0e0e0; }
.theme-glass .inline-code { background: rgba(30,30,40,0.4); }
.theme-glass .code-copy { background: rgba(30,30,40,0.4); color: #b0b0b0; border: 1px solid rgba(255,255,255,0.06); }
.theme-glass .code-copy:hover { background: rgba(50,50,65,0.5); }
.theme-glass #userInput { color: #e0e0e0; }
.theme-glass #userInput::placeholder { color: #666; }
.theme-glass .chat-item:hover, .theme-glass .chat-item.active { background: rgba(255,255,255,0.04); }
.theme-glass .sidebar-search-input { background: rgba(25,25,35,0.5); border: 1px solid rgba(255,255,255,0.06); color: #e0e0e0; }
.theme-glass .status-dot { background: #30d158; }
.theme-glass .settings-row { border-bottom: 1px solid rgba(255,255,255,0.06); }
.theme-glass .settings-section-title { color: rgba(255,255,255,0.5); }
.theme-glass .settings-input { background: rgba(25,25,35,0.5); border: 1px solid rgba(255,255,255,0.06); color: #e0e0e0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.theme-glass .settings-select { background: rgba(25,25,35,0.5); color: #e0e0e0; border: 1px solid rgba(255,255,255,0.06); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.theme-glass .settings-textarea { background: rgba(25,25,35,0.5); border: 1px solid rgba(255,255,255,0.06); color: #e0e0e0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ── Dark ── */
body.theme-dark { background: #111; color: #ddd; }
.theme-dark .topbar, .theme-dark .inputbar, .theme-dark .sidebar, .theme-dark .mini-sidebar { background: #1a1a1a; border-color: #2a2a2a; }
.theme-dark .bubble-row.ai .bubble { background: #2a2a2a; color: #ddd; }
.theme-dark .bubble-row.user .bubble { background: #0a84ff; color: #fff; }
.theme-dark .input-wrap { background: #2a2a2a; }
.theme-dark .quick-cmd { background: #2a2a2a; color: #ddd; }
.theme-dark .modal-content, .theme-dark .settings-card, .theme-dark .landing-card { background: #1a1a1a; }
.theme-dark .sidebar-new-chat { background: #0a84ff; color: #fff; }
.theme-dark .sidebar-fold, .theme-dark .mini-sidebar-expand, .theme-dark .mini-settings { background: #2a2a2a; color: #8e8e93; }
.theme-dark .mini-new-chat { background: #0a84ff; color: #fff; }
.theme-dark .mini-chat-avatar { background: #2a2a2a; }
.theme-dark .personality-select { background: #2a2a2a; color: #ddd; border-color: #3a3a3c; }
.theme-dark .code-block { background: #0a0a0a; border-color: #2a2a2a; }
.theme-dark .code-header { background: #1a1a1a; color: #8e8e93; }
.theme-dark .code-block pre { color: #ddd; }
.theme-dark .inline-code { background: #2a2a2a; }
.theme-dark .code-copy { background: #2a2a2a; color: #ddd; }
.theme-dark .code-copy:hover { background: #3a3a3c; }
.theme-dark .status-dot { background: #30d158; }

/* ── White / Light ── */
body.theme-white { background: #f2f2f7; color: #000; }
.theme-white .topbar, .theme-white .inputbar { background: #f9f9f9; border-color: #e0e0e0; }
.theme-white .sidebar, .theme-white .mini-sidebar { background: #f9f9f9; border-color: #e0e0e0; }
.theme-white .sidebar-title, .theme-white .sidebar-item, .theme-white .topbar-name, .theme-white .chat-item-name { color: #000; }
.theme-white .bubble-row.ai .bubble { background: #e9e9ef; color: #000; }
.theme-white .bubble-row.user .bubble { background: #0a84ff; color: #fff; }
.theme-white .input-wrap { background: #e9e9ef; }
.theme-white #userInput { color: #000; }
.theme-white .quick-cmd { background: #e9e9ef; color: #000; }
.theme-white .modal-content, .theme-white .settings-card, .theme-white .landing-card { background: #fff; color: #000; }
.theme-white .settings-section-title, .theme-white .landing-title { color: #000; }
.theme-white .settings-select, .theme-white .modal-input, .theme-white .landing-input { background: #e9e9ef; color: #000; }
.theme-white .sidebar-profile-name { color: #000; }
.theme-white .sidebar-new-chat { background: #0a84ff; color: #fff; }
.theme-white .sidebar-fold, .theme-white .mini-sidebar-expand, .theme-white .mini-settings { background: #e9e9ef; color: #8e8e93; }
.theme-white .mini-new-chat { background: #0a84ff; color: #fff; }
.theme-white .mini-chat-avatar { background: #e9e9ef; }
.theme-white .personality-select { background: #e9e9ef; color: #000; border-color: #d0d0d0; }
.theme-white .code-block { background: #f0f0f0; border-color: #d0d0d0; }
.theme-white .code-header { background: #e0e0e0; color: #666; }
.theme-white .code-block pre { color: #000; }
.theme-white .inline-code { background: #e0e0e0; }
.theme-white .code-copy { background: #e0e0e0; color: #000; }
.theme-white .code-copy:hover { background: #d0d0d0; }
.theme-white .status-dot { background: #30d158; }
.theme-white .settings-input { background: #e9e9ef; border-color: #d0d0d0; color: #000; }
.theme-white .settings-textarea { background: #e9e9ef; border-color: #d0d0d0; color: #000; }

/* ── Cyberpunk ── */
body.theme-cyberpunk { background: #0a0a1a; color: #0ff; }
.theme-cyberpunk .topbar, .theme-cyberpunk .inputbar, .theme-cyberpunk .sidebar, .theme-cyberpunk .mini-sidebar { background: #0f0f2a; border-color: #1a1a3a; }
.theme-cyberpunk .bubble-row.ai .bubble { background: #1a1a3a; color: #0ff; }
.theme-cyberpunk .bubble-row.user .bubble { background: #ff00aa; color: #fff; }
.theme-cyberpunk .input-wrap { background: #1a1a3a; }
.theme-cyberpunk .quick-cmd { background: #1a1a3a; color: #0ff; }
.theme-cyberpunk .send-btn { background: #ff00aa; }
.theme-cyberpunk .modal-content, .theme-cyberpunk .settings-card, .theme-cyberpunk .landing-card { background: #0f0f2a; }
.theme-cyberpunk .sidebar-new-chat, .theme-cyberpunk .mini-new-chat { background: #ff00aa; color: #fff; }
.theme-cyberpunk .sidebar-fold, .theme-cyberpunk .mini-sidebar-expand, .theme-cyberpunk .mini-settings { background: #1a1a3a; color: #0ff; }
.theme-cyberpunk .mini-chat-avatar { background: #1a1a3a; }
.theme-cyberpunk .personality-select { background: #1a1a3a; color: #0ff; border-color: #2a2a4a; }
.theme-cyberpunk .code-block { background: #0a0a2a; border-color: #1a1a3a; }
.theme-cyberpunk .code-header { background: #0f0f2a; color: #0ff; }
.theme-cyberpunk .code-block pre { color: #0ff; }
.theme-cyberpunk .inline-code { background: #1a1a3a; }
.theme-cyberpunk .code-copy { background: #1a1a3a; color: #0ff; }
.theme-cyberpunk .code-copy:hover { background: #2a2a4a; }
.theme-cyberpunk .status-dot { background: #0ff; }

/* ── Chrome ── */
body.theme-chrome { background: #1a1a1a; color: #e0e0e0; }
.theme-chrome .topbar, .theme-chrome .inputbar, .theme-chrome .sidebar, .theme-chrome .mini-sidebar { background: #222; border-color: #333; }
.theme-chrome .bubble-row.ai .bubble { background: #333; color: #e0e0e0; }
.theme-chrome .bubble-row.user .bubble { background: #888; color: #fff; }
.theme-chrome .input-wrap { background: #333; }
.theme-chrome .quick-cmd { background: #333; color: #e0e0e0; }
.theme-chrome .send-btn { background: #888; }
.theme-chrome .modal-content, .theme-chrome .settings-card, .theme-chrome .landing-card { background: #222; }
.theme-chrome .sidebar-new-chat, .theme-chrome .mini-new-chat { background: #888; color: #fff; }
.theme-chrome .sidebar-fold, .theme-chrome .mini-sidebar-expand, .theme-chrome .mini-settings { background: #333; color: #e0e0e0; }
.theme-chrome .mini-chat-avatar { background: #333; }
.theme-chrome .personality-select { background: #333; color: #e0e0e0; border-color: #444; }
.theme-chrome .code-block { background: #111; border-color: #333; }
.theme-chrome .code-header { background: #222; color: #999; }
.theme-chrome .code-block pre { color: #e0e0e0; }
.theme-chrome .inline-code { background: #333; }
.theme-chrome .code-copy { background: #333; color: #e0e0e0; }
.theme-chrome .code-copy:hover { background: #444; }
.theme-chrome .status-dot { background: #aaa; }

/* ── Ocean ── */
body.theme-ocean { background: #0a1a2e; color: #b8d8f0; }
.theme-ocean .topbar, .theme-ocean .inputbar, .theme-ocean .sidebar, .theme-ocean .mini-sidebar { background: #0f2035; border-color: #1a3050; }
.theme-ocean .bubble-row.ai .bubble { background: #1a3050; color: #b8d8f0; }
.theme-ocean .bubble-row.user .bubble { background: #0077b6; color: #fff; }
.theme-ocean .input-wrap { background: #1a3050; }
.theme-ocean .quick-cmd { background: #1a3050; color: #b8d8f0; }
.theme-ocean .send-btn { background: #0077b6; }
.theme-ocean .modal-content, .theme-ocean .settings-card, .theme-ocean .landing-card { background: #0f2035; }
.theme-ocean .sidebar-new-chat, .theme-ocean .mini-new-chat { background: #0077b6; color: #fff; }
.theme-ocean .sidebar-fold, .theme-ocean .mini-sidebar-expand, .theme-ocean .mini-settings { background: #1a3050; color: #b8d8f0; }
.theme-ocean .mini-chat-avatar { background: #1a3050; }
.theme-ocean .personality-select { background: #1a3050; color: #b8d8f0; border-color: #2a4060; }
.theme-ocean .code-block { background: #0a1a2e; border-color: #1a3050; }
.theme-ocean .code-header { background: #0f2035; color: #b8d8f0; }
.theme-ocean .code-block pre { color: #b8d8f0; }
.theme-ocean .inline-code { background: #1a3050; }
.theme-ocean .code-copy { background: #1a3050; color: #b8d8f0; }
.theme-ocean .code-copy:hover { background: #2a4060; }
.theme-ocean .status-dot { background: #00b4d8; }

/* ── Forest ── */
body.theme-forest { background: #0a1a0a; color: #b8e0b8; }
.theme-forest .topbar, .theme-forest .inputbar, .theme-forest .sidebar, .theme-forest .mini-sidebar { background: #0f200f; border-color: #1a301a; }
.theme-forest .bubble-row.ai .bubble { background: #1a301a; color: #b8e0b8; }
.theme-forest .bubble-row.user .bubble { background: #2d8a2d; color: #fff; }
.theme-forest .input-wrap { background: #1a301a; }
.theme-forest .quick-cmd { background: #1a301a; color: #b8e0b8; }
.theme-forest .send-btn { background: #2d8a2d; }
.theme-forest .modal-content, .theme-forest .settings-card, .theme-forest .landing-card { background: #0f200f; }
.theme-forest .sidebar-new-chat, .theme-forest .mini-new-chat { background: #2d8a2d; color: #fff; }
.theme-forest .sidebar-fold, .theme-forest .mini-sidebar-expand, .theme-forest .mini-settings { background: #1a301a; color: #b8e0b8; }
.theme-forest .mini-chat-avatar { background: #1a301a; }
.theme-forest .personality-select { background: #1a301a; color: #b8e0b8; border-color: #2a402a; }
.theme-forest .code-block { background: #0a1a0a; border-color: #1a301a; }
.theme-forest .code-header { background: #0f200f; color: #b8e0b8; }
.theme-forest .code-block pre { color: #b8e0b8; }
.theme-forest .inline-code { background: #1a301a; }
.theme-forest .code-copy { background: #1a301a; color: #b8e0b8; }
.theme-forest .code-copy:hover { background: #2a402a; }
.theme-forest .status-dot { background: #30d158; }

/* ── Sunset ── */
body.theme-sunset { background: #1a0a0a; color: #f0c8b8; }
.theme-sunset .topbar, .theme-sunset .inputbar, .theme-sunset .sidebar, .theme-sunset .mini-sidebar { background: #200f0f; border-color: #301a1a; }
.theme-sunset .bubble-row.ai .bubble { background: #301a1a; color: #f0c8b8; }
.theme-sunset .bubble-row.user .bubble { background: #e85d26; color: #fff; }
.theme-sunset .input-wrap { background: #301a1a; }
.theme-sunset .quick-cmd { background: #301a1a; color: #f0c8b8; }
.theme-sunset .send-btn { background: #e85d26; }
.theme-sunset .modal-content, .theme-sunset .settings-card, .theme-sunset .landing-card { background: #200f0f; }
.theme-sunset .sidebar-new-chat, .theme-sunset .mini-new-chat { background: #e85d26; color: #fff; }
.theme-sunset .sidebar-fold, .theme-sunset .mini-sidebar-expand, .theme-sunset .mini-settings { background: #301a1a; color: #f0c8b8; }
.theme-sunset .mini-chat-avatar { background: #301a1a; }
.theme-sunset .personality-select { background: #301a1a; color: #f0c8b8; border-color: #402a2a; }
.theme-sunset .code-block { background: #1a0a0a; border-color: #301a1a; }
.theme-sunset .code-header { background: #200f0f; color: #f0c8b8; }
.theme-sunset .code-block pre { color: #f0c8b8; }
.theme-sunset .inline-code { background: #301a1a; }
.theme-sunset .code-copy { background: #301a1a; color: #f0c8b8; }
.theme-sunset .code-copy:hover { background: #402a2a; }
.theme-sunset .status-dot { background: #ff6b35; }

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
#app { display: flex; height: 100%; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; left: -320px; top: 0; bottom: 0; width: 300px;
  z-index: 100; transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2);
  display: flex; flex-direction: column; padding: 16px; overflow-y: auto;
}
.sidebar.open { left: 0; }
.sidebar-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sidebar-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.sidebar-close { margin-left: auto; background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; }
.sidebar-actions-row { display: flex; gap: 8px; padding: 0 0 12px 0; }
.sidebar-new-chat {
  width: 36px; height: 36px; border-radius: 50%; border: none; font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, background 0.2s; flex-shrink: 0;
}
.sidebar-new-chat:active { transform: scale(0.9) rotate(90deg); }
.sidebar-fold {
  width: 36px; height: 36px; border-radius: 50%; border: none; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s; flex-shrink: 0;
}
.sidebar-fold:active { transform: scale(0.9); }
.sidebar-search { margin-bottom: 12px; }
.sidebar-search-input {
  width: 100%; padding: 8px 12px; border: none;
  font-size: 14px; border-radius: 10px;
}
.sidebar-chats { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  cursor: pointer; transition: background 0.15s; margin-bottom: 2px;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 15px; font-weight: 500; }
.chat-item-preview { font-size: 13px; color: #8e8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 11px; color: #8e8e93; flex-shrink: 0; }
.chat-item-actions-btn {
  background: none; border: none; font-size: 16px; cursor: pointer;
  padding: 4px 8px; border-radius: 50%; flex-shrink: 0; transition: background 0.15s;
}
.sidebar-footer { border-top: 1px solid #2c2c2e; padding-top: 12px; margin-top: 8px; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; }
.sidebar-profile-name { font-size: 15px; font-weight: 500; }
.sidebar-profile-status { font-size: 12px; color: #8e8e93; }

/* ── MINI SIDEBAR ── */
.mini-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 52px;
  z-index: 101; display: none; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 8px; border-right: 1px solid #2c2c2e;
}
.mini-sidebar.visible { display: flex; animation: slideIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1.2); }
@keyframes slideIn { from { transform: translateX(-60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.mini-sidebar-expand, .mini-new-chat, .mini-settings {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.mini-new-chat { font-size: 18px; }
.mini-sidebar-expand:active, .mini-new-chat:active, .mini-settings:active { transform: scale(0.9); }
.mini-avatars { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; padding: 4px 0; }
.mini-chat-avatar:active { transform: scale(0.85); }
.mini-sidebar.visible ~ .main { margin-left: 52px; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; }
.overlay.visible { display: block; }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; max-width: 600px; margin: 0 auto; width: 100%; transition: margin-left 0.3s; }

.topbar {
  padding: 10px 12px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid #2c2c2e; flex-shrink: 0;
}
.topbar-btn { background: none; border: none; color: #0a84ff; font-size: 20px; cursor: pointer; padding: 4px; display: flex; align-items: center; gap: 4px; }
.topbar-back { font-size: 28px; line-height: 1; }
.topbar-center { flex: 1; cursor: pointer; }
.topbar-name { font-size: 16px; font-weight: 600; }
.topbar-status { font-size: 12px; color: #8e8e93; display: flex; align-items: center; gap: 4px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-dot.thinking { background: #ff9f0a; animation: pulse 1s infinite; }
.status-dot.offline { background: #ff453a; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── PERSONALITY SELECTOR ── */
.personality-select {
  border-radius: 8px; padding: 4px 8px; font-size: 12px; cursor: pointer;
  max-width: 110px; -webkit-appearance: none; appearance: none; border: 1px solid;
}

/* ── MESSAGES ── */
.messages { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.messages::-webkit-scrollbar { display: none; }

.bubble-row { display: flex; flex-direction: column; max-width: 82%; animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bubble-row.user { align-self: flex-end; align-items: flex-end; }
.bubble-row.ai { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.4;
  word-break: break-word; white-space: pre-wrap;
}
.bubble-row.user .bubble { border-bottom-right-radius: 4px; }
.bubble-row.ai .bubble { border-bottom-left-radius: 4px; }
.timestamp { font-size: 11px; color: #8e8e93; margin: 2px 6px; }
.provider-badge { font-size: 10px; color: #8e8e93; margin: 2px 6px; font-style: italic; }

.quick-commands { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; align-self: center; }
.quick-cmd { padding: 8px 14px; border-radius: 20px; border: none; font-size: 14px; cursor: pointer; transition: transform 0.1s, background 0.2s, color 0.2s; }
.quick-cmd:active { transform: scale(0.95); }

.typing-indicator { display: none; align-self: flex-start; padding: 12px 16px; gap: 5px; }
.typing-indicator.visible { display: flex; }
.dot { width: 7px; height: 7px; background: #8e8e93; border-radius: 50%; animation: bounce 1.2s infinite; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

.command-hint { align-self: center; background: #1a1a2e; color: #8e8e93; border-radius: 12px; padding: 6px 12px; font-size: 11px; text-align: center; margin: 4px 0; }
.error-bubble { align-self: center; background: #3a1a1a; color: #ff453a; border-radius: 12px; padding: 8px 14px; font-size: 13px; text-align: center; animation: popIn 0.3s ease; }

/* ── CODE BLOCKS ── */
.code-block {
  border-radius: 10px; margin: 8px 0; overflow: hidden; border: 1px solid;
}
.code-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; font-size: 11px;
}
.code-copy {
  border: none; padding: 3px 8px; border-radius: 6px; font-size: 10px;
  cursor: pointer; transition: background 0.15s;
}
.code-block pre {
  padding: 12px; margin: 0; overflow-x: auto; font-size: 13px; line-height: 1.5;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  white-space: pre-wrap; word-break: break-word;
}
.inline-code {
  padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; font-size: 13px;
}

/* ── CONFETTI ── */
.confetti-canvas { position: fixed; inset: 0; z-index: 999; pointer-events: none; display: none; }

/* ── INPUT BAR ── */
.inputbar {
  padding: 10px 12px; border-top: 1px solid #2c2c2e;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.input-wrap { flex: 1; border-radius: 20px; display: flex; align-items: center; padding: 0 14px; min-height: 36px; }
#userInput {
  background: transparent; border: none; outline: none; font-size: 16px;
  font-family: inherit; width: 100%; resize: none; max-height: 100px; padding: 8px 0; line-height: 1.4;
}
.input-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; }
.send-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.1s;
}
.send-btn:disabled { background: #3a3a3c; cursor: default; }
.send-btn svg { width: 16px; height: 16px; fill: #fff; }
.mic-status { display: none; text-align: center; color: #ff453a; font-size: 13px; padding: 6px; align-items: center; justify-content: center; gap: 6px; }
.mic-status.visible { display: flex; }
.mic-pulse { width: 8px; height: 8px; background: #ff453a; border-radius: 50%; animation: pulse 0.8s infinite; }

/* ── MODALS ── */
.modal { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; }
.modal.visible { display: flex; }
.modal-content { border-radius: 20px; padding: 24px; width: 340px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; }
.modal-btn { width: 100%; padding: 12px; border-radius: 12px; border: none; cursor: pointer; font-size: 16px; margin-bottom: 6px; background: #2c2c2e; color: #fff; text-align: left; }
.modal-btn.primary { background: #0a84ff; }
.modal-btn.text { background: none; color: #8e8e93; text-align: center; }
.modal-input { width: 100%; padding: 10px; border-radius: 10px; background: #2c2c2e; border: 1px solid #3a3a3c; color: #fff; font-size: 16px; margin-bottom: 10px; }

/* ═══════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════ */
.settings-container { max-width: 500px; margin: 0 auto; padding: 16px; height: 100%; overflow-y: auto; }
.settings-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.settings-back { background: none; border: none; color: #0a84ff; font-size: 18px; cursor: pointer; }
.settings-title { font-size: 24px; font-weight: 700; }
.settings-section { margin-bottom: 24px; }
.settings-section-title { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; font-weight: 600; }
.settings-card { border-radius: 16px; padding: 4px 0; overflow: hidden; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; font-size: 15px; transition: background 0.15s; }
.settings-row:hover { background: rgba(255,255,255,0.02); }
.settings-value { color: #8e8e93; font-size: 14px; }
.settings-btn { width: 100%; padding: 12px; border-radius: 12px; border: none; background: #2c2c2e; color: #fff; font-size: 15px; cursor: pointer; margin-top: 8px; transition: background 0.2s; }
.settings-btn:hover { background: #3a3a3c; }
.settings-btn.danger { background: #3a1a1a; color: #ff453a; }
.settings-btn.danger:hover { background: #4a2020; }
.settings-select { width: 100%; padding: 12px; border-radius: 12px; border: none; font-size: 15px; cursor: pointer; }
.settings-input { padding: 8px 12px; border-radius: 8px; font-size: 14px; width: 180px; text-align: right; }
.settings-textarea { width: 100%; padding: 12px; border-radius: 10px; font-size: 14px; resize: vertical; min-height: 80px; font-family: inherit; }
.settings-disclaimer { font-size: 11px; color: #ff9f0a; margin-top: 4px; line-height: 1.4; padding: 4px 0; }

.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.avatar-option { font-size: 28px; padding: 8px; border-radius: 12px; border: 2px solid transparent; background: #2c2c2e; cursor: pointer; transition: border 0.2s; }
.avatar-option:hover { border-color: #0a84ff; }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-option { padding: 14px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; font-size: 14px; color: #fff; text-align: left; transition: border 0.2s, transform 0.15s; }
.theme-option:hover { border-color: #0a84ff; transform: translateY(-1px); }
.theme-option.theme-midnight { background: #0a0a0a; }
.theme-option.theme-dark { background: #111; }
.theme-option.theme-white { background: #f2f2f7; color: #000; }
.theme-option.theme-glass { background: rgba(20,20,30,0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); }
.theme-option.theme-cyberpunk { background: #0a0a1a; color: #0ff; }
.theme-option.theme-chrome { background: #1a1a1a; }
.theme-option.theme-ocean { background: #0a1a2e; color: #b8d8f0; }
.theme-option.theme-forest { background: #0a1a0a; color: #b8e0b8; }
.theme-option.theme-sunset { background: #1a0a0a; color: #f0c8b8; }

.background-presets { display: flex; gap: 8px; padding: 8px 16px; }
.bg-preset { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: border 0.2s; }
.bg-preset:hover { border-color: #0a84ff; }

/* ═══════════════════════════════════════════
   ATTACHMENT & FILE PREVIEW
   ═══════════════════════════════════════════ */
.attachment-btn { font-size: 18px; }
.file-preview { display: none; padding: 8px 12px; background: #1c1c1e; border-top: 1px solid #2c2c2e; align-items: center; gap: 8px; }
.file-preview.visible { display: flex; }
.preview-img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.preview-vid { width: 120px; height: 60px; border-radius: 8px; object-fit: cover; }
.preview-file { font-size: 13px; color: #8e8e93; flex: 1; }
.file-preview button { background: #3a1a1a; color: #ff453a; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 12px; }

/* ═══════════════════════════════════════════
   MEDIA BUBBLES
   ═══════════════════════════════════════════ */
.media-bubble { padding: 8px !important; background: transparent !important; max-width: 280px; }
.media-bubble img { width: 100%; border-radius: 12px; cursor: pointer; display: block; }
.media-bubble video { width: 100%; border-radius: 12px; max-height: 300px; }
.media-actions { display: flex; gap: 6px; margin-top: 6px; }
.media-actions button { flex: 1; padding: 6px 10px; border-radius: 8px; border: none; background: #2c2c2e; color: #fff; font-size: 11px; cursor: pointer; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 400px) {
  .bubble { font-size: 15px; padding: 8px 12px; }
  .quick-cmd { font-size: 12px; padding: 6px 10px; }
  .landing-card { padding: 24px 16px; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .mini-sidebar.visible ~ .main { margin-left: 52px; }
  .personality-select { max-width: 90px; font-size: 11px; }
  .media-bubble { max-width: 240px; }
  .media-actions button { font-size: 10px; padding: 4px 8px; }
  .file-preview { padding: 6px 10px; }
}
