/* ============================================
   looksreal.ai — Brand Stylesheet v1
   Colors: Brand Profile v1
   Fonts: Space Grotesk + Geist Mono
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Geist+Mono:wght@300;400;500&display=swap');

:root {
  --sans: 'Space Grotesk', sans-serif;
  --mono: 'Geist Mono', monospace;

  /* Brand colors */
  --ember: #ff4d00;
  --flame: #ff6b00;
  --ignite: #ffb800;
  --online: #22c55e;
  --signal: #3b82f6;
  --alert: #ef4444;

  /* Light mode */
  --void: #ffffff;
  --surface: #f5f5f5;
  --bg: #fafafa;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --text: #0a0a0a;
  --text-secondary: #555;
  --text-muted: #888;
  --text-faint: #aaa;
  --text-ghost: #bbb;
  --text-whisper: #ccc;
  --text-dim: #ddd;
  --text-strong: #333;
  --text-label: #666;
  --text-placeholder: #999;

  /* Surfaces */
  --surface-alt: #f8f8f8;
  --bg-overlay: #1a1a1a;
  --bg-overlay-deep: #1a1a2e;
  --border-mid: #d4d4d4;
  --border-dark: #2a2a2a;

  /* Layout */
  --sidebar-width: 200px;
  --topbar-height: 50px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ============================================
   TOP BAR
   ============================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--void);
  height: var(--topbar-height);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-logo {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.03em;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.topbar-logo .dot { color: var(--ember); }

.topbar-workspace {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-whisper);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.15s;
}
.topbar-workspace:hover { color: var(--text-muted); }

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

.topbar-session {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-ghost);
}
.topbar-session .time { color: var(--text-dim); margin-left: 8px; }

.topbar-balance {
  font-family: var(--mono);
  font-size: 10px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.topbar-balance:hover { border-color: var(--ember); }
.topbar-balance .amount { color: var(--ember); font-weight: 500; }
.topbar-balance .unit { color: var(--text-faint); }

.btn-connect {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 6px 16px;
  background: none;
  border: 1px solid var(--online);
  color: var(--online);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-connect:hover { background: rgba(34,197,94,0.06); }

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height));
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--topbar-height));
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  background: var(--void);
  position: sticky;
  top: var(--topbar-height);
  align-self: flex-start;
}

.sidebar-section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--text-whisper);
  margin-bottom: 8px;
  padding-left: 12px;
}

.sidebar-nav { padding: 0 12px; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 1px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-placeholder);
  border-left: 2px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.sidebar-nav-item:hover { color: var(--text-label); }
.sidebar-nav-item:hover .nav-icon { color: var(--text-placeholder); }
.sidebar-nav-item.active {
  color: var(--ember);
  background: rgba(255,77,0,0.04);
  border-left-color: var(--ember);
}
.sidebar-nav-item.active .nav-icon { color: var(--ember); }

.nav-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  color: var(--text-whisper);
  transition: color 0.15s;
}

.sidebar-library { padding: 0 12px; margin-top: 24px; }

.sidebar-lib-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-ghost);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color 0.15s;
}
.sidebar-lib-item:hover { color: var(--text-muted); }
.sidebar-lib-item .nav-icon { color: var(--text-dim); }

.sidebar-stats { padding: 0 20px; margin-top: 24px; }
.sidebar-balance-section { margin-top: 20px; }

.sidebar-stat-header {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--text-whisper);
  margin-bottom: 10px;
}

.sidebar-stat-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  margin-bottom: 6px;
}
.sidebar-stat-label { color: var(--text-faint); }
.sidebar-stat-value { font-weight: 500; }
.sidebar-stat-value.green { color: var(--online); }
.sidebar-stat-value.ember { color: var(--ember); }

.sidebar-progress {
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  margin-bottom: 8px;
}
.sidebar-progress-fill {
  height: 100%;
  border-radius: 2px;
}
.sidebar-progress-fill.green { background: linear-gradient(90deg, var(--online), #4ade80); }
.sidebar-progress-fill.ember { background: linear-gradient(90deg, var(--ember), var(--flame)); }

/* Deposit modal */
.deposit-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.deposit-modal { position: relative; background: var(--void); width: 420px; max-width: 90vw; padding: 28px; border: 1px solid var(--border); border-radius: 4px; }
.deposit-modal h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: var(--text); }
.deposit-subtitle { margin: 0 0 16px; font-size: 0.8rem; color: var(--text-secondary); }
.deposit-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.deposit-amounts { display: flex; gap: 8px; margin-bottom: 12px; }
.deposit-amounts button { flex: 1; padding: 10px 0; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.deposit-amounts button:hover, .deposit-amounts button.selected { background: var(--ember); color: #fff; border-color: var(--ember); }
.deposit-custom { width: 100%; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.85rem; font-family: inherit; margin-bottom: 16px; box-sizing: border-box; }
.deposit-custom:focus { outline: none; border-color: var(--ember); }
.deposit-actions { display: flex; gap: 10px; justify-content: flex-end; }
.deposit-actions button { padding: 10px 24px; font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit; border: none; transition: all 0.15s; }
.deposit-confirm { background: var(--ember); color: #fff; }
.deposit-confirm:hover { opacity: 0.85; }
.deposit-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
.deposit-cancel { background: transparent; color: var(--text-secondary); border: 1px solid var(--border) !important; }
.deposit-status { font-size: 0.75rem; margin-top: 12px; padding: 8px; text-align: center; }

/* Account modal tabs */
.account-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.account-tab { flex: 1; padding: 10px 0; border: none; background: transparent; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; font-family: inherit; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.account-tab.active { color: var(--ember); border-bottom-color: var(--ember); }
.account-tab:hover { color: var(--text); }
.account-panel.hidden { display: none; }

/* Transaction history */
.tx-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 0.8rem; }
.tx-row:last-child { border-bottom: none; }
.tx-left { color: var(--text); font-weight: 500; }
.tx-right { text-align: right; }
.tx-amount { display: block; font-weight: 600; font-family: var(--mono); font-size: 0.8rem; }
.tx-date { display: block; color: var(--text-faint); font-size: 0.7rem; }

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 20px;
}
.mini-chart-bar {
  width: 3px;
  border-radius: 0.5px;
  background: var(--border);
}
.mini-chart-bar.active { background: var(--online); }

/* Alerts */
.sidebar-alerts { padding: 0 20px; margin-top: 20px; }

.alert-item { margin-bottom: 6px; }
.alert-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
}
.alert-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alert-dot-green { background: var(--online); }
.alert-dot-ember { background: var(--ember); }
.alert-dot-signal { background: var(--signal); }
.alert-text { color: var(--text-muted); }
.alert-time {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-dim);
  margin-left: 10px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}

/* ============================================
   HOME PAGE
   ============================================ */

.home-title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

/* Category cards */
.category-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 40px;
  /* Allow cards to lift on hover without clipping */
  padding-top: 20px;
  margin-top: -20px;
}

.category-card {
  background: var(--void);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 800ms ease, box-shadow 800ms ease, border-color 800ms ease;
  overflow: hidden;
}
.category-card:hover {
  transform: translateY(-6px);
  border-color: var(--ember);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.category-card-header {
  padding: 14px 14px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.category-card-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.category-card-desc {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
}

.category-card-arrow { font-size: 16px; color: var(--text-whisper); }

.category-card-gradient {
  height: 140px;
  margin: 0 10px 10px;
  border-radius: 4px;
}

.category-card-gradient.animated-gradient {
  background-size: 200% 200% !important;
  animation: gradientFlow 6s ease infinite;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* Featured section */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.carousel-arrows {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Carousel container - clips overflow without creating scroll on Y */
.carousel-container {
  position: relative;
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  margin-bottom: 32px;
}

/* Model cards - horizontal scroll track */
.model-cards {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
  width: 100%;
}
.model-cards::-webkit-scrollbar { display: none; }

.carousel-dots {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex: 1;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.carousel-dot.active {
  background: var(--ember);
  width: 18px;
  border-radius: 3px;
}

.carousel-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: var(--void);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.carousel-arrow:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.model-card {
  /* Dynamic width set via JS --card-width */
  flex: 0 0 var(--card-width, 200px);
  min-width: var(--card-width, 200px);
  background: var(--void);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 800ms ease, box-shadow 800ms ease, border-color 800ms ease;
  overflow: hidden;
}
.model-card:hover {
  transform: translateY(-6px);
  border-color: var(--ember);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.model-card-visual {
  height: var(--card-height, 220px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-card-orb-outer {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-card-orb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.model-card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
}

.model-card-info {
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
}

.model-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.model-card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.model-card-name {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.model-card-desc {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--void);
  border: 1px solid var(--border);
  padding: 16px;
}

.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.stat-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--online);
}

/* All models table */
.models-table {
  background: var(--void);
  border: 1px solid var(--border);
  margin-bottom: 40px;
}

.models-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 60px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}

.models-table-header span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-whisper);
}

.models-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 60px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--surface-alt);
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
}
.models-table-row:last-child { border-bottom: none; }
.models-table-row:hover { background: var(--bg); }

.models-table-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.models-table-name .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.models-table-name .name {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.models-table-cell {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-placeholder);
}
.models-table-cell.type { text-transform: uppercase; }

.models-table-arrow {
  text-align: right;
  font-size: 14px;
  color: var(--text-dim);
}

/* All Models header row */
.models-table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Filter tabs for All Models table */
.models-filter-tabs {
  display: flex;
  gap: 6px;
}

.models-filter-tab {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.models-filter-tab:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.models-filter-tab.active {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--void);
}

/* ============================================
   TAGS / BADGES
   ============================================ */

.tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  display: inline-block;
  white-space: nowrap;
}
.tag-new { background: var(--ember); color: #000; }
.tag-popular { background: var(--border); color: var(--text-secondary); }
.tag-beta { background: rgba(59,130,246,0.12); color: var(--signal); }
.tag-online { background: rgba(34,197,94,0.12); color: var(--online); }

/* ============================================
   PROMPT PAGE
   ============================================ */

.prompt-title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

/* Prompt area */
.prompt-area {
  background: var(--void);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

/* Top controls row */
.prompt-controls {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-light);
}

/* Media type pill selector */
.media-selector {
  display: inline-flex;
  gap: 1px;
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 3px;
  margin-right: 16px;
}

.media-selector-item {
  width: 34px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.media-selector-item:hover svg { color: var(--text-muted); }
.media-selector-item.active {
  background: var(--void);
  box-shadow: 0 0.5px 2px rgba(0,0,0,0.06);
}
.media-selector-item.active svg { color: var(--ember); }
.media-selector-item svg { color: var(--text-whisper); transition: color 0.15s; }

/* Sub-tabs */
.sub-tabs {
  display: flex;
  align-items: center;
}

.sub-tab {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-ghost);
  cursor: pointer;
  transition: all 0.15s;
}
.sub-tab:hover { color: var(--text-muted); }
.sub-tab.active {
  border-bottom-color: var(--ember);
  color: var(--text);
}

.btn-enhance {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  padding: 6px 14px;
  background: rgba(59,130,246,0.06);
  color: var(--signal);
  border: 1px solid rgba(59,130,246,0.12);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-enhance:hover { background: rgba(59,130,246,0.1); }
.btn-enhance .label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
}

/* Image upload zone */
.upload-zone {
  margin: 16px 16px 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
}
.upload-zone.hidden { display: none; }

.upload-area {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.upload-area:first-child { border-right: 1px solid var(--border); }
.upload-area:hover { background: var(--bg); }

.upload-area-title {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.upload-area-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-whisper);
}

/* Textarea */
.prompt-textarea {
  width: 100%;
  height: 200px;
  min-height: 200px;
  max-height: 300px;
  padding: 16px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  line-height: 1.6;
}
/* When upload zone is visible, shrink textarea to maintain total height */
.prompt-textarea.compact {
  height: 140px;
  min-height: 140px;
  max-height: 240px;
}
.prompt-textarea::placeholder { color: var(--text-faint); }

/* Bottom bar */
.prompt-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
}

.prompt-options {
  display: flex;
  gap: 8px;
}

.btn-generate {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  height: 36px;
  padding: 0 28px;
  background: var(--ember);
  color: var(--void);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-generate:hover { background: var(--flame); }

/* ============================================
   DROPDOWN COMPONENTS
   ============================================ */

.dropdown { position: relative; }

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.dropdown-trigger:hover {
  background: var(--border-light);
  border-color: var(--text-dim);
  color: var(--text-strong);
}
.dropdown-trigger.active {
  background: var(--border-light);
  border-color: var(--text-whisper);
  color: var(--text-strong);
}

.dropdown-chevron { font-size: 8px; color: var(--text-faint); margin-left: 2px; }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  z-index: 100;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
.dropdown-panel.open { display: block; }

.dropdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: none;
}
.dropdown-overlay.open { display: block; }

.dropdown-section-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-ghost);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

/* Model dropdown */
.model-dropdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 12px;
}

.model-option {
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--void);
  position: relative;
}
.model-option:hover {
  border-color: var(--text-dim);
  background: var(--bg);
}
.model-option.selected {
  border-color: var(--ember);
  background: rgba(255,77,0,0.02);
}

.model-option-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ember);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--void);
  font-size: 10px;
}

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

.model-option-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-option-icon .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.model-option-name {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.model-option-desc {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
  line-height: 1.5;
  transition: color 0.15s;
}
.model-option:hover .model-option-desc { color: var(--text-muted); }

/* Aspect dropdown */
.aspect-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.aspect-option:hover { background: var(--bg); }
.aspect-option.selected { background: rgba(255,77,0,0.03); }

.aspect-icon-box {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aspect-icon-shape {
  border: 1.5px solid var(--text-whisper);
  border-radius: 2px;
  transition: border-color 0.15s;
}
.aspect-option.selected .aspect-icon-shape { border-color: var(--ember); }

.aspect-name {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-label);
  transition: color 0.15s;
}
.aspect-option.selected .aspect-name { font-weight: 500; color: var(--text); }
.aspect-option:hover .aspect-name { color: var(--text-strong); }

.aspect-ratio-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-ghost);
  transition: color 0.15s;
}
.aspect-option.selected .aspect-ratio-label { color: var(--text-muted); }

.aspect-check { color: var(--ember); font-size: 12px; }

/* Simple list dropdown (count, duration) */
.simple-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-label);
  transition: all 0.1s;
}
.simple-option:hover { background: var(--bg); color: var(--text-strong); }
.simple-option.selected {
  background: rgba(255,77,0,0.03);
  color: var(--text);
  font-weight: 500;
}
.simple-option .check { color: var(--ember); font-size: 12px; }

/* ============================================
   GALLERY / CREATIONS
   ============================================ */

.gallery-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.gallery-tab {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-ghost);
  cursor: pointer;
  transition: color 0.15s;
}
.gallery-tab:hover { color: var(--text-muted); }
.gallery-tab.active {
  border-bottom-color: var(--ember);
  color: var(--text);
}

.gallery-grid {
  position: relative;
  overflow: hidden;
}

.gallery-item {
  position: absolute;
  cursor: pointer;
  overflow: hidden;
  background: var(--surface);
  transition: filter 0.15s ease;
}
.gallery-item:hover {
  z-index: 10;
  filter: brightness(1.1);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video: poster on top, video behind — swap on hover */
.gallery-item .gallery-poster,
.showcase-item .gallery-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: opacity 0.3s ease;
}
.gallery-item .gallery-hover-video,
.showcase-item .gallery-hover-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Image: Ken Burns — zoom + pan on hover, randomized per tile via .kb-N class */
.gallery-item .gallery-hover-kenburns,
.showcase-item .gallery-hover-kenburns {
  width: 115% !important;
  height: 115% !important;
  position: absolute;
  top: -7.5%;
  left: -7.5%;
  transition: transform 3s ease-out;
}
/* kb-0: pan upper-left → lower-right */
.gallery-hover-kenburns.kb-0 { transform: translate(3%, 2%); }
.gallery-item:hover .kb-0, .showcase-item:hover .kb-0 { transform: scale(1.08) translate(-3%, -2%); }
/* kb-1: pan lower-right → upper-left */
.gallery-hover-kenburns.kb-1 { transform: translate(-3%, -2%); }
.gallery-item:hover .kb-1, .showcase-item:hover .kb-1 { transform: scale(1.08) translate(3%, 2%); }
/* kb-2: pan upper-right → lower-left */
.gallery-hover-kenburns.kb-2 { transform: translate(-3%, 2%); }
.gallery-item:hover .kb-2, .showcase-item:hover .kb-2 { transform: scale(1.08) translate(3%, -2%); }
/* kb-3: pan lower-left → upper-right */
.gallery-hover-kenburns.kb-3 { transform: translate(3%, -2%); }
.gallery-item:hover .kb-3, .showcase-item:hover .kb-3 { transform: scale(1.08) translate(-3%, 2%); }
/* kb-4: zoom only, no pan */
.gallery-hover-kenburns.kb-4 { transform: scale(1); }
.gallery-item:hover .kb-4, .showcase-item:hover .kb-4 { transform: scale(1.12); }

/* 3D: model-viewer fills tile, auto-rotates */
.gallery-item .gallery-hover-3d,
.showcase-item .gallery-hover-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-item.filler,
.showcase-item.filler {
  cursor: pointer;
}

.gallery-audio-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: var(--void);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.lightbox-ref {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-ghost);
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.15s;
}
.lightbox-ref:hover {
  color: var(--ember);
}

.filler-cta {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.filler-brand {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-ghost);
  letter-spacing: 0.04em;
}
.filler-action {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ember);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Gallery filter bar */
.gallery-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.gallery-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-ghost);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { color: var(--text-muted); border-color: var(--text-ghost); }
.filter-chip.active { background: var(--ember); color: var(--void); border-color: var(--ember); }

.gallery-search {
  flex: 1;
  min-width: 180px;
}
.gallery-search-input {
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  background: var(--void);
  border: 1px solid var(--border);
  color: var(--bg-overlay);
  outline: none;
  transition: border-color 0.15s;
}
.gallery-search-input:focus { border-color: var(--ember); }
.gallery-search-input::placeholder { color: var(--text-ghost); }

/* Shared badge on gallery items */
.gallery-shared-badge {
  font-size: 10px;
  color: var(--ember);
  margin-right: 4px;
}

/* ============================================
   SHARE TOGGLE (lightbox)
   ============================================ */

.share-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.share-toggle-input {
  display: none;
}
.share-toggle-slider {
  width: 32px;
  height: 18px;
  background: var(--bg-overlay);
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
}
.share-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}
.share-toggle-input:checked + .share-toggle-slider {
  background: var(--ember);
}
.share-toggle-input:checked + .share-toggle-slider::after {
  left: 16px;
  background: var(--void);
}
.share-toggle-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: color 0.15s;
}
.share-toggle-input:checked ~ .share-toggle-label {
  color: var(--ember);
}

/* ============================================
   SHOWCASE BOARD (home page masonry)
   ============================================ */

.showcase-grid {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}
.showcase-item {
  position: absolute;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-overlay);
  transition: filter 0.15s ease;
}
.showcase-item:hover {
  z-index: 10;
  filter: brightness(1.1);
}
.showcase-item img,
.showcase-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.showcase-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay-deep);
}
.showcase-audio-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-ghost);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-body {
  position: relative;
  max-width: 90vw;
  max-height: 92vh;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
}
.lightbox-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.lightbox-visual img,
.lightbox-visual video {
  border-radius: 8px 8px 0 0;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--void);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-orb {
  width: 50%;
  height: 50%;
  border-radius: 50%;
  opacity: 0.6;
}

/* Drawer — must clip to body width set by JS */
.lightbox-drawer {
  width: 100%;
  background: var(--bg-overlay);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid var(--border-dark);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.lightbox-drawer-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-label);
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.lightbox-drawer-toggle:hover { color: var(--text-faint); }
.lightbox-drawer-toggle svg {
  transition: transform 0.2s ease;
}
.lightbox-drawer-toggle.collapsed svg {
  transform: rotate(0deg);
}
.lightbox-drawer-toggle:not(.collapsed) svg {
  transform: rotate(180deg);
}

.lightbox-drawer-content {
  padding: 0 20px 16px;
  max-height: 400px;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
  opacity: 1;
  min-width: 0;
  overflow-x: hidden;
}
.lightbox-drawer-content.collapsed {
  max-height: 0;
  padding: 0 20px;
  opacity: 0;
  overflow: hidden;
}

/* Prompt */
.lightbox-prompt {
  margin-bottom: 14px;
}

.lightbox-field-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-label);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.lightbox-prompt-text {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-whisper);
  cursor: pointer;
  padding: 8px 10px;
  background: var(--border-dark);
  overflow-wrap: break-word;
  word-break: break-word;
  border-radius: 4px;
  transition: background 0.15s;
  max-height: 6.4em;
  overflow-y: auto;
}
.lightbox-prompt-text:hover { background: var(--border-dark); }

/* Details grid */
.lightbox-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
}

.lightbox-field-value {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-ghost);
}


.lightbox-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 7px 20px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.lightbox-btn.primary {
  background: var(--ember);
  color: var(--void);
}
.lightbox-btn.primary:hover { background: var(--flame); }

.lightbox-btn.secondary {
  background: var(--bg-overlay);
  color: var(--text-faint);
}
.lightbox-btn.secondary:hover { background: var(--text-strong); color: var(--text-whisper); }

/* ============================================
   CUSTOM SCROLLBARS
   ============================================ */

/* Webkit (Chrome, Safari, Edge) */
.dropdown-panel::-webkit-scrollbar,
.prompt-textarea::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
  width: 6px;
}

.dropdown-panel::-webkit-scrollbar-track,
.prompt-textarea::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-panel::-webkit-scrollbar-thumb,
.prompt-textarea::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}

.dropdown-panel::-webkit-scrollbar-thumb:hover,
.prompt-textarea::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-ghost);
}

/* Firefox */
.dropdown-panel,
.prompt-textarea,
.main-content {
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden { display: none !important; }

/* ============================================
   HAMBURGER BUTTON (hidden on desktop)
   ============================================ */

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-muted);
  transition: background 0.15s;
}
.hamburger-btn:hover span { background: var(--text); }

.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.15s;
}
.sidebar-close-btn:hover { color: var(--text); border-color: var(--text-muted); }

.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================
   RESPONSIVE: ≤ 1024px — Sidebar → overlay
   ============================================ */

@media (max-width: 1024px) {
  .hamburger-btn { display: flex; }
  .sidebar-close-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 1000;
    transform: translateX(-260px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: none;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    min-height: unset;
  }

  .sidebar.animating {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    width: 100%;
  }

  /* Module cards: 3 cols */
  .category-cards { grid-template-columns: repeat(3, 1fr); }

  /* Gallery: 3 cols */
  /* MiniMasonry handles responsive columns */
}

/* ============================================
   RESPONSIVE: ≤ 768px — Grids reduce, topbar collapses
   ============================================ */

@media (max-width: 768px) {
  /* Topbar: hide secondary items */
  .topbar { padding: 10px 16px; }
  .topbar-workspace { display: none; }
  .topbar-session { display: none; }

  /* Main content: reduce padding */
  .main-content { padding: 20px 16px; }

  /* Home title */
  .home-title { font-size: 18px; margin-bottom: 24px; }

  /* Module cards: horizontal scroll */
  .category-cards {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding-top: 20px;
    margin-top: -20px;
    padding-bottom: 4px;
    -webkit-transform: translateZ(0);
  }
  .category-cards::-webkit-scrollbar { display: none; }
  .category-card {
    flex: 0 0 220px;
    min-width: 220px;
    scroll-snap-align: start;
  }

  /* Featured model cards: tighter gap on tablet */
  .model-cards { gap: 10px; }

  /* Hide carousel arrows on mobile - touch scroll instead */
  .carousel-arrow { display: none; }

  /* Stats: 2 cols */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Table: hide TYPE and STATUS columns */
  .models-table-header {
    grid-template-columns: 2fr 1fr 60px;
  }
  .models-table-row {
    grid-template-columns: 2fr 1fr 60px;
  }
  .models-table-header span:nth-child(3),
  .models-table-header span:nth-child(4),
  .models-table-row > :nth-child(3),
  .models-table-row > :nth-child(4) {
    display: none;
  }

  /* Gallery: 3 cols */
  /* MiniMasonry handles responsive columns */

  /* Inspiration: bin-pack handles responsive */

  /* Featured section nav arrows: hide */
  .section-nav { display: none; }

  /* Prompt title */
  .prompt-title { font-size: 18px; }

  /* Prompt controls: wrap */
  .prompt-controls { flex-wrap: wrap; gap: 8px; }
  .media-selector { margin-right: 8px; }

  /* Upload zone: stack */
  .upload-zone { flex-direction: column; }
  .upload-area:first-child { border-right: none; border-bottom: 1px solid var(--border); }

  /* Lightbox */
  .lightbox-body { max-width: 95vw; max-height: 94vh; }
  .lightbox-visual img,
  .lightbox-visual video { max-width: 93vw; max-height: 60vh; }
  .lightbox-details-grid { grid-template-columns: repeat(2, 1fr); gap: 10px 12px; }

  /* Model dropdown */
  .dropdown-panel[style*="min-width:755px"] {
    min-width: unset !important;
    width: calc(100vw - 32px);
    max-width: 400px;
    left: 0;
  }
  .model-dropdown-grid { grid-template-columns: 1fr; }
}

/* ============================================
   RESPONSIVE: ≤ 600px — Everything stacks
   ============================================ */

@media (max-width: 600px) {
  /* Sidebar: full width */
  .sidebar {
    width: 100%;
    transform: translateX(-100%);
  }

  /* Topbar: minimal */
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar-balance { display: none; }
  .btn-connect { padding: 6px 10px; font-size: 9px; }
  .topbar-logo { font-size: 14px; }

  /* Main content: tighter */
  .main-content { padding: 16px 12px; }

  /* Home title smaller */
  .home-title { font-size: 16px; margin-bottom: 20px; }

  /* Module cards in scroll */
  .category-card { flex: 0 0 200px; min-width: 200px; }
  .category-card-gradient { height: 100px; }

  /* Model cards in scroll */
  /* Card size handled by JS at all breakpoints */

  /* Prompt bottom: stack */
  .prompt-bottom { flex-wrap: wrap; gap: 8px; }
  .prompt-options { width: 100%; flex-wrap: wrap; }
  .btn-generate {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }

  /* Dropdown triggers: allow wrapping */
  .dropdown-trigger { font-size: 10px; padding: 0 10px; }

  /* Gallery: 2 cols */
  /* MiniMasonry handles responsive columns */

  /* Stats */
  .stat-value { font-size: 20px; }

  /* Table: name + arrow only */
  .models-table-header {
    grid-template-columns: 1fr 40px;
  }
  .models-table-row {
    grid-template-columns: 1fr 40px;
  }
  .models-table-header span:nth-child(2),
  .models-table-row > :nth-child(2) {
    display: none;
  }

  /* Lightbox */
  .lightbox-details-grid { grid-template-columns: repeat(2, 1fr); gap: 8px 10px; }
  .lightbox-drawer-content { padding: 0 12px 12px; }
  .lightbox-actions { padding: 10px 12px; }

  /* Prompt textarea smaller on mobile */
  .prompt-textarea { height: 140px; min-height: 120px; max-height: 200px; font-size: 14px; }
  .prompt-textarea.compact { height: 100px; min-height: 80px; max-height: 160px; }
}

/* ============================================
   RESPONSIVE: ≤ 480px — Minimal
   ============================================ */

@media (max-width: 480px) {
  /* Gallery: 1 col */
  /* MiniMasonry handles responsive columns */

  /* Stats: single col */
  .stats-grid { grid-template-columns: 1fr; }

  /* Home title */
  .home-title { font-size: 15px; }

  /* Prompt controls: vertical */
  .prompt-controls { padding: 8px 12px; }
  .sub-tabs { flex-wrap: wrap; }
  .sub-tab { padding: 6px 10px; font-size: 12px; }
  .btn-enhance { display: none; }

  /* Lightbox details: single col */
  .lightbox-details-grid { grid-template-columns: 1fr; }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  font-family: var(--mono);
  font-size: 11px;
  padding: 10px 18px;
  border-radius: 4px;
  color: var(--void);
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
  max-width: 340px;
}
.toast.show {
  opacity: 1;
  transform: translateX(0);
}
.toast-success { background: var(--online); }
.toast-error { background: var(--alert); }
.toast-info { background: var(--signal); }

/* ============================================
   STATUS MODAL (generation progress)
   ============================================ */

.status-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.status-box {
  position: relative;
  background: var(--void);
  border: 1px solid var(--border);
  padding: 40px 48px;
  text-align: center;
  min-width: 320px;
  max-width: 400px;
}

.status-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--ember);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.status-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.status-log {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.status-cancel {
  font-family: var(--mono);
  font-size: 10px;
  padding: 6px 20px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.status-cancel:hover {
  border-color: var(--alert);
  color: var(--alert);
}

/* ============================================
   LOGIN MODAL
   ============================================ */

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.login-box {
  position: relative;
  background: var(--void);
  border: 1px solid var(--border);
  padding: 40px;
  width: 360px;
  max-width: 90vw;
}

.login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-close:hover { color: var(--text); }

.login-title {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.login-subtitle {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-btn {
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 10px;
  background: var(--ember);
  color: var(--void);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--flame); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================
   CONNECT BUTTON (connected state)
   ============================================ */

.btn-connect.connected {
  border-color: var(--ember);
  color: var(--ember);
}
.btn-connect.connected:hover {
  background: rgba(255, 77, 0, 0.06);
}

/* ============================================
   CUSTOM PARAMS (schema-driven controls)
   ============================================ */

.custom-params {
  padding: 8px 16px 4px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}
.custom-params.hidden { display: none; }


.custom-param {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-param-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-ghost);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.custom-param-select {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 0;
  cursor: pointer;
  max-width: 160px;
}
.custom-param-select:focus { border-color: var(--ember); outline: none; }

.custom-param-slider {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-slider-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-ghost);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.custom-param-range {
  width: 100px;
  height: 3px;
  accent-color: var(--ember);
  cursor: pointer;
}

.custom-slider-value {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  min-width: 28px;
}

.custom-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
}

.custom-toggle input[type="checkbox"] { display: none; }

.toggle-slider {
  width: 28px;
  height: 14px;
  background: var(--border);
  border-radius: 7px;
  position: relative;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--void);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.custom-toggle input:checked + .toggle-slider {
  background: var(--ember);
}
.custom-toggle input:checked + .toggle-slider::after {
  transform: translateX(14px);
}

.toggle-label {
  color: var(--text-muted);
}

/* ============================================
   GALLERY EMPTY STATE
   ============================================ */

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-ghost);
}

.models-table-empty {
  text-align: center;
  padding: 24px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-ghost);
}

/* ============================================
   LIGHTBOX: real media (images, videos, audio)
   ============================================ */

.lightbox-visual img,
.lightbox-visual video {
  max-width: 88vw;
  max-height: 70vh;
  display: block;
  object-fit: contain;
}

.lightbox-visual audio {
  width: 90%;
}

/* Audio lightbox: cover art with audio player overlay */
.lightbox-audio-container {
  position: relative;
  width: min(88vw, 500px);
  height: min(70vh, 500px);
  background: var(--bg-overlay-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}
.lightbox-audio-cover {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}
.lightbox-audio-container audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.lightbox-audio-container {
  cursor: pointer;
}
.lightbox-audio-play-icon {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  transition: opacity 0.3s ease;
}
.lightbox-audio-play-icon.hidden {
  opacity: 0;
  pointer-events: none;
}
.lightbox-audio-play-icon svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* ============================================
   SIDEBAR GENERATIONS (non-blocking queue)
   ============================================ */

.sidebar-generations {
  padding: 0 12px;
  margin-top: 16px;
}

.sidebar-gen-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--text-whisper);
  margin-bottom: 8px;
  padding-left: 8px;
}

.gen-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  margin-bottom: 2px;
  border-radius: 4px;
  transition: background 0.15s;
}
.gen-item.clickable { cursor: pointer; }
.gen-item.clickable:hover { background: var(--bg); }

.gen-item-spinner {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--border);
  border-top-color: var(--ember);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.gen-item-thumb {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

.gen-item-text {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gen-item-text.failed {
  text-decoration: line-through;
  color: var(--text-ghost);
}

.gen-item-media-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}
.gen-item-media-icon svg { width: 10px; height: 10px; }

.gen-item-time {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-ghost);
  flex-shrink: 0;
}

.gen-item-check {
  color: var(--online);
  font-size: 11px;
  flex-shrink: 0;
}

.gen-item-error-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--alert);
  flex-shrink: 0;
}

/* ============================================
   GALLERY PLACEHOLDER (pulsing card)
   ============================================ */

.gallery-placeholder-visual {
  width: 100%;
  height: 100%;
  background: var(--void);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.gallery-placeholder-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--text-placeholder);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.gallery-placeholder-label {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-placeholder);
  letter-spacing: 0.06em;
}

.gallery-placeholder-failed {
  width: 100%;
  height: 100%;
  background: #1a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.gallery-placeholder-failed-icon {
  font-size: 16px;
  color: var(--alert);
}

.gallery-placeholder-failed-text {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--alert);
  letter-spacing: 0.06em;
}

/* ============================================
   MORPH ANIMATION (placeholder → result)
   ============================================ */

.gallery-item-morphed {
  animation: morphFadeIn 0.5s ease-out;
}

@keyframes placeholderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes morphFadeIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============================================
   UTILITY CLASSES (extracted from inline styles)
   ============================================ */
.u-pad-6 { padding: 6px; }
.u-pad-8 { padding: 8px; }
.u-opt-item { padding: 4px 8px; margin-bottom: 2px; }
.u-opt-item-lg { padding: 4px 8px; margin-bottom: 4px; }
.u-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.u-flex-1 { flex: 1; }
.u-w-150 { width: 150px; }
.u-w-160 { width: 160px; }
.u-w-180 { width: 180px; }
.u-w-200 { width: 200px; }
.u-w-220 { width: 220px; }
.u-w-300 { width: 300px; }
.u-color-ember { color: var(--ember); }
.u-meta-sm { font-size: 10px; color: var(--text-faint); }
.u-mono-sm { font-family: var(--mono); font-size: 10px; color: var(--text-muted); min-width: 28px; }
.u-range-track { flex: 1; height: 3px; accent-color: var(--ember); }
.u-3d-placeholder { width: 100%; height: 100%; background: var(--bg-overlay-deep); display: flex; align-items: center; justify-content: center; }
.u-3d-viewer-bg { position: absolute; inset: 0; width: 100%; height: 100%; background: linear-gradient(180deg, var(--bg-overlay-deep), #111); --progress-bar-height: 0; }
