/* ══════════════════════════════════════════════════════════
   SMEPro Orchestrator Individual — Design System
   ══════════════════════════════════════════════════════════ */

:root {
  /* Core Palette */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --white: #ffffff;
  --green-500: #22c55e;
  --red-500: #ef4444;

  /* Semantic */
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-sidebar: var(--white);
  --border-color: var(--gray-200);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --accent: var(--blue-600);
  --accent-light: var(--blue-50);
  --accent-hover: var(--blue-700);

  /* Spacing */
  --sidebar-width: 240px;
  --header-height: 54px;
  --input-panel-min: 180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
}

/* Dark Mode */
body.dark {
  --bg-primary: #0f1117;
  --bg-secondary: #161822;
  --bg-sidebar: #12141d;
  --border-color: #1e2231;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-light: rgba(37, 99, 235, 0.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
}

/* ═══ APP LAYOUT ═══ */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: width 0.22s cubic-bezier(.4,0,.2,1),
              min-width 0.22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  position: relative;
}

/* ── Collapsed state (icon rail) ── */
.sidebar.collapsed {
  width: 52px;
  min-width: 52px;
}
.sidebar.collapsed #sidebar-logo-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .session-history,
.sidebar.collapsed .btn-new-chat span,
.sidebar.collapsed .btn-settings span {
  display: none;
}
/* Hide text labels in nav items but keep icon */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  overflow: hidden;
}
.sidebar.collapsed .nav-item > svg {
  flex-shrink: 0;
}
.sidebar.collapsed .nav-label {
  display: none;
}
.sidebar.collapsed .btn-new-chat,
.sidebar.collapsed .btn-settings {
  justify-content: center;
  padding: 10px 0;
  width: 100%;
  overflow: hidden;
}
.sidebar.collapsed .sidebar-section {
  padding: 0;
}
.sidebar.collapsed .nav-badge-new { display: none; }
.sidebar.collapsed .sidebar-inner { padding: 12px 6px; }
.sidebar.collapsed #sidebar-logo-icon {
  margin: 0 auto 8px;
}

/* ── Sidebar toggle button ── */
.sidebar-toggle {
  position: absolute;
  top: 14px;
  right: 10px;
  z-index: 20;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: var(--bg-hover, rgba(128,128,128,.1));
  color: var(--text-primary);
  border-color: var(--accent-color, #6366f1);
}
.sidebar.collapsed .sidebar-toggle {
  right: 50%;
  transform: translateX(50%);
  top: 14px;
}
.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* ── Header open button (shown when sidebar collapsed) ── */
.sidebar-open-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  margin-right: 10px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sidebar-open-btn:hover {
  background: var(--bg-hover, rgba(128,128,128,.1));
  color: var(--text-primary);
}
.sidebar-open-btn.visible { display: flex; }

/* ═══ RESIZE HANDLE ═══ */
.resize-handle {
  width: 5px;
  min-width: 5px;
  height: 100vh;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.resize-handle:hover,
.resize-handle.dragging {
  background: var(--accent-color, #6366f1);
  opacity: 0.5;
}
.resize-handle-dots {
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.resize-handle:hover .resize-handle-dots,
.resize-handle.dragging .resize-handle-dots {
  opacity: 1;
}
.resize-handle-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-secondary);
}


.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin-bottom: 16px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.5px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.logo-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

/* New Chat */
.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--duration) var(--ease);
  margin-bottom: 20px;
}

.btn-new-chat:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Sidebar Sections */
.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  margin-bottom: 6px;
  cursor: pointer;
}

.sidebar-section-header:hover .sidebar-collapse-btn {
  opacity: 1;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.sidebar-collapse-btn svg {
  transition: transform 0.2s var(--ease);
}

.sidebar-collapse-btn:hover {
  color: var(--accent);
  opacity: 1;
}

.sidebar-section-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Nav Items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}

.nav-item:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.nav-item.active {
  color: var(--accent);
  font-weight: 500;
}

.nav-item svg {
  flex-shrink: 0;
}

/* Session History */
.session-history {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  min-width: 0;
}

.session-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.session-item .session-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.session-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.session-type-tag {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid;
  text-transform: uppercase;
  cursor: help;
  line-height: 1.4;
}

.session-timestamp {
  flex-shrink: 0;
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: help;
}

/* Settings Button */
.btn-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  transition: all var(--duration) var(--ease);
  width: 100%;
}

.btn-settings:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-primary);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  position: relative;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.badge-text {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.badge-text strong {
  color: var(--accent);
  font-weight: 600;
}

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

.ios-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  color: var(--green-500);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ═══ CHAT AREA ═══ */
.chat-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.chat-area::-webkit-scrollbar { width: 6px; }
.chat-area::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 6px;
}

/* Hero Branding */
.hero-branding {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.8s var(--ease);
  -webkit-user-select: none;
  user-select: none;
}

.hero-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: clamp(52px, 8vw, 100px);
  font-weight: 200;
  color: #7aadce;
  letter-spacing: -2px;
  line-height: 1;
}

.hero-subtitle {
  font-size: 11px;
  letter-spacing: 14px;
  color: var(--text-muted);
  margin-top: 10px;
  font-weight: 400;
  text-transform: uppercase;
  text-indent: 14px;
}

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

/* Messages */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 12px;
}

.message {
  max-width: 780px;
  animation: messageIn 0.35s var(--ease);
}

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

.message.assistant {
  align-self: flex-start;
  width: 100%;
  max-width: 780px;
}

/* Message action buttons (copy, etc.) */
.message-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  opacity: 0;
  transition: opacity .15s;
}
.message:hover .message-actions {
  opacity: 1;
}
.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.msg-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37, 99, 235, 0.05);
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.message-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--gray-200);
  color: var(--gray-600);
}

.message.assistant .message-avatar {
  background: var(--accent);
  color: var(--white);
}

.message-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.message-model {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}

.message-body {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.65;
}

.message.user .message-body {
  background: var(--accent);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message.assistant .message-body {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-color);
}

.message-body p { margin-bottom: 8px; }
.message-body p:last-child { margin-bottom: 0; }

.message-body code {
  background: rgba(0,0,0,0.06);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.message-body pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}

.message-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.message-body ul, .message-body ol {
  padding-left: 20px;
  margin: 6px 0;
}

.message-body li {
  margin-bottom: 4px;
}

/* ── Markdown Tables in AI Responses ── */
.message-body .md-table,
.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.md-table thead {
  background: var(--bg-secondary);
}
.md-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}
.md-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.md-table tbody tr:last-child td {
  border-bottom: none;
}
.md-table tbody tr:hover {
  background: var(--bg-hover);
}

/* ── Strong/Bold in responses ── */
.message-body strong {
  font-weight: 600;
  color: var(--text-primary);
}
.message-body em {
  font-style: italic;
}
.message-body h2, .message-body h3,
.message-body h4, .message-body h5 {
  margin: 12px 0 6px;
  font-weight: 600;
  color: var(--text-primary);
}
.message-body h2 { font-size: 18px; }
.message-body h3 { font-size: 16px; }
.message-body h4 { font-size: 14px; }
.message-body h5 { font-size: 13px; }

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

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ═══ INPUT PANEL ═══ */
.input-panel {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 0 24px 16px;
  flex-shrink: 0;
}

.input-tabs {
  display: flex;
  gap: 0;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--border-color);
}

.input-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  text-transform: uppercase;
}

.input-tab:hover {
  color: var(--text-secondary);
}

.input-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.input-tab svg {
  opacity: 0.5;
}

.input-tab.active svg {
  opacity: 1;
}

/* Tab Content */
.tab-content {
  display: none;
  padding: 10px 0;
}

.tab-content.active {
  display: block;
}

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

.connect-link {
  font-weight: 500;
  color: var(--accent);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.upload-zone svg {
  margin-bottom: 8px;
  opacity: 0.4;
}

.upload-zone p {
  font-size: 13px;
}

.upload-browse {
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.file-item-name { color: var(--text-primary); font-weight: 500; }
.file-item-size { color: var(--text-muted); }
.file-item-remove {
  color: var(--red-500);
  cursor: pointer;
  font-weight: 600;
  padding: 0 4px;
}

/* System Instructions */
.system-instructions {
  width: 100%;
  min-height: 60px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  resize: vertical;
  background: var(--bg-secondary);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.system-instructions:focus {
  border-color: var(--accent);
}

/* Input Row */
.input-row {
  padding: 8px 0;
}

.message-input {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 22px;
  max-height: 120px;
  overflow-y: auto;
}

.message-input::placeholder {
  color: var(--text-muted);
}

/* Toolbar */
.input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--duration) var(--ease);
}

.toolbar-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Agent Selector */
.agent-selector {
  position: relative;
}

.agent-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}

.agent-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.agent-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  animation: pulse 2s ease-in-out infinite;
}

/* Model Selector */
.model-selector {
  position: relative;
}

.model-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}

.model-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Dropdowns — default position:absolute; JS overrides to position:fixed for agent dropdown */
.agent-dropdown,
.model-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 -4px 40px rgba(0,0,0,0.6), var(--shadow-lg);
  z-index: 99999;
  display: none;
  animation: dropdownIn 0.15s var(--ease);
}

.agent-dropdown.open,
.model-dropdown.open {
  display: block;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.dropdown-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.dropdown-item.active {
  color: var(--accent);
  font-weight: 600;
}

.dropdown-item .check-icon {
  display: none;
  color: var(--accent);
}

.dropdown-item.active .check-icon {
  display: block;
}

/* Send Button */
.btn-send {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  transition: all var(--duration) var(--ease);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-send:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

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

.btn-send.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ═══ SECONDARY VIEWS ═══ */
.secondary-view {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  overflow-x: auto;
  overflow-y: auto;
  z-index: 5;
  animation: fadeIn 0.3s var(--ease);
}

.view-body-scroll {
  overflow-x: auto;
}

.view-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border-color);
}

.view-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.view-body {
  padding: 24px 32px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; margin-bottom: 16px; }

.btn-primary {
  padding: 8px 20px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

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

/* MCP Grid */
.mcp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.mcp-card {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--duration) var(--ease);
}

.mcp-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.mcp-card-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.mcp-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-family: 'Inter', monospace;
}

.mcp-card p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.mcp-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.mcp-status.connected,
.mcp-status--active {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-500);
}

/* MCP Tools Grid */
.mcp-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.mcp-tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease);
}
.mcp-tool-card:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
}
.mcp-tool-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.mcp-tool-info {
  flex: 1;
  min-width: 0;
}
.mcp-tool-name {
  font-size: 13px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-primary);
}
.mcp-tool-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.view-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.settings-section {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.settings-field {
  margin-bottom: 12px;
}

.settings-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.settings-field input,
.settings-field select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.settings-field input:focus,
.settings-field select:focus {
  border-color: var(--accent);
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-field label {
  margin-bottom: 0;
}

.toggle-switch {
  width: 42px;
  height: 24px;
  background: var(--gray-300);
  border-radius: 12px;
  position: relative;
  padding: 2px;
  transition: background var(--duration) var(--ease);
  cursor: pointer;
}

.toggle-switch.active {
  background: var(--accent);
}

.toggle-knob {
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  display: block;
  transition: transform var(--duration) var(--ease);
  box-shadow: var(--shadow-sm);
}

.toggle-switch.active .toggle-knob {
  transform: translateX(18px);
}

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s var(--ease);
}

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn 0.3s var(--ease);
}

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

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  font-size: 22px;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 20px;
}

.data-source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.data-source-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.data-source-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ds-icon {
  font-size: 28px;
}

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

/* ═══ AGENT ROLE BADGES ═══ */
.agent-role {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: auto;
  padding-left: 8px;
}

.agent-dropdown {
  min-width: 260px;
  max-height: 340px;
  overflow-y: auto;
}

/* ═══ APP BUILDER ═══ */
.builder-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  flex-shrink: 0;
}

.builder-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.builder-title-area h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.builder-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(139,92,246,0.1));
  color: var(--accent);
  border: 1px solid rgba(37,99,235,0.2);
}

.builder-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 3px;
}

.builder-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}

.builder-tab:hover {
  color: var(--text-secondary);
}

.builder-tab.active {
  background: var(--bg-primary);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.builder-deploy-btn {
  padding: 6px 16px;
  font-size: 12px;
}

.builder-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.builder-input-area {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.builder-prompt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  transition: border-color var(--duration) var(--ease);
}

.builder-prompt-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.builder-prompt-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.builder-prompt {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
}

.builder-prompt::placeholder {
  color: var(--text-muted);
}

.builder-generate-btn {
  padding: 6px 20px;
  font-size: 13px;
  white-space: nowrap;
}

.builder-panels {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.builder-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  position: absolute;
  inset: 0;
}

.builder-panel.active {
  display: flex;
}

.builder-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-action-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--duration) var(--ease);
}

.panel-action-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.panel-status {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}

.panel-status.generating {
  color: var(--accent);
  background: var(--accent-light);
  animation: pulse 1.5s ease-in-out infinite;
}

.panel-status.done {
  color: var(--green-500);
  background: rgba(34, 197, 94, 0.1);
}

.builder-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.builder-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.builder-empty svg {
  opacity: 0.2;
  margin-bottom: 12px;
}

.builder-empty p {
  font-size: 14px;
  margin-bottom: 6px;
}

.builder-hint {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Code Editor */
.code-editor {
  margin: 0;
  padding: 20px 24px;
  background: #1a1b26;
  color: #a9b1d6;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  min-height: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 0;
}

.code-editor code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Live Preview */
.preview-container {
  padding: 0;
  background: var(--white);
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  min-height: 400px;
  background: var(--white);
}

/* Logic Flow Nodes */
.logic-flow {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logic-node {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  transition: all var(--duration) var(--ease);
  animation: messageIn 0.3s var(--ease);
}

.logic-node:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.logic-node-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--accent-light);
}

.logic-node-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.logic-node-body p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.logic-connector {
  width: 2px;
  height: 16px;
  background: var(--border-color);
  margin-left: 32px;
}

/* ═══ AI SEARCH ═══ */
.search-header {
  padding-bottom: 8px;
}

.search-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.search-bar-container {
  margin-bottom: 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  transition: all var(--duration) var(--ease);
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.search-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
}

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

.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.search-empty-state svg {
  opacity: 0.15;
  margin-bottom: 16px;
}

.search-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.search-empty-state p {
  font-size: 13px;
  margin-bottom: 20px;
}

.search-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.search-chip {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  background: var(--bg-primary);
  transition: all var(--duration) var(--ease);
}

.search-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-result-card {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  animation: messageIn 0.3s var(--ease);
  transition: all var(--duration) var(--ease);
}

.search-result-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.search-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.search-result-source {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
}

.search-result-time {
  font-size: 11px;
  color: var(--text-muted);
}

.search-result-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.search-result-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.search-synthesis {
  padding: 20px;
  background: linear-gradient(135deg, var(--accent-light), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  animation: messageIn 0.3s var(--ease);
}

.search-synthesis h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-synthesis p {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.65;
}

/* Search Loading */
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  gap: 16px;
}

.search-loading-bar {
  width: 200px;
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.search-loading-bar::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadingSlide 1.2s ease-in-out infinite;
}

@keyframes loadingSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

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

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    border-radius: 0;
  }

  .hero-title {
    font-size: 40px;
  }

  .settings-grid,
  .mcp-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   VAULT / HOSTING VIEW
   ══════════════════════════════════════════════════════════ */
.vault-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.vault-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}
.vault-stats {
  display: flex;
  gap: 24px;
  padding: 16px 24px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 20px;
}
.vault-stat { display: flex; flex-direction: column; gap: 2px; }
.vault-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue-500);
  line-height: 1;
}
.vault-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.vault-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.vault-card:hover {
  border-color: var(--blue-500);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.12);
}
.vault-card-top { display: flex; align-items: center; gap: 8px; }
.vault-card-icon { font-size: 20px; }
.vault-card-type {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--blue-400);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 20px;
  flex: 1;
}
.vault-card-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.vault-card-delete:hover { background: rgba(239,68,68,0.1); color: var(--red-500); }
.vault-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin: 0; }
.vault-card-date { font-size: 11px; color: var(--text-muted); margin: 0; }
.vault-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.vault-action-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.vault-action-btn:hover { border-color: var(--blue-500); color: var(--blue-400); }
.vault-action-primary { background: var(--blue-600); border-color: var(--blue-600); color: white; }
.vault-action-primary:hover { background: var(--blue-500); border-color: var(--blue-500); color: white; }
.vault-action-github { background: #24292f; border-color: #24292f; color: #f0f6fc; }
.vault-action-github:hover { background: #161b22; border-color: #58a6ff; color: #58a6ff; }
.vault-action-github:disabled { opacity: 0.6; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   NETLIFY DROP DEPLOY MODAL
   ══════════════════════════════════════════════════════════ */

/* Modal container */
.netlify-deploy-modal {
  max-width: 580px;
  width: 95vw;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

/* Floating close button */
.deploy-modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: rgba(0,0,0,0.15);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.deploy-modal-x:hover { background: rgba(0,0,0,0.35); }

/* Header */
.nd-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #2563eb 100%);
  padding: 20px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nd-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.01em;
}
.nd-badge {
  background: rgba(255,255,255,0.25);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 20px;
  color: white;
  text-transform: uppercase;
}
.nd-app-name {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

/* Drop Zone */
.nd-drop-zone {
  margin: 20px 24px 0;
  border: 2px dashed #00ad9f;
  border-radius: 12px;
  background: rgba(0, 173, 159, 0.04);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  cursor: default;
}
.nd-drop-zone--active {
  background: rgba(0, 173, 159, 0.1);
  border-color: #05bdaa;
  transform: scale(1.01);
}
.nd-drop-zone--done {
  border-color: var(--green-500);
  background: rgba(34, 197, 94, 0.06);
}
.nd-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 20px 24px;
  text-align: center;
}
.nd-drop-icon { margin-bottom: 4px; }
.nd-drop-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.nd-drop-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.nd-drop-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}
.nd-btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #00ad9f;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s;
}
.nd-btn-launch:hover { background: #009d90; transform: translateY(-1px); }
.nd-btn-launch:active { transform: translateY(0); }
.nd-btn-launch:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.nd-btn-browse {
  font-size: 13px;
  color: #00ad9f;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.nd-btn-browse:hover { color: #009d90; }
.nd-no-account {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  margin-top: 4px;
}

/* Status message */
.deploy-status-msg {
  margin: 12px 24px 0;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 18px;
  line-height: 1.5;
}
.deploy-status-success { color: var(--green-500); }
.deploy-status-error { color: var(--red-500); }

/* Step cards */
.nd-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 18px 24px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.nd-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.nd-step:last-child { border-bottom: none; }
.nd-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #00ad9f;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.nd-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nd-step-body strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.nd-step-body span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Feature Pills */
.nd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 24px 0;
}
.nd-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Secondary links */
.nd-also {
  display: flex;
  gap: 16px;
  padding: 14px 24px 20px;
  justify-content: center;
}
.nd-also-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.nd-also-btn:hover { color: var(--text-secondary); }


/* ══════════════════════════════════════════════════════════
   MESSAGE ACTION BUTTONS
   ══════════════════════════════════════════════════════════ */
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-action-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.msg-action-btn:hover { border-color: var(--blue-400); color: var(--blue-400); background: rgba(59,130,246,0.07); }

/* ══════════════════════════════════════════════════════════
   COPY TOAST
   ══════════════════════════════════════════════════════════ */
.copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════ */
.btn-mt { margin-top: 8px; }
.deploy-ready {
  background: var(--green-500) !important;
  border-color: var(--green-500) !important;
  animation: pulse-deploy 1.5s ease infinite;
}
@keyframes pulse-deploy {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* ══════════════════════════════════════════════════════════
   UTILITY — replaces all inline display:none
   ══════════════════════════════════════════════════════════ */
.view-hidden  { display: none !important; }
.input-hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════
   REAL-TIME AI SEARCH — Live UI Components
   ══════════════════════════════════════════════════════════ */
.search-live-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3);
  color: #22c55e; font-size: 10px; font-weight: 800;
  letter-spacing: .08em; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase;
}
.search-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; display: inline-block;
  animation: live-pulse 1.5s ease infinite;
}
@keyframes live-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(.7); }
}
.search-section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-secondary);
  margin: 24px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Real estate grid */
.re-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.re-listing-card {
  background: var(--gray-900,#111827); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; text-decoration: none;
  color: var(--text); display: block; cursor: pointer;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.re-listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  border-color: var(--blue-400,#60a5fa);
}
.re-listing-img-wrap {
  position: relative; aspect-ratio: 3/2;
  overflow: hidden; background: var(--gray-800,#1f2937);
}
.re-listing-img-wrap img {
  width:100%; height:100%; object-fit:cover; transition:transform .5s;
}
.re-listing-card:hover .re-listing-img-wrap img { transform:scale(1.06); }
.re-listing-badge {
  position:absolute; top:10px; left:10px;
  background:rgba(10,10,20,.8); border:1px solid rgba(255,255,255,.15);
  color:#facc15; font-size:10px; font-weight:800;
  padding:3px 9px; border-radius:20px; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
}
.re-listing-type {
  position:absolute; top:10px; right:10px;
  background:rgba(10,10,20,.75); color:#94a3b8;
  font-size:10px; font-weight:600;
  padding:3px 9px; border-radius:20px; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
}
.re-listing-body { padding: 14px 16px; }
.re-listing-price { font-size:20px; font-weight:800; margin-bottom:4px; letter-spacing:-.02em; }
.re-listing-addr { font-size:12px; color:var(--text-secondary); margin-bottom:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.re-listing-spec { display:flex; gap:12px; font-size:12px; color:var(--text-secondary); margin-bottom:6px; }
.re-listing-persqft { font-size:11px; color:var(--blue-400,#60a5fa); font-weight:600; margin-top:4px; }

/* Portal buttons */
.re-portal-links { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.re-portal-btn {
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600;
  text-decoration:none; color:var(--text);
  border:1px solid var(--border); background:var(--gray-900,#111827);
  transition:all .2s;
}
.re-portal-btn:hover { border-color:var(--blue-400,#60a5fa); color:var(--blue-400,#60a5fa); transform:translateY(-1px); }
.re-zillow:hover  { border-color:#006AFF; color:#006AFF; }
.re-realtor:hover { border-color:#d92228; color:#d92228; }
.re-redfin:hover  { border-color:#e52b2b; color:#e52b2b; }

/* ══════════════════════════════════════════════════════════
   SMEPROPAY — Payment Facilitation UI
   ══════════════════════════════════════════════════════════ */

/* Nav badge */
.nav-item--payments { position: relative; }
.nav-badge-new {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  background: var(--accent);
  color: var(--white);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: auto;
  flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}

/* Info strip */
.smpay-info-strip {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.smpay-info-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 4px 0;
}
.smpay-info-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.smpay-info-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.smpay-info-divider {
  width: 1px;
  height: 32px;
  background: var(--border-color);
  flex-shrink: 0;
}

/* Two-column layout */
.smpay-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .smpay-layout { grid-template-columns: 1fr; }
}

/* Two-column fields inside form */
.smpay-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Form section label */
.smpay-form-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Button margin-top utility */
.btn-mt {
  margin-top: 8px;
}

/* Plans grid */
.smpay-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .smpay-plans-grid { grid-template-columns: 1fr; }
}

/* Plan card */
.smpay-plan-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-secondary);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.smpay-plan-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.smpay-plan-card--active {
  border-color: var(--accent);
  background: var(--accent-light);
}
/* smpay-plan-card alias for settings-based plan cards */
.smpay-plan-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-primary);
  transition: border-color .2s;
}
.smpay-plan-card:hover { border-color: var(--accent); }
.smpay-plan-card--active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.smpay-plan-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.smpay-plan-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.smpay-plan-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}
.smpay-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.smpay-plan-features li {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Metrics grid */
.smpay-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .smpay-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
.smpay-metric {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.smpay-metric-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
}
.smpay-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Search engine links */
.search-search-links { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.search-engine-link {
  display:inline-flex; align-items:center; gap:5px;
  padding:6px 14px; border-radius:6px; font-size:12px; font-weight:600;
  text-decoration:none; color:var(--text-secondary);
  background:var(--gray-900,#111827); border:1px solid var(--border);
  transition:all .2s;
}
.search-engine-link:hover { border-color:var(--blue-400,#60a5fa); color:var(--blue-400,#60a5fa); }

/* Featured result */
.search-result-card--featured { border-left: 3px solid var(--blue-400,#60a5fa); }
.search-result-link { display:inline-block; margin-top:10px; font-size:12px; font-weight:600; color:var(--blue-400,#60a5fa); }

/* Attribution bar */
.search-attribution {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin-top:20px; padding-top:12px; border-top:1px solid var(--border);
  font-size:11px; color:var(--text-secondary);
}
.search-attribution a { color:var(--blue-400,#60a5fa); text-decoration:none; font-weight:600; }
.search-attribution a:hover { text-decoration:underline; }

/* Clickable result cards */
a.search-result-card { text-decoration:none; color:inherit; cursor:pointer; display:block; }
a.search-result-card:hover { border-color:var(--blue-400,#60a5fa); }
a.search-result-card h3 { color:var(--blue-400,#60a5fa); }


/* ══════════════════════════════════════════════════════════
   SMEPROPAY — Payment Facilitation UI
   ══════════════════════════════════════════════════════════ */

/* Nav badge */
.nav-item--payments { position:relative; }
.nav-badge-new {
  font-size:9px; font-weight:700; letter-spacing:.05em;
  background:linear-gradient(135deg,#7c3aed,#4f46e5);
  color:#fff; padding:1px 5px; border-radius:4px;
  margin-left:auto; flex-shrink:0;
  animation: smpay-pulse 2.4s ease-in-out infinite;
}
@keyframes smpay-pulse {
  0%,100% { opacity:1; } 50% { opacity:.6; }
}

/* Status badge */
.smpay-status-badge {
  font-size:11px; font-weight:700; padding:4px 12px;
  border-radius:20px; letter-spacing:.04em;
}
.smpay-status--pending { background:rgba(234,179,8,.15); color:#fbbf24; border:1px solid rgba(234,179,8,.3); }
.smpay-status--active  { background:rgba(34,197,94,.15); color:#4ade80; border:1px solid rgba(34,197,94,.3); }
.smpay-status--review  { background:rgba(249,115,22,.15); color:#fb923c; border:1px solid rgba(249,115,22,.3); }

/* Hero Banner */
.smpay-hero {
  display:flex; align-items:center; gap:32px;
  background:linear-gradient(135deg,rgba(79,70,229,.15) 0%,rgba(124,58,237,.1) 50%,rgba(17,24,39,0) 100%);
  border:1px solid rgba(79,70,229,.25);
  border-radius:16px; padding:28px 32px; margin-bottom:24px;
}
.smpay-hero-content { flex:1; }
.smpay-logo-lockup { display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.smpay-logo-icon { font-size:36px; }
.smpay-logo-name { font-size:22px; font-weight:800; color:#fff; letter-spacing:-.02em; }
.smpay-logo-sub  { font-size:12px; color:var(--text-muted,#9ca3af); margin-top:2px; }
.smpay-hero-desc { color:var(--text-secondary,#d1d5db); line-height:1.6; margin-bottom:20px; max-width:520px; }
.smpay-hero-stats { display:flex; gap:24px; flex-wrap:wrap; }
.smpay-stat { display:flex; flex-direction:column; }
.smpay-stat-val   { font-size:22px; font-weight:800; color:#a78bfa; line-height:1; }
.smpay-stat-label { font-size:11px; color:var(--text-muted,#9ca3af); margin-top:3px; }

/* Credit card visual */
.smpay-hero-visual { flex-shrink:0; }
.smpay-card-preview {
  width:200px; height:120px;
  background:linear-gradient(135deg,#4f46e5 0%,#7c3aed 60%,#6d28d9 100%);
  border-radius:12px; padding:16px 18px;
  display:flex; flex-direction:column; justify-content:space-between;
  box-shadow:0 20px 40px rgba(79,70,229,.35), 0 0 0 1px rgba(255,255,255,.1);
  position:relative; overflow:hidden;
}
.smpay-card-preview::before {
  content:''; position:absolute; top:-40px; right:-40px;
  width:130px; height:130px; border-radius:50%;
  background:rgba(255,255,255,.06);
}
.smpay-card-chip {
  width:28px; height:20px; border-radius:4px;
  background:linear-gradient(135deg,#fbbf24,#f59e0b);
  box-shadow:0 2px 4px rgba(0,0,0,.3);
}
.smpay-card-number { font-size:13px; font-weight:600; color:rgba(255,255,255,.85); letter-spacing:.12em; }
.smpay-card-footer { display:flex; justify-content:space-between; font-size:11px; color:rgba(255,255,255,.7); font-weight:600; }

/* Two-col layout */
.smpay-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
@media(max-width:900px) { .smpay-grid { grid-template-columns:1fr; } }

/* Panel */
.smpay-panel {
  background:var(--surface-elevated,#161b27);
  border:1px solid var(--border,rgba(255,255,255,.08));
  border-radius:14px; padding:24px; margin-bottom:20px;
}
.smpay-panel-header { margin-bottom:18px; }
.smpay-panel-header h3 { font-size:15px; font-weight:700; color:#fff; margin:0 0 4px; }
.smpay-panel-sub { font-size:12px; color:var(--text-muted,#9ca3af); }

/* Form */
.smpay-form { display:flex; flex-direction:column; gap:14px; }
.smpay-form-section {
  font-size:11px; font-weight:700; letter-spacing:.08em;
  color:#a78bfa; text-transform:uppercase;
  padding-bottom:6px; border-bottom:1px solid rgba(167,139,250,.2);
  margin-top:4px;
}
.smpay-field-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.smpay-field { display:flex; flex-direction:column; gap:5px; }
.smpay-field label { font-size:12px; font-weight:600; color:var(--text-secondary,#d1d5db); }
.smpay-field input,
.smpay-field select {
  background:var(--surface,#0d1117);
  border:1px solid var(--border,rgba(255,255,255,.1));
  border-radius:8px; padding:9px 12px;
  color:#fff; font-size:13px;
  transition:border-color .2s;
}
.smpay-field input:focus,
.smpay-field select:focus {
  outline:none; border-color:#7c3aed;
  box-shadow:0 0 0 3px rgba(124,58,237,.15);
}
.smpay-field input::placeholder { color:var(--text-muted,#9ca3af); }
.smpay-field select option { background:#161b27; color:#fff; }

.smpay-tos { display:flex; gap:10px; align-items:flex-start; padding:10px 0; }
.smpay-tos input[type=checkbox] { flex-shrink:0; margin-top:2px; accent-color:#7c3aed; width:15px; height:15px; }
.smpay-tos label { font-size:12px; color:var(--text-secondary,#d1d5db); line-height:1.5; }
.smpay-link { color:#a78bfa; text-decoration:none; }
.smpay-link:hover { text-decoration:underline; }

.smpay-enrollment-status {
  font-size:13px; border-radius:8px; padding:0;
  transition:padding .2s, background .2s;
}
.smpay-enrollment-status.success { padding:10px 14px; background:rgba(34,197,94,.12); color:#4ade80; border:1px solid rgba(34,197,94,.25); }
.smpay-enrollment-status.error   { padding:10px 14px; background:rgba(239,68,68,.12); color:#f87171; border:1px solid rgba(239,68,68,.25); }
.smpay-enrollment-status.pending { padding:10px 14px; background:rgba(234,179,8,.1); color:#fbbf24; border:1px solid rgba(234,179,8,.25); }

.btn-smpay-primary {
  background:linear-gradient(135deg,#4f46e5,#7c3aed);
  color:#fff; border:none; border-radius:10px;
  padding:12px 20px; font-size:14px; font-weight:700;
  cursor:pointer; margin-top:6px;
  transition:opacity .2s, transform .15s;
  box-shadow:0 4px 14px rgba(124,58,237,.35);
}
.btn-smpay-primary:hover { opacity:.9; transform:translateY(-1px); }
.btn-smpay-primary:active { transform:translateY(0); }
.btn-smpay-primary:disabled { opacity:.5; cursor:not-allowed; }

/* Right column */
.smpay-right-col { display:flex; flex-direction:column; gap:0; }

/* Plans */
.smpay-plans { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
@media(max-width:1100px) { .smpay-plans { grid-template-columns:1fr; } }

.smpay-plan {
  border:1px solid var(--border,rgba(255,255,255,.08));
  border-radius:12px; padding:16px;
  display:flex; flex-direction:column; gap:10px;
  background:var(--surface,#0d1117);
  transition:border-color .2s;
}
.smpay-plan:hover { border-color:rgba(124,58,237,.4); }
.smpay-plan--featured {
  border-color:#7c3aed;
  background:linear-gradient(180deg,rgba(124,58,237,.1) 0%,rgba(17,24,39,0) 100%);
  box-shadow:0 0 0 1px rgba(124,58,237,.3);
  position:relative;
}
.smpay-plan-badge {
  font-size:9px; font-weight:800; letter-spacing:.08em;
  color:#a78bfa; background:rgba(124,58,237,.2);
  padding:2px 8px; border-radius:4px; align-self:flex-start;
}
.smpay-plan-name  { font-size:14px; font-weight:700; color:var(--text-primary, #fff); }
.smpay-plan-price { font-size:28px; font-weight:800; color:var(--text-primary, #fff); }
.smpay-plan-price span { font-size:13px; color:var(--text-muted,#9ca3af); font-weight:500; }
.smpay-plan-features { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:5px; }
.smpay-plan-features li { font-size:12px; color:var(--text-secondary,#d1d5db); }
.smpay-plan-features li.dim { color:var(--text-muted,#9ca3af); }

.smpay-plan-btn {
  background:var(--surface-elevated,#161b27);
  border:1px solid var(--border,rgba(255,255,255,.1));
  color:#d1d5db; border-radius:8px; padding:8px 14px;
  font-size:12px; font-weight:600; cursor:pointer;
  transition:all .2s; margin-top:auto; width:100%;
}
.smpay-plan-btn:hover { border-color:#7c3aed; color:#a78bfa; }
.smpay-plan-btn--primary {
  background:linear-gradient(135deg,#4f46e5,#7c3aed);
  border-color:transparent; color:#fff;
}
.smpay-plan-btn--primary:hover { opacity:.9; }

/* Connector card */
.smpay-connector-body {
  display:flex; align-items:flex-start; gap:14px; margin-bottom:16px;
}
.smpay-connector-icon { font-size:28px; flex-shrink:0; }
.smpay-connector-info { flex:1; }
.smpay-connector-name { font-size:14px; font-weight:700; color:#fff; margin-bottom:4px; }
.smpay-connector-desc { font-size:12px; color:var(--text-muted,#9ca3af); line-height:1.5; }
.smpay-connector-toggle-wrap { display:flex; flex-direction:column; align-items:center; gap:5px; flex-shrink:0; }
.smpay-connector-status { font-size:11px; font-weight:700; color:var(--text-muted,#9ca3af); }

.smpay-code-preview {
  background:var(--surface,#0d1117);
  border:1px solid var(--border,rgba(255,255,255,.08));
  border-radius:10px; padding:14px;
}
.smpay-code-label { font-size:11px; color:var(--text-muted,#9ca3af); margin-bottom:8px; font-weight:600; }
.smpay-code-preview pre { margin:0; overflow-x:auto; }
.smpay-code-preview code { font-size:11px; color:#7dd3fc; font-family:monospace; line-height:1.6; }

/* Dashboard stub */
.smpay-dashboard-stub { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:14px; }
@media(max-width:700px) { .smpay-dashboard-stub { grid-template-columns:repeat(2,1fr); } }
.smpay-dash-metric {
  background:var(--surface,#0d1117);
  border:1px solid var(--border,rgba(255,255,255,.06));
  border-radius:10px; padding:14px; text-align:center;
}
.smpay-dash-val   { font-size:22px; font-weight:800; color:#6b7280; }
.smpay-dash-label { font-size:11px; color:var(--text-muted,#9ca3af); margin-top:4px; }
.smpay-dash-empty {
  font-size:12px; color:var(--text-muted,#9ca3af);
  text-align:center; padding:6px 0 4px;
  font-style:italic;
}
.smpay-live-badge {
  font-size:10px; font-weight:700; letter-spacing:.06em;
  color:#6b7280; background:rgba(107,114,128,.1);
  padding:2px 8px; border-radius:4px;
}

/* ═ IOS+ Streaming Cursor ═ */
.stream-cursor{display:inline-block;width:2px;height:1em;background:currentColor;margin-left:2px;vertical-align:text-bottom;animation:blink .7s step-end infinite}@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}

/* ══════════════════════════════════════════════════════════
   DATA TABLE VIEWER — Interactive tabular data explorer
   ══════════════════════════════════════════════════════════ */

.data-table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  animation: fadeIn .25s ease;
  min-height: 0;
  border-left: none;
  border-right: none;
}

.data-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.data-table-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.data-table-filename {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.data-table-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 20px;
}

.data-table-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-table-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  color: var(--text-muted);
  transition: border-color .2s;
}
.data-table-search-wrap:focus-within {
  border-color: var(--accent);
}

.data-table-search {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--text-primary);
  width: 180px;
}
.data-table-search::placeholder { color: var(--text-muted); }

.data-table-close-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.data-table-close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.data-table-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  min-height: 0;
  padding: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-secondary);
}

.data-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: color .15s;
}
.data-table th:hover { color: var(--accent); }
.data-table th.sort-asc::after  { content: ' ↑'; color: var(--accent); }
.data-table th.sort-desc::after { content: ' ↓'; color: var(--accent); }

.data-table td {
  padding: 7px 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr:hover td {
  background: var(--accent-light);
}
.data-table tbody tr:nth-child(even) td {
  background: var(--bg-secondary);
}
.data-table tbody tr:nth-child(even):hover td {
  background: var(--accent-light);
}

.data-table td.dt-highlight {
  background: rgba(99,102,241,.12) !important;
  color: var(--accent);
  font-weight: 600;
}

.data-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.data-table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-table-page-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.data-table-page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.data-table-page-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* Settings layout helpers (replaces inline styles) */
.view-body-scroll { overflow-x: auto; }
.settings-grid-min { min-width: 600px; }
.data-table-hidden { display: none; }
.initially-hidden  { display: none; }

/* Table view button in file list */
.file-item-view-table {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-light);
  transition: opacity .15s;
  white-space: nowrap;
}
.file-item-view-table:hover { opacity: .75; }

.file-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-item-translate {
  font-size: 11px;
  font-weight: 600;
  color: #7c3aed;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  transition: all .2s;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.file-item-translate:hover { background: rgba(124, 58, 237, 0.2); }

.file-item-badge {
  padding: 0 2px;
  min-height: 0;
}

.translate-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 3px;
}
.translate-badge strong { color: #059669; }
.translate-badge em { color: var(--text-muted); font-style: normal; }

/* ── Tier 2: Action Buttons ── */
.dt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.dt-action-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}
.dt-action-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ── Tier 2: Bulk Action Bar ── */
.data-table-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #4f7df5 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  animation: fadeIn .2s ease;
}
.dt-bulk-hidden { display: none !important; }
.dt-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s;
}
.dt-bulk-btn:hover { background: rgba(255,255,255,.3); }
.dt-bulk-secondary { background: transparent; border-color: rgba(255,255,255,.25); }
#dt-selected-count { margin-right: auto; }

/* ── Tier 2: Column Filter Row ── */
.dt-filter-row th {
  padding: 4px 6px !important;
  background: var(--bg-secondary) !important;
  border-bottom: 2px solid var(--accent) !important;
}
.dt-col-filter {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s;
}
.dt-col-filter:focus {
  border-color: var(--accent);
}

/* ── Tier 2: Row Selection ── */
.dt-select-cell {
  width: 36px;
  text-align: center;
  padding: 0 !important;
}
.dt-row-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}
.data-table tbody tr.dt-row-selected {
  background: var(--accent-light) !important;
}
.data-table thead th.dt-select-cell {
  cursor: default;
}

/* ── Data-Aware Badge ── */
.dt-aware-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 10px;
  margin-left: 6px;
  text-transform: uppercase;
  animation: fadeIn .3s ease;
}

/* DETERMINISTIC + VERIFIED variant */
.dt-aware-badge.deterministic {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 0 12px rgba(99,102,241,0.35);
  animation: fadeIn .3s ease, deterministicPulse 3s ease 1s infinite;
  text-transform: none;
  letter-spacing: .3px;
}
@keyframes deterministicPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(99,102,241,.3); }
  50%       { box-shadow: 0 0 18px rgba(99,102,241,.6); }
}

/* ═══════════════════════════════════════════════════
   SPLIT-VIEW WORKSPACE
   ═══════════════════════════════════════════════════ */

.split-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── Layout Mode Toolbar ── */
.split-layout-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  animation: fadeIn .2s ease;
}
.split-layout-bar-hidden {
  display: none;
}

.split-layout-modes {
  display: flex;
  gap: 2px;
  background: var(--bg-primary);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid var(--border-color);
}

.split-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s ease;
}
.split-mode-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.split-mode-btn.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(66,133,244,.3);
}

.split-layout-divider-v {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  flex-shrink: 0;
}

.split-panel-toggles {
  display: flex;
  gap: 4px;
}

.split-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-muted);
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s ease;
}
.split-toggle-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}
.split-toggle-btn.active {
  background: rgba(66,133,244,.08);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.split-toggle-btn:not(.active) {
  opacity: .5;
}

/* ── Split Panels ── */
.split-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  transition: flex .25s ease;
}

.split-panel-table {
  flex: 1;
}
.split-panel-chat {
  flex: 1;
  min-height: 0;
}

/* Panel minimized states */
.split-panel-minimized {
  flex: 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  max-height: 0 !important;
  max-width: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  border: none !important;
  opacity: 0;
  pointer-events: none;
}

/* ── Resize Handle ── */
.split-resize-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  -webkit-user-select: none;
  user-select: none;
  transition: background .15s ease;
}
.split-resize-hidden {
  display: none !important;
}

/* Horizontal resize (default: top/bottom) */
.split-workspace.split-mode-top-bottom .split-resize-handle,
.split-workspace.split-mode-default .split-resize-handle {
  height: 8px;
  cursor: row-resize;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.split-workspace.split-mode-top-bottom .split-resize-grip,
.split-workspace.split-mode-default .split-resize-grip {
  width: 40px;
  height: 3px;
  background: var(--gray-300);
  border-radius: 3px;
  transition: background .15s ease, width .15s ease;
}
.split-workspace.split-mode-top-bottom .split-resize-handle:hover .split-resize-grip,
.split-workspace.split-mode-default .split-resize-handle:hover .split-resize-grip {
  background: var(--accent-blue);
  width: 60px;
}

/* Vertical resize (side-by-side & table-full) */
.split-workspace.split-mode-side-by-side .split-resize-handle,
.split-workspace.split-mode-table-full .split-resize-handle {
  width: 8px;
  cursor: col-resize;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.split-workspace.split-mode-side-by-side .split-resize-grip,
.split-workspace.split-mode-table-full .split-resize-grip {
  height: 40px;
  width: 3px;
  background: var(--gray-300);
  border-radius: 3px;
  transition: background .15s ease, height .15s ease;
}
.split-workspace.split-mode-side-by-side .split-resize-handle:hover .split-resize-grip,
.split-workspace.split-mode-table-full .split-resize-handle:hover .split-resize-grip {
  background: var(--accent-blue);
  height: 60px;
}

/* Active dragging */
.split-resize-handle.split-resize-active {
  background: rgba(66,133,244,.08) !important;
}
.split-resize-handle.split-resize-active .split-resize-grip {
  background: var(--accent-blue) !important;
}

/* ═══ LAYOUT MODES ═══ */

/* Top-Bottom (default) */
.split-workspace.split-mode-default,
.split-workspace.split-mode-top-bottom {
  flex-direction: column;
}

/* Side-by-side */
.split-workspace.split-mode-side-by-side {
  flex-direction: row;
}
.split-workspace.split-mode-side-by-side .split-layout-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}
.split-workspace.split-mode-side-by-side .split-panel-table,
.split-workspace.split-mode-side-by-side .split-panel-chat {
  padding-top: 0;
}

/* Table-Full + Chat Sidebar */
.split-workspace.split-mode-table-full {
  flex-direction: row;
}
.split-workspace.split-mode-table-full .split-panel-table {
  flex: 1;
}
.split-workspace.split-mode-table-full .split-panel-chat {
  flex: 0 0 340px;
  min-width: 260px;
  max-width: 400px;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.split-workspace.split-mode-table-full .split-panel-chat .chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
/* Hide hero branding in table-full mode — it bleeds into the sidebar */
.split-workspace.split-mode-table-full .hero-branding {
  display: none;
}
/* Compact messages container in sidebar mode */
.split-workspace.split-mode-table-full .messages-container {
  padding: 12px;
}
/* Also hide when side-by-side */
.split-workspace.split-mode-side-by-side .hero-branding {
  display: none;
}
.split-workspace.split-mode-table-full .split-layout-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

/* When side-by-side or table-full, add top padding for the floating toolbar */
.split-workspace.split-mode-side-by-side .split-panel-table,
.split-workspace.split-mode-side-by-side .split-panel-chat,
.split-workspace.split-mode-table-full .split-panel-table,
.split-workspace.split-mode-table-full .split-panel-chat {
  padding-top: 36px;
}

/* Chat-only: table hidden */
.split-workspace.split-mode-chat-only .split-panel-table {
  display: none;
}
.split-workspace.split-mode-chat-only .split-resize-handle {
  display: none;
}
.split-workspace.split-mode-chat-only .split-panel-chat {
  flex: 1;
}

/* Table-only: chat hidden */
.split-workspace.split-mode-table-only .split-panel-chat {
  display: none;
}
.split-workspace.split-mode-table-only .split-resize-handle {
  display: none;
}
.split-workspace.split-mode-table-only .split-panel-table {
  flex: 1;
}

/* Both minimized: show a restore prompt */
.split-workspace.split-mode-both-min::after {
  content: "Both panels minimized — use the toolbar to restore";
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: .3px;
}

/* ── Data table needs flex:1 within its panel ── */
.split-panel-table .data-table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.split-panel-table .data-table-container.data-table-hidden {
  display: none;
}

/* When data table is hidden, collapse the entire table panel so chat gets full space */
.split-panel-table:has(.data-table-hidden) {
  display: none !important;
}
.split-panel-table:has(.data-table-hidden) ~ .split-resize-handle {
  display: none !important;
}

/* ── Chat area fills its panel ── */
.split-panel-chat .chat-area {
  flex: 1;
  overflow-y: auto;
}

/* ── Prevent body scroll during resize ── */
body.split-resizing {
  cursor: row-resize !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
body.split-resizing-col {
  cursor: col-resize !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
body.input-panel-resizing {
  cursor: n-resize !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* ═══════════════════════════════════════════════════════════
   INPUT PANEL – Minimize / Resize / Restore
   ═══════════════════════════════════════════════════════════ */

/* ── Panel header: tabs + minimize button in one row ── */
.input-panel-header {
  display: flex;
  align-items: center;
  gap: 0;
}
.input-panel-header .input-tabs {
  flex: 1;
}
/* Hidden tabs by default — clean interface */
.input-panel-header-hidden {
  display: none !important;
}
.input-panel-header-hidden + .tab-content {
  display: none !important;
}

/* ═══ MY FILES LIST ═══ */
.files-list-container {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-primary);
  transition: background .15s;
}
.file-row:hover {
  background: var(--bg-secondary);
}
.file-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.file-row-icon.csv { background: #dcfce7; color: #16a34a; }
.file-row-icon.xlsx { background: #dbeafe; color: #2563eb; }
.file-row-icon.docx { background: #ede9fe; color: #7c3aed; }
.file-row-icon.other { background: var(--gray-100); color: var(--gray-500); }
.file-row-info {
  flex: 1;
  min-width: 0;
}
.file-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.file-row-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.file-row-badge.csv { background: #dcfce7; color: #16a34a; }
.file-row-badge.xlsx { background: #dbeafe; color: #2563eb; }
.file-row-badge.docx { background: #ede9fe; color: #7c3aed; }
.file-row-badge.other { background: var(--gray-100); color: var(--gray-500); }
.file-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.file-row-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.file-row-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.file-row-btn.remove:hover {
  border-color: var(--red-500);
  color: var(--red-500);
}

/* ── Resize Handle (top edge of input panel) ── */
.input-panel-resize {
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 8px;
  cursor: n-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-panel-resize-grip {
  width: 40px;
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
  opacity: 0;
  transition: opacity .2s;
}
.input-panel-resize:hover .input-panel-resize-grip,
.input-panel-resize:active .input-panel-resize-grip {
  opacity: 1;
  background: var(--accent);
}

/* Make .input-panel relative for the resize handle */
.input-panel {
  position: relative;
  z-index: 200;
  transition: height .25s ease, opacity .2s ease, padding .25s ease;
  overflow: visible; /* must be visible so dropdowns can escape upward */
  min-height: 80px;
}

/* When data is active, make the input panel compact */
.input-panel.input-panel-data-active {
  min-height: 52px;
  max-height: 52px;
  height: 52px !important;
}
.input-panel.input-panel-data-active .tab-content {
  display: none !important;
}
.input-panel.input-panel-data-active .input-panel-header {
  display: none;
}
.input-panel.input-panel-data-active .input-row {
  padding: 4px 0;
}
.input-panel.input-panel-data-active .input-toolbar {
  padding: 2px 12px 4px;
}

/* ── Minimize Button (inline with tabs) ── */
.input-panel-minimize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 4px;
  transition: all .15s;
}
.input-panel-minimize-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* ── Minimized state ── */
.input-panel.input-panel-minimized {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ── Restore Bar (appears when minimized) ── */
.input-panel-restore {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  transition: all .2s ease;
}
.input-panel-restore.input-panel-restore-hidden {
  display: none;
}
.input-panel-restore-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
  text-transform: uppercase;
  transition: all .15s;
}
.input-panel-restore-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(59, 130, 246, .2);
}
.input-panel-restore-btn span {
  font-size: 11px;
}

/* ═══ DOCUMENT VIEWER (for .docx files) ═══ */
.doc-viewer {
  padding: 24px 28px;
  max-height: 60vh;
  overflow-y: auto;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary, #1e293b);
}
.doc-viewer h1 { font-size: 22px; font-weight: 700; margin: 0 0 12px; color: var(--text-primary); }
.doc-viewer h2 { font-size: 18px; font-weight: 600; margin: 16px 0 8px; color: var(--text-primary); }
.doc-viewer h3 { font-size: 15px; font-weight: 600; margin: 14px 0 6px; color: var(--text-primary); }
.doc-viewer p  { margin: 0 0 10px; }
.doc-viewer ul, .doc-viewer ol { margin: 8px 0 12px 20px; padding: 0; }
.doc-viewer li { margin-bottom: 4px; }
.doc-viewer strong, .doc-viewer b { font-weight: 600; }
.doc-viewer em, .doc-viewer i { font-style: italic; }
.doc-viewer table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.doc-viewer table th,
.doc-viewer table td {
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e0e7ef);
  text-align: left;
}
.doc-viewer table th {
  background: var(--surface-50, #f8fafc);
  font-weight: 600;
}
.doc-viewer a {
  color: var(--accent, #3b82f6);
  text-decoration: underline;
}
.doc-viewer img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}

/* Scrollbar inside doc viewer */
.doc-viewer::-webkit-scrollbar { width: 6px; }
.doc-viewer::-webkit-scrollbar-track { background: transparent; }
.doc-viewer::-webkit-scrollbar-thumb { background: var(--border-color, #d1d5db); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════
   AUTH — Modal, Buttons, User Bar
   ═══════════════════════════════════════════════════════ */

.user-auth-area { margin-right: 12px; }

.auth-buttons { display: flex; gap: 8px; align-items: center; }
.btn-auth {
  padding: 6px 14px; border-radius: 8px; font-size: 12px;
  font-weight: 600; cursor: pointer; border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}
.btn-login-sm { background: transparent; color: var(--text-secondary); }
.btn-login-sm:hover { background: var(--blue-50); color: var(--blue-600); }
.btn-register-sm { background: var(--blue-500); color: white; border-color: var(--blue-500); }
.btn-register-sm:hover { background: var(--blue-600); }

.user-info-bar { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.tier-badge {
  padding: 2px 8px; border-radius: 10px; font-size: 10px;
  font-weight: 700; letter-spacing: 0.5px;
}
.tier-starter { background: #dbeafe; color: #1d4ed8; }
.tier-creator { background: #fef3c7; color: #92400e; }
.tier-scale { background: #d1fae5; color: #065f46; }
.btn-logout {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-color);
  background: transparent; cursor: pointer; font-size: 14px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.btn-logout:hover { background: #fee2e2; color: #dc2626; border-color: #dc2626; }

/* Auth Modal */
.auth-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; animation: fadeIn 0.2s ease;
}
.auth-modal {
  background: white; border-radius: 16px; padding: 40px;
  width: 400px; max-width: 90vw; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}
.auth-modal h2 {
  margin: 0 0 4px; font-size: 22px; font-weight: 700; color: #111;
}
.auth-modal-subtitle {
  margin: 0 0 24px; font-size: 14px; color: #6b7280;
}
.auth-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: #f3f4f6; cursor: pointer;
  font-size: 18px; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.auth-modal-close:hover { background: #e5e7eb; color: #111; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-input {
  padding: 12px 14px; border-radius: 10px; border: 1.5px solid #e5e7eb;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.auth-error {
  padding: 10px 14px; border-radius: 8px;
  background: #fef2f2; color: #dc2626; font-size: 13px;
  border: 1px solid #fee2e2;
}
.btn-auth-submit {
  padding: 12px; border-radius: 10px; border: none;
  background: var(--blue-500); color: white;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; margin-top: 4px;
}
.btn-auth-submit:hover { background: var(--blue-600); }
.auth-switch {
  text-align: center; margin-top: 16px; font-size: 13px; color: #6b7280;
}
.auth-switch a { color: var(--blue-500); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

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

/* ═══ SETTINGS — Account & Subscription ═══ */
.plan-display { display: flex; align-items: center; gap: 10px; }
.plan-name { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.plan-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}
.plan-badge-free { background: var(--bg-tertiary); color: var(--text-secondary); }
.plan-badge-starter { background: rgba(59,130,246,.15); color: #3b82f6; }
.plan-badge-creator { background: rgba(139,92,246,.15); color: #8b5cf6; }
.plan-badge-scale { background: rgba(245,158,11,.15); color: #f59e0b; }

.status-active { color: #22c55e; font-weight: 600; font-size: 13px; }
.status-suspended { color: #ef4444; font-weight: 600; font-size: 13px; }

.field-hint { display: block; font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

.save-status { font-size: 13px; margin-top: 8px; min-height: 20px; }
.save-success { color: #22c55e; }
.save-error { color: #ef4444; }

.btn-danger {
  background: #ef4444; color: white; border: none; padding: 10px 20px;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: #dc2626; }

/* ═══ DOM RUNTIME EDIT ENGINE ═══ */

/* ── Row Visual States ── */
.data-table tbody tr.dt-row-scanning td { background: rgba(0,120,212,0.08) !important; }
.data-table tbody tr.dt-row-matched td { background: rgba(0,120,212,0.18) !important; transition: background 0.2s; }
.data-table tbody tr.dt-row-committed td { background: rgba(76,175,131,0.18) !important; transition: background 0.3s; }

/* Shimmer scan effect */
.data-table tbody tr.dt-row-scanning td::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(96,205,255,0.06) 50%, transparent 100%);
  animation: dt-shimmer 0.8s linear infinite;
  pointer-events: none;
}
.data-table td { position: relative; }
@keyframes dt-shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
@keyframes dt-commit-flash { 0%{background:rgba(76,175,131,0.35)} 100%{background:transparent} }
.data-table tbody tr.dt-row-flash td { animation: dt-commit-flash 0.6s ease-out; }

/* ── New Column Header ── */
.data-table thead th.dt-col-new { color: #60CDFF; background: rgba(96,205,255,0.08); }

/* ── Status Pills ── */
.dt-status-pill { display:inline-block; padding:2px 8px; border-radius:20px; font-size:11px; font-weight:600; letter-spacing:0.04em; }
.dt-status-SOLD   { background:rgba(76,175,131,0.2);  color:#4CAF83; border:1px solid rgba(76,175,131,0.3); }
.dt-status-OFFER  { background:rgba(255,185,0,0.15);  color:#FFB900; border:1px solid rgba(255,185,0,0.25); }
.dt-status-CLOSED { background:rgba(209,52,56,0.15);  color:#D13438; border:1px solid rgba(209,52,56,0.25); }
.dt-status-NA     { background:rgba(157,157,157,0.15);color:#9d9d9d; border:1px solid rgba(157,157,157,0.2); }
.dt-status-empty  { color:#666; font-style:italic; }

/* ── Runtime Progress Bar ── */
.dt-runtime-bar { height:3px; background:var(--bg-tertiary,#252525); position:relative; overflow:hidden; flex-shrink:0; }
.dt-runtime-bar-fill { height:100%; background:linear-gradient(90deg,#0078D4,#60CDFF); width:0%; transition:width 0.3s ease; }
.dt-runtime-bar-fill.dt-bar-scanning { animation:dt-scan-bar 1.5s ease-in-out infinite; }
@keyframes dt-scan-bar { 0%{width:0%;margin-left:0} 50%{width:60%;margin-left:20%} 100%{width:0%;margin-left:100%} }

/* ── Smoke Test Preview ── */
.dt-smoke-preview { margin-top:10px; background:var(--bg-tertiary,#1e1e1e); border-radius:6px; padding:10px 12px; font-size:12px; border:1px solid var(--border-color,#333); }
.dt-smoke-stat { display:flex; justify-content:space-between; padding:3px 0; color:var(--text-secondary,#9d9d9d); }
.dt-smoke-stat span:last-child { color:#60CDFF; font-weight:600; font-family:'JetBrains Mono',monospace; }
.dt-smoke-cmd { margin-top:8px; background:var(--bg-secondary,#1a1a1a); border-radius:4px; padding:8px 10px; font-family:'JetBrains Mono',monospace; font-size:10.5px; color:#60CDFF; line-height:1.7; max-height:120px; overflow-y:auto; white-space:pre-wrap; word-break:break-all; }

/* ── Confirm / Cancel Buttons ── */
.dt-confirm-row { display:flex; gap:8px; margin-top:10px; }
.dt-btn-confirm { flex:1; height:32px; border-radius:6px; border:none; background:#0078D4; color:#fff; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; transition:opacity 0.15s; }
.dt-btn-confirm:hover { opacity:0.85; }
.dt-btn-cancel { height:32px; padding:0 14px; border-radius:6px; border:1px solid var(--border-color,#333); background:transparent; color:var(--text-secondary,#9d9d9d); font-family:inherit; font-size:12px; cursor:pointer; transition:all 0.15s; }
.dt-btn-cancel:hover { border-color:#D13438; color:#D13438; }

/* ── Runtime Badge ── */
.dt-runtime-badge { display:inline-flex; align-items:center; gap:4px; background:rgba(0,120,212,0.15); color:#60CDFF; padding:2px 8px; border-radius:10px; font-size:10px; font-weight:600; letter-spacing:0.04em; margin-left:6px; }

/* ═══════════════════════════════════════════════════════════
   AUDIT TRAIL
   ═══════════════════════════════════════════════════════════ */

/* ── Audit View Layout Helpers ── */
.audit-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.audit-chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  background: rgba(255,255,255,.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: all .3s;
}
.audit-chain-badge.valid {
  background: rgba(16,185,129,.12);
  color: #10b981;
  border-color: rgba(16,185,129,.3);
  animation: auditPulse 3s ease infinite;
}
.audit-chain-badge.invalid {
  background: rgba(239,68,68,.12);
  color: #ef4444;
  border-color: rgba(239,68,68,.3);
}
@keyframes auditPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
  50%      { box-shadow: 0 0 0 4px rgba(16,185,129,.15); }
}

.audit-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 800px) {
  .audit-stats-row { grid-template-columns: repeat(2, 1fr); }
}

.audit-stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.audit-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.audit-stat-val.valid   { color: #10b981; }
.audit-stat-val.invalid { color: #ef4444; }
.audit-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .3px;
}

.audit-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 16px;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.audit-table thead {
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 2;
}
.audit-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.audit-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: top;
  max-width: 260px;
}
.audit-table tbody tr:hover td { background: var(--accent-light); }
.audit-table tbody tr:last-child td { border-bottom: none; }

.audit-seq    { font-weight: 700; color: var(--text-muted); font-size: 11px; }
.audit-ts     { white-space: nowrap; font-size: 11px; color: var(--text-secondary); }
.audit-user   { font-size: 11px; color: var(--accent); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-agent  { font-size: 11px; font-weight: 600; }
.audit-preview { font-size: 11px; color: var(--text-secondary); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-hash   { font-family: monospace; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.audit-chain-ok  { color: #10b981; font-weight: 700; font-size: 13px; }
.audit-chain-bad { color: #ef4444; font-weight: 700; font-size: 13px; }

.audit-empty {
  text-align: center;
  padding: 32px !important;
  color: var(--text-muted);
  font-size: 13px;
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

/* ════════════════════════════════════
   BUILDER PROCESSING TIMER OVERLAY
════════════════════════════════════ */
#builder-timer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: inherit;
  pointer-events: none;
}

.builder-timer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.builder-timer-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: timerSpin 0.9s linear infinite;
}

@keyframes timerSpin {
  to { transform: rotate(360deg); }
}

.builder-timer-label {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.builder-timer-elapsed {
  font-size: 32px;
  font-weight: 800;
  color: #6366f1;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 70px;
  text-align: center;
}

.builder-timer-hint {
  font-size: 11px;
  color: #475569;
}

@keyframes timerDots {
  0%,20% { opacity: 1; }
  40%     { opacity: 0.3; }
  60%,80% { opacity: 1; }
}

.builder-timer-dots { animation: timerDots 1.4s infinite; }

/* ════════════════════════════════════
   SIDEBAR COLLAPSE TRANSITION
════════════════════════════════════ */
.sidebar-section-body {
  transition: opacity 0.2s ease;
}
.sidebar-section-collapsed .sidebar-section-body {
  display: none;
}

/* ════════════════════════════════════
   DOCUMENT ANALYSIS VIEWER
════════════════════════════════════ */
#doc-viewer-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 12px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

#doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

#doc-viewer-close {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  background: none;
  cursor: pointer;
}
#doc-viewer-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
