/* Vexide Premium Minimalist Dark Theme */

:root {
  /* Vexide Premium Deep Dark Color Tokens */
  --bg-app: #000000;
  --bg-sidebar: #0d0d0d;
  --bg-card: #171717;
  --bg-input: #171717;
  --bg-input-focus: #171717;
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-active: rgba(255, 255, 255, 0.12);
  
  /* Primary Solid Colors (No neon glows) */
  --color-primary: #ffffff;
  --color-accent: #ab47bc;
  --color-success: #10b981;
  --color-danger: #ef4444;
  
  /* Text Colors */
  --text-main: #ececec;
  --text-muted: #b4b4b4;
  --text-white: #ffffff;
  
  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.24s var(--ease-smooth);
  --motion-fast: 120ms;
  --motion-menu: 190ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset and Scrollbars */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  min-height: -webkit-fill-available;
}

button,
[role="button"],
summary,
select {
  touch-action: manipulation;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
}

input, textarea, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Layout */
.app-layout {
  display: flex;
  height: 100dvh;
  min-height: -webkit-fill-available;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-app);
}

.sidebar-backdrop {
  display: none;
  border: 0;
}

/* Sidebar (Charcoal flat dark) */
.sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  position: relative;
  z-index: 10;
  overflow: hidden;
  margin-left: 0;
  opacity: 1;
  transition:
    margin-left 0.4s var(--ease-smooth),
    min-width 0.4s var(--ease-smooth),
    opacity 0.4s var(--ease-smooth),
    border-color 0.4s var(--ease-smooth);
}

.app-layout.sidebar-collapsed .sidebar {
  margin-left: -260px;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
  transition:
    margin-left 0.4s var(--ease-smooth),
    min-width 0.4s var(--ease-smooth),
    opacity 0.4s var(--ease-smooth),
    border-color 0.4s var(--ease-smooth);
}

.app-layout.sidebar-collapsed .menu-toggle {
  display: flex;
}

.sidebar > * {
  width: 260px;
  transition: opacity 0.2s ease, transform 0.28s var(--ease-smooth);
}

.app-layout.sidebar-collapsed .sidebar > * {
  opacity: 0;
  transform: translateX(-10px);
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo-group {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-white);
}

.brand-caret {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-header-actions {
  display: flex;
  gap: 4px;
}

.header-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.header-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.header-icon-btn.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
}

.sidebar-search-panel {
  width: auto;
  max-width: calc(100% - 24px);
  min-width: 0;
  margin: 0 12px 12px 12px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-search-panel i {
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-search-panel input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 13px;
}

.sidebar-search-panel input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

#sidebar-search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

#sidebar-search-clear-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.06);
}

/* Sidebar Nav list */
.sidebar-nav {
  padding: 0 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item i {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.nav-item.active {
  background-color: var(--bg-card);
  color: var(--text-white);
  font-weight: 600;
}

.sidebar-pricing-link {
  color: inherit;
  text-decoration: none;
}

.sidebar-pricing-link .pricing-link-arrow {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.45;
}

.pricing-route {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  background: #000;
}

.pricing-route.active {
  display: block;
  animation: pricing-route-enter 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pricing-route iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

body.pricing-route-open {
  overflow: hidden;
}

@keyframes pricing-route-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pricing-route.active {
    animation: none;
  }
}

.new-chat-icon {
  font-size: 13px;
  opacity: 0.8;
}

/* Agents and history */
.sidebar-agents, .history-section {
  padding: 16px 12px 0 12px;
  display: flex;
  flex-direction: column;
}

.agents-title, .history-title-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #8e8e8e;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agents-item, .history-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 12px;
}

.agents-item:hover, .history-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.agents-item.active, .history-item.active {
  background-color: var(--bg-card);
  color: var(--text-white);
  font-weight: 500;
}

body.code-mode .chat-form-capsule {
  border-color: rgba(255, 255, 255, 0.24);
}

body.code-mode #agents-code-btn .agents-avatar {
  background: #f0f0f0;
  color: #111111;
}

.search-hidden {
  display: none !important;
}

.agents-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.agents-avatar.code-suite { background: rgba(255, 255, 255, 0.08); color: #d7d7d7; border: 1px solid var(--border-color); }
.agents-avatar.video-suite { background: #26a69a; color: #fff; }
.agents-avatar.explore-suite { background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid var(--border-color); }

.agents-item-muted {
  cursor: default;
}

.agents-item-muted:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

/* History Segment (Recents) */
.history-section {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 12px;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-placeholder {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
  font-style: italic;
}

.history-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.history-title-box i {
  font-size: 12px;
  opacity: 0.7;
}

.history-title {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 13px;
}

.history-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: var(--transition-smooth);
}

.history-item:hover .history-delete-btn {
  opacity: 0.8;
}

.history-delete-btn:hover {
  opacity: 1 !important;
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Usage Limits */
.sidebar-limits {
  padding: 10px 12px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.limit-status-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #8e8e8e;
}

.status-header .badge {
  background: rgba(171, 71, 188, 0.15);
  color: #e040fb;
  padding: 2px 6px;
  border-radius: 100px;
  font-size: 8px;
  border: 1px solid rgba(171, 71, 188, 0.2);
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

.progress-container {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #ffffff;
  border-radius: 100px;
  transition: width 0.3s ease-out;
}

.progress-bar.accent-bar {
  background: var(--color-accent);
}

.progress-bar.success-bar {
  background: var(--color-success);
}

/* User Profile Row */
.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background-color: var(--bg-sidebar);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ab47bc, #7b1fa2); /* Premium Vexide Accent Gradient */
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.2px;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.user-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-white);
  line-height: 1.3;
}

.user-status {
  font-size: 11px;
  color: var(--text-muted); /* Free subscription style */
  font-weight: 600;
}

.profile-settings-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.profile-settings-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.sidebar-language-picker {
  position: relative;
  margin-left: auto;
}

.sidebar-language-trigger {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}

.sidebar-language-trigger::-webkit-details-marker {
  display: none;
}

.sidebar-language-trigger:hover,
.sidebar-language-details[open] .sidebar-language-trigger {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-white);
}

.sidebar-language-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 230px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(18, 19, 22, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  z-index: 100;
}

.sidebar-language-details:not([open]) .sidebar-language-menu {
  display: none;
}

.sidebar-language-search {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-language-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-white);
  font: inherit;
  font-size: 12px;
}

.sidebar-language-options {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-language-option {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 30px 1fr 16px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  padding: 5px 8px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

.sidebar-language-option:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-white);
}

.sidebar-language-option.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-white);
}

.language-code {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.language-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* Main Workspace */
.main-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-app);
  position: relative;
  overflow: hidden;
  transition: background-color 0.24s ease, transform 0.24s var(--ease-smooth), padding 0.24s var(--ease-smooth);
}

/* Invisible Top Navbar */
.navbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background-color: var(--bg-app);
  z-index: 5;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.navbar-model-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
}

.navbar-model-name:hover {
  background-color: rgba(255,255,255,0.04);
  color: var(--text-white);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.nav-action-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background-color: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-success);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite alternate;
}

.status-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Workspace Panels */
.workspace-tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  height: calc(100% - 56px);
  position: relative;
  min-height: 0;
}

.workspace-tab-content.active {
  display: flex;
}

/* Messages Pane */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px clamp(24px, 18vw, 360px) 32px clamp(24px, 18vw, 360px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
  min-height: 0;
  overscroll-behavior: contain;
}

/* Landing Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 40px 0 80px;
  text-align: center;
}

.welcome-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: 0;
  margin-bottom: 18px;
}

.welcome-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 8px;
  width: min(100%, 380px);
}

.welcome-prompt {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.welcome-prompt:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--border-color-active);
  color: var(--text-white);
}

/* Messages Row */
.message-row {
  display: flex;
  gap: 14px;
  width: 100%;
  animation: message-enter 0.24s var(--ease-smooth);
  will-change: transform, opacity;
}

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

.ai-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background-color: #171717;
  border: 0;
  color: var(--text-white);
  flex-shrink: 0;
  overflow: hidden;
}

.ai-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.55);
}

.message-bubble {
  max-width: 100%;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-main);
}

.message-row.ai .message-bubble {
  flex: 1;
  min-width: 0;
  max-width: 760px;
}

.message-row.user .message-bubble {
  max-width: min(70%, 680px);
  background-color: #2f2f2f;
  border-radius: 18px;
  padding: 9px 15px;
  color: var(--text-white);
}

.chat-attached-image {
  max-width: 280px;
  max-height: 200px;
  border-radius: 12px;
  margin-bottom: 8px;
  display: block;
  border: 1px solid var(--border-color);
}

.message-row.ai .generated-image-bubble {
  flex: 0 1 auto;
}

.generated-chat-image {
  width: min(560px, 68vw);
  max-width: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0;
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.image-generation-row {
  align-items: flex-start;
}

.image-generation-card {
  width: min(360px, 68vw);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1c1c1c;
}

.image-generation-dots {
  width: 52px;
  height: 52px;
  position: relative;
  animation: image-generation-spin 1.15s linear infinite;
}

.image-generation-dots span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.16;
}

.image-generation-dots span:nth-child(1) { transform: rotate(0deg) translateY(-22px); opacity: 1; }
.image-generation-dots span:nth-child(2) { transform: rotate(45deg) translateY(-22px); opacity: 0.82; }
.image-generation-dots span:nth-child(3) { transform: rotate(90deg) translateY(-22px); opacity: 0.66; }
.image-generation-dots span:nth-child(4) { transform: rotate(135deg) translateY(-22px); opacity: 0.52; }
.image-generation-dots span:nth-child(5) { transform: rotate(180deg) translateY(-22px); opacity: 0.4; }
.image-generation-dots span:nth-child(6) { transform: rotate(225deg) translateY(-22px); opacity: 0.3; }
.image-generation-dots span:nth-child(7) { transform: rotate(270deg) translateY(-22px); opacity: 0.22; }
.image-generation-dots span:nth-child(8) { transform: rotate(315deg) translateY(-22px); opacity: 0.16; }

@keyframes image-generation-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .image-generation-card,
  .generated-chat-image {
    width: min(78vw, 360px);
  }
}

/* Markdown parsing typography */
.bubble-markdown p {
  margin-bottom: 10px;
}
.bubble-markdown p:last-child {
  margin-bottom: 0;
}

.bubble-markdown.stream-content-reveal {
  transform-origin: left top;
  animation: stream-content-reveal 0.28s var(--ease-smooth) both;
}

.bubble-markdown h1, .bubble-markdown h2, .bubble-markdown h3 {
  font-weight: 600;
  color: var(--text-white);
  margin: 16px 0 8px 0;
}
.bubble-markdown h1 { font-size: 1.3em; }
.bubble-markdown h2 { font-size: 1.15em; }
.bubble-markdown h3 { font-size: 1.05em; }

.bubble-markdown ul, .bubble-markdown ol {
  margin-left: 18px;
  margin-bottom: 10px;
}

.bubble-markdown li {
  margin-bottom: 3px;
  padding-left: 2px;
}

.bubble-markdown a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

.bubble-markdown a:hover {
  color: inherit;
  text-decoration: none;
}

.bubble-markdown blockquote {
  border-left: 2px solid var(--text-muted);
  color: var(--text-muted);
  padding-left: 12px;
  margin-bottom: 12px;
  font-style: italic;
}

.bubble-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}

.bubble-markdown th, .bubble-markdown td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
}

.bubble-markdown th {
  background-color: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--text-white);
}

.bubble-markdown code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
  color: #f8f8f2;
}

/* Premium Carbon Code Block container */
.code-block-wrapper {
  background: #0b0d10;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
  position: relative;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111419;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-color);
}

.code-quality-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
  color: #72c48d;
  font-size: 10px;
  font-weight: 600;
}

.code-quality-indicator.has-warning {
  color: #d9b56d;
}

.code-lang {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.code-block-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.code-action-btn {
  width: 30px;
  height: 30px;
  background: rgba(18, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.code-action-btn:hover {
  color: var(--text-white);
  border-color: var(--border-color);
  background: rgba(255, 255, 255, 0.08);
}

.code-files-card {
  margin: 12px 0;
}

.code-files-card .code-block-wrapper {
  margin-top: 0;
  border-top-left-radius: 0;
}

.code-file-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  overflow-x: auto;
  padding: 5px 6px 0;
  background: #111419;
  border: 1px solid var(--border-color);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.code-file-tab-list {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.download-zip-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 0 2px 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.download-zip-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-white);
}

.code-file-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.code-file-tab.active {
  color: var(--text-white);
  border-bottom-color: var(--text-white);
}

.truncated-response {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  color: #d9b56d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.continue-response-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
}

.jump-to-latest-btn {
  position: absolute;
  right: 28px;
  bottom: 108px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #1b1d21;
  color: white;
  z-index: 10;
  cursor: pointer;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 14px 48px 48px 14px;
  overflow-x: auto;
}

.code-block-wrapper pre code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Typing loading rows */
.typing-bubble {
  background-color: transparent;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
}

.typing-bubble .dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing-breathe 1.2s infinite alternate;
}

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

/* Fixed Inputs layout at bottom */
.chat-input-wrapper {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  padding: 18px 20% 24px 20%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.92) 22%, var(--bg-app) 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 4;
  pointer-events: none;
  transition: padding 0.24s var(--ease-smooth), background-color 0.24s ease;
}

.chat-input-wrapper > * {
  pointer-events: auto;
}

.chat-form-capsule {
  position: relative;
  z-index: 10;
  background-color: var(--bg-input);
  border: 0;
  border-radius: 26px;
  padding: 10px 14px 10px 14px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  transition: var(--transition-smooth);
  min-width: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  will-change: transform, background-color;
}

.chat-form-capsule:focus-within {
  transform: translateY(-1px);
  background-color: #1b1b1b;
}

.capsule-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.capsule-btn:hover {
  background-color: rgba(255,255,255,0.05);
  color: var(--text-white);
}

.attach-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-white);
  font-size: 13px;
  width: 32px;
  height: 32px;
}

.attach-btn:hover {
  background-color: rgba(255,255,255,0.08);
}

.chat-form-capsule textarea {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-white);
  padding: 5px 2px;
  font-size: 15px;
  line-height: 1.5;
  max-height: 180px;
}

/* Right capsule actions row */
.capsule-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Model Dropdown Inline Selector */
.model-dropdown-container {
  position: relative;
}

.model-dropdown-btn {
  background: rgba(255,255,255,0.04);
  border: 0;
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.model-dropdown-btn:hover {
  background-color: rgba(255,255,255,0.08);
  color: var(--text-white);
}

.model-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 280px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.motion-menu {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 6px, 0) scale(0.97);
  transform-origin: bottom right;
  transition:
    opacity var(--motion-menu) ease,
    transform var(--motion-menu) var(--motion-ease),
    visibility 0s linear var(--motion-menu);
  will-change: opacity, transform;
}

.motion-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity var(--motion-menu) ease,
    transform var(--motion-menu) var(--motion-ease),
    visibility 0s;
}

.motion-menu.is-open > * {
  animation: motion-menu-item-in 220ms var(--motion-ease) both;
}

.motion-menu.is-open > *:nth-child(2) { animation-delay: 18ms; }
.motion-menu.is-open > *:nth-child(3) { animation-delay: 36ms; }
.motion-menu.is-open > *:nth-child(4) { animation-delay: 54ms; }

.motion-button {
  transition:
    transform var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    opacity var(--motion-fast) ease;
  will-change: transform;
}

.motion-button:hover {
  transform: translate3d(0, -1px, 0);
}

.motion-button:active {
  transform: translate3d(0, 1px, 0) scale(0.97);
  transition-duration: 70ms;
}

.motion-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.28);
  outline-offset: 2px;
}

@keyframes motion-menu-item-in {
  from {
    opacity: 0;
    transform: translate3d(0, 3px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.dropdown-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dropdown-option:hover {
  background-color: rgba(255,255,255,0.05);
}

.dropdown-option.active {
  background-color: rgba(255, 255, 255, 0.08);
}

.dropdown-option i {
  font-size: 14px;
  margin-top: 3px;
  flex-shrink: 0;
}

.option-text {
  display: flex;
  flex-direction: column;
}

.option-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-white);
}

.option-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 1px;
}

/* State machine for input capsule buttons (dynamic transitions) */
.chat-form-capsule .capsule-send-btn {
  display: none;
}
.chat-form-capsule .mic-btn,
.chat-form-capsule .voice-wave-btn {
  display: flex;
}

/* When form has text, swap buttons */
.chat-form-capsule.has-text .capsule-send-btn {
  display: flex;
  animation: scale-up 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chat-form-capsule.generating .capsule-send-btn {
  display: flex;
}
.chat-form-capsule.has-text .mic-btn,
.chat-form-capsule.has-text .voice-wave-btn,
.chat-form-capsule.generating .mic-btn,
.chat-form-capsule.generating .voice-wave-btn {
  display: none !important;
}

/* Send Button styling */
.capsule-send-btn {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.capsule-send-btn:hover {
  transform: scale(1.05);
}

/* Beautiful solid-white voice wave button matching screenshot */
.voice-wave-btn {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  padding: 0;
}

.voice-wave-btn:hover {
  transform: scale(1.05);
  background-color: #e5e5e5 !important;
}

.mic-btn.listening,
.voice-wave-btn.active,
.voice-wave-btn.listening {
  background-color: var(--color-accent) !important;
  color: #ffffff !important;
}

.mic-btn.listening {
  animation: pulse-dot 0.8s infinite alternate;
}

.voice-wave-svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Quick Action pills below input bar */
.quick-actions-bar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  order: -1;
  gap: 4px;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 0 18px;
  max-height: 96px;
  opacity: 1;
  transform: translateY(0);
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, max-height 0.28s var(--ease-smooth), padding 0.28s var(--ease-smooth);
}

.quick-action-pill {
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 7px 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.quick-action-pill:hover {
  background-color: rgba(255,255,255,0.05);
  color: var(--text-white);
}

.quick-action-pill.active {
  background: rgba(255, 255, 255, 0.07) !important;
  color: var(--text-white) !important;
  box-shadow: none;
  font-weight: 500;
}

.chat-input-wrapper.has-messages .quick-actions-bar,
.chat-input-wrapper.has-messages .input-footer {
  max-height: 0;
  opacity: 0;
  transform: translateY(12px);
  margin-top: -10px;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.input-footer {
  max-height: 44px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease, max-height 0.28s var(--ease-smooth), margin 0.28s var(--ease-smooth);
}


.pill-icon {
  font-size: 13px;
}

.input-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
}

/* Image Attachment Pre-input card */
.attachment-preview-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: max-content;
  max-width: 400px;
  margin: 0 auto;
}

.thumbnail-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
}

.thumbnail-wrapper .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--color-danger);
  color: var(--text-white);
  border: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  transition: var(--transition-smooth);
}

.thumbnail-wrapper .remove-btn:hover {
  transform: scale(1.1);
}

.attachment-details {
  display: flex;
  flex-direction: column;
}

.attachment-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-white);
}

.attachment-warning {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Image Generator workspace */
.image-generator-container {
  flex: 1;
  overflow-y: auto;
  padding: 40px 18%;
}

.image-header {
  margin-bottom: 24px;
  text-align: center;
}

.image-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 6px;
}

.image-header p {
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

.image-creator-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

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

.form-group label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-white);
}

.form-group textarea {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  outline: none;
  color: var(--text-white);
  font-size: 14px;
  resize: none;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.form-group textarea:focus {
  border-color: var(--border-color-active);
}

.btn-generate-capsule {
  background: #ffffff;
  color: #000000;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn-generate-capsule:hover {
  transform: translateY(-1px);
  background-color: #f0f0f0;
}

/* Gallery Grid */
.generated-gallery-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 16px;
}

.gallery-empty-state {
  grid-column: span 2;
  text-align: center;
  padding: 60px;
  background-color: rgba(255,255,255,0.01);
  border: 1px dashed var(--border-color);
  border-radius: 16px;
  color: var(--text-muted);
}

.gallery-empty-state i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Finished generated visual card */
.visual-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: var(--transition-smooth);
  animation: scale-up 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.visual-viewport {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
  background: #000000;
}

.visual-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.visual-card:hover .visual-viewport img {
  transform: scale(1.02);
}

.visual-error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.055);
  border-bottom: 1px solid rgba(239, 68, 68, 0.16);
}

.visual-error-content {
  max-width: 280px;
  padding: 18px;
  text-align: center;
  color: var(--color-danger);
}

.visual-error-content i {
  font-size: 24px;
  margin-bottom: 10px;
}

.visual-error-title {
  font-size: 12px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 5px;
}

.visual-error-copy {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.visual-card-footer {
  padding: 14px;
}

.visual-prompt-desc {
  font-size: 12px;
  color: var(--text-white);
  line-height: 1.4;
  height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.visual-card-actions {
  display: flex;
  gap: 8px;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-icon-only:hover {
  background-color: rgba(255,255,255,0.08);
  color: var(--text-white);
}

.btn-text-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.btn-text-action:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Subscription Premium Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.18s ease, backdrop-filter 0.18s ease, background-color 0.18s ease;
}

.modal-overlay.closing {
  opacity: 0;
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.glass-modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  position: relative;
  max-width: 600px;
  width: 100%;
  animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(0) scale(1);
  transition: transform 0.18s ease, opacity 0.18s ease;
  overflow: hidden;
}

.modal-overlay.closing .glass-modal-card {
  animation: none;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  z-index: 5;
}

.modal-close-btn:hover {
  background-color: rgba(255,255,255,0.05);
  color: var(--text-white);
}

.modal-header {
  padding: 32px 32px 16px 32px;
  text-align: center;
}

.premium-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ab47bc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-white);
  margin-bottom: 16px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 4px;
}

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

.pricing-card-layout {
  padding: 0 32px 32px 32px;
  display: flex;
  gap: 24px;
  align-items: center;
}

.benefit-list {
  flex: 1.2;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.benefit-list li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
}

.benefit-list li i {
  color: var(--color-success);
  margin-top: 3px;
}

.benefit-list li strong {
  color: var(--text-white);
}

.price-box {
  flex: 0.8;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.price-amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-white);
}

.price-term {
  font-size: 12px;
  color: var(--text-muted);
}

.price-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin: 10px 0 16px 0;
  line-height: 1.3;
}

.btn-stripe-checkout {
  background: #635bff; /* stripe purple */
  color: #ffffff;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  width: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.btn-stripe-checkout:hover {
  background-color: #7a73ff;
  transform: translateY(-1px);
}

.modal-footer {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 16px 32px;
  border-top: 1px solid var(--border-color);
}

.modal-footer p {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Animations */
@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.1); opacity: 1; }
}

@keyframes typing-breathe {
  0% { transform: translateY(0); opacity: 0.4; }
  100% { transform: translateY(-4px); opacity: 1; }
}

@keyframes stream-content-reveal {
  0% {
    opacity: 0;
    transform: translateY(5px);
    filter: blur(2px);
  }
  55% {
    opacity: 0.82;
    filter: blur(0.35px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .bubble-markdown.stream-content-reveal {
    animation: none;
  }
}

@media (max-width: 700px) {
  .header-icon-btn,
  .capsule-btn,
  .capsule-send-btn,
  .nav-action-icon-btn,
  .menu-toggle,
  .message-action-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .main-workspace,
  .chat-input-wrapper,
  .message-row,
  .message-bubble,
  .bubble-markdown,
  .code-block-wrapper,
  .code-file-shell,
  .generated-chat-image {
    max-width: 100%;
    min-width: 0;
  }

  .chat-input-wrapper {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .messages-container {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  pre,
  code,
  .code-file-content {
    overflow-x: auto;
    white-space: pre;
    max-width: 100%;
  }
}

.image-aspect-control {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.image-aspect-control.hidden {
  display: none;
}

.image-aspect-btn {
  min-width: 34px;
  height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.image-aspect-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.generated-image-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.generated-file-card {
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
}
.generated-file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.08);
  color: var(--text-white);
}
.generated-file-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.generated-file-info strong { overflow: hidden; color: var(--text-white); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.generated-file-info span { overflow: hidden; color: var(--text-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.generated-file-download {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  color: var(--text-white);
  cursor: pointer;
  transition: transform .2s var(--motion-ease), background .2s ease;
}
.generated-file-download:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }

.generated-image-action {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  cursor: pointer;
}

.generated-image-action:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.07);
}

@keyframes modal-enter {
  0% { transform: scale(0.95) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes scale-up {
  0% { transform: scale(0.97); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes message-enter {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Custom Webkit Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.hidden {
  display: none !important;
}

.inline-ui-notice {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(23, 23, 23, 0.96);
  border: 1px solid var(--border-color-active);
  color: var(--text-white);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 160;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.inline-ui-notice.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media(max-width: 1024px) {
  .messages-container {
    padding-left: 10%;
    padding-right: 10%;
    padding-bottom: 28px;
  }
  .chat-input-wrapper {
    padding-left: 10%;
    padding-right: 10%;
  }
  .image-generator-container {
    padding-left: 5%;
    padding-right: 5%;
  }
}

@media(max-width: 768px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    min-width: min(86vw, 300px);
    z-index: 80;
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.42);
    height: 100dvh;
    margin-left: 0 !important;
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.4s var(--ease-smooth), opacity 0.4s var(--ease-smooth), border-color 0.4s var(--ease-smooth) !important;
  }
  .sidebar > * {
    width: min(86vw, 300px);
  }
  .app-layout.sidebar-collapsed .sidebar {
    width: min(86vw, 300px) !important;
    min-width: min(86vw, 300px) !important;
    transform: translateX(-102%) !important;
    margin-left: 0 !important;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease-smooth), opacity 0.4s var(--ease-smooth), border-color 0.4s var(--ease-smooth) !important;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 1;
    transition: opacity 0.25s ease;
  }
  .app-layout.sidebar-collapsed .sidebar-backdrop {
    opacity: 0;
    pointer-events: none;
  }
  .menu-toggle {
    display: flex;
  }
  .messages-container {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 24px;
  }
  .chat-input-wrapper {
    width: 100%;
    max-width: 100vw;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .message-actions {
    opacity: 1;
  }
  .sidebar-user-profile {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .sidebar-user-profile.logged-out {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .modal-overlay {
    align-items: center;
    overflow-y: auto;
    padding: max(12px, env(safe-area-inset-top)) 0 calc(12px + env(safe-area-inset-bottom));
  }
  .glass-modal-card {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    overflow-y: auto;
    border-radius: 16px;
  }
  .chat-form-capsule {
    gap: 7px;
    width: 100%;
    max-width: 100%;
    padding: 9px 10px;
    border-radius: 24px;
    align-items: center;
  }
  .chat-form-capsule textarea {
    font-size: 16px;
    line-height: 24px;
    min-height: 34px;
    padding: 5px 2px 4px;
  }
  .chat-form-capsule.image-mode {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "prompt prompt"
      "attach controls";
    align-items: center;
    column-gap: 7px;
    row-gap: 8px;
  }
  .chat-form-capsule.image-mode textarea {
    grid-area: prompt;
    width: 100%;
    min-height: 34px;
    max-height: 120px;
    padding: 5px 4px;
  }
  .chat-form-capsule.image-mode .attach-btn {
    grid-area: attach;
  }
  .chat-form-capsule.image-mode .capsule-actions-right {
    grid-area: controls;
    min-width: 0;
    width: 100%;
    justify-content: flex-end;
    gap: 3px;
  }
  .chat-form-capsule.image-mode .model-dropdown-btn {
    max-width: 94px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .chat-form-capsule.image-mode .model-dropdown-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-form-capsule.image-mode .image-aspect-control {
    min-width: 0;
    padding: 2px;
  }
  .chat-form-capsule.image-mode .image-aspect-btn {
    min-width: 30px;
    width: 30px;
    padding: 0 3px;
  }
  .quick-actions-bar {
    width: 100%;
    padding: 0 14px;
  }
  .input-footer {
    display: none;
  }
  .model-dropdown-btn {
    max-width: 118px;
  }
  .message-row.user .message-bubble {
    max-width: 88%;
  }
  .capsule-actions-right {
    gap: 4px;
  }
  .pricing-card-layout {
    flex-direction: column;
    padding: 16px;
  }
  .settings-grid,
  .settings-row {
    grid-template-columns: 1fr;
  }
  .settings-modal-card .auth-form-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .settings-footer-actions .btn-auth-submit {
    max-width: none;
  }
  .welcome-prompts {
    grid-template-columns: 1fr;
    width: min(100%, 280px);
  }
}

/* Pinned Chats Accordion and Drawer */
#pinned-chats-accordion-btn .accordion-caret {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
#pinned-chats-accordion-btn.expanded .accordion-caret {
  transform: rotate(180deg);
  color: var(--text-white);
}

.pinned-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 8px;
}
.pinned-drawer.expanded {
  max-height: 200px;
  opacity: 1;
  overflow-y: auto;
  margin-top: 2px;
  margin-bottom: 6px;
}

.pinned-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 12px;
}
.pinned-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}
.pinned-item.active {
  background-color: var(--bg-card);
  color: var(--text-white);
  font-weight: 500;
}
.pinned-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.pinned-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pinned-unpin-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
  padding: 2px;
  font-size: 12px;
}
.pinned-item:hover .pinned-unpin-btn {
  opacity: 1;
}
.pinned-unpin-btn:hover {
  color: var(--color-danger);
}
.pinned-placeholder {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
  padding: 8px 12px;
  font-style: italic;
  text-align: center;
}

/* Sidebar Profile Updates */
.sidebar-user-profile {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  gap: 12px;
  min-height: 60px;
}
.sidebar-user-profile.logged-out {
  padding: 16px 14px;
}
.sidebar-user-profile.logged-out button {
  width: 100%;
}

/* Premium, highly-visible styling for Vexide Auth button to prevent Safari light-mode browser fallbacks */
.sidebar-auth-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text-white) !important;
  padding: 10px 16px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.sidebar-auth-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  transform: translateY(-1px) !important;
}

.sidebar-auth-btn:active {
  transform: translateY(1px) !important;
}

.sidebar-auth-btn i {
  font-size: 14px !important;
  color: var(--text-muted) !important;
}
.profile-actions-menu {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* Custom Auth / Preset Modal */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  padding: 0 32px;
}
.auth-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.auth-tab-btn:hover {
  color: var(--text-white);
}
.auth-tab-btn.active {
  color: var(--text-white);
}
.auth-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-white);
}

.auth-form-body {
  padding: 0 32px 32px 32px;
}
.auth-tab-content {
  display: none;
}
.auth-tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: scale-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-group {
  min-width: 0;
}

.settings-modal-card {
  max-width: 760px;
}

.settings-modal-card .auth-form-body {
  max-height: min(68vh, 720px);
  overflow-y: auto;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.settings-panel {
  min-width: 0;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  padding: 14px;
  overflow: hidden;
}

.settings-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.settings-panel-header i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-white);
  font-size: 13px;
}

.settings-panel-header h3 {
  font-size: 14px;
  line-height: 1.2;
  margin: 0 0 3px 0;
  color: var(--text-white);
}

.settings-panel-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.memory-manager-panel {
  padding-bottom: 12px;
}

.memory-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.memory-summary-count {
  color: var(--text-white);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.memory-updated-at {
  color: var(--text-muted);
  font-size: 11.5px;
}

.memory-summary-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.memory-action-btn {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.memory-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.memory-action-btn.danger {
  color: #ffb4b4;
}

.memory-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.memory-modal-card {
  max-width: 560px;
  overflow: hidden;
}

.memory-modal-card .modal-header-section {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  column-gap: 12px;
  align-items: center;
  padding: 28px 32px 16px;
  text-align: left;
}

.memory-modal-card .modal-icon-circle {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 15px;
  line-height: 1;
  margin: 0;
  background: rgba(255, 255, 255, 0.08);
}

.memory-modal-card .modal-icon-circle i {
  display: block;
  line-height: 1;
}

.memory-modal-card .modal-title {
  grid-column: 2;
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.memory-modal-card .modal-subtitle {
  grid-column: 2;
  margin: 4px 0 0;
  line-height: 1.35;
}

.memory-modal-card .modal-close-btn {
  top: 24px;
  right: 26px;
}

.memory-modal-body {
  max-height: min(54vh, 520px);
  overflow-y: auto;
  padding: 0 32px 16px;
}

.memory-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 32px 28px;
}

.memory-modal-footer .btn-auth-submit {
  max-width: 140px;
}

.memory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.memory-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  text-align: center;
}

.memory-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  padding: 9px 10px;
}

.memory-item-main {
  min-width: 0;
  flex: 1;
}

.memory-item-value {
  color: var(--text-white);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.memory-item-meta {
  color: var(--text-muted);
  font-size: 10.5px;
  margin-top: 2px;
  text-transform: capitalize;
}

.memory-add-row {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
}

.memory-icon-btn {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.memory-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.memory-delete-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.memory-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.settings-footer-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-home {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.settings-nav-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text-white);
  text-align: left;
  cursor: pointer;
  transform: translateZ(0);
  transition: transform .24s cubic-bezier(.22,1,.36,1), background .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.settings-nav-row:hover {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.07);
  transform: translateX(3px);
}
.settings-nav-row:active,
.settings-nav-row.selected {
  background: linear-gradient(135deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
  border-color: rgba(255,255,255,.15);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.18);
  transform: scale(.985);
}
.settings-nav-row > i:first-child {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(255,255,255,.07);
}
.settings-nav-row span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.settings-nav-row strong { font-size: 14px; }
.settings-nav-row small { color: var(--text-muted); font-size: 11.5px; }
.settings-nav-row > i:last-child { color: var(--text-muted); font-size: 11px; }
.settings-nav-row:hover > i:last-child,
.settings-nav-row.selected > i:last-child { color: var(--text-white); transform: translateX(2px); }
.settings-detail { animation: settings-detail-in .24s var(--ease-out); }
.settings-back-btn {
  border: 0; background: transparent; color: var(--text-white); cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 0 18px; font-weight: 600;
}
.settings-detail .settings-grid { display: block; }
.settings-detail .settings-panel { display: none; border: 0; padding: 0; background: transparent; }
.settings-detail .settings-panel.active { display: block; animation: settings-detail-in .24s var(--ease-out); }
.settings-help-wrap { position: relative; margin-top: 18px; }
.settings-help-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  padding: 7px; border: 1px solid var(--border-color); border-radius: 12px;
  background: #181818; box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.settings-help-menu a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  color: var(--text-white); text-decoration: none; border-radius: 8px; font-size: 13px;
}
.settings-help-menu a:hover { background: rgba(255,255,255,.06); }
@keyframes settings-detail-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.settings-footer-actions .btn-auth-submit {
  max-width: 220px;
}

.form-input {
  width: 100%;
  min-width: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  color: var(--text-white);
  font-size: 14px;
  transition: border-color 0.2s, background-color 0.2s;
}

select.form-input {
  appearance: none;
}
.form-input:focus {
  border-color: var(--border-color-active);
  background: rgba(0, 0, 0, 0.4);
}

.btn-auth-submit {
  background: var(--text-white);
  color: var(--bg-app);
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 8px;
  border: none;
  width: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  transition: var(--transition-smooth);
  margin-top: 6px;
}
.btn-auth-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.btn-auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-error-msg {
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(239, 68, 68, 0.08);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-error-msg .limit-secondary-btn {
  flex: 0 0 100%;
}

.auth-success-msg {
  color: var(--color-success);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.08);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.message-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 2px;
  min-height: 24px;
  margin-top: 6px;
  position: relative;
  opacity: 0;
  transition: opacity 160ms ease;
}

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

.message-row:hover .message-actions,
.message-actions:focus-within {
  opacity: 1;
}

.message-action-btn {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.message-action-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.07);
}

.message-action-btn.selected {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.1);
}

.message-feedback {
  position: relative;
}

.feedback-reasons {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #181a1e;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.feedback-reason-btn {
  border: 0;
  border-radius: 5px;
  padding: 5px 7px;
  background: transparent;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  font-size: 11px;
}

.feedback-reason-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-white);
}

.message-more {
  position: relative;
  display: inline-flex;
}

.message-more-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  min-width: 154px;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: #242424;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  z-index: 12;
}

.message-more-menu button {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.message-more-menu button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.chat-form-capsule.editing-message {
  border-color: rgba(255, 255, 255, 0.32);
}

.chat-form-capsule.generating {
  opacity: 0.82;
  border-color: rgba(255, 255, 255, 0.16);
}

.chat-form-capsule.generating textarea {
  color: var(--text-muted);
}

.chat-form-capsule.generating .capsule-btn,
.chat-form-capsule.generating .model-dropdown-btn {
  pointer-events: none;
  opacity: 0.55;
}

.chat-form-capsule.generating .capsule-send-btn {
  pointer-events: auto;
  opacity: 1;
}

.quick-actions-bar.generating {
  pointer-events: none;
  opacity: 0.55;
}

.limit-secondary-btn {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
}

.limit-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* History Item Actions and Pin Support */
.history-item {
  justify-content: space-between !important;
  position: relative;
}
.history-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.history-item:hover .history-item-actions {
  opacity: 1;
}
.history-pin-btn, .history-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  transition: color 0.15s;
}
.history-pin-btn:hover {
  color: var(--text-white);
}
.history-delete-btn:hover {
  color: var(--color-danger);
}
.history-item.pinned .history-pin-btn {
  color: #fbbf24 !important; /* gold */
}

/* In-Stream Generated Image styling */
.in-stream-image-card {
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  max-width: 512px;
  width: 100%;
  animation: scale-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.in-stream-image-card .image-wrapper {
  position: relative;
  aspect-ratio: 1/1;
  background: #0d0d0d;
}
.in-stream-image-card .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.in-stream-image-card .image-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--border-color);
}
.in-stream-image-card .image-prompt-text {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.in-stream-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  gap: 12px;
  text-align: center;
}
.in-stream-loading-spinner {
  font-size: 20px;
  color: var(--text-white);
}
.in-stream-loading-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Vexide Superpowers & Mobile Premium Enhancements Styling
   ========================================================================== */

/* 1. Selection Popover (Text-selection Toolbar) */
.selection-popover {
  position: absolute;
  display: flex;
  background: rgba(18, 18, 18, 0.85) !important;
  backdrop-filter: blur(16px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
  z-index: 10000;
  overflow: hidden;
  transform: translateY(-100%);
  margin-top: -8px;
  animation: popover-scale-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes popover-scale-up {
  from {
    opacity: 0;
    transform: translateY(-90%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(-100%) scale(1);
  }
}

.selection-popover button {
  background: none;
  border: none;
  color: var(--text-white);
  padding: 10px 14px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-smooth), transform 0.12s var(--ease-smooth);
  font-weight: 600;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.selection-popover button:last-child {
  border-right: none;
}

.selection-popover button:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  transform: translateY(-1px);
}

.selection-popover button:active {
  transform: translateY(0);
}

.selection-popover button i {
  font-size: 14px;
  transition: transform 0.15s ease;
}

.selection-popover button:hover i {
  transform: scale(1.15);
}

/* 2. Anchored Comments Drawer */
.comment-drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: 360px;
  max-width: 100vw;
  height: 100dvh;
  background: rgba(11, 11, 11, 0.9) !important;
  backdrop-filter: blur(24px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(120%) !important;
  border-left: 1px solid var(--border-color) !important;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.65);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

.comment-drawer-header h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-white);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s, background 0.2s;
  animation: fade-in-up 0.25s var(--ease-smooth);
}

.comment-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3. Document Versions & Git-style Line Diffs */
.diff-viewer-content {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  border-radius: 10px;
  background: #090909;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.diff-line {
  display: flex;
  padding: 3px 12px;
  white-space: pre-wrap;
  word-break: break-all;
  transition: background 0.15s ease;
}

.diff-line-marker {
  display: inline-block;
  width: 20px;
  min-width: 20px;
  user-select: none;
  font-weight: bold;
  opacity: 0.65;
}

.diff-line.added {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #a7f3d0 !important;
  border-left: 3px solid var(--color-success);
}

.diff-line.added .diff-line-marker {
  color: var(--color-success) !important;
  opacity: 1;
}

.diff-line.deleted {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #fca5a5 !important;
  border-left: 3px solid var(--color-danger);
}

.diff-line.deleted .diff-line-marker {
  color: var(--color-danger) !important;
  opacity: 1;
}

.diff-line.unchanged {
  color: var(--text-main);
  opacity: 0.85;
}

.diff-line.unchanged:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* 4. Kanban Card task board */
.kanban-board {
  gap: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.kanban-column {
  background: rgba(255, 255, 255, 0.015) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 16px !important;
  padding: 16px !important;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: grab;
  transition: transform 0.2s var(--ease-smooth), border-color 0.2s, box-shadow 0.2s;
  animation: fade-in-up 0.2s var(--ease-smooth);
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.kanban-card:active {
  cursor: grabbing;
  transform: translateY(0) scale(0.98);
}

/* 5. Parallel Split Mode (Low vs High comparisons) */
.comparison-row {
  display: flex;
  gap: 16px;
  width: 100%;
  margin: 16px 0;
}

.compare-col {
  flex: 1;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 0.24s, transform 0.24s;
}

.compare-col:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.compare-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.compare-accept-btn {
  background: var(--color-success);
  color: var(--text-white);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s var(--ease-smooth), transform 0.15s;
}

.compare-accept-btn:hover {
  background: #059669;
  transform: scale(1.03);
}

.compare-accept-btn:active {
  transform: scale(0.98);
}

/* 6. Deep Research Mode Progress indicators */
.research-prep-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.research-step {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.research-step i {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

/* 7. Topic Monitors */
.monitor-item {
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.monitor-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  transform: translateX(2px);
}

/* 8. Mobile Native Enhancements inside WebView */
@media (max-width: 768px) {
  .navbar {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(56px + env(safe-area-inset-top, 0px));
  }

  .sidebar-header {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }

  .comment-drawer {
    width: 100vw;
    border-left: none !important;
    border-top: 1px solid var(--border-color) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.65);
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
  }
  
  .comparison-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .kanban-board {
    grid-template-columns: 1fr;
  }
}


/* --- Google Auth & Divider Styles --- */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider:not(:empty)::before {
  margin-right: 12px;
}

.auth-divider:not(:empty)::after {
  margin-left: 12px;
}

.google-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  width: 100%;
}
