/* ============================================
   Cognos — Design System & Styles
   ============================================ */

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

/* --- Theme Tokens --- */
:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;

  /* Spacing */
  --nav-height: 48px;
  --chat-max-width: 800px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Theme (Default) --- */
[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #121212;
  --bg-elevated: #0f0f0f;
  --surface: #141414;
  --surface-hover: #1f1f1f;
  --surface-active: #292929;
  --border: #222222;
  --border-subtle: #171717;
  --border-focus: #9333ea; /* Vibrant Purple */

  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-tertiary: #737373;
  --text-inverse: #000000;

  --accent: #a855f7;
  --accent-hover: #9333ea;
  --accent-muted: rgba(168, 85, 247, 0.15);
  --accent-glow: rgba(168, 85, 247, 0.1);

  --user-msg-bg: #111113;
  --ai-msg-bg: transparent;

  --code-bg: #0a0a0a;
  --code-header-bg: #141414;
  --code-text: #e4e4e7;
  --code-border: #27272a;

  --input-bg: #141416;
  --input-border: #27272a;
  --input-focus-border: #3f3f46;
  --input-placeholder: #52525b;

  --modal-bg: #141416;
  --modal-overlay: rgba(0, 0, 0, 0.7);

  --scrollbar-track: transparent;
  --scrollbar-thumb: #27272a;
  --scrollbar-thumb-hover: #3f3f46;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.1);

  color-scheme: dark;
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --surface-active: #e5e7eb;
  --border: #e5e7eb;
  --border-subtle: #f3f4f6;
  --border-focus: #7c3aed;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;

  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-muted: rgba(124, 58, 237, 0.08);
  --accent-glow: rgba(124, 58, 237, 0.05);

  --user-msg-bg: #f3f0ff;
  --ai-msg-bg: transparent;

  --code-bg: #f8f8fa;
  --code-header-bg: #f0f0f2;
  --code-text: #1f2937;
  --code-border: #e5e7eb;

  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-focus-border: #7c3aed;
  --input-placeholder: #9ca3af;

  --modal-bg: #ffffff;
  --modal-overlay: rgba(0, 0, 0, 0.4);

  --scrollbar-track: transparent;
  --scrollbar-thumb: #d1d5db;
  --scrollbar-thumb-hover: #9ca3af;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.06);

  color-scheme: light;
}

/* --- Base Styles --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--accent-muted);
  color: var(--text-primary);
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Utility */
.hidden {
  display: none !important;
}

/* ============================================
   Navigation — Apple-Level Premium
   ============================================ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 48px;
  background: rgba(12,12,14,0.82);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
[data-theme="light"] #navbar {
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.nav-left { display: flex; align-items: center; gap: 6px; }
.nav-right { display: flex; align-items: center; gap: 4px; }

.nav-brand {
  display: flex; align-items: center; gap: 7px;
  text-decoration: none; color: var(--text-primary); flex-shrink: 0;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
}
.nav-brand:hover { text-decoration: none; }
.nav-logo-img { flex-shrink: 0; border-radius: 5px; width: 24px; height: 24px; }

.btn-ghost {
  height: 30px; padding: 0 12px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-primary); }

.btn-primary {
  height: 30px; padding: 0 14px; border-radius: 6px; border: none;
  background: var(--accent); color: #fff;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.12); }

.btn-icon {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: transparent;
  color: var(--text-tertiary); cursor: pointer; transition: all 0.15s ease;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text-primary); }

.nav-auth-buttons { display: flex; align-items: center; gap: 6px; margin-left: 4px; }

/* Mobile menu toggle */
.btn-toggle-sidebar svg { transition: transform 0.2s ease; }
.sidebar.open ~ .btn-toggle-sidebar svg { transform: rotate(90deg); }

/* ============================================
   Sidebar — Premium Minimal
   ============================================ */
.sidebar {
  position: fixed; top: 0; left: 0; width: 260px; height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  z-index: 90; transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column; will-change: transform;
}
.sidebar.open {
  transform: translateX(0); box-shadow: 16px 0 48px rgba(0,0,0,0.4);
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px; flex-shrink: 0; gap: 8px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  padding: 8px; border-radius: 8px;
  transition: background 0.15s ease;
}
.sidebar-brand:hover { background: var(--surface-hover); }
.sidebar-brand img { width: 20px; height: 20px; border-radius: 4px; }
.btn-close-sidebar { flex-shrink: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }

/* Sidebar Menu */
.sidebar-menu {
  padding: 8px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px;
}
.sidebar-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 12px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; cursor: pointer;
  text-align: left; transition: all var(--transition-fast);
  position: relative; overflow: hidden;
}

.sidebar-menu-item:hover {
  background: var(--surface-hover); color: var(--text-primary);
}

.sidebar-menu-item:active {
  transform: scale(0.98);
}

.sidebar-menu-new {
  color: var(--accent); font-weight: 550;
  background: rgba(168, 85, 247, 0.05);

}
.sidebar-menu-new:hover { background: rgba(139,92,246,0.1); color: #c4b5fd; }

.smi-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  color: var(--text-tertiary);
}
.sidebar-menu-item:hover .smi-icon {
  background: rgba(139,92,246,0.12); color: #a78bfa;
  box-shadow: 0 2px 8px rgba(139,92,246,0.12); transform: scale(1.05);
}
.smi-label { flex: 1; font-size: 13px; }
.smi-dots svg { opacity: 0.45; }
.sidebar-menu-item:hover .smi-dots svg { opacity: 0.7; }

/* Sidebar Dividers */
.sidebar-divider { height: 1px; background: var(--border-subtle); margin: 6px 12px; flex-shrink: 0; }

/* Sidebar Section (Recents) */
.sidebar-section { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.sidebar-section-head {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px 4px; flex-shrink: 0;
}
.sidebar-section-icon { color: var(--text-tertiary); display: flex; }
.sidebar-section-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-tertiary); flex: 1;
}

.nav-brand-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Logo theme visibility */
[data-theme="light"] .logo-theme-light { display: block; }
[data-theme="light"] .logo-theme-dark { display: none; }



/* Nav Buttons */
.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.btn-icon:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.btn-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-new-chat {
  background: var(--surface-hover);
  color: var(--text-secondary);
  margin-left: 6px;
}
.btn-new-chat:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

/* Theme Toggle Icons */
[data-theme="dark"] .icon-sun { display: none !important; }
[data-theme="dark"] .icon-moon { display: block !important; }
[data-theme="light"] .icon-sun { display: block !important; }
[data-theme="light"] .icon-moon { display: none !important; }

/* Navbar premium redesign */
#navbar {
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] #navbar {
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75), 0 14px 38px rgba(17, 24, 39, 0.07);
}
.nav-inner {
  height: 100%;
  padding: 0 18px 0 14px;
  gap: 16px;
}
.nav-left {
  gap: 10px;
  min-width: 0;
}
.nav-right {
  gap: 10px;
  flex-shrink: 0;
}
.nav-brand {
  height: 36px;
  padding: 0 8px;
  gap: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.nav-brand:hover {
  background: var(--surface-hover);
}
[data-theme="light"] .nav-brand:hover {
  background: var(--surface-hover);
}
.nav-logo-img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.18);
}
.nav-brand-text {
  font-size: 15px;
  font-weight: 680;
  letter-spacing: 0;
}
.nav-auth-buttons {
  gap: 8px;
  margin-left: 2px;
}
.nav-auth-buttons .btn-nav {
  height: 36px;
  padding: 0 15px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}
.nav-auth-buttons .btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
}
.nav-auth-buttons .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--text-primary);
  transform: translateY(-1px);
}
[data-theme="light"] .nav-auth-buttons .btn-ghost {
  border-color: rgba(17, 24, 39, 0.09);
  background: rgba(17, 24, 39, 0.025);
}
[data-theme="light"] .nav-auth-buttons .btn-ghost:hover {
  background: rgba(17, 24, 39, 0.055);
  border-color: rgba(17, 24, 39, 0.14);
}
.nav-auth-buttons .btn-primary {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #f5f3ff 0%, #c4b5fd 15%, #8b5cf6 48%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.nav-auth-buttons .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.36) 42%, transparent 62%);
  transform: translateX(-130%);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-auth-buttons .btn-primary:hover {
  background: linear-gradient(135deg, #ffffff 0%, #ddd6fe 13%, #9b6cff 48%, #6d5df6 100%);
  box-shadow: 0 13px 34px rgba(99, 102, 241, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  filter: saturate(1.06);
  transform: translateY(-1px);
}
.nav-auth-buttons .btn-primary:hover::before {
  transform: translateX(130%);
}
.nav-auth-buttons .btn-primary:active,
.nav-auth-buttons .btn-ghost:active {
  transform: translateY(0) scale(0.98);
}
.btn-new-chat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  margin-left: 4px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  background: rgba(139, 92, 246, 0.08);
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 550;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-new-chat:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.35);
  color: #ddd6fe;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.12);
}
.btn-new-chat svg {
  flex-shrink: 0;
  opacity: 0.9;
}
.btn-theme {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.btn-theme:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.btn-theme:active {
  transform: translateY(0) scale(0.96);
}
[data-theme="light"] .btn-theme {
  border-color: rgba(17, 24, 39, 0.09);
  background: rgba(17, 24, 39, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
[data-theme="light"] .btn-theme:hover {
  background: rgba(17, 24, 39, 0.055);
  border-color: rgba(17, 24, 39, 0.14);
}

/* Mobile */
.mobile-only {
  display: none;
}

/* ============================================
   Model Selector — Apple-level Premium
   ============================================ */
.model-picker {
  position: relative;
  display: flex;
  align-items: center;
  user-select: none;
}
.model-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  color: rgba(255,255,255,0.55);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
}
.model-trigger:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
}
.model-trigger:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.model-trigger.open {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.model-trigger-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #6366f1;
  transition: background 0.3s ease;
}
.model-chevron {
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}
.model-trigger.open .model-chevron {
  transform: rotate(180deg);
  opacity: 0.8;
}

/* Dropdown */
.model-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  padding: 6px;
  background: rgba(22, 22, 35, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
  z-index: 300;
  animation: model-dropdown-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top right;
}
@keyframes model-dropdown-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.model-picker.open .model-dropdown {
  display: block;
}

/* Option items */
.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  transition: background 0.18s ease;
  color: rgba(255,255,255,0.7);
}
.model-option:hover {
  background: rgba(255,255,255,0.06);
}
.model-option.selected {
  background: rgba(99, 102, 241, 0.08);
}
.model-option.selected .model-option-name {
  font-weight: 600;
}
.model-option:not(:last-child) {
  margin-bottom: 2px;
}
.model-option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(99,102,241,0.2);
}
.model-option-code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.45);
  min-width: 22px;
  flex-shrink: 0;
}
.model-option-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.model-option-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
}
.model-option-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Selected state indicator */
.model-option-check {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.model-option.selected .model-option-check {
  opacity: 1;
}

/* Light theme */
[data-theme="light"] .model-trigger {
  border-color: rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  color: rgba(0,0,0,0.45);
}
[data-theme="light"] .model-trigger:hover {
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  color: rgba(0,0,0,0.7);
}
[data-theme="light"] .model-trigger.open {
  border-color: rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.06);
  color: #000;
}
[data-theme="light"] .model-dropdown {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}
[data-theme="light"] .model-option {
  color: rgba(0,0,0,0.6);
}
[data-theme="light"] .model-option:hover {
  background: rgba(0,0,0,0.04);
}
[data-theme="light"] .model-option-code {
  color: rgba(0,0,0,0.35);
}
[data-theme="light"] .model-option-name {
  color: #000;
}
[data-theme="light"] .model-option-desc {
  color: rgba(0,0,0,0.4);
}
[data-theme="light"] .model-option.selected {
  background: rgba(99, 102, 241, 0.08);
}



/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--modal-overlay);
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 200ms ease-out;
}

.mobile-menu-panel {
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideInRight 250ms ease-out;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  width: 100%;
  text-align: left;
}
.mobile-menu-item:hover {
  background: var(--surface-hover);
}

/* ============================================
   Views
   ============================================ */
.view {
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.view.transitioning-out {
  animation: viewFadeOut 300ms ease-in forwards;
}

.view.transitioning-in {
  animation: viewFadeIn 350ms ease-out forwards;
}

/* ============================================
   Home View
   ============================================ */
#home-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
}

.home-container {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* Workspace Welcome */
.home-welcome {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.welcome-title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Home Input */
.home-input-wrapper {
  width: 100%;
}

/* Prompt Cards */
.prompt-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

.prompt-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  transition: all var(--transition-base);
  color: var(--text-primary);
}

.prompt-card:hover {
  background: var(--surface-hover);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 16px rgba(168, 85, 247, 0.15);
  transform: translateY(-2px);
}

.prompt-card:active {
  transform: translateY(0) scale(0.98);
}

.prompt-card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.prompt-card-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.prompt-card:hover .prompt-card-icon {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.24), rgba(99, 102, 241, 0.13));
  color: #ddd6fe;
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.22), 0 10px 28px rgba(99, 102, 241, 0.14);
  transform: translateY(-1px) scale(1.03);
}

.prompt-card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.prompt-card-title {
  font-size: 13.75px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--text-primary);
}

.prompt-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

[data-theme="light"] .prompt-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.92));
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 24px rgba(17, 24, 39, 0.045);
}

[data-theme="light"] .prompt-card:hover {
  border-color: rgba(124, 58, 237, 0.24);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08), 0 0 0 1px rgba(124, 58, 237, 0.055), 0 0 22px rgba(124, 58, 237, 0.07);
}

[data-theme="light"] .prompt-card-icon {
  color: #7c3aed;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(99, 102, 241, 0.055));
}

/* ============================================
   Chat Input (Shared)
   ============================================ */
.chat-input-form {
  width: 100%;
}

.chat-input-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px 8px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chat-input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent), 0 4px 16px rgba(99, 102, 241, 0.1);
}

.chat-textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  outline: none;
  max-height: 200px;
  padding: 6px 0;
}
.chat-textarea::placeholder {
  color: var(--input-placeholder);
}

.btn-send {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
.btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.btn-send:disabled {
  opacity: 0.2;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.btn-send.streaming {
  background: var(--surface-active);
  color: var(--text-primary);
  box-shadow: none;
}
.btn-send.streaming:hover {
  background: var(--surface-hover);
  transform: none;
}

/* ============================================
   Input Tool Buttons
   ============================================ */
.btn-input-tool {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  background: transparent;
  color: var(--text-tertiary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.btn-input-tool:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}
.btn-input-tool:active {
  transform: scale(0.95);
}
.btn-input-tool svg {
  transition: transform 0.2s ease;
}
.btn-input-tool:hover svg {
  transform: scale(1.1);
}

/* Homepage flagship input */
#home-view .home-input-wrapper {
  position: relative;
}

#home-view .home-input-wrapper::before {
  content: '';
  position: absolute;
  inset: -18px -20px;
  z-index: -1;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 45%, rgba(139, 92, 246, 0.16), transparent 64%);
  opacity: 0.55;
  filter: blur(18px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

#home-view .home-input-wrapper:hover::before,
#home-view .home-input-wrapper:focus-within::before {
  opacity: 0.9;
  transform: scale(1.015);
}

#home-view .chat-input-form {
  position: relative;
}

#home-view .chat-input-container {
  position: relative;
  align-items: center;
  min-height: 66px;
  padding: 10px 12px 10px 16px;
  gap: 7px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-base);
}

#home-view .chat-input-container:hover {
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(168, 85, 247, 0.1);
}

#home-view .chat-input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent), 0 0 0 4px rgba(168, 85, 247, 0.15);
}

[data-theme="light"] #home-view .chat-input-container {
  border-color: rgba(17, 24, 39, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.96));
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.1), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

[data-theme="light"] #home-view .chat-input-container:hover {
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: 0 20px 56px rgba(17, 24, 39, 0.13), 0 0 0 1px rgba(124, 58, 237, 0.055), 0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

[data-theme="light"] #home-view .chat-input-container:focus-within {
  border-color: rgba(124, 58, 237, 0.52);
  box-shadow: 0 24px 68px rgba(17, 24, 39, 0.15), 0 0 0 1px rgba(124, 58, 237, 0.18), 0 0 0 5px rgba(124, 58, 237, 0.07), 0 1px 0 rgba(255, 255, 255, 1) inset;
}

#home-view .chat-textarea {
  font-size: 16.5px;
  line-height: 1.5;
  padding: 9px 0;
  min-height: 42px;
}

#home-view .chat-textarea::placeholder {
  color: rgba(212, 212, 216, 0.52);
  font-weight: 450;
  letter-spacing: 0;
  transition: color 0.2s ease;
}

#home-view .chat-input-container:focus-within .chat-textarea::placeholder {
  color: rgba(212, 212, 216, 0.36);
}

[data-theme="light"] #home-view .chat-textarea::placeholder {
  color: rgba(107, 114, 128, 0.68);
}

[data-theme="light"] #home-view .chat-input-container:focus-within .chat-textarea::placeholder {
  color: rgba(107, 114, 128, 0.48);
}

#home-view .btn-input-tool {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: var(--text-tertiary);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

#home-view .btn-input-tool:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
  transform: translateY(-1px);
}

[data-theme="light"] #home-view .btn-input-tool:hover {
  background: rgba(17, 24, 39, 0.055);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.045);
}

#home-view .input-model-btn {
  height: 36px;
  border-radius: 13px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#home-view .input-model-btn:hover,
#home-view .input-model-picker.open .input-model-btn {
  border-color: rgba(167, 139, 250, 0.26);
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
}

[data-theme="light"] #home-view .input-model-btn {
  border-color: rgba(17, 24, 39, 0.08);
  background: rgba(17, 24, 39, 0.035);
}

#home-view .btn-send {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, #f5f3ff 0%, #c4b5fd 15%, #8b5cf6 50%, #6366f1 100%);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: background 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
}

#home-view .btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffffff 0%, #ddd6fe 14%, #9b6cff 50%, #6d5df6 100%);
  box-shadow: 0 16px 38px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  filter: saturate(1.08);
  transform: translateY(-2px) scale(1.02);
}

#home-view .btn-send:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

#home-view .btn-send:disabled {
  opacity: 0.38;
  background: linear-gradient(135deg, rgba(82, 82, 91, 0.7), rgba(39, 39, 42, 0.9));
  color: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="light"] #home-view .btn-send:disabled {
  background: linear-gradient(135deg, rgba(229, 231, 235, 0.96), rgba(209, 213, 219, 0.9));
  color: rgba(75, 85, 99, 0.58);
}
.btn-mic.recording {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  animation: mic-pulse 1.2s ease-in-out infinite;
}

/* Input Model Picker */
.input-model-picker { position: relative; flex-shrink: 0; }
.input-model-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease; outline: none;
}
.input-model-btn:hover { border-color: var(--border); color: var(--text-primary); }
.imodel-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.imodel-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.imodel-chevron { flex-shrink: 0; opacity: 0.5; transition: transform 0.2s ease; }
.input-model-picker.open .imodel-chevron { transform: rotate(180deg); }
.input-model-picker.open .input-model-btn { border-color: var(--accent); }
.imodel-drop {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 170px; background: var(--modal-bg); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,0.3);
  z-index: 300; padding: 4px; animation: model-dropdown-in 0.15s ease;
}
.input-model-picker.open .imodel-drop { display: block; }
.imodel-opt {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border: none; border-radius: 7px;
  background: transparent; color: var(--text-secondary); font-size: 12.5px;
  cursor: pointer; text-align: left; font-family: var(--font-sans); transition: background 0.1s;
}
.imodel-opt:hover { background: var(--surface-hover); color: var(--text-primary); }
.imodel-opt.selected { background: var(--accent-glow); color: var(--accent); }
.imodel-opt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.btn-mic.recording:hover {
  background: rgba(239, 68, 68, 0.15);
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.btn-mic.unsupported {
  opacity: 0.25;
  cursor: not-allowed;
}

.btn-search {
  position: relative;
}
.btn-search.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}
.btn-search.active:hover {
  background: rgba(16, 185, 129, 0.15);
}
.btn-search.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.btn-attach.has-files {
  color: var(--accent);
}

/* Hidden file input */
.hidden-file-input {
  display: none;
}

/* ============================================
   File Preview Area (above input)
   ============================================ */
.file-preview-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 8px;
  margin-bottom: 2px;
}
.file-preview-area.hidden {
  display: none;
}
.file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  max-width: 220px;
  animation: chip-in 0.2s ease-out;
}
@keyframes chip-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.file-chip-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.file-chip-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-active);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 600;
}
.file-chip-info {
  min-width: 0;
  flex: 1;
}
.file-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  line-height: 1.3;
}
.file-chip-size {
  font-size: 11px;
  color: var(--text-tertiary);
}
.file-chip-remove {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.file-chip-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ============================================
   Voice Recording Overlay
   ============================================ */
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: overlay-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes overlay-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.voice-overlay.hidden {
  display: none;
}
.voice-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 60px;
  background: rgba(24, 24, 27, 0.4);
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.voice-visualizer {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: transparent;
  animation: siri-pulse 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 1;
}
.voice-visualizer::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff3366, #ff9933, #33ccff, #9933ff, #ff3366);
  filter: blur(16px);
  animation: siri-spin 4s linear infinite;
  z-index: -2;
  opacity: 0.8;
}
.voice-visualizer::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--bg-primary);
  z-index: -1;
}
.vv-bar {
  display: inline-block;
  width: 4px;
  height: 20px;
  min-height: 12px;
  border-radius: 4px;
  background: #fff;
  animation: vv-wave 0.8s ease-in-out infinite alternate;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}
@keyframes vv-wave {
  0% { height: 12px; }
  100% { height: 40px; }
}
@keyframes siri-pulse {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.08); }
}
@keyframes siri-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.voice-status {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.voice-dots span {
  animation: dot-blink 1.4s infinite;
  opacity: 0;
}
.voice-dots span:nth-child(1) { animation-delay: 0s; }
.voice-dots span:nth-child(2) { animation-delay: 0.2s; }
.voice-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-blink {
  0%, 60%, 100% { opacity: 0; }
  30% { opacity: 1; }
}
.voice-hint {
  font-size: 13px;
  color: var(--text-tertiary);
}
.btn-voice-stop {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 8px;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  animation: record-pulse 2s ease-in-out infinite;
}
.btn-voice-stop:hover {
  background: #dc2626;
  transform: scale(1.08);
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
}
.btn-voice-stop:active {
  transform: scale(0.95);
}
@keyframes record-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Light theme voice overlay tweaks */
[data-theme="light"] .voice-overlay {
  background: rgba(255, 255, 255, 0.7);
}

/* ============================================
   Chat View
   ============================================ */
#chat-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: var(--nav-height);
}

.chat-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 16px 8px;
  scroll-behavior: smooth;
}
.chat-messages-scroll::-webkit-scrollbar {
  width: 6px;
}
.chat-messages-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
.chat-messages-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.chat-messages {
  max-width: var(--chat-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Chat Input Dock */
.chat-input-dock {
  position: sticky;
  bottom: 0;
  padding: 12px 16px 16px;
  background: linear-gradient(to bottom, transparent, var(--bg-primary) 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chat-input-dock .chat-input-form {
  max-width: var(--chat-max-width);
}

/* Chat dock footer — privacy pill + more actions row */
.chat-dock-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--chat-max-width);
  padding: 0 4px;
}

/* Chat More Actions */
.chat-more-wrap {
  position: relative;
}
.chat-more-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.5;
}
.chat-more-btn:hover {
  opacity: 1;
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.chat-more-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
  z-index: 300;
  padding: 4px;
  animation: model-dropdown-in 0.15s ease;
  transform-origin: bottom right;
}
.chat-more-wrap.open .chat-more-dropdown { display: block; }
.chat-more-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.1s ease;
}
.chat-more-option:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.chat-more-option svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.chat-more-option:hover svg {
  opacity: 1;
}

.chat-disclaimer {
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.4;
}

/* ============================================
   Chat Messages — Premium
   ============================================ */
.message {
  display: flex; flex-direction: column;
  padding: 24px 0; animation: msgIn 0.35s ease-out;
  max-width: 720px; margin: 0 auto; width: 100%;
}
.message-user { align-items: flex-end; }
.message-ai { align-items: flex-start; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.msg-timestamp {
  font-size: 11px; color: var(--text-tertiary); opacity: 0.45;
  margin-bottom: 4px; padding: 0 4px;
  text-align: center;
}

.message-body { max-width: 82%; min-width: 0; }
.message-user .message-body {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 18px;
}
.message-ai .message-body {
  padding: 2px 0;
}

.message-content {
  font-size: 15.5px; line-height: 1.75;
  color: var(--text-primary); overflow-wrap: break-word; word-break: break-word;
}
.message-content p { margin-bottom: 12px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content h1, .message-content h2, .message-content h3 { margin-top: 20px; margin-bottom: 8px; font-weight: 600; }
.message-content h1 { font-size: 20px; } .message-content h2 { font-size: 17px; } .message-content h3 { font-size: 15px; }
.message-content strong { font-weight: 600; }
.message-content ul, .message-content ol { margin: 10px 0; padding-left: 20px; }
.message-content li { margin-bottom: 4px; }
.message-content code {
  background: var(--surface); padding: 2px 5px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 13px;
}
.message-content pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; overflow-x: auto;
  margin: 12px 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
}
.message-content blockquote {
  border-left: 2px solid var(--accent); padding: 8px 14px;
  margin: 12px 0; color: var(--text-secondary); font-style: italic;
}

/* Message Content — Markdown */

.message-content p {
  margin-bottom: 16px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.message-content h1 { font-size: 24px; }
.message-content h2 { font-size: 20px; }
.message-content h3 { font-size: 17px; }
.message-content h4 { font-size: 15.5px; }
.message-content *:first-child {
  margin-top: 0;
}

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

.message-content em {
  font-style: italic;
}

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

.message-content li {
  margin-bottom: 6px;
}

.message-content li > p {
  margin-bottom: 6px;
}

.message-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  color: var(--text-secondary);
  background: var(--accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.message-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.message-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--transition-fast);
}
.message-content a:hover {
  opacity: 0.8;
}

.message-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  font-size: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.message-content th, .message-content td {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.message-content th {
  background: var(--surface-hover);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.message-content tr:last-child td {
  border-bottom: none;
}

/* Inline Code */
.message-content code:not(pre code) {
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--accent);
  border: 1px solid var(--border-subtle);
}

/* Message Attachments (Images & Files) */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.msg-attachment-img {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.msg-attachment-img:hover {
  transform: scale(1.02);
}
.msg-attachment-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.msg-attachment-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}

/* Search source citation in AI messages */
.search-sources {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.search-sources-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin: 0 0 8px;
}
.search-source {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.4;
  transition: color var(--transition-fast);
}
.search-source:hover {
  color: var(--accent);
}
.search-source-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--surface-hover);
  font-size: 10px;
  font-weight: 600;
  margin-right: 6px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

/* Code Blocks */
.code-block-wrapper {
  position: relative;
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
  transition: border-color var(--transition-fast);
}
.code-block-wrapper:hover {
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 8px 18px;
  background: var(--code-header-bg);
  border-bottom: 1px solid var(--code-border);
  user-select: none;
}

.code-block-lang {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.btn-copy-code {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
  opacity: 0.6;
}
.code-block-wrapper:hover .btn-copy-code {
  opacity: 1;
}

.btn-copy-code:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
  opacity: 1;
}

.btn-copy-code.copied {
  color: #22c55e;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  background: transparent;
}

.code-block-wrapper pre code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-text);
  background: transparent;
  padding: 0;
  border: none;
}

/* Message Actions */
.message-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.message:hover .message-actions,
.message-actions.visible {
  opacity: 1;
}

.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-action:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: scale(1.08);
}
.btn-action:active {
  transform: scale(0.95);
}

/* Limit Banner */
.limit-banner {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: 10px;
  margin: 12px 16px;
  padding: 10px 16px;
  animation: messageIn 0.3s ease;
}
.limit-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: #f59e0b;
}
.limit-banner-sub {
  font-size: 11.5px;
  opacity: 0.7;
}
.btn-action.copied {
  color: #22c55e;
}

/* Rating buttons */
.btn-rate-up,
.btn-rate-down {
  padding: 4px 6px;
  opacity: 0.6;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-rate-up:hover,
.btn-rate-down:hover {
  opacity: 1;
}
.btn-rate-up.rated {
  color: #22c55e;
  opacity: 1;
  animation: rate-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-rate-down.rated {
  color: #ef4444;
  opacity: 1;
  animation: rate-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rate-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* TTS Speak Button */
.btn-speak .icon-speaker {
  transition: color 0.2s ease;
}
.btn-speak.speaking .icon-speaker {
  color: var(--accent);
}
.btn-speak.speaking .sound-wave-1,
.btn-speak.speaking .sound-wave-2 {
  animation: sound-pulse 0.8s ease-in-out infinite;
}
.btn-speak.speaking .sound-wave-2 {
  animation-delay: 0.15s;
}
@keyframes sound-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Message Edit */
.message-content.editing {
  padding: 0;
}
.msg-edit-textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.msg-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.msg-edit-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.msg-edit-save {
  background: var(--accent);
  color: #fff;
}
.msg-edit-save:hover {
  filter: brightness(1.1);
}
.msg-edit-cancel {
  background: transparent;
  color: var(--text-tertiary);
}
.msg-edit-cancel:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}
.qa-btn:hover {
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--text-primary);
}
.qa-btn:active {
  transform: scale(0.96);
}

/* Chat experience redesign */
.chat-messages-scroll {
  padding: 34px 18px 10px;
}

.chat-messages {
  max-width: 820px;
  gap: 2px;
}

.message {
  max-width: 820px;
  padding: 18px 0;
}

.message-user {
  align-items: flex-end;
}

.message-ai {
  align-items: flex-start;
}

.msg-timestamp {
  margin-bottom: 6px;
  padding: 0 2px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  opacity: 0.42;
}

.message-user .msg-timestamp {
  text-align: right;
}

.message-ai .msg-timestamp {
  text-align: left;
}

.message-body {
  max-width: min(86%, 680px);
  min-width: 0;
}

.message-user .message-body {
  max-width: min(74%, 560px);
  padding: 11px 15px;
  background: linear-gradient(180deg, rgba(39, 39, 42, 0.94), rgba(24, 24, 27, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.message-ai .message-body {
  width: 100%;
  max-width: min(92%, 720px);
  padding: 0;
  border-left: none;
}

[data-theme="light"] .message-user .message-body {
  background: linear-gradient(180deg, #f7f7f8, #f0f1f3);
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.message-content {
  font-size: 15.75px;
  line-height: 1.68;
  letter-spacing: 0;
  color: var(--text-primary);
}

.message-ai .message-content {
  max-width: 700px;
  font-size: 15.85px;
  line-height: 1.72;
}

.message-user .message-content {
  font-size: 15px;
  line-height: 1.55;
}

.message-content p {
  margin-bottom: 14px;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin-top: 22px;
  margin-bottom: 10px;
  font-weight: 650;
  letter-spacing: 0;
}

.message-content h1 { font-size: 22px; }
.message-content h2 { font-size: 19px; }
.message-content h3 { font-size: 16.5px; }
.message-content h4 { font-size: 15px; }

.message-content ul,
.message-content ol {
  margin: 12px 0 16px;
  padding-left: 24px;
  line-height: 1.7;
}

.message-content li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.message-content blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.02) 100%);
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.98em;
}

.message-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 18px 0;
  font-size: 13.5px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message-content thead {
  background: rgba(255, 255, 255, 0.04);
}

.message-content th {
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.message-content th,
.message-content td {
  padding: 10px 14px;
}

.message-content tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.message-content tbody tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.message-content code:not(pre code) {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.11);
  color: #c4b5fd;
  font-size: 0.88em;
}

[data-theme="light"] .message-content code:not(pre code) {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.07);
  border-color: rgba(124, 58, 237, 0.1);
}

.code-block-wrapper {
  margin: 16px 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  background: #0c0c0f;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.code-block-wrapper:hover {
  border-color: rgba(167, 139, 250, 0.24);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
}

.code-block-header {
  min-height: 38px;
  padding: 8px 10px 8px 14px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.code-block-lang {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.btn-copy-code {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--text-tertiary);
  opacity: 0.74;
}

.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.065);
  color: var(--text-primary);
}

.code-block-wrapper pre {
  padding: 18px 20px;
}

.code-block-wrapper pre code {
  font-size: 13.25px;
  line-height: 1.65;
}

[data-theme="light"] .code-block-wrapper {
  border-color: rgba(17, 24, 39, 0.09);
  background: #f7f7f8;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
}

[data-theme="light"] .code-block-header {
  background: rgba(17, 24, 39, 0.035);
  border-bottom-color: rgba(17, 24, 39, 0.075);
}

[data-theme="light"] .btn-copy-code:hover {
  background: rgba(17, 24, 39, 0.06);
}

.message-actions {
  gap: 4px;
  margin-top: 10px;
  padding: 0;
  opacity: 0;
}

.message-ai .message-actions {
  /* opacity removed to inherit hover behavior */
}

.message:hover .message-actions,
.message-actions.visible {
  opacity: 1;
}

.message-user .message-actions {
  justify-content: flex-end;
}

.btn-action {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--text-tertiary);
  background: transparent;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  transform: translateY(-1px);
}

[data-theme="light"] .btn-action:hover {
  background: rgba(17, 24, 39, 0.055);
}

.quick-actions {
  max-width: 700px;
  gap: 6px;
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}

.qa-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.075);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 11.5px;
}

.qa-btn:hover {
  border-color: rgba(167, 139, 250, 0.2);
  background: rgba(139, 92, 246, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .qa-btn {
  border-color: rgba(17, 24, 39, 0.08);
}

[data-theme="light"] .qa-btn:hover {
  border-color: rgba(124, 58, 237, 0.18);
  background: rgba(124, 58, 237, 0.065);
}

/* Reasoning / Thinking Display */
.thinking-block {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.thinking-block:hover {
  border-color: var(--border);
}
.thinking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}
.thinking-header:hover { color: var(--text-secondary); }
.thinking-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.thinking-block.open .thinking-chevron {
  transform: rotate(180deg);
}
.thinking-body {
  display: none;
  padding: 0 12px 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.thinking-body p { margin: 4px 0; }
.thinking-block.open .thinking-body { display: block; }

/* Suggested Questions */
.suggested-bar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.suggested-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.suggested-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.suggested-chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  text-align: left;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggested-chip:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}
.suggested-chip:active {
  transform: scale(0.97);
}

/* Thinking Indicator */
.thinking-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.thinking-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: thinking 1.4s ease-in-out infinite;
}
.thinking-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

/* Streaming Cursor */
.streaming-cursor::after {
  content: '▊';
  display: inline;
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-size: 14px;
  margin-left: 1px;
  vertical-align: baseline;
}

/* ============================================
   Auth Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  padding: 20px;
  animation: fadeIn 200ms ease-out;
}

.modal-panel {
  width: 100%;
  max-width: 400px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px 28px;
  position: relative;
  animation: modalIn 300ms ease-out;
  box-shadow: var(--shadow-lg);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 28px;
}

.modal-logo {
  margin-bottom: 4px;
  border-radius: 10px;
  object-fit: contain;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input::placeholder {
  color: var(--input-placeholder);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-auth-submit {
  padding: 11px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-top: 4px;
}
.btn-auth-submit:hover {
  background: var(--accent-hover);
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--text-tertiary);
  font-size: 12.5px;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.modal-social {
  display: flex;
  gap: 10px;
}

.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-social:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.modal-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 20px;
}

.btn-link {
  border: none;
  background: none;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover {
  text-decoration: underline;
}

/* Auth Error */
.auth-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  margin-bottom: 4px;
}

[data-theme="light"] .auth-error {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

/* ============================================
   Welcome Modal — Premium Auth Experience
   ============================================ */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.welcome-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  animation: fadeIn 300ms ease-out;
}

[data-theme="light"] .welcome-backdrop {
  background: rgba(255, 255, 255, 0.6);
}

.welcome-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px 32px;
  animation: welcomeIn 400ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.05);
}

[data-theme="light"] .welcome-panel {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(139, 92, 246, 0.08);
}

.welcome-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  z-index: 1;
}
.welcome-close-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.welcome-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.welcome-logo {
  margin-bottom: 16px;
  border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.3));
  object-fit: contain;
}

.welcome-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.welcome-subtitle {
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

[data-theme="light"] .welcome-subtitle {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
}

.welcome-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 320px;
}

.welcome-benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.welcome-benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.benefit-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.welcome-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.welcome-btn-social {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.welcome-btn-social:hover {
  background: var(--surface-hover);
  border-color: var(--input-focus-border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.welcome-btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.welcome-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.welcome-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0;
  color: var(--text-tertiary);
  font-size: 12px;
}
.welcome-divider::before,
.welcome-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.welcome-footer-text {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.welcome-link {
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.welcome-link:hover {
  color: var(--accent);
}

/* Phone Toast */
.phone-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-primary);
  opacity: 0;
  transition: all 350ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.phone-toast:not(.hidden) {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.phone-toast svg {
  color: #f59e0b;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  font-size: 13px;
  color: var(--text-primary);
  opacity: 0;
  transition: all 350ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: 420px;
}
.toast:not(.hidden) {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast.success { border-color: #22c55e; }
.toast.warning { border-color: #f59e0b; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
  line-height: 1;
}
.toast-close:hover { color: var(--text-primary); }

/* ============================================
   Custom Instructions (Settings)
   ============================================ */
.settings-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3), 0 0 0 1px rgba(99,102,241,0.06);
  animation: welcomeIn 400ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
[data-theme="light"] .settings-panel {
  box-shadow: 0 24px 80px rgba(0,0,0,0.1), 0 0 0 1px rgba(99,102,241,0.08);
}

.settings-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.settings-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.settings-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
}
.settings-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}
.settings-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.settings-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.settings-body {
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.settings-card:focus-within {
  border-color: rgba(99,102,241,0.35);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.settings-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.style-icon {
  background: rgba(99,102,241,0.1);
  color: #818cf8;
}
.context-icon {
  background: rgba(34,197,94,0.1);
  color: #4ade80;
}
.settings-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1px;
}
.settings-card-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}
.settings-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  transition: border-color var(--transition-fast);
  outline: none;
}
.settings-textarea:hover {
  border-color: var(--border-subtle);
}
.settings-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.settings-textarea::placeholder {
  color: var(--text-tertiary);
  font-size: 12.5px;
  opacity: 0.7;
}
.settings-card-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.settings-counter {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 24px;
  border-top: 1px solid var(--border-subtle);
  gap: 12px;
}
.settings-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.settings-saved-time {
  color: var(--text-tertiary);
}
.settings-active-badge {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.settings-btn {
  padding: 8px 18px;
  border-radius: 9px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
}
.settings-btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
}
.settings-btn-ghost:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.settings-btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.settings-btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.settings-btn-primary:active {
  transform: scale(0.97);
}

/* Active dot on gear icon */
.btn-icon.settings-active {
  position: relative;
}
.btn-icon.settings-active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
}

@media (max-width: 600px) {

/* ============================================
   Keyboard Shortcuts Modal
   ============================================ */
.shortcuts-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: welcomeIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.shortcuts-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.shortcuts-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.shortcuts-close:hover { background: var(--surface-hover); color: var(--text-primary); }
.shortcuts-body {
  padding: 14px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shortcuts-group-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin: 0 0 6px;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}
.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.shortcut-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
[data-theme="light"] .shortcut-keys kbd { box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.shortcut-label {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.shortcuts-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 10px 24px 16px;
  border-top: 1px solid var(--border-subtle);
  margin: 0;
}
.shortcuts-hint kbd {
  display: inline-flex;
  align-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 10px;
  font-weight: 500;
}

/* ============================================
   Search Modal
   ============================================ */
.search-modal-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 70vh;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: welcomeIn 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.search-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
}
.search-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  outline: none;
}
.search-modal-input::placeholder {
  color: var(--text-tertiary);
}
.search-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.search-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  max-height: 400px;
}
.search-modal-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-result-item:hover {
  background: var(--surface-hover);
}
.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-title {
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.search-result-title mark {
  background: rgba(99,102,241,0.2);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}
.search-result-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

@keyframes welcomeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================
   User Avatar & Dropdown
   ============================================ */
.nav-user-menu {
  position: relative;
}

.btn-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 6px;
  animation: modalIn 200ms ease-out;
  z-index: 100;
}

.user-dropdown-header {
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-dropdown-email {
  font-size: 11.5px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--transition-fast);
  text-align: left;
}
.user-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.55;
  color: var(--text-tertiary);
}
.user-dropdown-item:hover svg {
  opacity: 1;
  color: var(--accent);
}
.user-dropdown-item:hover {
  background: var(--surface-hover);
}

.user-dropdown-signout {
  color: #ef4444;
}

/* ─── Sidebar ────────────────────────────────────────── */
/* ============================================
   Sidebar — Premium Design
   ============================================ */
.sidebar.open {
  transform: translateX(0);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.2);
}

/* Head */
.sidebar-brand img { border-radius: 5px; width: 22px; height: 22px; }
.btn-close-sidebar { flex-shrink: 0; }



/* Dividers */

/* Section */

/* Footer */
.sidebar-footer-section {
  flex-shrink: 0;
  padding: 6px 10px 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.sidebar-footer-link:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.sidebar-search {
  position: relative;
  padding: 6px 0 2px;
  flex-shrink: 0;
}
.sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.sidebar-search-input {
  width: 100%;
  padding: 8px 32px 8px 34px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.sidebar-search-input:focus {
  border-color: var(--accent);
  background: var(--bg);
}
.sidebar-search-input::placeholder {
  color: var(--text-tertiary);
}
.sidebar-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
}
.sidebar-search-clear:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.sidebar-search.has-text .sidebar-search-clear {
  display: flex;
}
.sidebar-chats mark {
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
}
.veil-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 6px 16px 10px;
  pointer-events: none;
  margin-top: -2px;
}
.veil-banner-inner {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px 6px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.10));
  border: 1px solid rgba(139, 92, 246, 0.25);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #c4b5fd;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.08);
  pointer-events: auto;
  user-select: none;
}
.veil-banner-icon {
  flex-shrink: 0;
  opacity: 0.8;
}
[data-theme="light"] .veil-banner-inner {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(219, 39, 119, 0.06));
  border-color: rgba(124, 58, 237, 0.2);
  color: #7c3aed;
}

/* Veil mode chat background */
.veil-active #chat-view .chat-messages-scroll {
  background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.03) 0%, transparent 60%);
}
.veil-active #chat-view .chat-input-container {
  border-color: rgba(139, 92, 246, 0.2);
  background: rgba(20, 20, 22, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.veil-active #chat-view .chat-input-container:focus-within {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), var(--shadow-sm);
}
[data-theme="light"] .veil-active #chat-view .chat-input-container {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(124, 58, 237, 0.15);
}
[data-theme="light"] .veil-active #chat-view .chat-input-container:focus-within {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08), var(--shadow-sm);
}

/* Sidebar Veil Toggle */
.sidebar-veil-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 2px 8px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  border: 1px solid transparent;
}
.sidebar-veil-toggle:hover {
  background: var(--surface-hover);
}
.sidebar-veil-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.veil-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.veil-toggle-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.veil-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}
.veil-toggle-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.3;
}
.veil-toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--surface-active);
  transition: all var(--transition-base);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.veil-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

/* Active state */
.veil-toggle.active .veil-toggle-switch {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-color: transparent;
}
.veil-toggle.active .veil-toggle-knob {
  left: 18px;
  background: #fff;
}
.veil-toggle.active .veil-toggle-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.10));
  color: #c4b5fd;
}
.veil-toggle.active .veil-toggle-label {
  background: linear-gradient(135deg, #c4b5fd, #f9a8d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .veil-toggle.active .veil-toggle-label {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .veil-toggle.active .veil-toggle-switch {
  background: linear-gradient(135deg, #7c3aed, #db2777);
}
[data-theme="light"] .veil-toggle.active .veil-toggle-icon {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(219, 39, 119, 0.08));
  color: #7c3aed;
}

/* Veil ON — Premium (sidebar-veil-toggle.veil-on) */
.sidebar-veil-toggle.veil-on {
  background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.12);
}
.sidebar-veil-toggle.veil-on .veil-toggle-switch {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}
.sidebar-veil-toggle.veil-on .veil-toggle-knob {
  transform: translateX(16px);
}
.sidebar-veil-toggle.veil-on .veil-toggle-icon {
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(236,72,153,0.08));
  color: #c4b5fd;
  box-shadow: 0 0 12px rgba(139,92,246,0.2);
}
.sidebar-veil-toggle.veil-on .veil-toggle-label {
  background: linear-gradient(135deg, #c4b5fd, #f9a8d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .sidebar-veil-toggle.veil-on .veil-toggle-label {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar Footer Links */
.sidebar-footer-links {
  flex-shrink: 0;
  padding: 2px 8px 8px;
}
.sidebar-footer-link:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.sidebar-footer-link svg {
  flex-shrink: 0;
}

.sidebar-chats {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
  scrollbar-width: thin;
}
.sidebar-chats::-webkit-scrollbar {
  width: 4px;
}
.sidebar-chats::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
.sidebar-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.5;
}
.sidebar-empty-icon {
  margin-bottom: 12px;
  opacity: 0.4;
}
.sidebar-empty-sub {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.7;
}
.sidebar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}
.sidebar-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sidebar-spin 0.8s linear infinite;
}
@keyframes sidebar-spin {
  to { transform: rotate(360deg); }
}
.sidebar-date-group {
  margin-bottom: 4px;
}
.sidebar-date-label {
  padding: 12px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}
.sidebar-chat-item {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  transition: all 0.15s ease; position: relative;
  animation: sidebar-item-in 0.2s ease-out;
}
.sidebar-chat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2.5px;
  height: 16px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: transform 0.15s ease;
  opacity: 0;
}
.sidebar-chat-item:hover { background: var(--surface-hover); }
.sidebar-chat-item:hover::before { transform: translateY(-50%) scaleY(1); opacity: 0.3; }
.sidebar-chat-item.active { background: rgba(139,92,246,0.08); }
.sidebar-chat-item.active::before { transform: translateY(-50%) scaleY(1); opacity: 1; }
.sidebar-chat-item.active .sidebar-chat-title { color: var(--accent); font-weight: 500; }
.sidebar-chat-title { font-size: 12.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.sidebar-chat-time { font-size: 10.5px; color: var(--text-tertiary); }
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.sidebar-chat-item.active .sidebar-chat-title {
  color: var(--accent);
}
.sidebar-chat-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}
.sidebar-chat-item:hover .sidebar-chat-actions {
  opacity: 1;
}
.sidebar-chat-item.active .sidebar-chat-actions {
  opacity: 1;
}

.btn-chat-more {
  padding: 4px;
  border-radius: 4px;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}
.btn-chat-more:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.chat-context-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 150px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: context-menu-in 0.15s ease-out forwards;
}

.chat-context-menu.hidden {
  display: none;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-align: left;
}

.ctx-item:hover {
  background: var(--surface-hover);
}

.ctx-item.btn-chat-delete {
  color: #ef4444;
}

.ctx-item.btn-chat-delete:hover {
  background: rgba(239, 68, 68, 0.1);
}

@keyframes context-menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Select mode */
.btn-select-mode {
  padding: 6px;
}
.btn-select-mode.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 6px;
}
.sidebar-select-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
  transition: all var(--transition-fast);
}
.sidebar-chat-item.selected .sidebar-select-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sidebar-chat-item.selected {
  background: var(--accent-glow);
}

/* Batch actions */
.batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
}
.batch-actions span {
  color: var(--text-secondary);
}
.batch-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.batch-btn-delete {
  color: #ef4444;
  border-color: #ef4444;
  margin-left: auto;
}
.batch-btn-delete:hover {
  background: #ef4444;
  color: #fff;
}
.batch-btn-cancel {
  color: var(--text-tertiary);
}
.batch-btn-cancel:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Popover tooltip */
.popover-tip {
  position: fixed;
  z-index: 2500;
  padding: 6px 14px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  pointer-events: none;
  transform: translate(-50%, 4px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.popover-tip.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================
   Sovereign Veil (Temporary Chat)
   ============================================ */
.btn-temp-chat {
  gap: 6px;
  color: #a78bfa;
  position: relative;
  overflow: hidden;
}
.btn-temp-chat::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(99,102,241,0.06));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-temp-chat:hover::before {
  opacity: 1;
}
.btn-temp-chat:hover {
  color: #c4b5fd;
}
.btn-temp-chat.active {
  color: #a78bfa;
  background: rgba(139,92,246,0.1);
  box-shadow: 0 0 12px rgba(139,92,246,0.15);
}

.temp-banner {
  position: relative;
  overflow: hidden;
  margin: 0 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(99,102,241,0.04));
  border: 1px solid rgba(139,92,246,0.15);
  animation: tempBannerIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.temp-banner-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(139,92,246,0.12) 0%, transparent 60%);
  animation: tempGlow 3s ease-in-out infinite;
}
@keyframes tempGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(2%, -1%) scale(1.05); opacity: 0.8; }
}
@keyframes tempBannerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.temp-banner-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.temp-banner-shield {
  color: #a78bfa;
  flex-shrink: 0;
  animation: shieldPulse 2s ease-in-out infinite;
}
@keyframes shieldPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.temp-banner-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.temp-banner-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #c4b5fd;
  letter-spacing: 0.02em;
}
.temp-banner-desc {
  font-size: 11px;
  color: rgba(196,181,253,0.6);
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 89;
  animation: overlay-in 0.2s ease-out;
}
@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.btn-toggle-sidebar {
  display: flex;
} 

/* ─── Rename Modal ───────────────────────────────────── */
.modal-panel-small {
  max-width: 380px;
}

@media (max-width: 768px) {



}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: 22px 24px 26px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}
[data-theme="light"] .site-footer {
  border-top-color: rgba(17, 24, 39, 0.07);
}
.footer-inner {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-copyright {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12.5px;
  line-height: 1.4;
  letter-spacing: 0;
}
.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease;
  white-space: nowrap;
}
.footer-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  text-decoration: none;
}
[data-theme="light"] .footer-link:hover {
  background: rgba(17, 24, 39, 0.045);
}

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

@keyframes viewFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

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

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

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

@keyframes thinking {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================
   Syntax Highlighting — Dark Theme
   ============================================ */
[data-theme="dark"] .hljs {
  background: transparent;
  color: #e4e4e7;
}
[data-theme="dark"] .hljs-keyword,
[data-theme="dark"] .hljs-selector-tag { color: #c084fc; }
[data-theme="dark"] .hljs-string,
[data-theme="dark"] .hljs-addition { color: #86efac; }
[data-theme="dark"] .hljs-number,
[data-theme="dark"] .hljs-literal { color: #fbbf24; }
[data-theme="dark"] .hljs-comment,
[data-theme="dark"] .hljs-quote { color: #52525b; font-style: italic; }
[data-theme="dark"] .hljs-function .hljs-title,
[data-theme="dark"] .hljs-title.function_ { color: #93c5fd; }
[data-theme="dark"] .hljs-built_in { color: #67e8f9; }
[data-theme="dark"] .hljs-type,
[data-theme="dark"] .hljs-class .hljs-title { color: #fcd34d; }
[data-theme="dark"] .hljs-attr,
[data-theme="dark"] .hljs-attribute { color: #a78bfa; }
[data-theme="dark"] .hljs-params { color: #d4d4d8; }
[data-theme="dark"] .hljs-meta { color: #71717a; }
[data-theme="dark"] .hljs-deletion { color: #fca5a5; }
[data-theme="dark"] .hljs-symbol { color: #c4b5fd; }
[data-theme="dark"] .hljs-variable { color: #f0abfc; }
[data-theme="dark"] .hljs-regexp { color: #fda4af; }
[data-theme="dark"] .hljs-operator { color: #94a3b8; }
[data-theme="dark"] .hljs-property { color: #7dd3fc; }
[data-theme="dark"] .hljs-punctuation { color: #71717a; }

/* --- Light Theme Syntax --- */
[data-theme="light"] .hljs {
  background: transparent;
  color: #1f2937;
}
[data-theme="light"] .hljs-keyword,
[data-theme="light"] .hljs-selector-tag { color: #7c3aed; }
[data-theme="light"] .hljs-string,
[data-theme="light"] .hljs-addition { color: #059669; }
[data-theme="light"] .hljs-number,
[data-theme="light"] .hljs-literal { color: #d97706; }
[data-theme="light"] .hljs-comment,
[data-theme="light"] .hljs-quote { color: #9ca3af; font-style: italic; }
[data-theme="light"] .hljs-function .hljs-title,
[data-theme="light"] .hljs-title.function_ { color: #2563eb; }
[data-theme="light"] .hljs-built_in { color: #0891b2; }
[data-theme="light"] .hljs-type,
[data-theme="light"] .hljs-class .hljs-title { color: #b45309; }
[data-theme="light"] .hljs-attr,
[data-theme="light"] .hljs-attribute { color: #6d28d9; }
[data-theme="light"] .hljs-params { color: #374151; }
[data-theme="light"] .hljs-meta { color: #9ca3af; }
[data-theme="light"] .hljs-deletion { color: #dc2626; }
[data-theme="light"] .hljs-symbol { color: #7c3aed; }
[data-theme="light"] .hljs-variable { color: #c026d3; }
[data-theme="light"] .hljs-regexp { color: #e11d48; }
[data-theme="light"] .hljs-operator { color: #475569; }
[data-theme="light"] .hljs-property { color: #0284c7; }
[data-theme="light"] .hljs-punctuation { color: #6b7280; }

/* ============================================
   Memory View
   ============================================ */
#memory-view {
  padding: calc(var(--nav-height) + 32px) 24px 60px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}
.memory-container {
  width: 100%;
  max-width: 720px;
}
.memory-header {
  margin-bottom: 28px;
}
.memory-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.memory-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.memory-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.memory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.memory-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}
.memory-empty svg {
  margin-bottom: 12px;
  opacity: 0.3;
}
.memory-empty p {
  font-size: 14px;
  line-height: 1.5;
}
.memory-empty-sub {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.7;
}

/* Memory Card */
.memory-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}
.memory-card:hover {
  border-color: var(--border-focus);
}
.memory-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-muted);
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.memory-card-body {
  flex: 1;
  min-width: 0;
}
.memory-card-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-primary);
  word-break: break-word;
}
.memory-card-date {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 6px;
}
.memory-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}
.btn-memory-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-memory-action:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.btn-memory-action.delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Form Textarea */
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-textarea:focus {
  border-color: var(--input-focus-border);
}
.form-textarea::placeholder {
  color: var(--input-placeholder);
}

/* Memory Suggestion Banner */
.memory-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin: 6px 0 0;
  background: var(--accent-glow);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
  animation: messageIn 350ms ease-out;
}
.memory-suggestion-icon {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 1px;
}
.memory-suggestion-body {
  flex: 1;
  min-width: 0;
}
.memory-suggestion-text {
  margin-bottom: 6px;
}
.memory-suggestion-actions {
  display: flex;
  gap: 6px;
}
.btn-memory-suggestion {
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-memory-suggestion.remember {
  background: var(--accent);
  color: #fff;
}
.btn-memory-suggestion.remember:hover {
  background: var(--accent-hover);
}
.btn-memory-suggestion.dismiss {
  background: var(--surface);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}
.btn-memory-suggestion.dismiss:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ============================================
   Privacy Showcase
   ============================================ */
.privacy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid rgba(34,197,94,0.12);
  border-radius: 16px;
  background: rgba(34,197,94,0.03);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.privacy-badge:hover {
  background: rgba(34,197,94,0.07);
  border-color: rgba(34,197,94,0.25);
  box-shadow: 0 0 14px rgba(34,197,94,0.08);
}
.privacy-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.privacy-badge:hover .privacy-badge-icon {
  background: rgba(34,197,94,0.16);
  box-shadow: 0 0 6px rgba(34,197,94,0.15);
}
.privacy-badge-text {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(74,222,128,0.85);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.privacy-badge-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  padding: 10px 12px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.22);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  z-index: 500;
}
.privacy-badge:hover .privacy-badge-tooltip {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {

/* Hero privacy message */
.hero-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.hero-privacy svg {
  flex-shrink: 0;
  opacity: 0.6;
}
}

/* Privacy pill — subtle clickable indicator in input areas */
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.5;
}
.privacy-pill:hover {
  opacity: 1;
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.privacy-pill svg {
  flex-shrink: 0;
}

/* Privacy Modal */
.privacy-modal-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--accent);
}
.privacy-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 4px;
}
.privacy-item {
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.privacy-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}
.privacy-item strong {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.privacy-item p {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Memory Data Control Section */
.memory-data-section {
  margin-top: 32px;
  padding-top: 8px;
}
.memory-data-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 20px;
}
.memory-data-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.memory-data-header svg {
  color: var(--text-tertiary);
}
.memory-data-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.btn-memory-data-delete {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-memory-data-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
}
.btn-memory-data-delete:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Memory share toggle active state */
.btn-memory-action.share-active {
  color: var(--accent);
  background: var(--accent-muted);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  :root {
    --nav-height: 52px;
  }



  .btn-toggle-sidebar {
    display: flex;
  }










  .code-block-wrapper pre code {
    font-size: 12.5px;
  }



  .btn-new-chat span {
    display: none;
  }
  .btn-new-chat {
    padding: 7px 8px;
    margin-left: 2px;
  }

  .memory-container {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .voice-overlay-inner {
    padding: 40px 24px;
    border-radius: 28px;
  }
  .voice-visualizer {
    width: 100px;
    height: 100px;
  }
  .chat-input-container {
    padding: 6px 8px 6px 12px;
    gap: 4px;
  }
  .chat-textarea {
    font-size: 15px;
  }
  .input-model-picker .input-model-btn {
    padding: 3px 7px 3px 6px;
  }
  .chat-more-dropdown {
    right: 0;
    left: auto;
    min-width: 160px;
  }
}

/* Print */
@media print {
  #navbar, .chat-input-dock, .message-actions, .site-footer {
    display: none;
  }
}

/* ============================================
   Image Lightbox
   ============================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: lightbox-fade-in 0.2s ease-out;
}
.lightbox-overlay.hidden {
  display: none;
}
@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.lightbox-close-btn:hover {
  background: rgba(255,255,255,0.2);
}



/* ============================================
   Premium Plans Modal
   ============================================ */
.plans-panel { position: relative; width: 100%; max-width: 680px; background: var(--modal-bg); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,0.3); padding: 36px 32px 28px; overflow: hidden; animation: welcomeIn 0.35s cubic-bezier(0.16,1,0.3,1); }
.plans-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: none; border-radius: 8px; background: transparent; color: var(--text-tertiary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.plans-close:hover { background: var(--surface-hover); color: var(--text-primary); }
.plans-header { text-align: center; margin-bottom: 28px; }
.plans-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; letter-spacing: -0.02em; }
.plans-subtitle { font-size: 13.5px; color: var(--text-tertiary); margin: 0; }
.plans-grid { display: flex; gap: 16px; }
.plan-card { flex: 1; border: 1px solid var(--border); border-radius: 16px; padding: 24px 20px; position: relative; transition: all 0.2s ease; background: var(--surface); }
.plan-card-pro { border-color: rgba(139,92,246,0.3); background: linear-gradient(180deg, rgba(139,92,246,0.06), rgba(139,92,246,0.02)); }
.plan-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.plan-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; }
.plan-card-header { margin-bottom: 16px; }
.plan-name { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 4px; }
.plan-price { font-size: 28px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.plan-currency { font-size: 18px; font-weight: 500; vertical-align: super; }
.plan-period { font-size: 12.5px; color: var(--text-tertiary); font-weight: 400; }
.plan-features { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-features li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.plan-features li svg { color: #22c55e; flex-shrink: 0; }
.plan-btn { width: 100%; padding: 10px; border: none; border-radius: 8px; font-family: var(--font-sans); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.plan-btn-current { background: var(--surface-active); color: var(--text-tertiary); cursor: default; }
.plan-btn-upgrade { background: var(--accent); color: #fff; }
.plan-btn-upgrade:hover { filter: brightness(1.1); }
.plans-footer-text { text-align: center; font-size: 11.5px; color: var(--text-tertiary); margin: 20px 0 0; }

/* Sidebar premium */
.sidebar {
  width: 272px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  box-shadow: none;
}
.sidebar.open {
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.28);
}

.sidebar-menu-item {
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.sidebar-menu-item.active {
  background: rgba(139, 92, 246, 0.1);
  color: #ddd6fe;
  font-weight: 600;
}
.sidebar-menu-item.active::before {
  transform: translateY(-50%) scaleY(1);
  opacity: 1;
}
.sidebar-menu-item.active .smi-icon {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.12);
}
.sidebar-menu-new {
  margin-bottom: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.06));
  color: #c4b5fd;
  font-weight: 600;
}
.sidebar-menu-new:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(99, 102, 241, 0.1));
  border-color: rgba(139, 92, 246, 0.28);
  transform: translateY(-1px);
}
.sidebar-menu-new .smi-icon {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
}
.smi-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

/* More menu dropdown */
.sidebar-more-wrap {
  position: relative;
}
.more-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  padding: 6px;
  z-index: 120;
  animation: menuSlideUp 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes menuSlideUp {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.more-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.more-menu-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.more-menu-item svg {
  flex-shrink: 0;
  opacity: 0.65;
  color: var(--text-tertiary);
}
.more-menu-item:hover svg { opacity: 1; color: var(--accent); }
.more-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

/* Workspace views (Library & Projects) */
.workspace-container {
  max-width: 960px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 24px 48px;
}
.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.workspace-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.workspace-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.5;
}
.btn-workspace-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.btn-workspace-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
}

.workspace-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.workspace-tab {
  flex: 1;
  min-width: max-content;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.workspace-tab:hover { color: var(--text-secondary); }
.workspace-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.workspace-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
}
.workspace-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.workspace-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
}
.workspace-card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.workspace-card-desc {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.workspace-card-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: auto;
}

.project-card {
  position: relative;
}
.project-card-color {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
}

/* Empty & coming soon states */
.workspace-empty,
.workspace-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.workspace-empty-icon,
.coming-soon-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.08);
  color: #a78bfa;
  margin-bottom: 16px;
}
.workspace-empty h3,
.workspace-coming-soon h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.workspace-empty p,
.workspace-coming-soon p {
  font-size: 13.5px;
  color: var(--text-tertiary);
  max-width: 360px;
  line-height: 1.55;
  margin: 0;
}
.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Search modal polish */
.search-modal-panel {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.search-modal-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13.5px;
  line-height: 1.5;
}
.search-modal-empty svg {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.4;
}
.search-result-snippet {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* About modal */
.about-panel { max-width: 440px; }
.about-body { padding: 0 4px 8px; }
.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 20px;
}
.about-hero img { border-radius: 14px; }
.about-hero h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0 0;
}
.about-tagline {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin: 0;
}
.about-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 20px;
}
.about-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.form-label-optional {
  font-weight: 400;
  color: var(--text-tertiary);
}

/* Sidebar overlay */
.sidebar-overlay {
  transition: opacity 0.28s ease;
}
.sidebar-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile navigation */
@media (max-width: 768px) {
  .nav-inner {
    padding: 0 10px;
    gap: 8px;
  }
  .nav-left {
    gap: 6px;
  }
  .nav-right {
    gap: 7px;
  }
  .nav-brand {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
  }
  .nav-brand .nav-brand-text {
    display: none;
  }
  .model-picker-btn {
    padding: 0 8px;
    height: 34px;
    max-width: 140px;
  }
  .model-picker-name {
    font-size: 13px;
  }
  .nav-auth-buttons {
    gap: 6px;
    margin-left: 0;
  }
  .nav-auth-buttons .btn-nav {
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    border-radius: 10px;
  }
  .nav-auth-buttons .btn-primary {
    padding: 0 13px;
  }
  .btn-theme {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .hero-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin-bottom: 2px;
    box-shadow: 0 10px 28px rgba(139, 92, 246, 0.2), 0 0 34px rgba(139, 92, 246, 0.14);
  }

  .sidebar {
    width: min(88vw, 300px);
  }
  .sidebar-menu-item {
    padding: 12px 14px;
    min-height: 48px;
  }
  .sidebar-menu-new {
    min-height: 50px;
  }
  .smi-icon {
    width: 36px;
    height: 36px;
  }
  .btn-new-chat span { display: none; }
  .btn-new-chat {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    margin-left: 2px;
  }
  .nav-brand-text { font-size: 14px; }
  .workspace-header {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-workspace-primary {
    width: 100%;
    justify-content: center;
  }
  .workspace-container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .btn-mobile-menu { display: none !important; }
  .btn-toggle-sidebar { display: flex !important; }
  .more-menu-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: auto;
    top: auto;
  }

  /* Prevent input model picker dropdown from overflowing */
  .input-model-picker .imodel-drop {
    left: auto;
    right: 0;
    min-width: 150px;
  }

  /* Ensure chat tools have enough tap targets */
  .btn-input-tool {
    width: 44px;
    height: 44px;
  }
  .btn-send {
    width: 44px;
    height: 44px;
  }
  .chat-messages-scroll {
    padding: 24px 12px 8px;
  }
  .chat-messages {
    max-width: 100%;
    gap: 0;
  }
  .message {
    padding: 14px 0;
  }
  .message-body,
  .message-ai .message-body {
    max-width: 100%;
  }
  .message-user .message-body {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 16px 16px 5px 16px;
  }
  .message-content,
  .message-ai .message-content {
    font-size: 15px;
    line-height: 1.65;
  }
  .message-user .message-content {
    font-size: 14.5px;
    line-height: 1.5;
  }
  .code-block-wrapper {
    border-radius: 10px;
    margin-left: -2px;
    margin-right: -2px;
  }
  .code-block-header {
    padding: 7px 8px 7px 12px;
  }
  .code-block-wrapper pre {
    padding: 15px 14px;
  }
  .message-actions {
    opacity: 1;
  }
  #home-view .chat-input-container {
    min-height: 62px;
    padding: 8px 9px 8px 12px;
    gap: 4px;
    border-radius: 22px;
  }
  #home-view .chat-textarea {
    min-height: 40px;
    font-size: 15.5px;
  }
  #home-view .btn-input-tool,
  #home-view .btn-send {
    width: 42px;
    height: 42px;
  }
  #home-view .input-model-btn {
    height: 34px;
    padding: 3px 8px 3px 7px;
  }
  .prompt-cards {
    gap: 10px;
  }
  .prompt-card {
    min-height: 74px;
    padding: 14px;
  }
  .prompt-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  /* Make chat-dock-footer use proper spacing */
  .chat-dock-footer {
    padding: 0 2px;
  }
}

@media (max-width: 520px) {
  .nav-inner {
    gap: 6px;
  }
  .btn-new-chat {
    display: none;
  }
  .nav-auth-buttons .btn-nav {
    padding: 0 10px;
  }
  .nav-auth-buttons .btn-primary {
    padding: 0 11px;
  }
  .prompt-cards {
    grid-template-columns: 1fr;
  }
  .site-footer {
    padding: 22px 18px 28px;
  }
  .footer-inner {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    text-align: center;
  }
  .footer-links {
    justify-content: center;
    gap: 2px;
  }
}

@media (min-width: 769px) {
  .sidebar-overlay.hidden { display: none; }
}
@media (max-width: 768px) {
  .sidebar-overlay:not(.hidden) { display: block; }
}

/* ============================================
   Product Maturity Pass
   ============================================ */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --ease-product: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  line-height: 1.5;
}

#navbar {
  box-shadow: none;
}

.nav-inner {
  padding-left: 18px;
  padding-right: 18px;
}

.nav-brand,
.btn-new-chat,
.btn-theme,
.nav-auth-buttons .btn-nav,
.sidebar-menu-item,
.btn-input-tool,
.btn-send,
.prompt-card,
.footer-link,
.btn-action,
.qa-btn,
.workspace-card,
.welcome-btn,
.settings-btn,
.more-menu-item,
.chat-more-option,
.imodel-opt {
  transition-duration: 180ms;
  transition-timing-function: var(--ease-product);
}

.nav-brand:hover,
.btn-new-chat:hover,
.btn-theme:hover,
.nav-auth-buttons .btn-nav:hover {
  transform: none;
}

#home-view {
  padding-top: calc(var(--nav-height) + 34px);
  padding-bottom: 72px;
}

.home-container {
  max-width: 760px;
  gap: 34px;
}

.hero {
  gap: 14px;
}

.hero-app-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  margin-bottom: 2px;
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.16);
}

.hero-title {
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 680;
  line-height: 1.03;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 440px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-tertiary);
}

#home-view .home-input-wrapper::before {
  opacity: 0.45;
  filter: blur(20px);
}

#home-view .home-input-wrapper:hover::before,
#home-view .home-input-wrapper:focus-within::before {
  opacity: 0.72;
  transform: none;
}



#home-view .btn-send {
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#home-view .btn-send:hover:not(:disabled) {
  transform: none;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

#home-view .btn-input-tool:hover {
  transform: none;
}

.prompt-cards {
  gap: 10px;
}

.prompt-card {
  min-height: 70px;
  padding: 14px 15px;
  border-color: rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.022);
  box-shadow: none;
}

.prompt-card::before {
  display: none;
}

.prompt-card:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.22);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(139, 92, 246, 0.045);
}

.prompt-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(139, 92, 246, 0.09);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.09);
}

.prompt-card:hover .prompt-card-icon {
  transform: none;
  background: rgba(139, 92, 246, 0.13);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.14);
}

.prompt-card-title {
  font-size: 13.5px;
  font-weight: 620;
}

.prompt-card-desc {
  color: var(--text-tertiary);
}

.sidebar {
  background: rgba(17, 17, 19, 0.96);
}



.sidebar-menu-item {
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13.25px;
}

.sidebar-menu-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
}

.sidebar-menu-item.active {
  background: rgba(139, 92, 246, 0.095);
  color: var(--text-primary);
}

.sidebar-menu-item:hover::before {
  opacity: 0;
}

.smi-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-menu-item:hover .smi-icon,
.sidebar-menu-item.active .smi-icon {
  transform: none;
  box-shadow: none;
  background: rgba(139, 92, 246, 0.11);
}

.sidebar-section-head {
  padding: 12px 14px 6px;
}

.sidebar-section-title {
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.sidebar-chat-item {
  border-radius: 10px;
  font-size: 13px;
}

.chat-messages {
  max-width: 840px;
}

.message {
  max-width: 840px;
  padding: 17px 0;
}

.message-ai .message-content {
  max-width: 710px;
  font-size: 15.75px;
  line-height: 1.72;
}

.message-user .message-body {
  max-width: min(72%, 560px);
  background: rgba(39, 39, 42, 0.92);
  box-shadow: none;
}

.message-ai .message-body {
  max-width: min(94%, 730px);
}

.msg-timestamp {
  opacity: 0.36;
}

.message-actions {
  margin-top: 8px;
}

.message-ai .message-actions {
  /* No opacity override here to keep them hidden by default */
}

.btn-action:hover,
.qa-btn:hover,
.btn-copy-code:hover {
  transform: none;
}

.code-block-wrapper {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
  background: #0d0d12;
}

.code-block-wrapper:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  border-color: rgba(167, 139, 250, 0.25);
}

.code-block-header {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.code-block-wrapper pre code {
  font-size: 13px;
}

.modal-panel,
.welcome-panel,
.plans-panel,
.settings-card,
.workspace-card,
.search-modal-panel,
.more-menu-panel,
.chat-more-dropdown,
.imodel-drop {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.btn-icon:hover,
.btn-ghost:hover,
.welcome-btn-social:hover,
.settings-btn-ghost:hover,
.chat-more-option:hover,
.more-menu-item:hover,
.imodel-opt:hover {
  transform: none;
}

[data-theme="light"] .prompt-card {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(17, 24, 39, 0.07);
  box-shadow: none;
}

[data-theme="light"] .prompt-card:hover {
  border-color: rgba(124, 58, 237, 0.18);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

[data-theme="light"] #home-view .chat-input-container {
  box-shadow: 0 16px 44px rgba(17, 24, 39, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .message-user .message-body {
  background: #f4f4f5;
  box-shadow: none;
}

[data-theme="light"] .modal-panel,
[data-theme="light"] .welcome-panel,
[data-theme="light"] .plans-panel,
[data-theme="light"] .settings-card,
[data-theme="light"] .workspace-card,
[data-theme="light"] .search-modal-panel,
[data-theme="light"] .more-menu-panel,
[data-theme="light"] .chat-more-dropdown,
[data-theme="light"] .imodel-drop {
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.1);
}

@media (max-width: 768px) {
  #home-view {
    padding-left: 18px;
    padding-right: 18px;
  }

  .home-container {
    gap: 28px;
  }

  .hero-title {
    font-size: clamp(38px, 13vw, 54px);
  }

  .hero-subtitle {
    font-size: 13.5px;
  }

  .message-user .message-body {
    max-width: 88%;
  }
}

/* ============================================
   ChatGPT-Style Layout Restructure
   ============================================ */
body {
  background: #050506;
}

[data-theme="light"] body {
  background: #ffffff;
}

#navbar {
  height: 48px;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-inner {
  padding: 0 18px;
}

.nav-brand {
  height: 34px;
  padding: 0 8px 0 4px;
  gap: 8px;
}

.nav-logo-img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: none;
}

.nav-brand-text {
  font-size: 14px;
  font-weight: 620;
}

.btn-new-chat {
  height: 32px;
  padding: 0 10px;
  margin-left: 2px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.btn-new-chat:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.nav-auth-buttons .btn-nav,
.btn-theme {
  height: 32px;
  border-radius: 9px;
  box-shadow: none;
}



#home-view {
  min-height: 100svh;
  justify-content: center;
  padding: calc(var(--nav-height) + 12px) 24px 56px;
}

.home-container {
  max-width: 660px;
  gap: 20px;
}

.hero {
  gap: 0;
}

.hero-app-icon,
.hero-subtitle {
  display: none;
}

.hero-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 520;
  line-height: 1.14;
  letter-spacing: 0;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-title-line.accent {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text-primary);
}

[data-theme="light"] .hero-title-line.accent {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text-primary);
}

.home-input-wrapper {
  max-width: 640px;
  margin: 0 auto;
}

#home-view .home-input-wrapper::before {
  display: none;
}

#home-view .chat-input-container {
  min-height: 68px;
  padding: 10px 14px 10px 16px;
  gap: 12px;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #151518;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.02);
  align-items: center;
}

#home-view .chat-input-container:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: #1a1a1d;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.03);
}

#home-view .chat-input-container:focus-within {
  border-color: var(--brand-purple);
  background: #1a1a1d;
  box-shadow: 0 0 0 1px var(--brand-purple), 0 0 0 4px var(--brand-purple-soft), 0 24px 64px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] #home-view .chat-input-container {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 16px 44px rgba(17, 24, 39, 0.09), inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

[data-theme="light"] #home-view .chat-input-container:hover,
[data-theme="light"] #home-view .chat-input-container:focus-within {
  background: #f8f8f9;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 1px var(--brand-purple), 0 0 0 4px rgba(139, 53, 255, 0.1), 0 24px 64px rgba(0, 0, 0, 0.1);
}

#home-view .chat-textarea {
  min-height: 36px;
  padding: 7px 0;
  font-size: 15.5px;
  line-height: 1.4;
}

#home-view .chat-textarea::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

[data-theme="light"] #home-view .chat-textarea::placeholder {
  color: rgba(17, 24, 39, 0.45);
}

#home-view .btn-input-tool {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

#home-view .btn-input-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

#home-view .input-model-btn {
  height: 100%;
  border-radius: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  margin-right: -4px;
}

#home-view .input-model-btn:hover,
#home-view .input-model-picker.open .input-model-btn {
  background: transparent;
  border-color: transparent;
  opacity: 0.8;
}


[data-theme="light"] #home-view .btn-send {
  background: #111827;
  color: #ffffff;
}

[data-theme="light"] #home-view .btn-send:disabled {
  background: rgba(17, 24, 39, 0.18);
  color: rgba(17, 24, 39, 0.55);
}

.home-input-wrapper .privacy-pill {
  display: none;
}

.prompt-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 800px; /* match input width */
  margin: 16px auto 0;
}

.prompt-card {
  display: flex;
  width: auto;
  min-height: 38px;
  padding: 0 16px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.prompt-card:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.08);
  color: var(--text-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.prompt-card-icon {
  width: 16px;
  height: 16px;
  border-radius: 0;
  background: transparent;
  color: var(--text-tertiary);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prompt-card-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.prompt-card-text {
  display: flex;
  align-items: center;
}

.prompt-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.prompt-card-desc {
  display: none;
}
}

.prompt-card:hover .prompt-card-icon {
  background: transparent;
  box-shadow: none;
}

.prompt-card-text {
  display: block;
}

.prompt-card-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
}

.prompt-card-desc {
  display: none;
}

[data-theme="light"] .prompt-card {
  background: transparent;
  border-color: rgba(17, 24, 39, 0.12);
}

[data-theme="light"] .prompt-card:hover {
  background: rgba(17, 24, 39, 0.045);
  border-color: rgba(17, 24, 39, 0.18);
  box-shadow: none;
}

.sidebar {
  width: 260px;
  background: #050506;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sidebar.open {
  box-shadow: none;
}



.sidebar-menu-item,
.sidebar-menu-new {
  min-height: 36px;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13.5px;
  font-weight: 500;
}

.sidebar-menu-item:hover,
.sidebar-menu-new:hover,
.sidebar-menu-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: none;
}

.sidebar-menu-new {
  margin-bottom: 3px;
  color: #ffffff;
}

.smi-icon,
.sidebar-menu-new .smi-icon,
.sidebar-menu-item:hover .smi-icon,
.sidebar-menu-item.active .smi-icon {
  width: 22px;
  height: 22px;
  background: transparent;
  color: currentColor;
  box-shadow: none;
}

.smi-label {
  font-size: 13.5px;
}

.sidebar-divider {
  background: transparent;
  margin: 4px 12px;
}

.sidebar-section-head {
  padding: 10px 14px 6px;
}

.sidebar-section-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-chat-item {
  border-radius: 8px;
  min-height: 34px;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-chat-item:hover,
.sidebar-chat-item.active {
  background: rgba(255, 255, 255, 0.08);
}

.site-footer {
  display: none;
}

@media (max-width: 768px) {
  #home-view {
    padding: calc(var(--nav-height) + 8px) 16px 44px;
  }

  .home-container {
    max-width: 100%;
    gap: 18px;
  }

  .hero-title {
    font-size: clamp(24px, 9vw, 32px);
  }

  #home-view .chat-input-container {
    min-height: 54px;
    border-radius: 24px;
  }

  .prompt-cards {
    gap: 8px;
  }

  .prompt-card {
    min-height: 36px;
    padding: 0 12px;
  }
}

/* Cognos Brand Palette: black, white, vibrant purple */
:root {
  --brand-purple: #8b35ff;
  --brand-purple-hover: #9f55ff;
  --brand-purple-deep: #5f16d6;
  --brand-purple-soft: rgba(139, 53, 255, 0.14);
  --brand-purple-glow: rgba(139, 53, 255, 0.22);
}

[data-theme="dark"] {
  --accent: var(--brand-purple);
  --accent-hover: var(--brand-purple-hover);
  --accent-muted: var(--brand-purple-soft);
  --accent-glow: rgba(139, 53, 255, 0.1);
  --border-focus: var(--brand-purple);
  --bg-primary: #000000;
  --bg-secondary: #070707;
  --bg-tertiary: #101010;
  --bg-elevated: #121212;
  --surface: #171717;
  --surface-hover: #202020;
  --surface-active: #292929;
  --border: #262626;
  --border-subtle: #1d1d1d;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.68);
  --text-tertiary: rgba(255, 255, 255, 0.43);
  --user-msg-bg: #1a1026;
}

[data-theme="light"] {
  --accent: #7f22ff;
  --accent-hover: #6d12e8;
  --accent-muted: rgba(127, 34, 255, 0.1);
  --accent-glow: rgba(127, 34, 255, 0.08);
  --border-focus: #7f22ff;
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f4f4f5;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f4f4f5;
  --surface-active: #ededf0;
  --text-primary: #000000;
  --text-secondary: rgba(0, 0, 0, 0.64);
  --text-tertiary: rgba(0, 0, 0, 0.42);
  --user-msg-bg: #f4edff;
}

.nav-auth-buttons .btn-primary {
  background: linear-gradient(135deg, #ffffff 0%, var(--brand-purple-hover) 36%, var(--brand-purple-deep) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(139, 53, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nav-auth-buttons .btn-primary:hover {
  background: linear-gradient(135deg, #ffffff 0%, #b26cff 34%, #741fff 100%);
  box-shadow: 0 14px 34px rgba(139, 53, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.btn-theme:hover,
.nav-auth-buttons .btn-ghost:hover,
.btn-nav:hover {
  border-color: rgba(139, 53, 255, 0.22);
}



#home-view .btn-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-purple-hover), var(--brand-purple-deep));
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(139, 53, 255, 0.35);
  transition: all 0.2s ease;
}

#home-view .btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #b26cff, #741fff);
  box-shadow: 0 12px 32px rgba(139, 53, 255, 0.45);
  transform: translateY(-1px);
}

#home-view .btn-send:disabled {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}

[data-theme="light"] #home-view .btn-send {
  background: linear-gradient(135deg, #9f55ff, #6d12e8);
  color: #ffffff;
}

[data-theme="light"] #home-view .btn-send:disabled {
  background: rgba(0, 0, 0, 0.14);
  color: rgba(0, 0, 0, 0.42);
  box-shadow: none;
}



.prompt-card:hover .prompt-card-icon,
.sidebar-menu-item:hover .smi-icon,
.sidebar-menu-new:hover .smi-icon,
.sidebar-menu-item.active .smi-icon {
  color: var(--accent);
}

.sidebar-menu-item.active,
.sidebar-chat-item.active {
  background: rgba(139, 53, 255, 0.1);
  color: #ffffff;
}

[data-theme="light"] .sidebar-menu-item.active,
[data-theme="light"] .sidebar-chat-item.active {
  color: #000000;
}

.message-user .message-body {
  background: linear-gradient(180deg, rgba(139, 53, 255, 0.18), rgba(139, 53, 255, 0.11));
  border-color: rgba(139, 53, 255, 0.18);
}

[data-theme="light"] .message-user .message-body {
  background: #f4edff;
  border-color: rgba(127, 34, 255, 0.12);
}

/* Auth Split Screen */
.welcome-overlay {
  padding: 0;
  background: #000000;
}

.welcome-backdrop {
  background:
    radial-gradient(circle at 28% 52%, rgba(139, 53, 255, 0.08), transparent 34%),
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.035), transparent 24%),
    #000000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme="light"] .welcome-backdrop {
  background:
    radial-gradient(circle at 28% 52%, rgba(127, 34, 255, 0.08), transparent 34%),
    #000000;
}

.welcome-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  width: min(100vw, 1120px);
  max-width: none;
  min-height: min(760px, 100vh);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

[data-theme="light"] .welcome-panel {
  box-shadow: none;
}

.welcome-close-btn {
  top: 22px;
  right: 22px;
  z-index: 3;
  color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.welcome-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 53, 255, 0.26);
}

.welcome-product-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 54px;
  padding: 48px 64px;
  color: #ffffff;
  overflow: hidden;
}

.welcome-product-side::before {
  content: '';
  position: absolute;
  inset: 12% -10% -18% -16%;
  background: radial-gradient(circle, rgba(139, 53, 255, 0.12), transparent 52%);
  pointer-events: none;
}

.welcome-product-brand,
.welcome-product-copy,
.welcome-preview-card {
  position: relative;
  z-index: 1;
}

.welcome-product-brand {
  position: absolute;
  top: 46px;
  left: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.welcome-product-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #050505;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 30px rgba(139, 53, 255, 0.18);
}

.welcome-product-copy {
  max-width: 610px;
  margin-top: 32px;
}

.welcome-product-copy h2 {
  margin: 0 0 20px;
  font-size: clamp(36px, 4.8vw, 56px);
  line-height: 1.04;
  font-weight: 690;
  letter-spacing: -0.045em;
  color: #ffffff;
}

.welcome-product-copy p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.welcome-preview-card {
  width: min(100%, 584px);
  padding: 52px 32px 32px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.72);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.welcome-preview-dots {
  position: absolute;
  top: 18px;
  left: 24px;
  display: flex;
  gap: 8px;
}

.welcome-preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.welcome-preview-dots span:nth-child(1) { background: #ff5f57; }
.welcome-preview-dots span:nth-child(2) { background: #ffbd2e; }
.welcome-preview-dots span:nth-child(3) { background: #28c840; }

.welcome-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 540;
}

.welcome-preview-row + .welcome-preview-row {
  margin-top: 14px;
}

.welcome-preview-row.featured {
  border-color: rgba(139, 53, 255, 0.44);
  background: rgba(139, 53, 255, 0.105);
  color: #ffffff;
  box-shadow: 0 0 42px rgba(139, 53, 255, 0.1);
}

.welcome-preview-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.055);
}

.welcome-preview-row.featured .welcome-preview-icon {
  color: #d7bdff;
  background: rgba(139, 53, 255, 0.18);
}

.welcome-auth-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 64px 56px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(12, 12, 12, 0.72);
}

.welcome-auth-side .welcome-header {
  align-items: flex-start;
  text-align: left;
  margin-bottom: 38px;
}

.welcome-auth-side .welcome-logo,
.welcome-auth-side .welcome-subtitle,
.welcome-auth-side .welcome-benefits {
  display: none;
}

.welcome-auth-side .welcome-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 720;
  letter-spacing: -0.045em;
}

.welcome-auth-side .welcome-desc {
  max-width: 280px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 15.5px;
  line-height: 1.5;
}

.welcome-auth-side .auth-error {
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(239, 68, 68, 0.26);
  color: #ff8a8a;
}

.welcome-auth-side .welcome-actions {
  gap: 12px;
  margin-bottom: 22px;
}

.welcome-auth-side .welcome-btn {
  min-height: 56px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 650;
}

.welcome-auth-side .welcome-btn-social {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.085);
  color: #ffffff;
}

.welcome-auth-side .welcome-btn-social:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(139, 53, 255, 0.32);
  box-shadow: none;
}

.welcome-auth-side .welcome-btn-primary {
  background: linear-gradient(135deg, #a75fff, #691eea);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(139, 53, 255, 0.28);
}

.welcome-auth-side .welcome-btn-primary:hover {
  background: linear-gradient(135deg, #b87aff, #792bff);
  box-shadow: 0 18px 38px rgba(139, 53, 255, 0.34);
}

.welcome-auth-side .welcome-divider {
  color: rgba(255, 255, 255, 0.38);
}

.welcome-auth-side .welcome-divider::before,
.welcome-auth-side .welcome-divider::after {
  background: rgba(255, 255, 255, 0.08);
}

.welcome-auth-side .welcome-footer-text {
  margin-top: auto;
  padding-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  color: rgba(255, 255, 255, 0.42);
}

.welcome-auth-side .welcome-link {
  color: rgba(255, 255, 255, 0.7);
}

.welcome-auth-side .welcome-link:hover {
  color: #c9a8ff;
}

#auth-modal {
  background: rgba(0, 0, 0, 0.82);
}

#auth-modal .modal-panel {
  max-width: 430px;
  padding: 38px 34px 32px;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.09);
  background: #0d0d0e;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(139, 53, 255, 0.06);
}

#auth-modal .modal-header {
  align-items: flex-start;
  text-align: left;
  margin-bottom: 26px;
}

#auth-modal .modal-logo {
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(139, 53, 255, 0.16);
}

#auth-modal .modal-title {
  font-size: 30px;
  line-height: 1.14;
  font-weight: 720;
  letter-spacing: -0.045em;
  color: #ffffff;
}

#auth-modal .modal-subtitle {
  color: rgba(255, 255, 255, 0.55);
}

#auth-modal .form-label {
  color: rgba(255, 255, 255, 0.72);
}

#auth-modal .form-input {
  min-height: 48px;
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
}

#auth-modal .form-input:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

#auth-modal .form-input:focus {
  border-color: rgba(139, 53, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(139, 53, 255, 0.09);
}

#auth-modal .btn-auth-submit {
  min-height: 50px;
  border-radius: 13px;
  background: linear-gradient(135deg, #a75fff, #691eea);
  box-shadow: 0 14px 30px rgba(139, 53, 255, 0.28);
}

#auth-modal .btn-auth-submit:hover {
  background: linear-gradient(135deg, #b87aff, #792bff);
  box-shadow: 0 18px 38px rgba(139, 53, 255, 0.34);
}

#auth-modal .modal-footer-text,
#auth-modal .btn-link {
  color: rgba(255, 255, 255, 0.58);
}

#auth-modal .btn-link:hover {
  color: #c9a8ff;
}

@media (max-width: 900px) {
  .welcome-panel {
    display: block;
    width: 100%;
    min-height: 100vh;
  }

  .welcome-product-side {
    display: none;
  }

  .welcome-auth-side {
    min-height: 100vh;
    padding: 82px 24px 34px;
    border-left: none;
    background: transparent;
  }

  .welcome-auth-side .welcome-header,
  .welcome-auth-side .welcome-footer-text {
    width: min(100%, 390px);
    margin-left: auto;
    margin-right: auto;
  }

  .welcome-auth-side .welcome-actions,
  .welcome-auth-side .auth-error {
    width: min(100%, 390px);
    margin-left: auto;
    margin-right: auto;
  }

  .welcome-auth-side .welcome-title {
    font-size: 28px;
  }

  .welcome-close-btn {
    top: 18px;
    right: 18px;
  }
}

@media (max-width: 520px) {
  #auth-modal .modal-panel {
    max-width: none;
    padding: 34px 22px 28px;
    border-radius: 20px;
  }
}

/* Standalone Auth Page */
.auth-page-body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 52%, rgba(139, 53, 255, 0.09), transparent 34%),
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.035), transparent 24%),
    #000000;
  color: #ffffff;
}

.auth-page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  min-height: 100vh;
}

.auth-page-product {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 54px;
  padding: 52px 64px;
  overflow: hidden;
}

.auth-page-product::before {
  content: '';
  position: absolute;
  inset: 12% -10% -18% -16%;
  background: radial-gradient(circle, rgba(139, 53, 255, 0.13), transparent 52%);
  pointer-events: none;
}

.auth-page-brand,
.auth-page-copy,
.auth-page-preview {
  position: relative;
  z-index: 1;
}

.auth-page-brand {
  position: absolute;
  top: 48px;
  left: 64px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.auth-page-brand:hover {
  text-decoration: none;
}

.auth-page-brand img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #050505;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 30px rgba(139, 53, 255, 0.18);
}

.auth-page-copy {
  max-width: 640px;
  margin-top: 42px;
}

.auth-page-copy h1 {
  margin: 0 0 20px;
  color: #ffffff;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.04;
  font-weight: 690;
  letter-spacing: -0.045em;
}

.auth-page-copy p {
  max-width: 580px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.auth-page-preview {
  width: min(100%, 584px);
  padding: 52px 32px 32px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.72);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.auth-preview-dots {
  position: absolute;
  top: 18px;
  left: 24px;
  display: flex;
  gap: 8px;
}

.auth-preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.auth-preview-dots span:nth-child(1) { background: #ff5f57; }
.auth-preview-dots span:nth-child(2) { background: #ffbd2e; }
.auth-preview-dots span:nth-child(3) { background: #28c840; }

.auth-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 540;
}

.auth-preview-row + .auth-preview-row {
  margin-top: 14px;
}

.auth-preview-row.featured {
  border-color: rgba(139, 53, 255, 0.44);
  background: rgba(139, 53, 255, 0.105);
  color: #ffffff;
  box-shadow: 0 0 42px rgba(139, 53, 255, 0.1);
}

.auth-preview-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.055);
  flex: 0 0 auto;
}

.auth-preview-row.featured .auth-preview-icon {
  color: #d7bdff;
  background: rgba(139, 53, 255, 0.18);
}

.auth-page-panel {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 56px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(12, 12, 12, 0.72);
}

.auth-panel-inner {
  width: 100%;
}

.auth-panel-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 38px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 13px;
  font-weight: 560;
}

.auth-panel-back:hover {
  color: #ffffff;
  text-decoration: none;
}

.auth-panel-header {
  margin-bottom: 34px;
}

.auth-panel-header h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(25px, 2.15vw, 30px);
  line-height: 1.12;
  font-weight: 720;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.auth-panel-header p {
  color: rgba(255, 255, 255, 0.56);
  font-size: 15.5px;
  line-height: 1.5;
}

.auth-page-panel .auth-error {
  margin-bottom: 14px;
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(239, 68, 68, 0.26);
  color: #ff8a8a;
}

.auth-social-stack,
.auth-page-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-page-button {
  display: flex;
  min-height: 54px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.auth-page-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.auth-page-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.auth-page-button-social {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.085);
  color: #ffffff;
}

.auth-page-button-social:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(139, 53, 255, 0.32);
}

.auth-page-button-primary {
  margin-top: 2px;
  background: linear-gradient(135deg, #a75fff, #691eea);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(139, 53, 255, 0.28);
}

.auth-page-button-primary:not(:disabled):hover {
  background: linear-gradient(135deg, #b87aff, #792bff);
  box-shadow: 0 18px 38px rgba(139, 53, 255, 0.34);
}

.auth-page-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 12px;
}

.auth-page-divider::before,
.auth-page-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-field {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 560;
}

.auth-field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
  font: inherit;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.auth-field input:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.auth-field input:focus {
  border-color: rgba(139, 53, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(139, 53, 255, 0.09);
}

.auth-toggle-copy,
.auth-legal {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.5;
}

.auth-toggle-copy {
  margin-top: 18px;
  text-align: center;
}

.auth-toggle-copy button {
  border: none;
  background: transparent;
  color: #c9a8ff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.auth-legal {
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-legal a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .auth-page-body {
    overflow: auto;
  }

  .auth-page-shell {
    display: block;
  }

  .auth-page-product {
    display: none;
  }

  .auth-page-panel {
    min-height: 100vh;
    padding: 64px 24px 34px;
    border-left: none;
    background: transparent;
  }

  .auth-panel-inner {
    max-width: 390px;
    margin: 0 auto;
  }
}

@media (max-width: 390px) {
  .auth-panel-header h2 {
    font-size: 23px;
  }
}

/* ============================================
   Conversation-First UX Refactor
   ============================================ */
.workspace-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Chat Messages */
.chat-messages-scroll {
  flex: 0;
  opacity: 0;
  transition: flex 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Welcome Area */
.workspace-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: flex 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, margin 0.35s ease;
  padding-bottom: 12px;
}
.workspace-welcome .welcome-title {
  transition: opacity 0.3s ease;
}

/* Input Dock */
.workspace-input-dock {
  flex-shrink: 0;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

/* Bottom Spacer */
.home-bottom-spacer {
  flex: 1.2;
  transition: flex 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Safety Disclaimer */
.safety-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 12px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.4s ease, max-height 0.4s ease;
  pointer-events: none;
}

/* When Chatting State */
.workspace-view.is-chatting .chat-messages-scroll {
  flex: 1;
  opacity: 1;
}

.workspace-view.is-chatting .workspace-welcome {
  flex: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
  overflow: hidden;
}

.workspace-view.is-chatting .home-bottom-spacer {
  flex: 0;
}

.workspace-view.is-chatting .safety-disclaimer {
  opacity: 0.7;
  max-height: 20px;
}

.workspace-view.is-chatting #home-privacy-pill {
  opacity: 0;
  pointer-events: none;
}
