/**
 * ═══════════════════════════════════════════════════════════════
 * VYOMA AI — Premium Light Theme
 * Design System: Apple + Linear + Notion + Modern AI SaaS
 *
 * Principles: Clean, calm, intelligent, future-focused
 * ═══════════════════════════════════════════════════════════════
 */

/* ── CSS Variables (Design Tokens) ─────────────────────────── */
:root {
  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Surfaces */
  --bg-body: #f8f9fb;
  --bg-sidebar: #ffffff;
  --bg-main: #f8f9fb;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f3f4f6;
  --bg-input: #f3f4f6;
  --bg-input-focus: #ffffff;
  --bg-code: #f5f5f7;

  /* Glass */
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-strong: rgba(255, 255, 255, 0.88);

  /* Accent — soft violet */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --accent-medium: rgba(99, 102, 241, 0.12);
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.10);

  /* Text hierarchy */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-faint: #d1d5db;

  /* Borders */
  --border: #e5e7eb;
  --border-light: #f0f0f2;
  --border-accent: rgba(99, 102, 241, 0.25);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-accent: 0 4px 14px rgba(99, 102, 241, 0.12);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Layout */
  --sidebar-w: 280px;
  --header-h: 56px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.2s var(--ease);
  --transition-slow: all 0.35s var(--ease);
}

/* ── [PATCH v3] Feature: Dark Mode — full dark theme ────────── */
:root.dark {
  /* Surfaces */
  --bg-body: #0d0d0f;
  --bg-sidebar: #141416;
  --bg-main: #0d0d0f;
  --bg-surface: #1a1a1e;
  --bg-surface-hover: #232328;
  --bg-input: #1a1a1e;
  --bg-input-focus: #232328;
  --bg-code: #16161a;

  /* Glass */
  --bg-glass: rgba(20, 20, 22, 0.72);
  --bg-glass-strong: rgba(20, 20, 22, 0.92);

  /* Accent — keep brand violet */
  --accent: #818cf8;
  --accent-light: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.10);
  --accent-medium: rgba(129, 140, 248, 0.14);
  --accent-hover: #6366f1;
  --accent-glow: rgba(129, 140, 248, 0.12);

  /* Text hierarchy */
  --text-primary: #f0f0f3;
  --text-secondary: #a1a1aa;
  --text-muted: #63636e;
  --text-faint: #3f3f46;

  /* Borders */
  --border: #27272a;
  --border-light: #1e1e22;
  --border-accent: rgba(129, 140, 248, 0.25);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-accent: 0 4px 14px rgba(129, 140, 248, 0.15);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  display: flex;
  height: calc(var(--vh, 1vh) * 100);
  /* [FIX #1] Dynamic viewport height */
  overflow: hidden;
  line-height: 1.6;
  font-size: 15px;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-faint);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Sidebar Overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.20);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  position: relative;
  z-index: 100;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: calc(var(--vh, 1vh) * 100);
  /* [FIX #1] Dynamic viewport height */
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

/* ── Brand ─────────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border-light);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 32px;
  height: 32px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.sidebar-close {
  display: none;
}

/* ── Icon Button ───────────────────────────────────────────── */
.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  border-color: var(--border);
}

/* ── New Chat Button ───────────────────────────────────────── */
.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 8px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.new-chat-btn svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.new-chat-btn:hover {
  background: var(--accent-soft);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
}

/* ── Search ────────────────────────────────────────────────── */
.search-wrapper {
  position: relative;
  margin: 0 12px 8px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrapper input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition);
}

.search-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-wrapper input:focus {
  border-color: var(--border-accent);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── Chat List ─────────────────────────────────────────────── */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.chat-item:hover {
  background: var(--bg-surface-hover);
}

.chat-item.active {
  background: var(--accent-soft);
}

.chat-item.active .chat-item-title {
  color: var(--accent);
  font-weight: 500;
}

.chat-item-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-item.active .chat-item-icon {
  color: var(--accent);
}

.chat-item-title {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

/* Inline rename input */
.chat-item-title-input {
  flex: 1;
  background: var(--bg-input-focus);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.82rem;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-item-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.chat-item:hover .chat-item-actions {
  opacity: 1;
}

.chat-action-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chat-action-btn svg {
  width: 13px;
  height: 13px;
}

.chat-action-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
}

.chat-action-btn.delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* ── Sidebar Footer ────────────────────────────────────────── */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.footer-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN AREA
   ═══════════════════════════════════════════════════════════════ */

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(var(--vh, 1vh) * 100);
  /* [FIX #1] Dynamic viewport height */
  position: relative;
  z-index: 1;
  min-width: 0;
  background: var(--bg-main);
}

/* ── Header ────────────────────────────────────────────────── */
.main-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hamburger {
  display: none;
}

.chat-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* ── Share Dropdown ──────────────────────────────────────────── */
.share-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  animation: dropIn 0.18s var(--ease);
}

.share-dropdown.hidden {
  display: none;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.dropdown-item:hover svg {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   MESSAGES CONTAINER
   ═══════════════════════════════════════════════════════════════ */

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  scroll-behavior: smooth;
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v14] Feature: Ultra-Premium New Chat Landing UI
   ═══════════════════════════════════════════════════════════════ */

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 60px;
  min-height: 65vh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.welcome-screen.hidden {
  display: none;
}

/* ─── Radial glow backdrop ─── */
.hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle,
      rgba(99, 102, 241, 0.08) 0%,
      rgba(139, 92, 246, 0.04) 40%,
      transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  animation: heroGlowPulse 4s ease-in-out infinite alternate;
}

@keyframes heroGlowPulse {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -55%) scale(1);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -55%) scale(1.1);
  }
}

/* ─── Logo wrapper with shimmer ring ─── */
.hero-logo-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 28px;
  animation: heroLogoIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroLogoIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-logo-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      rgba(99, 102, 241, 0.3),
      rgba(139, 92, 246, 0.15),
      rgba(168, 85, 247, 0.3),
      rgba(99, 102, 241, 0.05),
      rgba(99, 102, 241, 0.3));
  animation: heroRingSpin 6s linear infinite;
  z-index: 0;
}

@keyframes heroRingSpin {
  to {
    transform: rotate(360deg);
  }
}

.hero-logo-ring::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--bg-main);
  z-index: 1;
}

.hero-logo-wrapper .welcome-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  margin-bottom: 0;
  filter: none;
}

.hero-logo-img {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50%;
  filter: drop-shadow(0 4px 16px rgba(99, 102, 241, 0.25));
}

/* ─── Headline ─── */
.hero-headline {
  font-size: 1.85rem;
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  line-height: 1.25;
  animation: heroFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.hero-accent-text {
  background: linear-gradient(135deg, #6366f1, #a855f7, #6366f1);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroGradientShift 4s ease-in-out infinite;
}

@keyframes heroGradientShift {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

/* ─── Subtitle ─── */
.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 440px;
  margin-bottom: 40px;
  line-height: 1.65;
  font-weight: 400;
  animation: heroFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Suggestion cards grid ─── */
.hero-suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 560px;
  width: 100%;
  animation: heroFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

/* ─── Glassmorphism suggestion card ─── */
.hero-chip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 0 rgba(99, 102, 241, 0);
  position: relative;
  overflow: hidden;
}

.hero-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-chip:hover::before {
  opacity: 1;
}

.hero-chip:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-3px);
  box-shadow:
    0 8px 24px rgba(99, 102, 241, 0.1),
    0 0 0 1px rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
}

/* Icon container */
.hero-chip-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.hero-chip-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.hero-chip:hover .hero-chip-icon {
  background: var(--accent);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.hero-chip:hover .hero-chip-icon svg {
  color: white;
}

/* Text area */
.hero-chip-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hero-chip-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.hero-chip-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  font-weight: 400;
}

.hero-chip:hover .hero-chip-desc {
  color: var(--text-secondary);
}

/* ─── Floating particles ─── */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.hero-particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: heroParticleFloat linear infinite;
}

@keyframes heroParticleFloat {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }

  15% {
    opacity: 0.3;
  }

  85% {
    opacity: 0.15;
  }

  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(1);
  }
}

/* ─── Dark mode enhancements ─── */
[data-theme="dark"] .hero-glow {
  background: radial-gradient(circle,
      rgba(99, 102, 241, 0.12) 0%,
      rgba(139, 92, 246, 0.06) 40%,
      transparent 70%);
}

[data-theme="dark"] .hero-logo-ring {
  background: conic-gradient(from 0deg,
      rgba(99, 102, 241, 0.45),
      rgba(139, 92, 246, 0.2),
      rgba(168, 85, 247, 0.45),
      rgba(99, 102, 241, 0.08),
      rgba(99, 102, 241, 0.45));
}

[data-theme="dark"] .hero-logo-img {
  filter: drop-shadow(0 4px 20px rgba(139, 92, 246, 0.35));
}

[data-theme="dark"] .hero-chip {
  background: rgba(30, 30, 48, 0.5);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .hero-chip:hover {
  background: rgba(40, 40, 64, 0.6);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .hero-chip-icon {
  background: rgba(99, 102, 241, 0.12);
}

/* ─── Responsive: Mobile ─── */
@media (max-width: 768px) {
  .welcome-screen {
    padding: 36px 18px 48px;
    min-height: 55vh;
  }

  .hero-glow {
    width: 280px;
    height: 280px;
  }

  .hero-logo-wrapper {
    width: 76px;
    height: 76px;
    margin-bottom: 22px;
  }

  .hero-logo-img {
    width: 48px !important;
    height: 48px !important;
  }

  .hero-headline {
    font-size: 1.4rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    margin-bottom: 28px;
  }

  .hero-suggestions {
    gap: 10px;
  }

  .hero-chip {
    padding: 13px 14px;
  }

  .hero-chip-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
  }

  .hero-chip-icon svg {
    width: 16px;
    height: 16px;
  }

  .hero-chip-title {
    font-size: 0.78rem;
  }

  .hero-chip-desc {
    font-size: 0.68rem;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: 1.2rem;
  }

  .hero-subtitle {
    font-size: 0.8rem;
  }

  .hero-suggestions {
    grid-template-columns: 1fr;
    max-width: 320px;
  }

  .hero-chip {
    padding: 14px 15px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MESSAGES
   ═══════════════════════════════════════════════════════════════ */

.messages {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.message {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  animation: msgFade 0.3s var(--ease);
  position: relative;
}

@keyframes msgFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User message */
.message.user {
  flex-direction: row-reverse;
  text-align: right;
}

.message.user .message-content {
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.10);
  border-radius: var(--radius-lg) var(--radius-lg) 6px var(--radius-lg);
  padding: 12px 16px;
  text-align: left;
  max-width: 72%;
}

/* Assistant message */
/* [PATCH v2] Feature: Bubble Actions — buttons moved outside, normal padding restored */
.message.assistant .message-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 6px;
  padding: 12px 16px;
  max-width: 72%;
  box-shadow: var(--shadow-xs);
  position: relative;
}

/* Avatars */
.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 600;
}

.message.user .message-avatar {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.message-avatar svg {
  width: 16px;
  height: 16px;
}

/* Message text */
.message-text {
  font-size: 0.88rem;
  line-height: 1.72;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message-text p {
  margin-bottom: 10px;
}

.message-text p:last-child {
  margin-bottom: 0;
}

/* Code blocks */
.message-text pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.message-text code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.83rem;
}

.message-text :not(pre)>code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.82rem;
}

/* Lists */
.message-text ul,
.message-text ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.message-text li {
  margin-bottom: 4px;
}

/* Headings in messages */
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5 {
  margin-top: 12px;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 600;
}

/* Strong / Bold */
.message-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Copy button — base (user messages: top-right, original position) ── */
/* [PATCH v2] Feature: More Visible Copy Button — larger size, higher contrast */
.message-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.18s ease-out,
    background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
  box-shadow: var(--shadow-xs);
}

/* [PATCH v2] Feature: More Visible Copy Button — larger icon */
.message-copy-btn svg {
  width: 15px;
  height: 15px;
}

/* User messages — hover shows copy (original behaviour) */
.message.user:hover .message-copy-btn {
  opacity: 1;
}

/* ── [PATCH v3] Feature: Bubble Actions — enhanced glass container ── */
.bubble-actions {
  position: absolute;
  bottom: -10px;
  left: 44px;
  display: flex;
  gap: 6px;
  z-index: 2;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 3px;
}

/* [PATCH v3] Override: buttons inside .bubble-actions are static + always visible */
.bubble-actions .message-copy-btn,
.bubble-actions .message-regen-btn {
  position: static;
  opacity: 1;
  transform: none;
}

/* [PATCH v3] Feature: Bubble Action Buttons — subtle hover scale */
.bubble-actions .message-copy-btn:hover,
.bubble-actions .message-regen-btn:hover,
.bubble-actions .importance-menu-btn:hover {
  transform: scale(1.05);
}

/* Hover highlight (both user & assistant) */
.message-copy-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* Copied state (both user & assistant) */
.message-copy-btn.copied {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  opacity: 1;
  transform: translateY(0);
}

/* ── [PATCH v2] Regenerate Button — base styles ────── */
.message-regen-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: opacity 0.2s var(--ease), transform 0.18s ease-out,
    background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
  box-shadow: var(--shadow-xs);
}

/* [PATCH v2] Regenerate Button — icon size */
.message-regen-btn svg {
  width: 15px;
  height: 15px;
}

/* [PATCH v3] Regenerate Button — hover highlight */
.message-regen-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* ── [PATCH v3] Feature: Message Marking — importance visual classes ── */

/* ⭐ Important — purple left border + subtle glow */
.message .message-content.mark-important {
  border-left: 3px solid var(--accent);
  box-shadow: -2px 0 12px rgba(99, 102, 241, 0.12), var(--shadow-xs);
}

/* 🔽 Least Favourite — faint grey left border */
.message .message-content.mark-least {
  border-left: 3px solid var(--text-muted);
}

/* 🚫 Dislike — reduced opacity + desaturated */
.message .message-content.mark-dislike {
  opacity: 0.6;
  filter: saturate(0.5);
}

/* ── [PATCH v3] Feature: Message Marking — 3-dot menu button ── */
.importance-menu-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 1px;
  line-height: 1;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.15s var(--ease);
  box-shadow: var(--shadow-xs);
  position: relative;
}

.importance-menu-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* ── [PATCH v3] Feature: Message Marking — premium dropdown menu ── */
.importance-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
  animation: dropIn 0.18s var(--ease);
  display: none;
}

.importance-menu.open {
  display: block;
}

.importance-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  text-align: left;
}

.importance-menu-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.importance-menu-item .mark-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

/* [PATCH v3] Active state indicators in menu */
.importance-menu-item.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
}

/* [PATCH v3] User message bubble-actions (same style as assistant) */
.message.user .bubble-actions {
  position: absolute;
  bottom: -10px;
  right: 44px;
  left: auto;
  display: flex;
  gap: 6px;
  z-index: 2;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 3px;
}

.message.user .bubble-actions .message-copy-btn {
  position: static;
  opacity: 1;
  transform: none;
}

/* ── [PATCH v3] Feature: Settings Modal ── */
.settings-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.settings-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.settings-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Settings modal overlay */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease);
}

.settings-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Settings modal */
.settings-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: dropIn 0.25s var(--ease);
}

.settings-modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.settings-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.settings-close-btn svg {
  width: 16px;
  height: 16px;
}

.settings-group {
  margin-bottom: 20px;
}

.settings-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: block;
}

.theme-options {
  display: flex;
  gap: 8px;
}

.theme-option {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.theme-option:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.theme-option.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ── [PATCH v4] Feature: Merge Chats — modal styles ────────── */

.merge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 310;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease);
}

.merge-overlay.hidden {
  display: none;
}

.merge-modal {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 92%;
  max-width: 440px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: dropIn 0.25s var(--ease);
  overflow: hidden;
}

.merge-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.merge-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.merge-subtitle {
  padding: 8px 24px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* [PATCH v4] Scrollable chat list */
.merge-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  margin-bottom: 8px;
  max-height: 45vh;
}

.merge-chat-list::-webkit-scrollbar {
  width: 4px;
}

.merge-chat-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* [PATCH v4] Individual chat item row */
.merge-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
  user-select: none;
}

.merge-chat-item:hover {
  background: var(--bg-surface-hover);
}

/* [PATCH v4] Custom checkbox */
.merge-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--bg-input);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.merge-chat-item.selected .merge-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.merge-chat-item.selected .merge-checkbox::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.merge-chat-info {
  flex: 1;
  min-width: 0;
}

.merge-chat-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.merge-chat-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.merge-chat-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  flex-shrink: 0;
}

/* [PATCH v4] Footer buttons */
.merge-modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

.merge-btn-secondary {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.merge-btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.merge-btn-primary {
  flex: 1;
  padding: 10px 16px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: white;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-accent);
}

.merge-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.merge-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* [PATCH v4] Empty state */
.merge-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── [PATCH v5] Feature: Merged Summary Card ───────────────── */

.merged-summary-card {
  max-width: 800px;
  margin: 12px auto 4px;
  width: 100%;
  padding: 0 18px;
  animation: msgFade 0.3s var(--ease);
}

.merged-summary-card.hidden {
  display: none;
}

/* Collapsed toggle bar */
.merged-summary-collapsed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.merged-summary-collapsed:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-accent);
}

.merged-summary-icon {
  font-size: 1rem;
}

.merged-summary-label {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.merged-summary-arrow {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.2s var(--ease);
}

.merged-summary-card.expanded .merged-summary-arrow {
  transform: rotate(90deg);
}

/* Expanded body */
.merged-summary-expanded {
  margin-top: 8px;
  padding: 16px 18px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: dropIn 0.2s var(--ease);
}

.merged-summary-expanded.hidden {
  display: none;
}

/* Meta rows */
.merged-summary-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.merged-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.merged-meta-row .meta-icon {
  font-size: 0.85rem;
  width: 20px;
  text-align: center;
}

.merged-meta-row .meta-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* AI Understanding section */
.merged-summary-ai {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.merged-ai-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.merged-ai-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.merged-ai-text.loading {
  color: var(--text-muted);
  font-style: italic;
}

/* ── [PATCH v6] Fix: Merged messages inside expanded body ──── */
.merged-expand-messages {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  max-height: 60vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.merged-expand-messages:empty {
  display: none;
}

/* Collapse button */
.merged-summary-collapse-btn {
  display: block;
  margin: 14px auto 0;
  padding: 6px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.merged-summary-collapse-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ── [PATCH v5] Feature: Sidebar Merged Tag ────────────────── */

.chat-item-merged-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   TYPING INDICATOR
   ═══════════════════════════════════════════════════════════════ */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  animation: msgFade 0.3s var(--ease);
}

.typing-indicator.hidden {
  display: none;
}

.typing-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.typing-avatar svg {
  width: 30px;
  height: 30px;
}

.thinking-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 6px;
  box-shadow: var(--shadow-xs);
}

/* Spinning SVG icon */
.thinking-spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #9ca3af;
  animation: thinkingSpin 1s linear infinite;
}

/* "Thinking" base text */
.thinking-text {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 400;
  letter-spacing: 0.01em;
  user-select: none;
}

/* Cycling dots: driven by JS setInterval via data-dots attribute */
.thinking-text::before {
  content: 'Thinking';
}

.thinking-text::after {
  content: attr(data-dots);
  display: inline-block;
  min-width: 1.8em;
  text-align: left;
  vertical-align: bottom;
}

@keyframes thinkingSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Keep typingBounce — used elsewhere */
@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}


/* ═══════════════════════════════════════════════════════════════
   INPUT BAR
   ═══════════════════════════════════════════════════════════════ */

.input-bar {
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  /* [FIX #5] Safe area */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(to top, var(--bg-body) 60%, transparent);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 800px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
}

.input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  /* [FIX #7] ≥16px prevents iOS auto-zoom on focus */
  resize: none;
  max-height: 180px;
  overflow-y: auto;
  /* [FIX #4] Allow scrolling inside textarea when text is long */
  line-height: 1.5;
  padding: 4px 0;
}

.input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.send-btn svg {
  width: 17px;
  height: 17px;
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: var(--text-muted);
}

.send-btn:not(:disabled):hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-accent);
  transform: scale(1.05);
}

.input-disclaimer {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   [INPUT CONTROLS] Gemini-style — File upload, Thinking mode, Mic/Send
   ═══════════════════════════════════════════════════════════════ */

/* — File upload + generic icon button — */
.input-icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.input-icon-btn svg {
  width: 16px;
  height: 16px;
}

.input-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* — Mic / Send icon swap — */
.send-btn .icon-mic,
.send-btn .icon-send {
  width: 17px;
  height: 17px;
}

.send-btn .icon-mic.hidden,
.send-btn .icon-send.hidden {
  display: none;
}

.send-btn.has-text {
  background: var(--accent);
}

/* When mic mode (empty input), show as ghost */
.send-btn:not(.has-text) {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  opacity: 1;
  cursor: pointer;
}

.send-btn:not(.has-text):hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* — Thinking mode inline dropdown — */
.thinking-select {
  position: relative;
  flex-shrink: 0;
}

.thinking-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.thinking-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.thinking-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.thinking-caret {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.thinking-toggle.open .thinking-caret {
  transform: rotate(180deg);
}

/* Dropdown menu — opens above */
.thinking-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 90;
  animation: dropIn 0.15s ease;
}

.thinking-dropdown.hidden {
  display: none;
}

.thinking-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font);
}

.thinking-option:hover {
  background: var(--bg-surface-hover);
}

.thinking-opt-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.thinking-opt-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.thinking-opt-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.thinking-opt-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.thinking-opt-check {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.thinking-opt-check.hidden {
  visibility: hidden;
}

/* Dark theme shadow boost */
[data-theme="dark"] .thinking-dropdown {
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* — File preview bar — */
.file-preview-bar {
  max-width: 800px;
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 8px 0;
  overflow-x: auto;
}

.file-preview-bar.hidden {
  display: none;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.file-preview-item .remove-file {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  font-size: 0.7rem;
  padding: 0;
}

.file-preview-item .remove-file:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .input-icon-btn {
    width: 40px;
    height: 40px;
  }

  .input-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .thinking-select {
    display: none;
    /* Hide on mobile — mode pills below handle it */
  }

  .thinking-toggle {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .thinking-dropdown {
    min-width: 190px;
    right: -40px;
  }

  .thinking-option {
    padding: 12px 14px;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [SMART MODES] Perplexity-style Query Mode Pills
   ═══════════════════════════════════════════════════════════════ */

.sqm-bar {
  max-width: 800px;
  width: 100%;
  margin-top: 8px;
}

.sqm-scroll {
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}

.sqm-scroll::-webkit-scrollbar {
  display: none;
}

/* Pill button */
.sqm-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sqm-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sqm-pill:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.sqm-pill:hover svg {
  opacity: 1;
}

/* Active state — accent glow */
.sqm-pill.sqm-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 16px rgba(99, 102, 241, 0.35);
}

.sqm-pill.sqm-active svg {
  opacity: 1;
  stroke: #fff;
}

.sqm-pill.sqm-active:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Ripple animation on press */
.sqm-pill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  border-radius: inherit;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sqm-pill:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: opacity 0s, transform 0s;
}

/* Auto-detected mode label */
.sqm-auto-label {
  max-width: 800px;
  width: 100%;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  animation: sqmFadeIn 0.3s ease;
}

.sqm-auto-label.hidden {
  display: none;
}

.sqm-auto-label::before {
  content: '✦';
  font-size: 0.65rem;
}

/* Suggestions container */
.sqm-suggestions {
  max-width: 800px;
  width: 100%;
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
  animation: sqmFadeIn 0.25s ease;
}

.sqm-suggestions.hidden {
  display: none;
}

@keyframes sqmFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sqm-suggestion {
  padding: 6px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sqm-suggestion:hover {
  border-color: var(--accent-light);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Dark mode enhancements */
[data-theme="dark"] .sqm-pill {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sqm-pill:hover {
  background: rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .sqm-suggestion {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sqm-suggestion:hover {
  background: rgba(99, 102, 241, 0.12);
}

/* Mobile: horizontal scroll with bigger tap targets */
@media (max-width: 768px) {
  .sqm-scroll {
    justify-content: flex-start;
    padding-left: 4px;
  }

  .sqm-pill {
    padding: 9px 16px;
    font-size: 0.78rem;
    min-height: 40px;
    flex: 0 0 auto;
  }

  .sqm-pill svg {
    width: 15px;
    height: 15px;
  }

  .sqm-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .sqm-suggestions::-webkit-scrollbar {
    display: none;
  }

  .sqm-suggestion {
    min-height: 36px;
    padding: 8px 14px;
    flex-shrink: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [CONTINUE] Continue Generating Button
   ═══════════════════════════════════════════════════════════════ */

.continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: sqmFadeIn 0.3s ease;
}

.continue-btn:hover {
  background: var(--accent-medium);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.continue-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.continue-btn svg {
  width: 14px;
  height: 14px;
}

/* Loading state */
.continue-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 16px;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  animation: sqmFadeIn 0.3s ease;
}

.continue-loading::after {
  content: '';
  animation: continueDots 1.2s steps(4, end) infinite;
}

@keyframes continueDots {
  0% {
    content: '';
  }

  25% {
    content: '.';
  }

  50% {
    content: '..';
  }

  75% {
    content: '...';
  }
}

[data-theme="dark"] .continue-btn {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--accent-light);
}

[data-theme="dark"] .continue-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.toast.hidden {
  display: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Toast type variants */
.toast.toast-info {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.08);
}

.toast.toast-success {
  border-color: rgba(34, 197, 94, 0.3);
  color: #16a34a;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.08);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --sidebar-w: 280px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: calc(var(--vh, 1vh) * 100);
    /* [FIX #1] Dynamic viewport height */
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .main-header {
    padding: 0 14px;
  }


  .message.user .message-content,
  .message.assistant .message-content {
    max-width: 88%;
  }

  .messages {
    padding: 0 10px;
  }

  .input-bar {
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
    /* [FIX #5] Safe area */
  }
}

@media (max-width: 480px) {

  .message-text {
    font-size: 0.85rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v7] Feature: Recycle Bin Modal
   ═══════════════════════════════════════════════════════════════ */

.recycle-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s var(--ease);
}

.recycle-overlay.hidden {
  display: none;
}

.recycle-modal {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: dropIn 0.25s var(--ease);
}

.recycle-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.recycle-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.recycle-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.recycle-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 50vh;
}

.recycle-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 32px 0;
}

.recycle-chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: var(--transition);
}

.recycle-chat-item:hover {
  border-color: var(--border-accent);
}

.recycle-chat-info {
  flex: 1;
  min-width: 0;
}

.recycle-chat-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recycle-chat-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.recycle-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.recycle-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  padding: 0;
}

.recycle-action-btn.restore:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.5);
  color: #22c55e;
}

.recycle-action-btn.export:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-accent);
  color: var(--accent);
}

.recycle-action-btn.perm-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.recycle-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.recycle-btn-danger {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.recycle-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
}

.recycle-btn-accent {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.recycle-btn-accent:hover {
  background: var(--accent);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v12] Feature: Recycle Bin UI – Professional Overhaul
   ═══════════════════════════════════════════════════════════════ */

/* Enhanced modal shadow and border */
.recycle-modal {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .recycle-modal {
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Increased spacing between chat entries + divider line */
.recycle-list {
  gap: 0;
}

.recycle-chat-item {
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.recycle-chat-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Better title contrast */
.recycle-chat-title {
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Better date contrast */
.recycle-chat-date {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-top: 3px;
  opacity: 0.8;
}

/* Actions area: increased gap */
.recycle-actions {
  gap: 8px;
}

/* Professional button base: larger, glassmorphism, pill-rounded */
.recycle-action-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 0;
  line-height: 0;
  transition: all 0.2s var(--ease);
}

.recycle-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.recycle-action-btn:hover {
  transform: scale(1.08);
}

.recycle-action-btn.restore:hover {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.15);
}

.recycle-action-btn.export:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12);
}

.recycle-action-btn.perm-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.15);
}

/* Footer buttons: professional with inline SVG space */
.recycle-btn-danger,
.recycle-btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.recycle-btn-danger svg,
.recycle-btn-accent svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ─── Recycle Confirmation Modal ─── */
.recycle-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s var(--ease);
}

.recycle-confirm-overlay.hidden {
  display: none;
}

.recycle-confirm-modal {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px 24px;
  width: 88%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  animation: dropIn 0.25s var(--ease);
}

.recycle-confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.recycle-confirm-icon svg {
  width: 28px;
  height: 28px;
}

.recycle-confirm-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.recycle-confirm-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 22px;
  line-height: 1.5;
}

.recycle-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.rcf-btn {
  padding: 10px 22px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rcf-btn-cancel {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.rcf-btn-cancel:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.rcf-btn-delete {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.rcf-btn-delete:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* Dark mode enhancements */
[data-theme="dark"] .recycle-confirm-modal {
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .recycle-confirm-icon {
  background: rgba(239, 68, 68, 0.15);
}

/* Mobile */
@media (max-width: 768px) {
  .recycle-action-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .recycle-confirm-modal {
    width: 92%;
    padding: 28px 22px 20px;
  }

  .rcf-btn {
    padding: 9px 18px;
    font-size: 0.8rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v8] Feature: Scroll-To-Bottom Floating Button
   ═══════════════════════════════════════════════════════════════ */

.scroll-down-btn {
  position: absolute;
  bottom: 90px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 50;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), background 0.2s;
  opacity: 1;
  transform: translateY(0);
}

.scroll-down-btn.hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.scroll-down-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.scroll-down-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.scroll-down-btn:hover svg {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v8] Feature: Good/Bad Feedback Buttons
   ═══════════════════════════════════════════════════════════════ */

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.feedback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.78rem;
  padding: 0;
  opacity: 0.5;
}

.feedback-btn:hover {
  opacity: 1;
  background: var(--bg-glass);
  border-color: var(--border);
}

.feedback-btn.good:hover,
.feedback-btn.good.active {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  opacity: 1;
}

.feedback-btn.bad:hover,
.feedback-btn.bad.active {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  opacity: 1;
}

.feedback-btn svg {
  width: 14px;
  height: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v9] Feature: Bubble Action Bar UI Polish
   ═══════════════════════════════════════════════════════════════ */

/* Enhanced action bar container — more spacious, glassmorphism border */
.bubble-actions {
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: msgFade 0.2s var(--ease);
}

/* User variant inherits the same polish */
.message.user .bubble-actions {
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Unified button baseline — all action buttons get consistent size & spacing */
.bubble-actions .message-copy-btn,
.bubble-actions .message-regen-btn,
.bubble-actions .feedback-btn,
.bubble-actions .importance-menu-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  padding: 0;
  flex-shrink: 0;
}

/* Unified hover — subtle lift + glass background */
.bubble-actions .message-copy-btn:hover,
.bubble-actions .message-regen-btn:hover,
.bubble-actions .feedback-btn:hover,
.bubble-actions .importance-menu-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border);
  color: var(--text-primary);
  transform: scale(1.06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Unified icon sizing inside action bar */
.bubble-actions .message-copy-btn svg,
.bubble-actions .message-regen-btn svg {
  width: 14px;
  height: 14px;
}

/* Feedback buttons inside action bar inherit size */
.bubble-actions .feedback-btn {
  opacity: 0.55;
}

.bubble-actions .feedback-btn:hover {
  opacity: 1;
}

/* Importance menu button consistency */
.bubble-actions .importance-menu-btn {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0;
}

/* Feedback actions container — tighter inside bubble-actions */
.bubble-actions .feedback-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 0;
}

/* Dark mode enhanced contrast */
[data-theme="dark"] .bubble-actions,
[data-theme="dark"] .message.user .bubble-actions {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .bubble-actions .message-copy-btn:hover,
[data-theme="dark"] .bubble-actions .message-regen-btn:hover,
[data-theme="dark"] .bubble-actions .feedback-btn:hover,
[data-theme="dark"] .bubble-actions .importance-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

/* Mobile responsiveness — ensure minimum tap area */
@media (max-width: 768px) {
  .bubble-actions {
    gap: 3px;
    padding: 3px 5px;
  }

  .bubble-actions .message-copy-btn,
  .bubble-actions .message-regen-btn,
  .bubble-actions .feedback-btn,
  .bubble-actions .importance-menu-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH vFix] Bubble Action Bar — Spacing & Alignment Fix
   ChatGPT-style: actions flow BELOW bubble with clear gap
   ═══════════════════════════════════════════════════════════════ */

/* Make message rows wrap so bubble-actions can sit on its own line */
.message {
  flex-wrap: wrap;
}

/* Actions bar: remove absolute, flow naturally below bubble with gap */
.bubble-actions {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  order: 3;
  flex-basis: 100%;
  margin-top: 6px;
  padding-left: 44px;
  gap: 6px;
  padding-top: 5px;
  padding-bottom: 5px;
  padding-right: 8px;
  border-radius: 10px;
  align-items: center;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

/* User message: actions right-aligned, skip past user avatar on right */
.message.user .bubble-actions {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  order: 3;
  flex-basis: 100%;
  margin-top: 6px;
  padding-right: 44px;
  padding-left: 8px;
  gap: 6px;
  justify-content: flex-end;
  border-radius: 10px;
  align-items: center;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

/* Individual buttons get subtle styling */
.bubble-actions .message-copy-btn,
.bubble-actions .message-regen-btn,
.bubble-actions .importance-menu-btn {
  border-radius: 8px;
  box-shadow: none;
}

/* Feedback group gap */
.bubble-actions .feedback-actions {
  gap: 4px;
}

/* Reset message bottom margin — no longer need extra space */
.message {
  margin-bottom: 0;
  padding-bottom: 16px;
}

/* Mobile adjustment */
@media (max-width: 768px) {
  .bubble-actions {
    padding-left: 40px;
    margin-top: 4px;
    gap: 5px;
  }

  .message.user .bubble-actions {
    padding-right: 40px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v11] Feature: Select & Move Chat Bubbles
   ═══════════════════════════════════════════════════════════════ */

/* Selected bubble state */
.message.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
  transition: outline 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

[data-theme="dark"] .message.selected {
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

/* Select checkbox inside bubble-actions */
.select-checkbox-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  padding: 0;
  flex-shrink: 0;
}

.select-checkbox-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border);
  color: var(--accent);
  transform: scale(1.06);
}

.select-checkbox-btn svg {
  width: 15px;
  height: 15px;
}

.message.selected .select-checkbox-btn {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent);
}

/* ─── Selection Toolbar (floating bar at bottom of chat) ─── */
.selection-toolbar {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  animation: msgFade 0.25s var(--ease);
}

.selection-toolbar.hidden {
  display: none;
}

.selection-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  padding-right: 6px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
}

.sel-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  font-family: inherit;
}

.sel-btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.sel-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.sel-btn-accent {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.sel-btn-accent:hover {
  background: rgba(34, 197, 94, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.2);
}

.sel-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.sel-btn-ghost:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ─── Move-to-Chat Modal ─── */
.movechat-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s var(--ease);
}

.movechat-overlay.hidden {
  display: none;
}

.movechat-modal {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 92%;
  max-width: 440px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  animation: dropIn 0.25s var(--ease);
}

.movechat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
}

.movechat-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.movechat-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 20px 10px;
}

.movechat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  max-height: 40vh;
}

.movechat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  margin-bottom: 4px;
}

.movechat-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border);
}

.movechat-item.selected {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent);
}

.movechat-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease);
}

.movechat-item.selected .movechat-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.movechat-item.selected .movechat-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.movechat-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movechat-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.movechat-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}

/* Dark mode enhancements */
[data-theme="dark"] .selection-toolbar {
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .movechat-modal {
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.4);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .selection-toolbar {
    bottom: 82px;
    padding: 8px 12px;
    gap: 6px;
    border-radius: 12px;
    width: 94%;
    max-width: 420px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .sel-toolbar-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .selection-count {
    font-size: 0.78rem;
    width: 100%;
    text-align: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-right: 0;
    margin-bottom: 4px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v13] Feature: New Branding Logo — Unified Logo Styles
   ═══════════════════════════════════════════════════════════════ */

/* Base logo styles shared across all logo placements */
.app-logo,
.assistant-avatar,
.ui-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Sidebar logo — clean, vertically centered */
.app-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.08));
}

.brand-logo {
  pointer-events: auto;
}

.brand-logo:hover .app-logo {
  opacity: 0.85;
  transform: scale(1.04);
}

/* Assistant avatar in chat bubbles — round, with depth shadow */
.assistant-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

/* Welcome screen logo — larger, centered */
.welcome-logo-img {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.2));
}

/* Typing indicator avatar sizing (inherits .assistant-avatar) */
.typing-avatar .assistant-avatar {
  width: 30px;
  height: 30px;
}

/* Dark mode: boost logo visibility with subtle glow */
[data-theme="dark"] .app-logo,
[data-theme="dark"] .assistant-avatar,
[data-theme="dark"] .ui-logo {
  filter: drop-shadow(0 1px 4px rgba(255, 255, 255, 0.08));
}

[data-theme="dark"] .welcome-logo-img {
  filter: drop-shadow(0 4px 16px rgba(139, 92, 246, 0.25));
}

/* Override legacy SVG avatar styling when image is used */
.message.assistant .message-avatar {
  background: transparent;
  border: none;
  padding: 0;
  overflow: hidden;
}

.message.assistant .message-avatar .assistant-avatar {
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v17] Feature: Gemini-Style Mode Switcher
   Clean dropdown in header — Auto / Lawyer / Commerce Expert
   ═══════════════════════════════════════════════════════════════ */

/* ─── Switcher Container ─── */
.gemini-mode-switcher {
  position: relative;
  margin-left: 10px;
  flex-shrink: 0;
  z-index: 100;
}

/* ─── Pill Button ─── */
.gemini-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  line-height: 1;
}

.gemini-mode-btn:hover {
  background: var(--bg-glass-strong);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

.gemini-mode-btn:active {
  transform: scale(0.97);
}

.gemini-mode-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.gemini-mode-icon svg {
  width: 14px;
  height: 14px;
}

.gemini-mode-label {
  color: inherit;
}

.gemini-mode-arrow {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}

.gemini-mode-btn.open .gemini-mode-arrow {
  transform: rotate(180deg);
}

/* ─── When a role mode is active (not Auto) ─── */
.gemini-mode-btn.mode-role-active {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ─── Dropdown ─── */
.gemini-mode-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  animation: geminiDropIn 0.18s var(--ease);
  z-index: 1300;
}

.gemini-mode-dropdown.hidden {
  display: none;
}

@keyframes geminiDropIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Dropdown Items ─── */
.gemini-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.gemini-dropdown-item:hover {
  background: var(--accent-soft);
}

.gemini-dropdown-item.active {
  background: rgba(99, 102, 241, 0.08);
}

.gemini-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.gemini-item-icon svg {
  width: 16px;
  height: 16px;
}

.gemini-dropdown-item:hover .gemini-item-icon {
  background: var(--accent);
  color: white;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.2);
}

.gemini-dropdown-item.active .gemini-item-icon {
  background: var(--accent);
  color: white;
}

.gemini-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.gemini-item-name {
  font-size: 0.8rem;
  font-weight: 620;
  color: var(--text-primary);
  line-height: 1.2;
}

.gemini-item-desc {
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.gemini-item-check {
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.gemini-item-check svg {
  width: 16px;
  height: 16px;
}

.gemini-dropdown-item.active .gemini-item-check {
  display: flex;
}

/* ─── Click Backdrop (disabled — replaced by document click listener) ─── */
.gemini-mode-backdrop {
  display: none !important;
}

/* ─── Dark Mode ─── */
:root.dark .gemini-mode-btn {
  background: rgba(30, 30, 48, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

:root.dark .gemini-mode-btn:hover {
  background: rgba(40, 40, 64, 0.7);
  border-color: rgba(99, 102, 241, 0.3);
}

:root.dark .gemini-mode-btn.mode-role-active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

:root.dark .gemini-mode-dropdown {
  background: rgba(22, 22, 35, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

:root.dark .gemini-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
}

:root.dark .gemini-dropdown-item.active {
  background: rgba(99, 102, 241, 0.08);
}

:root.dark .gemini-item-icon {
  background: rgba(99, 102, 241, 0.15);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .gemini-mode-btn {
    padding: 4px 8px 4px 6px;
    font-size: 0.68rem;
    gap: 4px;
  }

  .gemini-mode-icon {
    width: 14px;
    height: 14px;
  }

  .gemini-mode-icon svg {
    width: 12px;
    height: 12px;
  }

  .gemini-mode-arrow {
    width: 10px;
    height: 10px;
  }

  .gemini-mode-dropdown {
    min-width: 210px;
    left: -20px;
  }
}

@media (max-width: 420px) {
  .gemini-mode-label {
    display: none;
  }

  .gemini-mode-btn {
    padding: 5px 7px;
    border-radius: 50%;
  }

  .gemini-mode-arrow {
    display: none;
  }

  .gemini-mode-dropdown {
    left: -60px;
    min-width: 200px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [PATCH v18] Mobile Responsiveness — Full-Width Fix
   Ensures header, mode switcher, messages, modals, hero,
   and all UI elements fit perfectly at every screen width.
   CSS-only. No JS changes.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Global: Prevent horizontal scroll ─── */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ─── Header layout fix: mode switcher always visible ─── */
.header-left {
  overflow: visible;
  flex: 1;
  min-width: 0;
}

.chat-title {
  flex-shrink: 1;
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gemini-mode-switcher {
  flex-shrink: 0;
}

.header-actions {
  flex-shrink: 0;
}

/* ─── 768px: Tablet + large phone ─── */
@media (max-width: 768px) {
  .chat-title {
    max-width: 140px;
    font-size: 0.85rem;
  }

  .messages {
    padding: 0 8px;
  }

  .message {
    padding: 12px 10px;
    gap: 10px;
  }

  .message-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .message-text {
    font-size: 0.88rem;
  }

  .input-bar {
    padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .input-wrapper {
    padding: 8px 12px;
    gap: 8px;
  }

  /* Recycle Bin modal */
  .recycle-modal {
    width: 95%;
    max-height: 85vh;
    padding: 16px;
    border-radius: 14px;
  }

  /* Merge modal */
  .merge-modal {
    width: 95%;
    max-height: 85vh;
    padding: 16px;
    border-radius: 14px;
  }

  /* Move chat modal */
  .movechat-modal {
    width: 95%;
    padding: 16px;
  }

  /* Sidebar footer */
  .sidebar-footer {
    padding: 10px 12px;
  }

  .settings-btn span {
    font-size: 0.72rem;
  }
}

/* ─── 600px: Small tablet / large phone ─── */
@media (max-width: 600px) {
  .chat-title {
    max-width: 110px;
    font-size: 0.82rem;
  }

  .hero-suggestions {
    grid-template-columns: 1fr;
    max-width: 340px;
  }

  .hero-headline {
    font-size: 1.3rem;
  }

  .message.user .message-content,
  .message.assistant .message-content {
    max-width: 92%;
  }

  .bubble-actions {
    padding-left: 36px;
  }

  .message.user .bubble-actions {
    padding-right: 36px;
  }
}

/* ─── 480px: Standard phone ─── */
@media (max-width: 480px) {
  .main-header {
    padding: 0 10px;
    height: 48px;
  }

  .header-left {
    gap: 8px;
  }

  .chat-title {
    max-width: 90px;
    font-size: 0.78rem;
  }

  .hamburger {
    width: 32px;
    height: 32px;
  }

  .hamburger svg {
    width: 18px;
    height: 18px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .messages {
    padding: 0 6px;
  }

  .message {
    padding: 10px 8px;
    gap: 8px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .message-text {
    font-size: 0.84rem;
  }

  .message-text pre {
    font-size: 0.75rem;
  }

  .input-wrapper {
    padding: 8px 10px;
    border-radius: 12px;
  }

  .input-wrapper textarea {
    font-size: 0.88rem;
  }

  .input-disclaimer {
    font-size: 0.6rem;
  }

  /* Bubble actions: tighter on phone */
  .bubble-actions {
    padding-left: 32px;
    gap: 4px;
    margin-top: 3px;
  }

  .message.user .bubble-actions {
    padding-right: 32px;
  }

  .bubble-actions .message-copy-btn,
  .bubble-actions .message-regen-btn,
  .bubble-actions .feedback-btn,
  .bubble-actions .importance-menu-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  /* Hero section */
  .welcome-screen {
    padding: 28px 14px 40px;
    min-height: 50vh;
  }

  .hero-glow {
    width: 240px;
    height: 240px;
  }

  .hero-logo-wrapper {
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
  }

  .hero-headline {
    font-size: 1.15rem;
  }

  .hero-subtitle {
    font-size: 0.78rem;
    margin-bottom: 22px;
    padding: 0 8px;
  }

  .hero-suggestions {
    grid-template-columns: 1fr;
    max-width: 300px;
    gap: 8px;
  }

  .hero-chip {
    padding: 11px 12px;
  }

  .hero-chip-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 7px;
  }

  .hero-chip-icon svg {
    width: 14px;
    height: 14px;
  }

  .hero-chip-title {
    font-size: 0.74rem;
  }

  .hero-chip-desc {
    font-size: 0.65rem;
  }

  /* Modals */
  .recycle-modal,
  .merge-modal,
  .movechat-modal {
    width: 96%;
    max-height: 88vh;
    padding: 14px;
    border-radius: 12px;
  }

  .recycle-chat-item,
  .merge-chat-item {
    padding: 10px;
  }

  /* Selection toolbar */
  .selection-toolbar {
    bottom: 70px;
    width: 96%;
  }

  /* Share dropdown */
  .share-dropdown {
    min-width: 180px;
  }

  .dropdown-item {
    font-size: 0.78rem;
    padding: 8px 10px;
  }
}

/* ─── 420px: Small phone ─── */
@media (max-width: 420px) {
  .chat-title {
    max-width: 70px;
    font-size: 0.75rem;
  }

  .gemini-mode-btn {
    padding: 4px 6px;
    gap: 3px;
    font-size: 0.65rem;
  }

  .gemini-mode-icon {
    width: 14px;
    height: 14px;
  }

  .gemini-mode-icon svg {
    width: 11px;
    height: 11px;
  }

  .gemini-mode-arrow {
    width: 10px;
    height: 10px;
  }

  .gemini-mode-dropdown {
    left: 0;
    min-width: 190px;
    right: auto;
  }

  .message-text {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .bubble-actions {
    padding-left: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .message.user .bubble-actions {
    padding-right: 0;
    justify-content: flex-end;
  }

  .bubble-actions .message-copy-btn,
  .bubble-actions .message-regen-btn,
  .bubble-actions .feedback-btn,
  .bubble-actions .importance-menu-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  .bubble-actions .message-copy-btn svg,
  .bubble-actions .message-regen-btn svg,
  .bubble-actions .feedback-btn svg,
  .bubble-actions .importance-menu-btn svg {
    width: 13px;
    height: 13px;
  }

  .hero-headline {
    font-size: 1.05rem;
  }

  .hero-subtitle {
    font-size: 0.74rem;
  }
}

/* ─── 360px: Ultra-small phone ─── */
@media (max-width: 360px) {
  .main-header {
    padding: 0 8px;
    height: 44px;
  }

  .header-left {
    gap: 6px;
  }

  .chat-title {
    max-width: 55px;
    font-size: 0.72rem;
  }

  /* Mode switcher: icon-only on ultra narrow */
  .gemini-mode-label {
    display: none;
  }

  .gemini-mode-arrow {
    display: none;
  }

  .gemini-mode-btn {
    padding: 5px;
    border-radius: 50%;
  }

  .gemini-mode-dropdown {
    left: -40px;
    min-width: 180px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .message {
    padding: 8px 6px;
    gap: 6px;
  }

  .message-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }

  .message-text {
    font-size: 0.8rem;
  }

  .input-wrapper {
    padding: 7px 8px;
    gap: 6px;
  }

  .input-wrapper textarea {
    font-size: 0.84rem;
  }

  .send-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .hero-headline {
    font-size: 0.98rem;
  }

  .hero-subtitle {
    font-size: 0.72rem;
    padding: 0 4px;
  }

  .hero-logo-wrapper {
    width: 60px;
    height: 60px;
  }

  .hero-logo-img {
    width: 40px !important;
    height: 40px !important;
  }

  .hero-suggestions {
    max-width: 280px;
  }

  .hero-chip {
    padding: 10px;
  }

  /* Modals: full-width on tiny screens */
  .recycle-modal,
  .merge-modal,
  .movechat-modal {
    width: 98%;
    padding: 12px;
    border-radius: 10px;
  }

  /* Sidebar */
  .sidebar {
    width: 260px;
    min-width: 260px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [VOICE CALL] Premium Voice Call UI Styles
   All class names prefixed with "vc-" — fully isolated.
   No existing classes modified.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Step 1: Floating Action Button (FAB) ─── */
.vc-fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow:
    0 4px 20px rgba(99, 102, 241, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.vc-fab:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 28px rgba(99, 102, 241, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.vc-fab:active {
  transform: scale(0.95);
}

.vc-fab-icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
  z-index: 1;
}

/* Pulse ring animation */
.vc-fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.4);
  animation: vcFabPulse 2.5s ease-out infinite;
  pointer-events: none;
}

@keyframes vcFabPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  70% {
    transform: scale(1.4);
    opacity: 0;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* ─── Step 2: Voice Call Overlay ─── */
.vc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.vc-overlay.vc-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.vc-overlay.vc-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* ─── Voice Call Modal ─── */
.vc-modal {
  position: relative;
  width: 380px;
  max-width: 92vw;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 251, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.2),
    0 8px 32px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: vcModalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vcModalIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close button */
.vc-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.vc-close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.vc-close-btn svg {
  width: 16px;
  height: 16px;
}

/* Header */
.vc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vc-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.vc-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vc-header-title {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.vc-header-tag {
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Timer */
.vc-timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vc-timer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: vcDotBlink 1.5s ease infinite;
}

@keyframes vcDotBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.vc-timer {
  font-family: 'Inter', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}

/* ─── Mic Area ─── */
.vc-mic-area {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animated ring behind mic */
.vc-mic-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.15);
  transition: all 0.4s ease;
  pointer-events: none;
}

/* Mic Button */
.vc-mic-btn {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  z-index: 2;
}

.vc-mic-btn:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 24px rgba(99, 102, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.vc-mic-btn:active {
  transform: scale(0.96);
}

.vc-mic-svg {
  width: 36px;
  height: 36px;
}

/* ─── Mic Button States ─── */

/* Active (recording) */
.vc-mic-btn.vc-mic-active {
  background: linear-gradient(145deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow:
    0 6px 28px rgba(99, 102, 241, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: vcMicGlow 2s ease infinite;
}

/* Note: Ring animation when mic is active is handled via :has() selector below */

/* For the animated ring when active */
.vc-mic-btn.vc-mic-active+.vc-mic-ring,
.vc-mic-area:has(.vc-mic-active) .vc-mic-ring {
  border-color: rgba(99, 102, 241, 0.4);
  animation: vcRingPulse 1.5s ease infinite;
}

@keyframes vcMicGlow {

  0%,
  100% {
    box-shadow:
      0 6px 28px rgba(99, 102, 241, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  50% {
    box-shadow:
      0 8px 36px rgba(99, 102, 241, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

@keyframes vcRingPulse {
  0% {
    transform: scale(1);
    border-color: rgba(99, 102, 241, 0.4);
  }

  50% {
    transform: scale(1.12);
    border-color: rgba(99, 102, 241, 0.15);
  }

  100% {
    transform: scale(1);
    border-color: rgba(99, 102, 241, 0.4);
  }
}

/* Processing state */
.vc-mic-btn.vc-mic-processing {
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: #fff;
  animation: vcProcessSpin 1.5s linear infinite;
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.35);
}

@keyframes vcProcessSpin {
  0% {
    box-shadow: 0 6px 28px rgba(245, 158, 11, 0.35);
  }

  50% {
    box-shadow: 0 8px 36px rgba(245, 158, 11, 0.5);
  }

  100% {
    box-shadow: 0 6px 28px rgba(245, 158, 11, 0.35);
  }
}

/* Error state */
.vc-mic-btn.vc-mic-error {
  background: linear-gradient(145deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 6px 28px rgba(239, 68, 68, 0.35);
}

/* ─── Subtitles ─── */
.vc-subtitles-wrap {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.vc-subtitles {
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
  margin: 0;
  word-break: break-word;
  transition: opacity 0.3s ease;
}

/* ─── End Call Button ─── */
.vc-end-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  letter-spacing: 0.3px;
}

.vc-end-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.4);
}

.vc-end-btn:active {
  transform: translateY(0) scale(0.97);
}

.vc-end-btn svg {
  width: 18px;
  height: 18px;
}

/* ─── Limit Note ─── */
.vc-limit-note {
  font-family: var(--font);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
  letter-spacing: 0.2px;
}

/* ═══════════════════════════════════════════════════════════════
   [VOICE CALL] Dark Mode
   ═══════════════════════════════════════════════════════════════ */
:root.dark .vc-modal {
  background: linear-gradient(160deg, rgba(26, 26, 30, 0.97), rgba(20, 20, 22, 0.99));
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.5),
    0 8px 32px rgba(99, 102, 241, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root.dark .vc-close-btn {
  background: rgba(255, 255, 255, 0.06);
}

:root.dark .vc-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

:root.dark .vc-mic-btn {
  background: linear-gradient(145deg, #2a2a32, #1e1e24);
  color: var(--text-secondary);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root.dark .vc-mic-btn:hover {
  box-shadow:
    0 6px 24px rgba(99, 102, 241, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root.dark .vc-mic-btn.vc-mic-active {
  background: linear-gradient(145deg, #6366f1, #8b5cf6);
  color: #fff;
}

:root.dark .vc-subtitles-wrap {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

:root.dark .vc-mic-ring {
  border-color: rgba(99, 102, 241, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   [VOICE CALL] Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .vc-fab {
    bottom: 80px;
    right: 14px;
    width: 50px;
    height: 50px;
  }

  .vc-fab-icon {
    font-size: 20px;
  }

  .vc-modal {
    width: 96vw;
    padding: 24px 20px 22px;
    border-radius: 22px;
    gap: 16px;
  }

  .vc-timer {
    font-size: 1.3rem;
  }

  .vc-mic-area {
    width: 100px;
    height: 100px;
  }

  .vc-mic-btn {
    width: 72px;
    height: 72px;
  }

  .vc-mic-svg {
    width: 30px;
    height: 30px;
  }

  .vc-subtitles {
    font-size: 0.78rem;
  }

  .vc-end-btn {
    padding: 10px 22px;
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .vc-fab {
    bottom: 76px;
    right: 10px;
    width: 46px;
    height: 46px;
  }

  .vc-fab-icon {
    font-size: 18px;
  }

  .vc-modal {
    padding: 20px 16px 18px;
    gap: 14px;
    border-radius: 18px;
  }

  .vc-header-title {
    font-size: 0.9rem;
  }

  .vc-timer {
    font-size: 1.1rem;
  }

  .vc-mic-area {
    width: 90px;
    height: 90px;
  }

  .vc-mic-btn {
    width: 64px;
    height: 64px;
  }

  .vc-mic-svg {
    width: 26px;
    height: 26px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   [MIC ERROR] Microphone Permission Error Styles
   New classes only — no existing CSS modified.
   ═══════════════════════════════════════════════════════════════ */

.mic-error-box {
  display: none;
  /* hidden by default, shown via JS */
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(254, 226, 226, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  animation: micErrorSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mic-error-box.mic-error-visible {
  display: flex;
}

@keyframes micErrorSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mic-error-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.mic-error-text {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: #b91c1c;
  line-height: 1.4;
  text-align: center;
}

/* ─── Dark Mode ─── */
:root.dark .mic-error-box {
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(239, 68, 68, 0.2);
}

:root.dark .mic-error-text {
  color: #fca5a5;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .mic-error-box {
    padding: 8px 12px;
    border-radius: 10px;
    gap: 6px;
  }

  .mic-error-text {
    font-size: 0.74rem;
  }

  .mic-error-icon {
    font-size: 14px;
  }
}