:root {
  --bg: #080a0f;
  --panel: #10131b;
  --panel2: #151925;
  --line: #252b3a;
  --text: #f4f6fb;
  --text-secondary: #b4bdce;
  --muted: #8490a5;
  --muted-soft: #69758a;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #fb7185;
  --shadow: 0 24px 80px #0008;
  --rail: 76px;
  --queue-width: 390px;
  --surface: #0c1018;
  --surface-raised: #121824;
  --glass: #111722cc;
  --accent: #9b7cff;
  --accent2: #4fd8eb;
  --warm: #ffb86b;
  --radius-xl: 24px;
  --fs-caption: 10px;
  --fs-small: 11px;
  --fs-control: 12px;
  --fs-body: 13px;
  --fs-title: 15px;
  --space-panel: 20px;
  --space-toolbar: 10px;
  --control-radius: 10px;
  --ui-control-height: 36px;
  --ui-radius-control: 8px;
  --ui-radius-card: 10px;
  --ui-radius-group: 14px;
  --ui-gap: 10px;
  --editor-bg: #0d121a;
  --editor-bg-hover: #111824;
  --editor-border: #313a4d;
  --editor-border-hover: #46526a;
  --editor-focus: #8b5cf6;
  --editor-text: #d8deea;
  --editor-label: #98a3b6;
  --editor-placeholder: #626e82;
  --entity-surface: #0b0f16;
  --entity-surface-subtle: #0c1119;
  --entity-border: #30384a;
  --entity-empty-border: #303748;
  --entity-divider: #293143;
  --entity-header-start: #151b27;
  --entity-header-end: #0d121b;
  --entity-chip-bg: #111827;
  --entity-chip-border: #334155;
  --entity-title: #aeb8c9;
  --entity-muted: #7f8ba0;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -10%, #4c1d9540, transparent 32%),
    radial-gradient(circle at 95% 3%, #155e7540, transparent 26%),
    linear-gradient(180deg, #090b11 0, #07090d 58%, #090b10 100%);
  color: var(--text);
  font:
    14px/1.55 Inter,
    "Noto Sans JP",
    system-ui,
    sans-serif;
  min-height: 100vh;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.hidden {
  display: none !important;
}
::selection {
  background: #8b5cf655;
  color: white;
}
:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}
.shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(18px, 2.2vw, 42px);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #080a0fcf;
  backdrop-filter: blur(26px) saturate(1.25);
  border-bottom: 1px solid #ffffff12;
  box-shadow: 0 8px 30px #00000020;
}
.topbar-inner {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.logo {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #6366f1 50%, #0891b2);
  box-shadow:
    0 9px 28px #7c3aed55,
    inset 0 1px #ffffff55;
}
.logo svg {
  width: 21px;
}
.brand small {
  color: #798196;
  font-size: 9px;
  display: block;
  letter-spacing: 0.14em;
  margin-top: 1px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.provider-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid #343b4e;
  border-radius: 999px;
  background: linear-gradient(180deg, #171b27, #11141d);
  color: #d6dbea;
  font-size: 11px;
  font-weight: 750;
  box-shadow: inset 0 1px #ffffff0a;
  cursor: pointer;
  transition:
    border-color 0.18s,
    background 0.18s,
    transform 0.18s,
    box-shadow 0.18s;
}
.provider-pill:hover {
  transform: translateY(-1px);
  border-color: #6f7890;
  background: linear-gradient(180deg, #222838, #171b27);
  box-shadow: 0 7px 18px #0004;
}
.provider-pill:active {
  transform: none;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 7px;
  box-shadow: 0 0 12px var(--green);
}
.provider-pill.unconfigured .dot,
.provider-settings-btn.unconfigured .dot {
  background: #f43f5e;
  box-shadow: 0 0 12px #f43f5e;
}
.provider-pill.unconfigured {
  border-color: #fb718566;
}
.btn {
  border: 1px solid #303749;
  border-radius: 10px;
  background: linear-gradient(180deg, #1a1f2c, #141823);
  color: #eef1f7;
  padding: 10px 14px;
  font-weight: 760;
  transition:
    transform 0.18s,
    border-color 0.18s,
    background 0.18s,
    box-shadow 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 5px 16px #00000020,
    inset 0 1px #ffffff0a;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: #535f7c;
  background: linear-gradient(180deg, #222838, #181d29);
  box-shadow: 0 8px 20px #00000035;
}
.btn:active {
  transform: translateY(0);
}
.btn.primary {
  border: 1px solid #9b87f555;
  background: linear-gradient(115deg, #7c3aed, #6265e9);
  box-shadow:
    0 10px 28px #6d28d94d,
    inset 0 1px #ffffff35;
}
.btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 13px 34px #6d28d966;
}
.btn.green {
  border: 1px solid #5eead455;
  background: linear-gradient(110deg, #059669, #0d9488);
  box-shadow: 0 10px 26px #04785735;
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.btn.danger {
  color: #fecdd3;
}
.btn.small {
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 11px;
  box-shadow: none;
}
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
}
.ico {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(20px, 2vw, 34px);
  padding-top: 28px;
  padding-bottom: 80px;
}
.sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}
.progress-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #626b80;
  font-weight: 850;
  margin: 0 0 12px 14px;
}
.step-nav {
  display: grid;
  gap: 6px;
  position: relative;
}
.step-nav:before {
  content: "";
  position: absolute;
  left: 26px;
  top: 25px;
  bottom: 25px;
  width: 1px;
  background: linear-gradient(#8b5cf655, #293044 30%, #293044 70%, transparent);
  z-index: -1;
}
.step-link {
  border: 1px solid transparent;
  background: transparent;
  color: #858da0;
  text-align: left;
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 720;
  transition: 0.18s;
}
.step-link:hover {
  background: #ffffff08;
  color: #e1e4ed;
}
.step-link.active {
  background: linear-gradient(90deg, #8b5cf621, #8b5cf60b);
  border-color: #8b5cf63d;
  color: #e7e0ff;
  box-shadow: inset 3px 0 #8b5cf6;
}
.step-num {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #181c27;
  border: 1px solid #292f40;
  font-size: 10px;
}
.active .step-num {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-color: #a78bfa;
  color: white;
  box-shadow: 0 4px 13px #7c3aed55;
}
.side-note {
  margin-top: 24px;
  padding: 15px;
  border: 1px solid #262c3b;
  border-radius: 14px;
  background: linear-gradient(145deg, #121620, #0d1017);
  color: #7f8799;
  font-size: 11px;
  box-shadow: 0 10px 30px #0002;
}
.side-note b {
  display: block;
  color: #d9ddea;
  margin-bottom: 5px;
}
main {
  min-width: 0;
}
.hero {
  position: relative;
  padding: 26px 5px 33px;
  overflow: hidden;
}
.hero:after {
  content: "";
  position: absolute;
  right: 4%;
  top: 8px;
  width: 180px;
  height: 80px;
  background: linear-gradient(90deg, #8b5cf620, #22d3ee20);
  filter: blur(38px);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b9a7fb;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-weight: 850;
}
.eyebrow:before {
  content: "";
  width: 22px;
  height: 1px;
  background: #8b5cf6;
  box-shadow: 0 0 9px #8b5cf6;
}
.hero h1 {
  font-size: clamp(30px, 3.6vw, 50px);
  line-height: 1.06;
  margin: 10px 0 13px;
  letter-spacing: -0.048em;
  max-width: 920px;
}
.hero h1 span {
  background: linear-gradient(90deg, #c4b5fd, #8b9cf9 48%, #67e8f9);
  -webkit-background-clip: text;
  color: transparent;
}
.hero p {
  color: #949caf;
  max-width: 720px;
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
}
.hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #293043;
  border-radius: 999px;
  background: #11151dc9;
  color: #969fb1;
  font-size: 10px;
  font-weight: 700;
}
.hero-chip:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b5cf6;
}
.hero-chip:nth-child(2):before {
  background: #22d3ee;
}
.hero-chip:nth-child(3):before {
  background: #34d399;
}
.card {
  position: relative;
  background: linear-gradient(155deg, #131722f2, #0d1017f5);
  border: 1px solid #242a38;
  border-radius: 18px;
  box-shadow:
    0 18px 55px #0000002b,
    inset 0 1px #ffffff08;
  margin-bottom: 20px;
  overflow: hidden;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}
.card:hover {
  border-color: #30384a;
  box-shadow:
    0 22px 65px #00000038,
    inset 0 1px #ffffff0a;
}
.card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #8b5cf6, transparent 55%);
  opacity: 0.45;
}
.card-head {
  padding: 17px 21px;
  border-bottom: 1px solid #242a38;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #171b26aa, transparent);
}
.card-title {
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.01em;
}
.card-sub {
  color: #687186;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: auto;
}
.card-body {
  padding: 22px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b3bac9;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.025em;
  margin: 0 0 8px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #2b3243;
  background: linear-gradient(180deg, #0b0e14, #0d1017);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 13px;
  outline: none;
  box-shadow: inset 0 2px 8px #00000028;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}
.field textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.7;
}
.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: #3c455b;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #8b5cf6;
  background: #0d1018;
  box-shadow:
    0 0 0 3px #8b5cf61c,
    inset 0 2px 8px #00000020;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #50586c;
}
.field .hint {
  color: #687084;
  font-size: 10px;
  margin-top: 6px;
}
.lyrics-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}
.field .lyrics-title {
  margin: 0;
  flex: 0 0 auto;
}
.lyrics-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: #8f98aa;
  font-size: 10px;
}
.field .meta-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
  color: #aeb6c6;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.field .meta-check input {
  appearance: auto;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  box-shadow: none;
  accent-color: #8b5cf6;
}
.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 17px;
}
.actions .push {
  margin-left: auto;
}
.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    #2a3040 8%,
    #2a3040 92%,
    transparent
  );
  margin: 22px 0;
}
.output {
  background: #0b0e14;
  border: 1px solid #292f40;
  border-radius: 13px;
  padding: 16px;
  min-height: 110px;
  white-space: pre-wrap;
  color: #d8dceb;
}
.empty {
  border: 1px dashed #303748;
  border-radius: 14px;
  padding: 38px;
  text-align: center;
  color: #687084;
  background: linear-gradient(135deg, #10141c88, #0a0d1288);
}
.empty strong {
  display: block;
  color: #aab1c1;
  margin-bottom: 4px;
}
.badge {
  font-size: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #8b5cf61c;
  color: #c4b5fd;
  border: 1px solid #8b5cf63a;
}
.character-grid,
.environment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 600px));
  justify-content: start;
  gap: 14px;
}
.character,
.environment {
  border: 1px solid var(--line);
  background: #0d1017;
  border-radius: 15px;
  overflow: hidden;
}
.character-visual,
.environment-visual {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #171b26, #0b0d13);
  display: grid;
  place-items: center;
  color: #555e73;
  overflow: hidden;
}
.character-visual img,
.environment-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.character-body,
.environment-body {
  padding: 14px;
}
.character input,
.character textarea,
.environment input,
.environment textarea {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 0;
  outline: 0;
}
.character input,
.environment input {
  font-weight: 850;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  padding: 5px 1px 9px;
}
.character textarea,
.environment textarea {
  min-height: 100px;
  margin-top: 10px;
  color: #adb4c4;
  resize: vertical;
  font-size: 12px;
}
.character-role {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #343d52;
  border-radius: 8px;
  background: #111827;
  color: #dce2ee;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 750;
}
.mini-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.scene-list {
  display: grid;
  gap: 14px;
}
.scene {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #0c0f15;
}
.scene-image {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #171b27, #090b10);
  display: grid;
  place-items: center;
  position: relative;
  color: #566075;
  overflow: hidden;
}
.scene-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-no {
  position: absolute;
  left: 10px;
  top: 10px;
  background: #07090dcc;
  border: 1px solid #ffffff1f;
  border-radius: 7px;
  padding: 4px 8px;
  color: #d8dce8;
  font-size: 10px;
  font-weight: 800;
}
.scene-content {
  padding: 16px;
  display: grid;
  gap: 10px;
}
.scene-content textarea {
  width: 100%;
  border: 1px solid #293042;
  background: #11151e;
  color: #cbd1df;
  border-radius: 9px;
  padding: 10px;
  resize: vertical;
  outline: 0;
}
.scene-content textarea:focus {
  border-color: #8b5cf6;
}
.scene-content label {
  display: flex;
  color: #788196;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  justify-content: space-between;
}
.scene-toolbar {
  display: flex;
  gap: 7px;
  align-items: center;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #020308d9;
  backdrop-filter: blur(14px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  position: relative;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #121620;
  border: 1px solid #32394b;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.modal-head {
  padding: 19px 70px 19px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.modal-head h2 {
  font-size: 17px;
  margin: 0;
}
.modal-head > .icon-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.modal-body {
  padding: 22px;
  overflow: auto;
  min-height: 0;
}
.modal-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.notice {
  padding: 12px 14px;
  background: #f59e0b12;
  border: 1px solid #f59e0b38;
  color: #fcd58b;
  border-radius: 11px;
  font-size: 11px;
  margin-bottom: 18px;
}
.tabs {
  display: flex;
  background: #0b0e14;
  padding: 4px;
  border-radius: 11px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: #7e879a;
  padding: 9px;
  border-radius: 8px;
  font-weight: 800;
}
.tab.active {
  background: #23293a;
  color: white;
}
.settings-pane {
  display: grid;
  gap: 13px;
}
.settings-pane > .hint {
  color: #768196;
  font-size: 10px;
  margin-top: -7px;
}
.key-row {
  display: flex;
  gap: 8px;
}
.key-row input {
  flex: 1;
}
.snapshot-create {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.snapshot-create input {
  flex: 1;
  min-width: 0;
  border: 1px solid #30384b;
  background: #0b0e14;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
}
.snapshot-status {
  min-height: 22px;
  margin: 0 2px 10px;
  color: #8d96a8;
  font-size: 11px;
}
.snapshot-status.success {
  color: #6ee7b7;
}
.snapshot-status.error {
  color: #fda4af;
}
.snapshot-list {
  display: grid;
  gap: 9px;
}
.snapshot-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #2b3345;
  border-radius: 12px;
  background: #0c1017;
}
.snapshot-item strong {
  display: block;
  font-size: 13px;
}
.snapshot-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.snapshot-actions {
  display: flex;
  gap: 7px;
}
.snapshot-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #30384b;
  border-radius: 12px;
}
.login-modal {
  z-index: 140;
}
.login-modal .modal {
  width: min(460px, 100%);
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-error {
  min-height: 20px;
  color: #fda4af;
  font-size: 12px;
}
.project-list {
  display: grid;
  gap: 9px;
}
.project-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #2b3345;
  border-radius: 12px;
  background: #0c1017;
  color: var(--text);
  text-align: left;
}
.project-item:hover,
.project-item.active {
  border-color: #7567d8;
  background: #17172b;
}
.project-item strong,
.project-item small {
  display: block;
}
.project-item small {
  margin-top: 4px;
  color: var(--muted);
}
.account-name {
  color: var(--muted);
  font-size: 11px;
  margin-right: auto;
}
body.save-locked
  :is(
    #add-character,
    #add-environment,
    #extract-characters,
    #extract-environments,
    #generate-scenes,
    #reset-timing,
    #remove-audio,
    #new-mv-create,
    [data-char-delete],
    [data-env-delete],
    [data-scene-delete],
    [data-shot-delete],
    [data-library-apply],
    [data-project-id],
    [data-snapshot-restore],
    label[for="audio-file"]
  ) {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
}
body.save-locked .shot-card {
  cursor: not-allowed;
}
.overlay {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  pointer-events: none;
}
.loader {
  width: min(360px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  background: #121722f2;
  border: 1px solid #3b4358;
  border-radius: 14px;
  box-shadow:
    0 20px 55px #0009,
    inset 0 1px #ffffff0d;
  backdrop-filter: blur(18px);
}
.spinner {
  grid-row: 1/3;
  width: 30px;
  height: 30px;
  border: 3px solid #ffffff18;
  border-top-color: #a78bfa;
  border-right-color: #67e8f9;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loader p {
  color: #e1e5ef;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}
.loader small {
  color: #737d91;
  font-size: 10px;
  margin-top: 2px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 102px;
  z-index: 80;
  background: #171c27;
  border: 1px solid #343c50;
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 12px 16px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.22s;
}
.toast.show {
  transform: none;
  opacity: 1;
}
.toast.error {
  border-color: #fb718566;
  color: #fecdd3;
}
/* Typography scale */
.step-link {
  font-size: 13px;
}
.progress-label {
  font-size: 10px;
}
.side-note {
  font-size: 12px;
}
.side-note b {
  font-size: 12px;
}
.card-title {
  font-size: 15px;
}
.card-sub {
  font-size: 10px;
}
.field label {
  font-size: 12px;
}
.field input,
.field textarea,
.field select {
  font-size: 13px;
}
.field .hint {
  font-size: 11px;
}
.btn {
  font-size: 13px;
}
.btn.small {
  font-size: 12px;
}
.hero-chip {
  font-size: 11px;
}
.empty {
  font-size: 13px;
}
.badge {
  font-size: 11px;
}
.character input {
  font-size: 15px;
}
.character textarea,
.scene-content textarea {
  font-size: 13px;
}
.scene-content label,
.scene-no {
  font-size: 11px;
}
.notice {
  font-size: 12px;
}
.provider-pill {
  font-size: 12px;
}
.audio-panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #30384b;
  border-radius: 14px;
  background: linear-gradient(135deg, #121824, #0b1018);
}
.audio-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.audio-upload input {
  display: none;
}
.audio-copy {
  flex: 1;
  min-width: 220px;
}
.audio-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.audio-copy strong {
  display: block;
  font-size: 13px;
}
.audio-title-row .btn {
  padding: 7px 11px;
  font-size: 11px;
}
.audio-copy > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.audio-file {
  color: #c4b5fd !important;
}
.audio-player {
  width: 100%;
  height: 36px;
  margin-top: 12px;
}
.audio-timeline {
  margin-top: 12px;
  padding: 12px 12px 9px;
  border: 1px solid #293143;
  border-radius: 11px;
  background: #080c13;
}
.audio-timeline-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
}
.audio-timeline-head strong {
  font-size: 11px;
  color: #dbe3f0;
}
.audio-timeline-legend {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-left: auto;
  flex-wrap: wrap;
  color: #8490a5;
  font-size: 9px;
}
.audio-timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.timeline-swatch {
  width: 13px;
  height: 5px;
  border-radius: 2px;
  background: #22d3ee;
}
.timeline-swatch.change {
  width: 2px;
  height: 10px;
  background: #f59e0b;
}
.timeline-swatch.scene {
  background: #8b5cf6;
}
.timeline-swatch.shot {
  background: #34d399;
}
.audio-timeline-stage {
  position: relative;
}
.audio-timeline svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 150px;
  overflow: visible;
  cursor: crosshair;
  touch-action: manipulation;
}
.audio-timeline .timeline-grid {
  stroke: #76819724;
  stroke-width: 1;
}
.audio-timeline .timeline-axis-label {
  fill: #7f8a9e;
  font-size: 10px;
}
.audio-timeline .timeline-area {
  fill: #22d3ee25;
}
.audio-timeline .timeline-line {
  fill: none;
  stroke: #22d3ee;
  stroke-width: 2;
}
.audio-timeline .timeline-change {
  stroke: #f59e0b;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.audio-timeline .timeline-change-dot {
  fill: #f59e0b;
}
.audio-timeline .timeline-scene {
  fill: #8b5cf628;
  stroke: #a78bfa66;
  stroke-width: 1;
}
.audio-timeline .timeline-scene.alt {
  fill: #6366f126;
}
.audio-timeline .timeline-scene-label {
  fill: #ddd6fe;
  font-size: 9px;
  font-weight: 700;
}
.audio-timeline .timeline-shot {
  fill: #34d399;
}
.audio-timeline .timeline-shot.story {
  fill: #60a5fa;
}
.audio-timeline .timeline-shot.insert {
  fill: #f59e0b;
}
.audio-timeline .timeline-playhead {
  stroke: #f8fafc;
  stroke-width: 2;
  pointer-events: none;
  filter: drop-shadow(0 0 3px #000);
}
.audio-timeline .timeline-hit {
  fill: transparent;
}
.audio-timeline-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  margin-top: 4px;
  color: #8390a4;
  font-size: 10px;
}
.audio-timeline-readout b {
  color: #dbe5f3;
  font-variant-numeric: tabular-nums;
}
.audio-timeline-readout span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.concept-settings {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(180px, 1fr) minmax(
      180px,
      1fr
    );
  gap: 14px;
  align-items: end;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #293246;
  border-radius: 13px;
  background: linear-gradient(100deg, #151a25, #0c1119);
}
.concept-settings-title {
  align-self: center;
}
.concept-settings-title strong {
  display: block;
  color: #dbe0ea;
  font-size: 11px;
}
.concept-settings-title small {
  display: block;
  margin-top: 3px;
  color: #707b90;
  font-size: 9px;
  line-height: 1.4;
}
.concept-settings .field label {
  margin-bottom: 6px;
}
.concept-settings .field select {
  padding: 10px 12px;
}
.recommendation {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #8b5cf612;
  border: 1px solid #8b5cf638;
}
.recommendation b {
  color: #c4b5fd;
}
.scene-group {
  border: 1px solid #30384a;
  border-radius: 16px;
  background: #0b0f16;
  overflow: hidden;
}
.scene-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(90deg, #1a2030, #111722);
  border-bottom: 1px solid #2a3243;
}
.scene-group-head input {
  min-width: 0;
  flex: 1;
  background: transparent;
  border: 0;
  color: #f0f2f7;
  font-weight: 800;
  outline: 0;
}
.scene-meta {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #252c3b;
}
.scene-meta input,
.scene-meta select {
  width: 100%;
  background: #10151e;
  border: 1px solid #2c3446;
  color: #d8dce7;
  border-radius: 8px;
  padding: 8px;
}
.scene-meta select {
  border-color: #4c4a72;
  color: #ddd6fe;
}
.shot-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}
.shot-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  border: 1px solid #293143;
  border-radius: 12px;
  overflow: hidden;
  background: #10141c;
}
.shot-card .scene-image {
  aspect-ratio: 16/9;
}
.shot-card .scene-content {
  padding: 12px;
}
.shot-badge {
  font-size: 10px;
  color: #67e8f9;
  font-weight: 800;
}
.shot-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.shot-fields input {
  width: 100%;
  background: #0c1017;
  border: 1px solid #293143;
  color: #cbd1dd;
  border-radius: 7px;
  padding: 7px;
  font-size: 11px;
}
.video-prompt {
  border-color: #0891b266 !important;
  background: linear-gradient(180deg, #07141a, #0a1118) !important;
  color: #d5f7fb !important;
}
.video-prompt-note {
  color: #67e8f9;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.timeline-swatch.shot-candidate {
  background: #f472b6;
}
.audio-timeline .timeline-change.medium {
  opacity: 0.72;
}
.audio-timeline .timeline-change.weak {
  opacity: 0.42;
}
.audio-timeline .timeline-shot-candidate {
  fill: #f472b6;
  stroke: #fbcfe8;
  stroke-width: 0.5;
}
.audio-player {
  display: none !important;
}
.audio-transport {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.audio-play-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #46516a;
  border-radius: 50%;
  background: #172033;
  color: #f8fafc;
  font-size: 12px;
  cursor: pointer;
}
.audio-play-toggle:hover:not(:disabled) {
  border-color: #8b5cf6;
  background: #27214a;
}
.audio-play-toggle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.audio-transport-time {
  min-width: 86px;
  color: #cbd5e1;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.audio-timeline-head {
  flex-wrap: wrap;
}
.audio-timeline-legend {
  min-width: min-content;
}
html[data-theme="light"] .audio-play-toggle {
  background: #eef2ff;
  border-color: #c4b5fd;
  color: #4c1d95;
}
html[data-theme="light"] .audio-play-toggle:hover:not(:disabled) {
  background: #ddd6fe;
  border-color: #8b5cf6;
}
html[data-theme="light"] .audio-transport-time {
  color: #334155;
}
.lrc-editor {
  margin: 12px 0;
  padding: 13px;
  border: 1px solid #32405a;
  border-radius: 11px;
  background: #0a1019;
}
.lrc-editor.hidden {
  display: none;
}
.lrc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lrc-head strong {
  color: #e2e8f0;
  font-size: 11px;
}
.lrc-head .lrc-progress {
  color: #94a3b8;
  font-size: 10px;
}
.lrc-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.lrc-controls label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 9px;
}
.lrc-controls select,
.lrc-controls input {
  min-height: 31px;
  border: 1px solid #344159;
  border-radius: 7px;
  background: #101722;
  color: #dbe5f3;
  padding: 0 7px;
  font-size: 10px;
}
.lrc-lines {
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
  margin-top: 10px;
  padding-right: 3px;
}
.lrc-line {
  display: grid;
  grid-template-columns: 34px 100px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #273247;
  border-radius: 7px;
  background: #0d141f;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
}
.lrc-line:hover {
  border-color: #475569;
  background: #121b29;
}
.lrc-line.active {
  border-color: #22d3ee;
  background: #0c2630;
  box-shadow: 0 0 0 2px #22d3ee18;
}
.lrc-line.done {
  border-left: 3px solid #34d399;
}
.lrc-line .lrc-no {
  color: #64748b;
  font-size: 9px;
}
.lrc-line input {
  width: 100%;
  border: 1px solid #31415a;
  border-radius: 5px;
  background: #080d15;
  color: #a5f3fc;
  padding: 5px 6px;
  font:
    10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.lrc-line .lrc-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.lrc-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.lrc-editor.complete {
  border-color: #34d39966;
}
html[data-theme="light"] .lrc-editor {
  border-color: #cbd5e1;
  background: #f8fafc;
}
html[data-theme="light"] .lrc-head strong {
  color: #1e293b;
}
html[data-theme="light"] .lrc-controls select,
html[data-theme="light"] .lrc-controls input {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}
html[data-theme="light"] .lrc-line {
  border-color: #dbe2ec;
  background: #fff;
  color: #334155;
}
html[data-theme="light"] .lrc-line:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}
html[data-theme="light"] .lrc-line.active {
  border-color: #0891b2;
  background: #ecfeff;
}
html[data-theme="light"] .lrc-line input {
  border-color: #cbd5e1;
  background: #fff;
  color: #0e7490;
}
.audio-timeline .timeline-lyric-marker {
  stroke: #34d399;
  stroke-width: 1.25;
  stroke-opacity: 0.7;
  pointer-events: none;
}
.audio-timeline .timeline-lyric-marker-label {
  fill: #6ee7b7;
  font-size: 7px;
  font-weight: 800;
  pointer-events: none;
}
html[data-theme="light"] .audio-timeline .timeline-lyric-marker {
  stroke: #059669;
}
html[data-theme="light"] .audio-timeline .timeline-lyric-marker-label {
  fill: #047857;
}
.audio-timeline .timeline-section {
  stroke: none;
  opacity: 0.78;
  pointer-events: none;
}
.audio-timeline .timeline-section.intro,
.audio-timeline .timeline-section.outro {
  fill: #64748b;
}
.audio-timeline .timeline-section.verse {
  fill: #3b82f6;
}
.audio-timeline .timeline-section.prechorus {
  fill: #8b5cf6;
}
.audio-timeline .timeline-section.chorus {
  fill: #ec4899;
}
.audio-timeline .timeline-section.postchorus {
  fill: #d946ef;
}
.audio-timeline .timeline-section.bridge {
  fill: #f59e0b;
}
.audio-timeline .timeline-section.instrumental,
.audio-timeline .timeline-section.solo {
  fill: #14b8a6;
}
.audio-timeline .timeline-section.breakdown {
  fill: #ef4444;
}
.audio-timeline .timeline-section.unknown {
  fill: #475569;
}
.audio-timeline .timeline-section-label {
  fill: #f8fafc;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}
html[data-theme="light"] .audio-timeline .timeline-section {
  opacity: 0.68;
}
html[data-theme="light"] .audio-timeline .timeline-section-label {
  fill: #fff;
}
:root {
  --section-intro: #f59e0b;
  --section-verse: #3b82f6;
  --section-prechorus: #8b5cf6;
  --section-chorus: #ec4899;
  --section-postchorus: #d946ef;
  --section-bridge: #14b8a6;
  --section-instrumental: #06b6d4;
  --section-breakdown: #ef4444;
  --section-outro: #64748b;
  --section-unknown: #64748b;
}
.audio-timeline .timeline-section.intro {
  fill: var(--section-intro);
}
.audio-timeline .timeline-section.verse {
  fill: var(--section-verse);
}
.audio-timeline .timeline-section.prechorus {
  fill: var(--section-prechorus);
}
.audio-timeline .timeline-section.chorus {
  fill: var(--section-chorus);
}
.audio-timeline .timeline-section.postchorus {
  fill: var(--section-postchorus);
}
.audio-timeline .timeline-section.bridge {
  fill: var(--section-bridge);
}
.audio-timeline .timeline-section.instrumental,
.audio-timeline .timeline-section.solo {
  fill: var(--section-instrumental);
}
.audio-timeline .timeline-section.breakdown {
  fill: var(--section-breakdown);
}
.audio-timeline .timeline-section.outro {
  fill: var(--section-outro);
}
.audio-timeline .timeline-section.unknown {
  fill: var(--section-unknown);
}
.lrc-line {
  --section-color: var(--section-unknown);
  border-left: 3px solid
    color-mix(in srgb, var(--section-color) 72%, transparent);
}
.lrc-line.section-intro {
  --section-color: var(--section-intro);
}
.lrc-line.section-verse {
  --section-color: var(--section-verse);
}
.lrc-line.section-prechorus {
  --section-color: var(--section-prechorus);
}
.lrc-line.section-chorus {
  --section-color: var(--section-chorus);
}
.lrc-line.section-postchorus {
  --section-color: var(--section-postchorus);
}
.lrc-line.section-bridge {
  --section-color: var(--section-bridge);
}
.lrc-line.section-instrumental,
.lrc-line.section-solo {
  --section-color: var(--section-instrumental);
}
.lrc-line.section-breakdown {
  --section-color: var(--section-breakdown);
}
.lrc-line.section-outro {
  --section-color: var(--section-outro);
}
.lrc-line.playing {
  border-color: var(--section-color);
  background: color-mix(in srgb, var(--section-color) 16%, #0d141f);
  box-shadow: 0 0 0 2px
    color-mix(in srgb, var(--section-color) 25%, transparent);
}
.lrc-line.playing .lrc-no::before {
  content: "▶";
  margin-right: 4px;
  color: var(--section-color);
  font-size: 7px;
}
.lrc-line.playing input {
  border-color: color-mix(in srgb, var(--section-color) 60%, #31415a);
  color: color-mix(in srgb, var(--section-color) 70%, white);
}
.lrc-line.active {
  outline: 1px solid #f8fafc80;
  outline-offset: -2px;
}
.audio-timeline .timeline-waveform-display {
  fill: #22d3ee24;
  stroke: #22d3eea8;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
html[data-theme="light"] .lrc-line.playing {
  background: color-mix(in srgb, var(--section-color) 10%, white);
}
html[data-theme="light"] .lrc-line.active {
  outline-color: #0f172a66;
}
html[data-theme="light"] .audio-timeline .timeline-waveform-display {
  fill: #0891b21c;
  stroke: #0891b299;
}
.audio-timeline .timeline-hoverhead {
  stroke: #38bdf8;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  pointer-events: none;
  filter: drop-shadow(0 0 2px #0284c7);
  visibility: hidden;
}
.timeline-swatch.playhead {
  width: 2px;
  height: 10px;
  background: #f8fafc;
}
.timeline-swatch.hoverhead {
  width: 2px;
  height: 10px;
  background: #38bdf8;
}
.audio-storyboard-live {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 10px;
  padding: 12px;
  border-top: 1px solid #253047;
}
.audio-storyboard-frame {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #2b3548;
  border-radius: 9px;
  background: linear-gradient(135deg, #171b27, #090b10);
  color: #6b758a;
  font-size: 11px;
}
.audio-storyboard-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.audio-storyboard-info {
  align-self: center;
  min-width: 0;
}
.audio-storyboard-info strong {
  display: block;
  color: #e2e8f0;
  font-size: 13px;
}
.audio-storyboard-info small {
  display: block;
  margin-top: 5px;
  color: #8b98ad;
  font-size: 10px;
}
.audio-storyboard-info p {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 0;
  color: #b8c1d0;
  font-size: 11px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
html[data-theme="light"] .audio-timeline .timeline-playhead {
  stroke: #7c3aed;
}
html[data-theme="light"] .timeline-swatch.playhead {
  background: #7c3aed;
}
html[data-theme="light"] .audio-storyboard-live {
  border-color: #dbe2ec;
}
html[data-theme="light"] .audio-storyboard-frame {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #64748b;
}
html[data-theme="light"] .audio-storyboard-info strong {
  color: #1e293b;
}
html[data-theme="light"] .audio-storyboard-info small {
  color: #64748b;
}
html[data-theme="light"] .audio-storyboard-info p {
  color: #475569;
}
.audio-timeline .timeline-change {
  stroke: #fb923c8f;
  stroke-width: 1.25;
  stroke-dasharray: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px #f9731638);
}
.audio-timeline .timeline-change.medium {
  opacity: 0.68;
}
.audio-timeline .timeline-change.weak {
  opacity: 0.38;
}
.audio-timeline .timeline-change-dot {
  display: none;
}
.audio-timeline .timeline-hoverhead {
  stroke: #67e8f9a6;
  stroke-width: 1.25;
  stroke-dasharray: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px #22d3ee52);
}
.audio-timeline .timeline-playhead {
  stroke: #ffffffc7;
  stroke-width: 1.6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px #020617cc);
}
.audio-timeline .timeline-shot-candidate {
  fill: url(#shot-candidate-gradient);
  stroke: #f5d0fead;
  stroke-width: 0.7;
  filter: drop-shadow(0 0 2px #c026d34f);
}
.timeline-swatch.change {
  background: #fb923c8f;
}
.timeline-swatch.playhead {
  background: #ffffffc7;
  box-shadow: 0 0 2px #020617;
}
.timeline-swatch.hoverhead {
  background: #67e8f9a6;
}
.timeline-swatch.shot-candidate {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(135deg, #c084fc, #f472b6 55%, #fb7185);
  transform: rotate(45deg);
}
html[data-theme="light"] .audio-timeline .timeline-playhead {
  stroke: #ffffffde;
  filter: drop-shadow(0 0 2px #334155);
}
html[data-theme="light"] .timeline-swatch.playhead {
  background: #fff;
  box-shadow: 0 0 2px #334155;
}
