@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Space+Grotesk:wght@400;500;600;700&display=swap');

html[data-vmax-gate="pending"] body {
  visibility: hidden;
}

:root {
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-text: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --st-accent: var(--color-primary);
  --st-accent-soft: color-mix(in srgb, var(--color-primary) 18%, transparent);
  --st-on-accent: #fff;
  --st-fill: var(--st-accent);
}

.studio-app[data-family="wan"] {
  --st-accent: #7EB0F5;
  --st-accent-soft: rgba(126, 176, 245, .16);
  --st-on-accent: #fff;
  --st-fill: linear-gradient(100deg, #6BA3F0 0%, #8BB4F2 40%, #B08AD9 78%, #9A7BC8 100%);
}
.studio-app[data-tone="dawn"] {
  --st-accent: #c8c0f0;
  --st-accent-soft: rgba(244, 180, 208, .18);
  --st-on-accent: #2a2a2a;
  --st-fill: linear-gradient(90deg, #f6b8d4 0%, #f8d0b8 22%, #f3e8c0 42%, #ccead8 62%, #c4e4f4 82%, #e8e4f6 100%);
}
.studio-app[data-tone="hot"] {
  --st-accent: #ff6a2e;
  --st-accent-soft: rgba(255, 106, 46, .16);
  --st-on-accent: #fff;
  --st-fill: linear-gradient(100deg, #ff6a2e 0%, #ff3d2e 100%);
}
.studio-app[data-tone="fast"] {
  --st-accent: #f0c93a;
  --st-accent-soft: rgba(240, 201, 58, .2);
  --st-on-accent: #2a2408;
  --st-fill: linear-gradient(100deg, #f6d34a 0%, #e8bc22 100%);
}
.studio-app[data-tone="mini"] {
  --st-accent: #efe6c4;
  --st-accent-soft: rgba(239, 230, 196, .22);
  --st-on-accent: #3a3420;
  --st-fill: linear-gradient(180deg, #f8f4e4 0%, #efe6c4 100%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.studio-app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.st-side {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 12px;
  background: var(--color-surface-1);
  border-right: 1px solid var(--color-hairline);
  position: sticky; top: 0; align-self: start;
  height: 100vh; max-height: 100vh;
  overflow: hidden;
}
.st-nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-height: 0;
  overflow: auto;
}
.st-group { display: flex; flex-direction: column; gap: 2px; }
.st-group + .st-group { margin-top: 10px; }
.st-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin: 0; padding: 6px 8px 4px 10px;
  background: none; border: 0; border-radius: 6px;
  font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-ink-tertiary);
}
.st-group-toggle:hover { color: var(--color-ink-subtle); background: var(--color-surface-2); }
.st-group-label { min-width: 0; text-align: left; }
.st-group-chevron {
  width: 12px; height: 12px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.st-group.is-collapsed .st-group-chevron { transform: rotate(-90deg); }
.st-group-items {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1), opacity .22s ease;
}
.st-group.is-collapsed .st-group-items {
  grid-template-rows: 0fr;
  opacity: 0;
}
.st-group-items-clip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}
.st-group.has-on .st-group-toggle { color: var(--color-ink-subtle); }
.st-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 16px;
  flex: none;
}
.st-brand .lg {
  width: 24px; height: 24px; flex: none;
  background: linear-gradient(135deg, var(--color-primary), #b7a6ff);
  -webkit-mask: url("../assets/icon-video-platform.svg") center / contain no-repeat;
  mask: url("../assets/icon-video-platform.svg") center / contain no-repeat;
}
.st-brand b { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.st-ni {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--color-ink-subtle);
}
button.st-ni {
  width: 100%;
  margin: 0;
  background: none;
  border: 0;
  text-align: left;
}
.st-ni svg { width: 15px; height: 15px; flex: none; }
.st-ni svg.st-ni-brand { width: 16px; height: 16px; }
.st-ni svg:not(.st-ni-brand) { stroke: currentColor; fill: none; }
.st-ni:hover { color: var(--color-ink); background: var(--color-surface-2); }
.st-ni.on { background: var(--color-surface-3); color: var(--color-ink); }
.st-ni.on svg:not(.st-ni-brand) { stroke: var(--st-accent); }
.st-ni-brand { overflow: visible; }
.st-badge {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 8px; padding: 2px 6px; border-radius: 999px;
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  line-height: 1.2; text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, #ffffff 0%, #6b6b6b 50%, #000000 100%);
  -webkit-text-stroke: 0.35px rgba(0, 0, 0, .55);
  text-shadow: 0 0 2px rgba(0, 0, 0, .9);
  vertical-align: 1px;
}
.st-ni .st-badge { margin-left: auto; flex: none; vertical-align: 0; }
.st-ni.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
  align-items: flex-start;
}
.st-ni.is-disabled:hover { background: none; color: var(--color-ink-tertiary); }
.st-ni-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.25; }
.st-ni-note { font-size: 10px; color: var(--color-ink-tertiary); }
.st-side-foot {
  margin-top: 0; padding: 10px 8px 4px; flex: none;
  background: var(--color-surface-1);
  border-top: 1px solid var(--color-hairline-tertiary);
}
.st-account { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.st-account-link {
  display: block; padding: 7px 8px; border-radius: 8px;
  font-size: 12px; color: var(--color-ink-subtle);
}
.st-account-link:hover { color: var(--color-ink); background: var(--color-surface-2); }
.st-side .foot {
  display: block; padding: 7px 8px;
  font-size: 12px; color: var(--color-ink-tertiary);
}
.st-side .foot:hover { color: var(--color-ink-subtle); }

.st-shell { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.st-top {
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 20px;
  border-bottom: 1px solid var(--color-hairline);
  background: color-mix(in srgb, var(--color-canvas) 86%, transparent);
}
.st-top h1 {
  margin: 0; font-family: var(--font-text); font-size: 15px; font-weight: 600;
  letter-spacing: -.2px;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.st-top h1 .st-badge { margin-left: 0; flex: none; }
.st-top .model-id {
  font-family: var(--font-mono); font-size: 11px; color: var(--color-ink-tertiary);
}
.st-modes:empty { display: none; margin: 0; }
.st-mode-fold { display: flex; flex-direction: column; gap: 2px; }
.st-mode-fold + .st-mode-fold { margin-top: 4px; }
.st-mode-row { display: flex; align-items: center; gap: 2px; }
.st-mode-arrow {
  width: 22px; height: 28px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0; padding: 0;
  border: 0; border-radius: 6px;
  background: none;
  color: var(--color-ink-tertiary);
}
.st-mode-arrow:hover { color: var(--color-ink); background: var(--color-surface-2); }
.st-mode-arrow svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.st-mode-fold.is-collapsed .st-mode-arrow svg { transform: rotate(-90deg); }
.st-mode-models {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1), opacity .22s ease;
}
.st-mode-fold.is-collapsed .st-mode-models {
  grid-template-rows: 0fr;
  opacity: 0;
}
.st-mode-models-clip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
  padding-left: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .st-mode-models,
  .st-mode-arrow svg,
  .st-group-items,
  .st-group-chevron { transition: none; }
}
.st-mode {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500;
  color: var(--color-ink-subtle);
}
.st-mode:hover { color: var(--color-ink); background: var(--color-surface-2); }
.st-mode.on {
  color: var(--color-ink);
  background: var(--color-surface-2);
  border-color: var(--color-hairline);
}
.st-top .grow { flex: 1; }
.st-key {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 999px;
  padding: 4px 10px 4px 12px;
  min-width: 0;
}
.st-key select {
  max-width: 220px;
  border: 0; background: transparent; outline: none;
  font-size: 12px; color: var(--color-ink-muted);
  cursor: pointer;
}
.st-key input {
  width: 168px; border: 0; background: transparent; outline: none;
  font-family: var(--font-mono); font-size: 12px; color: var(--color-ink-muted);
}
.st-key input::placeholder { color: var(--color-ink-tertiary); }
.st-key select[hidden],
.st-key input[hidden] { display: none; }
.st-signin {
  font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: 999px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
}
.st-signin:hover { border-color: var(--color-hairline-strong); }
.st-signin.is-in {
  background: color-mix(in srgb, #5fd07a 16%, var(--color-surface-1));
  border-color: color-mix(in srgb, #5fd07a 35%, var(--color-hairline));
}
.st-theme { position: relative; flex: none; }
.st-theme-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 248px;
  padding: 6px;
  border-radius: 12px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  box-shadow: 0 12px 32px color-mix(in srgb, #000 18%, transparent);
  z-index: 40;
}
.st-theme-menu[hidden] { display: none; }
.st-theme-item {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-ink);
  text-align: left;
  cursor: pointer;
}
.st-theme-item svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.st-theme-item b { display: block; font-size: 13px; font-weight: 600; }
.st-theme-item span { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--color-ink-tertiary); }
.st-theme-item:hover { background: color-mix(in srgb, var(--color-ink) 6%, transparent); }
.st-theme-item.on { background: color-mix(in srgb, var(--color-primary) 16%, var(--color-surface-1)); }
.st-theme-note {
  margin: 4px 2px 2px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--color-hairline);
  font-size: 12px;
  color: var(--color-ink-tertiary);
}
.st-lang { position: relative; flex: none; }
.st-lang-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border-radius: 999px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  color: var(--color-ink-muted);
  cursor: pointer;
}
.st-lang-btn:hover,
.st-lang-btn[aria-expanded="true"] {
  border-color: var(--color-hairline-strong);
  color: var(--color-ink);
}
.st-lang-btn svg { width: 18px; height: 18px; display: block; }
.st-lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  box-shadow: 0 12px 32px color-mix(in srgb, #000 16%, transparent);
  z-index: 40;
}
.st-lang-menu[hidden] { display: none; }
.st-lang-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-ink);
  cursor: pointer;
  text-align: left;
}
.st-lang-item:hover { background: color-mix(in srgb, var(--color-ink) 6%, transparent); }
.st-lang-item.on { font-weight: 600; }
.st-lang-item.on::after {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  margin-left: 8px;
}
.st-model-switch { display: none; }

.st-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.05fr);
}
.st-body-single { grid-template-columns: 1fr; }
.st-form {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 22px 18px;
  border-right: 1px solid var(--color-hairline);
  overflow: auto;
}
.st-preview {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px;
  overflow: auto;
}

.modes {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.modes button {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-1);
  color: var(--color-ink-subtle);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px; font-weight: 500;
}
.modes button.on {
  color: var(--st-on-accent);
  background: var(--st-fill);
  border-color: transparent;
}

.fld { display: flex; flex-direction: column; gap: 8px; }
.fld select {
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 8px 10px;
}
.fld[hidden] { display: none; }
.fld label, .drop-title {
  font-size: 12.5px; font-weight: 500; color: var(--color-ink-muted);
}
.fld .hint { font-size: 11px; color: var(--color-ink-tertiary); font-weight: 400; }
.prompt-head {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
}
.prompt-head label { margin: 0; }
.prompt-apply-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--color-ink-tertiary);
}
.prompt-apply-hint[hidden] { display: none; }
.prompt-help-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-2);
  color: var(--color-ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.prompt-help-open svg { width: 12px; height: 12px; flex: none; }
.prompt-help-open:hover { color: var(--color-ink); background: var(--color-surface-3); }
.prompt-help {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.prompt-help[hidden] { display: none; }
.prompt-help-backdrop {
  position: absolute; inset: 0;
  border: 0; padding: 0;
  background: rgba(0, 0, 0, .55);
}
.prompt-help-card {
  position: relative; z-index: 1;
  width: min(1080px, 100%);
  height: min(92vh, 820px);
  max-height: min(92vh, 820px);
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.prompt-help-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 14px;
  flex-wrap: wrap;
}
.prompt-help-head-copy {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; flex: 0 1 auto;
}
.prompt-help-search {
  display: block;
  width: 188px;
  margin: 0;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  padding: 7px 10px;
  outline: none;
  font-size: 13px;
  color: var(--color-ink);
}
.prompt-help-search:focus { border-color: var(--st-accent); }
.prompt-help-search[hidden] { display: none; }
.prompt-help-empty {
  margin: 8px 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--color-ink-muted);
}
.prompt-help-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--color-ink);
  white-space: nowrap;
}
.prompt-help-lead {
  margin: 6px 0 0;
  max-width: 52ch;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-ink-muted);
}
.prompt-help-cats {
  display: flex; gap: 8px; flex-wrap: wrap;
  flex: 1 1 280px;
  justify-content: flex-end;
}
.prompt-help-cats button {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-1);
  color: var(--color-ink-subtle);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 500;
}
.prompt-help-cats button.on {
  color: var(--st-on-accent);
  background: var(--st-fill);
  border-color: transparent;
}
.prompt-help-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.prompt-help-rail {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 2px;
}
.prompt-help-samples {
  display: flex; flex-direction: column; gap: 8px;
}
.prompt-help-samples[hidden] { display: none; }
.prompt-help-pick {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--color-hairline);
  border-radius: 12px;
  background: var(--color-surface-1);
  text-align: left;
}
.prompt-help-pick:hover { border-color: var(--st-accent); }
.prompt-help-pick.on {
  border-color: var(--st-accent);
  background: var(--st-accent-soft);
}
.prompt-help-thumb {
  position: relative;
  display: block;
  height: 56px;
  border-radius: 8px;
  background:
    radial-gradient(120% 80% at 18% 12%, rgba(255,255,255,.28), transparent 46%),
    linear-gradient(160deg, color-mix(in srgb, var(--tone, #243044) 55%, white) 0%, var(--tone, #182033) 100%);
  overflow: hidden;
}
.prompt-help-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prompt-help-thumb::after {
  content: '';
  position: absolute; right: 8px; top: 8px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent rgba(255,255,255,.85);
}
.prompt-help-ratio {
  position: absolute; left: 6px; bottom: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.prompt-help-card-title {
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.35;
}
.prompt-help-custom {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
}
.prompt-help-custom[hidden] { display: none; }
.prompt-help-custom label,
.prompt-help-draft-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-ink-muted);
}
#prompt-help-story,
#prompt-help-draft {
  width: 100%;
  resize: vertical;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  padding: 12px;
  outline: none;
  font-size: 13.5px;
  line-height: 1.5;
}
#prompt-help-story { min-height: 240px; flex: 1 1 auto; }
.prompt-help-draft-stack,
.prompt-help-polish {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
}
.prompt-help-draft-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#prompt-help-draft {
  min-height: 0;
  flex: 1 1 auto;
  resize: none;
  overflow-y: auto;
  cursor: text;
}
.prompt-help-polish {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 220px;
  border: 1px solid var(--color-hairline);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-surface-1) 88%, #1a1630);
  overflow: visible;
}
.prompt-help-polish.collapsed {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}
.prompt-help-polish.collapsed .prompt-help-polish-body,
.prompt-help-polish.collapsed .prompt-help-polish-actions,
.prompt-help-polish.collapsed .prompt-help-polish-err { display: none; }
.prompt-help-polish.collapsed .prompt-help-polish-bar { border-bottom: 0; }
.prompt-help-polish-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-hairline);
  flex: 0 0 auto;
  min-width: 0;
}
.prompt-help-polish-spark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: none;
  background: var(--st-fill);
}
.prompt-help-polish-bar strong {
  font-size: 13px;
  font-weight: 600;
}
.prompt-help-polish-grow { flex: 1; min-width: 0; }
.prompt-help-polish-link {
  border: 0;
  background: none;
  color: var(--color-ink-subtle);
  font-size: 12px;
  padding: 4px 0;
}
.prompt-help-polish-run-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
  z-index: 3;
}
.prompt-help-polish-run {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--st-fill);
  color: var(--st-on-accent);
}
.prompt-help-polish-run[disabled] { opacity: .55; cursor: default; }
.prompt-help-polish-models {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: min(320px, 72vw);
  max-height: min(320px, 72vh);
  z-index: 60;
}
.prompt-help-polish-models::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16px;
  left: -16px;
}
.prompt-help-polish-models.is-left::before {
  left: auto;
  right: -16px;
}
.prompt-help-polish-run-wrap:hover .prompt-help-polish-models,
.prompt-help-polish-run-wrap:focus-within .prompt-help-polish-models,
.prompt-help-polish-run-wrap.is-open .prompt-help-polish-models {
  display: flex;
  flex-direction: column;
}
.prompt-help-polish-models-card {
  border: 1px solid var(--color-hairline);
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-canvas) 90%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 48px color-mix(in srgb, #000 30%, transparent), 0 2px 8px color-mix(in srgb, #000 18%, transparent);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: inherit;
  animation: prompt-help-polish-models-in .16s ease;
}
@keyframes prompt-help-polish-models-in {
  from { opacity: 0; transform: translateY(4px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.prompt-help-polish-models-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  padding: 0 6px;
}
.prompt-help-polish-models-search {
  width: 100%;
  margin: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--color-ink);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.prompt-help-polish-models-search:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 3px var(--st-accent-soft);
}
.prompt-help-polish-models-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prompt-help-polish-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-ink);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.prompt-help-polish-model:hover,
.prompt-help-polish-model:focus-visible {
  background: color-mix(in srgb, var(--color-ink) 6%, transparent);
}
.prompt-help-polish-model.on {
  border-color: color-mix(in srgb, var(--st-accent) 45%, transparent);
  background: var(--st-accent-soft);
  color: var(--st-accent);
  font-weight: 600;
}
.prompt-help-polish-model.on::after {
  content: '';
  width: 5px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  flex: none;
}
.prompt-help-polish-model-id {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prompt-help-polish-models-empty,
.prompt-help-polish-models-loading {
  margin: 0;
  padding: 12px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--color-ink-muted);
}
.prompt-help-polish-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
  font-size: 13.5px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  white-space: pre-wrap;
}
.prompt-help-polish-extra {
  margin: 0;
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--color-ink);
  font-size: 13px;
  font-family: inherit;
  resize: none;
  flex: 1 1 auto;
  min-height: 72px;
}
.prompt-help-polish-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-ink-muted);
  font-size: 13px;
}
.prompt-help-polish-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8c0f0;
  animation: prompt-help-polish-pulse 1s ease-in-out infinite;
}
@keyframes prompt-help-polish-pulse {
  50% { opacity: .35; transform: scale(.85); }
}
.prompt-help-polish-err {
  margin: 0;
  padding: 0 12px 8px;
  color: #e06666;
  font-size: 12px;
  line-height: 1.4;
}
.prompt-help-polish-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0;
}
.prompt-help-polish-actions button {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-1);
  color: var(--color-ink-subtle);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.prompt-help-polish-actions button.on {
  border: 0;
  background: var(--st-fill);
  color: var(--st-on-accent);
}
.prompt-help-polish-run[hidden],
.prompt-help-polish-run-wrap[hidden],
.prompt-help-polish-link[hidden],
.prompt-help-polish-err[hidden],
.prompt-help-polish-actions[hidden] { display: none !important; }
#prompt-help-story:focus,
#prompt-help-draft:focus { border-color: var(--st-accent); }
.prompt-help-detail {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.prompt-help-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  flex: 0 0 auto;
  height: 267px;
}
.prompt-help-hero-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}
.prompt-help-ref {
  position: relative;
  width: 150px;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #12141c;
  border: 1px solid var(--color-hairline);
}
.prompt-help-ref video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.prompt-help-ref-tag {
  position: absolute; left: 8px; bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 12, 16, .62);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}
.prompt-help-ref-note {
  display: none;
}
.prompt-help-copy h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-ink);
}
.prompt-help-tip {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-ink-muted);
}
.prompt-help-params {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--color-ink-tertiary);
}
.prompt-help-copy { flex: 0 0 auto; }
.prompt-help-layers {
  display: flex; flex-wrap: nowrap; gap: 6px;
  flex: 0 0 auto;
  overflow-x: auto;
  padding: 3px 2px;
  scrollbar-width: none;
}
.prompt-help-layers::-webkit-scrollbar { display: none; }
.prompt-help-layer {
  border: 0;
  background: var(--color-surface-1);
  color: var(--color-ink-tertiary);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
.prompt-help-layer[data-layer="subject"].on {
  background: #7dd3c7;
  color: #0d3d38;
}
.prompt-help-layer[data-layer="action"].on {
  background: #ff9b73;
  color: #4a1f0d;
}
.prompt-help-layer[data-layer="scene"].on {
  background: #9ad27a;
  color: #1d3a12;
}
.prompt-help-layer[data-layer="light"].on {
  background: #ffd166;
  color: #3a2e08;
}
.prompt-help-layer[data-layer="camera"].on {
  background: #7eb8ff;
  color: #0d2a4a;
}
.prompt-help-layer[data-layer="style"].on {
  background: #c4a3f0;
  color: #2e1848;
}
.prompt-help-layer[data-layer="audio"].on {
  background: #8ee0c8;
  color: #0e3a32;
}
.prompt-help-layer[data-layer="constraint"].on {
  background: #c5c9d1;
  color: #1c2430;
}
.prompt-help-layer:not(.on) {
  opacity: .55;
}
.prompt-help-layer.active {
  box-shadow: 0 0 0 2px rgba(255,255,255,.72);
}
.prompt-help-draft {
  min-height: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-help-seg {
  border-radius: 4px;
  padding: 0 3px;
  margin: 0 1px;
  cursor: text;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.prompt-help-seg[data-seg="subject"] { background: rgba(125, 211, 199, .48); }
.prompt-help-seg[data-seg="action"] { background: rgba(255, 155, 115, .48); }
.prompt-help-seg[data-seg="scene"] { background: rgba(154, 210, 122, .48); }
.prompt-help-seg[data-seg="light"],
.prompt-help-seg[data-seg="style"] { background: rgba(255, 209, 102, .48); }
.prompt-help-seg[data-seg="camera"],
.prompt-help-seg[data-seg="constraint"] { background: rgba(126, 184, 255, .48); }
.prompt-help-seg[data-seg="audio"] { background: rgba(154, 210, 122, .48); }
.prompt-help-seg[hidden] { display: none; }
.prompt-help-user { color: var(--color-ink); }
.prompt-help-picker[data-tint="subject"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="subject"] .prompt-help-opt.on span { color: #7dd3c7; }
.prompt-help-picker[data-tint="action"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="action"] .prompt-help-opt.on span { color: #ff9b73; }
.prompt-help-picker[data-tint="scene"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="scene"] .prompt-help-opt.on span { color: #9ad27a; }
.prompt-help-picker[data-tint="light"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="light"] .prompt-help-opt.on span { color: #ffd166; }
.prompt-help-picker[data-tint="camera"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="camera"] .prompt-help-opt.on span { color: #7eb8ff; }
.prompt-help-picker[data-tint="style"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="style"] .prompt-help-opt.on span { color: #c4a3f0; }
.prompt-help-picker[data-tint="audio"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="audio"] .prompt-help-opt.on span { color: #8ee0c8; }
.prompt-help-picker[data-tint="constraint"] .prompt-help-group-pick,
.prompt-help-picker[data-tint="constraint"] .prompt-help-opt.on span { color: #c5c9d1; }
.prompt-help-picker {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-surface-1) 70%, transparent);
  scrollbar-width: thin;
}
.prompt-help-picker-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.38) rgba(255,255,255,.08);
  padding: 0 8px;
}
.prompt-help-picker-list::-webkit-scrollbar { width: 6px; }
.prompt-help-picker-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.08);
  border-radius: 99px;
}
.prompt-help-picker-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.38);
  border-radius: 99px;
}
.prompt-help-picker-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 0;
  margin: 0;
  padding: 6px 8px 4px;
}
.prompt-help-picker-head:empty { display: none; }
.prompt-help-picker-title {
  flex: 1 1 auto;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-ink-tertiary);
}
.prompt-help-picker-back,
.prompt-help-picker-off {
  border: 0;
  background: none;
  color: var(--color-ink-tertiary);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 0;
  white-space: nowrap;
}
.prompt-help-picker-off {
  margin-left: auto;
}
.prompt-help-picker-back:hover,
.prompt-help-picker-off:hover { color: var(--color-ink); }
.prompt-help-picker-hint,
.prompt-help-picker-empty {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-ink-muted);
}
.prompt-help-group,
.prompt-help-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--color-hairline);
  background: transparent;
  color: var(--color-ink);
  border-radius: 0;
  padding: 8px 2px;
  font-size: 13.5px;
  line-height: 1.3;
  min-height: 0;
  overflow: hidden;
}
.prompt-help-group:last-child,
.prompt-help-opt:last-child { border-bottom: 0; }
.prompt-help-group:hover,
.prompt-help-opt:hover {
  border-color: var(--color-hairline);
  color: var(--color-ink);
}
.prompt-help-opt.on {
  border-color: var(--color-hairline);
  background: transparent;
}
.prompt-help-opt.on span { font-weight: 600; }
.prompt-help-opt.on::after {
  content: '✓';
  flex: none;
  font-size: 12px;
  color: var(--color-ink);
}
.prompt-help-group-name {
  flex: 0 0 auto;
  font-weight: 400;
  color: var(--color-ink-muted);
  min-width: 3.5em;
}
.prompt-help-group-pick {
  min-width: 0;
  flex: 1 1 auto;
  text-align: right;
  color: var(--color-ink);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prompt-help-group::after {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-right: 1.5px solid var(--color-ink-tertiary);
  border-top: 1.5px solid var(--color-ink-tertiary);
  transform: rotate(45deg);
  margin-left: 2px;
}
.prompt-help-opts { display: flex; flex-direction: column; }
.prompt-help-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.prompt-help-actions button {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-1);
  color: var(--color-ink-subtle);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px; font-weight: 500;
}
.prompt-help-actions button.on {
  color: var(--st-on-accent);
  background: var(--st-fill);
  border-color: transparent;
}

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 92px; padding: 14px;
  border: 1px dashed var(--color-hairline-strong);
  border-radius: 12px;
  background: var(--color-surface-1);
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--st-accent); background: var(--st-accent-soft); }
.drop .plus { font-size: 20px; line-height: 1; color: var(--color-ink-subtle); }
.drop p { margin: 0; font-size: 12px; color: var(--color-ink-subtle); }
.drop small { font-size: 11px; color: var(--color-ink-tertiary); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 4px 8px; border-radius: 999px;
  background: var(--color-surface-3);
  border: 1px solid var(--color-hairline);
  font-family: var(--font-mono); font-size: 11px; color: var(--color-ink-muted);
}
.chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chip button {
  border: 0; background: none; color: var(--color-ink-tertiary); padding: 0; line-height: 1;
}
.url-row {
  display: flex; gap: 8px;
}
.url-row input {
  flex: 1; min-width: 0;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.url-row button {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

textarea.prompt {
  width: 100%; min-height: 110px; resize: vertical;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 12px;
  padding: 12px;
  outline: none;
}
textarea.prompt:focus { border-color: var(--st-accent); }
.prompt-meta {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; color: var(--color-ink-tertiary);
}

.params { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.params label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--color-ink-subtle);
}
.params label[hidden] { display: none; }
.params .span-2 { grid-column: 1 / -1; }
.params .param-head {
  display: flex; align-items: baseline; gap: 8px;
  min-height: 1.25em; line-height: 1.25;
}
.params .hint {
  font-size: 11px; color: var(--color-ink-tertiary); font-weight: 400;
  white-space: nowrap;
}
.params select,
.params input[type="number"],
.params input[type="text"],
.params textarea {
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 8px 10px;
  resize: vertical;
}

.gen {
  margin-top: auto;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 15px; font-weight: 600;
  color: var(--st-on-accent);
  background: var(--st-fill);
}
.gen:hover { filter: brightness(1.08); }
.gen:disabled { opacity: .55; cursor: not-allowed; filter: none; }

.stage {
  position: relative;
  flex: 1;
  min-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  background:
    radial-gradient(70% 50% at 78% 22%, rgba(108,177,255,.22) 0%, transparent 58%),
    radial-gradient(60% 45% at 22% 95%, rgba(91,52,245,.28) 0%, transparent 60%),
    linear-gradient(180deg, #050a18 0%, #0b1226 60%, #060812 100%);
}
.studio-app[data-family="wan"] .stage {
  background:
    radial-gradient(70% 50% at 80% 18%, rgba(126,176,245,.28) 0%, transparent 58%),
    radial-gradient(55% 40% at 20% 90%, rgba(75,0,130,.35) 0%, transparent 60%),
    linear-gradient(180deg, #061018 0%, #0a1830 60%, #080614 100%);
}
.stage .mark {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -1px; color: rgba(255,255,255,.88);
  text-shadow: 0 8px 40px rgba(0,0,0,.45);
  pointer-events: none;
}
.stage video, .stage img.frame-in, .stage img.stage-result, .stage img.stage-reference {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.stage audio.stage-audio {
  position: absolute; left: 50%; top: 50%;
  width: min(94%, 820px);
  transform: translate(-50%, -50%);
  z-index: 2;
}
.stage audio.stage-audio[hidden] { display: none; }
.stage audio.stage-audio.is-buffering {
  visibility: hidden;
  pointer-events: none;
}
.stage:has(audio.stage-audio:not([hidden]):not(.is-buffering)) .stage-brand,
.stage:has(audio.stage-audio:not([hidden]):not(.is-buffering)) .mark { display: none; }
.stage img.stage-result,
.stage img.stage-reference { object-fit: contain; background: #000; }
.stage img.stage-result[hidden],
.stage img.stage-reference[hidden] { display: none; }
.stage:has(img.stage-result:not([hidden])) .stage-brand,
.stage:has(img.stage-result:not([hidden])) .mark,
.stage:has(img.stage-reference:not([hidden])) .mark { display: none; }
.stage.busy .stage-reference,
.stage:has(img.stage-result:not([hidden])) .stage-reference { display: none; }
.stage video[hidden], .stage img.frame-in[hidden] { display: none; }
.stage video:not([hidden]), .stage img.frame-in:not([hidden]) { display: block; }
.stage .stage-brand {
  position: absolute; top: 50%; left: 50%;
  width: min(72%, 540px); max-height: 58%;
  transform: translate(-50%, -50%);
  object-fit: contain; object-position: center;
  pointer-events: none; display: none;
  mix-blend-mode: screen;
  clip-path: inset(0 0 5% 0);
  z-index: 1;
}
.stage.busy .stage-brand { display: block; }
.stage.busy .mark { display: none; }
.studio-app[data-page="audio"] .stage .mark { display: none; }
.studio-app[data-page="audio"] .stage .stage-brand { display: block; }
.studio-app[data-page="audio"] .stage:has(audio.stage-audio:not([hidden]):not(.is-buffering)) .stage-brand { display: none; }
.stage:has(video:not([hidden])) .play,
.stage:has(video:not([hidden])) .mark,
.stage:has(video:not([hidden])) .stage-brand { display: none; }
.stage .play {
  position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%;
  display: none; place-items: center;
  background: color-mix(in srgb, var(--color-canvas) 50%, transparent);
  border: 1px solid rgba(255,255,255,.34);
  backdrop-filter: blur(3px);
}
.stage.ready .play { display: grid; }
.stage .play::after {
  content: ''; width: 0; height: 0; margin-left: 3px;
  border-left: 14px solid rgba(255,255,255,.92);
  border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.stage-sound {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 36px; height: 36px; padding: 0; border-radius: 999px;
  display: grid; place-items: center;
  color: #fff; cursor: pointer;
  background: color-mix(in srgb, #000 55%, transparent);
  border: 1px solid rgba(255,255,255,.34);
}
.stage-sound[hidden] { display: none !important; }
.stage-sound .icon-on { display: none; }
.stage-sound[aria-pressed="true"] .icon-off { display: none; }
.stage-sound[aria-pressed="true"] .icon-on { display: block; }
.stage.is-guide video::-webkit-media-controls-mute-button,
.stage.is-guide video::-webkit-media-controls-volume-slider,
.stage.is-guide video::-webkit-media-controls-volume-control-container { display: none !important; }
.stage .tag {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--color-ink-muted);
  background: color-mix(in srgb, #000 55%, transparent);
  padding: 4px 8px; border-radius: 6px;
}
.progress {
  position: absolute; left: 16px; right: 16px; bottom: 42px; height: 3px;
  background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden;
  display: none;
}
.stage.busy .progress { display: block; }
.progress i {
  display: block; height: 100%; width: 30%;
  background: var(--st-accent);
  animation: st-load 1.1s ease-in-out infinite;
}
@keyframes st-load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(400%); }
}

.guide {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.guide article {
  padding: 12px;
  border-radius: 12px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
}
.guide h3 { margin: 0 0 6px; font-family: var(--font-text); font-size: 13px; font-weight: 600; }
.guide p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--color-ink-subtle); }
.status {
  font-family: var(--font-mono); font-size: 12px; color: var(--color-ink-tertiary);
  min-height: 18px;
}
.status.err { color: #e06666; }
.status.ok { color: #5fd07a; }
.st-expiry {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #c9a227;
  background: color-mix(in srgb, #e4b84a 16%, var(--color-surface-1));
  border: 1px solid color-mix(in srgb, #e4b84a 38%, var(--color-hairline));
}
.st-expiry[hidden] { display: none; }
.st-wait {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #5aa0d4;
  background: color-mix(in srgb, #4ea3e0 16%, var(--color-surface-1));
  border: 1px solid color-mix(in srgb, #4ea3e0 38%, var(--color-hairline));
}
.st-wait[hidden] { display: none; }

.sb-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(280px, 1.2fr) minmax(240px, 320px);
}
.sb-body > * { min-height: 0; }
.sb-rail {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 12px 16px;
  border-right: 1px solid var(--color-hairline);
  min-height: 0; overflow: hidden;
  background: var(--color-surface-1);
}
.sb-rail-head { display: flex; flex-direction: column; gap: 8px; }
.sb-board-title {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--color-ink-tertiary);
}
.sb-board-title input {
  text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 14px;
  color: var(--color-ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--color-hairline);
  padding: 4px 0; outline: none;
}
.sb-add, .sb-playall, .sb-ghost {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px; font-weight: 600;
}
.sb-add:hover, .sb-playall:hover, .sb-ghost:hover { border-color: var(--color-hairline-strong); }
.sb-playall {
  margin-top: auto;
  color: var(--st-on-accent);
  background: var(--st-fill);
  border-color: transparent;
}
.sb-shots {
  display: flex; flex-direction: column; gap: 6px;
  overflow: auto; min-height: 0; flex: 1;
}
.sb-shot {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 7px; border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-ink-subtle);
}
.sb-shot:hover { background: var(--color-surface-2); color: var(--color-ink); }
.sb-shot.on {
  background: var(--color-surface-3);
  color: var(--color-ink);
  border-color: var(--color-hairline);
}
.sb-thumb {
  width: 72px; height: 42px; flex: none;
  border-radius: 6px; overflow: hidden;
  display: grid; place-items: center;
  background: #0b1226;
  font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.55);
}
.sb-thumb video {
  width: 100%; height: 100%; object-fit: cover; pointer-events: none;
}
.sb-shot-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sb-shot-meta b {
  font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-shot-meta span { font-size: 11px; color: var(--color-ink-tertiary); }
.sb-stage-col {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 16px 20px; min-width: 0; min-height: 0;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-ink) 32%, transparent) transparent;
}
.sb-stage-col::-webkit-scrollbar { width: 10px; }
.sb-stage-col::-webkit-scrollbar-track { background: transparent; }
.sb-stage-col::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-ink) 32%, transparent);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.sb-stage-col::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-ink) 48%, transparent);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.sb-stage-col .stage {
  flex: none; width: 100%;
  height: 68vh; min-height: 280px;
}
.sb-guide { grid-template-columns: 1fr 1fr; flex: none; }
.sb-guide-note {
  margin: 0; padding: 0 2px 8px;
  font-size: 12px; line-height: 1.45;
  color: var(--color-ink-tertiary);
}
.sb-takes { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-take {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-1);
  color: var(--color-ink-subtle);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px; font-weight: 500;
}
.sb-take.on {
  color: var(--st-on-accent);
  background: var(--st-fill);
  border-color: transparent;
}
.sb-editor {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 16px 16px;
  border-left: 1px solid var(--color-hairline);
  overflow: auto;
}
.sb-editor label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--color-ink-muted);
}
.sb-editor input[type="text"],
.sb-editor input[type="number"],
.sb-editor select {
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 8px 10px;
}
.sb-editor-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-ghost.danger { color: #e06666; }
.sb-editor .gen { margin-top: auto; }

@media (max-width: 1280px) {
  body.sb-app { grid-template-columns: 1fr; }
  body.sb-app .st-side { display: none; }
  body.sb-app .st-model-switch {
    display: block;
    max-width: 220px;
    background: var(--color-surface-1);
    border: 1px solid var(--color-hairline);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
  }
  body.sb-app .st-key input,
  body.sb-app .st-key select { width: 120px; max-width: 140px; }
}

@media (max-width: 960px) {
  .prompt-help { padding: 10px; }
  .prompt-help-card { height: 96vh; max-height: 96vh; padding: 14px; }
  .prompt-help-layout { grid-template-columns: 1fr; }
  .prompt-help-rail { max-height: 132px; }
  .prompt-help-samples { flex-direction: row; overflow: auto; }
  .prompt-help-pick { min-width: 220px; }
  .prompt-help-head-copy { width: 100%; }
  .prompt-help-search { width: min(100%, 188px); }
  .prompt-help-hero { grid-template-columns: 108px minmax(0, 1fr); height: auto; min-height: 192px; }
  .prompt-help-ref { width: 108px; height: 192px; }
  .prompt-help-picker { min-height: 120px; }
  .prompt-help-group { padding: 8px 0; gap: 8px; }
  .prompt-help-group-name { min-width: 2.8em; }
  .prompt-help-actions { width: 100%; }
  .prompt-help-actions button { flex: 1 1 120px; text-align: center; }
  body.studio-app { grid-template-columns: 1fr; }
  .st-side { display: none; }
  .st-model-switch {
    display: block;
    max-width: 220px;
    background: var(--color-surface-1);
    border: 1px solid var(--color-hairline);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
  }
  .st-body { grid-template-columns: 1fr; }
  .st-form { border-right: 0; border-bottom: 1px solid var(--color-hairline); }
  .st-key input,
  .st-key select { width: 120px; max-width: 140px; }
  .sb-body { grid-template-columns: 1fr; }
  .sb-rail {
    border-right: 0;
    border-bottom: 1px solid var(--color-hairline);
    max-height: 240px;
  }
  .sb-shots { flex-direction: row; }
  .sb-shot { min-width: 210px; }
  .sb-editor { border-left: 0; border-top: 1px solid var(--color-hairline); }
  .sb-guide { grid-template-columns: 1fr 1fr; }
  .sb-stage-col { max-height: min(78vh, 820px); }
  .sb-stage-col .stage { height: min(48vh, 420px); }
}
@media (max-width: 640px) {
  .sb-guide { grid-template-columns: 1fr; }
}
