:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-soft: #0c0d12;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f5f7;
  --muted: #a6adbb;
  --faint: #697080;
  --accent: #7377ff;
  --accent-soft: rgba(115, 119, 255, 0.18);
  --success: #29c183;
  --warning: #e8c168;
  --danger: #ff6f91;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv01", "ss03";
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(115, 119, 255, 0.2), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(41, 193, 131, 0.08), transparent 24%),
    linear-gradient(145deg, #050609 0%, #0b0d14 48%, #050609 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 76%);
  opacity: 0.45;
}

.scene-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
  opacity: 0.09;
  mix-blend-mode: screen;
}

button, textarea, select, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.56; }

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(115, 119, 255, 0.92);
  outline-offset: 3px;
}

a { color: inherit; text-decoration: none; }

.studio-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 22px;
}

.topbar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: 280px minmax(320px, 1fr) 150px;
  align-items: center;
  gap: 18px;
  max-width: min(1900px, calc(100vw - 44px));
  margin: 0 auto 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 11, 16, 0.74);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 10px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border-radius: 14px;
}

.brand-lockup:hover { background: var(--surface-hover); }
.brand-lockup strong { display: block; font-size: 14px; font-weight: 590; letter-spacing: -0.01em; }
.brand-lockup small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, #4d52d8, #7377ff);
  box-shadow: 0 12px 32px rgba(115, 119, 255, 0.24);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.topbar-center {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.choice-switcher {
  position: relative;
  justify-self: center;
  width: min(680px, 100%);
}

.choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px 8px 16px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: 160ms ease;
}

.choice-trigger:hover,
.choice-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(115, 119, 255, 0.28);
}

.choice-trigger strong { display: block; font-size: 14px; font-weight: 650; }
.choice-trigger small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.choice-caret {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}

.choice-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  padding: 8px;
  border: 1px solid rgba(115, 119, 255, 0.24);
  border-radius: 18px;
  background: rgba(8, 9, 13, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px);
}

.choice-menu button {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 4px 14px;
  width: 100%;
  padding: 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border-radius: 12px;
}

.choice-menu button:hover { background: rgba(255, 255, 255, 0.06); }
.choice-menu span { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.choice-menu strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.choice-menu small { grid-column: 2; color: var(--muted); font-size: 12px; }

.topbar-center span,
.session-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  font-weight: 510;
}

.session-status {
  justify-self: end;
  gap: 8px;
  color: var(--text);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(41, 193, 131, 0.12);
}

.workbench {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  max-width: min(1900px, calc(100vw - 44px));
  margin: 0 auto;
}

.side-nav {
  min-height: calc(100vh - 118px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(10, 11, 16, 0.58);
  backdrop-filter: blur(18px);
}

.nav-items {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: 160ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(115, 119, 255, 0.18), rgba(255, 255, 255, 0.045));
  border-color: rgba(115, 119, 255, 0.24);
  box-shadow: 0 0 0 1px rgba(115, 119, 255, 0.08) inset;
}

.nav-index {
  display: grid;
  place-items: center;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--faint);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.nav-item.active .nav-index {
  color: #dfe1ff;
  border-color: rgba(115, 119, 255, 0.36);
  background: rgba(115, 119, 255, 0.16);
}

.nav-item strong { display: block; font-size: 14px; font-weight: 590; }
.nav-item small { display: block; margin-top: 2px; color: var(--faint); font-size: 12px; }

.stage-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  min-height: calc(100vh - 118px);
}

.inspector {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(10, 11, 16, 0.68);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
}

.stage-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: visible;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(115, 119, 255, 0.045), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 42%);
}

.stage-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(24px, 3vw, 42px) clamp(24px, 4vw, 58px) 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.kicker {
  color: #b8bcff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: min(1040px, 100%);
  margin: 8px 0 0;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.065em;
  font-weight: 510;
  text-wrap: balance;
}

.secondary-action,
.primary-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 650;
  transition: 160ms ease;
}

.secondary-action {
  position: absolute;
  top: clamp(24px, 3vw, 42px);
  right: clamp(24px, 4vw, 58px);
  flex: 0 0 auto;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-strong);
}

.secondary-action:hover { background: var(--surface-hover); transform: translateY(-1px); }

.primary-action {
  color: white;
  background: linear-gradient(135deg, #565be2, #777bff);
  box-shadow: 0 18px 45px rgba(115, 119, 255, 0.24);
}

.primary-action:hover { transform: translateY(-1px); filter: brightness(1.06); }
.full { width: 100%; }

.landing-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 11, 16, 0.68);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
}

.landing-brand { width: auto; }
.landing-login { position: static; display: inline-flex; align-items: center; }

.landing-open {
  padding: clamp(20px, 3vw, 44px);
}

.landing-nav-open {
  max-width: min(1800px, calc(100vw - clamp(40px, 6vw, 88px)));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.landing-login-open {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.035);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  gap: clamp(28px, 7vw, 86px);
  max-width: 1180px;
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  padding: clamp(44px, 8vw, 98px) 0;
}

.landing-hero-open {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: clamp(30px, 5vw, 72px);
  max-width: min(1800px, calc(100vw - clamp(40px, 6vw, 88px)));
  min-height: calc(100vh - 96px);
  padding: clamp(44px, 7vw, 110px) 0 0;
}

.landing-copy h1 {
  max-width: 760px;
  margin: 12px 0 22px;
  font-size: clamp(48px, 7vw, 86px);
  line-height: 0.93;
  letter-spacing: -0.075em;
}

.landing-copy-open h1 {
  max-width: min(1360px, 100%);
  font-size: clamp(72px, 8.9vw, 162px);
  line-height: 0.86;
  letter-spacing: -0.092em;
}

.landing-copy p {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
}

.landing-copy-open p {
  max-width: 820px;
  font-size: clamp(20px, 1.6vw, 28px);
}

.landing-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.landing-flow div {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 22px 22px 24px 0;
  border-right: 1px solid var(--line);
}

.landing-flow div:last-child { border-right: 0; }
.landing-flow span { color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.landing-flow strong { font-size: clamp(20px, 2vw, 34px); letter-spacing: -0.05em; }
.landing-flow em { color: var(--muted); font-style: normal; line-height: 1.4; }

.landing-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.landing-link {
  color: var(--muted);
  font-weight: 650;
  padding: 14px 8px;
}

.landing-link:hover { color: var(--text); }

.landing-product-shot {
  min-height: 540px;
  padding: 24px;
  border: 1px solid rgba(115, 119, 255, 0.24);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(115, 119, 255, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(10, 11, 16, 0.78);
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.54), 0 0 80px rgba(115, 119, 255, 0.12);
  backdrop-filter: blur(20px);
}

.shot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.shot-header strong { color: #dfe1ff; }

.shot-prompt {
  margin: 58px 0;
  color: var(--text);
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.shot-timeline {
  display: grid;
  gap: 0;
}

.shot-timeline span {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.view-stage {
  min-height: 540px;
  padding: clamp(22px, 3.4vw, 54px);
  opacity: 0;
  transform: translateY(10px) scale(0.992);
  transition: opacity 220ms ease, transform 220ms ease;
}

.view-stage.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.creation-console {
  display: grid;
  gap: 18px;
  max-width: none;
}

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

.prompt-row label,
.control-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 590;
}

textarea,
select,
input {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-strong);
  outline: none;
}

textarea {
  min-height: 240px;
  resize: vertical;
  padding: 24px;
  border-radius: 22px;
  font-size: clamp(20px, 2.5vw, 32px);
  line-height: 1.14;
  letter-spacing: -0.035em;
  font-weight: 510;
}

textarea::placeholder { color: rgba(166, 173, 187, 0.44); }

.control-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.control-strip label {
  display: grid;
  gap: 8px;
}

select {
  min-height: 48px;
  padding: 0 42px 0 14px;
  border-radius: 14px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 20px,
    calc(100% - 14px) 20px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.idea-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-chip {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.preset-chip:hover { color: var(--text); background: var(--surface-hover); }

.empty-state {
  min-height: 320px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 14px;
  padding: clamp(28px, 5vw, 64px) 0;
  border-bottom: 1px solid var(--line);
}

.empty-state strong {
  max-width: 720px;
  color: var(--text);
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 510;
}

.empty-state p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.story-board,
.cast-board,
.timeline-board,
.archive-board,
.model-board {
  display: grid;
  gap: 12px;
  max-width: none;
}

.story-line,
.cast-row,
.timeline-row,
.archive-row,
.model-option,
.result-strip,
.system-note {
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.story-line {
  padding: 22px 0;
}

.story-line.primary {
  min-height: 180px;
  display: grid;
  align-content: center;
  border-bottom-color: rgba(115, 119, 255, 0.28);
}

.story-line span,
.timeline-row span,
.cast-number {
  color: var(--faint);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.story-line strong {
  display: block;
  margin: 8px 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 510;
}

.story-line p,
.cast-row p,
.timeline-row p,
.model-option p,
.system-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cast-row {
  display: grid;
  grid-template-columns: 54px 210px 1fr;
  align-items: center;
  gap: 18px;
  padding: 20px 0;
}

.cast-row strong { display: block; font-size: 20px; letter-spacing: -0.03em; }
.cast-row small { color: var(--muted); }

.timeline-row {
  display: grid;
  grid-template-columns: 46px 1fr 54px;
  align-items: start;
  gap: 16px;
  padding: 18px 0;
}

.timeline-row strong { display: block; margin-bottom: 5px; font-size: 17px; }
.timeline-row em { color: var(--muted); font-style: normal; text-align: right; }

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.editor-toolbar strong { display: block; font-size: 18px; }
.editor-toolbar p { margin: 4px 0 0; color: var(--muted); }
.primary-action.compact { min-height: 38px; padding: 0 14px; border-radius: 12px; white-space: nowrap; }

.editable-board { gap: 0; }
.editable-row { align-items: start; }

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 0.75fr);
  gap: 12px;
  width: 100%;
}

.editor-grid label,
.duration-editor {
  display: grid;
  gap: 7px;
}

.editor-grid .wide { grid-column: 1 / -1; }
.editor-grid span,
.duration-editor span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editor-grid input,
.editor-grid textarea,
.duration-editor input {
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  outline: none;
}

.editor-grid textarea {
  min-height: auto;
  resize: vertical;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  font-weight: 480;
}

.scene-editor { grid-template-columns: minmax(0, 1fr); }
.duration-editor { grid-template-columns: 84px 18px; align-items: end; }
.duration-editor span { grid-column: 1 / -1; }
.duration-editor input { text-align: right; }
.duration-editor em { padding-bottom: 11px; text-align: left; }

.result-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom-color: rgba(41, 193, 131, 0.28);
  background: rgba(41, 193, 131, 0.08);
}

.model-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-option {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px 0;
  color: var(--text);
  text-align: left;
  transition: 160ms ease;
}

.model-option:hover { color: white; }
.model-option.active { border-bottom-color: rgba(115, 119, 255, 0.42); }
.model-option span { color: var(--muted); font-size: 13px; }
.model-option strong { font-size: 28px; letter-spacing: -0.05em; }
.model-option small { color: var(--faint); }

.archive-row {
  display: grid;
  gap: 6px;
  padding: 16px 0;
  color: var(--text);
  text-align: left;
}
.archive-row:hover, .archive-row.active { border-bottom-color: rgba(115, 119, 255, 0.32); }
.archive-row span { color: var(--muted); }
.system-note { padding: 16px 0; }

.inspector {
  align-self: start;
  position: sticky;
  top: 22px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.inspector-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.inspector h2 {
  margin: 8px 0 8px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.inspector p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.inspector-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.inspector-grid strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.inspector-grid span {
  color: var(--faint);
  font-size: 11px;
}

.credit-preview {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(41, 193, 131, 0.24);
  border-radius: 16px;
  background: rgba(41, 193, 131, 0.08);
}

.credit-preview.paid {
  border-color: rgba(232, 193, 104, 0.28);
  background: rgba(232, 193, 104, 0.08);
}

.credit-preview div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.credit-preview span,
.credit-preview p {
  color: var(--muted);
  font-size: 12px;
}

.credit-preview p { margin-bottom: 0; }
.credit-preview strong { font-size: 13px; }

@media (max-width: 1120px) {
  .topbar { grid-template-columns: 1fr; }
  .topbar-center { display: none; }
  .choice-switcher { justify-self: stretch; width: 100%; }
  .session-status { justify-self: stretch; justify-content: center; }
  .workbench { grid-template-columns: 1fr; }
  .side-nav { min-height: auto; }
  .nav-items { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .nav-item { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .nav-index { width: 34px; }
  .stage-shell { grid-template-columns: 1fr; }
  .inspector { position: static; }
  .landing-hero { grid-template-columns: 1fr; }
  .landing-product-shot { min-height: auto; }
  .landing-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .studio-shell { padding: 10px; }
  .topbar { grid-template-columns: 1fr; border-radius: 18px; }
  .session-status { justify-self: stretch; justify-content: center; }
  .nav-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item small { display: none; }
  .stage-header { display: grid; }
  h1 { max-width: 100%; }
  .secondary-action { position: static; width: 100%; }
  .view-stage { min-height: auto; padding: 18px; }
  .control-strip, .model-board, .landing-flow { grid-template-columns: 1fr; }
  textarea { min-height: 190px; font-size: 22px; }
  .cast-row { grid-template-columns: 42px 1fr; }
  .cast-row p { grid-column: 2; }
  .timeline-row { grid-template-columns: 38px 1fr; }
  .timeline-row em { grid-column: 2; text-align: left; }
  h1 { font-size: clamp(34px, 11vw, 46px); }
  .landing-shell { padding: 10px; }
  .landing-nav { display: grid; gap: 10px; }
  .landing-login { justify-content: center; width: 100%; }
  .landing-copy h1 { font-size: clamp(44px, 14vw, 62px); }
  .landing-copy-open h1 { font-size: clamp(56px, 18vw, 82px); }
  .shot-prompt { font-size: 28px; }
  .choice-menu button { grid-template-columns: 1fr; }
  .choice-menu small { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Estúdio Neutro — direção visual baseada no protótipo profissional do Pier */
.neutral-shell {
  min-height: 100vh;
  padding: 0 0 78px;
  background:
    radial-gradient(circle at 48% 20%, rgba(104, 91, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #10121c 0%, #0c0e17 52%, #090b12 100%);
}

.neutral-topbar {
  display: grid;
  grid-template-columns: auto auto auto auto auto auto minmax(98px, auto);
  gap: 16px;
  max-width: none;
  min-height: 52px;
  margin: 0;
  padding: 8px 18px;
  border: 0;
  border-bottom: 1px solid #252938;
  border-radius: 0;
  background: rgba(13, 15, 25, 0.94);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.neutral-topbar .brand-lockup {
  gap: 9px;
  min-height: 34px;
  padding: 0;
}

.neutral-topbar .brand-lockup:hover { background: transparent; }
.neutral-topbar .brand-lockup strong { font-size: 14px; letter-spacing: -0.02em; }
.neutral-topbar .brand-lockup em { color: #8f83ff; font-style: normal; }

.neutral-topbar .brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, #7d70ff, #5d50f5);
  box-shadow: 0 0 18px rgba(116, 101, 255, 0.82);
}

.topbar-tabs {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  color: #8d93a7;
  font-size: 14px;
}

.topbar-tabs a:hover { color: #f3f5ff; }
.compact-tabs { gap: 0; }

.ai-switcher {
  justify-self: start;
  width: auto;
}

.ai-trigger {
  min-height: 34px;
  width: auto;
  padding: 0 12px;
  color: #f5f3ff;
  background: rgba(111, 96, 255, 0.18);
  border: 1px solid rgba(119, 104, 255, 0.18);
  border-radius: 9px;
}

.ai-trigger strong { font-size: 14px; font-weight: 760; }
.ai-trigger small { display: none; }
.ai-trigger .choice-caret { display: none; }

.ai-menu {
  left: 0;
  right: auto;
  width: min(330px, calc(100vw - 36px));
  background: rgba(22, 25, 39, 0.98);
  border-color: #30364f;
  border-radius: 10px;
}

.aspect-switch {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #2a2f44;
  border-radius: 8px;
  color: #9aa1b5;
  font-size: 13px;
}

.aspect-switch button {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  color: #9aa1b5;
  background: transparent;
  font: inherit;
}

.aspect-switch button.active {
  color: white;
  background: #6d5cff;
}

.episode-file {
  justify-self: center;
  color: #7d8398;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.neutral-status {
  justify-self: end;
  min-height: 32px;
  padding: 0 10px;
  color: #a9b0c4;
  background: rgba(255,255,255,0.03);
  border-color: #252b3d;
}

.neutral-status .pulse-dot { background: #6d5cff; box-shadow: 0 0 0 5px rgba(109, 92, 255, 0.14); }

.neutral-workbench {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 0;
  max-width: none;
  min-height: calc(100vh - 130px);
  margin: 0;
}

.neutral-side-nav {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  min-height: calc(100vh - 130px);
  padding: 20px 14px;
  border: 0;
  border-right: 1px solid #252938;
  border-radius: 0;
  background: rgba(22, 25, 39, 0.82);
  backdrop-filter: blur(20px);
}

.side-label {
  padding: 0 6px;
  color: #8e94a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.neutral-side-nav .nav-items { align-content: start; gap: 8px; }
.neutral-side-nav .nav-item {
  grid-template-columns: 42px 1fr;
  min-height: 62px;
  padding: 10px 12px;
  color: #a8afc2;
  border: 1px solid transparent;
  border-radius: 16px;
}

.neutral-side-nav .nav-item:hover {
  color: #f5f6ff;
  background: rgba(255,255,255,0.035);
}

.neutral-side-nav .nav-item.active {
  color: #f7f7ff;
  background: rgba(111, 96, 255, 0.18);
  border-color: rgba(119, 104, 255, 0.58);
  box-shadow: 0 12px 36px rgba(99, 84, 255, 0.16), inset 0 0 0 1px rgba(143, 131, 255, 0.12);
}

.neutral-side-nav .nav-index {
  width: 34px;
  height: 34px;
  border-color: #30364f;
  border-radius: 999px;
}

.neutral-side-nav .nav-item.active .nav-index {
  color: #ffffff;
  border-color: transparent;
  background: #7567ff;
  box-shadow: 0 0 0 8px rgba(117, 103, 255, 0.12);
}

.neutral-side-nav .nav-item strong { font-size: 16px; }
.neutral-side-nav .nav-item small { color: #8a91a5; font-size: 13px; }

.progress-card {
  display: grid;
  gap: 9px;
  padding: 15px 14px;
  border: 1px solid rgba(117, 103, 255, 0.38);
  border-radius: 14px;
  color: #9ca3b8;
  background: rgba(111, 96, 255, 0.13);
  font-size: 12px;
}

.progress-card strong { justify-self: end; margin-top: -24px; color: #aaa2ff; }
.progress-card div { overflow: hidden; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.12); }
.progress-card i { display: block; width: 0; height: 100%; background: #7567ff; transition: width 180ms ease; }

.neutral-stage-shell {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) minmax(290px, 340px) 284px;
  gap: 0;
  min-height: calc(100vh - 130px);
}

.neutral-stage-frame,
.preview-panel,
.neutral-inspector {
  border-radius: 0;
  background: rgba(13, 15, 25, 0.36);
  border: 0;
  border-right: 1px solid #252938;
  box-shadow: none;
}

.neutral-stage-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 24% 22%, rgba(113, 98, 255, 0.1), transparent 30%),
    rgba(13, 15, 25, 0.28);
}

.neutral-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 138px;
  padding: 22px 28px 12px;
  border-bottom: 0;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 16px;
  padding: 0 12px;
  border: 1px solid rgba(117, 103, 255, 0.42);
  border-radius: 999px;
  color: #aaa2ff;
  background: rgba(111, 96, 255, 0.14);
  font-size: 11px;
  font-weight: 800;
}

.neutral-stage-header .kicker { display: none; }
.neutral-stage-header h1 {
  margin: 0 0 8px;
  font-size: clamp(34px, 3.2vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.neutral-next {
  position: static;
  min-height: 38px;
  color: #dfe2f4;
  background: rgba(255,255,255,0.04);
  border-color: #30364f;
}

.neutral-view-stage {
  min-height: 0;
  padding: 0 28px 28px;
}

.neutral-stage-shell .story-board,
.neutral-stage-shell .cast-board,
.neutral-stage-shell .timeline-board,
.neutral-stage-shell .archive-board,
.neutral-stage-shell .model-board,
.neutral-stage-shell .creation-console {
  gap: 14px;
}

.neutral-stage-shell .story-line,
.neutral-stage-shell .cast-row,
.neutral-stage-shell .timeline-row,
.neutral-stage-shell .archive-row,
.neutral-stage-shell .model-option,
.neutral-stage-shell .system-note {
  padding: 16px 22px;
  border: 1px solid #282e43;
  border-radius: 12px;
  background: rgba(10, 12, 20, 0.68);
}

.neutral-stage-shell .story-line.primary {
  min-height: 228px;
  align-content: center;
  border-color: #30364f;
  background: linear-gradient(180deg, rgba(27, 30, 46, 0.78), rgba(12, 14, 23, 0.82));
}

.neutral-stage-shell .story-line strong { font-size: clamp(26px, 2.8vw, 42px); }
.neutral-stage-shell .story-line p { max-width: 680px; font-size: 17px; }

.preview-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 138px 22px 22px;
}

.video-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 360px;
  min-height: 180px;
  justify-self: center;
  overflow: hidden;
  border: 1px solid #2b3146;
  border-radius: 12px;
  background:
    radial-gradient(circle at 54% 52%, rgba(255,255,255,0.08), transparent 24%),
    linear-gradient(135deg, #121522, #0b0d15);
}

.video-card[data-aspect-ratio="16:9"] {
  aspect-ratio: 16 / 9;
  max-height: none;
}

.video-card > span {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 8px;
  border-radius: 7px;
  color: white;
  background: #6d5cff;
  font-size: 12px;
  font-weight: 800;
}

.video-card button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  color: white;
  background: rgba(255,255,255,0.16);
}

.video-progress {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

.video-progress i { display: block; width: 0; height: 100%; background: #7567ff; transition: width 180ms ease; }

.render-summary {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #2b3146;
  border-radius: 10px;
  background: rgba(10, 12, 20, 0.58);
}

.render-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9ca3b8;
  font-size: 13px;
}

.render-summary strong { color: #f4f5ff; }

.neutral-inspector {
  position: static;
  align-self: stretch;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px 18px;
  background: rgba(22, 25, 39, 0.72);
  border-right: 0;
}

.inspector-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.inspector-title span { color: #8f83ff; }

.premise-block {
  padding: 0;
  border: 0;
  background: transparent;
}

.premise-block h2 { display: none; }
.premise-block p {
  min-height: 66px;
  margin: 8px 0 0;
  padding: 13px 14px;
  border: 1px solid #2b3146;
  border-radius: 8px;
  color: #aeb5c7;
  background: rgba(8, 10, 18, 0.8);
  font-size: 13px;
  line-height: 1.55;
}

.neutral-chip-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.neutral-chip-grid div {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.neutral-chip-grid span,
.inspector-options > span {
  color: #8d94a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.neutral-chip-grid strong {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #2b3146;
  border-radius: 8px;
  background: rgba(8, 10, 18, 0.8);
  font-size: 14px;
  letter-spacing: 0;
}

.inspector-options {
  display: grid;
  gap: 10px;
}

.inspector-options div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.inspector-options button {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid #2b3146;
  border-radius: 999px;
  color: #9aa1b5;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.inspector-options button.active {
  color: white;
  background: #6d5cff;
  border-color: transparent;
}

.queue-preview {
  margin-top: 4px;
  border-color: #2b3146;
  background: rgba(8, 10, 18, 0.72);
}

.queue-preview::before {
  content: "fila";
  color: #9aa1b5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.generate-action {
  min-height: 42px;
  border-radius: 7px;
  background: #6d5cff;
  box-shadow: none;
}

.timeline-dock {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 18px;
  border-top: 1px solid #252938;
  background: rgba(8, 10, 17, 0.96);
  backdrop-filter: blur(18px);
}

.timeline-play {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: white;
  background: #6d5cff;
}

.timeline-track {
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr) minmax(160px, 0.7fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid #252b3d;
  border-radius: 7px;
  background: #0b0d14;
}

.timeline-track button {
  min-height: 26px;
  padding: 7px 10px 0;
  border: 0;
  border-radius: 4px;
  color: #777f95;
  background: rgba(111, 96, 255, 0.08);
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
}

.timeline-track .active {
  color: white;
  background: rgba(111, 96, 255, 0.32);
  box-shadow: inset -2px 0 0 #7567ff;
}

.timeline-empty {
  grid-column: 1 / -1;
  padding: 7px 10px 0;
  color: #777f95;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-time {
  color: #8f96aa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .neutral-topbar { grid-template-columns: 1fr auto auto; }
  .topbar-tabs,
  .episode-file,
  .neutral-status { display: none; }
  .neutral-workbench { grid-template-columns: 1fr; }
  .neutral-side-nav { min-height: auto; border-right: 0; border-bottom: 1px solid #252938; }
  .neutral-side-nav .nav-items { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .progress-card { display: none; }
  .neutral-stage-shell { grid-template-columns: 1fr; }
  .preview-panel { padding: 18px; border-top: 1px solid #252938; }
  .neutral-inspector { border-top: 1px solid #252938; }
}

@media (max-width: 760px) {
  .neutral-shell { padding-bottom: 92px; }
  .neutral-topbar { gap: 10px; padding: 10px; }
  .aspect-switch { display: none; }
  .neutral-side-nav { padding: 14px 10px; gap: 12px; }
  .neutral-side-nav .nav-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .neutral-side-nav .nav-item { grid-template-columns: 1fr; justify-items: center; min-height: 58px; text-align: center; }
  .neutral-side-nav .nav-item small { display: none; }
  .neutral-stage-header { min-height: auto; padding: 22px 18px 12px; }
  .neutral-stage-header h1 { font-size: clamp(30px, 10vw, 44px); }
  .neutral-next { width: 100%; }
  .neutral-view-stage { padding: 0 18px 20px; }
  .preview-panel { padding: 14px 18px 18px; }
  .timeline-dock { grid-template-columns: 36px 1fr; }
  .timeline-track { grid-template-columns: 1fr; }
  .timeline-time { display: none; }
}

/* Ajuste final: comportamento de app em uma tela, com rolagem interna como editor profissional. */
.neutral-body { overflow: hidden; }

.neutral-workbench {
  height: calc(100vh - 114px);
  min-height: 0;
  overflow: hidden;
}

.neutral-side-nav {
  height: 100%;
  min-height: 0;
}

.neutral-stage-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.neutral-stage-frame,
.neutral-inspector,
.preview-panel {
  min-height: 0;
  overflow: auto;
}

.neutral-stage-header { min-height: 118px; }
.neutral-stage-header h1 { font-size: clamp(42px, 4vw, 66px); }
.neutral-stage-shell .story-line.primary { min-height: 184px; }
.neutral-inspector { gap: 9px; padding: 18px 14px 10px; }
.inspector-title { font-size: 15px; }
.premise-block p { min-height: 0; max-height: 86px; overflow: hidden; padding: 10px 12px; font-size: 12px; line-height: 1.45; }
.inspector-options { gap: 6px; }
.inspector-options div { gap: 6px; margin-bottom: 0; }
.inspector-options button { min-height: 28px; padding: 0 11px; }
.queue-preview { order: 6; gap: 3px; padding: 9px 12px; }
.queue-preview p { display: none; }
.generate-action { order: 5; min-height: 40px; position: fixed; right: 14px; bottom: 74px; z-index: 70; width: 248px; }

@media (max-width: 1180px) {
  .generate-action { position: static; width: 100%; }
}
