/* AIRED — Neural Photoshop — Global Styles */

:root {
  --bg-base: #0a0a0f;
  --bg-surface: #111118;
  --bg-elevated: #1a1a24;
  --bg-hover: #22223a;
  --bg-active: #2a2a40;
  --border: #2a2a3d;
  --border-subtle: #1e1e2e;
  --accent: #6366f1;
  --accent-hover: #7c7ff5;
  --accent-dim: rgba(99, 102, 241, 0.15);
  --accent-2: #8b5cf6;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --text-primary: #e2e2ef;
  --text-secondary: #8888aa;
  --text-muted: #55556a;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(99,102,241,0.25);
  --font: 'Inter', system-ui, sans-serif;
  --sidebar-w: 220px;
  --header-h: 54px;
  --transition: 0.18s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width var(--transition);
  z-index: 100;
}

.sidebar-logo {
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 15px; font-weight: 700; letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 10px 0;
}
.nav-section { padding: 6px 12px 2px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  color: var(--text-muted); text-transform: uppercase; padding: 0 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 20px; border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition); text-decoration: none;
  margin: 1px 6px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-dim); color: var(--accent);
  font-weight: 500;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .nav-label { font-size: 13px; }

.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border-subtle);
}

/* ===== MAIN AREA ===== */
.main-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

.topbar {
  height: var(--header-h); background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; flex-shrink: 0; gap: 12px;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page-content {
  flex: 1; overflow-y: auto; padding: 24px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all var(--transition); white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: var(--shadow-glow); }
.btn-secondary {
  background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.15); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* Generate button pulse */
.btn-generate {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; padding: 11px 24px; font-size: 14px; font-weight: 600;
  width: 100%; border-radius: var(--radius);
}
.btn-generate:hover:not(:disabled) {
  transform: translateY(-1px); box-shadow: 0 6px 24px rgba(99,102,241,0.4);
}
.btn-generate.loading {
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== FORM ELEMENTS ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; width: 100%;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { appearance: none; cursor: pointer; }

/* Toggle */
.toggle-group { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle {
  width: 36px; height: 20px; background: var(--bg-active); border-radius: 10px;
  position: relative; transition: background var(--transition); flex-shrink: 0;
  cursor: pointer; border: none; padding: 0;
}
.toggle::after {
  content: ''; width: 14px; height: 14px; background: white;
  border-radius: 50%; position: absolute; top: 3px; left: 3px;
  transition: transform var(--transition);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* Range slider */
.range-row { display: flex; align-items: center; gap: 10px; }
input[type=range] {
  flex: 1; accent-color: var(--accent); cursor: pointer; height: 4px;
}
.range-val { font-size: 12px; color: var(--text-secondary); min-width: 36px; text-align: right; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.card-title {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 2px; background: var(--bg-elevated); padding: 3px; border-radius: var(--radius-sm); }
.tab {
  flex: 1; padding: 6px 12px; border-radius: 5px; font-size: 12px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; text-align: center;
  transition: all var(--transition); border: none; background: transparent;
}
.tab.active { background: var(--bg-active); color: var(--text-primary); }
.tab:hover:not(.active) { color: var(--text-secondary); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 99px; font-size: 11px; font-weight: 500;
}
.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-error { background: rgba(239,68,68,0.15); color: var(--error); }

/* ===== PROGRESS ===== */
.progress-bar { height: 4px; background: var(--bg-active); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px; transition: width 0.3s ease;
}

/* ===== NOTIFICATIONS ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
  pointer-events: all; animation: slideIn 0.2s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  max-width: 90vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 16px; font-weight: 600; }

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ===== DROPDOWN ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; min-width: 180px;
  z-index: 200; box-shadow: var(--shadow);
  animation: fadeIn 0.12s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item {
  padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; color: var(--text-primary);
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg-hover); }

/* ===== IMAGE GRID ===== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.image-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.image-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.image-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.image-card-body { padding: 10px; }
.image-card-prompt { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.image-card-date { font-size: 10px; color: var(--text-muted); }

.image-card-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition);
}
.image-card:hover .image-card-actions { opacity: 1; }
.img-action-btn {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  border: none; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: background var(--transition);
}
.img-action-btn:hover { background: var(--accent); }
.img-action-btn.favorited { color: #fbbf24; }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.lightbox-img { max-width: 80vw; max-height: 80vh; border-radius: var(--radius); }
.lightbox-panel {
  position: absolute; right: 24px; top: 24px; bottom: 24px;
  width: 300px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; overflow-y: auto;
}
.lightbox-close {
  position: absolute; top: 16px; left: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none; color: white;
  cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ===== CHIP / TAG ===== */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px;
  background: var(--bg-active); color: var(--text-secondary);
  font-size: 11px; cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.chip:hover, .chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.chip-remove { margin-left: 2px; opacity: 0.6; }
.chip-remove:hover { opacity: 1; }

/* ===== COMPARISON SLIDER ===== */
.compare-slider { position: relative; overflow: hidden; border-radius: var(--radius); cursor: col-resize; }
.compare-slider img { width: 100%; display: block; }
.compare-slider .before { position: absolute; inset: 0; overflow: hidden; }
.compare-handle {
  position: absolute; top: 0; bottom: 0; width: 3px; background: white;
  cursor: col-resize; z-index: 10;
}
.compare-handle::before, .compare-handle::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: 32px; height: 32px; background: white; border-radius: 50%;
  box-shadow: var(--shadow);
}
.compare-handle::before { top: calc(50% - 16px); }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--bg-elevated);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: var(--accent-dim);
}
.upload-zone svg { width: 32px; height: 32px; color: var(--text-muted); margin: 0 auto 8px; }
.upload-zone p { color: var(--text-secondary); font-size: 13px; }
.upload-zone small { color: var(--text-muted); font-size: 11px; }

/* ===== STYLE PRESET GRID ===== */
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-btn {
  padding: 6px 4px; border-radius: var(--radius-sm); font-size: 11px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; text-align: center;
  transition: all var(--transition);
}
.preset-btn:hover, .preset-btn.active {
  border-color: var(--accent); color: var(--accent); background: var(--accent-dim);
}

/* ===== SIZE SELECTOR ===== */
.size-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.size-btn {
  padding: 5px; border-radius: var(--radius-sm); font-size: 11px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; text-align: center;
  transition: all var(--transition);
}
.size-btn:hover, .size-btn.active {
  border-color: var(--accent); color: var(--accent); background: var(--accent-dim);
}
.size-btn .size-icon { font-size: 16px; display: block; margin-bottom: 2px; }

/* ===== RESULT GRID ===== */
.result-grid { display: grid; gap: 12px; }
.result-grid.n1 { grid-template-columns: 1fr; max-width: 512px; }
.result-grid.n2 { grid-template-columns: repeat(2, 1fr); }
.result-grid.n3, .result-grid.n4 { grid-template-columns: repeat(2, 1fr); }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; gap: 12px;
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-muted); }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; color: var(--text-muted); max-width: 300px; }

/* ===== SPINNER ===== */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TWO-PANE LAYOUT ===== */
.two-pane {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  height: 100%;
}
.two-pane.wide-right { grid-template-columns: 300px 1fr; }

/* ===== GENERATE PAGE ===== */
.gen-panel {
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  padding-right: 4px;
}
.gen-result {
  display: flex; flex-direction: column; gap: 16px;
}

/* ===== EDITOR PANEL ===== */
.editor-layout {
  display: grid; grid-template-columns: 52px 1fr 280px;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}
.editor-toolbar {
  background: var(--bg-surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 6px; gap: 4px;
}
.tool-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.tool-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.tool-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.editor-canvas-wrap {
  overflow: auto; background: #050508;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 20px;
}
canvas#editor-canvas { cursor: crosshair; }
.editor-side {
  background: var(--bg-surface); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px;
}

/* ===== CHAT ===== */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; height: 100%; gap: 0; }
.chat-sidebar {
  background: var(--bg-surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-main { display: flex; flex-direction: column; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.chat-bubble.user { background: var(--accent); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble.assistant {
  background: var(--bg-elevated); color: var(--text-primary);
  align-self: flex-start; border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.chat-bubble.assistant code { background: var(--bg-active); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.chat-bubble.assistant pre { background: var(--bg-active); padding: 10px; border-radius: 8px; overflow-x: auto; margin: 8px 0; }
.chat-input-area {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--bg-surface);
}
.chat-input {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; color: var(--text-primary);
  font-size: 13px; resize: none; outline: none; max-height: 120px; min-height: 40px;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--accent); }
.chat-mode-tabs { display: flex; gap: 4px; padding: 12px 16px 0; overflow-x: auto; }
.chat-mode-btn {
  padding: 5px 10px; border-radius: 99px; font-size: 11px; font-weight: 500;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.chat-mode-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.typing-cursor { display: inline-block; width: 2px; height: 14px; background: var(--accent); animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

/* Quick action chips */
.quick-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }

/* ===== PIPELINE ===== */
.pipeline-canvas {
  flex: 1; background: var(--bg-base); border-radius: var(--radius);
  border: 1px solid var(--border); position: relative; overflow: auto; min-height: 400px;
}
.pipeline-step {
  position: absolute; width: 200px; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; cursor: grab;
  transition: border-color var(--transition);
}
.pipeline-step:hover { border-color: var(--accent); }
.pipeline-step-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pipeline-step-icon { font-size: 18px; }
.pipeline-step-label { font-size: 12px; font-weight: 600; }
.pipeline-step-type { font-size: 10px; color: var(--text-muted); background: var(--bg-active); padding: 2px 6px; border-radius: 99px; }

/* ===== GALLERY FILTERS ===== */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); }
.search-input-wrap input { padding-left: 32px; }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 28px; }
.settings-section-title {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle); gap: 16px;
}
.settings-row-info { flex: 1; }
.settings-row-label { font-size: 13px; font-weight: 500; }
.settings-row-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.settings-stat { text-align: center; }
.settings-stat-val { font-size: 24px; font-weight: 700; color: var(--accent); }
.settings-stat-label { font-size: 11px; color: var(--text-muted); }

/* ===== REFS PREVIEW ===== */
.refs-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-thumb {
  width: 72px; height: 72px; border-radius: var(--radius-sm);
  overflow: hidden; position: relative; border: 1px solid var(--border);
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-thumb-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  background: rgba(0,0,0,0.7); border-radius: 50%; border: none;
  color: white; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ===== SCROLLBAR IN SIDEBAR ===== */
.sidebar-session-list { overflow-y: auto; flex: 1; padding: 8px; }
.session-item {
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12px; color: var(--text-secondary);
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: space-between;
}
.session-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.session-item.active { background: var(--accent-dim); color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .two-pane { grid-template-columns: 1fr; }
  .sidebar { width: 52px; }
  .sidebar-logo .logo-text { display: none; }
  .nav-item .nav-label { display: none; }
  .nav-item { padding: 10px; justify-content: center; }
  .nav-section-label { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .editor-layout { grid-template-columns: 44px 1fr; }
  .editor-side { display: none; }
  .lightbox-panel { display: none; }
}

/* ===== HERO / LOGIN ===== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 20%, rgba(139,92,246,0.1) 0%, transparent 50%),
              var(--bg-base);
}
.login-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; justify-content: center; }
.login-logo .logo-icon { width: 42px; height: 42px; border-radius: 10px; font-size: 20px; }
.login-logo .logo-text { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
