/* ==========================================================================
   HilAPI — Design System & Stylesheet (Refined Dark)
   ========================================================================== */

:root {
  --bg: #0b0c0e;
  --bg-card: #131417;
  --bg-card-solid: #131417;
  --bg-elevated: #1a1b1f;
  --bg-input: #0f1012;
  
  --border: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(59, 130, 246, 0.35);
  
  --text: #ededef;
  --text-dim: #9c9ca4;
  --text-faint: #6b6b74;
  
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-gradient: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  --accent-glow: rgba(59, 130, 246, 0.2);
  
  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.12);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-hover); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #fff; }

/* ---------- Topbar Navigation ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 9, 14, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 100;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-dot {
  width: 11px; height: 11px; border-radius: 3px;
  background: var(--accent);
}
.brand-name { font-weight: 800; letter-spacing: 0.12em; font-size: 14px; color: #fff; }
.brand-tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 6px;
  background: rgba(59, 130, 246, 0.1); border: 1px solid var(--border-accent);
  color: var(--accent-hover);
}

.topnav { display: flex; align-items: center; gap: 20px; }
.topnav a {
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 8px; transition: all 0.18s ease;
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.topnav a.active { color: #fff; background: rgba(255, 255, 255, 0.06); }

.user-status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text);
}
.user-status-pill .plan-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  background: var(--accent-gradient); color: #fff;
  padding: 2px 7px; border-radius: var(--radius-full);
}

.nav-cta {
  background: #fff !important;
  color: #0b0c0e !important; font-weight: 600 !important;
  border-radius: 9px !important;
}
.nav-cta:hover { background: #d9d9de !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: var(--font); font-size: 14.5px; font-weight: 600;
  padding: 11px 22px; border-radius: 10px; transition: all 0.18s ease;
}
.btn-primary {
  background: #fff; color: #0b0c0e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
  background: #d9d9de;
  color: #0b0c0e;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08); border-color: var(--border-accent);
  color: #fff; transform: translateY(-1px);
}
.btn-danger {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- Landing Hero ---------- */
.hero {
  max-width: 1000px; margin: 0 auto; text-align: center;
  padding: 85px 24px 45px; position: relative;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--accent-hover);
  background: rgba(59, 130, 246, 0.08); border: 1px solid var(--border-accent);
  padding: 6px 18px; border-radius: var(--radius-full); margin-bottom: 24px;
}
.hero-badge .pill-sparkle { font-size: 14px; }
.hero h1 {
  font-size: clamp(34px, 5.5vw, 62px); font-weight: 800;
  line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 22px;
}
.hero h1 .grad {
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub {
  font-size: 18px; color: var(--text-dim); max-width: 660px;
  margin: 0 auto 36px; line-height: 1.65;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Interactive Before / After Split Slider ---------- */
.showcase-tabs {
  display: flex; gap: 10px; justify-content: center; margin-bottom: 28px; flex-wrap: wrap;
}
.stab {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 20px; font-size: 14px;
  font-weight: 600; color: var(--text-dim); cursor: pointer;
  font-family: var(--font); transition: all 0.18s ease;
  backdrop-filter: blur(12px);
}
.stab:hover { border-color: var(--border-light); color: #fff; }
.stab.active {
  background: rgba(255, 255, 255, 0.07); border-color: var(--border-light);
  color: #fff;
}

.showcase-panel { display: none; }
.showcase-panel.active { display: block; animation: fadeScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeScaleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.showcase-prompt {
  text-align: center; margin-bottom: 22px;
  padding: 12px 24px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: inline-flex; gap: 10px; align-items: center;
  margin-left: 50%; transform: translateX(-50%);
  max-width: 90%; backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.sp-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent-hover);
}
.sp-text { font-size: 14.5px; color: var(--text); font-style: italic; }

.ba-slider-box {
  max-width: 720px; margin: 0 auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.ba-stage {
  position: relative; width: 100%;
  aspect-ratio: 4 / 3; max-height: 640px; height: auto;
  overflow: hidden; user-select: none; -webkit-user-select: none;
  cursor: ew-resize; background: #fff;
  --slider-pos: 50%;
}
.ba-stage.dragging { cursor: grabbing; }

.ba-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.ba-layer img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: #fff; pointer-events: none;
}

.ba-layer-after { z-index: 1; }

.ba-layer-before {
  z-index: 2;
  clip-path: polygon(0 0, var(--slider-pos) 0, var(--slider-pos) 100%, 0 100%);
  -webkit-clip-path: polygon(0 0, var(--slider-pos) 0, var(--slider-pos) 100%, 0 100%);
}

.ba-badge-pill {
  position: absolute; top: 16px; z-index: 4;
  padding: 7px 16px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}
.ba-badge-pill.before {
  left: 18px;
  background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}
.ba-badge-pill.after {
  right: 18px;
  background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 8px #10b981; animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.ba-divider-handle {
  position: absolute; top: 0; bottom: 0;
  left: var(--slider-pos);
  transform: translateX(-50%);
  width: 44px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 5; pointer-events: none;
}
.ba-handle-line {
  width: 2px; flex: 1;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}
.ba-handle-thumb {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(14, 18, 30, 0.9);
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: ew-resize;
  transition: transform 0.15s ease;
}
.ba-stage:hover .ba-handle-thumb { transform: scale(1.1); }

.ba-slider-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: rgba(11, 14, 22, 0.95); flex-wrap: wrap; gap: 12px;
}
.ba-spec-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.ba-spec-tags .tag {
  font-size: 12px; font-weight: 600; padding: 4px 11px;
  border-radius: 6px; background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border); color: var(--text-dim);
}
.ba-slider-hint { font-size: 12.5px; color: var(--text-faint); font-weight: 500; }

/* ---------- Prompt Demo Box (Hero) ---------- */
.prompt-demo {
  max-width: 860px; margin: 48px auto 0; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(16px);
}
.prompt-demo-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}
.prompt-demo-icon { font-size: 18px; }
.prompt-demo-body { padding: 22px; }
.prompt-ref-row {
  display: flex; gap: 14px; align-items: center; margin-bottom: 18px;
}
.prompt-ref-thumb {
  position: relative; width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden; border: 1.5px solid var(--border-light);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.prompt-ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prompt-ref-tag {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(7, 9, 14, 0.92); font-size: 8.5px; font-weight: 700;
  color: var(--accent-hover); text-align: center; padding: 2px 0; text-transform: uppercase;
}
.prompt-ref-row .prompt-input-fake {
  flex: 1; margin-bottom: 0; min-height: 72px; display: flex; align-items: center;
}
.prompt-input-fake {
  background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: 11px; padding: 14px 18px; margin-bottom: 18px;
  font-size: 15px; color: var(--text); min-height: 48px;
  position: relative;
}
.prompt-cursor::after {
  content: ""; display: inline-block; width: 2px; height: 1.1em;
  background: var(--accent-hover); margin-left: 2px; vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.prompt-demo-results {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.prompt-demo-results-single {
  grid-template-columns: minmax(0, 420px); justify-content: center;
}
.prompt-demo-results-single .pdr-item img { aspect-ratio: 4 / 3; }
.pdr-item {
  position: relative; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--border); transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pdr-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  border-color: var(--border-light);
}
.pdr-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pdr-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(7, 9, 14, 0.95));
  font-size: 11px; font-weight: 600; color: #fff;
  padding: 20px 8px 6px; text-align: center;
}

/* ---------- Trust Bar ---------- */
.trust-bar {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: rgba(14, 18, 30, 0.5); backdrop-filter: blur(12px);
  padding: 38px 24px;
}
.trust-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 48px; flex-wrap: wrap;
}
.trust-stat { text-align: center; }
.trust-num {
  display: block; font-size: 36px; font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.trust-label { font-size: 13.5px; color: var(--text-faint); font-weight: 500; margin-top: 4px; display: block; }
.trust-divider { width: 1px; height: 42px; background: var(--border); }

/* ---------- Steps (How it Works) ---------- */
.steps {
  display: flex; align-items: stretch; justify-content: center;
  gap: 20px; flex-wrap: wrap;
}
.step {
  flex: 1 1 260px; max-width: 320px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 24px 28px;
  position: relative; backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.step:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
}
.step-num {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step-icon { font-size: 36px; margin-bottom: 16px; margin-top: 4px; }
.step h3 { font-size: 17.5px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.step p { color: var(--text-dim); font-size: 14px; }
.step-arrow {
  display: flex; align-items: center; font-size: 28px;
  color: var(--text-faint); padding: 0 10px;
}

/* ---------- Features & Models & Pricing ---------- */
.section { max-width: 1100px; margin: 0 auto; padding: 80px 24px; }
.section-title { font-size: 32px; font-weight: 800; text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--text-dim); margin-bottom: 48px; font-size: 16.5px; max-width: 720px; margin-left: auto; margin-right: auto; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.feature {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}
.feature:hover {
  transform: translateY(-3px); border-color: var(--border-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.feature .icon { font-size: 28px; margin-bottom: 16px; }
.feature h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.feature p { color: var(--text-dim); font-size: 14px; }

.models { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.model-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 34px; position: relative;
  backdrop-filter: blur(12px);
}
.model-card.pro {
  border-color: var(--border-light);
}
.model-card .model-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 6px; margin-bottom: 18px;
}
.model-card.flash .model-tag { background: rgba(59, 130, 246, 0.12); color: var(--accent-hover); }
.model-card.pro .model-tag { background: rgba(255, 255, 255, 0.08); color: #e5e5e9; }
.model-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.model-card p { color: var(--text-dim); font-size: 14.5px; }

.model-specs {
  list-style: none; margin-top: 20px; padding: 0;
  border-top: 1px solid var(--border); padding-top: 16px;
}
.model-specs li { padding: 6px 0; font-size: 13.5px; color: var(--text-dim); }
.model-specs li::before { content: "✓  "; color: var(--success); font-weight: 700; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.price-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 30px; text-align: center;
  position: relative; backdrop-filter: blur(12px);
  transition: transform 0.2s ease;
}
.price-card:hover { transform: translateY(-4px); }
.price-card.highlight {
  border-color: var(--border-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.popular-tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 18px; border-radius: var(--radius-full); white-space: nowrap;
}
.price-card .plan-name {
  font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
}
.price-card .price { font-size: 42px; font-weight: 800; margin: 16px 0 4px; color: #fff; }
.price-card .price span { font-size: 15px; color: var(--text-faint); font-weight: 500; }
.price-card ul { list-style: none; margin: 24px 0 28px; text-align: left; }
.price-card li { padding: 8px 0; color: var(--text-dim); font-size: 14px; }
.price-card li::before { content: "✓  "; color: var(--success); font-weight: 700; }

/* ---------- CTA & Code Demo ---------- */
.cta-section {
  padding: 90px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.cta-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.cta-inner h2 { font-size: 34px; font-weight: 800; margin-bottom: 16px; }
.cta-inner p { color: var(--text-dim); font-size: 16.5px; margin-bottom: 32px; }

.code-demo {
  max-width: 780px; margin: 60px auto 0; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.code-demo-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-faint);
  background: rgba(255, 255, 255, 0.02);
}
.code-demo-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.code-demo pre {
  padding: 22px 24px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  color: #c3cae0;
}
.code-demo .c-key { color: #818cf8; }
.code-demo .c-str { color: #34d399; }
.code-demo .c-cmt { color: var(--text-faint); }

.footer {
  border-top: 1px solid var(--border); padding: 48px 24px;
  background: rgba(7, 9, 14, 0.95);
}
.footer-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { color: var(--text-faint); font-size: 14px; }
.footer-links a:hover { color: var(--accent-hover); }
.footer-copy { color: var(--text-faint); font-size: 12.5px; margin-top: 4px; }

/* ==========================================================================
   STUDIO WORKSTATION STYLES (views/index.html)
   ========================================================================== */
.studio-body {
  min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--bg);
}

.brand-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  padding: 2px 7px; border-radius: 6px;
  background: rgba(59, 130, 246, 0.1); border: 1px solid var(--border-accent);
  color: var(--accent-hover);
}

.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.user-pill-name { font-weight: 600; color: #fff; }
.badge-plan {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  background: var(--accent-gradient); color: #fff;
  padding: 2px 8px; border-radius: var(--radius-full);
}

.studio-subbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 32px;
  background: rgba(14, 18, 30, 0.6);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  overflow-x: auto;
}
.chips-container { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.chips-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent-hover);
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.chip-btn {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  color: var(--text-dim); padding: 5px 13px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
  font-family: var(--font); transition: all 0.15s ease;
}
.chip-btn:hover {
  background: rgba(255, 255, 255, 0.07); border-color: var(--border-light);
  color: #fff;
}

.studio-workspace {
  display: grid; grid-template-columns: 460px 1fr; gap: 24px;
  padding: 24px 32px; flex: 1; align-items: start;
  max-width: 1700px; margin: 0 auto; width: 100%;
}

.card.studio-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px;
  backdrop-filter: blur(16px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}
.create-panel {
  position: sticky; top: 88px;
}

.panel-header {
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.panel-heading { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.panel-subtext { font-size: 13px; color: var(--text-dim); }

.field-block { margin-bottom: 18px; }
.field-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.field-label {
  display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); margin-bottom: 8px;
}
.field-label .optional {
  font-size: 11px; font-weight: 400; text-transform: none;
  color: var(--text-faint); margin-left: 4px;
}
.field-block textarea {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border-light); border-radius: 11px;
  color: var(--text); font-family: var(--font); font-size: 14px;
  line-height: 1.55; padding: 12px 14px; outline: none;
  resize: vertical; min-height: 95px; transition: border-color 0.15s ease;
}
.field-block textarea:focus { border-color: var(--accent); }

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius); padding: 20px 16px; text-align: center;
  cursor: pointer; background: rgba(14, 18, 30, 0.4);
  transition: all 0.2s ease; position: relative; margin-bottom: 18px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent); background: rgba(59, 130, 246, 0.05);
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dropzone-icon { color: var(--accent-hover); margin-bottom: 4px; }
.dropzone-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.link-btn {
  background: none; border: none; color: var(--accent-hover);
  font-weight: 600; cursor: pointer; text-decoration: underline; font-family: var(--font);
}
.link-btn.danger { color: var(--danger); }
.dropzone-preview {
  position: relative; width: 100%; height: 160px; border-radius: var(--radius-sm);
  overflow: hidden; margin-top: 8px;
}
.dropzone-preview img { width: 100%; height: 100%; object-fit: cover; }
.preview-meta {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 12px; background: rgba(7, 9, 14, 0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: space-between; font-size: 12px;
}

/* Segmented Controls */
.segmented {
  display: inline-flex; background: rgba(14, 18, 30, 0.6);
  border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px;
  flex-wrap: wrap;
}
.segmented-models { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg-btn {
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  transition: all 0.15s ease; text-align: center;
}
.seg-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.seg-btn.active {
  background: rgba(59, 130, 246, 0.12); border-color: var(--border-accent);
  color: #fff;
}
.seg-title { display: block; font-size: 13px; font-weight: 700; color: #fff; text-align: left; }
.seg-desc { display: block; font-size: 11px; color: var(--text-faint); margin-top: 2px; text-align: left; }
.seg-btn.active .seg-title { color: var(--accent-hover); }

.glow-btn {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Loading State */
.loading {
  margin-top: 20px; padding: 24px; text-align: center;
  background: rgba(14, 18, 30, 0.5); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
.spinner.small { width: 28px; height: 28px; border-width: 2.5px; margin-bottom: 8px; }
.loading-text { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.loading-sub { font-size: 12.5px; color: var(--text-dim); margin-bottom: 14px; }
.loading-progress-bar {
  height: 5px; background: rgba(255, 255, 255, 0.08);
  border-radius: 99px; overflow: hidden; max-width: 280px; margin: 0 auto;
}
.bar-fill {
  height: 100%; width: 45%; border-radius: 99px;
  background: var(--accent-gradient);
  animation: loadingSweep 1.6s infinite ease-in-out;
}
@keyframes loadingSweep {
  0% { transform: translateX(-100%); width: 20%; }
  50% { width: 60%; }
  100% { transform: translateX(300%); width: 20%; }
}

/* Canvas Output Stage */
.canvas-panel {
  min-height: 580px; display: flex; flex-direction: column;
}

.canvas-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 50px 20px;
}
.canvas-empty-icon {
  width: 76px; height: 76px; border-radius: 20px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; font-size: 32px;
}
.canvas-empty h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.canvas-empty p { font-size: 14.5px; color: var(--text-dim); max-width: 440px; margin-bottom: 24px; }
.canvas-features {
  display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; justify-content: center;
}
.cfeat {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: var(--radius-full);
}
.cf-icon { font-size: 14px; }

/* Result Stage */
.result-card { display: flex; flex-direction: column; gap: 20px; animation: fadeScaleIn 0.35s ease; }
.result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; flex-wrap: wrap; gap: 12px;
}
.result-title { font-size: 20px; font-weight: 800; color: #fff; }
.result-meta { font-size: 12.5px; color: var(--accent-hover); font-weight: 500; margin-top: 2px; }

.image-stage {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: #000;
  max-height: 560px; display: flex; align-items: center; justify-content: center;
}
.image-stage img {
  width: 100%; height: auto; max-height: 560px; object-fit: contain;
  display: block;
}
.stage-badge {
  position: absolute; top: 14px; right: 14px;
  padding: 4px 12px; border-radius: 6px;
  background: rgba(7, 9, 14, 0.88); backdrop-filter: blur(8px);
  border: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--success);
}

.download-box, .revise-box {
  background: rgba(14, 18, 30, 0.5); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.pane-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 14px; }

.download-controls {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.control-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.control-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--text-faint); }
.download-hint { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

.revise-form { display: flex; gap: 10px; align-items: flex-start; }
.revise-form textarea {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: 9px; padding: 10px 12px; font-family: var(--font); font-size: 13.5px;
  color: var(--text); resize: none; outline: none;
}
.revise-form textarea:focus { border-color: var(--accent); }
.revision-list { list-style: none; margin-top: 12px; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.revision-item {
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
  width: 60px; height: 60px; flex-shrink: 0; cursor: pointer;
}
.revision-item.active { border-color: var(--accent); }
.revision-item img { width: 100%; height: 100%; object-fit: cover; }
  font-family: var(--font); font-size: 14px; color: var(--text);
}

/* ==========================================================================
   AUTH, DASHBOARD, ADMIN & DOCS STYLES
   ========================================================================== */
.auth-wrap {
  min-height: calc(100vh - 70px); display: flex;
  align-items: center; justify-content: center; padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 34px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.auth-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; color: #fff; }
.auth-card .auth-sub { color: var(--text-dim); font-size: 14.5px; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}
.field input {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border-light); border-radius: 10px;
  color: var(--text); font-family: var(--font); font-size: 14.5px;
  padding: 12px 14px; outline: none; transition: border-color 0.15s ease;
}
.field input:focus { border-color: var(--accent); }
.auth-alt { margin-top: 22px; text-align: center; font-size: 14px; color: var(--text-dim); }

.alert {
  border-radius: 10px; padding: 12px 16px; font-size: 14px;
  margin-bottom: 20px; white-space: pre-wrap;
}
.alert.error { background: var(--danger-bg); border: 1px solid rgba(244, 63, 94, 0.35); color: #fca5a5; }
.alert.success { background: var(--success-bg); border: 1px solid rgba(16, 185, 129, 0.35); color: #86efac; }
.hidden { display: none !important; }

/* Dashboard & Admin */
.dash {
  max-width: 1240px; margin: 0 auto; padding: 40px 24px 90px;
  display: flex; flex-direction: column; gap: 28px;
}
.dash-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.dash-head h1 { font-size: 26px; font-weight: 800; color: #fff; }
.dash-head .who { color: var(--text-dim); font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  backdrop-filter: blur(12px);
}
.stat .stat-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.stat .stat-value { font-size: 30px; font-weight: 800; margin-top: 8px; color: #fff; }
.stat .stat-value.ok { color: var(--success); }
.stat .stat-value.bad { color: var(--danger); }

.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  backdrop-filter: blur(12px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.panel-title { font-size: 18px; font-weight: 700; color: #fff; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-faint); padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
td.strong { color: var(--text); font-weight: 600; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-full);
}
.badge.ok { background: var(--success-bg); color: #34d399; }
.badge.bad { background: var(--danger-bg); color: #fb7185; }
.badge.warn { background: var(--warning-bg); color: #fbbf24; }
.badge.dim { background: rgba(154, 161, 179, 0.12); color: var(--text-dim); }

.key-reveal {
  background: var(--bg-input); border: 1px dashed var(--accent);
  border-radius: 10px; padding: 14px 18px; margin: 14px 0;
  font-family: var(--mono); font-size: 13.5px; word-break: break-all;
  color: var(--accent-hover);
}

.api-endpoint-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 12px 16px;
}
.api-endpoint-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim);
}
.api-endpoint-url {
  flex: 1; min-width: 200px; font-family: var(--mono);
  font-size: 14px; color: var(--accent-hover); word-break: break-all;
}

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input {
  flex: 1; min-width: 160px; background: var(--bg-input);
  border: 1px solid var(--border-light); border-radius: 9px;
  color: var(--text); font-family: var(--font); font-size: 14px;
  padding: 10px 14px; outline: none;
}
.inline-form input:focus { border-color: var(--accent); }

.quota-bar {
  height: 10px; background: var(--bg-input);
  border-radius: var(--radius-full); overflow: hidden; margin-top: 12px;
}
.quota-bar .fill {
  height: 100%; border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 0.4s ease;
}

.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 10px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.chart .bar { border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .bar.s { background: var(--accent); }
.chart .bar.e { background: var(--danger); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.gallery .shot {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg-input);
}
.gallery .shot img { width: 100%; height: 130px; object-fit: cover; display: block; }
.gallery .shot .cap { padding: 8px 10px; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-faint); font-size: 13px; }

/* Docs */
.docs { max-width: 920px; margin: 0 auto; padding: 40px 24px 100px; }
.docs h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; color: #fff; }
.docs h2 { font-size: 22px; font-weight: 700; margin: 44px 0 14px; padding-top: 14px; border-top: 1px solid var(--border); color: #fff; }
.docs h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; color: var(--accent-hover); }
.docs p { color: var(--text-dim); margin-bottom: 14px; font-size: 15px; }
.docs pre {
  background: var(--bg-card-solid); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  color: #c3cae0; margin: 16px 0;
}
.docs code { font-family: var(--mono); font-size: 13px; background: rgba(255, 255, 255, 0.08); padding: 2px 7px; border-radius: 5px; color: var(--accent-hover); }
.docs pre code { background: none; padding: 0; color: inherit; }
.docs table { margin: 16px 0; }

/* Fade-up animations */
.fade-up {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible { opacity: 1; transform: none; }

/* Responsive Media Queries */
@media (max-width: 900px) {
  .studio-workspace { grid-template-columns: 1fr; }
  .create-panel { position: static; }
  .ba-slider-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 680px) {
  .topbar { padding: 14px 18px; }
  .topnav a:not(.nav-cta) { display: none; }
  .hero { padding: 60px 18px 30px; }
  .prompt-demo-results { grid-template-columns: repeat(2, 1fr); }
  .prompt-demo-results-single { grid-template-columns: 1fr; }
  .steps { flex-direction: column; align-items: center; gap: 14px; }
  .step-arrow { transform: rotate(90deg); margin: 0; padding: 8px 0; }
  .trust-inner { gap: 24px; }
  .trust-divider { display: none; }
}
