:root {
  color-scheme: dark;
  --bg: #0c0a11;
  --sidebar: #100d18;
  --surface: #15111f;
  --surface-2: #1b1627;
  --surface-3: #211a30;
  --line: #30283f;
  --line-strong: #49385d;
  --text: #f5f0fa;
  --muted: #9b92a8;
  --muted-2: #6f687b;
  --purple: #a970ff;
  --purple-strong: #8b4df0;
  --pink: #ed5eb7;
  --cyan: #51d8df;
  --gold: #f2be65;
  --green: #70d6a5;
  --danger: #ff7885;
  --focus: #aee8ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --sidebar-width: 224px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5fa;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f0f7;
  --surface-3: #ece7f2;
  --line: #d1c9da;
  --line-strong: #b9adc6;
  --text: #282230;
  --muted: #665e70;
  --muted-2: #756d7e;
  --purple: #7950b5;
  --purple-strong: #6840a2;
  --pink: #be4b88;
  --cyan: #197f8a;
  --gold: #9a6c1f;
  --green: #2c7b58;
  --danger: #b94456;
  --focus: #6f3eaa;
  --shadow: 0 20px 55px rgba(54, 43, 66, 0.12);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
}

.workspace {
  position: relative;
  isolation: isolate;
}

.workspace-backdrop {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  height: 310px;
  overflow: hidden;
  opacity: 0.34;
  pointer-events: none;
}

.workspace-backdrop::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 13, 24, 0.08), var(--bg) 92%);
  content: "";
}

.workspace-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: saturate(0.8) contrast(1.05);
}

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

button {
  border: 0;
}

button:not(:disabled),
select,
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

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

[hidden] {
  display: none !important;
}

/* Original and reference creation paths expose only the controls that belong to the active workflow. */
body[data-creation-mode="reference"] .mode-original-only {
  display: none !important;
}

.reference-studio[data-ready="false"] .reference-workflow-switch,
.reference-studio[data-ready="false"] .reference-analysis-grid,
.reference-studio[data-ready="false"] .reference-similarity,
.reference-studio[data-ready="false"] .reference-dimensions,
.reference-studio[data-ready="false"] .stem-mixer,
.reference-studio[data-ready="false"] .reference-transform-prompt,
.reference-studio[data-ready="false"] .reference-options,
.reference-studio[data-ready="false"] .reference-rights {
  opacity: 0.58;
}

.reference-studio[data-ready="false"] .reference-studio__header small::after {
  content: " · 上传原曲后解锁";
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

.theme-toggle {
  display: grid;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--purple);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.theme-toggle__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  width: 42px;
  height: 22px;
  padding: 0 4px;
  border-radius: 5px;
  background: #21192b;
}

.theme-toggle__track .icon {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  justify-self: center;
  pointer-events: none;
}

.theme-toggle__sun {
  color: #a39aaa;
}

.theme-toggle__moon {
  color: #f0e8f7;
}

.theme-toggle__track i {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #7450a8;
  box-shadow: 0 2px 8px rgba(13, 9, 18, 0.3);
  transition: right 180ms ease, transform 180ms ease, background 180ms ease;
}

:root[data-theme="light"] .theme-toggle__track {
  background: #eee9f3;
}

:root[data-theme="light"] .theme-toggle__track i {
  right: 22px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(82, 62, 100, 0.2);
}

:root[data-theme="light"] .theme-toggle__sun {
  color: #8055b9;
}

:root[data-theme="light"] .theme-toggle__moon {
  color: #99909f;
}

.auth-theme-toggle {
  position: absolute;
  z-index: 2;
  top: 30px;
  right: 36px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background-color: #0b0910;
  background-image:
    linear-gradient(rgba(169, 112, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(81, 216, 223, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
}

.auth-stage {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 390px);
  gap: 72px;
  align-items: center;
}

.auth-brand {
  position: absolute;
  top: 32px;
  left: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand > span:last-child,
.auth-brand b,
.auth-brand small {
  display: block;
}

.auth-brand b {
  font-size: 18px;
}

.auth-brand small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.auth-copy h1 {
  margin: 14px 0 10px;
  font-size: 38px;
  font-weight: 720;
  line-height: 1.15;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 15px;
  padding: 28px;
  border: 1px solid #4b385f;
  border-radius: 8px;
  background: #15111e;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f0d14;
}

.sms-code-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 7px;
}

.sms-code-row button {
  border: 1px solid #543b70;
  border-radius: 6px;
  color: #dac4f8;
  background: #281b36;
  font-size: 9px;
}

.auth-tabs button {
  min-height: 34px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}

.auth-tabs button.is-active {
  color: #fff;
  background: #352247;
}

.auth-form label,
.auth-form label > span {
  display: grid;
}

.auth-form label {
  gap: 7px;
}

.auth-form label > span {
  color: var(--muted);
  font-size: 9px;
}

.auth-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #0e0c13;
}

.auth-form input:focus {
  border-color: var(--purple);
}

.auth-submit {
  min-height: 42px;
  margin-top: 3px;
}

.auth-feedback {
  min-height: 18px;
  margin: 0;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
}

.auth-feedback.is-error {
  color: var(--danger);
}

.auth-feedback.is-success {
  color: var(--green);
}

.puzzle-captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.puzzle-captcha-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 4, 8, 0.76);
  backdrop-filter: blur(8px);
}

.puzzle-captcha-panel {
  position: relative;
  width: min(372px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid #4b385f;
  border-radius: 8px;
  background: #15111e;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
}

.puzzle-captcha-panel > header,
.puzzle-captcha-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.puzzle-captcha-panel > header {
  margin-bottom: 14px;
}

.puzzle-captcha-panel > header small,
.puzzle-captcha-panel > header h2 {
  display: block;
}

.puzzle-captcha-panel > header small {
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 8px;
}

.puzzle-captcha-panel > header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 680;
}

.puzzle-captcha-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--captcha-width, 320) / var(--captcha-height, 160);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #0b0910;
}

.puzzle-captcha-stage img {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
}

#puzzleCaptchaBackground {
  inset: 0;
  width: 100%;
  height: 100%;
}

#puzzleCaptchaPiece {
  top: var(--captcha-piece-y, 0%);
  left: var(--captcha-piece-x, 0%);
  width: var(--captcha-piece-size, 15.625%);
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
}

#puzzleCaptchaLoading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 9px;
  background: #0e0c13;
}

.puzzle-captcha-stage:not([aria-busy="true"]) #puzzleCaptchaLoading {
  display: none;
}

.puzzle-captcha-status-row {
  min-height: 34px;
  margin-top: 7px;
}

.puzzle-captcha-status-row > span {
  color: var(--muted);
  font-size: 9px;
}

.puzzle-captcha-status-row > span.is-error {
  color: var(--danger);
}

.puzzle-captcha-status-row > span.is-success {
  color: var(--green);
}

.puzzle-captcha-status-row .icon-button,
.puzzle-captcha-panel > header .icon-button {
  width: 30px;
  height: 30px;
}

.puzzle-captcha-slider {
  position: relative;
  display: block;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0e0c13;
  touch-action: none;
  user-select: none;
}

.puzzle-captcha-slider > span {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 40px;
  place-items: center;
  color: #f1e8fb;
  background: #352247;
  transform: translateX(var(--captcha-slider-offset, 0px));
  transition: background 160ms ease;
  pointer-events: none;
}

.puzzle-captcha-slider input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0.001;
  touch-action: none;
  cursor: grab;
}

.puzzle-captcha-slider input[type="range"]:active {
  cursor: grabbing;
}

.puzzle-captcha-slider:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.puzzle-captcha-slider:has(input:disabled) {
  opacity: 0.55;
}

.profile small {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 7px;
}

#memberPoints {
  color: var(--gold);
}

.wallet-modal {
  width: min(880px, calc(100vw - 32px));
}

.wallet-balance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d16;
}

.wallet-balance > span {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.wallet-balance > span:last-child {
  border-right: 0;
}

.wallet-balance small,
.wallet-balance b {
  display: block;
}

.wallet-balance small {
  color: var(--muted);
  font-size: 9px;
}

.wallet-balance b {
  margin-top: 7px;
  font-size: 17px;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(135px, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.package-option {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 164px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #171220;
}

.package-option::after {
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(81, 216, 223, 0.32);
  content: "";
  transform: rotate(28deg);
}

.package-option > span {
  color: var(--muted);
  font-size: 9px;
}

.package-option > b {
  font-size: 25px;
}

.package-option > small {
  min-height: 30px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.package-option button {
  position: relative;
  z-index: 1;
  align-self: end;
}

.payment-status {
  min-height: 42px;
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--cyan);
  color: var(--muted);
  background: #100d16;
  font-size: 10px;
  line-height: 1.7;
}

.payment-qr {
  display: flex;
  align-items: center;
  gap: 16px;
}

.payment-qr img {
  width: 132px;
  height: 132px;
  padding: 5px;
  border-radius: 5px;
  background: #fff;
}

.payment-qr b,
.payment-qr small,
.payment-complete b,
.payment-complete span {
  display: block;
}

.payment-qr b,
.payment-complete b {
  color: var(--text);
  font-size: 12px;
}

.payment-qr small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
}

.payment-complete {
  padding: 8px 4px;
  color: var(--green);
}

.visual-asset-builder {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d16;
}

.character-assets {
  margin: 14px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #100d16;
}

.character-assets > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.character-assets > header span,
.character-assets > header b,
.character-assets > header small {
  display: block;
}

.character-assets > header b {
  font-size: 11px;
}

.character-assets > header small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.character-assets > header em {
  flex: 0 0 auto;
  color: var(--cyan);
  font-size: 8px;
  font-style: normal;
}

.character-asset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.character-asset-list > .character-asset:only-child {
  grid-column: 1 / -1;
}

.character-asset {
  display: grid;
  grid-template-columns: minmax(168px, 0.78fr) minmax(220px, 1.22fr);
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: #100d16;
}

.character-asset .asset-preview {
  position: relative;
  min-height: 0;
  aspect-ratio: 1;
  align-self: start;
}

.character-asset .asset-preview img {
  height: 100%;
  object-fit: contain;
}

.character-asset .asset-preview small {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 8px;
  color: #e8e1ef;
  background: rgba(11, 10, 15, 0.88);
}

.asset-preview {
  display: grid;
  min-height: 142px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #57436c;
  border-radius: 6px;
  color: var(--muted);
  background: #0b0a0f;
}

.asset-preview > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #271a35;
}

.asset-preview img {
  width: 100%;
  height: 112px;
  object-fit: cover;
}

.asset-preview small {
  align-self: start;
  padding: 0 8px;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-controls {
  display: grid;
  gap: 9px;
}

.scene-assets {
  margin: 14px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #100d16;
}

.scene-assets > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.scene-assets > header span,
.scene-assets > header b,
.scene-assets > header small {
  display: block;
}

.scene-assets > header b {
  font-size: 11px;
}

.scene-assets > header small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.scene-asset-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.scene-asset {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(240px, 1.28fr);
  gap: 13px;
  min-width: 0;
  padding: 14px;
  background: #100d16;
}

.scene-asset .asset-preview {
  position: relative;
  min-height: 0;
  aspect-ratio: 16 / 9;
  align-self: start;
}

.scene-asset .asset-preview img {
  height: 100%;
  object-fit: cover;
}

.scene-asset .asset-preview small {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 8px;
  color: #e8e1ef;
  background: rgba(11, 10, 15, 0.88);
}

.asset-control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.asset-control-buttons .icon {
  width: 13px;
  height: 13px;
}

.asset-control-buttons [data-remove-scene] {
  min-width: 36px;
  padding: 0 10px;
  color: var(--danger);
}

.random-scene-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}

.random-scene-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

.random-scene-toggle b,
.random-scene-toggle small {
  display: block;
}

.random-scene-toggle b {
  font-size: 9px;
}

.random-scene-toggle small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
}

.asset-controls label {
  display: grid;
  gap: 6px;
}

.asset-controls label > span,
.asset-controls > small {
  color: var(--muted);
  font-size: 9px;
}

.asset-controls > .character-control-head {
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.character-control-head > label {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.character-gender-switch {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  padding: 2px;
  border: 1px solid #3a3045;
  border-radius: 6px;
  background: #0a090d;
}

.character-gender-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  color: var(--muted-2);
  font: inherit;
  font-size: 8px;
  letter-spacing: 0;
  cursor: pointer;
  background: transparent;
}

.character-gender-switch button:hover {
  color: var(--text);
  background: #18121f;
}

.character-gender-switch button.is-selected {
  color: #f4eef8;
  background: #51317c;
}

.character-gender-switch .icon {
  width: 10px;
  height: 10px;
  opacity: 0;
}

.character-gender-switch button.is-selected .icon {
  opacity: 1;
}

.asset-controls textarea,
.scene-item textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  outline: 0;
  background: #0c0a11;
  resize: vertical;
}

.scene-prompt-label {
  display: grid;
  gap: 7px;
}

.scene-prompt-label > span {
  color: var(--muted-2);
  font-size: 8px;
}

.scene-prompt-check {
  display: block;
  min-height: 16px;
  margin-top: 7px;
  color: #e7a8b3;
  font-size: 8px;
  line-height: 1.5;
}

.scene-prompt-check.is-complete {
  color: var(--green);
}

.scene-preview {
  display: grid;
  align-content: start;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.scene-preview__media {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  place-items: center;
  border: 1px solid #332a3e;
  border-radius: 6px;
  background: #070609;
  aspect-ratio: 16 / 9;
}

.scene-preview__media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050407;
}

.scene-preview__media > span {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 14px;
  color: var(--muted-2);
  text-align: center;
}

.scene-preview__media > span .icon {
  width: 24px;
  height: 24px;
  color: var(--purple);
}

.scene-preview__media > span b {
  color: var(--muted);
  font-size: 9px;
}

.scene-preview__media > span small {
  max-width: 260px;
  font-size: 7px;
  line-height: 1.5;
}

.scene-preview__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding-top: 9px;
}

.scene-preview__actions span,
.scene-preview__actions b,
.scene-preview__actions small {
  display: block;
}

.scene-preview__actions small {
  color: var(--muted-2);
  font-size: 7px;
}

.scene-preview__actions b {
  max-width: 190px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-preview__actions .primary-button {
  flex: 0 0 auto;
  min-width: 118px;
}

.scene-preview__actions .primary-button.is-incomplete {
  border-color: #67424a;
  color: #e7b5bd;
  background: #2a181e;
}

.scene-preview__actions .primary-button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.asset-controls textarea:focus,
.scene-item textarea:focus {
  border-color: var(--purple);
}

.asset-controls > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.storyboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--pink);
  background: #15101c;
}

.mv-lyrics-sync-control {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 24px 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid #52606a;
  border-radius: 6px;
  color: var(--text);
  background: #0f1316;
  cursor: pointer;
}

.mv-lyrics-sync-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.mv-lyrics-sync-control span,
.mv-lyrics-sync-control b,
.mv-lyrics-sync-control small {
  display: block;
  min-width: 0;
}

.mv-lyrics-sync-control b {
  font-size: 12px;
}

.mv-lyrics-sync-control small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.mv-lyrics-sync-control.is-enabled {
  border-left-color: var(--pink);
  background: #15101c;
}

.mv-lyrics-sync-control.is-ready {
  border-left-color: var(--cyan);
}

.mv-lyrics-sync-control.is-error {
  border-left-color: var(--danger);
}

.storyboard-toolbar b,
.storyboard-toolbar small {
  display: block;
}

.storyboard-toolbar b {
  font-size: 11px;
}

.storyboard-toolbar small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.scene-item blockquote {
  margin: 8px 0;
  padding: 7px 9px;
  border-left: 2px solid var(--cyan);
  color: #c7bbcE;
  background: #100d16;
  font-size: 9px;
  line-height: 1.6;
}

.scene-item textarea {
  min-height: 106px;
  font-size: 10px;
  line-height: 1.75;
}

.video-preview-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(170px, 0.5fr);
  gap: 14px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f0d14;
}

.video-preview-panel video {
  width: 100%;
  max-height: 380px;
  border-radius: 6px;
  background: #050407;
}

.video-preview-panel > div {
  display: grid;
  align-content: center;
  gap: 8px;
}

.video-preview-panel b,
.video-preview-panel small {
  display: block;
}

.video-preview-panel small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.video-preview-panel a {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 760px) {
  .package-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .wallet-balance {
    grid-template-columns: 1fr;
  }

  .wallet-balance > span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .visual-asset-builder,
  .video-preview-panel {
    grid-template-columns: 1fr;
  }

  .character-asset-list,
  .scene-item {
    grid-template-columns: 1fr;
  }

  .character-asset-list > .character-asset:only-child {
    grid-column: auto;
  }

  .scene-preview {
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .storyboard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: rgba(16, 13, 24, 0.96);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 8px;
  color: var(--text);
  text-decoration: none;
}

.brand--sidebar-logo {
  justify-content: flex-start;
  min-height: 104px;
  padding: 0 12px;
}

.sidebar-brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
}

.brand-mark::after {
  content: none;
}

.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark .icon {
  width: 23px;
  height: 23px;
  stroke-width: 2.2;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy b {
  font-size: 17px;
  font-weight: 700;
}

.brand-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.main-nav {
  display: grid;
  gap: 4px;
  margin-top: 34px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  overflow: hidden;
  border-radius: 7px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item::before {
  position: absolute;
  inset: 50% auto auto -16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 18px 6px rgba(169, 112, 255, 0.42);
  content: "";
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 180ms ease, left 180ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: #1a1524;
  transform: translateX(2px);
}

.nav-item.is-active {
  color: #fff;
  background: #241a33;
  box-shadow: inset 0 0 0 1px rgba(169, 112, 255, 0.14);
}

.nav-item.is-active::before {
  left: 1px;
  opacity: 1;
}

.sidebar-spacer {
  flex: 1;
  min-height: 24px;
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 4px;
  padding: 12px 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.engine-status b,
.engine-status small {
  display: block;
}

.engine-status b {
  font-size: 11px;
  font-weight: 650;
}

.engine-status small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.engine-orbit {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(81, 216, 223, 0.36);
  border-radius: 50%;
}

.engine-orbit::before,
.engine-orbit::after {
  position: absolute;
  border: 1px solid rgba(81, 216, 223, 0.35);
  border-radius: 50%;
  content: "";
}

.engine-orbit::before {
  width: 20px;
  height: 8px;
  transform: rotate(38deg);
}

.engine-orbit::after {
  width: 20px;
  height: 8px;
  transform: rotate(-38deg);
}

.engine-orbit i,
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(81, 216, 223, 0.9);
}

.profile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 6px 0;
}

.profile b,
.profile small {
  display: block;
}

.profile b {
  font-size: 11px;
  font-weight: 650;
}

.profile small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.profile > .icon {
  width: 13px;
  color: var(--muted-2);
}

.profile-logout {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted-2);
  background: transparent;
}

.profile-logout:hover {
  color: var(--danger);
  background: rgba(255, 120, 133, 0.09);
}

.profile-logout .icon {
  width: 14px;
  height: 14px;
}

.mobile-account-button {
  display: none;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px;
  min-width: 38px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #141119;
}

.mobile-account-button .icon {
  width: 14px;
  height: 14px;
}

.mobile-account-button span {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 700;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  overflow: hidden;
  place-items: center;
  border: 1px solid #584269;
  border-radius: 7px;
  color: #efe3ff;
  font-size: 10px;
  font-weight: 750;
  background: #2c1f39;
}

.avatar.has-image {
  border-color: rgba(255, 255, 255, 0.16);
  background: #17121d;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 10, 17, 0.88);
  backdrop-filter: blur(18px);
}

.breadcrumbs,
.top-actions,
.save-state,
.assistant-toggle,
.head-meta,
.text-button,
.field-label,
.section-heading > div,
.draft-badge,
.transport-buttons,
.export-actions,
.modal-actions,
.settings-grid,
.state-pill {
  display: flex;
  align-items: center;
}

.breadcrumbs {
  gap: 7px;
  min-width: 0;
  color: var(--muted-2);
  font-size: 11px;
}

.breadcrumbs .icon {
  width: 12px;
  height: 12px;
}

.breadcrumbs strong {
  overflow: hidden;
  color: var(--muted);
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  gap: 9px;
}

.save-state {
  gap: 7px;
  margin-right: 6px;
  color: var(--muted-2);
  font-size: 10px;
}

.save-state .icon {
  width: 15px;
  color: var(--green);
}

.icon-button {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #15121c;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: #5a456e;
  color: var(--text);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.mobile-settings-button {
  display: none;
}

.notification-panel { position: fixed; z-index: 80; top: 62px; right: 24px; width: min(420px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 86px)); overflow: hidden; border: 1px solid #4a385c; border-radius: 8px; background: #15111e; box-shadow: 0 24px 70px rgba(0,0,0,.58); }
.notification-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.notification-panel__head h2 { margin-top: 7px; font-size: 17px; }
.notification-panel__head p { margin: 5px 0 0; color: var(--muted-2); font-size: 9px; }
.notification-panel__toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.notification-panel__toolbar button { min-height: 27px; padding: 0 9px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); font-size: 9px; background: transparent; }
.notification-panel__toolbar button:hover, .notification-panel__toolbar button.is-active { border-color: rgba(169,112,255,.42); color: var(--text); background: #251933; }
.notification-panel__toolbar button[data-notification-read-all] { margin-left: auto; color: var(--cyan); }
.notification-list { display: grid; gap: 7px; max-height: min(510px, calc(100vh - 190px)); padding: 12px 14px 16px; overflow: auto; }
.notification-state { display: grid; place-items: center; min-height: 112px; color: var(--muted-2); font-size: 9px; }
.notification-state.is-error { color: var(--danger); }
.notification-retry { min-height: 27px; margin-top: 9px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--cyan); background: transparent; }
.notification-item { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #100d16; }
.notification-item.is-unread { border-color: rgba(169,112,255,.36); background: #171121; }
.notification-item__icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 6px; color: var(--cyan); background: #12272d; }
.notification-item__content { min-width: 0; }
.notification-item__head { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.notification-item__head b { color: var(--text); font-size: 10px; }
.notification-item__head time { flex: 0 0 auto; color: var(--muted-2); font-size: 8px; }
.notification-item__content p { margin: 5px 0 0; color: #aaa0b2; font-size: 9px; line-height: 1.55; }

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 7px rgba(237, 94, 183, 0.9);
}

.assistant-toggle {
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
  background: #15121c;
}

.assistant-toggle[aria-pressed="true"] {
  border-color: rgba(169, 112, 255, 0.45);
  color: #e5d4fb;
  background: #251a34;
}

.assistant-toggle .icon {
  width: 15px;
}

.content-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 30px 22px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 750;
}

.eyebrow i {
  width: 16px;
  height: 1px;
  background: currentColor;
}

.project-title {
  display: block;
  width: min(640px, 100%);
  margin: 8px 0 4px;
  padding: 0;
  border: 0;
  color: var(--text);
  font-size: 31px;
  font-weight: 720;
  line-height: 1.25;
  background: transparent;
}

.content-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.head-meta {
  gap: 8px;
  flex: 0 0 auto;
}

.ghost-button,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 650;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ghost-button,
.secondary-button {
  color: var(--muted);
  background: #141119;
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: #5e4774;
  color: var(--text);
  background: #21192b;
  transform: translateY(-1px);
}

.primary-button {
  border-color: #9a64e9;
  color: #fff;
  background: #7540bd;
  box-shadow: 0 8px 25px rgba(110, 57, 173, 0.22);
}

.primary-button:hover {
  border-color: #c39bff;
  background: #8750ca;
  box-shadow: 0 10px 30px rgba(139, 77, 240, 0.32);
  transform: translateY(-1px);
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(350px, 0.95fr) minmax(410px, 1.1fr) 282px;
  align-items: stretch;
  min-width: 0;
  margin: 0 18px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 14, 26, 0.96);
  box-shadow: var(--shadow);
  transition: grid-template-columns 240ms ease;
}

.studio-layout.is-assistant-closed {
  grid-template-columns: minmax(350px, 0.92fr) minmax(450px, 1.35fr);
}

.composer-panel,
.preview-panel,
.assistant-panel {
  min-width: 0;
  align-self: stretch;
  padding: 20px;
}

.composer-panel,
.preview-panel {
  border-right: 1px solid var(--line);
}

.studio-layout.is-assistant-closed .preview-panel {
  border-right: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 30px;
  margin-bottom: 17px;
}

.section-heading > div {
  gap: 9px;
}

.section-heading h2,
.assistant-head h2,
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 680;
}

.step-index {
  color: var(--purple);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.mode-switch,
.duration-switch,
.prompt-tabs,
.song-mode-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f0d14;
}

.mode-switch button,
.duration-switch button,
.prompt-tabs button,
.song-mode-switch button {
  min-height: 25px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--muted-2);
  font-size: 9px;
  background: transparent;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.mode-switch button.is-active,
.duration-switch button.is-active,
.prompt-tabs button.is-active,
.song-mode-switch button.is-active {
  color: #f3eafa;
  background: #30213f;
  box-shadow: inset 0 0 0 1px rgba(169, 112, 255, 0.16);
}

.prompt-field {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d16;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.prompt-field:focus-within {
  border-color: #76569c;
  box-shadow: 0 0 0 3px rgba(169, 112, 255, 0.08);
}

.prompt-field > span:first-child {
  display: block;
  padding: 11px 12px 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.prompt-field textarea {
  display: block;
  width: 100%;
  min-height: 86px;
  padding: 8px 12px 28px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: #eee6f5;
  font-size: 11px;
  line-height: 1.65;
  background: transparent;
}

.prompt-field textarea::placeholder {
  color: #5d5667;
}

.song-type-group {
  margin-top: 14px;
}

.composer-disclosure {
  margin-top: 17px;
  border-top: 1px solid var(--line);
}

.composer-disclosure > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.composer-disclosure > summary::-webkit-details-marker {
  display: none;
}

.composer-disclosure > summary small {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-disclosure > summary .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

.composer-disclosure:not([open]) > summary .icon {
  transform: rotate(0deg);
}

.composer-disclosure__body {
  padding: 2px 0 4px;
}

.composer-disclosure__body.field-group,
.composer-disclosure__body > .field-group,
.composer-disclosure__body > .parameter-grid {
  margin-top: 0;
}

.dialect-control {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d16;
}

.voice-library > .dialect-control {
  margin-bottom: 15px;
}

.dialect-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dialect-selectors label,
.dialect-selectors label > span {
  display: block;
  min-width: 0;
}

.dialect-selectors label > span {
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 7px;
}

.dialect-selectors select {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 9px;
  background: #0b0a0f;
}

.dialect-selectors select:disabled {
  color: #5d5667;
  opacity: 0.72;
}

.song-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.song-mode-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 33px;
}

.song-mode-switch .icon {
  width: 14px;
  height: 14px;
}

.lyrics-editor {
  position: relative;
  margin-top: 15px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d16;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.lyrics-editor:focus-within {
  border-color: #76569c;
  box-shadow: 0 0 0 3px rgba(169, 112, 255, 0.08);
}

.lyrics-editor textarea {
  display: block;
  width: 100%;
  min-height: 188px;
  padding: 2px 4px 23px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: #ded4e5;
  font-size: 9px;
  line-height: 1.72;
  background: transparent;
}

.lyrics-editor[hidden] {
  display: none;
}

.lyrics-editor .field-label {
  align-items: flex-start;
  flex-wrap: wrap;
}

.lyrics-field-heading {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.lyrics-adaptation-status {
  padding: 3px 6px;
  border: 1px solid rgba(241, 183, 81, 0.3);
  border-radius: 4px;
  color: #f2c46f !important;
  font-size: 7px !important;
  line-height: 1;
  background: rgba(241, 183, 81, 0.08);
}

.lyrics-adaptation-status[hidden] {
  display: none;
}

.lyrics-editor .text-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.lyrics-count {
  position: absolute;
  right: 11px;
  bottom: 8px;
  color: var(--muted-2);
  font-size: 7px;
}

.field-corner {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 8px;
}

.field-corner .icon {
  width: 13px;
  height: 13px;
  color: var(--purple);
}

.reference-drop {
  margin-top: 12px;
  border: 1px dashed #4b3b60;
  border-radius: 7px;
  background: rgba(169, 112, 255, 0.035);
}

.reference-drop > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.reference-drop > button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: transparent;
}

.reference-drop > button:hover .upload-icon {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

.reference-drop b,
.reference-drop small {
  display: block;
}

.reference-drop b {
  font-size: 10px;
}

.reference-drop small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
}

.upload-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--purple);
  transition: border-color 170ms ease, color 170ms ease, transform 170ms ease;
}

.upload-result {
  margin: 0 10px 10px;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.upload-result b {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-studio {
  margin: 0 10px 10px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.reference-studio__header,
.stem-mixer > header,
.reference-similarity__heading,
.reference-transform-prompt > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reference-studio__header small,
.reference-studio__header h3,
.reference-workflow-switch b,
.reference-workflow-switch small,
.reference-analysis-grid small,
.reference-analysis-grid b,
.reference-similarity__heading small,
.reference-similarity__heading b,
.stem-mixer header b,
.stem-mixer header small,
.stem-row b,
.stem-row small,
.reference-transform-prompt b,
.reference-transform-prompt small,
.reference-options b,
.reference-options small,
.reference-rights b,
.reference-rights small {
  display: block;
}

.reference-studio__header small {
  color: var(--cyan);
  font-size: 6px;
}

.reference-studio__header h3 {
  margin: 3px 0 0;
  font-size: 11px;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 6, 15, 0.82);
  backdrop-filter: blur(14px);
}
.welcome-modal[hidden] { display: none; }
.welcome-card {
  width: min(420px, 100%);
  padding: 38px;
  border: 1px solid rgba(184, 132, 255, 0.35);
  border-radius: 28px;
  background: linear-gradient(150deg, #201333, #120e1d 70%);
  box-shadow: 0 24px 80px rgba(8, 0, 28, 0.55);
  text-align: center;
}
.welcome-orb { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 20px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #a56bff, #6b3bbb); box-shadow: 0 0 38px rgba(159, 100, 255, 0.45); }
.welcome-card h2 { margin: 12px 0 10px; font-size: 30px; }
.welcome-card p { margin: 0 auto 24px; color: #b8adca; line-height: 1.7; }
.welcome-credit { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 26px; padding: 16px; border-radius: 16px; background: rgba(167, 111, 255, 0.12); text-align: left; }
.welcome-credit b { color: #d8baff; font-size: 38px; line-height: 1; }
.welcome-credit span { color: #f4effb; font-weight: 700; }
.welcome-credit small { color: #a99ab9; font-weight: 400; }

.mv-style-note {
  margin: 10px 0 0;
  color: #9f98ad;
  font-size: 12px;
  line-height: 1.6;
}

.reference-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 7px;
  white-space: nowrap;
}

.reference-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
}

.reference-status.is-ready {
  border-color: rgba(112, 214, 165, 0.28);
  color: var(--green);
  background: rgba(112, 214, 165, 0.05);
}

.reference-status.is-ready i {
  background: var(--green);
  box-shadow: 0 0 8px rgba(112, 214, 165, 0.65);
}

.reference-workflow-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 11px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0e0c13;
}

.reference-workflow-switch button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted-2);
  text-align: left;
  background: transparent;
}

.reference-workflow-switch button .icon {
  width: 15px;
  height: 15px;
}

.reference-workflow-switch button b {
  color: inherit;
  font-size: 8px;
}

.reference-workflow-switch button small {
  margin-top: 2px;
  color: inherit;
  font-size: 6px;
}

.reference-workflow-switch button.is-active {
  border-color: rgba(81, 216, 223, 0.28);
  color: #dbfcfb;
  background: #173036;
}

.reference-locks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.reference-locks span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid rgba(112, 214, 165, 0.24);
  border-radius: 4px;
  color: var(--green);
  font-size: 7px;
  background: rgba(112, 214, 165, 0.05);
}

.reference-locks .icon {
  width: 9px;
  height: 9px;
}

.reference-analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reference-analysis-grid > span {
  min-width: 0;
  padding: 8px 6px;
}

.reference-analysis-grid > span + span {
  border-left: 1px solid var(--line);
}

.reference-analysis-grid small {
  color: var(--muted-2);
  font-size: 6px;
}

.reference-analysis-grid b {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-similarity {
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
}

.reference-similarity__heading > span small {
  color: var(--muted);
  font-size: 7px;
}

.reference-similarity__heading > span b {
  margin-top: 2px;
  color: var(--cyan);
  font-size: 8px;
}

.reference-similarity__heading output {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.reference-similarity input {
  width: 100%;
  margin: 9px 0 4px;
}

.reference-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 6px;
}

.reference-dimensions {
  border-bottom: 1px solid var(--line);
}

.reference-dimensions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 8px;
  cursor: pointer;
}

.reference-dimensions summary span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 13px;
  padding: 0 0 10px;
}

.reference-dimension-grid label {
  min-width: 0;
}

.reference-dimension-grid label > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 7px;
}

.reference-dimension-grid input {
  width: 100%;
  margin: 5px 0 0;
}

.stem-mixer {
  padding: 11px 0 6px;
  border-bottom: 1px solid var(--line);
}

.stem-mixer > header > span:first-child {
  min-width: 0;
}

.stem-mixer header b {
  font-size: 8px;
}

.stem-mixer header small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stem-mixer > header > span:last-child {
  color: var(--cyan);
  font-size: 6px;
}

.stem-mixer__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stem-mixer__actions em {
  color: var(--cyan);
  font-size: 7px;
  font-style: normal;
}

.stem-mixer__actions .secondary-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
}

.stem-row.is-precise small {
  color: var(--green);
}

.stem-list {
  margin-top: 7px;
}

.stem-row {
  display: grid;
  grid-template-columns: 26px minmax(80px, 0.85fr) minmax(70px, 1.2fr) 26px 26px;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border-top: 1px solid rgba(48, 40, 63, 0.72);
}

.stem-row button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: #121019;
}

.stem-row button .icon {
  width: 12px;
  height: 12px;
}

.stem-row button:not(:disabled):hover,
.stem-row.is-playing .stem-play {
  border-color: var(--cyan);
  color: var(--cyan);
}

.stem-row .stem-master-download:not(:disabled):hover {
  border-color: var(--purple);
  color: var(--purple);
}

.stem-row > span {
  min-width: 0;
}

.stem-row b {
  font-size: 7px;
}

.stem-row small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 6px;
}

.stem-level {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(81, 216, 223, 0.8) var(--stem-level, 68%), #30283c var(--stem-level, 68%));
}

.reference-transform-prompt {
  display: block;
  margin-top: 11px;
}

.reference-transform-prompt b {
  font-size: 8px;
}

.reference-transform-prompt small {
  overflow: hidden;
  max-width: 72%;
  color: var(--muted-2);
  font-size: 6px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-transform-prompt textarea {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 8px 9px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--text);
  font-size: 8px;
  line-height: 1.55;
  background: #0d0b12;
}

.reference-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.reference-options label,
.reference-rights {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.reference-options label {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.012);
}

.reference-options input,
.reference-rights input {
  width: 14px;
  height: 14px;
  accent-color: var(--cyan);
}

.reference-options b,
.reference-rights b {
  font-size: 7px;
}

.reference-options small,
.reference-rights small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 6px;
  line-height: 1.35;
}

.reference-rights {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(242, 190, 101, 0.25);
  border-radius: 6px;
  background: rgba(242, 190, 101, 0.04);
}

.reference-rights b {
  color: #f4d493;
}

.field-group {
  margin-top: 18px;
}

.voice-library[hidden] {
  display: none;
}

.voice-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.voice-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  text-align: left;
  background: #101319;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.voice-option:hover {
  border-color: #4b6670;
  background: #151c21;
  transform: translateY(-1px);
}

.voice-option.is-selected {
  border-color: rgba(81, 216, 223, 0.62);
  color: var(--text);
  background: #142329;
}

.voice-option__mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #39525b;
  border-radius: 50%;
  color: var(--cyan);
  background: #0b1014;
}

.voice-option__mark .icon {
  width: 14px;
  height: 14px;
}

.voice-option span,
.voice-option b,
.voice-option small {
  display: block;
  min-width: 0;
}

.voice-option b {
  font-size: 9px;
  font-weight: 680;
}

.voice-option small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-option > em {
  padding: 2px 4px;
  border: 1px solid #4d5660;
  border-radius: 3px;
  color: #aeb8bf;
  font-size: 6px;
  font-style: normal;
}

.voice-option.is-cloud-only > em {
  border-color: #78563a;
  color: #e3b877;
}

.vocal-expression {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.vocal-expression > span,
.vocal-expression b,
.vocal-expression small {
  display: block;
  min-width: 0;
}

.vocal-expression b {
  font-size: 9px;
}

.vocal-expression small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
}

.vocal-expression-switch {
  display: grid;
  width: min(100%, 470px);
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  flex: 1 1 360px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0f12;
}

.vocal-expression-switch button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 7px;
  background: transparent;
}

.vocal-expression-switch button.is-active {
  color: #e9fbfa;
  background: #173036;
}

.dialogue-voices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dialogue-voices label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
}

.dialogue-voices select,
.lyrics-preview select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0c0f13;
}

.reference-voice-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.reference-voice-toggle input,
.subtitle-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
}

.reference-voice-toggle b,
.reference-voice-toggle small {
  display: block;
}

.reference-voice-toggle b {
  font-size: 8px;
}

.reference-voice-toggle small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
  line-height: 1.45;
}

.voice-tuning {
  margin-top: 9px;
  border-bottom: 1px solid var(--line);
}

.voice-tuning summary,
.lyric-timing-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 8px;
  cursor: pointer;
}

.voice-tuning summary span,
.lyric-timing-editor summary span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-tuning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 13px;
  padding-bottom: 11px;
}

.voice-tuning-grid label > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 7px;
}

.voice-tuning-grid output {
  color: var(--cyan);
}

.voice-parameter-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.voice-parameter-summary span {
  min-width: 0;
  padding: 8px 6px;
}

.voice-parameter-summary span + span {
  border-left: 1px solid var(--line);
}

.voice-parameter-summary small,
.voice-parameter-summary b {
  display: block;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-parameter-summary small {
  color: var(--muted-2);
  font-size: 6px;
}

.voice-parameter-summary b {
  margin-top: 4px;
  color: #d7edf0;
  font-size: 8px;
}

.field-label {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field-label small {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 500;
}

.text-button {
  gap: 5px;
  padding: 0;
  color: var(--purple);
  font-size: 11px;
  background: transparent;
}

.text-button:hover {
  color: #d8bcff;
}

.text-button .icon {
  width: 11px;
  height: 11px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.style-select-field {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.style-select-field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 10px;
}

.style-select-field small {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 500;
}

.style-select-field select {
  width: 100%;
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.style-select-field select[multiple] {
  height: 142px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.style-select-field select[multiple] option {
  min-height: 24px;
  padding: 5px 7px;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
}

.style-select-field select[multiple] option:checked {
  color: var(--purple-strong);
  background: rgba(121, 80, 181, 0.16);
}

.style-select-field select:hover,
.style-select-field select:focus {
  border-color: var(--purple);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(169, 112, 255, 0.08);
}

.mobile-style-wheel {
  display: none;
}

@media (min-width: 621px) {
  .style-select-field {
    display: none;
  }
}

.style-mix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(81, 216, 223, 0.18);
  border-radius: 7px;
  color: #d9d1e1;
  font-size: 12px;
  background: rgba(81, 216, 223, 0.04);
}

.style-mix-toolbar small {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 10px;
}

.style-mix-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.style-mix-actions output {
  max-width: 180px;
  overflow: hidden;
  color: var(--cyan);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-section-label {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 9px;
  color: #b9abc3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.style-section-label b {
  flex: 0 0 auto;
}

.style-section-label small {
  min-width: 0;
  overflow: hidden;
  color: #7f7289;
  font-size: 8px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-section-label::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.style-section-label:first-child {
  margin-top: 0;
}

.style-option {
  position: relative;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 49px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  text-align: left;
  background: #120f18;
  transition: border-color 170ms ease, background 170ms ease, transform 170ms ease;
}

.style-option:hover {
  border-color: #5a466d;
  background: #1c1625;
  transform: translateY(-1px);
}

.style-option.is-selected {
  border-color: rgba(169, 112, 255, 0.6);
  color: var(--text);
  background: #21172d;
  box-shadow: inset 0 0 20px rgba(169, 112, 255, 0.04);
}

.style-option span,
.style-option b,
.style-option small {
  display: block;
  min-width: 0;
}

.style-option b {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-option small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-option > .icon {
  width: 13px;
  height: 13px;
  color: var(--purple);
  opacity: 0;
}

.style-option.is-selected > .icon {
  opacity: 1;
}

.style-option.is-selected::before {
  position: absolute;
  top: 5px;
  right: 28px;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--cyan);
  font-size: 8px;
  content: "融合";
  background: rgba(81, 216, 223, 0.1);
}

.style-prompt-field {
  position: relative;
  display: block;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d16;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.style-prompt-field:focus-within,
.style-prompt-field.is-custom {
  border-color: rgba(81, 216, 223, 0.48);
  box-shadow: 0 0 0 3px rgba(81, 216, 223, 0.06);
}

.style-prompt-field > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px 0;
}

.style-prompt-field b,
.style-prompt-field small {
  display: block;
  min-width: 0;
  font-size: 8px;
}

.style-prompt-field b {
  color: var(--muted);
  font-weight: 650;
}

.style-prompt-field small {
  color: var(--muted-2);
}

.style-prompt-field.is-custom small {
  color: var(--cyan);
}

.style-prompt-field textarea {
  display: block;
  width: 100%;
  min-height: 70px;
  padding: 8px 11px 24px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: #eee6f5;
  font-size: 10px;
  line-height: 1.6;
  background: transparent;
}

.style-prompt-field textarea::placeholder {
  color: #5d5667;
}

.style-prompt-count {
  position: absolute;
  right: 10px;
  bottom: 7px;
  color: var(--muted-2);
  font-size: 7px;
}

.style-art {
  position: relative;
  display: block;
  width: 35px;
  height: 35px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background-color: #211b2b;
}

.style-art::before,
.style-art::after {
  position: absolute;
  content: "";
}

.style-electronic {
  background: repeating-linear-gradient(90deg, #1a1930 0 4px, #31215a 4px 5px);
}

.style-electronic::before {
  inset: 8px 6px;
  border-top: 2px solid var(--cyan);
  border-bottom: 2px solid var(--pink);
  transform: skewY(-22deg);
}

.style-pop {
  background: linear-gradient(140deg, #6d315f 0 44%, #272033 44% 60%, #d06081 60%);
}

.style-pop::after {
  top: 8px;
  left: 9px;
  width: 13px;
  height: 13px;
  border: 2px solid #f8d77e;
  transform: rotate(45deg);
}

.style-chinese {
  background: linear-gradient(90deg, #31253a 0 46%, #9a3d4d 46% 53%, #221b2b 53%);
}

.style-chinese::before {
  inset: 8px;
  border: 1px solid #e2c392;
  border-radius: 50% 50% 2px 2px;
}

.style-epic {
  background: linear-gradient(155deg, #20223a 0 42%, #69577a 43% 45%, #16131c 46%);
}

.style-epic::after {
  right: 6px;
  bottom: 7px;
  width: 18px;
  height: 8px;
  border-top: 1px solid var(--gold);
  transform: rotate(-24deg);
}

.style-jazz {
  background: repeating-linear-gradient(135deg, #3d2449 0 5px, #1c1925 5px 10px);
}

.style-jazz::after {
  right: 7px;
  bottom: 6px;
  width: 8px;
  height: 20px;
  border-left: 2px solid var(--gold);
  border-radius: 50%;
  transform: rotate(28deg);
}

.style-rock {
  background: #221c29;
}

.style-rock::before {
  inset: 5px;
  background: repeating-linear-gradient(120deg, transparent 0 6px, #d24a6d 6px 8px);
  transform: skewX(-10deg);
}

.parameter-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.86fr;
  gap: 9px;
  margin-top: 18px;
}

.duration-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auto-duration-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-2);
  font-size: 6px;
  cursor: pointer;
}

.auto-duration-toggle input {
  width: 12px;
  height: 12px;
  accent-color: var(--cyan);
}

.range-field,
.compact-field {
  display: block;
  min-width: 0;
}

.range-field > span,
.compact-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.range-field output {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 650;
}

input[type="range"] {
  width: 100%;
  height: 3px;
  margin: 8px 0;
  appearance: none;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--purple) var(--range-progress, 40%), #30283c var(--range-progress, 40%));
}

input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border: 2px solid #e9dcf7;
  border-radius: 50%;
  background: var(--purple-strong);
  box-shadow: 0 0 0 4px rgba(169, 112, 255, 0.1), 0 0 14px rgba(169, 112, 255, 0.45);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 7px;
  font-style: normal;
}

.duration-switch {
  width: 100%;
}

.duration-switch button {
  min-width: 0;
  flex: 1;
  padding: 0 5px;
}

.duration-field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.duration-field > label {
  color: var(--muted);
  font-size: 9px;
}

.duration-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27px;
  align-items: center;
  height: 33px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d14;
}

.duration-input-wrap:focus-within {
  border-color: var(--purple);
}

.duration-input-wrap input {
  width: 100%;
  height: 100%;
  padding: 0 4px 0 9px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.duration-input-wrap span {
  color: var(--muted-2);
  font-size: 8px;
}

.duration-field > small {
  color: var(--muted-2);
  font-size: 7px;
}

.compact-field select {
  width: 100%;
  height: 33px;
  padding: 0 24px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 9px;
  background: #100d14;
}

.emotion-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emotion-options button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 8px;
  background: #100d14;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.emotion-options button i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.emotion-options button.is-selected {
  border-color: #654987;
  color: #d7b8ff;
  background: #281c37;
}

/* Adapted from Uiverse creator gharsh11032000, cuddly-turkey-5 (MIT). */
.generate-button {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #17101f;
}

.generate-button::before {
  position: absolute;
  z-index: -2;
  inset: -2px;
  border-radius: 8px;
  background: linear-gradient(-45deg, var(--pink), var(--purple), var(--cyan), var(--gold));
  background-size: 240% 240%;
  content: "";
  pointer-events: none;
  transition: filter 450ms ease, transform 600ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.generate-button::after {
  position: absolute;
  z-index: -3;
  inset: 2px;
  border-radius: 8px;
  background: linear-gradient(-45deg, var(--pink), var(--purple), var(--cyan));
  content: "";
  filter: blur(18px);
  opacity: 0.34;
  transform: scale(0.96);
  transition: filter 300ms ease, opacity 300ms ease;
}

.generate-button:hover::before {
  filter: saturate(1.25);
  transform: rotateX(180deg);
  animation: border-flow 2s linear infinite;
}

.generate-button:hover::after {
  filter: blur(26px);
  opacity: 0.55;
}

.generate-button:active::before {
  transform: scale(0.98);
}

.generate-button__content {
  position: absolute;
  inset: 2px;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: 1fr 1fr;
  align-items: end;
  justify-content: center;
  column-gap: 9px;
  padding: 9px;
  border-radius: 6px;
  background: #17101f;
}

.generate-button__content .icon {
  grid-row: 1 / span 2;
  align-self: center;
  width: 20px;
  height: 20px;
  color: #dfc6ff;
}

.generate-button__content b {
  align-self: end;
  font-size: 11px;
  text-align: left;
}

.generate-button__content small {
  align-self: start;
  color: var(--muted-2);
  font-size: 7px;
  text-align: left;
}

.generate-button.is-generating .generate-button__content .icon {
  animation: wand-pulse 900ms ease-in-out infinite;
}

.generate-button.is-generating::before {
  animation: border-flow 1.1s linear infinite;
}

.generation-console {
  margin: 14px 0 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.generation-console .generate-button {
  margin-top: 0;
}

.generation-note {
  margin: 9px 4px 0;
  color: var(--muted-2);
  font-size: 7px;
  line-height: 1.45;
  text-align: center;
}

.generation-progress {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.generation-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 8px;
}

.generation-progress output {
  color: var(--cyan);
  font-weight: 700;
}

.generation-progress progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #292133;
}

.generation-progress progress::-webkit-progress-bar {
  border-radius: 4px;
  background: #292133;
}

.generation-progress progress::-webkit-progress-value {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transition: width 300ms ease;
}

.generation-progress progress::-moz-progress-bar {
  border-radius: 4px;
  background: var(--purple);
}

.charge-guard {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid rgba(112, 214, 165, 0.28);
  border-radius: 7px;
  color: var(--green);
  background: rgba(112, 214, 165, 0.055);
}

.charge-guard .icon {
  width: 16px;
}

.charge-guard b,
.charge-guard small {
  display: block;
}

.charge-guard b {
  font-size: 8px;
}

.charge-guard small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.45;
}

.preview-panel {
  background: #12101a;
}

.draft-badge {
  gap: 6px;
  color: var(--green);
  font-size: 7px;
  font-weight: 700;
}

.draft-badge i,
.assistant-head span i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.track-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.track-identity small {
  color: var(--muted-2);
  font-size: 8px;
}

.track-identity h3 {
  margin: 4px 0 2px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
}

.cover-art {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #4c395c;
  border-radius: 7px;
  background-color: #251b31;
  background-image: repeating-linear-gradient(125deg, transparent 0 9px, rgba(81, 216, 223, 0.08) 9px 11px);
}

.cover-art.has-image {
  overflow: hidden;
  border-color: rgba(81, 216, 223, 0.35);
  background: #21172d;
}

.cover-art.has-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.cover-art-title {
  position: absolute;
  z-index: 3;
  right: 4px;
  bottom: 4px;
  left: 4px;
  overflow: hidden;
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.04em;
  text-align: left;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.cover-art.has-image::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(145deg, rgba(16, 13, 24, 0.05), rgba(16, 13, 24, 0.55));
  content: "";
}

.cover-art::before,
.cover-art::after,
.cover-art span {
  position: absolute;
  border: 1px solid;
  content: "";
  transform: rotate(45deg);
}

.cover-art::before {
  width: 28px;
  height: 28px;
  border-color: var(--purple);
}

.cover-art::after {
  width: 17px;
  height: 17px;
  border-color: var(--cyan);
}

.cover-art span {
  width: 8px;
  height: 8px;
  border-color: var(--pink);
  background: rgba(237, 94, 183, 0.22);
}

.cover-art i {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.waveform-wrap,
.lyrics-karaoke {
  position: relative;
  height: 264px;
  margin-top: 0;
  overflow: hidden;
  border: 1px solid rgba(150, 99, 233, 0.18);
  border-radius: 8px;
  background-color: #0c0a11;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
}

.lyrics-karaoke::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(139, 79, 210, 0.15), transparent 42%),
    linear-gradient(180deg, rgba(8, 7, 12, 0.9), transparent 24%, transparent 76%, rgba(8, 7, 12, 0.94));
  content: "";
  pointer-events: none;
}

.lyrics-karaoke-head {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-size: 10px;
  pointer-events: none;
}

.lyrics-karaoke-head > span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lyrics-karaoke-head output {
  overflow: hidden;
  color: #aa91c8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyrics-karaoke-viewport {
  position: absolute;
  z-index: 2;
  inset: 34px 0 8px;
  overflow: hidden;
  scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}

.lyrics-karaoke-lines {
  min-height: 100%;
  padding: 88px clamp(18px, 6vw, 76px);
}

.karaoke-line {
  margin: 0;
  padding: 9px 0;
  color: rgba(184, 169, 202, 0.3);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 720;
  line-height: 1.42;
  text-align: center;
  transform: scale(0.93);
  transform-origin: center;
  transition: color 260ms ease, filter 260ms ease, opacity 260ms ease, transform 360ms cubic-bezier(.2,.8,.2,1);
}

.karaoke-line small {
  display: block;
  margin-bottom: 3px;
  color: #9d6ce2;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.karaoke-line > span {
  position: relative;
  display: inline;
  color: inherit;
}

.karaoke-line.is-past {
  opacity: 0.48;
}

.karaoke-line.is-active {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(177, 114, 255, 0.36));
  font-size: clamp(23px, 2.65vw, 34px);
  transform: scale(1);
}

.karaoke-line.is-active > span {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .lyrics-karaoke-viewport {
    scroll-behavior: auto;
  }

  .karaoke-line,
  .lyrics-realign-button .icon {
    animation: none !important;
    transition: none !important;
  }
}

.automation-workflow {
  margin: 14px 0 0;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
}

.automation-workflow[hidden] { display: none; }

.automation-workflow__header,
.automation-workflow__toolbar,
.automation-workflow__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.automation-workflow__header small {
  color: var(--cyan);
  font-size: 6px;
}

.automation-workflow__header h3 {
  margin: 3px 0 0;
  font-size: 11px;
}

.automation-status {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 7px;
  white-space: nowrap;
}

.automation-status.is-ready {
  border-color: rgba(112, 214, 165, 0.28);
  color: var(--green);
  background: rgba(112, 214, 165, 0.05);
}

.automation-status.is-running {
  border-color: rgba(81, 216, 223, 0.32);
  color: var(--cyan);
  background: rgba(81, 216, 223, 0.06);
}

.automation-status.is-error {
  border-color: rgba(255, 126, 142, 0.32);
  color: #ff9baa;
  background: rgba(255, 126, 142, 0.06);
}

.automation-workflow__toolbar {
  align-items: flex-end;
  margin-top: 12px;
}

.automation-workflow__toolbar label {
  display: grid;
  flex: 1;
  gap: 5px;
  min-width: 0;
}

.automation-workflow__toolbar label > span {
  color: var(--muted-2);
  font-size: 8px;
}

.automation-workflow__toolbar select {
  width: 100%;
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #0e0c13;
  font: inherit;
  font-size: 9px;
}

.automation-workflow__toolbar .secondary-button {
  flex: 0 0 auto;
  min-height: 34px;
}

.automation-workflow__summary {
  margin: 9px 0 0;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.55;
}

.automation-target-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.automation-target-grid[hidden] {
  display: none;
}

.automation-target-grid > span {
  min-width: 0;
  padding: 8px 7px;
}

.automation-target-grid > span + span {
  border-left: 1px solid var(--line);
}

.automation-target-grid small,
.automation-target-grid b {
  display: block;
}

.automation-target-grid small {
  color: var(--muted-2);
  font-size: 6px;
}

.automation-target-grid b {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin: 12px 0 14px;
  padding: 0;
  list-style: none;
}

.automation-step {
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 8px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
}

.automation-step::after {
  position: absolute;
  top: 15px;
  right: -7px;
  width: 8px;
  height: 1px;
  background: var(--line);
  content: "";
}

.automation-step:last-child::after { display: none; }

.automation-step__index {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.08);
  font-size: 7px;
}

.automation-step b,
.automation-step small { display: block; }

.automation-step b {
  overflow: hidden;
  color: var(--text);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-step small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-step.is-active {
  border-color: rgba(81, 216, 223, 0.42);
  background: rgba(81, 216, 223, 0.06);
}

.automation-step.is-active .automation-step__index {
  color: #07181a;
  background: var(--cyan);
}

.automation-step.is-done {
  border-color: rgba(112, 214, 165, 0.3);
}

.automation-step.is-done .automation-step__index {
  color: #071711;
  background: var(--green);
}

.automation-step.is-error {
  border-color: rgba(255, 126, 142, 0.35);
}

.automation-step.is-error .automation-step__index {
  color: #22090d;
  background: #ff8d9d;
}

.automation-workflow__actions {
  justify-content: flex-start;
}

.automation-workflow__actions .primary-button {
  min-height: 35px;
}

.automation-workflow__actions .text-button {
  min-height: 30px;
}

@media (max-width: 720px) {
  .automation-workflow__toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .automation-workflow__toolbar .secondary-button {
    width: 100%;
  }

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

  .automation-step:nth-child(3)::after,
  .automation-step:last-child::after { display: none; }
}

.lyrics-karaoke-placeholder {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #88769d;
  font-size: 12px;
  text-align: center;
}

.lyrics-karaoke-placeholder .icon {
  width: 30px;
  height: 30px;
  color: #8253b9;
}

.audio-result-card {
  margin-top: 19px;
  padding: 14px 15px 15px;
  border: 1px solid rgba(169, 112, 255, 0.25);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(28, 21, 39, 0.9), rgba(12, 10, 17, 0.96));
  box-shadow: inset 0 0 28px rgba(81, 216, 223, 0.025);
}

.audio-result-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.audio-result-head small,
.audio-result-head h3 {
  display: block;
}

.audio-result-head small {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.audio-result-head h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 15px;
}

.lyrics-sync-actions > span {
  color: var(--muted-2);
  font-size: 10px;
}

.audio-result-card:has(.spectrum-panel.is-playing) .lyrics-sync-actions > span {
  color: var(--cyan);
}

.lyrics-sync-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lyrics-realign-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(162, 105, 239, 0.38);
  border-radius: 7px;
  color: #d9c8ee;
  background: rgba(91, 55, 126, 0.2);
  font-size: 10px;
  font-weight: 680;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.lyrics-realign-button:hover:not(:disabled) {
  border-color: rgba(81, 216, 223, 0.6);
  color: #fff;
  background: rgba(81, 216, 223, 0.09);
}

.lyrics-realign-button .icon {
  width: 13px;
  height: 13px;
}

.lyrics-realign-button.is-loading .icon {
  animation: lyrics-sync-spin 900ms linear infinite;
}

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

#waveformCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.playhead {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(81, 216, 223, 0.75);
  opacity: 0;
  pointer-events: none;
}

.playhead::before {
  position: absolute;
  top: 0;
  left: -3px;
  width: 7px;
  height: 7px;
  background: var(--cyan);
  content: "";
  transform: rotate(45deg);
}

.wave-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: var(--muted-2);
  font-size: 9px;
}

.wave-placeholder .icon {
  width: 26px;
  height: 26px;
  color: #5e4778;
}

.waveform-wrap.has-audio .wave-placeholder {
  display: none;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted-2);
  font-family: Consolas, monospace;
  font-size: 7px;
}

.seek-range {
  height: 2px !important;
  margin: 7px 0 1px !important;
  background: linear-gradient(90deg, var(--cyan) var(--range-progress, 0%), #30283c var(--range-progress, 0%)) !important;
}

.seek-range::-webkit-slider-thumb {
  width: 10px !important;
  height: 10px !important;
  border-color: var(--cyan) !important;
  background: #111018 !important;
  box-shadow: 0 0 8px rgba(81, 216, 223, 0.5) !important;
}

.transport {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--line);
}

.transport-buttons {
  gap: 8px;
}

.transport-time {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 8px;
}

.transport-time:last-child {
  text-align: right;
}

.spectrum-panel {
  padding: 15px 0 0;
  border-bottom: 0;
}

.spectrum-panel > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.spectrum-panel > header span,
.spectrum-panel > header small,
.spectrum-panel > header b {
  display: block;
}

.spectrum-panel > header small {
  color: var(--muted-2);
  font-size: 7px;
}

.spectrum-panel > header b {
  margin-top: 3px;
  font-size: 10px;
}

.spectrum-panel > header output {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 7px;
}

.spectrum-panel > header output::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #665e70;
  content: "";
  box-shadow: 0 0 7px rgba(102, 94, 112, 0.45);
}

.spectrum-panel.is-playing > header output {
  color: var(--cyan);
}

.spectrum-panel.is-playing > header output::before {
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(81, 216, 223, 0.78);
}

.spectrum-stage {
  position: relative;
  height: 165px;
  overflow: hidden;
  border: 1px solid #27212f;
  border-radius: 7px;
  background-color: #0b0910;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: inset 0 0 42px rgba(81, 216, 223, 0.025);
}

#spectrumCanvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
}

.spectrum-core {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(81, 216, 223, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(81, 216, 223, 0.1), rgba(169, 112, 255, 0.035) 52%, transparent 70%);
  box-shadow: 0 0 28px rgba(81, 216, 223, 0.12), 0 0 58px rgba(169, 112, 255, 0.08);
  opacity: 0.46;
  transform: translate(-50%, -50%);
  animation: spectrum-breathe 3.8s ease-in-out infinite;
}

.spectrum-panel.is-playing .spectrum-core {
  opacity: 0.8;
  animation-duration: 1.8s;
}

@keyframes spectrum-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.88); }
  50% { transform: translate(-50%, -50%) scale(1.12); }
}

.play-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #9b69e1;
  border-radius: 50%;
  color: #fff;
  background: #6d3aa5;
  box-shadow: 0 0 22px rgba(139, 77, 240, 0.25);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.play-button:hover:not(:disabled) {
  background: #7f46ba;
  box-shadow: 0 0 28px rgba(169, 112, 255, 0.4);
  transform: scale(1.04);
}

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

.play-button .pause-icon {
  display: none;
}

.play-button.is-playing .play-icon {
  display: none;
}

.play-button.is-playing .pause-icon {
  display: block;
}

.volume-button {
  border-color: transparent;
  background: transparent;
}

.arrangement {
  padding-top: 17px;
}

.structure-track {
  display: flex;
  gap: 3px;
  height: 58px;
}

.structure-track.is-detailed .segment {
  min-width: 30px;
  padding: 6px 5px;
}

.segment {
  position: relative;
  display: flex;
  width: var(--width);
  min-width: 40px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: #eee7f6;
  text-align: left;
  background-color: #24202c;
  transition: filter 150ms ease, transform 150ms ease;
}

.segment::before {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, 0.06) 7px 8px);
  content: "";
}

.segment:hover {
  filter: brightness(1.18);
  transform: translateY(-2px);
}

.segment span,
.segment small {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segment span {
  font-size: 8px;
  font-weight: 650;
}

.segment small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 7px;
}

.segment.intro { background-color: #2d2340; }
.segment.verse { background-color: #243142; }
.segment.pre-chorus { background-color: #31354a; }
.segment.chorus { background-color: #503052; }
.segment.interlude { background-color: #2c3d43; }
.segment.bridge { background-color: #493446; }
.segment.final-chorus { background-color: #633957; }
.segment.outro { background-color: #3f362c; }

.analysis-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 17px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.analysis-strip > div {
  padding: 12px 9px;
}

.analysis-strip > div + div {
  border-left: 1px solid var(--line);
}

.analysis-strip small,
.analysis-strip b {
  display: block;
}

.analysis-strip small {
  color: var(--muted-2);
  font-size: 7px;
}

.analysis-strip b {
  margin-top: 5px;
  color: #e9e0f1;
  font-size: 10px;
  font-weight: 650;
}

.export-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.playback-next-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.mastering-opt-in {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.mastering-opt-in input {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

.mastering-opt-in span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mastering-opt-in b {
  color: var(--text);
  font-size: 11px;
}

.mastering-opt-in small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.delivery-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(169, 112, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(169, 112, 255, 0.08), var(--surface-2));
}

.delivery-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.delivery-panel__head h3 {
  margin: 4px 0 4px;
  color: var(--text);
  font-size: 14px;
}

.delivery-panel__head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.delivery-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.delivery-state.is-success {
  border-color: rgba(78, 204, 157, 0.46);
  color: var(--green);
}

.delivery-state.is-error {
  border-color: rgba(255, 110, 135, 0.46);
  color: #ff8ca4;
}

.delivery-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 12px;
  padding: 0;
  list-style: none;
}

.delivery-stages li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.delivery-stages li > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  grid-row: span 2;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}

.delivery-stages b,
.delivery-stages small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-stages b { color: var(--text); font-size: 10px; }
.delivery-stages small { color: var(--muted); font-size: 8px; }

.delivery-stages li.is-active {
  border-color: rgba(169, 112, 255, 0.42);
  background: rgba(169, 112, 255, 0.1);
}

.delivery-stages li.is-active > span {
  border-color: var(--purple);
  color: #fff;
  background: var(--purple-strong);
}

.delivery-stages li.is-done > span {
  border-color: rgba(78, 204, 157, 0.5);
  color: var(--green);
}

.delivery-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 9px;
  align-items: center;
}

.delivery-progress-row progress {
  width: 100%;
  height: 8px;
  accent-color: var(--purple);
}

.delivery-progress-row output {
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.delivery-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.delivery-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.delivery-actions .is-disabled {
  pointer-events: none;
  opacity: 0.48;
}

.mv-preset-editor {
  margin: 0 24px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mv-preset-editor header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mv-preset-editor header > span,
.mv-preset-editor header b,
.mv-preset-editor header small {
  display: block;
}

.mv-preset-editor header b {
  font-size: 10px;
}

.mv-preset-editor header small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
}

.mv-preset-editor header > div {
  display: flex;
  gap: 5px;
}

.mv-preset-editor textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 9px;
  line-height: 1.65;
  outline: none;
  background: #0b0d10;
  resize: vertical;
}

.mv-preset-editor textarea:focus {
  border-color: var(--cyan);
}

.mv-style-library {
  padding: 16px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: #0f0d14;
}

.mv-style-library > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mv-style-library > header > span,
.mv-style-library > header b,
.mv-style-library > header small {
  display: block;
}

.mv-style-library > header b {
  font-size: 11px;
}

.mv-style-library > header small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 7px;
}

.mv-style-search {
  display: grid;
  width: min(190px, 42%);
  min-height: 32px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-2);
  background: #16131c;
}

.mv-style-search .icon {
  width: 13px;
  height: 13px;
}

.mv-style-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 8px;
  background: transparent;
}

.mv-style-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 7px;
  width: min(440px, 100%);
  margin-top: 12px;
}

.mv-style-filters button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 8px;
  background: #19161e;
}

.mv-style-filters button.is-active {
  border-color: #8270f0;
  color: #fff;
  background: #16142a;
}

.mv-style-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  max-height: 390px;
  margin-top: 12px;
  overflow: auto;
  scrollbar-width: thin;
}

.mv-style-option {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 7px;
  color: #fff;
  text-align: left;
  background: #17141b;
  aspect-ratio: 1.52;
}

.mv-style-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.mv-style-option::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  background: rgba(0, 0, 0, 0.68);
  content: "";
  pointer-events: none;
}

.mv-style-option:hover img {
  transform: scale(1.035);
}

.mv-style-option.is-selected {
  border-color: #7d62f1;
  box-shadow: 0 0 0 1px rgba(125, 98, 241, 0.28);
}

.mv-style-option > span {
  position: absolute;
  z-index: 1;
  right: 8px;
  bottom: 7px;
  left: 8px;
  overflow: hidden;
  font-size: 8px;
  font-weight: 680;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px #000;
  white-space: nowrap;
}

.mv-style-option > i {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  display: none;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #7256df;
}

.mv-style-option.is-selected > i {
  display: grid;
}

.mv-style-option > i .icon {
  width: 11px;
  height: 11px;
}

.mv-style-empty {
  grid-column: 1 / -1;
  padding: 26px 0;
  color: var(--muted-2);
  font-size: 8px;
  text-align: center;
}

.assistant-panel {
  background: #15111e;
  transition: opacity 200ms ease, transform 200ms ease;
}

.studio-layout.is-assistant-closed .assistant-panel {
  display: none;
}

.assistant-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.assistant-symbol,
.assistant-avatar,
.suggestion-icon,
.engine-choice__icon {
  display: grid;
  place-items: center;
}

.assistant-symbol {
  width: 34px;
  height: 34px;
  border: 1px solid #5e4175;
  border-radius: 7px;
  color: #e1c5ff;
  background: #291d37;
  box-shadow: inset 0 0 16px rgba(169, 112, 255, 0.14);
}

.assistant-symbol .icon {
  width: 17px;
}

.assistant-head h2 {
  font-size: 12px;
}

.assistant-head span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--green);
  font-size: 7px;
}

.assistant-head .icon-button {
  width: 29px;
  height: 29px;
}

.assistant-message {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.assistant-avatar {
  width: 25px;
  height: 25px;
  border: 1px solid #4b3a5d;
  border-radius: 50%;
  color: var(--purple);
  background: #21182b;
}

.assistant-avatar .icon {
  width: 12px;
  height: 12px;
}

.assistant-message p {
  margin: 0;
  color: #c4baca;
  font-size: 9px;
  line-height: 1.65;
}

.intent-block,
.suggestion-block,
.assistant-log {
  padding-top: 16px;
}

.intent-block dl {
  margin: 0;
}

.intent-block dl > div {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 0;
  border-bottom: 1px dashed #2c2538;
  font-size: 8px;
}

.intent-block dt {
  color: var(--muted-2);
}

.intent-block dd {
  margin: 0;
  color: #cfc5d5;
}

.suggestion-block > span,
.assistant-log > span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  background: transparent;
  transition: color 150ms ease, background 150ms ease;
}

.suggestion:last-child {
  border-bottom: 1px solid var(--line);
}

.suggestion:hover {
  color: var(--text);
  background: #1e1728;
}

.suggestion > span {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  column-gap: 8px;
}

.suggestion-icon {
  grid-row: 1 / span 2;
  width: 29px;
  height: 29px;
  border: 1px solid #4f3e62;
  border-radius: 6px;
  color: var(--purple);
  font-size: 6px;
  font-style: normal;
}

.suggestion b {
  align-self: end;
  font-size: 8px;
  font-weight: 650;
}

.suggestion small {
  align-self: start;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
}

.suggestion > .icon {
  width: 13px;
  height: 13px;
}

.assistant-log ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assistant-log li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted-2);
}

.assistant-log li > i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 7px;
  font-style: normal;
}

.assistant-log li > i .icon {
  width: 11px;
  height: 11px;
}

.assistant-log li b,
.assistant-log li small {
  display: block;
}

.assistant-log li b {
  font-size: 8px;
  font-weight: 650;
}

.assistant-log li small {
  margin-top: 3px;
  font-size: 10px;
}

.assistant-results {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.assistant-results > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.assistant-results > header span,
.assistant-results > header b,
.assistant-results > header small {
  display: block;
}

.assistant-results > header b {
  color: var(--text);
  font-size: 13px;
}

.assistant-results > header small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.assistant-result-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(70, 56, 85, 0.55);
}

.assistant-result-item img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.assistant-result-item b,
.assistant-result-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-result-item > div {
  min-width: 0;
}

.assistant-result-item b {
  color: #e9deee;
  font-size: 11px;
}

.assistant-result-item small,
.assistant-results-empty {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.assistant-result-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.assistant-result-actions .secondary-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
}

.assistant-showcase-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 23px;
  margin-top: 6px;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid rgba(169, 112, 255, 0.3);
  border-radius: 5px;
  color: #cbb2ed;
  background: rgba(169, 112, 255, 0.07);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.assistant-showcase-button:hover:not(:disabled) {
  border-color: rgba(169, 112, 255, 0.58);
  color: #eadfff;
  background: rgba(169, 112, 255, 0.13);
}

.assistant-showcase-button .icon {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
}

.assistant-showcase-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-showcase-button.is-recommended {
  border-color: rgba(169, 112, 255, 0.52);
  color: #dec9ff;
  background: rgba(169, 112, 255, 0.16);
}

.assistant-showcase-control {
  min-width: 0;
}

.assistant-showcase-button.is-taken-down,
.assistant-showcase-button.is-rejected {
  border-color: rgba(255, 120, 133, 0.42);
  color: #ffabb4;
  background: rgba(255, 120, 133, 0.09);
}

.assistant-showcase-button.is-pending {
  border-color: rgba(242, 190, 101, 0.42);
  color: #f3cc88;
  background: rgba(242, 190, 101, 0.09);
}

.assistant-result-item .assistant-showcase-note {
  display: block;
  margin-top: 5px;
  overflow: visible;
  color: var(--muted-2);
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
}

.assistant-showcase-form {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.assistant-showcase-form[hidden] {
  display: none;
}

.assistant-showcase-form textarea {
  width: 100%;
  min-height: 58px;
  padding: 7px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  color: var(--text);
  background: var(--surface-2);
  font-size: 9px;
  line-height: 1.45;
  resize: vertical;
}

.assistant-showcase-form textarea:focus {
  border-color: rgba(169, 112, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(169, 112, 255, 0.1);
}

.assistant-showcase-form > div {
  display: flex;
  gap: 5px;
}

.assistant-showcase-form button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9px;
}

.assistant-showcase-form-cancel {
  color: var(--muted);
  background: transparent;
}

.assistant-showcase-form-submit {
  color: #fff;
  background: var(--purple-strong);
}

.assistant-showcase-button.is-loading .icon {
  animation: step-pulse 900ms ease-in-out infinite;
}

.assistant-showcase-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.assistant-showcase-button.is-pending:disabled {
  cursor: default;
}

.assistant-log li.is-active {
  color: var(--purple);
}

.assistant-log li.is-active > i {
  border-color: var(--purple);
  animation: step-pulse 1.2s ease-in-out infinite;
}

.assistant-log li.is-done {
  color: var(--green);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(5, 4, 8, 0.82);
  backdrop-filter: blur(12px);
}

.modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid #4a385c;
  border-radius: 8px;
  background: #15111e;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  animation: modal-in 220ms ease both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin-top: 8px;
  font-size: 19px;
}

.modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.prompt-tabs {
  margin: 16px 24px 0;
}

.prompt-tabs button {
  min-height: 29px;
  padding: 0 13px;
}

.scene-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.scene-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
  gap: 18px;
  min-width: 0;
  padding: 18px 20px;
  background: #121019;
}

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

.scene-item header span {
  color: var(--purple);
  font-size: 8px;
  font-weight: 700;
}

.scene-item header time {
  color: var(--muted-2);
  font-family: Consolas, monospace;
  font-size: 8px;
}

.scene-item h3 {
  margin: 9px 0 7px;
  font-size: 11px;
  font-weight: 650;
}

.scene-item p {
  margin: 0;
  color: #aaa0b2;
  font-size: 9px;
  line-height: 1.7;
}

.scene-progress {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.scene-progress > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scene-progress small,
.scene-progress output {
  color: var(--muted-2);
  font-size: 7px;
}

.scene-progress > span output,
.scene-progress.is-complete > small {
  color: var(--cyan);
}

.scene-progress progress,
.mv-segment-result progress {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: #2a2531;
  appearance: none;
}

.scene-progress progress::-webkit-progress-bar,
.mv-segment-result progress::-webkit-progress-bar {
  background: #2a2531;
}

.scene-progress progress::-webkit-progress-value,
.mv-segment-result progress::-webkit-progress-value {
  background: var(--cyan);
}

.scene-progress progress::-moz-progress-bar,
.mv-segment-result progress::-moz-progress-bar {
  background: var(--cyan);
}

.modal-actions {
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px 20px;
}

.modal-actions > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 8px;
}

.settings-modal {
  width: min(640px, 100%);
}

.history-modal {
  width: min(760px, 100%);
}

.storyboard-toolbar > div,
.asset-picker-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-picker-backdrop {
  z-index: 160;
}

.asset-picker-modal {
  width: min(1120px, 100%);
  overflow: hidden;
}

.asset-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #100e16;
}

.asset-picker-filters {
  display: flex;
  gap: 7px;
}

.asset-picker-filters button {
  min-width: 66px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  background: #19161e;
}

.asset-picker-filters button.is-active {
  border-color: #8270f0;
  color: #fff;
  background: #211c35;
}

.asset-picker-search {
  display: grid;
  width: min(280px, 42%);
  min-height: 36px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-2);
  background: #16131c;
}

.asset-picker-search .icon {
  width: 15px;
  height: 15px;
}

.asset-picker-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 11px;
  background: transparent;
}

.asset-picker-layout {
  display: grid;
  min-height: 430px;
  max-height: min(62vh, 650px);
  grid-template-columns: minmax(0, 1fr) 340px;
}

.asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 16px 18px 20px 24px;
  overflow: auto;
  scrollbar-width: thin;
}

.asset-picker-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  background: #121019;
}

.asset-picker-card:hover,
.asset-picker-card.is-selected {
  border-color: #8270f0;
  background: #1b1726;
}

.asset-picker-card.is-selected {
  box-shadow: inset 0 0 0 1px #8270f0;
}

.asset-picker-card__media {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: #0b0a0f;
}

.asset-picker-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-picker-card__media > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #271d34;
}

.asset-picker-card__media .icon {
  width: 20px;
  height: 20px;
}

.asset-picker-card__media i {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 4px 6px;
  border-radius: 4px;
  color: #f2edf6;
  font-size: 9px;
  font-style: normal;
  background: rgba(8, 7, 11, 0.86);
}

.asset-picker-card__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
}

.asset-picker-card__copy b,
.asset-picker-card__copy small,
.asset-picker-card__copy code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-picker-card__copy b {
  font-size: 11px;
}

.asset-picker-card__copy small,
.asset-picker-card__copy code {
  color: var(--muted-2);
  font-size: 9px;
}

.asset-picker-preview {
  display: grid;
  min-width: 0;
  grid-template-rows: minmax(240px, 1fr) auto;
  border-left: 1px solid var(--line);
  background: #0e0c13;
}

.asset-picker-preview__media {
  display: grid;
  min-width: 0;
  min-height: 240px;
  padding: 16px;
  place-items: center;
  overflow: hidden;
}

.asset-picker-preview__media > span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: #21192c;
}

.asset-picker-preview__media img,
.asset-picker-preview__media video {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.asset-picker-preview__media audio {
  width: 100%;
}

.asset-picker-preview__copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px 20px;
  border-top: 1px solid var(--line);
}

.asset-picker-preview__copy b {
  font-size: 13px;
}

.asset-picker-preview__copy small,
.asset-picker-preview__copy code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.asset-picker-empty {
  display: grid;
  min-height: 220px;
  grid-column: 1 / -1;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.asset-picker-empty .icon {
  width: 24px;
  height: 24px;
}

.asset-picker-empty b {
  color: var(--text);
  font-size: 12px;
}

.asset-picker-empty small {
  font-size: 10px;
}

@media (max-width: 860px) {
  .asset-picker-layout {
    max-height: min(66vh, 720px);
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .asset-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .asset-picker-preview {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
    grid-template-rows: minmax(230px, auto);
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .asset-picker-preview__copy {
    align-content: center;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .storyboard-toolbar,
  .asset-picker-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .storyboard-toolbar > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .asset-picker-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .asset-picker-filters button {
    min-width: 0;
    padding: 0 6px;
  }

  .asset-picker-search {
    width: 100%;
  }

  .asset-picker-grid {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 14px;
    padding-left: 14px;
  }

  .asset-picker-preview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .asset-picker-preview__copy {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .asset-picker-actions > div {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--line);
}

.history-summary > span {
  padding: 14px 24px;
}

.history-summary > span + span {
  border-left: 1px solid var(--line);
}

.history-summary b,
.history-summary small {
  display: block;
}

.history-summary b {
  font-size: 16px;
}

.history-summary small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.history-list {
  display: grid;
  gap: 8px;
  min-height: 150px;
  max-height: min(52vh, 480px);
  padding: 16px 24px;
  overflow: auto;
}

.history-empty {
  display: grid;
  place-items: center;
  min-height: 118px;
  color: var(--muted-2);
  font-size: 9px;
}

.history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #100d16;
}

.history-item__icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  color: var(--purple);
  background: #251933;
}

.history-item b,
.history-item small {
  display: block;
}

.history-item b {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
}

.history-item__actions {
  display: flex;
  gap: 6px;
}

.history-item__actions a {
  text-decoration: none;
}

.history-item.is-cloud-asset .history-item__icon {
  color: var(--cyan);
  background: #12272d;
}

.history-item__actions .secondary-button {
  min-height: 30px;
  padding: 0 10px;
}

.history-item__actions .icon-button {
  width: 30px;
  height: 30px;
}

.confirm-modal {
  width: min(480px, 100%);
}

.confirm-modal .modal-actions {
  justify-content: flex-end;
}

.eyebrow.danger,
.danger-button {
  color: #fff;
}

.eyebrow.danger {
  color: var(--danger);
}

.danger-button {
  border-color: #c45868;
  background: #9e3f50;
  box-shadow: 0 8px 25px rgba(158, 63, 80, 0.2);
}

.danger-button:hover {
  border-color: #ff9aa5;
  background: #b94a5c;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 20px 24px;
}

.api-key-connect {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 18px 24px 0;
}

.api-key-connect label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-2);
  font-size: 7px;
  background: #0f0d14;
}

.api-key-connect input {
  min-width: 0;
  height: 30px;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: Consolas, monospace;
  font-size: 9px;
  background: transparent;
}

.api-key-connect input::placeholder {
  color: #5e5669;
}

.api-key-connect > small {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: 7px;
}

.api-key-connect > small.is-success {
  color: var(--green);
}

.api-key-connect > small.is-error {
  color: var(--danger);
}

.engine-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  text-align: left;
  background: #110e17;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.engine-choice:not(:disabled):hover {
  border-color: #72558e;
  background: #21182c;
  transform: translateY(-1px);
}

.engine-choice.is-selected {
  border-color: #60477a;
  background: #1e1729;
}

.engine-choice.is-disabled {
  opacity: 0.58;
}

.engine-choice__icon {
  width: 34px;
  height: 34px;
  border: 1px solid #4d3a61;
  border-radius: 7px;
  color: var(--purple);
}

.engine-choice b,
.engine-choice small {
  display: block;
}

.engine-choice b {
  font-size: 9px;
}

.engine-choice small {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 7px;
}

.state-pill {
  position: absolute;
  top: 7px;
  right: 7px;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid #4f3c60;
  border-radius: 999px;
  color: var(--green);
  font-size: 6px;
}

.engine-choice.is-disabled .state-pill {
  color: var(--muted);
}

.provider-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.provider-facts > span {
  min-width: 0;
  padding: 11px 12px;
}

.provider-facts > span + span {
  border-left: 1px solid var(--line);
}

.provider-facts b,
.provider-facts small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-facts b {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 550;
}

.provider-facts small {
  margin-top: 5px;
  color: #d1c6d8;
  font-size: 8px;
}

.video-submit-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 0.72fr)) minmax(230px, 1.35fr);
  align-items: end;
  gap: 9px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #17121f;
}

.video-submit-strip label {
  display: grid;
  gap: 6px;
  color: var(--muted-2);
  font-size: 7px;
}

.video-submit-strip select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 8px;
  background: #0f0d14;
}

.video-submit-strip .secondary-button {
  min-height: 34px;
}

.video-submit-strip .primary-button {
  min-height: 34px;
}

.video-submit-strip .subtitle-toggle {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #0f0d14;
}

.mv-segment-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
}

.mv-segment-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1013;
}

.mv-segment-result > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--cyan);
  font-size: 8px;
  background: #142329;
}

.mv-segment-result b,
.mv-segment-result small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv-segment-result progress {
  display: block;
  margin-top: 6px;
}

.mv-segment-result b {
  font-size: 8px;
}

.mv-segment-result small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
}

.mv-segment-result a {
  color: var(--cyan);
  font-size: 8px;
}

.mv-stitch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #10171a;
}

.mv-stitch-actions b,
.mv-stitch-actions small {
  display: block;
}

.mv-stitch-actions b {
  color: #dff4f2;
  font-size: 9px;
}

.mv-stitch-actions small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
}

.video-submit-strip .secondary-button.is-loading .icon {
  animation: step-pulse 1s ease-in-out infinite;
}

.cloud-task-status {
  padding: 11px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
  background: #101018;
}

.cloud-task-status a {
  color: var(--cyan);
  font-weight: 650;
}

.cloud-task-status.is-error {
  color: var(--danger);
}

.mv-audio-readiness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 24px;
  padding: 12px 14px;
  border: 1px solid rgba(83, 206, 189, .28);
  background: rgba(18, 55, 51, .42);
}

.mv-audio-readiness > span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.mv-audio-readiness > span > .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--cyan);
}

.mv-audio-readiness b,
.mv-audio-readiness small {
  display: block;
}

.mv-audio-readiness b {
  color: #e9f8f5;
  font-size: 10px;
}

.mv-audio-readiness small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.mv-audio-readiness.is-missing,
.mv-audio-readiness.is-error {
  border-color: rgba(224, 96, 112, .34);
  background: rgba(67, 25, 34, .44);
}

.mv-audio-readiness.is-missing > span > .icon,
.mv-audio-readiness.is-error > span > .icon {
  color: var(--danger);
}

.mv-audio-readiness.is-loading {
  border-color: rgba(214, 173, 86, .32);
  background: rgba(64, 50, 23, .38);
}

@media (max-width: 680px) {
  .mv-audio-readiness {
    align-items: stretch;
    flex-direction: column;
  }

  .mv-audio-readiness .secondary-button {
    width: 100%;
  }
}

.account-modal {
  width: min(520px, 100%);
}

.account-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 18px 24px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.account-summary .avatar {
  width: 42px;
  height: 42px;
}

.account-summary b,
.account-summary small,
.account-summary strong span {
  display: block;
}

.account-summary b {
  font-size: 12px;
}

.account-summary small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 500;
}

.account-summary strong {
  color: var(--cyan);
  font-size: 20px;
  text-align: right;
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 24px 24px;
}

.account-logout-button {
  color: var(--danger);
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 40px));
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #59416e;
  border-radius: 7px;
  color: #ddd3e4;
  font-size: 9px;
  background: #1d1626;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  animation: toast-in 220ms ease both;
}

.toast > .icon {
  color: var(--green);
}

.toast button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  background: transparent;
}

.toast.is-leaving {
  animation: toast-out 180ms ease both;
}

@keyframes border-flow {
  to { background-position: 200% 200%; }
}

@keyframes wand-pulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.1); }
}

@keyframes step-pulse {
  50% { box-shadow: 0 0 0 5px rgba(169, 112, 255, 0.09); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(14px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(14px); }
}

.mastering-modal {
  width: min(920px, 100%);
}

.mastering-source,
.mastering-preset-section,
.mastering-result {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.mastering-pipeline {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(48, 37, 69, 0.18);
}

.mastering-pipeline > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mastering-pipeline > header > span {
  display: grid;
  gap: 4px;
}

.mastering-pipeline header b {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
}

.mastering-pipeline header small,
.mastering-pipeline > p {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0;
}

.mastering-pipeline header em {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(88, 206, 204, 0.25);
  border-radius: 4px;
  color: var(--cyan);
  background: rgba(34, 109, 111, 0.12);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0;
}

.mastering-pipeline__steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.mastering-pipeline__steps > span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #100d16;
}

.mastering-pipeline__steps b {
  color: var(--text);
  font-size: 10px;
  letter-spacing: 0;
}

.mastering-pipeline__steps small {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0;
}

.mastering-pipeline__steps > .icon {
  width: 16px;
  color: var(--cyan);
}

.mastering-pipeline > p {
  margin: 12px 0 0;
  line-height: 1.5;
}

.mastering-source > header,
.mastering-preset-section > header,
.mastering-result > header,
.mastering-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mastering-source > header > span,
.mastering-preset-section > header > span,
.mastering-result > header > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mastering-source header b,
.mastering-preset-section header b,
.mastering-result header b {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
}

.mastering-source header small,
.mastering-preset-section header small,
.mastering-result header small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mastering-source > label {
  display: grid;
  align-items: center;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0;
}

.mastering-source select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--text);
  background: #100d16;
  letter-spacing: 0;
}

.mastering-source audio,
.mastering-result audio {
  width: 100%;
  height: 38px;
  margin-top: 14px;
  accent-color: var(--cyan);
}

.mastering-preset-section > header em {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(88, 206, 204, 0.25);
  border-radius: 4px;
  color: var(--cyan);
  background: rgba(34, 109, 111, 0.12);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0;
}

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

.mastering-presets button {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: left;
  background: #100d16;
  letter-spacing: 0;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.mastering-presets button:hover {
  border-color: #5c4b70;
  color: var(--text);
  background: #1b1622;
}

.mastering-presets button.is-active {
  border-color: rgba(88, 206, 204, 0.58);
  color: #e9ffff;
  background: rgba(24, 76, 82, 0.28);
  box-shadow: inset 0 0 0 1px rgba(88, 206, 204, 0.1);
}

.mastering-presets b {
  font-size: 10px;
  letter-spacing: 0;
}

.mastering-presets small {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.55;
  letter-spacing: 0;
}

.mastering-specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #110e17;
}

.mastering-specs > span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 18px;
}

.mastering-specs > span + span {
  border-left: 1px solid var(--line);
}

.mastering-specs small {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0;
}

.mastering-specs b {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mastering-progress {
  display: grid;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.mastering-progress > div {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #2a2233;
}

.mastering-progress > div > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  transition: width 280ms ease;
}

.mastering-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0;
}

.mastering-progress[data-state="complete"] p,
.mastering-result > header > .icon {
  color: var(--green);
}

.mastering-progress[data-state="error"] p {
  color: #ef9a9a;
}

.mastering-result {
  background: rgba(29, 73, 57, 0.12);
}

.mastering-result > header > .icon {
  width: 20px;
  height: 20px;
}

.mastering-result-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.mastering-actions {
  border-top: 0;
}

@media (max-width: 760px) {
  .mastering-presets,
  .mastering-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mastering-specs > span:nth-child(3) {
    border-left: 0;
  }

  .mastering-specs > span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .mastering-source,
  .mastering-preset-section,
  .mastering-pipeline,
  .mastering-result,
  .mastering-progress {
    padding-right: 16px;
    padding-left: 16px;
  }

  .mastering-source > label,
  .mastering-presets,
  .mastering-specs {
    grid-template-columns: minmax(0, 1fr);
  }

  .mastering-pipeline__steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .mastering-pipeline__steps > .icon {
    justify-self: center;
    transform: rotate(90deg);
  }

  .mastering-specs > span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .mastering-result-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 1240px) {
  :root {
    --sidebar-width: 76px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand--sidebar-logo {
    min-height: 78px;
  }

  .sidebar-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 5px;
  }

  .brand-copy,
  .nav-item span,
  .engine-status div,
  .profile div,
  .profile > .icon {
    display: none;
  }

  .main-nav {
    margin-top: 27px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-item .icon {
    width: 19px;
    height: 19px;
  }

  .engine-status {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .profile {
    display: flex;
    justify-content: center;
  }

  .studio-layout {
    grid-template-columns: minmax(340px, 0.9fr) minmax(390px, 1.1fr);
  }

  .assistant-panel {
    display: none;
  }

  .composer-panel,
  .preview-panel {
    border-right: 0;
  }

  .composer-panel {
    border-right: 1px solid var(--line);
  }

  .assistant-toggle {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    height: auto;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    justify-content: flex-start;
  }

  .brand--sidebar-logo {
    width: 82px;
    min-height: 78px;
  }

  .brand-copy {
    display: grid;
  }

  .main-nav {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin: 0;
  }

  .nav-item {
    width: 40px;
    flex: 0 0 40px;
  }

  .sidebar-spacer,
  .engine-status,
  .sidebar > .nav-item,
  .profile div,
  .profile > .icon {
    display: none;
  }

  .profile {
    display: flex;
    padding: 0;
  }

  .topbar {
    position: relative;
  }

  .mobile-settings-button {
    display: grid;
  }

  .mobile-account-button {
    display: inline-grid;
  }

  .studio-layout,
  .studio-layout.is-assistant-closed {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-panel {
    border: 0;
  }
}

@media (max-width: 620px) {
  .sidebar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .brand-copy {
    display: none;
  }

  .main-nav {
    justify-content: flex-end;
  }

  .profile {
    display: none;
  }

  .topbar {
    height: 52px;
    padding: 0 14px;
  }

  .save-state span,
  .top-actions > .icon-button {
    display: none;
  }

  .top-actions > .icon-button.mobile-settings-button {
    display: grid;
  }

  .mobile-account-button {
    display: inline-grid;
  }

  .content-head {
    display: block;
    padding: 23px 16px 17px;
  }

  .project-title {
    font-size: 22px;
  }

  .head-meta {
    margin-top: 15px;
  }

  .studio-layout {
    margin: 0 8px 20px;
  }

  .composer-panel,
  .preview-panel {
    padding: 16px;
  }

  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

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

  .style-option.is-selected::before {
    right: 38px;
  }

  .voice-preset-grid,
  .dialogue-voices,
  .voice-tuning-grid,
  .reference-dimension-grid,
  .mv-segment-results {
    grid-template-columns: 1fr;
  }

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

  .reference-workflow-switch {
    grid-template-columns: 1fr;
  }

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

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

  .automation-target-grid > span:nth-child(3) {
    border-left: 0;
  }

  .automation-target-grid > span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .automation-step:nth-child(3)::after {
    display: block;
  }

  .automation-step:nth-child(2n)::after {
    display: none;
  }

  .automation-workflow__actions {
    flex-wrap: wrap;
  }

  .reference-analysis-grid > span:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .reference-analysis-grid > span:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .reference-options {
    grid-template-columns: 1fr;
  }

  .mv-style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 52vh;
  }

  .mv-style-library > header,
  .vocal-expression {
    align-items: stretch;
    flex-direction: column;
  }

  .mv-style-search {
    width: 100%;
  }

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

  .vocal-expression-switch {
    flex: none;
    width: 100%;
  }

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

  .voice-parameter-summary span:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .voice-parameter-summary span:nth-child(4) {
    border-top: 1px solid var(--line);
  }

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

  .dialect-selectors,
  .account-actions {
    grid-template-columns: 1fr;
  }

  .range-field,
  .compact-field {
    padding-bottom: 7px;
  }

  .waveform-wrap {
    height: 230px;
  }

  .audio-result-head {
    align-items: flex-start;
  }

  .lyrics-sync-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .lyrics-realign-button {
    min-height: 34px;
    font-size: 11px;
  }

  .lyrics-karaoke-head output {
    max-width: 58%;
  }

  .lyrics-karaoke-lines {
    padding-right: 18px;
    padding-left: 18px;
  }

  .karaoke-line {
    font-size: 17px;
  }

  .karaoke-line.is-active {
    font-size: 24px;
  }

  .export-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .spectrum-stage {
    height: 160px;
  }

  .scene-list,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .character-assets,
  .scene-assets {
    margin-right: 16px;
    margin-left: 16px;
  }

  .character-assets > header,
  .scene-assets > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .character-asset {
    grid-template-columns: minmax(142px, 0.72fr) minmax(0, 1.28fr);
    padding: 12px;
  }

  .scene-asset {
    grid-template-columns: minmax(160px, 0.72fr) minmax(0, 1.28fr);
    padding: 12px;
  }

  .character-asset .asset-preview {
    min-height: 0;
  }

  .scene-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .scene-preview {
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .scene-preview__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .scene-preview__actions .primary-button {
    width: 100%;
  }

  .api-key-connect {
    grid-template-columns: 1fr;
  }

  .api-key-connect > small {
    grid-column: auto;
  }

  .video-submit-strip,
  .provider-facts {
    grid-template-columns: 1fr;
  }

  .provider-facts > span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal {
    max-height: calc(100vh - 16px);
  }

  .auth-shell {
    align-items: start;
    padding: 104px 18px 28px;
  }

  .auth-stage {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .auth-brand {
    top: 24px;
    left: 20px;
  }

  .auth-copy h1 {
    font-size: 30px;
  }

  .auth-form {
    padding: 20px;
  }

  .puzzle-captcha-modal {
    padding: 8px;
  }

  .puzzle-captcha-panel {
    width: min(372px, calc(100vw - 16px));
    padding: 15px;
  }

  .history-list {
    padding-right: 14px;
    padding-left: 14px;
  }

  .history-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .history-item__actions {
    grid-column: 1 / -1;
  }

  .modal-head,
  .modal-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .prompt-tabs {
    display: grid;
    grid-template-columns: 1fr;
    margin-right: 16px;
    margin-left: 16px;
  }

  .mv-preset-editor {
    margin-right: 16px;
    margin-left: 16px;
  }

  .mv-stitch-actions {
    align-items: stretch;
    flex-direction: column;
    padding-right: 16px;
    padding-left: 16px;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions .primary-button {
    width: 100%;
  }

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

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

  .character-asset .asset-preview {
    width: min(100%, 320px);
    justify-self: center;
  }

  .scene-asset .asset-preview {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spectrum-core {
    animation: none;
    transform: translate(-50%, -50%);
  }
}

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

/* Light theme: preserve the workstation's dense layout while lifting its surfaces. */
:root[data-theme="light"] body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(121, 80, 181, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 80, 181, 0.045) 1px, transparent 1px);
}

:root[data-theme="light"] .workspace-backdrop {
  opacity: 0.12;
}

:root[data-theme="light"] .workspace-backdrop::after {
  background: linear-gradient(180deg, rgba(247, 245, 250, 0.08), var(--bg) 92%);
}

:root[data-theme="light"] .auth-shell {
  background-color: #f7f5fa;
  background-image:
    linear-gradient(rgba(121, 80, 181, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 127, 138, 0.035) 1px, transparent 1px);
}

:root[data-theme="light"] .auth-form,
:root[data-theme="light"] .puzzle-captcha-panel,
:root[data-theme="light"] .welcome-card,
:root[data-theme="light"] .modal {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .auth-form,
:root[data-theme="light"] .auth-tabs,
:root[data-theme="light"] .auth-form input,
:root[data-theme="light"] .puzzle-captcha-slider,
:root[data-theme="light"] .puzzle-captcha-slider > span {
  background: var(--surface-2);
}

:root[data-theme="light"] .auth-tabs button.is-active,
:root[data-theme="light"] .sms-code-row button,
:root[data-theme="light"] .puzzle-captcha-slider input[type="range"] {
  border-color: rgba(121, 80, 181, 0.35);
  color: var(--purple-strong);
  background: #ebe4f4;
}

:root[data-theme="light"] .auth-form input,
:root[data-theme="light"] .puzzle-captcha-panel input,
:root[data-theme="light"] .auth-form input:focus {
  color: var(--text);
}

:root[data-theme="light"] .auth-form input::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: #756d7e;
  opacity: 1;
}

:root[data-theme="light"] .puzzle-captcha-stage,
:root[data-theme="light"] #puzzleCaptchaLoading {
  background: #eeebf2;
}

:root[data-theme="light"] .puzzle-captcha-modal,
:root[data-theme="light"] .modal-backdrop,
:root[data-theme="light"] .welcome-modal {
  background: rgba(45, 35, 57, 0.28);
}

:root[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.96);
}

:root[data-theme="light"] .brand-mark {
  background: transparent;
}

:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .nav-item.is-active,
:root[data-theme="light"] .mobile-account-button,
:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .assistant-toggle,
:root[data-theme="light"] .ghost-button,
:root[data-theme="light"] .secondary-button {
  border-color: var(--line);
  background: var(--surface-2);
}

:root[data-theme="light"] .nav-item:hover {
  color: var(--text);
}

:root[data-theme="light"] .nav-item.is-active {
  color: var(--purple-strong);
  box-shadow: inset 0 0 0 1px rgba(121, 80, 181, 0.16);
}

:root[data-theme="light"] .avatar {
  border-color: #c5b4d7;
  color: #684394;
  background: #eee6f5;
}

:root[data-theme="light"] .topbar {
  background: rgba(247, 245, 250, 0.9);
}

:root[data-theme="light"] .assistant-toggle[aria-pressed="true"],
:root[data-theme="light"] .mode-switch button.is-active,
:root[data-theme="light"] .duration-switch button.is-active,
:root[data-theme="light"] .prompt-tabs button.is-active,
:root[data-theme="light"] .song-mode-switch button.is-active,
:root[data-theme="light"] .reference-workflow-switch button.is-active,
:root[data-theme="light"] .vocal-expression-switch button.is-active {
  border-color: rgba(121, 80, 181, 0.28);
  color: var(--purple-strong);
  background: #ebe4f4;
}

:root[data-theme="light"] .studio-layout,
:root[data-theme="light"] .composer-panel,
:root[data-theme="light"] .preview-panel,
:root[data-theme="light"] .assistant-panel {
  background: var(--surface);
}

:root[data-theme="light"] .mode-switch,
:root[data-theme="light"] .duration-switch,
:root[data-theme="light"] .prompt-tabs,
:root[data-theme="light"] .song-mode-switch,
:root[data-theme="light"] .prompt-field,
:root[data-theme="light"] .dialect-control,
:root[data-theme="light"] .lyrics-editor,
:root[data-theme="light"] .reference-drop,
:root[data-theme="light"] .reference-transform-prompt textarea,
:root[data-theme="light"] .dialogue-voices select,
:root[data-theme="light"] .lyrics-preview select,
:root[data-theme="light"] .compact-field select,
:root[data-theme="light"] .automation-workflow__toolbar select,
:root[data-theme="light"] .mv-preset-editor textarea,
:root[data-theme="light"] .mv-style-search,
:root[data-theme="light"] .api-key-connect label,
:root[data-theme="light"] .video-submit-strip select,
:root[data-theme="light"] .video-submit-strip .subtitle-toggle,
:root[data-theme="light"] .mastering-source select {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-2);
}

:root[data-theme="light"] .prompt-field textarea,
:root[data-theme="light"] .lyrics-editor textarea,
:root[data-theme="light"] .style-prompt-field textarea,
:root[data-theme="light"] .mv-preset-editor textarea,
:root[data-theme="light"] .reference-transform-prompt textarea,
:root[data-theme="light"] .asset-controls textarea,
:root[data-theme="light"] .scene-item textarea,
:root[data-theme="light"] .api-key-connect input {
  color: var(--text);
}

:root[data-theme="light"] .prompt-field textarea::placeholder,
:root[data-theme="light"] .style-prompt-field textarea::placeholder,
:root[data-theme="light"] .api-key-connect input::placeholder {
  color: #9a91a4;
}

:root[data-theme="light"] .style-option,
:root[data-theme="light"] .voice-option,
:root[data-theme="light"] .vocal-expression-switch,
:root[data-theme="light"] .stem-row button,
:root[data-theme="light"] .character-gender-switch,
:root[data-theme="light"] .character-gender-switch button,
:root[data-theme="light"] .emotion-options button,
:root[data-theme="light"] .reference-options label,
:root[data-theme="light"] .reference-workflow-switch,
:root[data-theme="light"] .asset-picker-filters button,
:root[data-theme="light"] .asset-picker-search,
:root[data-theme="light"] .asset-picker-card,
:root[data-theme="light"] .engine-choice,
:root[data-theme="light"] .mastering-presets button {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface-2);
}

:root[data-theme="light"] .style-option:hover,
:root[data-theme="light"] .voice-option:hover,
:root[data-theme="light"] .suggestion:hover,
:root[data-theme="light"] .asset-picker-card:hover,
:root[data-theme="light"] .asset-picker-card.is-selected,
:root[data-theme="light"] .engine-choice:not(:disabled):hover,
:root[data-theme="light"] .mastering-presets button:hover,
:root[data-theme="light"] .ghost-button:hover,
:root[data-theme="light"] .secondary-button:hover,
:root[data-theme="light"] .icon-button:hover {
  border-color: #b9a5d0;
  color: var(--text);
  background: #f0eaf6;
}

:root[data-theme="light"] .style-option.is-selected,
:root[data-theme="light"] .voice-option.is-selected,
:root[data-theme="light"] .emotion-options button.is-selected,
:root[data-theme="light"] .reference-workflow-switch button.is-active,
:root[data-theme="light"] .engine-choice.is-selected,
:root[data-theme="light"] .mastering-presets button.is-active {
  border-color: rgba(121, 80, 181, 0.55);
  color: var(--purple-strong);
  background: #eee6f5;
}

:root[data-theme="light"] .voice-option__mark,
:root[data-theme="light"] .assistant-symbol,
:root[data-theme="light"] .assistant-avatar,
:root[data-theme="light"] .suggestion-icon,
:root[data-theme="light"] .engine-choice__icon,
:root[data-theme="light"] .history-item__icon,
:root[data-theme="light"] .asset-preview > span {
  border-color: #cbb9dc;
  color: var(--purple-strong);
  background: #f0e9f6;
}

:root[data-theme="light"] .voice-option.is-selected .voice-option__mark {
  border-color: rgba(25, 127, 138, 0.42);
  background: #e5f3f2;
}

:root[data-theme="light"] .visual-asset-builder,
:root[data-theme="light"] .character-assets,
:root[data-theme="light"] .character-asset,
:root[data-theme="light"] .scene-assets,
:root[data-theme="light"] .scene-asset,
:root[data-theme="light"] .storyboard-toolbar,
:root[data-theme="light"] .video-preview-panel,
:root[data-theme="light"] .mv-style-library,
:root[data-theme="light"] .asset-picker-toolbar,
:root[data-theme="light"] .asset-picker-preview,
:root[data-theme="light"] .history-item,
:root[data-theme="light"] .mastering-pipeline__steps > span,
:root[data-theme="light"] .mastering-presets button {
  border-color: var(--line);
  background: var(--surface-2);
}

:root[data-theme="light"] .asset-preview,
:root[data-theme="light"] .scene-preview__media,
:root[data-theme="light"] .asset-picker-card__media,
:root[data-theme="light"] .asset-picker-preview__media > span {
  border-color: #cbb9dc;
  background: #eeeaf3;
}

:root[data-theme="light"] .asset-controls textarea,
:root[data-theme="light"] .scene-item textarea {
  border-color: var(--line);
  background: #fbfafd;
}

:root[data-theme="light"] .mv-style-filters button,
:root[data-theme="light"] .mv-style-option {
  border-color: var(--line);
  background: var(--surface-2);
}

:root[data-theme="light"] .mv-style-filters button.is-active {
  border-color: rgba(121, 80, 181, 0.52);
  color: var(--purple-strong);
  background: #eee6f5;
}

:root[data-theme="light"] .assistant-message p,
:root[data-theme="light"] .intent-block dd,
:root[data-theme="light"] .assistant-result-item b,
:root[data-theme="light"] .scene-item blockquote,
:root[data-theme="light"] .analysis-strip b,
:root[data-theme="light"] .provider-facts small,
:root[data-theme="light"] .mv-stitch-actions b,
:root[data-theme="light"] .mv-audio-readiness b {
  color: var(--text);
}

:root[data-theme="light"] .scene-item blockquote {
  border-left-color: var(--cyan);
  background: #f3eff7;
}

:root[data-theme="light"] .audio-result-card {
  border-color: rgba(121, 80, 181, 0.28);
  background: linear-gradient(180deg, #f4eff9, #ffffff 86%);
  box-shadow: inset 0 0 28px rgba(121, 80, 181, 0.035);
}

:root[data-theme="light"] .cover-art {
  border-color: #c5b4d7;
  background-color: #eee6f5;
}

:root[data-theme="light"] .cover-art.has-image {
  background: #eee6f5;
}

:root[data-theme="light"] .waveform-wrap,
:root[data-theme="light"] .lyrics-karaoke,
:root[data-theme="light"] .spectrum-stage {
  border-color: rgba(121, 80, 181, 0.22);
  background-color: #fbfafd;
  background-image:
    linear-gradient(rgba(121, 80, 181, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 80, 181, 0.055) 1px, transparent 1px);
}

:root[data-theme="light"] .seek-range {
  background: linear-gradient(90deg, var(--cyan) var(--range-progress, 0%), #d9d1e3 var(--range-progress, 0%)) !important;
}

:root[data-theme="light"] .seek-range::-webkit-slider-thumb {
  background: #ffffff !important;
}

:root[data-theme="light"] .generation-progress progress,
:root[data-theme="light"] .generation-progress progress::-webkit-progress-bar,
:root[data-theme="light"] .mastering-progress > div {
  background: #ddd5e5;
}

:root[data-theme="light"] .style-mix-toolbar {
  border-color: rgba(25, 127, 138, 0.2);
  color: var(--text);
  background: rgba(25, 127, 138, 0.06);
}

:root[data-theme="light"] .mv-segment-result,
:root[data-theme="light"] .video-submit-strip,
:root[data-theme="light"] .mv-stitch-actions,
:root[data-theme="light"] .cloud-task-status,
:root[data-theme="light"] .mv-audio-readiness,
:root[data-theme="light"] .mastering-specs {
  border-color: var(--line);
  background: var(--surface-2);
}

:root[data-theme="light"] .mv-segment-result > span {
  background: #e5f3f2;
}

:root[data-theme="light"] .mv-audio-readiness {
  background: rgba(25, 127, 138, 0.07);
}

:root[data-theme="light"] .mv-audio-readiness.is-missing,
:root[data-theme="light"] .mv-audio-readiness.is-error {
  background: rgba(185, 68, 81, 0.07);
}

:root[data-theme="light"] .mv-audio-readiness.is-loading {
  background: rgba(154, 108, 31, 0.08);
}

:root[data-theme="light"] .modal-head,
:root[data-theme="light"] .modal-actions,
:root[data-theme="light"] .history-summary,
:root[data-theme="light"] .settings-grid,
:root[data-theme="light"] .provider-facts,
:root[data-theme="light"] .account-summary {
  border-color: var(--line);
}

:root[data-theme="light"] .package-option,
:root[data-theme="light"] .payment-status,
:root[data-theme="light"] .api-key-connect label,
:root[data-theme="light"] .engine-choice,
:root[data-theme="light"] .video-submit-strip .subtitle-toggle,
:root[data-theme="light"] .history-item,
:root[data-theme="light"] .mastering-source select,
:root[data-theme="light"] .mastering-presets button {
  border-color: var(--line);
  background: var(--surface-2);
}

:root[data-theme="light"] .assistant-showcase-button {
  border-color: rgba(121, 80, 181, 0.3);
  color: var(--purple-strong);
  background: rgba(121, 80, 181, 0.06);
}

:root[data-theme="light"] .assistant-showcase-button:hover:not(:disabled),
:root[data-theme="light"] .assistant-showcase-button.is-recommended {
  border-color: rgba(121, 80, 181, 0.46);
  color: #5d368f;
  background: #eee6f5;
}

:root[data-theme="light"] .assistant-showcase-button.is-taken-down,
:root[data-theme="light"] .assistant-showcase-button.is-rejected {
  border-color: rgba(183, 65, 78, 0.34);
  color: #a52e3c;
  background: rgba(183, 65, 78, 0.07);
}

:root[data-theme="light"] .assistant-showcase-button.is-pending {
  border-color: rgba(157, 111, 31, 0.34);
  color: #805815;
  background: rgba(157, 111, 31, 0.07);
}

:root[data-theme="light"] .assistant-showcase-form textarea {
  border-color: var(--line);
  background: #fff;
}

:root[data-theme="light"] .package-option.is-selected,
:root[data-theme="light"] .engine-choice.is-selected {
  border-color: rgba(121, 80, 181, 0.52);
  background: #eee6f5;
}

:root[data-theme="light"] .wallet-balance {
  background: #f3eff8;
}

:root[data-theme="light"] .mastering-pipeline {
  background: rgba(121, 80, 181, 0.07);
}

:root[data-theme="light"] .mastering-result {
  background: rgba(44, 123, 88, 0.07);
}

:root[data-theme="light"] .toast {
  border-color: #cbb9dc;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(54, 43, 66, 0.16);
}

:root[data-theme="light"] .welcome-card p,
:root[data-theme="light"] .welcome-credit small {
  color: var(--muted);
}

:root[data-theme="light"] .welcome-credit {
  background: rgba(121, 80, 181, 0.1);
}

:root[data-theme="light"] .welcome-credit b,
:root[data-theme="light"] .welcome-credit span {
  color: var(--purple-strong);
}

:root[data-theme="light"] .theme-toggle.auth-theme-toggle {
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .primary-button,
:root[data-theme="light"] .generate-button {
  border-color: #8153b5;
  color: #ffffff;
  background: #7650ad;
}

:root[data-theme="light"] .primary-button:hover,
:root[data-theme="light"] .generate-button:hover {
  border-color: #6b3e9d;
  background: #68409d;
}

:root[data-theme="light"] .app-shell input:not([type="range"]),
:root[data-theme="light"] .app-shell select,
:root[data-theme="light"] .app-shell textarea {
  caret-color: var(--purple-strong);
}

:root[data-theme="light"] .app-shell input:disabled,
:root[data-theme="light"] .app-shell select:disabled,
:root[data-theme="light"] .app-shell textarea:disabled {
  border-color: #d2cadb;
  color: #817987;
  background: #ece8f0;
  opacity: 0.78;
}

:root[data-theme="light"] button:disabled {
  border-color: #d2cadb;
  color: #817987;
  background-color: #ece8f0;
  opacity: 0.78;
}

:root[data-theme="light"] button:focus-visible,
:root[data-theme="light"] input:focus-visible,
:root[data-theme="light"] select:focus-visible,
:root[data-theme="light"] textarea:focus-visible {
  outline: 3px solid #6f3eaa;
  outline-offset: 2px;
}

:root[data-theme="light"] input[type="range"] {
  background: linear-gradient(90deg, var(--purple) var(--range-progress, 40%), #cfc5d9 var(--range-progress, 40%));
}

:root[data-theme="light"] input[type="range"]::-webkit-slider-thumb {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #6f3eaa, 0 2px 7px rgba(55, 35, 75, 0.28);
}

/* Keep secondary workstation copy readable on lifted surfaces. */
:root[data-theme="light"] .section-heading h2,
:root[data-theme="light"] .composer-disclosure > summary,
:root[data-theme="light"] .field-label > span,
:root[data-theme="light"] .style-select-field > span,
:root[data-theme="light"] .track-identity h3,
:root[data-theme="light"] .audio-result-head h3,
:root[data-theme="light"] .lyrics-karaoke-head > span,
:root[data-theme="light"] .generation-progress b,
:root[data-theme="light"] .charge-guard b,
:root[data-theme="light"] .spectrum-panel header b,
:root[data-theme="light"] .assistant-head h2,
:root[data-theme="light"] .assistant-log li b,
:root[data-theme="light"] .assistant-results > header b,
:root[data-theme="light"] .suggestion b,
:root[data-theme="light"] .reference-step-heading h3,
:root[data-theme="light"] .reference-studio__header h3,
:root[data-theme="light"] .automation-workflow__header h3 {
  color: var(--text);
}

:root[data-theme="light"] .composer-disclosure > summary small,
:root[data-theme="light"] .field-label small,
:root[data-theme="light"] .style-select-field small,
:root[data-theme="light"] .track-identity small,
:root[data-theme="light"] .track-identity p,
:root[data-theme="light"] .generation-note,
:root[data-theme="light"] .charge-guard small,
:root[data-theme="light"] .timeline-labels,
:root[data-theme="light"] .transport-time,
:root[data-theme="light"] .lyrics-karaoke-head output,
:root[data-theme="light"] .spectrum-panel header output,
:root[data-theme="light"] .assistant-log li small,
:root[data-theme="light"] .assistant-results > header small,
:root[data-theme="light"] .assistant-result-item small,
:root[data-theme="light"] .suggestion small,
:root[data-theme="light"] .reference-step-heading p,
:root[data-theme="light"] .automation-workflow__summary {
  color: var(--muted);
}

:root[data-theme="light"] .style-select-field select,
:root[data-theme="light"] .style-select-field option {
  color: var(--text);
  background: #ffffff;
}

:root[data-theme="light"] .style-select-field select {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

:root[data-theme="light"] .intent-block dl > div {
  border-bottom-color: var(--line);
}

@media (max-width: 620px) {
  .auth-theme-toggle {
    top: 20px;
    right: 18px;
  }

  .top-actions > .theme-toggle {
    display: grid;
  }
}

/* Mobile studio home: a compact entry point that keeps the full workstation below it. */
.mobile-home,
.mobile-tabbar,
.mobile-creation-wizard,
.mobile-wizard-actions {
  display: none;
}

@media (max-width: 620px) {
  html,
  body,
  .app-shell,
  .workspace {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 320px;
    background-size: 32px 32px;
  }

  .app-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  .sidebar {
    display: none;
  }

  .mobile-home {
    display: block;
    order: 1;
    width: 100%;
    padding: max(18px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 88% 4%, rgba(169, 112, 255, 0.2), transparent 34%),
      linear-gradient(180deg, rgba(13, 10, 20, 0.98), var(--bg) 58%);
  }

  :root[data-theme="light"] .mobile-home {
    background:
      radial-gradient(circle at 88% 4%, rgba(121, 80, 181, 0.12), transparent 34%),
      linear-gradient(180deg, #fbf9fd, var(--bg) 58%);
  }

  .mobile-home__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    margin-bottom: 18px;
  }

  .mobile-home__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }

  .mobile-home__brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .mobile-home__brand b,
  .mobile-home__brand small {
    display: block;
  }

  .mobile-home__brand b {
    font-size: 15px;
    line-height: 1.1;
  }

  .mobile-home__brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .12em;
  }

  .mobile-home__actions {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mobile-home__actions .icon-button {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
  }

  :root[data-theme="light"] .mobile-home__actions .icon-button {
    background: rgba(255, 255, 255, .75);
  }

  .mobile-home__actions .icon-button:hover {
    color: var(--text);
    border-color: var(--line-strong);
  }

  .mobile-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(242, 190, 101, .34);
    border-radius: 999px;
    color: var(--gold);
    background: rgba(242, 190, 101, .1);
    font-size: 11px;
    white-space: nowrap;
  }

  .mobile-credit-pill .icon {
    width: 14px;
    height: 14px;
  }

  .mobile-credit-pill b {
    font-size: 11px;
  }

  .notification-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pink);
    box-shadow: 0 0 0 2px var(--surface);
  }

  .mobile-hero-card {
    position: relative;
    isolation: isolate;
    min-height: 236px;
    padding: 24px 20px 19px;
    overflow: hidden;
    border: 1px solid rgba(169, 112, 255, .38);
    border-radius: 19px;
    background:
      linear-gradient(135deg, rgba(48, 28, 73, .98), rgba(28, 19, 44, .98) 58%, rgba(35, 25, 49, .96));
    box-shadow: 0 22px 50px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .08);
  }

  :root[data-theme="light"] .mobile-hero-card {
    border-color: rgba(121, 80, 181, .28);
    background: linear-gradient(135deg, #f0e8fa, #fbf8fd 62%, #eee8f5);
    box-shadow: 0 20px 45px rgba(84, 61, 107, .15), inset 0 1px rgba(255, 255, 255, .85);
  }

  .mobile-hero-card__glow {
    position: absolute;
    z-index: -1;
    top: -68px;
    right: -48px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(81, 216, 223, .26);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(81, 216, 223, .035), 0 0 0 42px rgba(81, 216, 223, .025);
  }

  .mobile-hero-card__glow::after {
    position: absolute;
    right: 28px;
    bottom: 30px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: rgba(237, 94, 183, .28);
    filter: blur(22px);
    content: "";
  }

  .mobile-hero-card .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cyan);
    font-size: 8px;
    letter-spacing: .14em;
  }

  .mobile-hero-card h1 {
    max-width: 300px;
    margin: 15px 0 9px;
    font-size: clamp(28px, 8.6vw, 38px);
    line-height: 1.12;
    letter-spacing: -.04em;
  }

  .mobile-hero-card h1 em {
    color: var(--purple);
    font-style: normal;
  }

  :root[data-theme="light"] .mobile-hero-card h1 em {
    color: var(--purple-strong);
  }

  .mobile-hero-card p {
    max-width: 265px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
  }

  .mobile-hero-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
  }

  .mobile-hero-card__actions .primary-button,
  .mobile-hero-card__actions .ghost-button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 11px;
  }

  .mobile-hero-card__actions .primary-button .icon,
  .mobile-hero-card__actions .ghost-button .icon {
    width: 15px;
    height: 15px;
  }

  .mobile-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .mobile-section-title span {
    display: grid;
    gap: 4px;
  }

  .mobile-section-title b {
    font-size: 15px;
    letter-spacing: -.02em;
  }

  .mobile-section-title small {
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-quick-actions {
    margin-top: 25px;
  }

  .mobile-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .mobile-quick-card {
    position: relative;
    display: grid;
    min-height: 108px;
    align-content: start;
    justify-items: start;
    padding: 13px 12px 11px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    text-align: left;
    background: var(--surface);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  }

  .mobile-quick-card::after {
    position: absolute;
    right: -18px;
    bottom: -24px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: currentColor;
    content: "";
    opacity: .07;
  }

  .mobile-quick-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
  }

  .mobile-quick-card:active {
    transform: translateY(0);
  }

  .mobile-quick-icon {
    display: grid;
    width: 30px;
    height: 30px;
    margin-bottom: 12px;
    place-items: center;
    border-radius: 9px;
    color: currentColor;
    background: rgba(255, 255, 255, .09);
  }

  .mobile-quick-icon .icon {
    width: 16px;
    height: 16px;
  }

  .mobile-quick-card b {
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-quick-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
  }

  .mobile-quick-arrow {
    position: absolute;
    right: 11px;
    bottom: 11px;
    width: 13px;
    height: 13px;
    color: var(--muted-2);
  }

  .mobile-quick-card--purple { color: var(--purple); }
  .mobile-quick-card--cyan { color: var(--cyan); }
  .mobile-quick-card--pink { color: var(--pink); }
  .mobile-quick-card--gold { color: var(--gold); }

  .mobile-task-card {
    margin-top: 24px;
    padding: 15px 15px 13px;
    border: 1px solid rgba(81, 216, 223, .2);
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(81, 216, 223, .09), rgba(169, 112, 255, .08));
  }

  :root[data-theme="light"] .mobile-task-card {
    border-color: rgba(25, 127, 138, .22);
    background: linear-gradient(120deg, rgba(25, 127, 138, .08), rgba(121, 80, 181, .06));
  }

  .mobile-task-card__top,
  .mobile-task-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-task-card__top > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .mobile-task-card__top b {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-task-card__top strong {
    color: var(--cyan);
    font-size: 12px;
  }

  .mobile-task-progress {
    height: 6px;
    margin: 12px 0 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
  }

  :root[data-theme="light"] .mobile-task-progress {
    background: rgba(25, 127, 138, .12);
  }

  .mobile-task-progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    transition: width 220ms ease;
  }

  .mobile-task-card.is-complete .mobile-task-progress > span {
    background: linear-gradient(90deg, var(--green), var(--cyan));
  }

  .mobile-task-card.is-generating .status-dot {
    animation: step-pulse 1.1s ease-in-out infinite;
  }

  .mobile-task-card__meta {
    color: var(--muted);
    font-size: 9px;
  }

  .mobile-task-card__meta .text-button {
    flex: 0 0 auto;
    color: var(--purple);
    font-size: 10px;
  }

  .mobile-task-card__meta .text-button .icon {
    width: 13px;
    height: 13px;
  }

  .mobile-recent-section {
    margin-top: 25px;
  }

  .mobile-recent-section .text-button {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-recent-projects {
    display: flex;
    gap: 10px;
    width: calc(100vw - 16px);
    max-width: none;
    margin-right: -16px;
    overflow-x: auto;
    padding: 2px 16px 8px 0;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .mobile-recent-projects::-webkit-scrollbar { display: none; }

  .mobile-project-card {
    display: grid;
    grid-template-columns: 44px minmax(115px, 1fr) 13px;
    align-items: center;
    gap: 10px;
    width: min(235px, 74vw);
    min-width: min(235px, 74vw);
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--text);
    text-align: left;
    background: var(--surface);
    scroll-snap-align: start;
  }

  .mobile-project-card:hover { border-color: var(--line-strong); }

  .mobile-project-cover {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #7d4ec4, #ca4e9f);
  }

  .mobile-project-cover--blue { background: linear-gradient(135deg, #2b7eab, #51d8df); }
  .mobile-project-cover .icon { width: 19px; height: 19px; }
  .mobile-project-card > span:nth-child(2) { display: grid; gap: 5px; min-width: 0; }
  .mobile-project-card b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-project-card small { color: var(--muted); font-size: 9px; }
  .mobile-project-card > .icon { width: 13px; height: 13px; color: var(--muted-2); }

  .mobile-tabbar {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: 64px;
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(18, 14, 27, .94);
    backdrop-filter: blur(20px);
  }

  :root[data-theme="light"] .mobile-tabbar {
    background: rgba(255, 255, 255, .94);
  }

  .mobile-tabbar button {
    display: grid;
    min-width: 0;
    place-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 10px;
    color: var(--muted-2);
    background: transparent;
    font-size: 9px;
  }

  .mobile-tabbar button .icon { width: 18px; height: 18px; }
  .mobile-tabbar button.is-active { color: var(--purple); background: rgba(169, 112, 255, .1); }
  :root[data-theme="light"] .mobile-tabbar button.is-active { color: var(--purple-strong); background: rgba(121, 80, 181, .1); }

  .workspace {
    order: 2;
    width: 100%;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .workspace .topbar {
    position: sticky;
    top: 0;
    z-index: 15;
  }

  .studio-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .composer-panel,
  .preview-panel,
  .assistant-panel {
    min-width: 0;
  }
}

@media (max-width: 399px) {
  .mobile-home { padding-right: 12px; padding-left: 12px; }
  .mobile-recent-projects { width: calc(100vw - 12px); margin-right: -12px; }
  .mobile-hero-card { padding-right: 16px; padding-left: 16px; }
  .mobile-hero-card__actions .primary-button,
  .mobile-hero-card__actions .ghost-button { padding-right: 11px; padding-left: 11px; }
}

/* Mobile creation wizard: one focused, screen-safe card group per step. */
@media (max-width: 620px) {
  .playback-next-options {
    align-items: flex-start;
    padding: 11px;
  }

  .playback-next-options .text-button {
    flex: 0 0 auto;
  }

  .delivery-panel__head {
    flex-direction: column;
    gap: 8px;
  }

  .delivery-state {
    align-self: flex-start;
  }

  .delivery-stages {
    gap: 5px;
  }

  .delivery-stages li {
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 5px;
    padding: 7px 5px;
  }

  .delivery-stages li > span {
    width: 20px;
    height: 20px;
  }

  .delivery-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .delivery-actions > * {
    width: 100%;
    justify-content: center;
  }

  .mobile-creation-wizard {
    position: sticky;
    z-index: 14;
    top: 52px;
    display: block;
    width: 100%;
    padding: 8px 12px 0;
    background: linear-gradient(180deg, var(--bg) 78%, transparent);
  }

  .mobile-wizard-head {
    width: 100%;
    max-width: 100%;
    padding: 11px 12px 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(20, 16, 29, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(18px);
  }

  :root[data-theme="light"] .mobile-wizard-head {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(54, 43, 66, 0.1);
  }

  .mobile-wizard-head > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin-bottom: 9px;
  }

  .mobile-wizard-head > span small {
    color: var(--purple);
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-wizard-head > span b {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-wizard-progress {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 5px;
    width: 100%;
  }

  .mobile-wizard-progress button {
    display: grid;
    min-width: 0;
    min-height: 43px;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted-2);
    background: var(--surface-2);
  }

  .mobile-wizard-progress button > span {
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    font-size: 8px;
    font-weight: 750;
  }

  .mobile-wizard-progress button small {
    max-width: 100%;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-wizard-progress button.is-active {
    border-color: rgba(169, 112, 255, 0.42);
    color: var(--text);
    background: rgba(169, 112, 255, 0.12);
  }

  .mobile-wizard-progress button.is-active > span {
    border-color: var(--purple);
    color: #ffffff;
    background: var(--purple-strong);
  }

  :root[data-theme="light"] .mobile-wizard-progress button.is-active {
    border-color: rgba(121, 80, 181, 0.34);
    background: rgba(121, 80, 181, 0.1);
  }

  .workspace {
    padding-bottom: calc(154px + env(safe-area-inset-bottom));
  }

  .content-head,
  .studio-layout {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    margin-right: 12px;
    margin-left: 12px;
  }

  .content-head {
    display: none;
    margin-top: 10px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .content-head .project-title {
    width: 100%;
    max-width: 100%;
    font-size: 20px;
    line-height: 1.25;
  }

  .content-head p {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.55;
  }

  .head-meta {
    margin-top: 10px;
  }

  .studio-layout,
  .studio-layout.is-assistant-closed {
    display: block;
    margin-top: 10px;
    margin-bottom: 14px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .composer-panel,
  .preview-panel,
  .assistant-panel {
    display: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent !important;
  }

  body[data-mobile-wizard-step="direction"] .content-head,
  body[data-mobile-wizard-step="direction"] .composer-panel,
  body[data-mobile-wizard-step="style"] .composer-panel,
  body[data-mobile-wizard-step="voice"] .composer-panel,
  body[data-mobile-wizard-step="lyrics"] .composer-panel,
  body[data-mobile-wizard-step="playback"] .preview-panel,
  body[data-mobile-wizard-step="delivery"] .preview-panel {
    display: block;
  }

  body[data-mobile-wizard-step="direction"] .composer-panel > :not(.creation-direction-heading):not(.prompt-field):not(.song-type-group):not(.reference-drop),
  body[data-mobile-wizard-step="direction"] .composer-panel > [data-composer-disclosure],
  body[data-mobile-wizard-step="style"] .composer-panel > :not([data-composer-disclosure="styles"]),
  body[data-mobile-wizard-step="voice"] .composer-panel > :not([data-composer-disclosure="voice"]),
  body[data-mobile-wizard-step="lyrics"] .composer-panel > :not(#lyricsSection):not([data-composer-disclosure="parameters"]) {
    display: none !important;
  }

  body[data-mobile-wizard-step="direction"] .composer-panel,
  body[data-mobile-wizard-step="style"] [data-composer-disclosure="styles"],
  body[data-mobile-wizard-step="voice"] [data-composer-disclosure="voice"],
  body[data-mobile-wizard-step="lyrics"] #lyricsSection,
  body[data-mobile-wizard-step="lyrics"] [data-composer-disclosure="parameters"] {
    width: 100%;
    max-width: 100%;
    margin: 0 0 10px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  body[data-mobile-wizard-step="direction"] .content-head,
  body[data-mobile-wizard-step="direction"] .composer-panel {
    display: block;
  }

  body[data-mobile-wizard-step="direction"] .content-head {
    display: block;
  }

  body[data-mobile-wizard-step="style"] [data-composer-disclosure="styles"] > summary,
  body[data-mobile-wizard-step="voice"] [data-composer-disclosure="voice"] > summary,
  body[data-mobile-wizard-step="lyrics"] #lyricsSection > summary,
  body[data-mobile-wizard-step="lyrics"] [data-composer-disclosure="parameters"] > summary {
    display: none;
  }

  body[data-mobile-wizard-step="direction"] .creation-direction-heading {
    margin-bottom: 13px;
  }

  body[data-mobile-wizard-step="direction"] .prompt-field,
  body[data-mobile-wizard-step="direction"] .song-type-group,
  body[data-mobile-wizard-step="direction"] .reference-drop {
    width: 100%;
    max-width: 100%;
  }

  .composer-disclosure__body,
  .composer-disclosure__body.field-group {
    min-width: 0;
    padding-top: 0;
  }

  .style-select-field,
  .style-select-field select,
  .mobile-style-wheel,
  .style-prompt-field,
  .style-prompt-field textarea,
  .dialect-selectors,
  .dialect-selectors select,
  .voice-library,
  .voice-preset-grid,
  .lyrics-editor,
  .lyrics-editor textarea,
  .parameter-grid,
  .compact-field,
  .range-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .style-select-field > span,
  .style-mix-toolbar,
  .field-label {
    flex-wrap: wrap;
  }

  .style-select-field small,
  .style-mix-actions,
  .style-mix-actions output {
    max-width: 100%;
    white-space: normal;
  }

  .style-prompt-field textarea {
    min-height: 92px;
  }

  .style-select-field select {
    display: none;
  }

  .mobile-style-wheel {
    position: relative;
    display: block;
    height: 224px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-snap-type: y mandatory;
    scroll-padding: 88px 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-2);
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }

  .mobile-style-wheel::before,
  .mobile-style-wheel::after {
    position: sticky;
    z-index: 2;
    right: 0;
    left: 0;
    display: block;
    height: 76px;
    pointer-events: none;
    content: "";
  }

  .mobile-style-wheel::before {
    top: 0;
    margin-bottom: -76px;
    background: linear-gradient(180deg, var(--surface-2), rgba(243, 240, 247, 0));
  }

  .mobile-style-wheel::after {
    bottom: 0;
    margin-top: -76px;
    background: linear-gradient(0deg, var(--surface-2), rgba(243, 240, 247, 0));
  }

  .mobile-style-wheel__group {
    display: grid;
    gap: 3px;
    padding: 6px 8px;
  }

  .mobile-style-wheel__group-title {
    position: static;
    z-index: 3;
    display: block;
    padding: 4px 8px;
    color: var(--purple-strong);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .04em;
    background: transparent;
  }

  .mobile-style-wheel__option {
    display: grid;
    min-height: 46px;
    align-content: center;
    gap: 3px;
    padding: 7px 12px;
    scroll-snap-align: center;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    text-align: left;
    background: transparent;
    transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
  }

  .mobile-style-wheel__option span,
  .mobile-style-wheel__option small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-style-wheel__option span {
    font-size: 11px;
    font-weight: 650;
  }

  .mobile-style-wheel__option small {
    color: var(--muted-2);
    font-size: 9px;
  }

  .mobile-style-wheel__option.is-selected {
    grid-template-columns: minmax(0, 1fr) auto;
    border-color: rgba(121, 80, 181, 0.5);
    color: var(--purple-strong);
    background: rgba(121, 80, 181, 0.11);
    transform: scale(1.015);
  }

  .mobile-style-wheel__option.is-selected::after {
    align-self: center;
    color: var(--cyan);
    content: "已选";
    font-size: 8px;
    font-weight: 750;
  }

  .lyrics-editor textarea {
    min-height: min(46vh, 390px);
    max-height: 52vh;
  }

  .preview-panel .preview-heading,
  .preview-panel .track-identity,
  .preview-panel .generation-console,
  .preview-panel .audio-result-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .preview-panel .preview-heading,
  .preview-panel .track-identity,
  .preview-panel .generation-console {
    margin: 0 0 10px;
    padding: 13px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .preview-panel .preview-heading {
    min-height: 0;
  }

  .preview-panel .track-identity {
    grid-template-columns: 46px minmax(0, 1fr) 32px;
    gap: 9px;
  }

  .preview-panel .cover-art {
    width: 46px;
    height: 46px;
  }

  .preview-panel .track-identity h3,
  .preview-panel .track-identity p {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preview-panel .audio-result-card {
    padding: 12px;
    overflow: hidden;
    border-radius: 8px;
  }

  .audio-result-head {
    gap: 9px;
  }

  .audio-result-head > div:first-child,
  .lyrics-sync-actions {
    width: 100%;
    min-width: 0;
  }

  .lyrics-sync-actions {
    align-items: stretch;
  }

  .lyrics-realign-button {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .lyrics-karaoke-viewport {
    height: clamp(210px, 42vh, 320px);
  }

  .lyrics-karaoke-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .lyrics-karaoke-head output {
    width: 100%;
    max-width: 100%;
    text-align: left;
    white-space: normal;
  }

  .spectrum-stage {
    height: min(44vw, 176px);
    min-height: 126px;
  }

  body[data-mobile-wizard-step="playback"] .arrangement,
  body[data-mobile-wizard-step="playback"] .analysis-strip {
    display: none;
  }

  body[data-mobile-wizard-step="playback"] .preview-panel > :not(.preview-heading):not(.track-identity):not(.generation-console):not(.audio-result-card):not(.playback-next-options),
  body[data-mobile-wizard-step="playback"] .audio-result-card .lyrics-karaoke,
  body[data-mobile-wizard-step="playback"] .audio-result-card .timeline-labels,
  body[data-mobile-wizard-step="playback"] .audio-result-card .seek-range,
  body[data-mobile-wizard-step="playback"] .audio-result-card .transport,
  body[data-mobile-wizard-step="delivery"] .preview-panel > :not(.preview-heading):not(.track-identity):not(.audio-result-card):not(.delivery-panel),
  body[data-mobile-wizard-step="delivery"] .delivery-panel + audio {
    display: none !important;
  }

  body[data-mobile-wizard-step="playback"] .preview-panel .audio-result-card,
  body[data-mobile-wizard-step="playback"] .preview-panel .audio-result-card .timeline-labels,
  body[data-mobile-wizard-step="playback"] .preview-panel .audio-result-card .seek-range,
  body[data-mobile-wizard-step="playback"] .preview-panel .audio-result-card .transport,
  body[data-mobile-wizard-step="playback"] .preview-panel .audio-result-card .spectrum-panel {
    display: block;
  }

  body[data-mobile-wizard-step="delivery"] .preview-panel .audio-result-card,
  body[data-mobile-wizard-step="delivery"] .preview-panel .audio-result-card .lyrics-karaoke,
  body[data-mobile-wizard-step="delivery"] .preview-panel .audio-result-card .timeline-labels,
  body[data-mobile-wizard-step="delivery"] .preview-panel .audio-result-card .seek-range,
  body[data-mobile-wizard-step="delivery"] .preview-panel .audio-result-card .transport {
    display: block;
  }

  body[data-mobile-wizard-step="delivery"] .preview-panel .audio-result-card .spectrum-panel {
    display: none !important;
  }

  body[data-mobile-wizard-step="delivery"] .playback-next-options {
    display: none !important;
  }

  body[data-mobile-wizard-step="delivery"] .delivery-panel {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .export-actions {
    gap: 7px;
    margin-top: 10px;
  }

  .export-actions > * {
    min-width: 0;
    white-space: normal;
  }

  .mobile-wizard-actions {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: rgba(18, 14, 27, 0.95);
    backdrop-filter: blur(20px);
  }

  :root[data-theme="light"] .mobile-wizard-actions {
    background: rgba(255, 255, 255, 0.95);
  }

  .mobile-wizard-actions.is-first,
  .mobile-wizard-actions.is-last {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-wizard-actions button {
    display: flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--text);
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-wizard-actions .mobile-wizard-next {
    border-color: rgba(169, 112, 255, 0.55);
    color: #ffffff;
    background: var(--purple-strong);
  }

  .mobile-wizard-actions button .icon {
    width: 14px;
    height: 14px;
  }

  .mobile-wizard-back .icon {
    transform: rotate(180deg);
  }
}

@media (max-width: 359px) {
  .mobile-creation-wizard {
    padding-right: 8px;
    padding-left: 8px;
  }

  .content-head,
  .studio-layout {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    margin-right: 8px;
    margin-left: 8px;
  }

  .mobile-wizard-head,
  body[data-mobile-wizard-step="direction"] .composer-panel,
  body[data-mobile-wizard-step="style"] [data-composer-disclosure="styles"],
  body[data-mobile-wizard-step="voice"] [data-composer-disclosure="voice"],
  body[data-mobile-wizard-step="lyrics"] #lyricsSection,
  body[data-mobile-wizard-step="lyrics"] [data-composer-disclosure="parameters"] {
    padding-right: 10px;
    padding-left: 10px;
  }

  .mobile-wizard-actions {
    padding-right: 8px;
    padding-left: 8px;
  }
}

/* Immersive desktop workstation */
.desktop-studio { margin: 0 28px 24px; padding: 16px; border: 1px solid rgba(174,145,226,.22); border-radius: 8px; background: #111019; box-shadow: 0 22px 60px rgba(0,0,0,.28); perspective: 1600px; overflow: hidden; }
.desktop-studio__toolbar { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:14px; }
.desktop-studio__title { display:grid; gap:4px; min-width:220px; }.desktop-studio__title strong { font-size:18px; letter-spacing:.02em; }.desktop-studio__title small { color:var(--muted); font-size:11px; }
.desktop-studio__modes { display:flex; flex-wrap:wrap; gap:5px; }.desktop-studio__modes button { min-width:58px; height:30px; border:1px solid rgba(255,255,255,.11); border-radius:5px; color:var(--muted); background:#1a1723; font-size:11px; cursor:pointer; }.desktop-studio__modes button.is-active { color:#fff; border-color:#9d70e4; background:#4d3475; box-shadow:0 0 0 1px rgba(181,133,255,.2),0 0 18px rgba(153,91,240,.24); }
.desktop-studio__viewport { min-height:380px; transform-style:preserve-3d; }.desktop-studio__scene { display:grid; grid-template-columns:170px minmax(280px,1fr) 170px; grid-template-rows:250px 112px; gap:12px; transform-style:preserve-3d; transition:transform 650ms cubic-bezier(.2,.8,.2,1); }
.desktop-studio[data-mode="create"] .desktop-studio__scene { transform:translate3d(0,0,0) rotateX(0) rotateY(0) scale(1); }.desktop-studio[data-mode="mix"] .desktop-studio__scene { transform:translate3d(-70px,0,0) rotateY(-4deg) scale(1.015); }.desktop-studio[data-mode="arrange"] .desktop-studio__scene { transform:translate3d(0,45px,0) rotateX(5deg) scale(1.01); }.desktop-studio[data-mode="stems"] .desktop-studio__scene { transform:translate3d(80px,8px,0) rotateY(5deg) scale(1.015); }.desktop-studio[data-mode="master"] .desktop-studio__scene { transform:translate3d(130px,-15px,0) rotateY(8deg) scale(1.02); }.desktop-studio[data-mode="export"] .desktop-studio__scene { transform:translate3d(0,-22px,0) rotateX(-3deg); }
.deck,.creative-stage,.multi-track-timeline { position:relative; border:1px solid rgba(255,255,255,.12); border-radius:7px; background:#191721; box-shadow:inset 0 1px rgba(255,255,255,.06),0 16px 28px rgba(0,0,0,.24); }.deck { padding:12px; display:grid; align-content:start; gap:9px; }.deck--a { border-color:rgba(170,112,255,.45); }.deck--b { border-color:rgba(81,216,223,.4); }.deck__label { display:flex; justify-content:space-between; color:#d9c7f4; font:600 10px/1.2 ui-monospace,monospace; letter-spacing:.1em; }.deck--b .deck__label { color:#a6eff0; }.deck__platter { width:138px; aspect-ratio:1; margin:3px auto; border-radius:50%; background:repeating-radial-gradient(circle at center,#24202d 0 3px,#17151d 4px 6px); border:7px solid #292533; box-shadow:0 0 0 2px #0c0b10,0 0 22px rgba(163,93,255,.23); position:relative; }.deck--b .deck__platter { box-shadow:0 0 0 2px #0c0b10,0 0 22px rgba(54,216,223,.2); }.deck__platter i { position:absolute; inset:41%; border-radius:50%; background:#a671ea; box-shadow:0 0 12px #a671ea; }.deck--b .deck__platter i { background:#53d7dd; box-shadow:0 0 12px #53d7dd; }.deck__platter b { position:absolute; inset:8px; border:1px solid rgba(255,255,255,.08); border-radius:50%; }.deck__meters { display:flex; gap:5px; height:24px; align-items:end; }.deck__meters i { width:8px; height:var(--level); max-height:100%; background:#a36be8; box-shadow:0 0 8px rgba(163,107,232,.55); }.deck--b .deck__meters i { background:#59d7dd; box-shadow:0 0 8px rgba(89,215,221,.4); }.deck__controls { display:flex; align-items:center; gap:8px; }.deck__controls button { width:28px; height:28px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.14); border-radius:50%; color:#fff; background:#272231; cursor:pointer; }.deck__controls .icon { width:13px; height:13px; }.deck__controls label { display:grid; gap:3px; flex:1; color:var(--muted); font-size:9px; }.deck__controls input { width:100%; accent-color:#a56be5; }
.creative-stage { grid-column:2; display:grid; grid-template-columns:155px 1fr; gap:18px; align-items:center; padding:18px; background:radial-gradient(circle at 75% 15%,rgba(94,66,144,.28),transparent 42%),#171520; }.creative-stage__art { width:145px; aspect-ratio:1; overflow:hidden; border-radius:6px; border:1px solid rgba(255,255,255,.16); background:#24202d; }.creative-stage__art img { width:100%; height:100%; object-fit:cover; }.creative-stage__fallback { width:100%; height:100%; display:grid; place-items:center; color:#a36be8; }.creative-stage__fallback .icon { width:34px; height:34px; }.creative-stage__copy { min-width:0; }.creative-stage__copy > span { color:#9e82c8; font-size:10px; }.creative-stage__copy h2 { margin:7px 0; font-size:22px; }.creative-stage__copy p { margin:0 0 17px; color:var(--muted); font-size:12px; }.creative-stage__actions { display:flex; gap:8px; }.creative-stage__actions button { min-height:32px; padding:0 12px; font-size:11px; }
.multi-track-timeline { grid-column:1 / -1; padding:12px 14px; background:#121119; }.timeline__head,.timeline__ruler { display:flex; justify-content:space-between; color:var(--muted); font-size:10px; }.timeline__head span { color:#e4d8f3; font-weight:600; }.timeline__ruler { margin:10px 0 5px 48px; color:#766c85; }.timeline__tracks { display:grid; gap:6px; }.track { display:grid; grid-template-columns:40px 1fr; align-items:center; gap:8px; height:16px; background:repeating-linear-gradient(90deg,rgba(255,255,255,.05) 0 1px,transparent 1px 10%); }.track b { color:#8d8199; font-size:9px; }.clip { display:block; height:12px; border-radius:3px; background:#674b8d; box-shadow:0 0 9px rgba(144,93,215,.28); }.clip--bass { width:68%; background:#276e78; }.clip--vocal { width:78%; background:#9b4f85; }.clip--chord { width:54%; background:#3d7080; }.clip.short { width:19%; margin-left:80%; }.timeline__playhead { position:absolute; top:35px; bottom:10px; left:39%; width:1px; background:#f3c85d; box-shadow:0 0 10px #f3c85d; }
.desktop-studio__mode-panel { display:flex; align-items:center; gap:12px; margin-top:12px; padding:10px 12px; border-top:1px solid rgba(255,255,255,.08); color:var(--muted); font-size:11px; }.desktop-studio__mode-panel strong { color:#eee4fb; font-size:12px; }.desktop-studio__mode-panel span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width: 900px) { .desktop-studio { margin:0 14px 18px; padding:12px; }.desktop-studio__toolbar { align-items:flex-start; flex-direction:column; }.desktop-studio__scene { grid-template-columns:120px minmax(250px,1fr) 120px; }.deck__platter { width:94px; }.creative-stage { grid-template-columns:105px 1fr; padding:12px; gap:12px; }.creative-stage__art { width:98px; }.creative-stage__copy h2 { font-size:17px; } }
@media (max-width: 640px) { .desktop-studio__viewport { overflow-x:auto; padding-bottom:4px; }.desktop-studio__scene { min-width:670px; }.desktop-studio__mode-panel { align-items:flex-start; flex-direction:column; gap:3px; }.desktop-studio__mode-panel span { white-space:normal; } }
@media (prefers-reduced-motion: reduce) { .desktop-studio__scene { transition:none; } }


/* Unsynchronized lyrics remain under direct user scroll control. */
.lyrics-karaoke.is-manual-preview .lyrics-karaoke-viewport {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-behavior: auto;
  touch-action: pan-y;
}
.lyrics-karaoke.is-manual-preview .karaoke-line,
.lyrics-karaoke.is-manual-preview .karaoke-line.is-past,
.lyrics-karaoke.is-manual-preview .karaoke-line.is-active,
.lyrics-karaoke.is-manual-preview .karaoke-line.is-future {
  color: var(--text-primary, #f5f2fa);
  filter: none;
  font-size: 18px;
  opacity: 1;
  transform: none;
}
.lyrics-karaoke.is-manual-preview .karaoke-line > span {
  color: inherit;
}
@media (max-width: 760px) {
  .lyrics-karaoke.is-manual-preview .karaoke-line,
  .lyrics-karaoke.is-manual-preview .karaoke-line.is-active {
    font-size: 17px;
  }
}


.spoken-intro-toggle {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.spoken-intro-toggle input {
  accent-color: #8c54d6;
  flex: 0 0 auto;
}
.spoken-intro-toggle span {
  display: grid;
  gap: 2px;
}
.spoken-intro-toggle b,
.spoken-intro-toggle small {
  display: block;
}
.spoken-intro-toggle small {
  color: var(--text-secondary, #aaa2b7);
  font-size: 12px;
}
