:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f9faff;
  --line: #e6eaf4;
  --line-strong: #d8deed;
  --text: #171923;
  --muted: #737b93;
  --quiet: #a4abc0;
  --primary: #5a5cf6;
  --primary-strong: #1b67ff;
  --primary-soft: #eef0ff;
  --mint: #65d8b0;
  --amber: #efb44b;
  --shadow: 0 18px 42px rgba(46, 56, 90, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.material-symbols-rounded {
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  color: currentColor;
  overflow: hidden;
  vertical-align: -0.15em;
}

.material-symbols-rounded svg {
  width: 1em;
  height: 1em;
  display: block;
  stroke: currentColor;
}

.material-symbols-rounded:not([data-icon-ready="true"]) {
  color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  grid-template-rows: 74px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 74px;
  grid-column: 1;
  grid-row: 2;
  height: calc(100vh - 74px);
  padding: 18px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary-strong), #8128ff);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  font-weight: 800;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.primary-nav {
  display: grid;
  gap: 8px;
}

.quick-steps {
  display: grid;
  gap: 8px;
  padding: 0 0 8px 18px;
}

.quick-step {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #6d7488;
  text-align: left;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.menu-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
  filter: brightness(0) saturate(100%) invert(45%) sepia(9%) saturate(848%) hue-rotate(189deg) brightness(93%) contrast(89%);
  transition: filter 0.18s ease, transform 0.18s ease;
}

.quick-step:hover,
.quick-step.active {
  background: #f2f4ff;
  color: var(--primary);
  font-weight: 700;
}

.quick-step:hover .menu-icon,
.quick-step.active .menu-icon,
.nav-item:hover .menu-icon,
.nav-item.active .menu-icon {
  filter: brightness(0) saturate(100%) invert(37%) sepia(73%) saturate(3429%) hue-rotate(230deg) brightness(99%) contrast(94%);
}

.nav-item,
.platform-tab,
.step,
.ghost-button,
.select-like,
.primary-small,
.icon-button,
.episode-card,
.asset-tile,
.clip-item,
.phone-project,
.table-button,
.radio-pill {
  border: 0;
  background: transparent;
  color: inherit;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  color: #444b60;
  border-radius: 12px;
  text-align: left;
  font-size: 20px;
  font-weight: 600;
  transition: 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.main-stage {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 74px;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.top-brand img {
  width: 116px;
  height: 34px;
  object-fit: contain;
  object-position: left center;
}

.top-brand span {
  font-size: 22px;
  font-weight: 700;
  color: #1f2533;
}

.login-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.login-button {
  min-width: 82px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.auth-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 188px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(28, 35, 70, 0.14);
  z-index: 30;
}

.auth-user-menu[hidden] {
  display: none;
}

.auth-user-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid #eef1f8;
}

.auth-user-menu-head span,
.auth-user-menu-head strong {
  display: block;
}

.auth-user-menu-head span {
  color: var(--muted);
  font-size: 12px;
}

.auth-user-menu-head strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
}

.auth-menu-action {
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e44f7a;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 10px;
}

.auth-menu-action:hover {
  background: #fff1f5;
}

.points-balance {
  min-width: 88px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f5f6ff;
  color: var(--primary);
  font-weight: 800;
  text-align: center;
}

.points-recharge {
  height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(82, 92, 255, 0.22);
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
  font-weight: 800;
}

.login-button.logged-in {
  min-width: 96px;
  padding: 0 18px;
  background: rgba(82, 92, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(82, 92, 255, 0.18);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(16, 20, 34, 0.36);
  backdrop-filter: blur(12px);
}

.auth-modal.open {
  display: flex;
}

.auth-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(23, 31, 56, 0.2);
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(102, 112, 146, 0.1);
  color: #4b5568;
  font-size: 24px;
  line-height: 1;
}

.auth-head {
  margin-bottom: 24px;
}

.auth-kicker {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

.auth-head h2 {
  margin: 8px 0 0;
  font-size: 26px;
  line-height: 1.25;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: #536078;
  font-size: 14px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  height: 48px;
  border: 1px solid #dfe5f2;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(82, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(82, 92, 255, 0.1);
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: #ef4444;
  font-size: 13px;
}

.auth-message.success {
  color: #059669;
}

.auth-submit {
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #1769ff, #7931ff);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.auth-links button {
  border: 0;
  background: transparent;
  color: #536078;
  font-size: 14px;
}

.auth-links button:hover {
  color: var(--primary);
}

.project-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-title h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.project-title.history-title h1 {
  display: none;
}

.project-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.top-actions,
.select-row,
.asset-actions,
.story-topline,
.shot-options,
.icon-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-switch,
.segmented {
  display: flex;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
}

.platform-tab,
.segmented button {
  padding: 8px 14px;
  border-radius: 10px;
  color: #3f4659;
}

.platform-tab.active,
.segmented button.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.ghost-button,
.primary-small,
.select-like,
.table-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: #252b3a;
  white-space: nowrap;
}

.primary-small {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: #52586b;
}

.step {
  min-width: 108px;
  min-height: 56px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  color: #33394b;
  transition: 0.18s ease;
}

.step.active {
  color: var(--primary);
  border-color: #c5c9ff;
  background: #f7f8ff;
  box-shadow: 0 8px 22px rgba(90, 92, 246, 0.12);
}

.web-product,
.history-product,
.mini-product,
.screen {
  display: none;
}

.web-product.active,
.history-product.active,
.mini-product.active,
.screen.active {
  display: block;
}

.upload-hero {
  padding: 58px min(4vw, 54px) 26px;
  min-height: calc(100vh - 74px);
  text-align: center;
  animation: riseIn 0.42s ease both;
}

.web-product.upload-mode .upload-hero {
  min-height: calc(100vh - 78px);
}

.upload-hero h2 {
  margin: 0 0 66px;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0;
}

.upload-hero h2 span {
  color: var(--primary);
}

.dropzone {
  width: min(66.666%, 1280px);
  min-height: 270px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  border: 1px dashed #d6dced;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transition: 0.2s ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--primary);
  background: #f8f9ff;
}

.file-stack {
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-stack-card {
  border: 1px solid #e2e6f1;
  background: #fff;
  box-shadow: 0 8px 18px rgba(55, 65, 100, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-stack-card img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(62%) sepia(11%) saturate(643%) hue-rotate(185deg) brightness(91%) contrast(86%);
}

.file-stack .center {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  z-index: 2;
}

.file-stack .center img {
  width: 36px;
  height: 36px;
}

.file-stack .side {
  width: 58px;
  height: 64px;
  border-radius: 10px;
  transform: rotate(-14deg) translateX(12px);
}

.file-stack .side:last-child {
  transform: rotate(14deg) translateX(-12px);
}

.dropzone p {
  margin: 0;
  color: #a2a9bc;
  font-size: 20px;
}

.dropzone strong {
  display: block;
  color: var(--primary);
  font-weight: 600;
}

.upload-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef1ff;
  color: #626981;
  font-size: 14px;
  font-weight: 600;
}

.creation-toolbar {
  width: min(66.666%, 1280px);
  margin-top: 22px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.avatar-select img,
.style-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.style-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #22283a, #7b8195);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.style-avatar.compact {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 7px;
  padding: 4px;
  background: #eef2ff;
  object-fit: contain;
}

.primary-cta {
  margin-top: 68px;
  min-width: 320px;
  height: 62px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #126dff, #8321f5);
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  box-shadow: 0 18px 38px rgba(69, 83, 238, 0.22);
  transition: transform 0.18s ease;
}

.primary-cta:hover {
  transform: translateY(-2px);
}

.section-head {
  padding: 30px min(4vw, 48px) 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow,
.panel-kicker {
  display: inline-block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.section-head h2 {
  margin: 8px 0 0;
  font-size: 28px;
}

.script-detail-page {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 58px 36px 72px;
  background: #fff;
}

.script-hero-card {
  display: grid;
  grid-template-columns: 207px minmax(0, 1fr);
  gap: 74px;
  align-items: center;
  padding: 0 0 78px;
  border-bottom: 1px solid var(--line);
}

.script-cover-visual {
  width: 207px;
  height: 297px;
  border-radius: 10px;
  background-image: url("assets/script-cover-gold.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 30px rgba(44, 49, 70, 0.16);
}

.script-doc-cover {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-image: url("assets/script-cover-gold.png");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.script-doc-cover span {
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
}

.script-doc-cover strong {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

.script-hero-info {
  padding-top: 6px;
  text-align: center;
  justify-self: start;
  width: min(100%, 590px);
}

.script-doc-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.script-dedication {
  margin-bottom: 12px;
  color: #626a7e;
  font-size: 18px;
  font-weight: 600;
}

.script-hero-info h2 {
  margin: 0 0 14px;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0;
}

.script-author-subtitle {
  color: #4d5568;
  font-size: 20px;
  font-weight: 400;
  text-align: center;
}

.script-complete-label {
  margin-top: 10px;
  color: #333b4d;
  font-size: 18px;
  font-weight: 600;
}

.script-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #697083;
  font-size: 14px;
}

.script-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.script-meta-row .material-symbols-rounded {
  font-size: 18px;
}

.script-meta-row img {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  object-fit: cover;
}

.script-production-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 28px;
  color: #697083;
  font-size: 24px;
}

.script-production-row span:last-child {
  font-size: 21px;
}

.script-production-row span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 22px;
  margin-right: 22px;
  border-right: 1px solid var(--line-strong);
}

.script-production-row span:last-child {
  border-right: 0;
}

.script-production-row b {
  color: #8a91a5;
  font-weight: 600;
}

.script-production-row img {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  object-fit: cover;
}

.script-date-line {
  margin-top: 24px;
  color: #4d5568;
  font-size: 22px;
  text-align: center;
}

.script-field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  max-width: 760px;
}

.script-field-row div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbff;
}

.script-field-row span,
.script-field-row strong {
  display: block;
}

.script-field-row span {
  color: #858ca0;
  font-size: 13px;
}

.script-field-row strong {
  margin-top: 6px;
  color: #242b3a;
  font-size: 15px;
  font-weight: 700;
}

.script-tags-block {
  width: fit-content;
  margin-top: 34px;
  margin-left: auto;
  margin-right: auto;
}

.script-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.script-tags span {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
}

.tag-lavender {
  color: #6255d8;
  background: #eeecff;
}

.tag-mint {
  color: #168b76;
  background: #e7f7f2;
}

.tag-amber {
  color: #b96a13;
  background: #fff0d9;
}

.tag-rose {
  color: #c24c74;
  background: #ffe8f1;
}

.tag-green {
  color: #168156;
  background: #e7f7e9;
}

.tag-blue {
  color: #2d69c8;
  background: #e8f1ff;
}

.script-content-flow {
  position: relative;
  padding-top: 60px;
}

.script-section {
  margin-bottom: 58px;
}

.script-section h3 {
  margin: 0 0 18px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}

.script-section h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.script-section p {
  max-width: 1010px;
  margin: 0;
  color: #404756;
  font-size: 19px;
  line-height: 2;
}

.script-type-block strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.script-section-title {
  position: relative;
}

.script-next-button {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  min-width: 158px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(2, 4, 10, 0.74);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 40;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 0 2px rgba(106, 90, 255, 0.62),
    0 0 0 6px rgba(0, 210, 196, 0.08),
    0 18px 44px rgba(20, 25, 50, 0.18);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.script-next-button .material-symbols-rounded {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
}

.script-next-button::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-120%);
  transition: transform 420ms ease;
  pointer-events: none;
}

.script-next-button:hover {
  transform: translateX(-50%) translateY(-2px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(2, 4, 10, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 0 2px rgba(106, 90, 255, 0.78),
    0 0 0 7px rgba(0, 210, 196, 0.1),
    0 22px 52px rgba(20, 25, 50, 0.22);
}

.script-next-button:hover::after {
  transform: translateX(120%);
}

.script-next-button:active {
  transform: translateX(-50%) translateY(0);
}

.script-next-button:disabled,
.floating-next:disabled {
  cursor: wait;
  opacity: 0.78;
}

.script-next-button:disabled .material-symbols-rounded,
.floating-next:disabled .material-symbols-rounded {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.character-bio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 92px;
  row-gap: 28px;
}

.character-bio-grid div:last-child {
  grid-column: 1;
}

.character-bio-grid p {
  color: #555d6e;
  font-size: 18px;
  line-height: 1.85;
}

.character-bio-grid h4 {
  font-size: 24px;
  font-weight: 700;
}

.episode-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
}

.episode-tabs button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #2f3544;
}

.episode-tabs button.active,
.episode-tabs button:hover {
  border-color: #c5c9ff;
  background: #f3f5ff;
  color: var(--primary);
  font-weight: 700;
}

.script-episode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.script-episode-tabs button {
  width: 38px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #2f3544;
  font-weight: 700;
}

.script-episode-tabs button.active,
.script-episode-tabs button:hover {
  border-color: #c5c9ff;
  background: #f3f5ff;
  color: var(--primary);
}

.script-episode-block {
  padding: 20px 24px 26px;
}

.script-episode-block h4 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 800;
}

.script-episode-summary {
  margin: -6px 0 18px;
  white-space: pre-line;
  color: #384052;
  font-size: 18px;
  line-height: 1.9;
}

.script-episode-scene {
  padding: 18px 0;
  border-top: 1px solid #eef1f7;
}

.script-episode-scene:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.script-episode-scene h5 {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 800;
}

.script-episode-scene p {
  margin: 0;
  white-space: pre-line;
  color: #384052;
  font-size: 18px;
  line-height: 1.95;
}

.episode-story-block span {
  display: block;
  margin-bottom: 8px;
  color: #697083;
}

.script-body-card {
  max-width: 1010px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.script-body-scene {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.script-body-scene:last-child {
  border-bottom: 0;
}

.script-body-scene > span {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

.script-body-scene h4 {
  margin: 2px 0 10px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
}

.script-body-scene p {
  font-size: 18px;
  line-height: 1.9;
}

.asset-board {
  position: relative;
  min-height: calc(100vh - 74px);
  padding: 48px 22px 90px;
  background: #fff;
}

.asset-tabs {
  display: flex;
  gap: 54px;
  align-items: center;
  margin-bottom: 78px;
}

.asset-tabs button {
  border: 0;
  background: transparent;
  color: #7d8298;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}

.asset-tabs button.active {
  color: #151923;
}

.asset-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.asset-title-row,
.asset-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.asset-title-row h2 {
  margin: 0 16px 0 0;
  font-size: 24px;
  font-weight: 600;
}

.asset-title-row > span {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid #edf0f7;
  border-radius: 12px;
  color: #7b8197;
  font-size: 16px;
  background: #fff;
}

.asset-title-row strong {
  color: #232938;
  font-size: 16px;
}

.asset-title-row .danger {
  color: #e14c80;
}

.asset-title-row .material-symbols-rounded {
  font-size: 18px;
}

.asset-text-button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #454b5c;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

.asset-text-button .material-symbols-rounded {
  font-size: 20px;
}

.role-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(320px, 1fr));
  column-gap: 36px;
  row-gap: 44px;
}

.role-card {
  min-width: 0;
}

.role-card.generating {
  opacity: 0.72;
}

.role-image-strip,
.empty-role-stage,
.role-variant-frame {
  position: relative;
  aspect-ratio: 2 / 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #edf0f7;
  border-radius: 10px;
  background: #f4f5fb;
}

.role-image-strip img,
.role-variant-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f4f6fb;
}

.role-image-strip.single-image-strip {
  grid-template-columns: 1fr;
}

.role-image-strip.single-image-strip img {
  object-fit: cover;
}

.role-image-strip .role-portrait {
  object-position: center top;
}

.role-variant-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.role-variant-frame {
  grid-template-columns: 1fr;
}

.role-variant-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #25304a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(33, 42, 72, 0.12);
}

.asset-placeholder-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-image-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 22px;
  background: rgba(28, 30, 36, 0.72);
  color: #fff;
  opacity: 0;
  transform: translateY(-6px);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 24px rgba(18, 20, 34, 0.18);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.asset-image-actions:has(.asset-more-menu:not([hidden])) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.role-image-strip:hover .asset-image-actions,
.role-variant-frame:hover .asset-image-actions,
.role-card:focus-within .asset-image-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.asset-image-actions button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.asset-image-actions button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.asset-image-actions button:disabled,
.asset-empty-actions button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.asset-image-actions button:disabled .material-symbols-rounded,
.asset-empty-actions button:disabled .material-symbols-rounded {
  animation: spin 900ms linear infinite;
}

.asset-image-actions .material-symbols-rounded {
  font-size: 22px;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
}

.asset-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  min-width: 148px;
  padding: 6px;
  border: 1px solid rgba(223, 228, 240, 0.92);
  border-radius: 10px;
  background: #fff;
  color: #202532;
  box-shadow: 0 14px 34px rgba(18, 20, 34, 0.16);
}

.asset-more-menu[hidden] {
  display: none;
}

.asset-more-menu button {
  width: 100%;
  min-height: 38px;
  height: auto;
  padding: 0 10px;
  border-radius: 8px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  color: #d03f5f;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.asset-more-menu button:hover {
  background: #fff1f4;
}

.asset-more-menu .material-symbols-rounded {
  color: #d03f5f;
  font-size: 19px;
}

.variant-pill {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-radius: 10px;
  background: rgba(25, 27, 31, 0.68);
  color: #ff9f18;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.variant-pill .material-symbols-rounded {
  font-size: 18px;
}

.role-card h3 {
  margin: 16px 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.asset-name {
  min-height: 30px;
  border-radius: 8px;
  outline: none;
}

.asset-name:focus {
  padding: 4px 8px;
  background: #f8f9fd;
  box-shadow: inset 0 0 0 1px #dde2f0;
}

.asset-card-meta {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.asset-card-meta span,
.asset-prompt-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  background: #f4f6fb;
  color: #6d7488;
  font-size: 13px;
  font-weight: 600;
}

.asset-prompt-label {
  width: max-content;
  max-width: 100%;
  margin-bottom: 6px;
  color: #4d566d;
}

.role-card p {
  margin: 0;
  color: #737a91;
  font-size: 16px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  outline: none;
}

.role-card p:focus {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8f9fd;
  box-shadow: inset 0 0 0 1px #dde2f0;
  overflow: visible;
}

.role-card p strong {
  color: #737a91;
  margin-right: 12px;
  font-weight: 600;
}

.storyboard-empty-note,
.storyboard-asset-ref {
  margin: 10px 0 0;
  color: #737a91;
  font-size: 15px;
  line-height: 1.6;
}

.storyboard-full-table {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(22, 28, 50, 0.05);
}

.storyboard-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.storyboard-table-head h3 {
  margin: 0;
  font-size: 22px;
}

.storyboard-table-head span {
  color: var(--muted);
  font-size: 14px;
}

.storyboard-table-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.storyboard-table-row {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e4e8f4;
  border-radius: 12px;
  background: #fff;
  color: #252b3a;
  text-align: left;
}

.storyboard-table-row.active,
.storyboard-table-row:hover {
  border-color: rgba(82, 92, 255, 0.38);
  background: #f7f8ff;
}

.storyboard-table-index {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 800;
}

.storyboard-table-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.storyboard-table-main strong {
  font-size: 17px;
}

.storyboard-table-main em,
.storyboard-table-main small {
  color: #646b80;
  font-style: normal;
  line-height: 1.65;
}

.storyboard-table-main small {
  display: -webkit-box;
  color: #3f4659;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.storyboard-table-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.storyboard-table-assets i {
  padding: 4px 8px;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.storyboard-shot-list {
  display: grid;
  gap: 22px;
}

.storyboard-shot-card {
  border: 1px solid #e4e8f4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 28, 50, 0.05);
  overflow: hidden;
}

.storyboard-shot-card.active {
  border-color: rgba(82, 92, 255, 0.42);
  box-shadow: 0 14px 36px rgba(82, 92, 255, 0.1);
}

.storyboard-shot-card-head {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef1f7;
}

.storyboard-shot-card-head > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}

.storyboard-shot-card-head small {
  padding: 2px 6px;
  border-radius: 7px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
}

.storyboard-shot-card-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(420px, 1fr) minmax(320px, 0.72fr);
  gap: 16px;
  padding: 18px;
  background: #fbfcff;
}

.storyboard-card-info,
.storyboard-card-prompt-panel,
.storyboard-card-preview {
  min-width: 0;
  border: 1px solid #eef1f7;
  border-radius: 16px;
  background: #fff;
  padding: 18px;
}

.storyboard-card-info h4,
.storyboard-card-prompt-panel h4 {
  margin: 0 0 16px;
  font-size: 18px;
}

.storyboard-card-info textarea {
  min-height: 124px;
  font-size: 15px;
}

.storyboard-card-asset-row,
.storyboard-card-scene-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.storyboard-card-asset-row img,
.storyboard-card-scene-row img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f4fa;
}

.storyboard-card-scene-row {
  grid-template-columns: 72px minmax(0, 1fr);
}

.storyboard-card-scene-row img {
  width: 72px;
  height: 48px;
}

.storyboard-card-asset-row span,
.storyboard-card-scene-row span {
  min-width: 0;
  color: #2d3448;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storyboard-card-asset-row em {
  color: #6e768b;
  font-size: 13px;
  font-style: normal;
}

.generation-input.compact {
  min-height: 62px;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.generation-input.compact p {
  margin: 0;
  font-size: 14px;
}

.storyboard-card-prompt {
  min-height: 330px;
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
}

.storyboard-card-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.storyboard-card-controls button {
  height: 34px;
  border: 1px solid #e4e8f4;
  border-radius: 10px;
  background: #fff;
  color: #4d566b;
  padding: 0 10px;
}

.storyboard-card-controls span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.storyboard-card-controls i {
  padding: 4px 8px;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--primary);
  font-style: normal;
  font-size: 13px;
}

.storyboard-card-preview {
  position: relative;
  min-height: 430px;
  padding: 0;
  overflow: hidden;
  background: #2c333f;
}

.storyboard-card-preview img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
}

.storyboard-card-video {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: contain;
  background: #080b12;
}

.storyboard-card-download {
  position: absolute;
  left: 16px;
  bottom: 16px;
  min-height: 38px;
  border-radius: 12px;
  padding: 9px 14px;
  background: rgba(12, 16, 24, 0.72);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.storyboard-card-generate {
  position: absolute;
  right: 16px;
  bottom: 16px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(82, 92, 255, 0.28);
}

.story-workspace .shot-header,
.story-workspace > .storyboard-grid {
  display: none;
}

@media (max-width: 900px) {
  .storyboard-table-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .storyboard-table-assets {
    grid-column: 2;
  }

  .storyboard-shot-card-head,
  .storyboard-shot-card-grid {
    grid-template-columns: 1fr;
  }

  .storyboard-card-preview,
  .storyboard-card-preview img {
    min-height: 320px;
  }
}

.voice-button {
  min-width: 108px;
  height: 44px;
  margin-top: 14px;
  border: 1px solid #edf0f7;
  border-radius: 12px;
  background: #fff;
  color: #202532;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}

.empty-role-stage {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background: #f4f5fb;
}

.asset-empty-actions {
  position: relative;
  z-index: 2;
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: max-content;
  margin: auto;
}

.asset-empty-actions button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #333948;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(36, 42, 64, 0.08);
}

.asset-empty-actions button:hover {
  color: var(--primary);
  box-shadow: 0 10px 24px rgba(86, 91, 255, 0.12);
}

.asset-empty-actions .material-symbols-rounded {
  font-size: 22px;
}

.floating-next {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 40;
  min-width: 158px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(2, 4, 10, 0.74);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 0 2px rgba(106, 90, 255, 0.62),
    0 0 0 6px rgba(0, 210, 196, 0.08),
    0 18px 44px rgba(20, 25, 50, 0.18);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.floating-next .material-symbols-rounded {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
}

.floating-next::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-120%);
  transition: transform 420ms ease;
  pointer-events: none;
}

.floating-next:hover {
  transform: translateX(-50%) translateY(-2px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(2, 4, 10, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 0 2px rgba(106, 90, 255, 0.78),
    0 0 0 7px rgba(0, 210, 196, 0.1),
    0 22px 52px rgba(20, 25, 50, 0.22);
}

.floating-next:hover::after {
  transform: translateX(120%);
}

.floating-next:active {
  transform: translateX(-50%) translateY(0);
}

.asset-disclaimer {
  margin: 10px 0 0;
  text-align: center;
  color: #a0a6b7;
  font-size: 18px;
}

.script-layout,
.video-board {
  padding: 0 min(4vw, 48px) 22px;
  display: grid;
  gap: 16px;
}

.script-layout {
  grid-template-columns: 1fr 1fr;
}

.plain-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.script-summary,
.plain-panel {
  padding: 24px;
}

.script-summary h3 {
  margin: 8px 0 12px;
  font-size: 25px;
}

.script-summary p {
  color: var(--muted);
  line-height: 1.8;
}

.metric-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.metric-row span {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
}

.metric-row strong {
  display: block;
  color: var(--text);
  font-size: 24px;
}

.bio-list {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.bio-list div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bio-list img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
}

.bio-list p {
  margin: 0;
}

.bio-list strong,
.bio-list span {
  display: block;
}

.bio-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.episode-panel {
  margin: 0 min(4vw, 48px) 32px;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.episode-card {
  min-height: 112px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.episode-card.active {
  border-color: #c7cbff;
  background: #f4f6ff;
}

.episode-card strong,
.episode-card span {
  display: block;
}

.episode-card span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.editor-shell {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  min-height: calc(100vh - 154px);
  background: #fbfcff;
}

.episode-rail {
  padding: 34px 10px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 14px;
  justify-items: center;
}

.episode-rail strong {
  margin-bottom: 12px;
}

.episode-number {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #3f4659;
  font-size: 21px;
}

.episode-number.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.story-workspace {
  min-width: 0;
  padding: 26px 26px 36px;
}

.story-topline {
  justify-content: space-between;
}

.wide {
  min-width: 320px;
}

.episode-intro {
  position: relative;
  margin-top: 28px;
  padding: 0 0 24px 28px;
  border-bottom: 1px solid var(--line);
}

.episode-intro h2 {
  margin: 0 0 14px;
}

.episode-intro p {
  max-width: 1220px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.timeline-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 38px;
  border-radius: 99px;
  background: var(--mint);
}

.shot-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin: 18px 0;
}

.shot-header small {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 7px;
  color: var(--primary);
  background: var(--primary-soft);
}

.drag-handle {
  color: var(--muted);
  font-weight: 800;
}

.radio-pill {
  height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.radio-pill span {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
}

.radio-pill.active {
  background: #f7f8ff;
  color: #252b3a;
}

.radio-pill.active span {
  border: 7px solid var(--primary);
}

.storyboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.shot-info h3,
.generation-panel h3 {
  margin: 0 0 24px;
  font-size: 22px;
}

.generation-panel {
  position: relative;
}

label,
.cast-head {
  color: #646b80;
}

textarea {
  width: 100%;
  min-height: 154px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  color: #242b3b;
  resize: vertical;
  line-height: 1.7;
}

.cast-head {
  margin-top: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cast-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 148px 44px;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.cast-row img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}

.cast-row button,
.muted-select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #2e3445;
}

.muted-select {
  color: var(--quiet) !important;
}

.generation-input {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: #bcc2cf;
}

.generation-panel textarea {
  min-height: 280px;
  margin: 0;
  border: 0;
  padding: 0;
  font-size: 18px;
}

.mention-popover {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #dfe5f2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(20, 28, 52, 0.16);
}

.mention-popover[hidden] {
  display: none;
}

.mention-popover button {
  border: 1px solid #e4e8f4;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: #263044;
  text-align: left;
  font-size: 14px;
}

.mention-popover button span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.video-preview {
  position: relative;
  min-height: 460px;
  border-radius: 18px;
  overflow: hidden;
  background: #282e39;
  box-shadow: var(--shadow);
}

.video-preview img {
  position: absolute;
  left: 0;
  bottom: 54px;
  width: 100%;
  height: 52%;
  object-fit: cover;
}

.generated-video-preview {
  position: absolute;
  inset: 0 0 54px;
  width: 100%;
  height: calc(100% - 54px);
  object-fit: contain;
  background: #05070c;
}

.video-preview-download {
  position: absolute;
  left: 18px;
  bottom: 70px;
  z-index: 4;
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(12, 16, 24, 0.72);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.preview-tools {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(8, 11, 17, 0.78);
  color: white;
}

.preview-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
}

.preview-caption button {
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
}

.render-state {
  position: absolute;
  left: 18px;
  top: 18px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #2f3547;
  font-size: 13px;
}

.video-board {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.video-studio {
  min-height: calc(100vh - 74px);
  background: #f6f8fc;
}

.video-actionbar {
  min-height: 64px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.video-project-meta,
.video-export-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.video-project-meta strong {
  font-size: 16px;
}

.video-project-meta span,
.video-project-meta button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #6b7286;
}

.video-project-meta img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.video-project-meta button {
  color: var(--primary);
  font-weight: 700;
}

.video-export-actions button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: #303747;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.video-export-actions .credit-pill {
  color: var(--primary);
  background: #f4f6ff;
  border-color: transparent;
}

.video-editor-layout {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: calc(100vh - 138px);
}

.video-episode-rail {
  padding: 16px 6px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.video-episode-rail strong {
  font-size: 13px;
  margin-bottom: 4px;
}

.video-episode-rail button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #606779;
  font-weight: 700;
}

.video-episode-rail button.active,
.video-episode-rail button:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.video-main-workspace {
  min-width: 0;
  padding: 10px 14px 18px;
}

.cinema-player {
  position: relative;
  height: clamp(520px, calc(100vh - 322px), 820px);
  border: 1px solid #dfe4f2;
  border-radius: 12px 12px 0 0;
  background: #000;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(26, 34, 58, 0.08);
}

.shot-title {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.edit-video-button {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-weight: 700;
}

.player-side-tools {
  position: absolute;
  right: 18%;
  bottom: 20px;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.player-side-tools button {
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 700;
}

.player-control-strip {
  min-height: 48px;
  border: 1px solid #dfe4f2;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #303747;
  font-size: 12px;
  font-weight: 700;
}

.player-control-strip button {
  border: 0;
  background: transparent;
  color: #51586b;
}

.player-control-strip .play-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #56596b;
  color: #fff;
}

.timeline-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 14px 8px;
}

.timeline-ruler {
  height: 28px;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: #9ba2b3;
  font-size: 11px;
}

.timeline-ruler i {
  height: 1px;
  background: repeating-linear-gradient(90deg, #d9deeb 0 2px, transparent 2px 36px);
}

.timeline-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.timeline-shot {
  flex: 0 0 210px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 7px;
  text-align: left;
  color: #4d5569;
}

.timeline-shot.wide {
  flex-basis: 390px;
}

.timeline-shot.active,
.timeline-shot:hover {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px #c6caff;
}

.timeline-shot span {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  color: #596176;
}

.timeline-shot div {
  height: 48px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, 1fr);
  overflow: hidden;
  border-radius: 5px;
}

.timeline-shot img {
  width: 100%;
  height: 48px;
  object-fit: cover;
}

.timeline-shot.placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  color: #b3bac9;
  background: #f8f9fd;
}

.timeline-shot.placeholder em {
  font-style: normal;
  font-size: 12px;
}

.timeline-panel p {
  margin: 4px 0 0;
  text-align: center;
  color: #a3a9b8;
  font-size: 12px;
}

.video-library-head {
  min-height: 86px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.video-library-head h2 {
  margin: 4px 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

.video-library-head p {
  margin: 0;
  color: #71798d;
  font-size: 15px;
}

.video-library-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.video-library-actions button,
.video-player-caption button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #2d3446;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.video-library-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.video-library-layout {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  min-height: calc(100vh - 160px);
}

.video-episode-list {
  padding: 22px 8px;
  border-right: 1px solid var(--line);
  background: #fff;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
}

.video-episode-list strong {
  margin-bottom: 6px;
  font-size: 13px;
}

.video-episode-list button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #4d5568;
  font-size: 18px;
  font-weight: 800;
}

.video-episode-list button.active,
.video-episode-list button:hover {
  border-color: var(--primary);
  background: #f2f4ff;
  color: var(--primary);
}

.video-episode-list em {
  position: absolute;
  right: -5px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  line-height: 18px;
}

.video-library-main {
  min-width: 0;
  padding: 18px 24px 28px;
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.video-library-player {
  position: sticky;
  top: 18px;
  min-height: 520px;
  border-radius: 18px;
  overflow: hidden;
  background: #05070c;
  box-shadow: 0 18px 40px rgba(30, 38, 64, 0.16);
}

.video-library-player > video {
  width: 100%;
  height: min(68vh, 680px);
  min-height: 520px;
  display: block;
  object-fit: contain;
  background: #05070c;
}

.video-player-caption {
  min-height: 72px;
  padding: 14px 16px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
}

.video-player-caption strong,
.video-player-caption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-player-caption span {
  color: #737b8e;
  font-size: 13px;
}

.video-player-caption button {
  grid-row: span 2;
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.video-shot-library {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.video-shot-library-head {
  min-height: 62px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-shot-library-head h3 {
  margin: 0;
  font-size: 19px;
}

.video-shot-library-head span {
  color: #7a8295;
  font-weight: 800;
}

.video-shot-list {
  display: grid;
  gap: 0;
}

.video-shot-item {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) 40px;
  gap: 14px;
  text-align: left;
  cursor: pointer;
}

.video-shot-item:last-child {
  border-bottom: 0;
}

.video-shot-item.active,
.video-shot-item:hover {
  background: #f7f8ff;
}

.video-shot-item video {
  width: 126px;
  height: 74px;
  border-radius: 10px;
  object-fit: cover;
  background: #080b12;
}

.video-shot-item strong,
.video-shot-item p,
.video-shot-item span {
  display: block;
  min-width: 0;
}

.video-shot-item strong {
  margin-top: 2px;
  color: #141925;
  font-size: 15px;
}

.video-shot-item p {
  margin: 6px 0 5px;
  color: #596176;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-shot-item span {
  color: #8790a4;
  font-size: 12px;
}

.video-shot-item button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
}

.video-empty-state {
  min-height: 520px;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #d8dce8;
  text-align: center;
}

.video-empty-state .material-symbols-rounded {
  font-size: 54px;
}

.video-empty-state h3 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.video-empty-state p {
  margin: 0;
  max-width: 360px;
  color: #aeb5c5;
  line-height: 1.7;
}

.video-empty-state button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
}

.video-shot-empty {
  padding: 28px 18px;
  color: #8a92a4;
  text-align: center;
}

@media (max-width: 1100px) {
  .video-library-main {
    grid-template-columns: 1fr;
  }

  .video-library-player {
    position: relative;
    top: auto;
  }
}

.final-player {
  position: relative;
  min-height: 560px;
  border-radius: 24px;
  overflow: hidden;
  background: #151922;
  box-shadow: var(--shadow);
}

.final-player img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
}

.player-overlay {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  min-height: 74px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  background: rgba(20, 25, 35, 0.78);
  color: #fff;
  backdrop-filter: blur(14px);
}

.player-overlay button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 99px;
  background: #fff;
  color: var(--primary);
}

.player-overlay span {
  margin-left: auto;
  color: #cdd2df;
}

.video-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.clip-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-align: left;
}

.clip-item.active {
  border-color: var(--primary);
}

.clip-item img {
  width: 112px;
  height: 76px;
  object-fit: cover;
  border-radius: 12px;
}

.clip-item strong,
.clip-item span {
  display: block;
}

.clip-item span {
  color: var(--muted);
}

.history-product {
  padding: 0 0 38px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 16px;
  padding: 0 min(4vw, 48px);
}

.history-card {
  position: relative;
  min-height: 330px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-card img {
  width: 100%;
  height: 178px;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: 16px;
}

.history-card h3 {
  margin: 10px 0 8px;
  font-size: 21px;
}

.history-card p {
  color: var(--muted);
}

.history-head .eyebrow {
  display: none;
}

.history-project-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.history-project-cover {
  aspect-ratio: 16 / 9;
  height: auto;
  margin-bottom: 0;
  border-radius: 16px;
}

.history-project-main h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.history-project-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: start;
}

.history-project-main h3,
.history-project-main .history-project-summary {
  grid-column: 1;
}

.history-project-main .primary-small {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  white-space: nowrap;
}

.history-project-summary {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.history-stage-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stage-pill {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.stage-pill em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.stage-pill.done {
  border-color: #c8f0df;
  background: #effbf6;
  color: #0d8d67;
}

.stage-pill.pending {
  background: #f5f6fa;
  color: #697086;
}

.featured-history {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: stretch;
}

.featured-history img {
  height: 100%;
  min-height: 290px;
  margin: 0;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.done {
  color: #0d8d67;
  background: #e9fbf4;
}

.badge.working {
  color: #8b650e;
  background: #fff4dd;
}

.badge.draft {
  color: #5f6680;
  background: #eef1f7;
}

.mini-product {
  min-height: calc(100vh - 78px);
  padding: 48px min(5vw, 76px);
  grid-template-columns: minmax(320px, 0.8fr) minmax(330px, 430px);
  align-items: center;
  gap: 58px;
}

.mini-product.active {
  display: grid;
}

.mini-copy h2 {
  margin: 10px 0 14px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
}

.mini-copy p {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.mini-feature-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.mini-feature-list button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 16px;
}

.mini-feature-list button.active {
  color: var(--primary);
  border-color: #c6caff;
  background: var(--primary-soft);
}

.phone-shell {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 390 / 760;
  margin: 0 auto;
  border: 10px solid #1b1f2a;
  border-radius: 42px;
  background: #f7f8fb;
  box-shadow: 0 30px 80px rgba(32, 38, 62, 0.22);
  overflow: hidden;
}

.phone-top {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 110px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #1b1f2a;
  z-index: 3;
}

.phone-screen {
  display: none;
  height: 100%;
  padding: 56px 20px 22px;
}

.phone-screen.active {
  display: block;
  animation: riseIn 0.28s ease both;
}

.phone-screen header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.phone-upload {
  padding: 28px 18px;
  border: 1px dashed #cfd6e7;
  border-radius: 24px;
  background: #fff;
  text-align: center;
}

.phone-upload .material-symbols-rounded {
  font-size: 46px;
  color: var(--primary);
}

.phone-upload h3 {
  margin: 10px 0 4px;
}

.phone-upload p,
.phone-screen p {
  color: var(--muted);
}

.phone-upload button,
.phone-screen > button {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.phone-row {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  justify-content: space-between;
}

.phone-cover {
  width: 100%;
  height: 218px;
  border-radius: 22px;
  object-fit: cover;
}

.phone-progress {
  height: 10px;
  margin: 18px 0;
  border-radius: 999px;
  background: #e7ebf4;
  overflow: hidden;
}

.phone-progress span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-strong), var(--mint));
}

.phone-project {
  width: 100%;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-align: left;
}

.phone-project.active {
  border-color: var(--primary);
}

.phone-project img {
  width: 82px;
  height: 82px;
  border-radius: 14px;
  object-fit: cover;
}

.phone-project strong,
.phone-project em {
  display: block;
  font-style: normal;
}

.phone-project em {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .storyboard-grid,
  .video-board,
  .history-grid {
    grid-template-columns: 1fr;
  }

  .role-asset-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .featured-history {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 74px auto minmax(0, 1fr);
  }

  .side-nav {
    position: static;
    height: auto;
    grid-column: 1;
    grid-row: 2;
    padding: 14px;
  }

  .main-stage {
    grid-column: 1;
    grid-row: 3;
  }

  .primary-nav {
    grid-template-columns: 1fr 1fr;
  }

  .quick-steps {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 1fr);
    padding: 0;
  }

  .quick-step {
    justify-content: center;
    text-align: center;
  }

  .topbar,
  .section-head,
  .creation-toolbar,
  .story-topline,
  .shot-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
    flex-direction: row;
    align-items: center;
  }

  .top-brand img {
    width: 96px;
  }

  .top-brand span {
    font-size: 18px;
  }

  .login-area span {
    display: none;
  }

  .top-actions,
  .select-row {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .step {
    min-width: max-content;
  }

  .upload-hero {
    padding: 38px 16px;
  }

  .dropzone {
    width: 100%;
    min-height: 260px;
  }

  .creation-toolbar {
    width: 100%;
  }

  .dropzone p {
    font-size: 16px;
    padding: 0 18px;
  }

  .primary-cta {
    min-width: 0;
    width: 100%;
    margin-top: 42px;
  }

  .script-layout,
  .episode-grid {
    grid-template-columns: 1fr;
  }

  .script-detail-page {
    padding: 28px 18px 48px;
  }

  .script-hero-card {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 24px;
  }

  .script-next-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 136px;
    height: 52px;
    margin: 0;
    font-size: 18px;
  }

  .script-next-button:hover,
  .script-next-button:active {
    transform: translateX(-50%);
  }

  .floating-next {
    bottom: 20px;
    min-width: 136px;
    height: 52px;
    font-size: 18px;
  }

  .floating-next:hover,
  .floating-next:active {
    transform: translateX(-50%);
  }

  .script-field-row {
    grid-template-columns: 1fr;
  }

  .character-bio-grid {
    grid-template-columns: 1fr;
    row-gap: 22px;
  }

  .episode-tabs {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .asset-board {
    padding: 28px 16px 78px;
  }

  .asset-tabs {
    gap: 30px;
    margin-bottom: 40px;
  }

  .asset-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-asset-grid {
    grid-template-columns: 1fr;
  }

  .video-actionbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-editor-layout {
    grid-template-columns: 1fr;
  }

  .video-episode-rail {
    grid-auto-flow: column;
    justify-content: start;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cinema-player {
    height: 420px;
  }

  .player-side-tools {
    right: 18px;
  }

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

  .episode-rail {
    grid-auto-flow: column;
    overflow-x: auto;
    justify-content: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .cast-row {
    grid-template-columns: 44px 1fr;
  }

  .cast-row .muted-select,
  .cast-row .icon-button {
    grid-column: 2;
  }

  .mini-product.active {
    grid-template-columns: 1fr;
    padding: 32px 16px;
  }
}
