:root {
  --bg: #07090f;
  --bg-alt: #0c111b;
  --panel: rgba(13, 18, 28, 0.92);
  --panel-strong: rgba(9, 13, 20, 0.96);
  --panel-border: rgba(63, 225, 194, 0.18);
  --text: #f5f7ff;
  --muted: #a6b0c4;
  --accent: #3fe1c2;
  --accent-2: #f29c4b;
  --accent-3: #d7e36a;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --glow-shadow: 0 0 0 1px rgba(63, 225, 194, 0.12), 0 18px 50px rgba(7, 10, 18, 0.6);
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-display: 'Fraunces', serif;
  --text-xxl: clamp(2.4rem, 4.8vw, 4rem);
  --text-xl: clamp(1.6rem, 2.6vw, 2.4rem);
  --text-lg: 1.15rem;
  --text-md: 1rem;
  --text-sm: 0.9rem;
  --text-xs: 0.78rem;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background: radial-gradient(circle at 15% 20%, rgba(63, 225, 194, 0.18) 0%, transparent 48%),
    radial-gradient(circle at 85% 10%, rgba(242, 156, 75, 0.2) 0%, transparent 42%),
    radial-gradient(circle at 70% 85%, rgba(215, 227, 106, 0.14) 0%, transparent 52%),
    linear-gradient(140deg, #05060a 0%, #0b111b 45%, #07090f 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}


.glow {
  position: fixed;
  inset: -40vh -20vw auto auto;
  height: 55vh;
  width: 55vh;
  background: radial-gradient(circle, rgba(63, 225, 194, 0.3), rgba(242, 156, 75, 0.18) 35%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  animation: float 12s ease-in-out infinite alternate;
}

@keyframes float {
  from {
    transform: translate(-10%, -5%);
  }
  to {
    transform: translate(10%, 5%);
  }
}

/* ===== GLOBAL APP HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(63, 225, 194, 0.1);
}

.app-header .brand-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-header .brand-compact .brand-mark {
  width: 32px;
  height: 32px;
}

.app-header .brand-compact .brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-header-actions .ghost {
  padding: 6px 12px;
  font-size: var(--text-sm);
}

.app-header .app-email {
  font-size: var(--text-xs);
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header .account-credits {
  font-size: var(--text-xs);
  color: var(--accent);
  padding: 4px 10px;
  background: rgba(63, 225, 194, 0.1);
  border-radius: var(--radius-pill);
}

@media (max-width: 768px) {
  .app-header {
    padding: 10px 16px;
  }

  .app-header .brand-compact .brand-name {
    display: none;
  }

  .app-header-actions {
    gap: 6px;
  }

  .app-header-actions .ghost {
    padding: 6px 10px;
    font-size: var(--text-xs);
  }

  .app-header .app-email {
    display: none;
  }

  .app-header .account-credits {
    font-size: 10px;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 8px 12px;
    gap: 8px;
  }

  .app-header-actions {
    gap: 4px;
  }

  .app-header-actions .ghost {
    padding: 4px 6px;
    font-size: 10px;
  }

  /* On very small screens, hide some nav items */
  .app-header #appAdminBtn {
    display: none;
  }

  .app-header .account-credits {
    font-size: 9px;
    padding: 2px 6px;
  }
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  padding: 48px 8vw 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: var(--text-xs);
  color: var(--accent);
  margin-bottom: 16px;
  text-shadow: 0 0 18px rgba(63, 225, 194, 0.35);
}

.lede {
  color: rgba(245, 247, 255, 0.72);
  font-size: var(--text-lg);
}

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

.dropzone {
  border: 1.5px dashed rgba(63, 225, 194, 0.5);
  padding: 28px;
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  background: rgba(10, 14, 22, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(63, 225, 194, 0.1);
  box-shadow: 0 0 0 1px rgba(63, 225, 194, 0.35), 0 18px 40px rgba(5, 10, 18, 0.6);
}

.drop-title {
  margin: 0 0 6px;
  font-size: var(--text-lg);
  font-weight: 600;
}

.drop-sub {
  margin: 0;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.review-config-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(8, 12, 20, 0.65);
  display: grid;
  gap: 12px;
}

.review-config-row {
  display: grid;
  gap: 10px;
}

.review-config-panel .variant-config,
.review-config-panel .preview-config {
  margin-top: 0;
}

.review-config-panel .variant-config {
  flex-wrap: wrap;
  row-gap: 6px;
}

.review-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.review-config-panel .model-config {
  margin-top: 0;
}

.review-config-panel .estimate-summary {
  margin-top: 0;
}

@media (min-width: 768px) {
  .review-config-row {
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr);
    align-items: center;
  }

  .review-config-row .preview-config {
    justify-self: end;
  }

  .review-config-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (min-width: 1024px) {
  .review-config-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

.variant-config {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.variant-config select {
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  background: rgba(10, 14, 22, 0.7);
  color: var(--text);
  border: 1px solid rgba(63, 225, 194, 0.22);
  font-family: var(--font-body);
}

.variant-config input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.variant-config .dropdown-meta {
  flex: 1;
  margin: 0;
  font-size: var(--text-xs);
  color: var(--muted);
  opacity: 0.8;
}

.cost-estimate {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(63, 225, 194, 0.08);
  border: 1px solid rgba(63, 225, 194, 0.2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.cost-estimate .cost-label {
  color: var(--muted);
}

.cost-estimate .cost-value {
  font-weight: 600;
  color: var(--accent);
}

.cost-estimate .cost-unit {
  color: var(--muted);
  font-size: var(--text-xs);
}

.model-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.model-config.is-hidden {
  display: none;
}

.preview-config {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: var(--text-sm);
  cursor: pointer;
  position: relative;
  user-select: none;
}

.toggle-field input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: rgba(9, 12, 20, 0.9);
  border: 1px solid rgba(63, 225, 194, 0.24);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(242, 255, 252, 0.9);
  box-shadow: 0 2px 6px rgba(3, 6, 12, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-field input:checked + .toggle-track {
  background: rgba(63, 225, 194, 0.3);
  border-color: rgba(63, 225, 194, 0.7);
}

.toggle-field input:checked + .toggle-track::after {
  transform: translateX(20px);
  background: rgba(8, 20, 20, 0.95);
}

.toggle-field input:focus-visible + .toggle-track {
  outline: 2px solid rgba(63, 225, 194, 0.6);
  outline-offset: 2px;
}

.preview-config .panel-note {
  margin: 0;
  font-size: var(--text-xs);
  color: rgba(245, 247, 255, 0.7);
}

.generation-config {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.generation-config .model-config {
  margin-top: 0;
}

.model-config select {
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  background: rgba(10, 14, 22, 0.7);
  color: var(--text);
  border: 1px solid rgba(63, 225, 194, 0.22);
  font-family: var(--font-body);
}

.model-meta {
  font-size: var(--text-xs);
  color: rgba(211, 221, 244, 0.9);
  line-height: 1.5;
}

.model-meta a {
  color: var(--accent-2);
  text-decoration: none;
}

.model-meta a:hover {
  text-decoration: underline;
}

.estimate-summary,
.cost-summary {
  margin-top: 10px;
  font-size: var(--text-xs);
  color: rgba(211, 221, 244, 0.92);
  line-height: 1.5;
}

.estimate-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.estimate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.estimate-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: rgba(211, 221, 244, 0.55);
}

.estimate-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.estimate-price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(231, 241, 255, 0.98);
}

.estimate-price-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: rgba(211, 221, 244, 0.6);
  margin-right: 4px;
}

.estimate-divider {
  margin: 0 6px;
  color: rgba(211, 221, 244, 0.35);
}

.estimate-delta {
  font-weight: 600;
}

.estimate-delta.is-over {
  color: rgba(255, 150, 150, 0.95);
}

.estimate-delta.is-under {
  color: rgba(140, 255, 210, 0.95);
}

.estimate-delta.is-even {
  color: rgba(211, 221, 244, 0.8);
}

.estimate-usd {
  font-weight: 500;
  color: rgba(211, 221, 244, 0.7);
}

.estimate-toggle {
  border: 1px solid rgba(110, 170, 255, 0.35);
  border-radius: 999px;
  background: rgba(14, 20, 35, 0.65);
  color: rgba(211, 221, 244, 0.9);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  cursor: pointer;
}

.estimate-toggle:hover {
  border-color: rgba(110, 170, 255, 0.7);
}

.estimate-details {
  border-radius: var(--radius-md);
  border: 1px solid rgba(110, 170, 255, 0.18);
  background: rgba(10, 14, 22, 0.45);
  padding: 10px 12px;
}

.estimate-warning {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 120, 120, 0.35);
  background: rgba(35, 14, 18, 0.55);
  color: rgba(255, 220, 220, 0.9);
  padding: 8px 10px;
  margin-bottom: 10px;
}

.estimate-section + .estimate-section {
  margin-top: 12px;
}

.estimate-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.estimate-section-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: rgba(211, 221, 244, 0.55);
}

.estimate-section-total {
  font-size: var(--text-xs);
  font-weight: 600;
  color: rgba(231, 241, 255, 0.95);
}

.estimate-block + .estimate-block {
  margin-top: 12px;
}

.estimate-block-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: rgba(211, 221, 244, 0.55);
  margin-bottom: 6px;
}

.estimate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  font-size: var(--text-xs);
}

.estimate-row {
  display: contents;
}

.estimate-key {
  color: rgba(211, 221, 244, 0.7);
}

.estimate-value {
  text-align: right;
  color: rgba(231, 241, 255, 0.98);
}

.estimate-note {
  margin-top: 8px;
  color: rgba(211, 221, 244, 0.7);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.estimate-summary.is-open .estimate-toggle,
.cost-summary.is-open .estimate-toggle {
  border-color: rgba(140, 255, 225, 0.6);
}

@media (max-width: 720px) {
  .estimate-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .estimate-header-right {
    justify-content: flex-start;
  }

  .estimate-grid {
    grid-template-columns: 1fr;
  }

  .estimate-value {
    text-align: left;
  }
}

.estimate-summary.is-updated,
.cost-summary.is-updated {
  animation: estimatePulse 0.9s ease;
}

@keyframes estimatePulse {
  0% { opacity: 0.4; }
  30% { opacity: 1; }
  100% { opacity: 0.85; }
}

.estimate-summary em,
.cost-summary em {
  color: rgba(211, 221, 244, 0.7);
  font-style: normal;
}

.slide-selection {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(110, 170, 255, 0.18);
  background: rgba(10, 14, 22, 0.45);
}

.slide-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
  color: rgba(211, 221, 244, 0.92);
}

.slide-selection-toggle {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  padding: 4px 10px;
}

.slide-selection-body {
  margin-top: 8px;
}

.slide-selection.is-collapsed .slide-selection-body {
  display: none;
}

.slide-selection-actions {
  display: flex;
  gap: 8px;
}

.slide-selection-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.slide-selection-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 18, 0.6);
  border: 1px solid rgba(110, 170, 255, 0.12);
}

.slide-selection-item.is-generated {
  opacity: 0.5;
}

.slide-selection-item input {
  margin-top: 2px;
}

.slide-selection-item span {
  display: block;
  font-size: var(--text-xs);
  color: rgba(211, 221, 244, 0.9);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.slide-selection-status {
  margin-top: 8px;
  font-size: var(--text-xs);
  color: rgba(211, 221, 244, 0.75);
}

button {
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  background: rgba(10, 14, 22, 0.7);
  color: var(--text);
}

.ghost {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(110, 170, 255, 0.3);
  color: rgba(211, 221, 244, 0.9);
  font-size: var(--text-xs);
}

.ghost:hover {
  border-color: rgba(110, 170, 255, 0.6);
  color: #f7fbff;
}

button.loading {
  position: relative;
  padding-right: 36px;
  color: rgba(245, 247, 255, 0.7);
}

button.loading::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(245, 247, 255, 0.35);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a;
  box-shadow: 0 12px 34px rgba(63, 225, 194, 0.25), 0 10px 30px rgba(242, 156, 75, 0.18);
}

button.secondary {
  background: rgba(10, 14, 22, 0.6);
  color: var(--text);
  border: 1px solid rgba(63, 225, 194, 0.3);
}

a.primary,
a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-family: var(--font-display);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.primary {
  background: linear-gradient(120deg, rgba(63, 225, 194, 0.95), rgba(242, 156, 75, 0.95));
  color: #04121a;
  box-shadow: 0 18px 40px rgba(4, 10, 18, 0.6);
}

a.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(63, 225, 194, 0.28);
}

a.primary:hover,
a.secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(110, 170, 255, 0.28);
  background: linear-gradient(145deg, rgba(18, 26, 40, 0.95), rgba(7, 12, 20, 0.75));
  color: rgba(211, 221, 244, 0.95);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 20px rgba(0, 0, 0, 0.35);
}

.icon-btn[data-tooltip] {
  position: relative;
}

.icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%);
  background: #0a0f18;
  color: var(--text);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.icon-btn[data-tooltip]:hover::after {
  opacity: 1;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 170, 255, 0.6);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(4, 8, 14, 0.55);
}

.icon-btn.is-active {
  color: #0c131c;
  border-color: rgba(99, 255, 209, 0.7);
  background: linear-gradient(135deg, rgba(99, 255, 209, 0.8), rgba(58, 196, 255, 0.75));
}

.icon-btn[data-state='collapsed'] svg {
  transform: rotate(180deg);
}

.meta {
  margin-top: 16px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.paste-block {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.paste-block label {
  font-size: var(--text-sm);
  color: var(--muted);
}

.paste-block textarea {
  width: 100%;
  resize: vertical;
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(63, 225, 194, 0.18);
  background: rgba(10, 14, 22, 0.7);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.text-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.text-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

.sample-json {
  margin-top: 16px;
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid rgba(63, 225, 194, 0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 260px;
  overflow: auto;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.35;
  white-space: pre-wrap;
}

#reviewJsonPreview {
  max-height: 45vh;
  min-height: 260px;
}

@media (max-width: 720px) {
  #reviewJsonPreview {
    max-height: 38vh;
    min-height: 200px;
  }
}

.status {
  position: relative;
  z-index: 1;
  padding: 8px 8vw 24px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status h2 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: var(--text-xl);
}

.timing {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(245, 247, 255, 0.3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

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

.progress {
  height: 10px;
  background: rgba(63, 225, 194, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 0.4s ease;
}

.download {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 40px 6vw;
  backdrop-filter: blur(6px);
}

.lightbox.active {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: min(1400px, 90vw);
  max-height: 90vh;
  width: 100%;
  background: #0a0f18;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.14);
  box-shadow: var(--shadow);
  padding: 16px;
}

.lightbox-inner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 14, 22, 0.8);
  color: var(--text);
  padding: 8px 12px;
  font-size: var(--text-xs);
}

main {
  position: relative;
  z-index: 1;
  padding: 0 8vw 60px;
}

.slides {
  display: grid;
  gap: 28px;
}

.slide-card {
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.96), rgba(10, 14, 22, 0.94));
  border: 1px solid rgba(63, 225, 194, 0.14);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.slide-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.slide-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.slide-collapse {
  border: 1px solid rgba(63, 225, 194, 0.24);
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  cursor: pointer;
  flex-shrink: 0;
}

.slide-collapse:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.slide-insert {
  border: 1px dashed rgba(63, 225, 194, 0.6);
  background: transparent;
  color: var(--accent);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.slide-insert:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.slide-archive {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--muted);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.slide-archive:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.slide-archive-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Slide Settings Button */
.slide-settings {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--muted);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.slide-settings:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: var(--accent);
  border-color: var(--accent);
}

.slide-settings.has-settings {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(63, 225, 194, 0.1);
}

/* Slide Settings Popover */
.slide-settings-popover {
  position: fixed;
  z-index: 1000;
  min-width: 260px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  display: none;
}

.slide-settings-popover.active {
  display: block;
}

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

.slide-settings-title {
  font-weight: 600;
  font-size: var(--text-sm);
}

.slide-settings-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.slide-settings-close:hover {
  color: var(--text);
}

.slide-settings-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slide-settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slide-settings-field label {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.slide-settings-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
}

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

.slide-settings-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.slide-settings-footer button {
  flex: 1;
}

.slide-card.is-archived {
  opacity: 0.7;
  border-color: rgba(255, 255, 255, 0.08);
}

.slide-card.is-collapsed .edit-controls {
  display: none;
}

.slide-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.slide-purpose {
  color: var(--muted);
  font-size: var(--text-sm);
}

.slide-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--muted);
}

.slide-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.65rem;
  border: 1px solid rgba(48, 242, 255, 0.2);
  background: rgba(48, 242, 255, 0.08);
  color: var(--text);
}

.slide-status-pill[data-status="ready"] {
  border-color: rgba(72, 255, 195, 0.35);
  background: rgba(72, 255, 195, 0.15);
  color: #bfffe9;
}

.slide-status-pill[data-status="generating"] {
  border-color: rgba(48, 242, 255, 0.45);
  background: rgba(48, 242, 255, 0.2);
  color: #e3fbff;
}

.slide-status-pill[data-status="queued"] {
  border-color: rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.16);
  color: #fff3c8;
}

.slide-status-pill[data-status="editing"] {
  border-color: rgba(255, 106, 213, 0.35);
  background: rgba(255, 106, 213, 0.18);
  color: #ffd8f4;
}

.slide-status-pill[data-status="error"],
.slide-status-pill[data-status="partial"] {
  border-color: rgba(255, 88, 88, 0.35);
  background: rgba(255, 88, 88, 0.18);
  color: #ffd0d0;
}

.slide-status-pill[data-status="archived"],
.slide-status-pill[data-status="empty"] {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.slide-timing {
  font-variant-numeric: tabular-nums;
  color: rgba(245, 247, 255, 0.7);
}

.slide-card[data-status="generating"] {
  border-color: rgba(48, 242, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(48, 242, 255, 0.2), 0 20px 50px rgba(5, 10, 18, 0.5);
  animation: pulseGlow 2.4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(48, 242, 255, 0.2), 0 20px 50px rgba(5, 10, 18, 0.5);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 106, 213, 0.25), 0 24px 60px rgba(5, 10, 18, 0.6);
  }
}

.variants {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.edit-controls {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.edit-scope {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--muted);
  font-size: var(--text-xs);
}

.edit-controls .edit-prompt {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid rgba(63, 225, 194, 0.2);
  background: rgba(10, 14, 22, 0.7);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  min-height: 44px;
  resize: vertical;
}

.edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  align-self: start;
}

@media (max-width: 720px) {
  .edit-controls {
    grid-template-columns: 1fr;
  }
}

.variant {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(63, 225, 194, 0.12);
  background: rgba(10, 14, 22, 0.7);
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.variant.is-generating {
  border-color: rgba(48, 242, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(48, 242, 255, 0.18), 0 16px 30px rgba(6, 12, 20, 0.5);
}

.variant.is-ready {
  border-color: rgba(72, 255, 195, 0.3);
}

.variant.is-selected {
  border-color: rgba(72, 255, 195, 0.7);
  box-shadow: 0 18px 40px rgba(4, 10, 18, 0.55), 0 0 0 1px rgba(72, 255, 195, 0.35);
  background: rgba(10, 18, 24, 0.85);
}

@media (min-width: 900px) {
  .variants {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .variant {
    flex: 1 1 0;
    min-width: 0;
  }
}

.variant.is-error {
  border-color: rgba(255, 88, 88, 0.3);
}

.variant.is-queued {
  border-color: rgba(255, 209, 102, 0.25);
}

.variant.is-editing {
  border-color: rgba(255, 106, 213, 0.3);
}

.variant.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
  opacity: 0.8;
}

.variant-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.variant-download {
  justify-self: flex-start;
  background: rgba(63, 225, 194, 0.12);
}

.variant-archive {
  justify-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.variant-download[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.variant.is-archived {
  opacity: 0.65;
  border-color: rgba(255, 255, 255, 0.06);
}

.variant.is-archived input,
.variant.is-archived .preview,
.variant.is-archived .variant-download {
  display: none;
}

.variant.is-archived .preview {
  filter: grayscale(1);
}

.variant:hover {
  transform: translateY(-2px);
  border-color: rgba(63, 225, 194, 0.65);
  box-shadow: 0 16px 34px rgba(4, 8, 14, 0.55);
}

.variant input {
  accent-color: var(--accent);
}

.preview {
  position: relative;
  width: 100%;
  padding-top: 66.7%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #07090d;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.preview.is-loading {
  padding-top: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(4, 6, 12, 0.85);
}

.preview.is-loading .preview-text,
.preview.is-loading .preview-notes {
  display: none;
}

.preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55));
}

.preview-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  z-index: 2;
  pointer-events: none;
}

.preview.is-loading .preview-spinner {
  position: static;
  margin: 0;
}

.preview-status {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(211, 221, 244, 0.85);
  z-index: 2;
}

.preview-text {
  position: absolute;
  color: #f7fbff;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7);
  max-width: 80%;
  white-space: pre-line;
  z-index: 1;
}

.preview-text.upper-center { top: 8%; left: 50%; transform: translateX(-50%); text-align: center; }
.preview-text.bottom-center { bottom: 8%; left: 50%; transform: translateX(-50%); text-align: center; }
.preview-text.center { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.preview-text.left { top: 50%; left: 8%; transform: translateY(-50%); text-align: left; }
.preview-text.right { top: 50%; right: 8%; transform: translateY(-50%); text-align: right; }
.preview-text.upper-left { top: 8%; left: 8%; text-align: left; }
.preview-text.upper-right { top: 8%; right: 8%; text-align: right; }
.preview-text.bottom-left { bottom: 8%; left: 8%; text-align: left; }
.preview-text.bottom-right { bottom: 8%; right: 8%; text-align: right; }

.preview-notes {
  position: absolute;
  bottom: 6%;
  left: 6%;
  right: 6%;
  color: #f7fbff;
  font-size: var(--text-xs);
  line-height: 1.2;
  background: rgba(3, 5, 10, 0.6);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: none;
  z-index: 1;
}

body.show-notes .preview-notes {
  display: block;
}

.compact .variant {
  gap: 6px;
  padding: 10px;
}

.compact .variant .preview,
.compact .variant .variant-download {
  display: none;
}

.compact .variant-status {
  font-size: var(--text-xs);
}

.variant-status {
  color: var(--muted);
  font-size: var(--text-sm);
}

.variant-cost {
  color: rgba(211, 221, 244, 0.92);
  font-size: var(--text-xs);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-3);
}

@media (max-width: 720px) {
  .hero {
    padding: 32px 6vw 24px;
  }

  .status,
  main {
    padding: 0 6vw 40px;
  }

  .wizard {
    padding: 36px 6vw 64px;
  }

  .landing {
    padding: 36px 6vw 64px;
  }

  .auth-page {
    padding: 28px 6vw 56px;
  }

  .auth-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-card {
    width: 100%;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .brand {
    gap: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .hero-shell {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-actions a {
    width: 100%;
  }

  .panel-card {
    padding: 18px;
  }

  .slide-card {
    padding: 16px;
  }

  .admin-auth {
    grid-template-columns: 1fr;
  }

  .admin-job {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .admin-user {
    grid-template-columns: 1fr;
  }

  .admin-users-controls {
    width: 100%;
  }

  .footer-inner {
    align-items: flex-start;
  }
}

/* Wizard layout */
.landing {
  padding: 48px 8vw 80px;
}

.wizard {
  padding: 48px 8vw 80px;
}

.wizard-hero {
  max-width: 1200px;
  margin: 0 auto 36px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(5, 8, 14, 0.6));
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.brand-tag {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.brand:focus-visible {
  outline: 2px solid rgba(63, 225, 194, 0.6);
  outline-offset: 4px;
  border-radius: 12px;
}

.hero-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .landing .hero-shell {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

/* Hero Slideshow */
.hero-slideshow {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-alt);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.slideshow-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slideshow-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .slideshow-track {
    transition: none;
  }
}

.slideshow-slide {
  flex: 0 0 100%;
  position: relative;
  cursor: pointer;
}

.slideshow-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slideshow-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}

.slideshow-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
  z-index: 10;
}

.slideshow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

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

.slideshow-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.slideshow-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
}

.slideshow-pause .icon-play {
  display: none;
}

.slideshow-pause[aria-pressed="true"] .icon-pause {
  display: none;
}

.slideshow-pause[aria-pressed="true"] .icon-play {
  display: block;
}

.slideshow-dots {
  display: flex;
  gap: 6px;
}

.slideshow-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.slideshow-dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.slideshow-dot[aria-selected="true"] {
  background: var(--accent);
  transform: scale(1.2);
}

.slideshow-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hidden - now using global .app-header instead */
.account-chip {
  display: none;
}

.account-meta {
  display: grid;
  gap: 4px;
}

.account-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.account-email {
  font-family: var(--font-display);
  font-size: var(--text-sm);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-credits {
  font-size: var(--text-xs);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(63, 225, 194, 0.2);
  color: #9ff3dd;
}

.auth-page {
  padding: 32px 8vw 64px;
}

.auth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.auth-shell {
  display: grid;
  gap: 28px;
  align-items: start;
}

.auth-intro {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.auth-perks {
  display: grid;
  gap: 12px;
}

.auth-perk {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(10, 14, 22, 0.72);
}

.auth-perk-title {
  display: block;
  font-family: var(--font-display);
  margin-bottom: 4px;
}

.auth-perk-note {
  font-size: var(--text-sm);
  color: var(--muted);
}

.auth-card {
  width: min(420px, 100%);
  border-radius: calc(var(--radius-lg) + 4px);
  padding: 22px;
  border: 1px solid rgba(63, 225, 194, 0.2);
  background: rgba(9, 13, 20, 0.82);
  box-shadow: var(--glow-shadow);
}

.auth-card-header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-pill);
  background: rgba(8, 12, 18, 0.7);
  border: 1px solid rgba(63, 225, 194, 0.16);
  margin-bottom: 16px;
}

.auth-tabs .tab {
  border: 0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.auth-tabs .tab.active {
  background: linear-gradient(120deg, rgba(63, 225, 194, 0.25), rgba(242, 156, 75, 0.2));
  color: #f1fff9;
}

.auth-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.18);
  background: rgba(10, 14, 22, 0.8);
  box-shadow: var(--glow-shadow);
  max-width: 360px;
}

.auth-header {
  display: grid;
  gap: 6px;
}

.auth-panel .status-note {
  margin: 0;
}

.auth-fields {
  display: grid;
  gap: 10px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.auth-support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(63, 225, 194, 0.18);
  font-size: var(--text-xs);
  color: rgba(245, 247, 255, 0.6);
}

.auth-support .support-copy {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.62rem;
}

.auth-link {
  min-height: 44px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(242, 156, 75, 0.35);
  background: rgba(19, 12, 10, 0.65);
  color: rgba(255, 225, 200, 0.9);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(16, 9, 6, 0.45);
}

.auth-link:hover {
  border-color: rgba(242, 156, 75, 0.6);
  color: #fff4ea;
  transform: translateY(-1px);
}

.auth-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-panel .panel-note {
  margin: 0;
  font-size: var(--text-xs);
  color: rgba(245, 247, 255, 0.6);
}

.auth-panel code {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: #e6f2ff;
  background: rgba(110, 170, 255, 0.12);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

body.auth-locked .auth-panel {
  border-color: rgba(242, 156, 75, 0.35);
}

body.auth-locked .wizard-body {
  display: none;
}

body.auth-locked #studio {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(0.2) saturate(0.85);
}

@media (min-width: 1024px) {
  .hero-shell {
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
  }

  .cta-band {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: var(--text-xxl);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-shadow: 0 20px 40px rgba(5, 8, 14, 0.6);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(63, 225, 194, 0.25);
  background: rgba(8, 12, 20, 0.65);
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-visual-card {
  background: linear-gradient(170deg, rgba(16, 22, 34, 0.92), rgba(8, 12, 20, 0.85));
  border: 1px solid rgba(63, 225, 194, 0.18);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-visual {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(8, 12, 20, 0.6);
  border: 1px solid rgba(63, 225, 194, 0.18);
  box-shadow: var(--glow-shadow);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(4, 8, 14, 0.6);
}

.hero-visual-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.caption-label {
  color: var(--accent);
}

.hero-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 26px;
}

.stat-card {
  background: rgba(9, 13, 20, 0.75);
  border: 1px solid rgba(63, 225, 194, 0.14);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--glow-shadow);
}

.stat-title {
  margin: 0 0 6px;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.stat-note {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.wizard-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.step-pill {
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(10, 14, 22, 0.7);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  cursor: pointer;
}

.step-pill.active {
  color: #031019;
  border-color: rgba(63, 225, 194, 0.8);
  background: linear-gradient(120deg, rgba(63, 225, 194, 0.9), rgba(242, 156, 75, 0.9));
  box-shadow: 0 12px 24px rgba(4, 8, 14, 0.5);
}

.wizard-body {
  max-width: 1200px;
  margin: 0 auto;
}

.landing-section {
  max-width: 1200px;
  margin: 0 auto 36px;
}

.section-header {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin: 0;
}

.section-header p {
  margin: 0;
  color: rgba(245, 247, 255, 0.7);
  max-width: 60ch;
}

.prop-grid,
.advantage-grid,
.timing-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.prop-card,
.advantage-card,
.timing-card {
  background: linear-gradient(170deg, rgba(14, 20, 32, 0.95), rgba(8, 12, 20, 0.88));
  border: 1px solid rgba(63, 225, 194, 0.16);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.prop-card h3,
.advantage-card h3,
.timing-card h3 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.prop-card p,
.advantage-card p,
.timing-card p {
  margin: 0;
  color: rgba(245, 247, 255, 0.72);
  font-size: var(--text-sm);
}

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

.timing-tag {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-2);
}

.timing-value {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.timing-note {
  font-size: var(--text-xs);
  color: var(--muted);
}

.cta-band {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(63, 225, 194, 0.2);
  background: linear-gradient(120deg, rgba(63, 225, 194, 0.15), rgba(242, 156, 75, 0.12));
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--glow-shadow);
}

.cta-band h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

.cta-band p {
  margin: 0;
  color: rgba(245, 247, 255, 0.7);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Admin */
.admin {
  padding: 48px 8vw 80px;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-auth {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(10, 14, 22, 0.7);
}

.admin-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-config-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(10, 14, 22, 0.7);
  display: grid;
  gap: 14px;
}

.admin-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.admin-config-advanced {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.admin-config-group {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(63, 225, 194, 0.12);
  background: rgba(8, 12, 20, 0.6);
  display: grid;
  gap: 10px;
}

.admin-config-group h4 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: var(--text-lg);
}

.admin-model-editor {
  display: grid;
  gap: 10px;
}

.admin-model-list {
  display: grid;
  gap: 8px;
}

.admin-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(12, 18, 28, 0.9);
  flex-wrap: wrap;
}

.admin-model-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
}

.admin-model-tags {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-model-tag {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(63, 225, 194, 0.2);
  background: rgba(10, 14, 22, 0.8);
  color: var(--muted);
}

.admin-model-tag.is-known {
  border-color: rgba(63, 225, 194, 0.4);
  color: #9ff3dd;
}

.admin-model-tag.is-custom {
  border-color: rgba(242, 156, 75, 0.35);
  color: #f2c38f;
}

.admin-model-tag.is-default {
  border-color: rgba(120, 200, 255, 0.45);
  color: #a6d8ff;
}

.admin-model-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-model-add {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-model-add input {
  flex: 1;
  min-width: 200px;
}

/* Text model pricing styles */
.admin-text-model-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.admin-model-name-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-text-pricing {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-pricing-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--muted);
}

.admin-pricing-field span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-pricing-field input {
  width: 80px;
  padding: 4px 8px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(63, 225, 194, 0.2);
  background: rgba(10, 14, 22, 0.8);
  color: var(--text);
}

.admin-pricing-field input:focus {
  border-color: rgba(63, 225, 194, 0.5);
  outline: none;
}

@media (max-width: 600px) {
  .admin-text-model-row {
    grid-template-columns: 1fr;
  }

  .admin-text-pricing {
    justify-content: flex-start;
  }
}

.admin-config-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-stat {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(12, 18, 28, 0.9);
  box-shadow: var(--shadow);
}

.admin-stat-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 6px;
}

.admin-stat-value {
  font-size: var(--text-lg);
  font-weight: 600;
}

.admin-section h3 {
  font-family: var(--font-display);
  margin: 0 0 12px;
}

.admin-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-users-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-users-controls input {
  min-width: 220px;
}

.admin-users {
  display: grid;
  gap: 10px;
}

.admin-user {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, auto) minmax(240px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(63, 225, 194, 0.12);
  background: rgba(9, 13, 20, 0.75);
  font-size: var(--text-sm);
}

.admin-user.is-suspended {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(24, 10, 12, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.08);
}

.admin-user-meta {
  display: grid;
  gap: 4px;
}

.admin-user-email {
  font-family: var(--font-display);
}

.admin-user-sub {
  font-size: var(--text-xs);
  color: var(--muted);
}

.admin-user-roles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(63, 225, 194, 0.2);
  background: rgba(12, 18, 28, 0.9);
  color: var(--muted);
}

.admin-role-owner {
  border-color: rgba(242, 156, 75, 0.45);
  color: #f2c38f;
}

.admin-role-admin {
  border-color: rgba(63, 225, 194, 0.35);
  color: #9ff3dd;
}

.admin-role-suspended {
  border-color: rgba(255, 120, 120, 0.45);
  color: #ffb2b2;
}

.admin-user-credits {
  font-weight: 600;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-suspend-btn {
  border-color: rgba(255, 120, 120, 0.35);
  color: #ffb2b2;
}

.admin-suspend-btn.is-suspended {
  background: rgba(255, 120, 120, 0.15);
  border-color: rgba(255, 120, 120, 0.55);
  color: #ffe2e2;
}

.admin-user-actions input {
  width: 120px;
}

.admin-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.admin-jobs {
  display: grid;
  gap: 10px;
}

.admin-job {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(3, minmax(90px, auto));
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(63, 225, 194, 0.12);
  background: rgba(9, 13, 20, 0.75);
  font-size: var(--text-sm);
}

.admin-job-id {
  font-family: var(--font-display);
}

.admin-job-status {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--text-xs);
  color: var(--accent);
}

.admin-job-meta {
  color: var(--muted);
  font-size: var(--text-xs);
}

/* Admin Pricing Table */
.admin-pricing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-pricing-header h3 {
  font-family: var(--font-display);
  margin: 0 0 6px;
}

.admin-pricing-table {
  display: grid;
  gap: 16px;
}

.admin-pricing-model-group {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(10, 14, 22, 0.7);
}

.admin-pricing-model-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin: 0 0 12px;
  color: var(--accent);
}

.admin-pricing-grid {
  display: grid;
  gap: 8px;
}

.admin-pricing-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 20, 0.6);
  font-size: var(--text-sm);
}

.admin-pricing-row.is-header {
  background: rgba(63, 225, 194, 0.08);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
  color: var(--muted);
}

.admin-pricing-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-pricing-cell input {
  width: 100%;
  max-width: 100px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(63, 225, 194, 0.22);
  background: rgba(10, 14, 22, 0.8);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.admin-pricing-cell input:focus {
  outline: none;
  border-color: rgba(63, 225, 194, 0.55);
  box-shadow: 0 0 0 2px rgba(63, 225, 194, 0.15);
}

.admin-pricing-cell input.is-invalid {
  border-color: rgba(255, 120, 120, 0.55);
  background: rgba(255, 120, 120, 0.08);
}

.admin-pricing-cell .pricing-error {
  font-size: var(--text-xs);
  color: #ffb2b2;
  margin-top: 2px;
}

.admin-pricing-images-per-credit {
  color: var(--muted);
  font-size: var(--text-xs);
}

@media (max-width: 768px) {
  .admin-pricing-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .admin-pricing-row.is-header {
    display: none;
  }

  .admin-pricing-cell::before {
    content: attr(data-label);
    font-size: var(--text-xs);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 2px;
  }
}

.site-footer {
  padding: 32px 8vw 48px;
  color: var(--muted);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(63, 225, 194, 0.12);
  padding-top: 18px;
  font-size: var(--text-sm);
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: var(--text-xs);
}

.footer-link:hover {
  color: #eafff7;
}

.wizard-start {
  background: rgba(9, 13, 20, 0.6);
  border: 1px solid rgba(63, 225, 194, 0.16);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
}

.wizard-start-header {
  margin-bottom: 16px;
}

#wizard-start {
  scroll-margin-top: 120px;
}

.wizard-start-header h2 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: var(--text-xl);
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.mode-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.mode-card {
  position: relative;
  background: linear-gradient(160deg, rgba(16, 22, 34, 0.95), rgba(10, 14, 22, 0.9));
  border: 1px solid rgba(63, 225, 194, 0.16);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
  border: 1px solid rgba(63, 225, 194, 0.25);
  color: var(--text);
  background: rgba(63, 225, 194, 0.12);
}

.badge-beginner {
  border-color: rgba(72, 255, 195, 0.35);
  background: rgba(72, 255, 195, 0.18);
}

.badge-advanced {
  border-color: rgba(242, 156, 75, 0.35);
  background: rgba(242, 156, 75, 0.2);
}

.badge-pro {
  border-color: rgba(255, 106, 213, 0.35);
  background: rgba(255, 106, 213, 0.18);
}

.badge-example {
  border-color: rgba(215, 227, 106, 0.4);
  background: rgba(215, 227, 106, 0.2);
  color: #f6ffe0;
}

.mode-card h3 {
  font-family: var(--font-display);
  margin-bottom: 6px;
  color: var(--text);
  font-size: var(--text-lg);
  text-shadow: 0 10px 22px rgba(5, 8, 14, 0.55);
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(63, 225, 194, 0.6);
  box-shadow: 0 18px 36px rgba(4, 8, 14, 0.55);
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
}

.json-guidance {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(10, 14, 22, 0.65);
  color: var(--muted);
  font-size: var(--text-sm);
}

.json-guidance summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.json-guidance summary::marker {
  color: var(--accent);
}

.json-guidance ul {
  padding-left: 18px;
  margin: 0 0 12px;
}

.json-guidance li {
  margin-bottom: 6px;
}

.json-guidance pre {
  margin: 0;
  white-space: pre-wrap;
  border-radius: var(--radius-md);
  background: rgba(6, 10, 18, 0.8);
  border: 1px solid rgba(63, 225, 194, 0.12);
  padding: 12px;
  font-size: var(--text-xs);
  color: rgba(245, 247, 255, 0.85);
}

.text-guidance {
  margin: 10px 0 14px;
}

.demo-card .panel-note {
  margin-bottom: 8px;
}

.demo-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.demo-steps {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-step-pill {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(63, 225, 194, 0.16);
  background: rgba(10, 14, 22, 0.6);
  color: var(--muted);
  padding: 6px 12px;
  font-size: var(--text-xs);
  cursor: pointer;
}

.demo-step-pill.active {
  border-color: rgba(63, 225, 194, 0.7);
  color: #031019;
  background: linear-gradient(120deg, rgba(63, 225, 194, 0.9), rgba(242, 156, 75, 0.8));
}

.demo-body {
  display: grid;
  gap: 16px;
}

.demo-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.demo-nav {
  justify-content: space-between;
}

.wizard-nav {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.panel-card {
  background: linear-gradient(180deg, rgba(14, 20, 32, 0.96), rgba(9, 12, 20, 0.92));
  border: 1px solid rgba(63, 225, 194, 0.14);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-note {
  color: rgba(245, 247, 255, 0.7);
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.status-note {
  color: var(--muted);
  margin-top: 12px;
}

.status-note.is-error,
.inline-status.is-error {
  color: #ffd0d0;
  background: rgba(255, 88, 88, 0.12);
  border: 1px solid rgba(255, 88, 88, 0.35);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.status-note.is-success,
.inline-status.is-success {
  color: #bfffe9;
  background: rgba(72, 255, 195, 0.12);
  border: 1px solid rgba(72, 255, 195, 0.35);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.inline-status {
  margin: 12px 0 0;
  font-size: var(--text-sm);
  opacity: 1;
}

.status-note.fade-out,
.inline-status.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.wizard-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.wizard-status-line .status-note {
  margin: 0;
}

/* Builder */
.builder {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 18px;
}

.builder-sidebar {
  background: rgba(9, 12, 20, 0.65);
  border: 1px solid rgba(63, 225, 194, 0.12);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: 100%;
  box-shadow: var(--glow-shadow);
}

.builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.slide-list {
  display: grid;
  gap: 10px;
}

.slide-item {
  background: rgba(12, 16, 26, 0.8);
  border: 1px solid rgba(63, 225, 194, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: grid;
  gap: 6px;
  cursor: grab;
  min-width: 0;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.slide-item.active {
  border-color: rgba(63, 225, 194, 0.6);
  box-shadow: 0 16px 30px rgba(4, 8, 14, 0.45);
}

.slide-item-title {
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slide-item-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slide-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.slide-item button {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
}

.builder-main {
  background: rgba(9, 12, 20, 0.65);
  border: 1px solid rgba(63, 225, 194, 0.12);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--glow-shadow);
}

.builder-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.builder-tabs .tab {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 22, 0.6);
  border: 1px solid rgba(63, 225, 194, 0.18);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-xs);
  transition: border 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.builder-tabs .tab.active {
  color: var(--text);
  border-color: rgba(63, 225, 194, 0.7);
  background: rgba(63, 225, 194, 0.12);
}

.builder-panel {
  display: block;
}

.form-section {
  margin-bottom: 20px;
}

.form-section h4 {
  font-family: var(--font-display);
  margin-bottom: 10px;
  font-size: var(--text-lg);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(63, 225, 194, 0.18);
  background: rgba(10, 14, 22, 0.7);
  color: var(--text);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(63, 225, 194, 0.6);
  box-shadow: 0 0 0 2px rgba(63, 225, 194, 0.18);
}

.field-inline {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.field-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  justify-self: start;
  accent-color: var(--accent);
}

.field-hint {
  color: rgba(245, 247, 255, 0.55);
  font-size: var(--text-xs);
}

.variant-count-status {
  color: rgba(245, 247, 255, 0.6);
  font-size: var(--text-xs);
}

.field .info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid rgba(63, 225, 194, 0.2);
  font-size: var(--text-xs);
  color: var(--muted);
  cursor: help;
  position: relative;
}

.field .info::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: #0a0f18;
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.field .info:hover::after {
  opacity: 1;
}

.field.span-2 {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .builder {
    grid-template-columns: 1fr;
  }

  .admin-config-advanced {
    grid-template-columns: 1fr;
  }
}

/* Studio wrapper */
.studio {
  padding-top: 12px;
}

.notes-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.notes-toggle input {
  accent-color: var(--accent);
}


.mode-card.active {
  border-color: rgba(63, 225, 194, 0.8);
  box-shadow: 0 18px 40px rgba(4, 8, 14, 0.6);
}

.mode-card p {
  color: rgba(245, 247, 255, 0.7);
}

.variant-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.variant-toggle {
  border-color: rgba(63, 225, 194, 0.2);
  color: var(--muted);
  width: 28px;
  height: 28px;
}

.variant.is-collapsed .preview {
  padding-top: 13.34%;
  background-position: top center;
}

.variant.is-collapsed .preview-text,
.variant.is-collapsed .preview-notes {
  display: none;
}

.variant.is-collapsed .variant-status {
  font-size: var(--text-xs);
}

.variants-collapsed .variant .preview {
  padding-top: 13.34%;
  background-position: top center;
}

.variants-collapsed .variant .preview-text,
.variants-collapsed .variant .preview-notes {
  display: none;
}

.variants-collapsed .variant-toggle {
  display: none;
}

.slide-card.is-collapsed .variant .preview {
  padding-top: 13.34%;
  background-position: top center;
}

.slide-card.is-collapsed .variant .preview-text,
.slide-card.is-collapsed .variant .preview-notes {
  display: none;
}

/* History Panel */
.history-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(63, 225, 194, 0.12);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-panel.is-collapsed .history-header {
  margin-bottom: 0;
}

.history-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text);
}

.history-toggle:hover {
  color: var(--accent);
}

.history-toggle-icon {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.history-panel:not(.is-collapsed) .history-toggle-icon {
  transform: rotate(90deg);
}

.history-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  margin: 0;
  color: inherit;
}

.history-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  max-height: 500px;
  opacity: 1;
}

.history-panel.is-collapsed .history-body {
  max-height: 0;
  opacity: 0;
}

.history-status {
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: var(--text-sm);
  color: rgba(245, 247, 255, 0.7);
  background: rgba(16, 22, 34, 0.6);
  border-radius: var(--radius);
}

.history-status.is-error {
  color: var(--error);
  background: rgba(255, 87, 87, 0.1);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(160deg, rgba(16, 22, 34, 0.8), rgba(10, 14, 22, 0.7));
  border: 1px solid rgba(63, 225, 194, 0.1);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.history-item:hover {
  border-color: rgba(63, 225, 194, 0.3);
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}

.history-item-date {
  font-size: var(--text-xs);
  color: rgba(245, 247, 255, 0.5);
}

.history-item-slides {
  font-size: var(--text-xs);
  color: rgba(245, 247, 255, 0.4);
}

.history-item-status {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 247, 255, 0.5);
}

.history-item-status.is-ready {
  background: rgba(63, 225, 194, 0.12);
  color: var(--accent);
}

.history-item-status.is-partial {
  background: rgba(255, 200, 87, 0.12);
  color: #ffc857;
}

.history-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.history-view-btn,
.history-json-btn,
.history-zip-btn {
  padding: 5px 10px;
  font-size: var(--text-xs);
}

.history-download-btn {
  padding: 6px 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(63, 225, 194, 0.1);
  border: 1px solid rgba(63, 225, 194, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-download-btn:hover {
  background: rgba(63, 225, 194, 0.2);
  border-color: rgba(63, 225, 194, 0.4);
}

.history-download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.history-empty {
  text-align: center;
  padding: 20px;
  color: rgba(245, 247, 255, 0.5);
  font-size: var(--text-sm);
}

/* JSON Editor Modal */
.json-editor-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 11;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.json-editor-modal.active {
  display: flex;
}

.json-editor-modal-inner {
  position: relative;
  max-width: min(720px, 95vw);
  max-height: 90vh;
  width: 100%;
  background: linear-gradient(170deg, rgba(16, 22, 34, 0.96), rgba(8, 12, 20, 0.94));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(63, 225, 194, 0.2);
  box-shadow: var(--shadow), 0 0 80px rgba(63, 225, 194, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.json-editor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(63, 225, 194, 0.12);
  background: rgba(8, 12, 20, 0.4);
}

.json-editor-modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}

.json-editor-modal-close {
  padding: 8px 14px;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.json-editor-modal-close:hover {
  background: rgba(10, 14, 22, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.json-editor-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px 0;
  border-bottom: 1px solid rgba(63, 225, 194, 0.1);
}

.json-editor-modal-tabs .tab {
  padding: 10px 18px;
  font-size: var(--text-sm);
  font-weight: 500;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.json-editor-modal-tabs .tab:hover {
  color: var(--text);
}

.json-editor-modal-tabs .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.json-editor-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.json-editor-panel {
  height: 100%;
}

.json-editor-panel textarea {
  width: 100%;
  min-height: 380px;
  padding: 14px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-sm);
  line-height: 1.5;
  background: rgba(8, 12, 20, 0.6);
  border: 1px solid rgba(63, 225, 194, 0.15);
  border-radius: var(--radius-md);
  color: var(--text);
  resize: vertical;
}

.json-editor-panel textarea:focus {
  outline: none;
  border-color: rgba(63, 225, 194, 0.4);
  box-shadow: 0 0 0 3px rgba(63, 225, 194, 0.1);
}

.json-editor-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.json-editor-form .form-section {
  padding: 16px;
  background: rgba(8, 12, 20, 0.4);
  border: 1px solid rgba(63, 225, 194, 0.1);
  border-radius: var(--radius-md);
}

.json-editor-form .form-section h4 {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.json-editor-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.json-editor-form .form-grid .span-2 {
  grid-column: span 2;
}

.json-editor-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.json-editor-form .field input,
.json-editor-form .field textarea {
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-transform: none;
  letter-spacing: normal;
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid rgba(63, 225, 194, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.json-editor-form .field input:focus,
.json-editor-form .field textarea:focus {
  outline: none;
  border-color: rgba(63, 225, 194, 0.35);
}

.json-editor-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid rgba(63, 225, 194, 0.12);
  background: rgba(8, 12, 20, 0.4);
}

.json-editor-modal-footer .status-note {
  margin: 0;
  flex: 1;
  font-size: var(--text-xs);
  color: var(--muted);
}

.json-editor-modal-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 600px) {
  .json-editor-form .form-grid {
    grid-template-columns: 1fr;
  }

  .json-editor-form .form-grid .span-2 {
    grid-column: span 1;
  }

  .json-editor-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .json-editor-modal-actions {
    justify-content: stretch;
  }

  .json-editor-modal-actions button {
    flex: 1;
  }
}

/* Skeleton loading states */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.skeleton-card {
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.96), rgba(10, 14, 22, 0.94));
  border: 1px solid rgba(63, 225, 194, 0.14);
  border-radius: var(--radius-lg);
  padding: 20px;
  animation: rise 0.3s ease both, skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.skeleton-title {
  height: 24px;
  width: 180px;
  background: rgba(63, 225, 194, 0.15);
  border-radius: var(--radius-sm);
}

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

.skeleton-btn {
  height: 32px;
  width: 32px;
  background: rgba(63, 225, 194, 0.1);
  border-radius: var(--radius-sm);
}

.skeleton-variants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.skeleton-variant {
  aspect-ratio: 16 / 10;
  background: rgba(63, 225, 194, 0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skeleton-variant::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid rgba(63, 225, 194, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Generate More Panel */
.generate-more-panel {
  margin: 16px 24px;
  padding: 16px;
  background: rgba(63, 225, 194, 0.04);
  border: 1px solid rgba(63, 225, 194, 0.12);
  border-radius: var(--radius-md);
}

.generate-more-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.generate-more-panel.is-collapsed .generate-more-header {
  margin-bottom: 0;
}

.generate-more-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.generate-more-toggle:hover {
  color: var(--accent);
}

.generate-more-toggle-icon {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.generate-more-panel:not(.is-collapsed) .generate-more-toggle-icon {
  transform: rotate(90deg);
}

.generate-more-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  margin: 0;
  color: inherit;
}

.generate-more-status {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.generate-more-body {
  margin-top: 12px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 600px;
  opacity: 1;
}

.generate-more-panel.is-collapsed .generate-more-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.generate-more-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.generate-more-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.generate-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(63, 225, 194, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.generate-more-item:hover {
  background: rgba(63, 225, 194, 0.08);
  border-color: rgba(63, 225, 194, 0.2);
}

.generate-more-item.is-selected {
  background: rgba(63, 225, 194, 0.12);
  border-color: var(--accent);
}

.generate-more-item.is-generated {
  opacity: 0.5;
  cursor: default;
}

.generate-more-item.is-generated:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(63, 225, 194, 0.1);
}

.generate-more-item input[type="checkbox"] {
  accent-color: var(--accent);
}

.generate-more-item-info {
  flex: 1;
  min-width: 0;
}

.generate-more-item-name {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generate-more-item-status {
  font-size: 11px;
  color: var(--text-muted);
}

.generate-more-item-status.is-ready {
  color: var(--accent);
}

.generate-more-item-thumb {
  width: 40px;
  height: 30px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.generate-more-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(63, 225, 194, 0.1);
}

.generate-more-selected {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Generate More Tabs */
.generate-more-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.generate-more-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.generate-more-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.generate-more-tab.active {
  color: var(--accent);
  background: rgba(63, 225, 194, 0.1);
}

.generate-more-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.generate-more-tab.active .generate-more-tab-count {
  background: var(--accent);
  color: var(--bg);
}

.generate-more-item-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding: 2px 6px;
  background: rgba(63, 225, 194, 0.15);
  border-radius: 4px;
}

.generate-more-item-badge.pending {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.1);
}

.generate-more-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
  padding: 24px;
}

/* ===== HISTORY DRAWER (Global) ===== */
.history-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  justify-content: flex-end;
}

.history-drawer[hidden] {
  display: none;
}

.history-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.history-drawer-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(16, 24, 36, 0.98) 0%, rgba(10, 14, 22, 0.98) 100%);
  border-left: 1px solid rgba(63, 225, 194, 0.15);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.history-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(63, 225, 194, 0.12);
}

.history-drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.history-drawer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-drawer-actions .ghost {
  padding: 6px 12px;
  font-size: var(--text-sm);
}

.history-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

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

.history-drawer .history-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(63, 225, 194, 0.08);
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.history-drawer .history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(63, 225, 194, 0.2);
}

.history-drawer .history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.history-drawer .history-item-info {
  flex: 1;
  min-width: 0;
}

.history-drawer .history-item-title {
  font-weight: 500;
  font-size: var(--text-base);
  color: var(--text);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-drawer .history-item-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.history-drawer .history-item-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.history-drawer .history-badge {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.history-drawer .history-badge.slides {
  background: rgba(63, 225, 194, 0.1);
  color: var(--accent);
}

.history-drawer .history-badge.complete {
  background: rgba(63, 225, 194, 0.15);
  color: var(--accent);
}

.history-drawer .history-badge.partial {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.history-drawer .history-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-drawer .history-item-actions button {
  flex: 1;
  min-width: 80px;
  padding: 8px 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-drawer .history-item-actions button:hover {
  background: rgba(63, 225, 194, 0.1);
  border-color: rgba(63, 225, 194, 0.3);
  color: var(--accent);
}

.history-drawer .history-item-actions button.primary-action {
  background: rgba(63, 225, 194, 0.1);
  border-color: rgba(63, 225, 194, 0.25);
  color: var(--accent);
}

.history-drawer .history-item-actions button.primary-action:hover {
  background: rgba(63, 225, 194, 0.2);
  border-color: rgba(63, 225, 194, 0.4);
}

.history-drawer .history-status {
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  text-align: center;
}

.history-drawer .history-status.error {
  background: rgba(255, 82, 82, 0.1);
  color: #ff5252;
}

.history-drawer .history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.history-drawer .history-empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.history-drawer .history-empty-text {
  font-size: var(--text-sm);
}

/* ============================================================================
   PRICING PAGE
   ============================================================================ */

.pricing {
  min-height: 100vh;
  padding: 80px 20px 40px;
  background: var(--bg);
}

.pricing-shell {
  max-width: 900px;
  margin: 0 auto;
}

.pricing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.pricing-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 8px 0 12px;
}

.pricing-header .panel-note {
  max-width: 500px;
  color: var(--text-muted);
  line-height: 1.5;
}

.pricing-packages {
  margin-bottom: 48px;
}

.package-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}

.package-free {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(63, 225, 194, 0.05) 0%, var(--surface) 50%);
  border-color: rgba(63, 225, 194, 0.2);
}

.package-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(63, 225, 194, 0.15);
  color: var(--accent);
  border-radius: 4px;
}

.package-badge.best-value {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.package-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 8px;
}

.package-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.package-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.package-credits {
  font-size: 1.125rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.package-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 16px;
}

.package-savings {
  font-size: var(--text-xs);
  color: #4caf50;
  margin-bottom: 16px;
}

.package-action {
  margin-top: 16px;
}

.package-current {
  display: inline-block;
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.package-action button {
  width: 100%;
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.packages-grid .package-card {
  display: flex;
  flex-direction: column;
}

.packages-grid .package-action {
  margin-top: auto;
  padding-top: 8px;
}

/* Pricing Balance */
.pricing-balance {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.pricing-balance h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin: 0 0 20px;
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
}

.balance-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.balance-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.balance-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.balance-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.balance-total {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.balance-total .balance-value {
  color: var(--accent);
}

/* Pricing History */
.pricing-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.pricing-history .history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pricing-history h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin: 0;
}

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

.pricing-history .history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pricing-history .history-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pricing-history .history-item-name {
  font-weight: 500;
  color: var(--text);
}

.pricing-history .history-item-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.pricing-history .history-item-details {
  text-align: right;
}

.pricing-history .history-item-price {
  font-weight: 500;
  color: var(--text);
}

.pricing-history .history-item-credits {
  font-size: var(--text-sm);
  color: var(--accent);
}

/* Purchase Modal */
.purchase-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.purchase-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.purchase-modal-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.purchase-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin: 0;
}

.purchase-modal-header button {
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 8px;
}

.purchase-modal-body {
  padding: 24px;
}

.purchase-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.purchase-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.purchase-row span {
  color: var(--text-muted);
}

.purchase-row strong {
  color: var(--text);
}

.purchase-warning {
  padding: 16px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: var(--radius-sm);
  text-align: center;
}

.purchase-warning strong {
  display: block;
  color: #ffc107;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.purchase-warning p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.purchase-modal-actions {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
}

.purchase-modal-actions button {
  flex: 1;
}

.purchase-modal .status-note {
  margin: 0 24px 20px;
  text-align: center;
}

.purchase-modal .status-note.error {
  color: #ff5252;
}

.purchase-modal .status-note.success {
  color: var(--accent);
}

/* Low credits warning in header */
.credits-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: #ffc107;
}

.credits-warning-icon {
  font-size: 1rem;
}

.credits-warning a {
  color: #ffc107;
  text-decoration: underline;
  font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .pricing-header {
    flex-direction: column;
  }

  .pricing-header button {
    align-self: flex-start;
  }

  .packages-grid {
    grid-template-columns: 1fr;
  }

  .balance-grid {
    grid-template-columns: 1fr;
  }

  .balance-total {
    padding-left: 0;
    padding-top: 16px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .pricing-history .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .pricing-history .history-item-details {
    text-align: left;
  }
}

/* Pricing Loading State */
.pricing-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
  color: var(--text-muted);
}

.pricing-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.pricing-content {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Pricing Explainer */
.pricing-explainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
}

.explainer-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.explainer-item strong {
  font-size: var(--text-sm);
  color: var(--accent);
}

.explainer-item p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== GENERATION MODE TOGGLE (High-Tech Lab Aesthetic) ===== */

/* Generation Mode Section Container */
.gen-mode-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(8, 12, 22, 0.95), rgba(12, 18, 30, 0.88));
  border: 1px solid rgba(63, 225, 194, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 50px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

/* Subtle scan line effect for lab aesthetic */
.gen-mode-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(63, 225, 194, 0.015) 2px,
    rgba(63, 225, 194, 0.015) 4px
  );
  pointer-events: none;
}

/* Header with label and price */
.gen-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.gen-mode-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(63, 225, 194, 0.8);
  font-weight: 600;
}

/* Price Display - Prominent */
.gen-mode-price {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(63, 225, 194, 0.08);
  border: 1px solid rgba(63, 225, 194, 0.2);
  box-shadow: 0 0 20px rgba(63, 225, 194, 0.1);
}

.gen-mode-price-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(211, 221, 244, 0.5);
}

.gen-mode-price-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(63, 225, 194, 0.4);
}

/* 3-Way Toggle Container */
.gen-mode-toggle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: rgba(4, 8, 16, 0.85);
  border: 1px solid rgba(63, 225, 194, 0.15);
  position: relative;
  z-index: 1;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Sliding Indicator (animated background) */
.gen-mode-indicator {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(25% - 4.5px);
  height: calc(100% - 12px);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(63, 225, 194, 0.25), rgba(63, 225, 194, 0.15));
  border: 1px solid rgba(63, 225, 194, 0.4);
  box-shadow:
    0 0 20px rgba(63, 225, 194, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

/* Indicator positions based on selection (order: draft, balanced, best, custom) */
.gen-mode-toggle:has([value="draft"]:checked) .gen-mode-indicator {
  transform: translateX(0);
}

.gen-mode-toggle:has([value="balanced"]:checked) .gen-mode-indicator {
  transform: translateX(calc(100% + 4px));
}

.gen-mode-toggle:has([value="best"]:checked) .gen-mode-indicator {
  transform: translateX(calc(200% + 8px));
}

.gen-mode-toggle:has([value="custom"]:checked) .gen-mode-indicator {
  transform: translateX(calc(300% + 12px));
}

/* Individual Option */
.gen-mode-option {
  position: relative;
  z-index: 1;
  cursor: pointer;
}

.gen-mode-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gen-mode-option-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.gen-mode-option-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(211, 221, 244, 0.5);
  transition: all 0.25s ease;
}

.gen-mode-option-icon svg {
  width: 20px;
  height: 20px;
}

.gen-mode-option-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.gen-mode-option-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(211, 221, 244, 0.7);
  transition: all 0.25s ease;
}

.gen-mode-option-desc {
  font-size: 10px;
  color: rgba(211, 221, 244, 0.4);
  transition: all 0.25s ease;
}

/* Hover State */
.gen-mode-option:hover .gen-mode-option-icon {
  color: rgba(63, 225, 194, 0.7);
}

.gen-mode-option:hover .gen-mode-option-title {
  color: rgba(211, 221, 244, 0.9);
}

/* Active/Selected State */
.gen-mode-option input:checked ~ .gen-mode-option-inner .gen-mode-option-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(63, 225, 194, 0.5));
}

.gen-mode-option input:checked ~ .gen-mode-option-inner .gen-mode-option-title {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(63, 225, 194, 0.3);
}

.gen-mode-option input:checked ~ .gen-mode-option-inner .gen-mode-option-desc {
  color: rgba(63, 225, 194, 0.8);
}

/* Focus State for Accessibility */
.gen-mode-option input:focus-visible ~ .gen-mode-option-inner {
  outline: 2px solid rgba(63, 225, 194, 0.6);
  outline-offset: 2px;
}

/* Specs Display (below toggle) */
.gen-mode-specs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(4, 8, 16, 0.6);
  border: 1px solid rgba(63, 225, 194, 0.08);
  position: relative;
  z-index: 1;
}

.gen-mode-spec {
  font-size: 11px;
  font-weight: 500;
  color: rgba(211, 221, 244, 0.85);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}

.gen-mode-spec-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(63, 225, 194, 0.4);
}

.gen-mode-spec-price {
  color: var(--accent);
  font-weight: 600;
}

/* ===== CUSTOM CONTROLS SECTION ===== */

.gen-custom-controls {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(6, 10, 18, 0.75);
  border: 1px solid rgba(63, 225, 194, 0.1);
  margin-top: 4px;
  max-height: 500px; /* Large enough for content */
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease,
              border-color 0.3s ease;
}

/* Collapsed state (when not in Custom mode) - smooth animation */
.gen-custom-controls.is-collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  border-color: transparent;
  pointer-events: none;
}

/* Alternative: fade/disable instead of hide */
.gen-custom-controls.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.3);
}

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

.gen-custom-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(211, 221, 244, 0.5);
  font-weight: 500;
}

.gen-custom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Control Group */
.gen-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gen-control-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gen-control-label-text {
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(211, 221, 244, 0.9);
}

.gen-control-label-hint {
  font-size: 10px;
  color: rgba(211, 221, 244, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Select Styling */
.gen-control-select {
  appearance: none;
  padding: 12px 40px 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(63, 225, 194, 0.2);
  background: rgba(8, 12, 20, 0.9);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233fe1c2' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.gen-control-select:hover {
  border-color: rgba(63, 225, 194, 0.4);
  background-color: rgba(10, 16, 26, 0.95);
}

.gen-control-select:focus {
  outline: none;
  border-color: rgba(63, 225, 194, 0.6);
  box-shadow: 0 0 0 3px rgba(63, 225, 194, 0.1);
}

/* Control Meta/Description */
.gen-control-meta {
  font-size: var(--text-xs);
  color: rgba(211, 221, 244, 0.6);
  line-height: 1.4;
  padding-left: 2px;
}

/* ===== MODE-SPECIFIC STYLING ===== */

/* Draft Mode - Lightning bolt accent */
.gen-mode-toggle:has([value="draft"]:checked) .gen-mode-indicator {
  background: linear-gradient(135deg, rgba(215, 227, 106, 0.25), rgba(215, 227, 106, 0.15));
  border-color: rgba(215, 227, 106, 0.4);
  box-shadow: 0 0 20px rgba(215, 227, 106, 0.2);
}

.gen-mode-option[data-mode="draft"] input:checked ~ .gen-mode-option-inner .gen-mode-option-icon {
  color: var(--accent-3);
  filter: drop-shadow(0 0 8px rgba(215, 227, 106, 0.5));
}

.gen-mode-option[data-mode="draft"] input:checked ~ .gen-mode-option-inner .gen-mode-option-desc {
  color: rgba(215, 227, 106, 0.8);
}

/* Balanced Mode - Default teal accent (uses default indicator styling) */
.gen-mode-option[data-mode="balanced"] input:checked ~ .gen-mode-option-inner .gen-mode-option-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(63, 225, 194, 0.5));
}

.gen-mode-option[data-mode="balanced"] input:checked ~ .gen-mode-option-inner .gen-mode-option-desc {
  color: rgba(63, 225, 194, 0.8);
}

/* Best Mode - Star/premium accent */
.gen-mode-toggle:has([value="best"]:checked) .gen-mode-indicator {
  background: linear-gradient(135deg, rgba(242, 156, 75, 0.25), rgba(242, 156, 75, 0.15));
  border-color: rgba(242, 156, 75, 0.4);
  box-shadow: 0 0 20px rgba(242, 156, 75, 0.2);
}

.gen-mode-option[data-mode="best"] input:checked ~ .gen-mode-option-inner .gen-mode-option-icon {
  color: var(--accent-2);
  filter: drop-shadow(0 0 8px rgba(242, 156, 75, 0.5));
}

.gen-mode-option[data-mode="best"] input:checked ~ .gen-mode-option-inner .gen-mode-option-desc {
  color: rgba(242, 156, 75, 0.8);
}

/* Custom Mode - Purple accent for customization */
.gen-mode-toggle:has([value="custom"]:checked) .gen-mode-indicator {
  background: linear-gradient(135deg, rgba(168, 139, 255, 0.25), rgba(168, 139, 255, 0.15));
  border-color: rgba(168, 139, 255, 0.4);
  box-shadow: 0 0 20px rgba(168, 139, 255, 0.2);
}

.gen-mode-option[data-mode="custom"] input:checked ~ .gen-mode-option-inner .gen-mode-option-icon {
  color: #a88bff;
  filter: drop-shadow(0 0 8px rgba(168, 139, 255, 0.5));
}

.gen-mode-option[data-mode="custom"] input:checked ~ .gen-mode-option-inner .gen-mode-option-desc {
  color: rgba(168, 139, 255, 0.8);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 600px) {
  .gen-mode-section {
    padding: 16px;
  }

  .gen-mode-toggle {
    gap: 2px;
    padding: 4px;
  }

  .gen-mode-option-inner {
    padding: 10px 8px;
  }

  .gen-mode-option-icon {
    width: 24px;
    height: 24px;
  }

  .gen-mode-option-icon svg {
    width: 16px;
    height: 16px;
  }

  .gen-mode-option-title {
    font-size: 12px;
  }

  .gen-mode-option-desc {
    font-size: 9px;
  }

  .gen-mode-specs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .gen-custom-grid {
    grid-template-columns: 1fr;
  }
}

/* Animation for price updates */
@keyframes pricePulse {
  0% {
    box-shadow: 0 0 20px rgba(63, 225, 194, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(63, 225, 194, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(63, 225, 194, 0.1);
  }
}

.gen-mode-price.is-updated {
  animation: pricePulse 0.6s ease;
}

/* Glow animation for active state */
@keyframes subtleGlow {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(63, 225, 194, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow:
      0 0 30px rgba(63, 225, 194, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

.gen-mode-indicator {
  animation: subtleGlow 3s ease-in-out infinite;
}
