/* Futuristic Minimalist Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap');

/* Deployment Badge */
.deployment-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.deployment-badge.cloud .status-dot {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.deployment-badge.local .status-dot {
  background-color: #f59e0b;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

:root {
  /* Core Palette - Deep Space */
  --bg-dark: #030305;
  --bg-deep: #000000;

  /* Glass & Surfaces */
  --glass-bg: rgba(20, 20, 25, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

  /* ==============================
     LIQUID GLASS DESIGN SYSTEM
     Refined Professional Aesthetic
     ============================== */

  /* Liquid Glass Properties - Visible but Refined */
  --liquid-blur: 20px;
  --liquid-saturation: 160%;
  --liquid-fill: rgba(20, 20, 25, 0.45);

  /* Refractive Border - Subtle Gradient */
  --border-highlight: rgba(255, 255, 255, 0.3);
  --border-shadow: rgba(255, 255, 255, 0.05);
  --border-inner-glow: rgba(255, 255, 255, 0.08);

  /* Shimmer - Subtle but Visible */
  --shimmer-opacity: 0.08;
  --shimmer-hover-opacity: 0.15;

  /* Shadows - Balanced Depth */
  --liquid-shadow-tight: 0 2px 6px rgba(0, 0, 0, 0.2);
  --liquid-shadow-diffuse: 0 12px 32px rgba(0, 0, 0, 0.18);
  --liquid-shadow-colored: 0 16px 40px rgba(0, 242, 255, 0.06);

  /* Noise Texture */
  --noise-texture: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");

  /* Transitions */
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Neon Accents */
  --primary: #00f2ff;
  /* Cyan Neon */
  --primary-dim: rgba(0, 242, 255, 0.1);
  --primary-glow: 0 0 20px rgba(0, 242, 255, 0.3);

  --secondary: #bc13fe;
  /* Purple Neon */
  --secondary-dim: rgba(188, 19, 254, 0.1);

  --success: #00ff9d;
  --warning: #ffb800;
  --error: #ff2a6d;

  /* Text */
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-dim: rgba(255, 255, 255, 0.3);

  /* Dimensions */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Fonts */
  --font-main: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(188, 19, 254, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 242, 255, 0.08), transparent 25%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ================================
   APP LAYOUT - Gemini Style
   ================================ */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  background: rgba(10, 10, 12, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 242, 255, 0.08);
  border: 1px solid rgba(0, 242, 255, 0.25);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-chat-btn svg {
  stroke: var(--primary);
  opacity: 1;
}

.new-chat-btn:hover {
  background: rgba(0, 242, 255, 0.15);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.history-section-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  margin-bottom: 4px;
}

.chat-history-empty {
  padding: 12px 16px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.chat-history-item {
  padding: 10px 16px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.chat-history-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

/* Delete session button */
.chat-history-item {
  display: flex;
  align-items: center;
  position: relative;
}

.chat-history-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delete-session-btn {
  opacity: 0;
  background: transparent;
  border: none;
  padding: 4px;
  margin-left: auto;
  cursor: pointer;
  color: var(--text-dim);
  border-radius: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.chat-history-item:hover .delete-session-btn {
  opacity: 1;
}

.delete-session-btn:hover {
  background: rgba(255, 42, 109, 0.2);
  color: var(--error);
}

.delete-session-btn:disabled {
  cursor: wait;
  opacity: 0.5;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Right Sources Panel */
.sources-panel {
  width: 280px;
  min-width: 280px;
  height: 100vh;
  background: rgba(10, 10, 12, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sources-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sources-panel-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

.sources-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.sources-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

.source-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

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

.source-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  display: block;
  line-height: 1.4;
}

.source-item a:hover {
  text-decoration: underline;
}

.source-item .source-db {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.sources-toggle-btn {
  background: transparent;
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.sources-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--primary-dim);
}

/* Main Chat Area */
.main-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Input Area - Fixed at Bottom */
.chat-input-area {
  padding: 16px 20px 24px;
  background: linear-gradient(to top, var(--bg-dark) 80%, transparent);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-input-form {
  max-width: 800px;
  margin: 0 auto;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: var(--font-main);
  resize: none;
  min-height: 48px;
  max-height: 200px;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

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

/* Model Trigger Button (in input row) */
.model-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.model-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 242, 255, 0.3);
  color: var(--text-main);
}

.model-trigger-btn.active {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.model-trigger-icon {
  font-size: 1rem;
}

.model-trigger-text {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Model Menu (Gemini-style) */
.model-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: #1e1f20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  padding: 8px 0;
  animation: menuFadeIn 0.2s ease-out;
  overflow: hidden;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-label {
  padding: 8px 16px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #80868b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #e8eaed;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
  background: rgba(138, 180, 248, 0.15);
}

.menu-item-icon {
  font-size: 1.2rem;
  width: 24px;
  display: flex;
  justify-content: center;
}

.menu-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-item-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.menu-item-desc {
  font-size: 0.75rem;
  color: #9aa0a6;
}

.check-mark {
  color: #8ab4f8;
  font-weight: bold;
  opacity: 0;
}

.menu-item.active .check-mark {
  opacity: 1;
}

.menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 0;
}

.menu-item.secondary {
  color: #9aa0a6;
}

.menu-item.secondary:hover {
  color: #e8eaed;
}

.settings-section-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 16px 0;
}

.settings-hint {
  font-size: 0.7rem;
  color: #80868b;
  line-height: 1.4;
  margin-top: 4px;
}

/* Position context for popover */
.input-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

/* Ollama Unavailable Warning Banner */
.ollama-warning-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.4);
  border-radius: 8px;
  margin: 12px 20px;
  color: #ff6b6b;
  font-size: 0.85rem;
}

.ollama-warning-banner .warning-icon {
  font-size: 1.2rem;
}

.ollama-warning-banner .warning-text {
  flex: 1;
}

.ollama-warning-banner .warning-action-btn {
  padding: 6px 12px;
  background: var(--primary);
  border: none;
  border-radius: 5px;
  color: #000;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.ollama-warning-banner .warning-action-btn:hover {
  background: #fff;
}

.ollama-warning-banner .warning-dismiss-btn {
  background: transparent;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

.input-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 16px;
}

.database-pills {
  display: flex;
  gap: 8px;
}

.db-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.db-pill:has(input:checked) {
  background: rgba(0, 242, 255, 0.1);
  border-color: rgba(0, 242, 255, 0.3);
  color: var(--primary);
}

.db-pill input {
  display: none;
}

.quality-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quality-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.quality-slider {
  width: 80px;
  height: 4px;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
}

.quality-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.quality-value {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 16px;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}

.empty-state-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 32px;
}

/* Settings Dropdown (Compact) */
.settings-dropdown {
  position: fixed;
  bottom: 60px;
  left: 12px;
  width: 260px;
  /* Slightly wider for preview */
  background: rgba(20, 20, 25, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  padding: 0;
  /* Clean edges */
  animation: slideUp 0.15s ease-out;
  overflow: hidden;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-section {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-section:last-child {
  border-bottom: none;
}

/* Config Preview */
.settings-preview {
  background: rgba(0, 242, 255, 0.03);
  padding: 10px 14px;
}

.settings-preview-row {
  display: flex;
  align-items: center;
  font-size: 0.7rem;
  margin-bottom: 2px;
}

.settings-preview-row:last-child {
  margin-bottom: 0;
}

.settings-preview-label {
  color: var(--text-dim);
  width: 45px;
}

.settings-preview-value {
  color: var(--primary);
  font-family: monospace;
  font-weight: 500;
}

.settings-section-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.settings-db-pills {
  display: flex;
  gap: 8px;
}

.settings-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-pill:has(input:checked) {
  background: rgba(0, 242, 255, 0.1);
  border-color: rgba(0, 242, 255, 0.3);
  color: var(--primary);
}

.settings-pill input {
  display: none;
}

.settings-warning {
  color: var(--error);
  font-size: 0.7rem;
  margin-top: 6px;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-row:last-child {
  margin-bottom: 0;
}

.settings-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.settings-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.settings-slider-label {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 500;
  min-width: 50px;
  text-align: right;
}

.settings-slider {
  width: 80px;
  height: 4px;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

/* Quality Selector - 3 Option Segmented Control */
.quality-selector {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 4px;
}

.quality-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.quality-btn.active {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid rgba(0, 242, 255, 0.3);
}

.quality-description {
  margin-top: 8px;
  text-align: center;
}

.quality-desc-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Advanced Settings Collapsible */
.advanced-settings-details {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.advanced-settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s ease;
}

.advanced-settings-toggle::-webkit-details-marker {
  display: none;
}

.advanced-settings-toggle:hover {
  color: var(--text-muted);
}

.advanced-settings-toggle svg {
  transition: transform 0.2s ease;
}

.advanced-settings-details[open] .advanced-settings-toggle svg {
  transform: rotate(90deg);
}

.advanced-settings-content {
  padding-bottom: 10px;
}

.settings-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text-main);
  font-size: 0.75rem;
  flex: 1;
  min-width: 0;
  transition: border-color 0.2s;
}

.settings-select:focus {
  outline: none;
  border-color: var(--primary);
}

.settings-model-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  /* flexbox fix */
}

.settings-refresh-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  transition: color 0.2s;
}

.settings-refresh-btn:hover {
  color: var(--text-main);
}

.settings-free-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  width: 100%;
  justify-content: flex-end;
}

.settings-free-filter input {
  width: auto;
  margin: 0;
}

.settings-status {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.settings-toggle-row input {
  display: none;
}

/* Toggle Switch Graphic */
.settings-toggle-row input+span {
  display: inline-block;
  width: 32px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  position: relative;
  transition: all 0.2s ease;
  margin-left: 8px;
  /* Spacing from text */
}

.settings-toggle-row input+span::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
}

.settings-toggle-row input:checked+span {
  background: var(--primary-dim);
  border: 1px solid var(--primary);
}

.settings-toggle-row input:checked+span::after {
  background: var(--primary);
  transform: translateX(14px);
}

.settings-toggle-hint {
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.2;
}

/* Info Icon & Tooltip */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 10px;
  cursor: help;
  position: relative;
}

.info-icon:hover {
  background: var(--text-muted);
  color: #000;
}

.custom-tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 10px;
  border-radius: 6px;
  color: #eee;
  font-size: 0.75rem;
  line-height: 1.4;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.info-icon:hover .custom-tooltip,
.info-icon:focus .custom-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: #fff;
  text-shadow: var(--primary-glow);
}

/* Layout */
.header {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
  z-index: 10;
}

.header h1 {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}

.header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto;
}

/* Glass Panel Component */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

/* ================================
   LIQUID GLASS UTILITY CLASS
   iOS 26 Inspired Glass Effect
   ================================ */
.liquid-glass {
  position: relative;

  /* The Frosted Glass Effect with Saturate Boost */
  background: var(--liquid-fill);
  backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturation));
  -webkit-backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturation));

  /* Geometry */
  border-radius: var(--radius-lg);

  /* Refractive Gradient Border - Light from top-left */
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--liquid-fill), var(--liquid-fill)),
    linear-gradient(135deg, var(--border-highlight) 0%, var(--border-shadow) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;

  /* Inner Glow for Glass Thickness */
  box-shadow:
    inset 0 0 0 1px var(--border-inner-glow),
    var(--liquid-shadow-tight),
    var(--liquid-shadow-diffuse),
    var(--liquid-shadow-colored);

  /* Smooth Transitions */
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth);

  /* Isolation for pseudo-elements */
  isolation: isolate;
  overflow: hidden;
}

/* Noise Texture Overlay - Prevents plastic look */
.liquid-glass::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--noise-texture);
  opacity: 0.03;
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: overlay;
  z-index: 0;
}

/* Specular Shimmer Highlight */
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg,
      transparent 0%,
      transparent 35%,
      rgba(255, 255, 255, var(--shimmer-opacity)) 45%,
      rgba(255, 255, 255, var(--shimmer-opacity)) 55%,
      transparent 65%,
      transparent 100%);
  pointer-events: none;
  border-radius: inherit;
  transition:
    opacity var(--transition-smooth),
    transform var(--transition-smooth);
  z-index: 1;
}

/* Hover State - Light Catch Effect */
.liquid-glass:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 20px 56px rgba(0, 0, 0, 0.25),
    0 28px 72px rgba(0, 242, 255, 0.12);
}

.liquid-glass:hover::before {
  opacity: 1;
  --shimmer-opacity: var(--shimmer-hover-opacity);
  transform: translateX(5%);
}

/* Liquid Glass Content Wrapper - Ensures content is above effects */
.liquid-glass-content {
  position: relative;
  z-index: 2;
}

/* Pill-shaped Liquid Glass Button */
.liquid-glass-pill {
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Main Search Container */
.main-search-container {
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 40px;
  position: relative;
  z-index: 10;

  /* LIQUID GLASS EFFECT */
  background: var(--liquid-fill);
  backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturation));
  -webkit-backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturation));

  /* Refractive Gradient Border */
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--liquid-fill), var(--liquid-fill)),
    linear-gradient(135deg, var(--border-highlight) 0%, var(--border-shadow) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;

  /* Layered Shadows */
  box-shadow:
    inset 0 0 0 1px var(--border-inner-glow),
    var(--liquid-shadow-tight),
    var(--liquid-shadow-diffuse),
    var(--liquid-shadow-colored);

  border-radius: var(--radius-lg);

  /* Floating Layout - Never touch edges */
  isolation: isolate;
  overflow: hidden;
}

/* Shimmer on Main Container */
.main-search-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg,
      transparent 0%,
      transparent 40%,
      rgba(255, 255, 255, 0.08) 50%,
      transparent 60%,
      transparent 100%);
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

/* Noise Texture on Main Container */
.main-search-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--noise-texture);
  opacity: 0.025;
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: overlay;
  z-index: 0;
}

/* Form Elements */
.main-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: var(--font-main);
  font-size: 1.1rem;
  color: #fff;
  transition: all 0.3s ease;
  resize: none;
  min-height: 120px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.main-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--primary-glow), inset 0 2px 4px rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.5);
}

.main-search-input::placeholder {
  color: var(--text-dim);
}

/* ================================
   BUTTON ROW - Right Aligned
   ================================ */
.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}




/* Secondary Button - Subtle Glass */
.new-chat-button {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* Subtle Refractive Border */
  border: 1px solid transparent;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;

  color: var(--text-muted);
  padding: 0 20px;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.new-chat-button:hover {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%);
  color: var(--text-main);
}

/* Cancel Button - Warning Glass */
.cancel-button {
  position: relative;
  background: rgba(255, 42, 109, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border: 1px solid transparent;
  background-image:
    linear-gradient(rgba(255, 42, 109, 0.08), rgba(255, 42, 109, 0.06)),
    linear-gradient(135deg, rgba(255, 42, 109, 0.4) 0%, rgba(255, 42, 109, 0.1) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;

  color: var(--error);
  padding: 0 20px;
  height: 48px;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
}

.cancel-button:hover {
  background-image:
    linear-gradient(rgba(255, 42, 109, 0.12), rgba(255, 42, 109, 0.1)),
    linear-gradient(135deg, rgba(255, 42, 109, 0.5) 0%, rgba(255, 42, 109, 0.15) 100%);
}

/* Selectors & Controls */
.database-selector {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.database-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.database-option label {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.3s;
  cursor: pointer;
}

.database-option input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.database-option input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.database-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 10px;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.database-option input[type="checkbox"]:checked+label {
  color: #fff;
  text-shadow: 0 0 10px var(--primary-dim);
}

/* Provider & Model Selectors */
.provider-selector,
.model-selector {
  margin-bottom: 20px;
}

.provider-selector label,
.model-selector label {
  display: block;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-weight: 600;
}

select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Model Controls */
.model-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.model-controls input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.model-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.model-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

#pullModelBtn {
  background: rgba(0, 255, 157, 0.1);
  border-color: rgba(0, 255, 157, 0.3);
  color: var(--success);
}

#pullModelBtn:hover {
  background: rgba(0, 255, 157, 0.2);
  box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
}

/* Results - Liquid Glass Enhanced */
.result-item {
  background: var(--liquid-fill);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);

  /* Refractive Gradient Border */
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--liquid-fill), var(--liquid-fill)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.03) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;

  border-radius: var(--radius-md);
  padding: 24px;
  padding-left: 28px;
  margin-bottom: 20px;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;

  /* Subtle Liquid Glass Shadows */
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 4px 16px rgba(0, 0, 0, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Accent Edge */
.result-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, rgba(0, 242, 255, 0.3) 100%);
  box-shadow: 0 0 12px var(--primary);
}

/* Shimmer Overlay */
.result-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg,
      transparent 0%,
      transparent 45%,
      rgba(255, 255, 255, 0.04) 50%,
      transparent 55%,
      transparent 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px) translateX(2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 16px 48px rgba(0, 242, 255, 0.08);
}

.result-item:hover::after {
  opacity: 1;
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.result-path {
  font-family: monospace;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.result-snippet {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* AI Answer */
.ai-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--glass-border);
}

.ai-answer {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.ai-answer h3 {
  display: none;
  /* Hide the "AI Response" header */
}

.answer-content {
  color: var(--text-main);
  font-size: 1.05rem;
  line-height: 1.8;
}

.answer-content strong {
  color: #fff;
  font-weight: 600;
}

/* Thinking Process */
.thinking-process-live {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow: hidden;
}

.thinking-process-live-header {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.thinking-process-live-header:hover {
  color: #fff;
}

.thinking-process-live-content {
  padding: 20px;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-height: 200px;
  overflow-y: auto;
}

.thinking-narrative {
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.8rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.01em;
  opacity: 0.85;
}

.thinking-narrative .typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary);
  margin-left: 2px;
  animation: blink 0.8s infinite;
  vertical-align: text-bottom;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* Modals */
#modelsModal {
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.7);
}

#modelsModal>div {
  background: #1a1a1f;
  border: 1px solid var(--glass-border);
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.model-option-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-main) !important;
}

.model-option-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--primary) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes glowPulse {
  0% {
    box-shadow: 0 0 5px var(--primary-dim);
  }

  50% {
    box-shadow: 0 0 20px var(--primary-dim);
  }

  100% {
    box-shadow: 0 0 5px var(--primary-dim);
  }
}

.loading {
  color: var(--primary);
  text-align: center;
  padding: 40px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  animation: glowPulse 2s infinite;
}

/* Theme Toggle (Hidden but kept for compatibility) */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Advanced Settings */
details summary {
  color: var(--primary);
  font-weight: 500;
  padding: 10px 0;
  user-select: none;
  transition: all 0.3s;
}

details summary:hover {
  text-shadow: 0 0 10px var(--primary-dim);
}

details>div {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-muted);
}

/* Static Thinking Process (JS Generated) */
.thinking-process {
  margin-top: 24px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.thinking-process-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}

.thinking-process-header:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.thinking-process-content {
  padding: 20px;
  display: none;
  border-top: 1px solid var(--glass-border);
}

.thinking-process-content.expanded {
  display: block;
}

.thinking-step {
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--primary);
}

.step-header {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.step-query {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-dim);
  border: 1px solid var(--glass-border);
  margin-bottom: 8px;
}

.step-stats {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.dspy-analysis {
  background: rgba(0, 255, 157, 0.05);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--success);
}

.analysis-title {
  font-weight: 600;
  color: var(--success);
  margin-bottom: 10px;
}

.analysis-item {
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.analysis-label {
  font-weight: 600;
  color: var(--text-main);
  margin-right: 8px;
}

/* Feedback Section */
.feedback-section {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.feedback-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.feedback-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--primary);
}

.feedback-btn.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

.feedback-btn svg {
  width: 16px;
  height: 16px;
}

/* Tooltips */
.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-icon {
  margin-left: 6px;
  color: var(--text-dim);
  cursor: help;
  font-size: 0.85em;
}

.tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  font-weight: normal;
  pointer-events: none;
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Feedback Icons - Sleek Minimal Style */
.feedback-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.feedback-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.feedback-icon-btn:active {
  transform: scale(0.95);
}

.feedback-icon-btn.selected {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

/* Empty State & Suggestions */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
}

.suggestions-label {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.suggestion-card {
  position: relative;
  background: var(--liquid-fill);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);

  /* Refractive Gradient Border */
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--liquid-fill), var(--liquid-fill)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.02) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;

  padding: 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-align: left;
  overflow: hidden;

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Shimmer Effect */
.suggestion-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg,
      transparent 0%,
      transparent 40%,
      rgba(255, 255, 255, 0.06) 50%,
      transparent 60%,
      transparent 100%);
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transform: translateX(-100%);
  transition: all var(--transition-smooth);
}

.suggestion-card:hover {
  background-image:
    linear-gradient(rgba(0, 242, 255, 0.08), rgba(0, 242, 255, 0.04)),
    linear-gradient(135deg, rgba(0, 242, 255, 0.4) 0%, rgba(0, 242, 255, 0.05) 100%);
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 242, 255, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.18),
    0 16px 40px rgba(0, 242, 255, 0.1);
}

.suggestion-card:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.suggestion-text {
  color: var(--text-main);
  font-size: 0.95rem;
}

/* Standardized Error Messages */
.error-message {
  background: rgba(255, 42, 109, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  padding: 20px;
  color: #fff;
  margin-top: 20px;
}

.error-message h3 {
  color: var(--error);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-message p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0;
}

.retry-btn {
  margin-top: 16px;
  padding: 10px 20px;
  background: rgba(0, 242, 255, 0.15);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background: rgba(0, 242, 255, 0.25);
  transform: translateY(-1px);
}

/* Collapsible Sources Section */
.sources-collapsible summary::-webkit-details-marker {
  display: none;
}

.sources-collapsible[open] summary svg {
  transform: rotate(90deg);
}

.sources-collapsible summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Search Status Warning */
.search-status-warning {
  background: rgba(255, 184, 0, 0.1);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 20px;
}

.search-status-warning h4 {
  color: var(--warning);
  margin-bottom: 5px;
  font-size: 1rem;
}

.search-status-warning p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* Mode Selector */
.mode-selector-container {
  margin-bottom: 30px;
}

.mode-toggle-wrapper {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.mode-option {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
}

.mode-option:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.mode-option.selected {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.1);
}

.mode-icon {
  font-size: 2rem;
}

.mode-info {
  display: flex;
  flex-direction: column;
}

.mode-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.mode-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.advanced-toggle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

/* Fix for Models Modal */
#modelsModal {
  z-index: 2000 !important;
  /* Ensure it's on top of everything */
}

/* Minimal Performance Slider */
.performance-slider-minimal {
  margin-bottom: 15px;
  display: flex;
  justify-content: flex-end;
}

.slider-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.slider-label-minimal {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.performance-slider-minimal-input {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.performance-slider-minimal-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary);
  transition: all 0.2s;
}

.performance-slider-minimal-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary);
  border: none;
}

.slider-value-minimal {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

/* Developer Settings */
.developer-settings-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  width: fit-content;
  margin-left: auto;
}

.developer-settings-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.developer-settings-panel {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.reasoning-config-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

/* Search Configuration Preview - Fixed at Bottom */
.search-config-preview {
  position: fixed;
  bottom: 0;
  left: 260px;
  /* Account for left sidebar width */
  right: 0;
  padding: 8px 16px;
  background: rgba(10, 10, 12, 0.95);
  border-top: 1px solid rgba(0, 242, 255, 0.2);
  font-size: 0.8rem;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.config-preview-header {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.config-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.config-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.config-value {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.85rem;
}

/* Quality Statistics */
.quality-stats {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
}

.performance-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  margin: 0;
  z-index: 2;
  position: relative;
  cursor: pointer;
}

.performance-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 15px var(--primary);
  transition: all 0.2s;
  margin-top: -9px;
  /* Center thumb */
  position: relative;
  z-index: 3;
}

.performance-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 25px var(--primary);
}

.slider-stops {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  position: relative;
}

.slider-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 80px;
  text-align: center;
}

.stop-dot {
  width: 2px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 8px;
  margin-top: -25px;
  /* Align with track */
  z-index: 1;
}

.stop-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color 0.3s;
}

.slider-stop:hover .stop-label {
  color: var(--text-main);
}

/* 10-Step Slider Styles */
.slider-stops-10 {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  position: relative;
  padding: 0 2px;
}

.slider-stop-10 {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1;
}

.slider-stop-10:hover {
  background: var(--primary);
  transform: scale(1.2);
}

.slider-labels-10 {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0 2px;
}

/* Compact Developer Settings */
.advanced-toggle.compact {
  margin-top: 15px;
  padding: 8px 12px;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#advancedSettings {
  display: block;
  /* Ensure it's not hidden if empty */
}

#advancedSettings .form-group {
  margin-bottom: 10px;
  /* Reduced from default */
}

#advancedSettings label {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

#advancedSettings select,
#advancedSettings input {
  padding: 8px;
  font-size: 0.9rem;
  height: auto;
}

/* ================================
   CHAT UI - Grok-Inspired Clean Design
   ================================ */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 800px;
  margin: 20px auto 0;
  padding-bottom: 40px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease forwards;
  width: 100%;
}

/* User Message - Right aligned, subtle bubble */
.user-message {
  align-items: flex-end;
}

.user-message .message-content {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: 16px 16px 4px 16px;
  font-size: 0.95rem;
  max-width: 75%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Assistant Message - Full width, clean */
.assistant-message {
  align-items: flex-start;
  width: 100%;
}

.assistant-message .message-content {
  width: 100%;
  color: var(--text-main);
}

.thinking-process-live {
  margin: 12px 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border-left: 2px solid var(--primary);
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Generic Confirmation Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #131316;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-footer {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.settings-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.cancel-btn {
  background: transparent;
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.1);
}

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

.delete-btn {
  background: rgba(255, 42, 109, 0.1);
  color: var(--error);
  border-color: rgba(255, 42, 109, 0.2);
}

.delete-btn:hover {
  background: rgba(255, 42, 109, 0.2);
  border-color: var(--error);
  box-shadow: 0 0 15px rgba(255, 42, 109, 0.2);
}

/* ================================
   AUTH UI - Login/User Session
   ================================ */

.auth-section {
  position: relative;
  margin-bottom: 8px;
}

.login-btn {
  background: rgba(0, 242, 255, 0.08) !important;
  border: 1px solid rgba(0, 242, 255, 0.25) !important;
}

.login-btn:hover {
  background: rgba(0, 242, 255, 0.15) !important;
  border-color: var(--primary) !important;
}

.user-info-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-info-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-dropdown {
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  background: rgba(20, 20, 25, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
  overflow: hidden;
  margin-bottom: 8px;
  animation: slideUp 0.15s ease-out;
}

.user-menu-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.user-menu-item.logout-btn {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-menu-item.logout-btn:hover {
  color: var(--error);
}

.user-menu-item svg {
  opacity: 0.7;
}

/* ================================
   API KEYS MODAL
   ================================ */

.api-keys-modal-content {
  width: 450px;
  max-width: 90vw;
}

.api-keys-description {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.api-keys-loading {
  text-align: center;
  color: var(--text-dim);
  padding: 20px;
}

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

.api-key-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.15s ease;
}

.api-key-card.configured {
  border-color: rgba(0, 255, 157, 0.25);
  background: rgba(0, 255, 157, 0.03);
}

.api-key-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.provider-name {
  font-weight: 500;
  color: var(--text-main);
}

.provider-status {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.provider-status.status-active {
  color: var(--success);
}

.provider-models {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.api-key-card-actions {
  display: flex;
  justify-content: flex-end;
}

.add-key-btn {
  background: rgba(0, 242, 255, 0.1) !important;
  border-color: rgba(0, 242, 255, 0.3) !important;
  color: var(--primary) !important;
}

.add-key-btn:hover {
  background: rgba(0, 242, 255, 0.2) !important;
}

.delete-key-btn {
  background: rgba(255, 42, 109, 0.1) !important;
  border-color: rgba(255, 42, 109, 0.3) !important;
  color: var(--error) !important;
}

.delete-key-btn:hover {
  background: rgba(255, 42, 109, 0.2) !important;
}

.add-key-form {
  margin-top: 16px;
  padding: 14px;
  background: rgba(0, 242, 255, 0.03);
  border: 1px solid rgba(0, 242, 255, 0.2);
  border-radius: 10px;
}

.add-key-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.add-key-cancel {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
}

.add-key-cancel:hover {
  color: var(--text-main);
}

.api-key-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: monospace;
}

.api-key-input:focus {
  outline: none;
  border-color: var(--primary);
}

.add-key-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.save-key-btn {
  background: var(--primary-dim) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.save-key-btn:hover {
  background: rgba(0, 242, 255, 0.2) !important;
}

.add-key-status {
  margin-top: 8px;
  font-size: 0.8rem;
  text-align: center;
}

.api-keys-error {
  color: var(--error);
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

/* ================================
   THINKING PULSE ANIMATION
   ================================ */

.thinking-pulse {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse-wave 1.4s ease-in-out infinite;
}

.pulse-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.pulse-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse-wave {

  0%,
  60%,
  100% {
    transform: scale(0.8);
    opacity: 0.4;
  }

  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Typewriter streaming effect for thinking narrative */
.thinking-narrative-streaming {
  overflow: hidden;
  white-space: pre-wrap;
}
/* Agent Activity Styles */
.agent-activity-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.agent-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.agent-step.active {
    opacity: 1;
    transform: translateX(4px);
}

.agent-step.complete {
    opacity: 0.8;
}

.agent-step.pending {
    opacity: 0.3;
}

.agent-step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-step.active .agent-step-icon {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--primary-glow);
    animation: agentPulse 2s infinite;
}

.agent-step.complete .agent-step-icon {
    background: rgba(0, 255, 157, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.agent-step.warning .agent-step-icon {
    background: rgba(255, 184, 0, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.agent-step-content {
    flex: 1;
}

.agent-step-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.agent-step.active .agent-step-name {
    color: var(--text-main);
}

.agent-step-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.3;
}

@keyframes agentPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 242, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0); }
}

.thinking-narrative-minimal {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 2px solid var(--primary);
}
