/* ═══════════════════════════════════════════════════════════════════
   AXIS Foundry — Studio layout
   Viewport-first generation UI. Full-bleed model-viewer stage with
   a left rail (prompt + settings) and a bottom rail (session history).
   ═══════════════════════════════════════════════════════════════════ */

/* ── Layout grid ──────────────────────────────────────────────── */
.studio-body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 56px 1fr 220px;
  grid-template-areas:
    "topbar topbar"
    "rail   stage"
    "rail   bottom";
  background: var(--av-bg-base, #090B0F);
  color: var(--av-fg-primary, #E6EAF2);
}

.studio-topbar  { grid-area: topbar; }
.studio-stage   { grid-area: stage;  position: relative; }
.studio-rail--left   { grid-area: rail; }
.studio-rail--bottom { grid-area: bottom; }

/* ── Top bar ──────────────────────────────────────────────────── */
.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  background: var(--av-bg-surface-1, #0E1116);
  gap: 16px;
}
.studio-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none;
  font-family: var(--av-font-display, inherit);
  font-size: 15px; letter-spacing: 0.01em;
}
.studio-brand .brand-mark {
  width: 22px; height: 22px; border-radius: 5px;
  background: linear-gradient(135deg, var(--av-accent-cyan, #38BDF8), var(--av-accent-magenta, #F472B6));
}
.studio-tag {
  margin-left: 6px; padding: 2px 8px;
  font-family: var(--av-font-mono, monospace);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid var(--av-line-strong, rgba(255,255,255,0.16));
  border-radius: 4px; color: var(--av-fg-secondary, #9CA3AF);
}
.studio-modes {
  display: inline-flex;
  background: var(--av-bg-surface-2, #14181F);
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 3px;
}
.studio-modes button {
  appearance: none; background: transparent; border: 0;
  color: var(--av-fg-secondary, #9CA3AF);
  padding: 6px 14px; border-radius: 6px;
  font-family: inherit; font-size: 13px;
  cursor: pointer;
}
.studio-modes button.active,
.studio-modes button[aria-selected="true"] {
  background: var(--av-bg-surface-3, #1A1F28);
  color: var(--av-fg-primary, #E6EAF2);
  box-shadow: 0 0 0 1px var(--av-line-strong, rgba(255,255,255,0.16));
}
.studio-topright { display: inline-flex; gap: 8px; align-items: center; }
.studio-topright .btn { padding: 6px 12px; font-size: 12px; }

/* ── Stage ────────────────────────────────────────────────────── */
.studio-stage {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(24,210,255,0.07), transparent 55%),
    radial-gradient(ellipse at 85% 72%, rgba(139,92,246,0.05), transparent 45%),
    radial-gradient(ellipse at 15% 80%, rgba(255,138,31,0.03), transparent 40%),
    var(--av-bg-canvas, #090B0F);
  overflow: hidden;
}
.studio-viewer { position: absolute; inset: 0; }
.studio-viewer model-viewer {
  width: 100%; height: 100%; background: transparent;
}
.studio-viewer .viewer-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--av-fg-secondary, #9CA3AF); padding: 24px;
}
.viewer-empty-inner { text-align: center; max-width: 340px; }
.viewer-empty-icon  { opacity: 0.45; margin-bottom: 12px; color: var(--av-accent-cyan, #38BDF8); }
.viewer-empty-h     { margin: 0 0 6px; font-size: 16px; color: var(--av-fg-primary, #E6EAF2); }
.viewer-empty-sub   { margin: 0; font-size: 12px; opacity: 0.7; }

/* Floating meta + actions over stage */
.studio-meta.viewer-meta {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: 60%;
  padding: 10px 14px;
  background: rgba(9,11,15,0.78);
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  border-radius: 10px;
  font-family: var(--av-font-mono, monospace);
  font-size: 11px;
  color: var(--av-fg-secondary, #9CA3AF);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 2;
}
.studio-meta strong { color: var(--av-fg-primary, #E6EAF2); font-weight: 500; }
.studio-actions.viewer-actions {
  position: absolute; bottom: 16px; right: 16px;
  display: inline-flex; gap: 8px;
  z-index: 2;
}

/* ── Left rail ────────────────────────────────────────────────── */
.studio-rail--left {
  display: flex; flex-direction: column;
  background: var(--av-bg-surface-1, #0E1116);
  border-right: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  width: 360px;
  min-width: 0;
  overflow: hidden;
  transition: width 0.22s ease, border-color 0.22s ease;
}
.studio-rail--left.rail-collapsed {
  width: 0;
  border-right-color: transparent;
}
.rail-scroll {
  flex: 1; overflow-y: auto;
  padding: 16px;
}
.rail-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  background: var(--av-bg-surface-1, #0E1116);
}
.rail-foot .submit-row {
  display: flex; flex-direction: column; gap: 8px; margin-top: 4px;
}
.rail-foot .btn-block { width: 100%; padding: 12px 16px; font-size: 14px; }
.rail-foot .progress { flex: 0 0 4px; width: 100%; height: 4px; min-width: 0; }
.rail-foot .status-text { font-size: 11px; opacity: 0.75; }

/* Make only the active mode pane visible inside the rail */
.studio-rail--left .mode-pane { display: none; }
.studio-rail--left .mode-pane.active { display: block; margin-bottom: 16px; }

.settings--studio { margin-top: 4px; }
.settings--studio .settings-body { display: grid; gap: 10px; }
.settings--studio .toggles { display: flex; flex-direction: column; gap: 6px; }

/* ── Bottom rail (history strip) ──────────────────────────────── */
.studio-rail--bottom {
  background: var(--av-bg-surface-1, #0E1116);
  border-top: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  display: flex; flex-direction: column;
  min-height: 0;
}
.bottom-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
}
.bottom-title {
  margin: 0; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--av-fg-secondary, #9CA3AF);
}
.bottom-head .gallery-controls {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.bottom-head .gallery-search { width: 200px; padding: 6px 10px; font-size: 12px; }
.bottom-head .gallery-filter { padding: 4px 10px; font-size: 11px; }

.bottom-strip {
  flex: 1; min-height: 0;
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  padding: 10px 16px;
  scroll-snap-type: x proximity;
}
.bottom-strip::-webkit-scrollbar { height: 8px; }
.bottom-strip::-webkit-scrollbar-thumb { background: var(--av-line-strong, rgba(255,255,255,0.16)); border-radius: 4px; }

.bottom-strip .gallery-empty-msg {
  margin: auto; opacity: 0.6; font-size: 13px;
}
.bottom-strip .gallery-card {
  flex: 0 0 160px; height: 100%;
  scroll-snap-align: start;
  display: flex; flex-direction: column;
}
.bottom-strip .gallery-card-preview {
  flex: 1; min-height: 0; background: var(--av-bg-surface-2, #14181F);
}
.bottom-strip .gallery-card-preview img,
.bottom-strip .gallery-card-preview model-viewer {
  width: 100%; height: 100%; object-fit: cover;
}

/* ── [hidden] override for dynamically-styled elements ───────── */
.viewer-empty[hidden],
.studio-meta[hidden] { display: none; }

/* ── Gallery card interaction ─────────────────────────────────── */
.gallery-card {
  cursor: pointer;
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.gallery-card:hover,
.gallery-card:focus-visible {
  border-color: var(--av-accent-cyan, #18D2FF);
  transform: translateY(-2px);
  outline: none;
}
.gallery-card-preview {
  display: flex; align-items: center; justify-content: center;
}

/* ── Field utilities (prompt/rail form controls) ──────────────── */
.studio-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--av-fg-secondary, #9CA3AF);
  margin-bottom: 5px;
}
.studio-textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}
.studio-textarea--sm { min-height: 60px; }
.studio-select { width: 100%; }
.studio-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 6px 0;
  -webkit-user-select: none;
  user-select: none;
}

/* kbd hint in empty state */
.viewer-empty-sub kbd {
  background: var(--av-bg-surface-2, #14181F);
  border: 1px solid var(--av-line-strong, rgba(255,255,255,0.16));
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--av-font-mono, monospace);
}

/* Wireframe button active state */
.viewer-actions .btn.active {
  background: var(--av-accent-cyan, #18D2FF);
  color: var(--av-bg-canvas, #090B0F);
  border-color: var(--av-accent-cyan, #18D2FF);
}

/* ── Responsive: collapse to single column on narrow screens ─── */
@media (max-width: 880px) {
  .studio-body {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 280px 200px;
    grid-template-areas:
      "topbar"
      "stage"
      "rail"
      "bottom";
  }
  .studio-rail--left { border-right: 0; border-top: 1px solid var(--av-line-soft, rgba(255,255,255,0.08)); }
  .studio-modes button { padding: 6px 10px; font-size: 12px; }
  .studio-meta.viewer-meta { max-width: 90%; font-size: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Full Parity v2 additions: GEN-01/02/03, POST-01/02, ACC-01, ONB-01
   ═══════════════════════════════════════════════════════════════════ */

/* ── Progress bar ─────────────────────────────────────────────────── */
.progress {
  width: 100%;
  height: 4px;
  background: var(--av-bg-surface-2, #14181F);
  border-radius: 9999px;
  overflow: hidden;
}

/* ── Token pill (ACC-01) ──────────────────────────────────────────── */
.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--av-bg-surface-2, #14181F);
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  border-radius: 9999px;
  font-size: 12px;
  font-family: var(--av-font-mono, monospace);
  color: var(--av-fg-secondary, #9CA3AF);
  white-space: nowrap;
}
.token-pill[hidden] { display: none; }
.token-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--av-accent-cyan, #18D2FF);
  flex-shrink: 0;
}

/* ── Input type tabs (GEN-01/02/03) ──────────────────────────────── */
.input-type-tabs {
  display: flex;
  background: var(--av-bg-surface-2, #14181F);
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  border-radius: 7px;
  padding: 3px;
  margin-bottom: 12px;
}
.input-tab {
  flex: 1;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--av-fg-secondary, #9CA3AF);
  padding: 5px 10px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.input-tab:hover { color: var(--av-fg-primary, #E6EAF2); }
.input-tab.active,
.input-tab[aria-selected="true"] {
  background: var(--av-bg-surface-3, #1A1F28);
  color: var(--av-fg-primary, #E6EAF2);
  box-shadow: 0 0 0 1px var(--av-line-strong, rgba(255,255,255,0.16));
}

/* ── Input sub-panes ─────────────────────────────────────────────── */
.input-sub-pane { display: none; }
.input-sub-pane.active { display: block; }

/* ── Preset grid (GEN-01) ────────────────────────────────────────── */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.preset-btn {
  appearance: none;
  background: var(--av-bg-surface-2, #14181F);
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  border-radius: 6px;
  color: var(--av-fg-secondary, #9CA3AF);
  font-family: inherit;
  font-size: 11px;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.preset-btn:hover {
  background: var(--av-bg-surface-3, #1A1F28);
  border-color: var(--av-accent-cyan, #18D2FF);
  color: var(--av-fg-primary, #E6EAF2);
}
.preset-btn:active { transform: scale(0.97); }

/* ── Image drop-zone (GEN-02) ────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 1.5px dashed var(--av-line-strong, rgba(255,255,255,0.18));
  border-radius: 10px;
  background: var(--av-bg-surface-2, #14181F);
  min-height: 140px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--av-accent-cyan, #18D2FF);
  background: rgba(24,210,255,0.04);
  outline: none;
}
.drop-zone.drag-over {
  border-color: var(--av-accent-cyan, #18D2FF);
  background: rgba(24,210,255,0.08);
  box-shadow: 0 0 0 2px rgba(24,210,255,0.2);
}
.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  pointer-events: none;
  color: var(--av-fg-tertiary, #6B7280);
  transition: opacity 0.15s;
}
.drop-zone.has-image .drop-zone-inner { display: none; }
.drop-zone-label { font-size: 13px; color: var(--av-fg-secondary, #9CA3AF); }
.drop-zone-hint  { font-size: 11px; line-height: 1.5; }

.drop-zone-preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 6px;
}
.drop-zone-preview[hidden] { display: none; }

.drop-zone-clear {
  position: absolute;
  top: 6px; right: 6px;
  appearance: none;
  background: rgba(9,11,15,0.72);
  border: 1px solid var(--av-line-strong, rgba(255,255,255,0.16));
  color: var(--av-fg-secondary, #9CA3AF);
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background 0.12s;
}
.drop-zone-clear[hidden] { display: none; }
.drop-zone-clear:hover { background: rgba(239,68,68,0.4); color: #fff; }

/* ── Multi-view grid (GEN-03) ────────────────────────────────────── */
.mv-hint {
  font-size: 11px;
  color: var(--av-fg-tertiary, #6B7280);
  margin: 0 0 10px;
}
.multiview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mv-slot {
  position: relative;
  aspect-ratio: 1;
  border: 1.5px dashed var(--av-line-strong, rgba(255,255,255,0.18));
  border-radius: 8px;
  background: var(--av-bg-surface-2, #14181F);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.mv-slot:hover,
.mv-slot:focus-visible {
  border-color: var(--av-accent-cyan, #18D2FF);
  outline: none;
}
.mv-slot.drag-over {
  border-color: var(--av-accent-cyan, #18D2FF);
  background: rgba(24,210,255,0.08);
}
.mv-slot.has-image { border-style: solid; border-color: var(--av-line-strong, rgba(255,255,255,0.22)); cursor: grab; }
.mv-slot.mv-dragging { opacity: 0.4; cursor: grabbing; }
.mv-slot.mv-drop-target {
  border-color: var(--av-accent-cyan, #18D2FF);
  background: rgba(24,210,255,0.1);
  box-shadow: inset 0 0 0 2px rgba(24,210,255,0.35);
}
.mv-slot-empty {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11px; color: var(--av-fg-tertiary, #6B7280);
  pointer-events: none;
}
.mv-slot-empty[hidden] { display: none; }
.mv-slot-preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.mv-slot-preview[hidden] { display: none; }
.mv-slot-clear {
  position: absolute;
  top: 4px; right: 4px;
  appearance: none;
  background: rgba(9,11,15,0.7);
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.1));
  color: var(--av-fg-secondary, #9CA3AF);
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  transition: background 0.1s;
}
.mv-slot-clear[hidden] { display: none; }
.mv-slot-clear:hover { background: rgba(239,68,68,0.5); color: #fff; }

/* ── Rig info panel (POST-01) ────────────────────────────────────── */
.rig-panel {
  margin-top: 14px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(24,210,255,0.06), rgba(168,85,247,0.04));
  border: 1px solid rgba(24,210,255,0.2);
  border-radius: 8px;
}
.rig-panel[hidden] { display: none; }
.rig-panel-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--av-accent-cyan, #18D2FF);
  margin-bottom: 4px;
}
.rig-panel-body {
  font-size: 12px; color: var(--av-fg-primary, #E6EAF2); line-height: 1.5;
}

/* Meta overlay rig rows */
#studio-rig-row[hidden],
#studio-bones-row[hidden],
#studio-anim-row[hidden] { display: none; }

/* ── Engine export buttons (POST-02) ─────────────────────────────── */
#studio-engine-export-btns[hidden] { display: none; }

.engine-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 4px;
}
.engine-dl-btn {
  flex: 1;
  min-width: 60px;
  font-size: 11px;
  padding: 6px 8px;
  white-space: nowrap;
  border-color: var(--av-accent-cyan, #18D2FF) !important;
  color: var(--av-accent-cyan, #18D2FF) !important;
}
.engine-dl-btn:hover {
  background: var(--av-accent-cyan, #18D2FF) !important;
  color: var(--av-bg-canvas, #090B0F) !important;
}

/* ── Onboarding modal (ONB-01) ───────────────────────────────────── */
.onboard-overlay {
  position: fixed; inset: 0;
  background: rgba(9,11,15,0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.onboard-overlay[hidden] { display: none; }
.onboard-modal {
  position: relative;
  background: var(--av-bg-surface-1, #0E1116);
  border: 1px solid var(--av-line-strong, rgba(255,255,255,0.16));
  border-radius: 14px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.onboard-close {
  position: absolute; top: 14px; right: 14px;
  appearance: none;
  background: transparent;
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  color: var(--av-fg-secondary, #9CA3AF);
  border-radius: 50%;
  width: 26px; height: 26px;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.12s;
}
.onboard-close:hover { background: var(--av-bg-surface-3, #1A1F28); color: var(--av-fg-primary); }
.onboard-heading {
  margin: 0 0 6px;
  font-size: 20px;
  font-family: var(--av-font-display, inherit);
  color: var(--av-fg-primary, #E6EAF2);
}
.onboard-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--av-fg-secondary, #9CA3AF);
  line-height: 1.5;
}
.onboard-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.onboard-example {
  appearance: none;
  text-align: left;
  background: var(--av-bg-surface-2, #14181F);
  border: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  border-radius: 8px;
  color: var(--av-fg-primary, #E6EAF2);
  padding: 10px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color 0.14s, background 0.14s;
}
.onboard-example:hover {
  border-color: var(--av-accent-cyan, #18D2FF);
  background: rgba(24,210,255,0.05);
}
.onboard-example strong { font-size: 12px; font-weight: 600; }
.onboard-example span  { font-size: 11px; color: var(--av-fg-secondary, #9CA3AF); line-height: 1.4; }

/* ── Responsive: update for new elements ─────────────────────────── */
@media (max-width: 880px) {
  .preset-grid       { grid-template-columns: 1fr 1fr 1fr; }
  .onboard-examples  { grid-template-columns: 1fr; }
  .onboard-modal     { padding: 20px; }
  .multiview-grid    { gap: 6px; }
  .engine-btn-row    { gap: 4px; }
  .engine-dl-btn     { font-size: 10px; padding: 5px 6px; }
  .token-pill        { font-size: 11px; padding: 3px 8px; }
}

/* ═══════════════════════════════════════════════════════════════════
   POL-01 — Visual polish pass
   ═══════════════════════════════════════════════════════════════════ */

/* ── Generate button (primary CTA) ──────────────────────────────── */
#studio-generate-btn {
  background: linear-gradient(135deg, var(--av-accent-cyan, #18D2FF), #0BBCE6) !important;
  border: none !important;
  color: #090B0F !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow:
    0 0 0 1px rgba(24,210,255,0.35),
    0 4px 18px rgba(24,210,255,0.22);
  transition:
    transform    150ms cubic-bezier(0.16,1,0.3,1),
    box-shadow   150ms cubic-bezier(0.16,1,0.3,1),
    background   150ms cubic-bezier(0.16,1,0.3,1);
}
#studio-generate-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #28DEFF, #18D2FF) !important;
  box-shadow:
    0 0 0 1px rgba(24,210,255,0.55),
    0 0 22px rgba(24,210,255,0.3),
    0 6px 24px rgba(24,210,255,0.18) !important;
  transform: translateY(-1px);
}
#studio-generate-btn:not(:disabled):active { transform: translateY(0); }
#studio-generate-btn:disabled { opacity: 0.45; transform: none; cursor: not-allowed; }

/* ── Progress bar — animated shimmer while running ───────────────── */
@keyframes av-shimmer {
  0%   { opacity: 1; }
  50%  { opacity: 0.65; }
  100% { opacity: 1; }
}
#studio-progress-bar { animation: av-shimmer 1.6s ease-in-out infinite; }

/* ── Form control focus rings ────────────────────────────────────── */
.studio-textarea:focus,
.studio-select:focus,
#studio-history-search:focus {
  outline: none;
  border-color: var(--av-accent-cyan, #18D2FF) !important;
  box-shadow:
    0 0 0 1px rgba(24,210,255,0.3),
    inset 0 1px 0 rgba(0,0,0,0.15);
}

/* ── Studio topbar — subtle gradient + depth ─────────────────────── */
.studio-topbar {
  background: linear-gradient(
    90deg,
    var(--av-bg-surface-1, #0E1116),
    rgba(23,30,39,0.97) 50%,
    var(--av-bg-surface-1, #0E1116)
  ) !important;
  box-shadow: 0 1px 0 var(--av-line-soft, rgba(255,255,255,0.08)),
              0 4px 20px rgba(0,0,0,0.22);
}

/* ── Mode tab active — thin cyan indicator bar ───────────────────── */
.studio-modes button { position: relative; }
.studio-modes button.active::after,
.studio-modes button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--av-accent-cyan, #18D2FF);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(24,210,255,0.6);
}

/* ── Meta overlay — improved glassmorphism ───────────────────────── */
.studio-meta.viewer-meta {
  background: rgba(17,22,29,0.84) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.5) !important;
  backdrop-filter: blur(14px) saturate(1.5) !important;
  border: 1px solid rgba(52,70,88,0.9) !important;
  box-shadow: 0 4px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ── Viewer action buttons — glassmorphism treatment ─────────────── */
.studio-actions.viewer-actions .btn {
  background: rgba(17,22,29,0.82);
  color: var(--av-fg-primary, #EEF4FA);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-color: var(--av-line-strong, rgba(255,255,255,0.16)) !important;
  transition:
    background  150ms cubic-bezier(0.16,1,0.3,1),
    border-color 150ms cubic-bezier(0.16,1,0.3,1),
    box-shadow  150ms cubic-bezier(0.16,1,0.3,1);
}
.studio-actions.viewer-actions .btn:hover {
  background: rgba(24,210,255,0.1);
  border-color: var(--av-accent-cyan, #18D2FF) !important;
  box-shadow: 0 0 0 1px rgba(24,210,255,0.2);
}

/* ── Gallery cards — cyan glow on hover ──────────────────────────── */
.gallery-card {
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.gallery-card:hover,
.gallery-card:focus-visible {
  border-color: var(--av-accent-cyan, #18D2FF);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(24,210,255,0.3), 0 6px 24px rgba(24,210,255,0.1);
  outline: none;
}

/* ── Rail left — subtle inner shadow + scrollbar ─────────────────── */
.studio-rail--left {
  box-shadow: inset -1px 0 0 var(--av-line-soft, rgba(255,255,255,0.08));
}
.rail-scroll::-webkit-scrollbar { width: 4px; }
.rail-scroll::-webkit-scrollbar-thumb {
  background: var(--av-line-strong, rgba(255,255,255,0.16));
  border-radius: 999px;
}
.rail-scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Brand mark — gradient ───────────────────────────────────────── */
.studio-brand .brand-mark {
  background: linear-gradient(
    135deg,
    var(--av-accent-cyan, #18D2FF),
    var(--av-accent-purple, #8B5CF6)
  ) !important;
  box-shadow: 0 0 10px rgba(24,210,255,0.25);
}

/* ── Bottom strip scrollbar ──────────────────────────────────────── */
.bottom-strip::-webkit-scrollbar { height: 4px; }
.bottom-strip::-webkit-scrollbar-thumb {
  background: var(--av-line-strong, rgba(255,255,255,0.16));
  border-radius: 999px;
}

/* ── Validation summary strip (POST-03) ──────────────────────────── */
#studio-validation-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px 0 2px;
  font-size: 11px;
  font-family: var(--av-font-mono, monospace);
  color: var(--av-fg-secondary, #9CA3AF);
  border-top: 1px solid var(--av-line-soft, rgba(255,255,255,0.08));
  margin-top: 6px;
}
#studio-validation-strip[hidden] { display: none; }
.vstrip-ok  { color: var(--av-state-success, #37D67A); font-weight: 600; }
.vstrip-key { color: var(--av-fg-tertiary, #738398); }

/* ── Responsive POL-02 additions ─────────────────────────────────── */
@media (max-width: 880px) {
  .studio-actions.viewer-actions {
    gap: 5px;
    bottom: 10px;
    right: 10px;
  }
  .studio-actions.viewer-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .studio-meta.viewer-meta {
    font-size: 10px;
    padding: 8px 10px;
    gap: 4px 10px;
  }
  #studio-generate-btn { font-size: 13px; }
}
@media (max-width: 640px) {
  .studio-modes { display: none; }
  .studio-topright .token-pill { display: none; }
}

/* ── Phone (≤480px): compact studio layout ───────────────────── */
@media (max-width: 480px) {
  .studio-body {
    grid-template-rows: 48px 1fr 180px 160px;
  }
  .studio-rail--left { width: auto; }
  .rail-scroll { padding: 10px; }
  .studio-topbar { padding: 0 8px; gap: 4px; }
  .studio-tag { display: none; }
  .studio-meta.viewer-meta { display: none; }
  .studio-actions.viewer-actions { bottom: 6px; right: 6px; gap: 4px; }
  .studio-actions.viewer-actions .btn { padding: 4px 7px; font-size: 10px; }
  .bottom-head .gallery-search { width: 110px; }
  .bottom-head .gallery-filter { display: none; }
  .onboard-modal { padding: 16px; margin: 8px; }
}
