:root {
  --bg: #111827;
  --bg-alt: #0f172a;
  --panel: rgba(17, 24, 39, 0.96);
  --panel-soft: rgba(17, 24, 39, 0.94);
  --panel-muted: rgba(31, 41, 55, 0.94);
  --field: #1f2937;
  --field-focus: #374151;
  --border: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.22);
  --cyan: #06b6d4;
  --cyan-soft: rgba(6, 182, 212, 0.18);
  --green: #52e1a1;
  --orange: #f59e0b;
  --red: #fb7185;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-glow {
  display: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding-bottom: 36px;
}

.app-shell.is-auth-hidden {
  display: none;
}

.login-shell[hidden] {
  display: none !important;
}

body[data-auth-view="login"] .app-shell {
  display: none !important;
}

body[data-auth-view="app"] .login-shell {
  display: none !important;
}

.login-shell {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: 32px 0;
}

.login-shell-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: stretch;
}

.login-panel {
  padding: 30px 32px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(24, 24, 27, 0.98), rgba(24, 24, 27, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-panel-brand {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(24, 24, 27, 0.98), rgba(24, 24, 27, 0.96));
}

.login-brand-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.login-brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  font-size: 1.5rem;
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.28);
}

.login-kicker,
.login-brand-head h1,
.login-lead,
.login-support-card p,
.login-note-card p,
.login-contact-item strong,
.login-contact-item small {
  margin: 0;
}

.login-kicker {
  color: #c7d2fe;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand-head h1 {
  margin-top: 8px;
  color: #dbeafe;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.login-lead {
  max-width: 580px;
  margin-top: 20px;
  color: #d4d4d8;
  font-size: 1.05rem;
  line-height: 1.8;
}

.login-support-card,
.login-note-card {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.login-support-card {
  margin-top: 34px;
  padding: 24px;
}

.login-support-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.login-support-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: #818cf8;
}

.login-support-card p {
  margin-top: 16px;
  color: #d4d4d8;
  line-height: 1.8;
}

.login-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.login-contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.login-contact-item:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.06);
}

.login-contact-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #eff6ff;
  font-size: 1.2rem;
  font-weight: 700;
}

.login-contact-copy {
  display: grid;
  gap: 4px;
}

.login-contact-item strong {
  color: #f8fafc;
  font-size: 1rem;
}

.login-contact-item small {
  color: #a1a1aa;
  font-size: 0.82rem;
}

.login-panel-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(29, 78, 216, 0.14);
  color: #eff6ff;
  font-size: 0.96rem;
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.login-field span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-submit-button {
  width: 100%;
  margin-top: 4px;
  min-height: 50px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.login-error {
  margin: 0;
  color: #fda4af;
  font-size: 0.84rem;
  line-height: 1.6;
}

.login-note-card {
  margin-top: 24px;
  padding: 22px;
}

.login-note-card p {
  color: #a5b4fc;
  line-height: 1.9;
}

.site-container {
  width: min(1024px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar,
.hero,
.step-panel,
.wizard-dock {
  box-shadow: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.92);
  border-radius: 0;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(14px);
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #2563eb);
}

.brand-mark-core {
  font-size: 1rem;
  line-height: 1;
}

.brand-copy p,
.brand-copy h1 {
  margin: 0;
}

.eyebrow {
  color: #a5b4fc;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.brand-copy h1 {
  margin-top: 3px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.role-pill,
.save-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.role-pill {
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(37, 99, 235, 0.12);
  color: #dbeafe;
}

.save-badge {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.icon-button-svg {
  width: 18px;
  height: 18px;
}

.stepper {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 18px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 66px;
  padding: 0;
  flex: 0 0 auto;
  color: inherit;
  background: none;
  border: 0;
  transition: transform 160ms ease;
}

.step-item:hover {
  transform: translateY(-1px);
}

.step-bullet {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  line-height: 1;
  color: #dfe7f6;
}

.step-item.is-active .step-bullet {
  border-color: rgba(147, 51, 234, 0.4);
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.94), rgba(37, 99, 235, 0.72));
}

.step-item.is-complete .step-bullet {
  border-color: rgba(82, 225, 161, 0.4);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.4), rgba(37, 99, 235, 0.26));
}

.step-name {
  margin: 0;
  font-size: 0.72rem;
  color: #cbd5e1;
  text-align: center;
}

.step-meta {
  display: none;
}

.hero {
  margin-top: 0;
  padding: 24px 0 28px;
  border: 0;
  border-radius: 0;
  text-align: center;
  background: linear-gradient(90deg, #7c3aed 0%, #2563eb 52%, #06b6d4 100%);
}

.hero-inner {
  text-align: center;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.hero-subline {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 64, 175, 0.22);
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
}

.hero-chip-primary {
  background: rgba(59, 130, 246, 0.24);
}

.hero-description {
  max-width: 820px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  line-height: 1.6;
}

.panel-stack {
  margin-top: 0;
  padding-top: 32px;
}

.step-panel {
  display: none;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: var(--panel);
}

.step-panel.is-active {
  display: block;
}

.config-panel {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  max-width: 760px;
  margin: 0 auto;
}

.config-intro {
  margin-bottom: 14px;
  text-align: center;
}

.config-heading {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.panel-description {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.config-card + .config-card {
  margin-top: 14px;
}

.card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(71, 85, 105, 0.4);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(17, 24, 39, 0.94));
}

.card-soft {
  background: linear-gradient(180deg, rgba(23, 35, 58, 0.98), rgba(18, 27, 44, 0.96));
}

.card-accent {
  background:
    linear-gradient(145deg, rgba(31, 64, 126, 0.28), rgba(17, 28, 47, 0.98)),
    rgba(18, 27, 44, 0.96);
}

.card-gradient {
  background:
    radial-gradient(circle at top right, rgba(82, 225, 161, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(23, 35, 58, 0.98), rgba(16, 25, 42, 0.96));
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title-row h3,
.card-copy,
.preview-copy {
  margin: 0;
}

.card-title-row h3 {
  font-size: 1rem;
}

.card-copy,
.preview-copy,
.tip-stack p,
.outline-card p {
  color: var(--muted);
  line-height: 1.7;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.04);
}

.section-tag-amber {
  color: #ffbe62;
}

.section-tag-pink {
  color: #ff7fba;
}

.section-tag-blue {
  color: #63c6ff;
}

.section-tag-red {
  color: #ff8e73;
}

.mini-tag,
.panel-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  color: #d3dcf0;
}

.mini-tag-highlight {
  color: #f7ffd1;
  border-color: rgba(156, 255, 110, 0.16);
  background: rgba(156, 255, 110, 0.08);
}

.grid-layout {
  display: grid;
  gap: 16px;
}

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

.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid {
  margin-top: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #edf3ff;
}

.field-note {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.compact-field {
  gap: 6px;
}

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

.card > .field + .field,
.config-card > .field + .field,
.scene-card > .field + .field,
.prompt-card > .field + .field {
  margin-top: 14px;
}

.field input,
.field select,
.field textarea,
#publishPreview {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.96), rgba(31, 41, 55, 0.92));
  border: 1px solid rgba(100, 116, 139, 0.34);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.field textarea,
#publishPreview {
  min-height: 112px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(227, 235, 248, 0.45);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
#publishPreview:focus {
  border-color: rgba(96, 165, 250, 0.42);
  background: linear-gradient(180deg, rgba(55, 65, 81, 0.96), rgba(31, 41, 55, 0.94));
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.custom-duration-wrap {
  display: grid;
  gap: 8px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.upload-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(15, 23, 42, 0.78);
}

.upload-card-dashed {
  border-style: dashed;
}

.upload-copy strong,
.upload-copy p,
.upload-status {
  margin: 0;
}

.upload-copy strong {
  display: block;
  font-size: 0.9rem;
}

.upload-copy p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.upload-status {
  margin-top: 10px;
  color: #b8c7dc;
  font-size: 0.76rem;
}

.mini-button {
  margin-top: 12px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(38, 194, 255, 0.22);
  color: #dff7ff;
  background: rgba(38, 194, 255, 0.1);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button-link {
  text-decoration: none;
}

.mini-button:hover {
  transform: translateY(-1px);
  background: rgba(38, 194, 255, 0.16);
}

.voice-block {
  margin-top: 16px;
}

.voice-region-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dialogue-language-block {
  margin-top: 18px;
}

.dialogue-language-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.voice-card,
.dialogue-card,
.platform-card,
.character-option,
.outline-card,
.scene-card,
.prompt-card,
.check-item {
  border-radius: 12px;
  border: 1px solid rgba(71, 85, 105, 0.32);
  background: rgba(255, 255, 255, 0.03);
}

.voice-card,
.dialogue-card,
.platform-card,
.character-option {
  padding: 14px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease,
    box-shadow 160ms ease;
}

.voice-card:hover,
.dialogue-card:hover,
.platform-card:hover,
.character-option:hover {
  transform: translateY(-1px);
  border-color: rgba(38, 194, 255, 0.22);
}

.voice-card.is-selected {
  border-color: rgba(139, 61, 255, 0.42);
  background: linear-gradient(180deg, rgba(139, 61, 255, 0.18), rgba(38, 194, 255, 0.06));
  box-shadow: 0 12px 24px rgba(80, 72, 185, 0.14);
}

.dialogue-card.is-selected {
  border-color: rgba(255, 190, 98, 0.38);
  background: linear-gradient(180deg, rgba(255, 190, 98, 0.12), rgba(38, 194, 255, 0.04));
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.12);
}

.voice-card-head,
.dialogue-card-head,
.platform-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voice-card-head strong,
.voice-card p,
.dialogue-card-head strong,
.dialogue-card p,
.platform-card-head strong,
.platform-card p {
  margin: 0;
}

.voice-card-dot,
.platform-card-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.voice-card p,
.dialogue-card p,
.platform-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.dialogue-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dialogue-card-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 700;
}

.dialogue-language-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.2);
  background: rgba(6, 182, 212, 0.08);
  color: #c9f7ff;
  font-size: 0.82rem;
  line-height: 1.7;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.platform-card.is-selected {
  border-color: rgba(139, 61, 255, 0.38);
  background: linear-gradient(180deg, rgba(139, 61, 255, 0.2), rgba(38, 194, 255, 0.04));
}

.platform-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d5def0;
  font-size: 0.68rem;
}

.platform-footnote {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.6;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-heading h2,
.panel-heading p {
  margin: 0;
}

.panel-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.35rem, 3vw, 1.95rem);
}

.action-row,
.action-grid,
.preset-stack,
.outline-stack,
.tip-stack,
.scene-list,
.prompt-list,
.checklist {
  display: grid;
  gap: 14px;
}

.action-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
  align-items: center;
  margin-bottom: 20px;
}

.script-editor-content[hidden] {
  display: none !important;
}

.character-editor-content[hidden] {
  display: none !important;
}

.scene-editor-content[hidden] {
  display: none !important;
}

.prompt-editor-content[hidden] {
  display: none !important;
}

.script-generation-view,
.character-generation-view {
  display: grid;
  gap: 20px;
  padding: 28px 24px 24px;
  margin-bottom: 20px;
  border-radius: 20px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background:
    radial-gradient(circle at top center, rgba(59, 130, 246, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(19, 28, 45, 0.98), rgba(16, 24, 40, 0.96));
  text-align: center;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.24);
}

.character-generation-view {
  border-color: rgba(139, 92, 246, 0.24);
  background:
    radial-gradient(circle at top center, rgba(124, 58, 237, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(23, 27, 47, 0.98), rgba(16, 24, 40, 0.96));
}

.script-generation-copy h3,
.script-generation-copy p,
.script-generation-status,
.character-generation-copy h3,
.character-generation-copy p,
.character-generation-status {
  margin: 0;
}

.script-generation-icon,
.character-generation-icon {
  margin: 0 0 8px;
  font-size: 2rem;
}

.script-generation-copy h3,
.character-generation-copy h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.script-generation-copy p,
.character-generation-copy p {
  margin-top: 10px;
  color: var(--muted-strong);
  line-height: 1.7;
}

.script-generation-pill,
.character-generation-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 720px);
  margin: 0 auto;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(124, 58, 237, 0.3);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 36px rgba(76, 29, 149, 0.12);
}

.character-generation-pill {
  border-color: rgba(96, 165, 250, 0.18);
  box-shadow: 0 18px 36px rgba(59, 130, 246, 0.12);
}

.script-generation-spinner,
.character-generation-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #f8fafc;
  border-radius: 50%;
  animation: script-spinner 900ms linear infinite;
}

.script-generation-progress,
.character-generation-progress {
  width: min(100%, 720px);
  height: 10px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.script-generation-progress span,
.character-generation-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.96), rgba(59, 130, 246, 0.96));
  transition: width 220ms ease;
}

.character-generation-progress span {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.96), rgba(59, 130, 246, 0.96));
}

@keyframes script-spinner {
  to {
    transform: rotate(360deg);
  }
}

.storyboard-intro {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 24px;
  text-align: center;
}

.storyboard-intro h2,
.storyboard-intro p,
.scene-generation-copy h3,
.scene-generation-copy p,
.storyboard-empty-state h3,
.storyboard-empty-state p {
  margin: 0;
}

.storyboard-icon,
.scene-generation-icon,
.storyboard-empty-icon {
  font-size: 2.2rem;
}

.storyboard-intro p,
.scene-generation-copy p {
  color: var(--muted-strong);
  line-height: 1.7;
}

.scene-generation-view {
  display: grid;
  gap: 0;
  margin: 20px 0 28px;
  padding: 0;
  text-align: center;
}

.scene-generation-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 0 auto;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.72), rgba(51, 65, 85, 0.72));
  box-shadow: 0 16px 32px rgba(91, 33, 182, 0.14);
}

.scene-generation-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #f8fafc;
  border-radius: 50%;
  animation: script-spinner 900ms linear infinite;
}

.scene-generation-progress {
  display: none;
  width: 100%;
  height: 10px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.scene-generation-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.96), rgba(37, 99, 235, 0.96));
  transition: width 220ms ease;
}

.prompt-generator-intro {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 24px;
  text-align: center;
}

.prompt-generator-intro h2,
.prompt-generator-intro p,
.prompt-empty-state h3,
.prompt-empty-state p {
  margin: 0;
}

.prompt-generator-icon,
.prompt-empty-icon {
  font-size: 2.2rem;
}

.prompt-generator-intro p,
.prompt-empty-state p {
  color: var(--muted-strong);
  line-height: 1.7;
}

.prompt-generation-view {
  display: grid;
  gap: 18px;
  margin: 20px 0 28px;
  padding: 0;
  text-align: center;
}

.prompt-generation-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 0 auto;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.72), rgba(51, 65, 85, 0.72));
  box-shadow: 0 16px 32px rgba(91, 33, 182, 0.14);
}

.prompt-generation-pill strong {
  margin: 0;
  color: #f8fafc;
  font-size: 1rem;
}

.prompt-generation-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #f8fafc;
  border-radius: 50%;
  animation: script-spinner 900ms linear infinite;
}

.prompt-generation-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: -8px 0 28px;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  background: rgba(29, 78, 216, 0.14);
  color: #bfdbfe;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.prompt-generation-note p {
  margin: 0;
  line-height: 1.6;
}

.prompt-generation-note-icon {
  flex: 0 0 auto;
  font-size: 0.95rem;
}

.prompt-editor-content {
  display: grid;
  gap: 18px;
}

.prompt-primary-action {
  margin-bottom: 0;
}

.prompt-generate-button {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: none;
  border-radius: 18px;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.96), rgba(37, 99, 235, 0.96));
  box-shadow: 0 20px 38px rgba(59, 130, 246, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.prompt-generate-button:hover {
  transform: translateY(-1px);
}

.prompt-generate-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.prompt-empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 220px;
  padding: 36px 24px;
  text-align: center;
}

.prompt-empty-state h3 {
  font-size: 1.05rem;
}

.prompt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.prompt-toolbar > button {
  min-width: 220px;
}

.storyboard-primary-action {
  margin-bottom: 22px;
}

.storyboard-generate-button {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: none;
  border-radius: 18px;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.96), rgba(37, 99, 235, 0.96));
  box-shadow: 0 20px 38px rgba(59, 130, 246, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.storyboard-generate-button:hover {
  transform: translateY(-1px);
}

.storyboard-generate-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.storyboard-empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 220px;
  padding: 36px 24px;
  text-align: center;
}

.storyboard-empty-state h3 {
  font-size: 1.05rem;
}

.storyboard-empty-state p {
  color: var(--muted);
}

.storyboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.storyboard-next-button {
  width: 100%;
  margin-top: 18px;
  min-height: 54px;
  padding: 14px 20px;
  border: none;
  border-radius: 16px;
  color: #f8fafc;
  font-size: 0.98rem;
  font-weight: 800;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.96), rgba(37, 99, 235, 0.96));
  box-shadow: 0 18px 34px rgba(59, 130, 246, 0.14);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.storyboard-next-button:hover {
  transform: translateY(-1px);
}

.storyboard-metrics-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.storyboard-metric-chip,
.storyboard-metric-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.storyboard-metric-chip {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.26);
  color: #cbd5e1;
}

.storyboard-metric-chip strong {
  margin-left: 4px;
  color: #f8fafc;
}

.storyboard-metric-action {
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #e9d5ff;
  background: rgba(91, 33, 182, 0.12);
  transition: transform 160ms ease, background 160ms ease;
}

.storyboard-metric-action:hover {
  transform: translateY(-1px);
}

.story-scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.story-scene-card,
.storyboard-add-tile {
  min-height: 360px;
  padding: 16px;
  border-radius: 18px;
}

.story-scene-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(24, 32, 48, 0.96), rgba(18, 26, 41, 0.94));
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.16);
}

.story-scene-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.story-scene-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-scene-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.story-scene-badge-shot {
  background: rgba(124, 58, 237, 0.18);
  color: #e9d5ff;
}

.story-scene-badge-duration {
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

.story-scene-remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.16);
  background: rgba(127, 29, 29, 0.12);
  color: #fecdd3;
  font-size: 1rem;
  line-height: 1;
}

.story-scene-card h3,
.story-scene-card p,
.scene-editor-drawer summary {
  margin: 0;
}

.story-scene-card h3 {
  margin-top: 12px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.story-scene-summary {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.72;
}

.story-scene-points {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.story-scene-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #cbd5e1;
  line-height: 1.65;
  font-size: 0.84rem;
}

.story-scene-point span {
  flex: 0 0 auto;
}

.story-scene-point-highlight {
  color: #fcd34d;
}

.story-scene-point-cast {
  color: #86efac;
}

.scene-editor-drawer {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.scene-editor-drawer summary {
  cursor: pointer;
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 700;
}

.scene-editor-drawer-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.storyboard-add-tile {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.storyboard-add-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 85, 247, 0.34);
  background: rgba(91, 33, 182, 0.06);
}

.storyboard-add-symbol {
  font-size: 1.8rem;
  color: #cbd5e1;
}

.script-scene-package {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.character-bible-preview {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.character-bible-card {
  padding: 22px 20px;
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.26);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 36%),
    linear-gradient(135deg, rgba(30, 41, 99, 0.96), rgba(30, 64, 175, 0.82));
  box-shadow: 0 18px 38px rgba(59, 130, 246, 0.14);
}

.character-bible-card h3,
.character-bible-card h4,
.character-bible-card p,
.character-bible-item p {
  margin: 0;
}

.character-bible-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.character-bible-kicker {
  color: #c4b5fd;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-bible-head h3 {
  margin-top: 8px;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
}

.character-bible-head p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
}

.character-bible-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.character-bible-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.18);
  background: rgba(15, 23, 42, 0.2);
  color: #dbeafe;
  font-size: 0.76rem;
  font-weight: 700;
}

.character-bible-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.character-bible-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(15, 23, 42, 0.22);
}

.character-bible-item h4 {
  font-size: 0.92rem;
}

.character-bible-item p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
}

.character-analysis-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(16, 24, 40, 0.72);
}

.character-analysis-toolbar strong,
.character-analysis-toolbar p,
.character-analysis-card h3,
.character-analysis-card p,
.character-analysis-lock p,
.character-style-guide h3,
.character-style-guide h4,
.character-style-guide p,
.style-guide-note li {
  margin: 0;
}

.character-analysis-kicker {
  color: #a78bfa;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-analysis-toolbar strong {
  display: block;
  margin-top: 6px;
  font-size: 0.96rem;
}

.character-analysis-summary {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.character-analysis-list {
  display: grid;
  gap: 14px;
}

.character-analysis-card,
.character-style-guide {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(24, 32, 48, 0.96), rgba(18, 26, 41, 0.94));
}

.character-analysis-card.is-primary {
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 16px 34px rgba(76, 29, 149, 0.12);
}

.character-analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.character-analysis-head h3 {
  font-size: 1.06rem;
}

.character-analysis-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.character-analysis-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.character-analysis-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.16);
  background: rgba(37, 99, 235, 0.12);
  color: #bfdbfe;
  font-size: 0.74rem;
  font-weight: 700;
}

.character-analysis-badge.is-primary {
  border-color: rgba(196, 181, 253, 0.18);
  background: rgba(124, 58, 237, 0.18);
  color: #e9d5ff;
}

.character-analysis-rows {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.character-analysis-rows p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
}

.character-analysis-rows span {
  flex: 0 0 auto;
}

.character-analysis-rows strong {
  margin-right: 4px;
  color: #f8fafc;
}

.character-analysis-lock {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.16);
  background: rgba(91, 33, 182, 0.08);
}

.character-analysis-lock strong {
  display: block;
  color: #c4b5fd;
  font-size: 0.82rem;
}

.character-analysis-lock p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.75;
}

.character-style-guide {
  border-color: rgba(59, 130, 246, 0.16);
}

.character-style-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.character-style-guide-head h3 {
  margin-top: 8px;
  font-size: 1.02rem;
}

.style-guide-chip-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.style-guide-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 700;
}

.style-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.style-guide-note {
  padding: 16px;
  border-radius: 16px;
}

.style-guide-note h4 {
  font-size: 0.94rem;
}

.style-guide-note ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.style-guide-note.is-positive {
  border: 1px solid rgba(34, 197, 94, 0.16);
  background: rgba(21, 128, 61, 0.08);
}

.style-guide-note.is-negative {
  border: 1px solid rgba(248, 113, 113, 0.16);
  background: rgba(127, 29, 29, 0.12);
}

.script-package-summary {
  padding: 22px 20px;
  border-radius: 18px;
  border: 1px solid rgba(124, 58, 237, 0.28);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 38%),
    linear-gradient(135deg, rgba(49, 46, 129, 0.96), rgba(30, 64, 175, 0.88));
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.14);
}

.script-package-summary h3,
.script-package-summary p,
.script-package-heading h4,
.script-package-heading p,
.scene-preview-card p,
.scene-preview-card h4 {
  margin: 0;
}

.script-package-summary h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.35;
}

.script-package-lead {
  margin-top: 12px;
  color: #bbf7d0;
  line-height: 1.8;
}

.script-package-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
}

.script-package-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.script-package-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.script-package-heading p {
  color: var(--muted);
  font-size: 0.84rem;
}

.script-scene-preview-list {
  display: grid;
  gap: 14px;
}

.scene-preview-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(24, 32, 48, 0.96), rgba(18, 26, 41, 0.94));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.scene-preview-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 190, 98, 0.26);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.scene-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scene-preview-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scene-preview-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.scene-preview-chip-scene {
  background: rgba(124, 58, 237, 0.24);
  color: #e9d5ff;
}

.scene-preview-chip-duration {
  background: rgba(37, 99, 235, 0.2);
  color: #bfdbfe;
}

.scene-preview-cast {
  color: #a78bfa;
  font-size: 0.82rem;
}

.scene-preview-setting,
.scene-preview-director,
.scene-preview-dialogue {
  margin-top: 12px;
  line-height: 1.75;
}

.scene-preview-setting {
  color: var(--muted-strong);
}

.scene-preview-narration {
  margin-top: 10px;
  color: #f8fafc;
  line-height: 1.8;
}

.scene-preview-director {
  color: #7dd3fc;
  font-style: italic;
}

.scene-preview-dialogue {
  color: #fcd34d;
  font-style: italic;
}

.action-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.preset-pill,
.remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 13px;
  border: 1px solid transparent;
  color: var(--text);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease,
    border-color 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.preset-pill:hover,
.remove-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.94), rgba(37, 99, 235, 0.92));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.secondary-button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.ghost-button,
.preset-pill,
.remove-button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.preset-pill {
  justify-content: flex-start;
}

.remove-button {
  min-width: 78px;
  color: #ffd5dc;
  border-color: rgba(255, 127, 142, 0.18);
  background: rgba(255, 127, 142, 0.08);
}

.outline-card,
.scene-card,
.prompt-card,
.check-item {
  padding: 16px;
}

.outline-card strong,
.preview-copy strong {
  color: var(--text);
}

.outline-card p,
.tip-stack p {
  margin: 0;
}

.outline-card p + p,
.tip-stack p + p {
  margin-top: 8px;
}

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

.character-option.is-selected {
  border-color: rgba(38, 194, 255, 0.34);
  background: linear-gradient(180deg, rgba(38, 194, 255, 0.16), rgba(139, 61, 255, 0.06));
}

.character-option h4,
.character-option p {
  margin: 0;
}

.character-option h4 {
  font-size: 1rem;
}

.character-option p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.preview-copy {
  white-space: pre-wrap;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-pill {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.stat-pill span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-pill strong {
  display: block;
  margin-top: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.12rem;
}

.scene-card-head,
.prompt-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.scene-card-head h3,
.scene-card-head p,
.prompt-card-head h3,
.prompt-card-head p {
  margin: 0;
}

.scene-card-head p,
.prompt-card-head p {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.progress-block {
  margin-bottom: 18px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.progress-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.check-item strong,
.check-item p {
  margin: 0;
}

.check-item p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.check-item.is-ready {
  border-color: rgba(82, 225, 161, 0.22);
  background: rgba(82, 225, 161, 0.06);
}

.check-item.is-missing {
  border-color: rgba(255, 127, 142, 0.16);
  background: rgba(255, 127, 142, 0.05);
}

.wizard-dock {
  position: sticky;
  bottom: 12px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.wizard-dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(71, 85, 105, 0.34);
  background: rgba(17, 24, 39, 0.96);
}

.wizard-dock.is-first-step .wizard-dock-inner {
  max-width: 760px;
  margin-inline: auto;
  justify-content: center;
}

.wizard-dock.is-first-step #prevStepButton,
.wizard-dock.is-first-step .dock-status {
  display: none;
}

.wizard-dock.is-first-step #nextStepButton {
  width: 100%;
  background: linear-gradient(180deg, rgba(75, 85, 99, 0.98), rgba(55, 65, 81, 0.98));
  box-shadow: none;
}

.dock-status {
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.app-footer {
  margin-top: 44px;
  padding: 24px 0 28px;
  border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.app-footer-inner {
  text-align: center;
}

.app-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.7;
}

.toast-rack {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(38, 194, 255, 0.16);
  background: rgba(9, 15, 27, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 1040px) {
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-container {
    width: min(1024px, calc(100% - 20px));
  }

  .login-shell {
    padding: 20px 0 24px;
  }

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

  .topbar {
    padding: 10px 0 12px;
  }

  .hero {
    padding: 20px 0 22px;
  }

  .step-panel:not(.config-panel) {
    padding: 18px;
  }

  .topbar-main,
  .panel-heading,
  .wizard-dock-inner,
  .field-label-row {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .two-columns,
  .three-columns,
  .upload-grid,
  .voice-region-grid,
  .dialogue-language-grid,
  .platform-grid {
    grid-template-columns: 1fr;
  }

  .action-row,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .script-package-heading,
  .scene-preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .wizard-dock {
    bottom: 10px;
  }
}

@media (max-width: 640px) {
  .site-container {
    width: calc(100% - 18px);
  }

  .login-panel {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .login-brand-head {
    align-items: flex-start;
  }

  .login-brand-head h1 {
    font-size: 1.7rem;
  }

  .login-lead {
    font-size: 0.94rem;
  }

  .login-contact-grid {
    grid-template-columns: 1fr;
  }

  .script-package-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .character-bible-head {
    flex-direction: column;
  }

  .character-bible-badges {
    justify-content: flex-start;
  }

  .character-analysis-toolbar,
  .character-style-guide-head,
  .character-analysis-head {
    flex-direction: column;
  }

  .character-analysis-summary,
  .character-analysis-badges,
  .style-guide-chip-list {
    justify-content: flex-start;
    text-align: left;
  }

  .storyboard-toolbar {
    flex-direction: column;
  }

  .prompt-toolbar {
    flex-direction: column;
  }

  .prompt-generation-note {
    flex-direction: column;
    align-items: center;
  }

  .storyboard-toolbar > button {
    width: 100%;
  }

  .prompt-toolbar > button {
    width: 100%;
    min-width: 0;
  }

  .storyboard-metrics-bar,
  .story-scene-head {
    align-items: flex-start;
  }

  .storyboard-metrics-bar {
    flex-direction: column;
  }

  .story-scene-grid {
    grid-template-columns: 1fr;
  }

  .style-guide-grid {
    grid-template-columns: 1fr;
  }

  .brand-copy h1 {
    font-size: 0.88rem;
  }

  .eyebrow {
    font-size: 0.62rem;
  }

  .hero-title {
    font-size: 1.52rem;
  }

  .hero-subline {
    font-size: 0.82rem;
  }

  .hero-chip-row {
    gap: 8px;
  }

  .hero-chip {
    width: auto;
    max-width: 100%;
  }

  .stepper {
    gap: 10px;
  }

  .step-item {
    min-width: 64px;
  }
}
