: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;
}
/* Professional editing timeline */
.audio-timeline {
  padding: 12px 14px 10px;
  background: #080b11;
  border-color: #232a37;
}
.audio-timeline-head {
  min-height: 32px;
  margin-bottom: 4px;
}
.audio-timeline-head strong {
  color: #b8c0cf;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.audio-timeline-legend {
  display: none;
}
.audio-timeline svg {
  min-height: 0;
  aspect-ratio: 1200/188;
}
.audio-timeline .timeline-grid {
  stroke: #7b849314;
  stroke-width: 1;
}
.audio-timeline .timeline-ruler-tick {
  stroke: #8b95a52c;
  stroke-width: 1;
}
.audio-timeline .timeline-axis-label {
  fill: #758094;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.audio-timeline .timeline-lane-label {
  fill: #657084;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.audio-timeline .timeline-lane-rule {
  stroke: #80899a18;
  stroke-width: 1;
}
.audio-timeline .timeline-area {
  fill: #71809612;
}
.audio-timeline .timeline-line {
  stroke: #8b99ad;
  stroke-width: 1.35;
  opacity: 0.78;
}
.audio-timeline .timeline-change {
  stroke: #d6a15c;
  stroke-width: 1;
  stroke-dasharray: none;
  stroke-linecap: butt;
  filter: none;
}
.audio-timeline .timeline-change.medium {
  opacity: 0.46;
}
.audio-timeline .timeline-change.weak {
  opacity: 0.25;
}
.audio-timeline .timeline-shot-candidate {
  stroke: #9b8ec4;
  stroke-width: 1;
  stroke-linecap: butt;
  filter: none;
}
.audio-timeline .timeline-scene {
  fill: #7871a926;
  stroke: none;
}
.audio-timeline .timeline-scene.alt {
  fill: #68729b20;
}
.audio-timeline .timeline-scene-label {
  fill: #c7c5dd;
  font-size: 8px;
  font-weight: 600;
}
.audio-timeline .timeline-shot {
  fill: #77859b;
  opacity: 0.64;
  transition:
    opacity 0.1s,
    fill 0.1s;
}
.audio-timeline .timeline-shot.performance {
  fill: #7d83b5;
}
.audio-timeline .timeline-shot.story {
  fill: #688ca9;
}
.audio-timeline .timeline-shot.insert {
  fill: #8e887d;
}
.audio-timeline .timeline-shot.is-current {
  fill: #a9a1ff;
  opacity: 1;
}
.audio-timeline .timeline-playhead {
  stroke: #d9d5ff;
  stroke-width: 1.2;
  stroke-linecap: butt;
  filter: none;
}
.audio-timeline .timeline-playhead-handle {
  fill: #d9d5ff;
}
.audio-timeline .timeline-hoverhead {
  stroke: #a8b0bf66;
  stroke-width: 1;
  stroke-dasharray: none;
  stroke-linecap: butt;
  filter: none;
}
.audio-timeline .timeline-hover-chip {
  fill: #151a24;
  stroke: #31394a;
  stroke-width: 1;
}
.audio-timeline .timeline-hover-time {
  fill: #d1d7e2;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}
.audio-timeline .timeline-hit {
  fill: transparent;
}
.audio-timeline-readout {
  border-top: 1px solid #222936;
  padding-top: 6px;
}
.timeline-swatch {
  box-shadow: none !important;
  filter: none !important;
}
html[data-theme="light"] .audio-timeline {
  background: #f8fafc;
  border-color: #d5dce7;
}
html[data-theme="light"] .audio-timeline .timeline-grid {
  stroke: #64748b18;
}
html[data-theme="light"] .audio-timeline .timeline-ruler-tick {
  stroke: #64748b30;
}
html[data-theme="light"] .audio-timeline .timeline-axis-label,
html[data-theme="light"] .audio-timeline .timeline-lane-label {
  fill: #64748b;
}
html[data-theme="light"] .audio-timeline .timeline-lane-rule {
  stroke: #64748b22;
}
html[data-theme="light"] .audio-timeline .timeline-area {
  fill: #64748b10;
}
html[data-theme="light"] .audio-timeline .timeline-line {
  stroke: #64748b;
}
html[data-theme="light"] .audio-timeline .timeline-change {
  stroke: #b7792f;
}
html[data-theme="light"] .audio-timeline .timeline-shot-candidate {
  stroke: #7567a4;
}
html[data-theme="light"] .audio-timeline .timeline-scene {
  fill: #6d63a71d;
}
html[data-theme="light"] .audio-timeline .timeline-scene.alt {
  fill: #64748b14;
}
html[data-theme="light"] .audio-timeline .timeline-scene-label {
  fill: #4c466f;
}
html[data-theme="light"] .audio-timeline .timeline-shot {
  fill: #64748b;
}
html[data-theme="light"] .audio-timeline .timeline-shot.performance {
  fill: #6366a3;
}
html[data-theme="light"] .audio-timeline .timeline-shot.story {
  fill: #477899;
}
html[data-theme="light"] .audio-timeline .timeline-shot.insert {
  fill: #746e65;
}
html[data-theme="light"] .audio-timeline .timeline-shot.is-current {
  fill: #5b55c9;
}
html[data-theme="light"] .audio-timeline .timeline-playhead {
  stroke: #514bc2;
}
html[data-theme="light"] .audio-timeline .timeline-playhead-handle {
  fill: #514bc2;
}
html[data-theme="light"] .audio-timeline .timeline-hoverhead {
  stroke: #47556966;
}
html[data-theme="light"] .audio-timeline .timeline-hover-chip {
  fill: #fff;
  stroke: #cbd5e1;
}
html[data-theme="light"] .audio-timeline .timeline-hover-time {
  fill: #334155;
}
html[data-theme="light"] .audio-timeline-readout {
  border-color: #dbe2ec;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .step-nav {
    display: flex;
    overflow: auto;
  }
  .step-link {
    white-space: nowrap;
  }
  .side-note,
  .progress-label {
    display: none;
  }
  .scene {
    grid-template-columns: 1fr;
  }
  .scene-image {
    max-height: 340px;
  }
  .grid3 {
    grid-template-columns: 1fr 1fr;
  }
  .shot-card {
    grid-template-columns: 1fr;
  }
  .concept-settings {
    grid-template-columns: 1fr 1fr;
  }
  .concept-settings-title {
    grid-column: 1/-1;
  }
  .audio-storyboard-live {
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  }
}
.timeline-trim-handle {
  cursor: ew-resize;
  outline: none;
}
.timeline-trim-handle .timeline-trim-hit {
  stroke: transparent;
  stroke-width: 14;
  pointer-events: stroke;
}
.timeline-trim-handle .timeline-trim-line {
  stroke: #f8fafc99;
  stroke-width: 1;
  pointer-events: none;
}
.timeline-trim-handle .timeline-trim-grip {
  fill: #111827;
  stroke: #f8fafccc;
  stroke-width: 1;
  pointer-events: none;
}
.timeline-trim-handle:hover .timeline-trim-line,
.timeline-trim-handle:focus .timeline-trim-line,
.timeline-trim-handle.dragging .timeline-trim-line {
  stroke: #f8fafc;
  stroke-width: 1.5;
}
.timeline-trim-handle:hover .timeline-trim-grip,
.timeline-trim-handle:focus .timeline-trim-grip,
.timeline-trim-handle.dragging .timeline-trim-grip {
  fill: #8b5cf6;
  stroke: #fff;
}
html[data-theme="light"] .timeline-trim-handle .timeline-trim-line {
  stroke: #33415599;
}
html[data-theme="light"] .timeline-trim-handle .timeline-trim-grip {
  fill: #fff;
  stroke: #334155;
}
html[data-theme="light"] .timeline-trim-handle:hover .timeline-trim-line,
html[data-theme="light"] .timeline-trim-handle:focus .timeline-trim-line,
html[data-theme="light"] .timeline-trim-handle.dragging .timeline-trim-line {
  stroke: #4338ca;
}
html[data-theme="light"] .timeline-trim-handle:hover .timeline-trim-grip,
html[data-theme="light"] .timeline-trim-handle:focus .timeline-trim-grip,
html[data-theme="light"] .timeline-trim-handle.dragging .timeline-trim-grip {
  fill: #6366f1;
  stroke: #312e81;
}
@media (max-width: 620px) {
  .audio-timeline-stage {
    overflow-x: auto;
  }
  .audio-timeline svg {
    min-width: 720px;
    aspect-ratio: 1200/188;
  }
}
@media (max-width: 620px) {
  .shell {
    padding: 0 15px;
  }
  .brand small,
  .provider-pill {
    display: none;
  }
  .topbar-inner {
    height: 64px;
  }
  .layout {
    padding-top: 15px;
  }
  .hero {
    padding-top: 12px;
  }
  .card-body,
  .card-head {
    padding: 16px;
  }
  .grid2,
  .grid3,
  .concept-settings {
    grid-template-columns: 1fr;
  }
  .scene-toolbar {
    flex-wrap: wrap;
  }
  .actions .push {
    margin-left: 0;
  }
  .character-grid,
  .environment-grid {
    grid-template-columns: 1fr;
  }
  .overlay {
    right: 16px;
    bottom: 16px;
  }
  .loader {
    width: calc(100vw - 32px);
  }
  .toast {
    right: 16px;
    bottom: 92px;
    max-width: calc(100vw - 32px);
  }
  .scene-meta,
  .shot-fields {
    grid-template-columns: 1fr;
  }
  .top-actions > .btn:not(.icon-btn) {
    padding: 8px;
    font-size: 11px;
  }
  .snapshot-create {
    flex-direction: column;
  }
  .snapshot-item {
    grid-template-columns: 1fr;
  }
  .snapshot-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 620px) {
  .audio-storyboard-live {
    grid-template-columns: 1fr;
  }
  .audio-storyboard-frame {
    max-width: none;
  }
  .audio-timeline-legend {
    margin-left: 0;
  }
}
/* VizIQa workspace */
body {
  background:
    radial-gradient(80% 65% at 72% -10%, #213c6b3a, transparent 62%),
    radial-gradient(55% 45% at 0 20%, #642ca72d, transparent 70%), #07090e;
  font-size: 14px;
  padding-bottom: 0;
}
.shell {
  padding: 0 18px;
}
.topbar {
  height: 66px;
  border-bottom-color: #ffffff10;
}
.topbar-inner {
  height: 66px;
  padding: 0 4px;
}
.brand {
  min-width: var(--rail);
}
.logo {
  border-radius: 15px;
}
.project-title {
  width: min(28vw, 320px);
  border: 0;
  border-left: 1px solid #ffffff14;
  background: transparent;
  color: #f6f7fb;
  padding: 7px 14px;
  font-weight: 750;
  outline: 0;
}
.project-title:focus {
  background: #ffffff07;
  border-radius: 9px;
}
.save-state {
  color: #8e98aa;
  font-size: 11px;
  white-space: nowrap;
}
.save-state:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 7px;
  box-shadow: 0 0 10px #4ade8099;
}
.queue-count {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 99px;
  background: #8b5cf6;
  color: white;
  font-size: 9px;
}
.queue-count.show {
  display: grid;
}
.layout {
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0 42px;
  max-width: none;
}
.sidebar {
  top: 84px;
}
.progress-label,
.side-note {
  display: none;
}
.step-nav {
  gap: 10px;
}
.step-nav:before {
  display: none;
}
.step-link {
  width: 60px;
  height: 60px;
  padding: 7px;
  display: grid;
  place-items: center;
  gap: 2px;
  text-align: center;
  border-radius: 18px;
  font-size: 9px;
  line-height: 1.05;
  color: #788297;
}
.step-link .step-num {
  width: 26px;
  height: 26px;
}
.step-link.active {
  background: linear-gradient(145deg, #8769f529, #37cde914);
  border-color: #987eff55;
  box-shadow:
    inset 0 0 0 1px #ffffff05,
    0 12px 28px #0005;
}
.step-link.active .step-num {
  border-radius: 10px;
}
.hero {
  padding: 18px 8px 25px;
}
.hero h1 {
  font-size: clamp(28px, 3vw, 46px);
}
main > .card {
  display: none;
  margin-bottom: 18px;
  border-radius: var(--radius-xl);
}
main > .card.active-panel {
  display: block;
  animation: panel-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
body:not([data-stage="concept"]) .hero {
  display: none;
}
.card-head {
  padding: 15px 20px;
}
.card-body {
  padding: 20px;
}
.card:before {
  width: 1px;
}
.actions {
  gap: 8px;
}
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.view-toolbar .view-label {
  color: #7d8799;
  font-size: 11px;
  margin-right: auto;
}
.view-toggle {
  display: flex;
  padding: 3px;
  background: #090d14;
  border: 1px solid #252e40;
  border-radius: 10px;
}
.view-toggle button {
  border: 0;
  background: transparent;
  color: #747e92;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 11px;
}
.view-toggle button.active {
  background: #292f42;
  color: #fff;
}
.shot-card {
  position: relative;
  transition:
    border-color 0.2s,
    transform 0.2s,
    background 0.2s;
}
.shot-card:hover {
  border-color: #495675;
  transform: translateY(-1px);
}
.scene-list.view-table .scene-group {
  overflow: visible;
  background: transparent;
  border: 0;
}
.scene-list.view-table .scene-group-head,
.scene-list.view-table .scene-meta {
  position: sticky;
  left: 0;
}
.scene-list.view-table .shot-list {
  padding: 4px 0;
}
.scene-list.view-table .shot-card {
  grid-template-columns: 110px minmax(120px, 0.5fr) minmax(160px, 1fr);
  border-radius: 8px;
  margin-bottom: 4px;
}
.scene-list.view-table .scene-image {
  aspect-ratio: 16/9;
}
.scene-list.view-table .scene-toolbar,
.scene-list.view-table .scene-content label,
.scene-list.view-table .scene-content textarea {
  display: none;
}
.scene-list.view-table .scene-content {
  display: grid;
  grid-template-columns: 80px 1fr;
  padding: 9px;
}
.scene-list.view-table .shot-fields {
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  grid-column: 2;
}
.scene-list.view-table .shot-badge {
  align-self: center;
}
.scene-group.collapsed .scene-meta,
.scene-group.collapsed .shot-list {
  display: none;
}
.scene-collapse {
  width: 31px;
  padding: 6px;
}
.scene-group.collapsed .scene-collapse {
  transform: rotate(-90deg);
}
.shot-part-type {
  width: 100%;
  margin: 8px 0;
  border: 1px solid #4c3f71;
  border-radius: 8px;
  background: #171124;
  color: #ddd6fe;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
  outline: 0;
}
.shot-part-type:focus {
  border-color: #a78bfa;
}
.shot-environment {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #2d374b;
  border-radius: 9px;
  background: #0a1019;
}
.shot-environment label {
  margin: 0;
  color: #a5b4fc !important;
  letter-spacing: 0.06em !important;
}
.shot-environment select {
  width: 100%;
  min-width: 0;
  border: 1px solid #3b4660;
  border-radius: 7px;
  background: #111827;
  color: #e0e7ff;
  padding: 8px 10px;
  font-size: 11px;
  outline: 0;
}
.shot-environment select:focus {
  border-color: #8b5cf6;
}
.shot-environment select.environment-none {
  color: #7f8a9f;
}
.scene-list.view-table .shot-environment {
  grid-column: 2;
  grid-template-columns: 1fr;
  padding: 5px;
}
.scene-list.view-table .shot-environment label {
  display: none;
}
.scene-meta {
  grid-template-columns: 1fr;
}
.shot-timecode {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 7px;
  align-items: end;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #24485a;
  border-radius: 9px;
  background: #07141a;
}
.shot-timecode label {
  margin: 0 !important;
  color: #67e8f9 !important;
  font-size: 9px !important;
}
.shot-timecode input {
  width: 100%;
  margin-top: 4px;
  border: 1px solid #285267;
  border-radius: 7px;
  background: #091b23;
  color: #d5f7fb;
  padding: 7px 8px;
  font:
    11px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.shot-duration {
  align-self: center;
  white-space: nowrap;
  color: #a5f3fc;
  font-size: 11px;
  font-weight: 800;
}
.scene-list.view-table .shot-timecode {
  grid-column: 2;
  grid-template-columns: 1fr 1fr auto;
  padding: 5px;
  margin: 4px 0;
}
.preflight-panel {
  display: none;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #33405a;
  border-radius: 12px;
  background: #0a1019;
}
.preflight-panel.show {
  display: block;
}
.preflight-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.preflight-summary strong {
  margin-right: auto;
}
.preflight-count {
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
}
.preflight-count.error {
  background: #fb71851c;
  color: #fda4af;
}
.preflight-count.warning {
  background: #fbbf2418;
  color: #fcd34d;
}
.preflight-count.ok {
  background: #34d39918;
  color: #6ee7b7;
}
.preflight-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #adb7c8;
  font-size: 11px;
  line-height: 1.7;
}
.preflight-list li.error {
  color: #fda4af;
}
.preflight-list li.warning {
  color: #fcd34d;
}
.bottom-dock {
  position: fixed;
  left: calc(var(--rail) + 30px);
  right: calc(var(--queue-width) + 30px);
  bottom: 14px;
  height: 56px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #ffffff1b;
  border-radius: 18px;
  background: #111722d9;
  backdrop-filter: blur(24px) saturate(1.35);
  box-shadow: 0 20px 60px #0009;
}
.dock-stage {
  margin-right: auto;
  padding-left: 7px;
}
.dock-stage small {
  display: block;
  color: #798397;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.dock-stage strong {
  font-size: 12px;
}
.dock-primary {
  min-width: 180px;
}
.drawer {
  position: fixed;
  right: 16px;
  top: 78px;
  bottom: 16px;
  width: min(390px, calc(100vw - 32px));
  z-index: 60;
  border: 1px solid #ffffff18;
  border-radius: 22px;
  background: #0d121bf5;
  box-shadow: 0 30px 90px #000b;
  backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  transition:
    width 0.25s,
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer-head {
  padding: 17px;
  border-bottom: 1px solid #ffffff10;
  display: flex;
  align-items: center;
  gap: 9px;
}
.drawer-head strong {
  min-width: 0;
}
.drawer-head .queue-toggle {
  margin-left: auto;
  width: 32px;
  padding: 0;
  font-size: 18px;
}
.queue-cancel-pending {
  padding: 5px 8px !important;
  font-size: 9px !important;
  color: #fecdd3 !important;
  border-color: #fb71854a !important;
}
.queue-cancel-pending:disabled {
  display: none;
}
.queue-list {
  padding: 12px;
  display: grid;
  gap: 8px;
  overflow: auto;
}
.queue-job {
  padding: 12px;
  border: 1px solid #293246;
  border-radius: 12px;
  background: #0a0e15;
}
.queue-job-head {
  display: flex;
  gap: 8px;
  align-items: center;
}
.queue-job-head b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.queue-job-state {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 9px;
  padding: 3px 7px;
  border-radius: 99px;
  background: #20283a;
  color: #aeb7c9;
}
.queue-job.queued,
.queue-job.preparing,
.queue-job.retry {
  border-color: #f59e0b55;
}
.queue-job.requesting {
  border-color: #8b5cf680;
  box-shadow: inset 2px 0 #8b5cf6;
}
.queue-job.done {
  opacity: 0.72;
}
.queue-job.error {
  border-color: #fb718580;
}
.queue-job.cancelled {
  opacity: 0.55;
}
.queue-job small {
  color: #8b96aa;
  display: block;
  margin-top: 6px;
}
.queue-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 9px;
}
.queue-progress i {
  height: 3px;
  border-radius: 99px;
  background: #2a3243;
}
.queue-progress i.active {
  background: #a78bfa;
  box-shadow: 0 0 8px #8b5cf666;
}
.queue-progress i.complete {
  background: #34d399;
}
.queue-job.cancelled .queue-progress i {
  background: #64748b;
}
.queue-job-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.queue-job-cancel {
  border: 0;
  background: transparent;
  color: #fda4af;
  padding: 2px 0;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.queue-job-cancel:hover {
  color: #fff;
}
.queue-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 2px 4px;
  color: #8792a6;
  font-size: 9px;
}
.queue-summary b {
  color: #cbd5e1;
}
.queue-job {
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.queue-job:hover {
  border-color: #6366f180;
  background: #111827;
}
.queue-detail-modal .modal {
  width: min(920px, 100%);
}
.queue-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
}
.queue-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.queue-detail-block {
  min-width: 0;
}
.queue-detail-block h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 12px;
}
.queue-detail-content {
  max-height: 56vh;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080c13;
  color: #dbe5f3;
  font:
    11px/1.65 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.queue-detail-image {
  display: block;
  max-width: 100%;
  max-height: 52vh;
  margin: auto;
  border-radius: 8px;
}
.queue-detail-empty {
  color: var(--muted);
}
@media (max-width: 760px) {
  .queue-detail-grid {
    grid-template-columns: 1fr;
  }
  .queue-detail-content {
    max-height: 34vh;
  }
}

/* Shot direction profile */
.direction-profile-editor {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--entity-divider);
  background: color-mix(in srgb, var(--entity-surface) 82%, transparent);
}
.direction-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.direction-profile-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.direction-profile-head strong {
  color: var(--text);
  font-size: var(--fs-control);
}
.direction-profile-head span,
.direction-profile-head small {
  color: var(--muted);
  font-size: var(--fs-caption);
}
.direction-profile-head small {
  text-align: right;
}
.direction-profile-head > .direction-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.direction-profile-actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.shot-design-stale {
  align-self: center;
  color: #fbbf24;
  font-size: var(--fs-caption);
  line-height: 1.35;
}
html[data-theme="light"] .shot-design-stale {
  color: #b45309;
}
.direction-profile-stage {
  width: 100%;
  overflow: hidden;
  border-radius: var(--ui-radius-card);
  background: #090d14;
}
.direction-profile-stage svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 190px;
  touch-action: none;
  user-select: none;
}
.direction-profile-column {
  fill: transparent;
}
.direction-profile-column:nth-of-type(even) {
  fill: #ffffff02;
}
.direction-profile-column.current {
  fill: #ffffff08;
}
.direction-profile-boundary {
  stroke: #ffffff0a;
  stroke-width: 0.7;
}
.direction-profile-grid {
  stroke: #ffffff0c;
  stroke-width: 0.65;
}
.direction-profile-label,
.direction-profile-level {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
  pointer-events: none;
}
.direction-profile-label.energy {
  fill: #fbbf24;
}
.direction-profile-label.tension {
  fill: #f472b6;
}
.direction-profile-label.motion {
  fill: #22d3ee;
}
.direction-profile-label.intimacy {
  fill: #a78bfa;
}
.direction-profile-line {
  fill: none;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
  pointer-events: none;
}
.direction-profile-line.energy {
  stroke: #fbbf24;
}
.direction-profile-line.tension {
  stroke: #f472b6;
}
.direction-profile-line.motion {
  stroke: #22d3ee;
}
.direction-profile-line.intimacy {
  stroke: #a78bfa;
}
.direction-profile-hit {
  fill: transparent;
  cursor: ns-resize;
}
.direction-profile-point {
  stroke: #0b0f16;
  stroke-width: 1.4;
  cursor: ns-resize;
  transition:
    r 0.14s,
    filter 0.14s;
}
.direction-profile-control:hover .direction-profile-point,
.direction-profile-control:focus .direction-profile-point {
  r: 5.5px;
  filter: drop-shadow(0 0 5px currentColor);
}
.direction-profile-control:focus {
  outline: none;
}
.direction-profile-point.energy {
  fill: #fbbf24;
  color: #fbbf24;
}
.direction-profile-point.tension {
  fill: #f472b6;
  color: #f472b6;
}
.direction-profile-point.motion {
  fill: #22d3ee;
  color: #22d3ee;
}
.direction-profile-point.intimacy {
  fill: #a78bfa;
  color: #a78bfa;
}
.direction-profile-point.unset {
  fill: #0b0f16;
  stroke: currentColor;
  stroke-dasharray: 2 1.5;
  opacity: 0.72;
}
.direction-profile-empty {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px dashed var(--entity-empty-border);
  border-radius: var(--ui-radius-card);
  color: var(--muted);
  font-size: var(--fs-small);
}
html[data-theme="light"] .direction-profile-editor {
  border-color: #d7dee9;
  background: #fff;
}
html[data-theme="light"] .direction-profile-stage {
  background: #f8fafc;
}
html[data-theme="light"] .direction-profile-column:nth-of-type(even) {
  fill: #0f172902;
}
html[data-theme="light"] .direction-profile-column.current {
  fill: #7c3aed0b;
}
html[data-theme="light"] .direction-profile-boundary,
html[data-theme="light"] .direction-profile-grid {
  stroke: #33415518;
}
html[data-theme="light"] .direction-profile-point {
  stroke: #fff;
}
html[data-theme="light"] .direction-profile-point.unset {
  fill: #fff;
  stroke: currentColor;
}
@media (max-width: 760px) {
  .direction-profile-head {
    display: grid;
    gap: 4px;
  }
  .direction-profile-head > div {
    display: grid;
    gap: 2px;
  }
  .direction-profile-head small {
    text-align: left;
  }
  .direction-profile-head > .direction-profile-actions,
  .direction-profile-actions > div {
    justify-content: flex-start;
  }
  .direction-profile-stage {
    overflow-x: auto;
  }
  .direction-profile-stage svg {
    min-width: 760px;
  }
}
html[data-theme="light"] .queue-job:hover {
  background: #f5f7ff;
  border-color: #818cf8;
}
html[data-theme="light"] .queue-detail-content {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}
.library-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.library-toolbar input,
.library-toolbar select {
  width: 100%;
  border: 1px solid #2b3346;
  background: #090d14;
  color: #e8ebf3;
  border-radius: 10px;
  padding: 10px 12px;
  outline: 0;
}
.library-count {
  color: #8791a5;
  font-size: 11px;
  white-space: nowrap;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 13px;
}
.library-card {
  min-width: 0;
  border: 1px solid #293246;
  border-radius: 15px;
  background: linear-gradient(155deg, #111722, #090d14);
  overflow: hidden;
  transition: 0.2s;
}
.library-card:hover {
  border-color: #596784;
  transform: translateY(-1px);
}
.library-preview {
  height: 166px;
  background: #070a10;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-bottom: 1px solid #232b3b;
}
.library-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.library-audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  padding: 10px 16px;
  border: 1px solid #4b556d;
  border-radius: 99px;
  background: #151b28;
  color: #e8ecf5;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: 0.18s;
}
.library-audio-toggle:hover {
  border-color: #8b5cf6;
  background: #201b37;
}
.library-audio-toggle.playing {
  border-color: #22d3ee;
  background: #0c2b34;
  color: #a5f3fc;
  box-shadow: 0 0 0 3px #22d3ee18;
}
.library-preview pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  color: #bcc5d5;
  font:
    11px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.library-card.expanded .library-preview {
  height: auto;
  min-height: 166px;
  max-height: 520px;
  overflow: auto;
}
.library-card.expanded .library-preview pre {
  height: auto;
  overflow: visible;
}
.library-body {
  padding: 12px;
}
.library-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.library-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.library-meta time {
  margin-left: auto;
  color: #697488;
  font-size: 9px;
  white-space: nowrap;
}
.library-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.library-badges span {
  font-size: 9px;
  color: #aeb9ca;
  border: 1px solid #2b3548;
  border-radius: 99px;
  padding: 3px 7px;
}
.library-apply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.library-apply select {
  min-width: 0;
  border: 1px solid #2c3548;
  background: #0a0e15;
  color: #d9deea;
  border-radius: 8px;
  padding: 7px;
  font-size: 10px;
}
.library-empty {
  grid-column: 1/-1;
  padding: 46px 20px;
  text-align: center;
  border: 1px dashed #303a4f;
  border-radius: 15px;
  color: #768196;
}
.library-empty strong {
  display: block;
  color: #c0c7d4;
  margin-bottom: 5px;
}
.command-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #03050aa8;
  backdrop-filter: blur(10px);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.command-box {
  width: min(620px, calc(100vw - 28px));
  border: 1px solid #ffffff1d;
  border-radius: 22px;
  background: #111722f7;
  box-shadow: 0 35px 100px #000c;
  overflow: hidden;
}
.command-box input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #ffffff10;
  background: transparent;
  color: white;
  padding: 18px;
  font-size: 16px;
  outline: 0;
}
.command-list {
  padding: 8px;
  max-height: 420px;
  overflow: auto;
}
.command-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd1de;
  display: flex;
  align-items: center;
  padding: 11px 12px;
  border-radius: 10px;
  text-align: left;
}
.command-item:hover,
.command-item.active {
  background: #8b5cf61c;
  color: white;
}
.command-item kbd {
  margin-left: auto;
  color: #6f798c;
  font-size: 10px;
}
.hidden.command-modal {
  display: none;
}
/* Shared UI system */
.card-head {
  padding: 16px var(--space-panel);
}
.card-body {
  padding: var(--space-panel);
}
.card-title {
  font-size: var(--fs-title);
}
.card-sub {
  color: var(--muted-soft);
  font-size: var(--fs-caption);
}
.field label {
  color: var(--text-secondary);
  font-size: var(--fs-control);
}
.field input,
.field textarea,
.field select {
  font-size: var(--fs-body);
}
.field input,
.field select {
  min-height: 42px;
}
.field .hint,
.lyrics-tools,
.audio-copy > span,
.concept-settings-title small {
  color: var(--muted);
  font-size: var(--fs-small);
}
.btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--control-radius);
  font-size: var(--fs-control);
  line-height: 1.2;
}
.btn.small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: var(--fs-small);
}
.audio-title-row .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: var(--fs-small);
}
.audio-copy {
  display: grid;
  gap: 0;
}
.audio-source-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.audio-source-actions .item-delete-icon {
  flex: 0 0 32px;
}
.audio-copy > span {
  margin-top: 7px;
}
.audio-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-top: 12px;
}
.audio-review-grid .lrc-editor {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
}
.audio-review-grid .lrc-lines {
  flex: 1;
  max-height: 420px;
}
.audio-review-grid .audio-storyboard-live {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 13px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #32405a;
  border-radius: 11px;
  background: #0a1019;
}
.audio-review-grid .audio-storyboard-frame {
  width: 100%;
  max-height: 420px;
}
.audio-review-grid .audio-storyboard-info {
  margin-top: 10px;
  text-align: center;
}
.audio-review-grid .audio-storyboard-info small {
  margin: 0;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 750;
}
html[data-theme="light"] .audio-review-grid .audio-storyboard-live {
  border-color: #cbd5e1;
  background: #f8fafc;
}
html[data-theme="light"] .audio-review-grid .audio-storyboard-info small {
  color: #334155;
}
.audio-analysis-workstation {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid #30384b;
  border-radius: 13px;
  background: #080c13;
}
.audio-analysis-controls {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 10px 14px;
}
.audio-analysis-controls .audio-transport {
  gap: 12px;
}
.audio-analysis-controls .audio-play-toggle {
  width: 46px;
  height: 46px;
  border-color: #7569ae;
  background: linear-gradient(145deg, #6d4cff, #4931b5);
  box-shadow: 0 8px 24px #6d4cff3a;
  color: #fff;
  font-size: 17px;
}
.audio-analysis-controls .audio-play-toggle:hover:not(:disabled) {
  border-color: #a99eff;
  background: linear-gradient(145deg, #7c5cff, #5638ca);
}
.audio-analysis-controls .audio-transport-time {
  min-width: 112px;
  color: #d8deea;
  font-size: 12px;
  font-weight: 700;
}
.audio-analysis-workstation .audio-review-grid {
  margin: 0;
  padding: 12px;
}
.audio-analysis-workstation .lrc-editor,
.audio-analysis-workstation .audio-storyboard-live {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.audio-analysis-workstation .audio-timeline {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.audio-analysis-workstation .audio-timeline-head,
.audio-analysis-workstation .audio-timeline-readout {
  display: none;
}
html[data-theme="light"] .audio-analysis-workstation {
  border-color: #cbd5e1;
  background: #fff;
}
html[data-theme="light"] .audio-analysis-controls .audio-transport-time {
  color: #334155;
}
.audio-structure-counts {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
  padding: 12px 14px 14px;
  flex-wrap: wrap;
}
.audio-structure-counts .recommendation {
  max-width: min(100%, 620px);
}
.btn[data-shot-image],
.btn[data-char-image] {
  border-color: #9b87f555;
  background: linear-gradient(115deg, #7c3aed, #6265e9);
  box-shadow: 0 8px 22px #6d28d936;
  color: #fff;
}
.actions,
.panel-toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-toolbar);
  flex-wrap: wrap;
}
.panel-toolbar {
  margin: 0;
}
.actions .push,
.panel-toolbar .push {
  margin-left: auto;
}
.scene-controls .btn {
  align-self: flex-end;
}
.panel-description {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.7;
}
.scene-structure-workflow {
  display: grid;
  gap: 9px;
}
.structure-count-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.structure-count-row .recommendation {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  margin: 0;
}
.structure-action-row {
  display: flex;
  align-items: center;
}
.structure-action-row .btn {
  min-width: 230px;
}
.shot-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shot-details-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.empty,
.library-empty {
  padding: 42px 20px;
  border: 1px dashed #303a4f;
  border-radius: 15px;
  background: linear-gradient(135deg, #10141c88, #0a0d1288);
  color: var(--muted);
  font-size: var(--fs-body);
  text-align: center;
}
.empty strong,
.library-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
}
.library-toolbar input,
.library-toolbar select {
  min-height: 40px;
  font-size: var(--fs-body);
}
.library-count {
  color: var(--muted);
  font-size: var(--fs-small);
}
.view-toolbar .view-label,
.view-toggle button {
  font-size: var(--fs-small);
}
.scene-toolbar {
  padding: 8px;
}
@media (max-width: 1180px) {
  .layout {
    grid-template-columns: var(--rail) minmax(0, 1fr);
  }
  .bottom-dock {
    right: 20px;
  }
}
@media (max-width: 760px) {
  :root {
    --rail: 0px;
  }
  .shell {
    padding: 0 12px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 66px;
    z-index: 25;
    background: #080b11d9;
    backdrop-filter: blur(16px);
    margin: 0 -12px 12px;
    padding: 8px 12px;
  }
  .step-nav {
    display: flex;
  }
  .step-link {
    width: auto;
    min-width: 64px;
    height: 50px;
    flex: 1;
  }
  .project-title {
    display: none;
  }
  .save-state {
    display: none;
  }
  .bottom-dock {
    left: 12px;
    right: 12px;
    bottom: 8px;
  }
  .dock-stage {
    display: none;
  }
  .dock-primary {
    min-width: 0;
    flex: 1;
  }
  .scene-list.view-table .shot-card,
  .shot-card {
    grid-template-columns: 1fr;
  }
  .top-actions {
    gap: 6px;
  }
  .hero p {
    font-size: 12px;
  }
}
/* Requested refinements */
@media (min-width: 901px) {
  .concept-settings {
    grid-template-columns: minmax(140px, 0.55fr) minmax(170px, 1fr) minmax(
        170px,
        1fr
      ) minmax(130px, 0.7fr);
  }
}
.concept-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 17px;
  align-items: stretch;
}
.lyrics-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.concept-editor-right {
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto;
  gap: 20px;
}
.concept-editor-grid .lyrics-label,
.concept-editor-grid .field-title-row {
  min-height: 32px;
  margin-bottom: 8px;
}
.field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.field-title-row label {
  margin: 0;
}
.lyrics-field .text-window {
  display: flex;
  flex: 1;
  min-height: 0;
}
.lyrics-field #lyrics {
  flex: 1;
  height: auto;
  min-height: 680px;
}
.concept-editor-right #direction {
  height: 260px;
  min-height: 260px;
}
.concept-editor-right #story {
  height: 360px;
  min-height: 360px;
}
#story-wrap {
  min-width: 0;
}
.creative-treatment {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #2c3446;
  border-radius: 14px;
  background: linear-gradient(145deg, #111722, #0b1018);
}
.creative-treatment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.creative-treatment-head strong {
  font-size: 13px;
}
.creative-treatment-head span {
  color: var(--muted);
  font-size: 10px;
}
.creative-treatment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.creative-treatment-grid .wide {
  grid-column: 1/-1;
}
.creative-treatment-grid textarea {
  min-height: 96px;
}
.emotional-arc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.emotional-arc-grid textarea {
  min-height: 82px;
}
.creative-motifs {
  display: grid;
  gap: 8px;
}
.creative-motif-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1.3fr) auto;
  gap: 8px;
  align-items: end;
}
.creative-motif-row .btn {
  height: 42px;
}
.creative-treatment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.lyric-relation {
  width: 160px;
  min-width: 145px;
  margin: 0;
}
.text-window {
  position: relative;
  min-width: 0;
}
.text-window textarea {
  padding-right: 84px;
}
.text-window-tools {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}
.text-window-action {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid #39445a;
  border-radius: 8px;
  background: #111722e8;
  color: #aeb8ca;
  box-shadow: 0 5px 16px #0007;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition:
    border-color 0.16s,
    background 0.16s,
    color 0.16s,
    transform 0.16s;
}
.text-window-action:hover {
  border-color: #8b7cf0;
  background: #292345;
  color: #fff;
  transform: translateY(-1px);
}
.text-window-action:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}
.text-window-action.danger:hover {
  border-color: #fb7185;
  background: #451a25;
  color: #fecdd3;
}
.text-window-action .ico {
  width: 15px;
  height: 15px;
}
.hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 8px 14px;
  min-height: 38px;
}
.hero:after {
  display: none;
}
.hero .eyebrow {
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: 0.16em;
}
.hero h1 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.35;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.hero h1 br {
  display: none;
}
.hero p,
.hero-meta {
  display: none;
}
.layout {
  grid-template-columns: var(--rail) minmax(0, 1fr);
  padding-right: calc(var(--queue-width) + 18px);
  transition: padding-right 0.25s;
}
.drawer {
  width: var(--queue-width);
}
.scene-list.view-visual .shot-card {
  grid-template-columns: 560px minmax(0, 1fr);
}
body.queue-collapsed .layout {
  padding-right: 66px;
}
body.queue-collapsed .drawer {
  width: 48px;
}
body.queue-collapsed .drawer-head {
  height: 100%;
  padding: 10px 7px;
  border: 0;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
}
body.queue-collapsed .drawer-head strong,
body.queue-collapsed .drawer-head .queue-count,
body.queue-collapsed .drawer-head .queue-cancel-pending,
body.queue-collapsed .queue-list {
  display: none !important;
}
body.queue-collapsed .drawer-head .queue-toggle {
  display: inline-flex;
  margin: 0;
}
@media (max-width: 1300px) {
  .layout {
    padding-right: 0;
  }
  body.queue-collapsed .layout {
    padding-right: 64px;
  }
  .drawer {
    width: min(390px, calc(100vw - 32px));
  }
  body.queue-collapsed .drawer {
    width: 48px;
  }
  .drawer-head {
    height: auto;
    padding: 17px;
    border-bottom: 1px solid #ffffff10;
    align-items: center;
    justify-content: flex-start;
  }
  .drawer-head strong,
  .drawer-head .queue-toggle,
  .queue-list {
    display: flex;
  }
  .queue-list {
    display: grid;
  }
  body.queue-collapsed .drawer-head {
    height: 100%;
    padding: 10px 7px;
    border: 0;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 760px) {
  body.queue-collapsed .layout {
    padding-right: 0;
  }
  .scene-list.view-visual .shot-card {
    grid-template-columns: 1fr;
  }
  .library-toolbar {
    grid-template-columns: 1fr;
  }
  .library-grid {
    grid-template-columns: 1fr;
  }
  .panel-toolbar {
    align-items: stretch;
  }
  .panel-toolbar .push {
    margin-left: 0;
  }
  .scene-controls .btn {
    align-self: stretch;
  }
  .structure-count-row {
    align-items: stretch;
  }
  .structure-count-row .recommendation {
    flex-basis: auto;
  }
  .structure-action-row .btn {
    width: 100%;
    min-width: 0;
  }
  .shot-details-note {
    font-size: 9px;
  }
  .concept-editor-grid,
  .creative-treatment-grid,
  .emotional-arc-grid {
    grid-template-columns: 1fr;
  }
  .creative-treatment-grid .wide {
    grid-column: auto;
  }
  .creative-motif-row {
    grid-template-columns: 1fr;
  }
  .lyrics-field #lyrics {
    height: 360px;
    min-height: 360px;
  }
  .concept-editor-right #direction {
    height: 260px;
    min-height: 260px;
  }
  .concept-editor-right #story {
    height: 360px;
    min-height: 360px;
  }
  .hero {
    padding: 0 3px 10px;
  }
  .hero .eyebrow {
    display: none;
  }
  .hero h1 {
    font-size: 15px;
    white-space: normal;
    flex-wrap: wrap;
    gap: 2px 5px;
  }
}
.character-grid.result-flash {
  animation: result-flash 0.55s ease;
}
@keyframes result-flash {
  0% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.22);
    transform: translateY(-2px);
  }
  100% {
    filter: brightness(1);
    transform: none;
  }
}
.edit-guidance {
  border-color: #f59e0b55 !important;
  background: linear-gradient(180deg, #171207, #11100b) !important;
  color: #fde7b0 !important;
}
.edit-guidance-note {
  color: #fbbf24;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.mv-name-field {
  display: flex;
  align-items: center;
  min-width: 0;
  border-left: 1px solid #ffffff14;
}
.mv-name-field label {
  padding-left: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.mv-name-field .project-title {
  border-left: 0;
  width: min(25vw, 280px);
  padding-left: 8px;
}
.mv-action {
  white-space: nowrap;
}
.compact-label {
  display: none;
}
.new-mv-form {
  display: grid;
  gap: 14px;
}
.new-mv-error {
  min-height: 18px;
  color: #fda4af;
  font-size: 12px;
}
.previewable-image {
  cursor: zoom-in;
  transition:
    filter 0.18s,
    transform 0.18s;
}
.previewable-image:hover {
  filter: brightness(1.08);
}
.previewable-image:focus-visible {
  outline: 3px solid #a78bfa;
  outline-offset: -3px;
}
.image-preview-modal {
  z-index: 180;
  background: #020308ed;
  padding: 18px;
}
.image-preview-dialog {
  position: relative;
  width: min(94vw, 1600px);
  height: min(90vh, 1000px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid #ffffff22;
  border-radius: 20px;
  background: #090c12;
  box-shadow: 0 35px 120px #000;
  overflow: hidden;
}
.image-preview-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(circle, #1a2030, #07090d 70%);
}
.image-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.image-preview-caption {
  min-height: 52px;
  padding: 14px 68px 14px 20px;
  color: #cbd2df;
  font-size: 13px;
  border-top: 1px solid #ffffff12;
  background: #10151e;
}
.image-preview-close {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 14px;
  background: #0a0d13dc;
  backdrop-filter: blur(12px);
}
body.preview-open {
  overflow: hidden;
}
@media (max-width: 1220px) {
  .wide-label {
    display: none;
  }
  .compact-label {
    display: inline;
  }
  .mv-name-field .project-title {
    width: min(22vw, 220px);
  }
}
@media (max-width: 760px) {
  .mv-name-field {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.shot-card.shot-generating {
  border-color: #38bdf866;
}
.shot-card.shot-generated {
  border-color: #34d399;
  box-shadow: 0 0 0 2px #34d39925;
}
.shot-image-status {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  padding: 5px 8px;
  border: 1px solid #67e8f966;
  border-radius: 7px;
  background: #07131ee8;
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 6px 18px #0008;
}
.shot-image-status.error {
  border-color: #fb718566;
  color: #fecdd3;
  background: #211016e8;
}
.shot-card .scene-image img.just-generated {
  animation: shot-reveal 0.45s ease-out;
}
@keyframes shot-reveal {
  from {
    opacity: 0.15;
    filter: blur(8px);
    transform: scale(1.025);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
.shot-background-population {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(220px, 1fr);
  gap: 8px;
  margin: 8px 0;
}
.shot-background-population label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
}
.shot-background-population select,
.shot-background-population input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #33405a;
  border-radius: 7px;
  background: #0c1017;
  color: #cbd5e1;
  padding: 7px 9px;
  font-size: 10px;
}
html[data-theme="light"] .shot-background-population select,
html[data-theme="light"] .shot-background-population input {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}
.environment-mode {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #8e98aa;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.environment-mode select,
.mini-actions select {
  border: 1px solid #343d52;
  background: #0b0f16;
  color: #dce2ee;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 10px;
  outline: 0;
}
.environment-mode select:focus,
.mini-actions select:focus {
  border-color: #8b5cf6;
}
.environment-mode-note {
  min-height: 18px;
  margin-top: 9px;
  color: #7e899d;
  font-size: 10px;
}
.environment-mode-note.warning {
  color: #fbbf24;
}
.environment-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: #67e8f9;
  font-size: 10px;
}
.environment-progress:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 9px #22d3ee;
}
.environment-view-count {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 7px;
  border: 1px solid #34d39944;
  border-radius: 99px;
  color: #6ee7b7;
  font-size: 9px;
  font-weight: 800;
}
.environment-visual.environment-five-grid {
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 7px;
  padding: 8px;
  background: #080b11;
}
.environment-view {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid #30394c;
  border-radius: 8px;
  background: #111722;
}
.environment-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.environment-view span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 3px 6px;
  border: 1px solid #ffffff1f;
  border-radius: 5px;
  background: #07090ddd;
  color: #dce6f4;
  font-size: 8px;
  font-weight: 800;
  pointer-events: none;
}
.environment-view-regenerate {
  position: absolute;
  z-index: 2;
  right: 6px;
  top: 6px;
  padding: 5px 8px;
  border: 1px solid #a78bfa88;
  border-radius: 7px;
  background: #171124e8;
  color: #ddd6fe;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 4px 14px #0008;
}
.environment-view-regenerate:hover {
  border-color: #c4b5fd;
  background: #312e81;
  color: #fff;
}
.environment-view-regenerate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.theme-toggle {
  font-size: 19px;
  line-height: 1;
}
.theme-toggle span {
  display: block;
  transform: translateY(-1px);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #fff;
  --panel2: #f6f8fb;
  --line: #d7dee9;
  --text: #172033;
  --text-secondary: #44516a;
  --muted: #65728a;
  --muted-soft: #7b879b;
  --shadow: 0 22px 65px #4755691f;
  --surface: #f7f9fc;
  --surface-raised: #fff;
  --glass: #fffffff0;
  --accent: #6d4aff;
  --accent2: #0891b2;
}
html[data-theme="light"] body {
  background:
    radial-gradient(80% 60% at 72% -10%, #bfdbfe80, transparent 62%),
    radial-gradient(50% 40% at 0 18%, #ddd6fe80, transparent 70%), #eef2f7;
  color: var(--text);
}
html[data-theme="light"] body:before {
  opacity: 0.018;
}
html[data-theme="light"] .topbar {
  background: #ffffffdc;
  border-bottom-color: #cbd5e1;
  box-shadow: 0 8px 28px #64748b18;
}
html[data-theme="light"] .project-title {
  color: #172033;
  border-left-color: #cbd5e1;
}
html[data-theme="light"] .project-title:focus {
  background: #eef2ff;
}
html[data-theme="light"] .save-state {
  color: #64748b;
}
html[data-theme="light"] .provider-pill {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px #fff;
}
html[data-theme="light"] .btn {
  background: linear-gradient(180deg, #fff, #f1f5f9);
  color: #273449;
  border-color: #cbd5e1;
  box-shadow:
    0 5px 14px #64748b18,
    inset 0 1px #fff;
}
html[data-theme="light"] .btn:hover {
  background: linear-gradient(180deg, #fff, #e9eef6);
  border-color: #94a3b8;
  box-shadow: 0 8px 18px #64748b24;
}
html[data-theme="light"] .btn.primary,
html[data-theme="light"] .btn.green {
  color: #fff;
}
html[data-theme="light"] .btn.danger {
  color: #be123c;
}
html[data-theme="light"]
  :is(
    .card,
    .character,
    .environment,
    .scene-group,
    .shot-card,
    .audio-panel,
    .concept-settings,
    .output,
    .empty,
    .side-note,
    .queue-job,
    .snapshot-item,
    .project-item,
    .command-item,
    .library-card,
    .preflight-panel,
    .audio-timeline
  ) {
  background: #fff;
  border-color: #d7dee9;
  color: #263349;
  box-shadow: 0 14px 36px #64748b12;
}
html[data-theme="light"] .card:before {
  opacity: 0.7;
}
html[data-theme="light"] :is(.card-head, .scene-group-head, .drawer-head) {
  background: linear-gradient(90deg, #f8fafc, #fff);
  border-color: #dbe2ec;
}
html[data-theme="light"] .scene-group-head input {
  color: #1e293b;
}
html[data-theme="light"] .audio-timeline-head strong,
html[data-theme="light"] .audio-timeline-readout b {
  color: #334155;
}
html[data-theme="light"] .audio-timeline .timeline-axis-label {
  fill: #64748b;
}
html[data-theme="light"] .audio-timeline .timeline-playhead {
  stroke: #0f172a;
}
html[data-theme="light"]
  :is(
    .field input,
    .field textarea,
    .field select,
    .character-role,
    .scene-meta input,
    .scene-meta select,
    .shot-fields input,
    .scene-content textarea,
    .shot-part-type,
    .shot-environment select,
    .shot-timecode input,
    .library-toolbar input,
    .library-toolbar select,
    .snapshot-create input,
    .new-mv-form input,
    .environment-mode select,
    .mini-actions select
  ) {
  background: #fff;
  color: #273449;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px 3px #64748b12;
}
html[data-theme="light"]
  :is(.field input, .field textarea, .field select):focus {
  background: #fff;
  border-color: #7c5cff;
  box-shadow: 0 0 0 3px #7c5cff1f;
}
html[data-theme="light"]
  :is(.scene-meta, .shot-list, .card-head, .drawer-head) {
  border-color: #dbe2ec;
}
html[data-theme="light"]
  :is(.shot-environment, .shot-timecode, .recommendation) {
  background: #f5f7ff;
  border-color: #c7d2fe;
}
html[data-theme="light"] .video-prompt {
  background: #f0f9ff !important;
  color: #164e63 !important;
  border-color: #67e8f9 !important;
}
html[data-theme="light"] .edit-guidance {
  background: #fffbeb !important;
  color: #78350f !important;
  border-color: #fbbf24 !important;
}
html[data-theme="light"]
  :is(.character-visual, .environment-visual, .scene-image) {
  background: linear-gradient(135deg, #e9eef6, #f8fafc);
  color: #64748b;
}
html[data-theme="light"] .step-link {
  color: #64748b;
}
html[data-theme="light"] .step-link:hover {
  background: #e8edf5;
  color: #263449;
}
html[data-theme="light"] .step-link.active {
  background: linear-gradient(145deg, #ede9fe, #e0f2fe);
  border-color: #a78bfa;
  color: #5b21b6;
}
html[data-theme="light"] .view-toggle {
  background: #e9eef6;
  border-color: #cbd5e1;
}
html[data-theme="light"] .view-toggle button.active {
  background: #fff;
  color: #273449;
  box-shadow: 0 2px 8px #64748b20;
}
html[data-theme="light"] .drawer {
  background: #fffffff2;
  border-color: #cbd5e1;
  box-shadow: 0 28px 80px #4755692e;
}
html[data-theme="light"] .bottom-dock {
  background: #fffffff0;
  border-color: #cbd5e1;
  box-shadow: 0 18px 50px #4755692e;
}
html[data-theme="light"] .modal-backdrop {
  background: #33415580;
}
html[data-theme="light"] .modal {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 28px 90px #1e293b40;
}
html[data-theme="light"] .modal-head,
html[data-theme="light"] .modal-foot {
  border-color: #dbe2ec;
}
html[data-theme="light"] .sidebar {
  background: transparent;
}
html[data-theme="light"] .text-window-action {
  background: #fff;
  color: #475569;
  border-color: #cbd5e1;
  box-shadow: 0 5px 14px #64748b20;
}
html[data-theme="light"] .environment-visual.environment-five-grid {
  background: #e8edf5;
}
html[data-theme="light"] .environment-view {
  background: #f8fafc;
  border-color: #cbd5e1;
}
html[data-theme="light"] .btn.primary {
  background: linear-gradient(115deg, #7c3aed, #5b5bd6);
  border-color: #6d4aff;
  color: #fff;
  box-shadow:
    0 8px 20px #6d28d933,
    inset 0 1px #ffffff55;
}
html[data-theme="light"] .btn.primary:hover {
  background: linear-gradient(115deg, #6d28d9, #4f46c8);
  border-color: #5b21b6;
  color: #fff;
  box-shadow: 0 11px 26px #6d28d944;
}
html[data-theme="light"] .btn.green {
  background: linear-gradient(110deg, #047857, #0f766e);
  border-color: #047857;
  color: #fff;
  box-shadow:
    0 8px 20px #0478572e,
    inset 0 1px #ffffff40;
}
html[data-theme="light"] .btn.green:hover {
  background: linear-gradient(110deg, #065f46, #115e59);
  color: #fff;
}
html[data-theme="light"] .btn.ghost {
  background: transparent;
  color: #334155;
  border-color: transparent;
  box-shadow: none;
}
html[data-theme="light"] .btn.danger {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
html[data-theme="light"] .btn.danger:hover {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}
html[data-theme="light"] .icon-btn {
  color: #475569;
}
html[data-theme="light"] .icon-btn:hover {
  color: #111827;
}
html[data-theme="light"] .theme-toggle {
  background: #eef2ff;
  color: #5b21b6;
  border-color: #c4b5fd;
}
html[data-theme="light"] .theme-toggle:hover {
  background: #e0e7ff;
  color: #4c1d95;
  border-color: #a78bfa;
}
html[data-theme="light"]
  :is(
    .card-title,
    .modal-head h2,
    .character input,
    .environment input,
    .snapshot-item strong,
    .project-item strong,
    .empty strong,
    .concept-settings-title strong,
    .audio-copy strong
  ) {
  color: #1e293b;
}
html[data-theme="light"]
  :is(
    .card-sub,
    .panel-description,
    .field .hint,
    .view-toolbar .view-label,
    .library-count,
    .save-state,
    .lyrics-tools,
    .environment-mode,
    .environment-mode-note,
    .side-note,
    .command-item small,
    .concept-settings-title small,
    .audio-copy > span
  ) {
  color: #64748b;
}
html[data-theme="light"] .audio-file {
  color: #6d28d9 !important;
}
html[data-theme="light"] :is(.field label, .scene-content label, .meta-check) {
  color: #475569;
}
html[data-theme="light"]
  :is(
    .field input,
    .field textarea,
    .field select,
    .character input,
    .character textarea,
    .environment input,
    .environment textarea,
    .scene-content textarea
  )::placeholder {
  color: #94a3b8;
  opacity: 1;
}
html[data-theme="light"] .badge {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}
html[data-theme="light"] .shot-badge {
  color: #0369a1;
}
html[data-theme="light"] .step-num {
  background: #eef2ff;
  color: #5b21b6;
  border-color: #c7d2fe;
}
html[data-theme="light"] .shot-environment label {
  color: #4338ca !important;
}
html[data-theme="light"] .shot-duration {
  color: #0e7490;
}
html[data-theme="light"] .video-prompt-note {
  color: #0369a1;
}
html[data-theme="light"] .edit-guidance-note {
  color: #a16207;
}
html[data-theme="light"] .notice {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}
html[data-theme="light"] .preflight-count.error {
  background: #ffe4e6;
  color: #be123c;
}
html[data-theme="light"] .preflight-count.warning {
  background: #fef3c7;
  color: #92400e;
}
html[data-theme="light"] .preflight-count.ok {
  background: #d1fae5;
  color: #047857;
}
html[data-theme="light"] .preflight-list {
  color: #475569;
}
html[data-theme="light"] .preflight-list li.error {
  color: #be123c;
}
html[data-theme="light"] .preflight-list li.warning {
  color: #92400e;
}
html[data-theme="light"] .queue-job-cancel {
  color: #be123c;
  background: transparent;
  border-radius: 6px;
  padding: 3px 6px;
}
html[data-theme="light"] .queue-job-cancel:hover {
  color: #881337;
  background: #ffe4e6;
  box-shadow: inset 0 0 0 1px #fda4af;
}
html[data-theme="light"] .queue-job-cancel:focus-visible {
  color: #881337;
  background: #fff1f2;
  outline-color: #e11d48;
}
html[data-theme="light"] .queue-cancel-pending {
  color: #be123c !important;
  background: #fff1f2 !important;
  border-color: #fda4af !important;
}
html[data-theme="light"] .queue-cancel-pending:hover {
  color: #881337 !important;
  background: #ffe4e6 !important;
  border-color: #e11d48 !important;
}
html[data-theme="light"] .text-window-action:hover {
  background: #ede9fe;
  color: #4c1d95;
  border-color: #a78bfa;
}
html[data-theme="light"] .text-window-action.danger:hover {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fb7185;
}
html[data-theme="light"] .queue-job-head span {
  background: #e2e8f0;
  color: #475569;
}
html[data-theme="light"] ::selection {
  background: #7c3aed35;
  color: #1e293b;
}
@media (max-width: 760px) {
  html[data-theme="light"] .sidebar {
    background: #f8fafce8;
  }
}
@media (max-width: 620px) {
  .provider-pill {
    display: inline-flex;
    padding: 8px 10px;
    font-size: 10px;
  }
  .top-actions {
    gap: 5px;
  }
}
.toast-region {
  position: fixed;
  z-index: 260;
  left: 50%;
  bottom: 24px;
  width: min(560px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #475569;
  border-radius: 13px;
  background: #111827;
  color: #f8fafc;
  box-shadow:
    0 18px 55px #000a,
    inset 0 1px #ffffff18;
  pointer-events: auto;
  animation: toast-in 0.22s ease-out;
}
.toast-item.success {
  background: #102b25;
  border-color: #34d39980;
  color: #ecfdf5;
}
.toast-item.info {
  background: #10243a;
  border-color: #38bdf880;
  color: #eff6ff;
}
.toast-item.warning {
  background: #382711;
  border-color: #fbbf2488;
  color: #fffbeb;
}
.toast-item.error {
  background: #38151d;
  border-color: #fb718599;
  color: #fff1f2;
}
.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff14;
  font-size: 12px;
  font-weight: 900;
}
.toast-message {
  min-width: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.toast-close {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover {
  opacity: 1;
}
.toast-item.leaving {
  animation: toast-out 0.18s ease-in forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
@media (max-width: 620px) {
  .toast-region {
    bottom: 16px;
    width: calc(100vw - 24px);
  }
}
/* Scene composition workspace refinement */
.shot-card {
  cursor: default !important;
}
.shot-move-button {
  min-width: 34px;
  padding-inline: 9px;
}
.shot-move-button:disabled {
  transform: none;
}
.shot-badge {
  display: none;
}
.shot-timecode {
  border-color: #2d374b;
  background: #0a1019;
  padding: 10px;
}
.shot-timecode:before {
  content: "タイムコード";
  grid-column: 1/-1;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.shot-timecode label {
  color: var(--text-secondary) !important;
  font-size: 10px !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}
.shot-timecode input {
  border-color: #3b4660;
  background: #111827;
  color: var(--text);
}
.shot-duration {
  color: var(--text-secondary);
}
.camera-field {
  min-width: 0;
}
.camera-field label {
  display: block !important;
  margin: 0 0 5px !important;
  color: var(--text-secondary) !important;
  font-size: 10px !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}
.camera-field input {
  width: 100%;
}
.camera-combo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
}
.camera-combo > input {
  border-radius: 7px 0 0 7px !important;
}
.camera-combo-toggle {
  border: 1px solid #3b4660;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #171d29;
  color: var(--text-secondary);
  font-size: 11px;
}
.camera-combo-toggle:hover,
.camera-combo.open .camera-combo-toggle {
  background: #252d3e;
  color: var(--text);
}
.camera-options {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 230px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #46516a;
  border-radius: 9px;
  background: #111722;
  box-shadow: 0 16px 36px #0009;
}
.camera-combo.open .camera-options {
  display: grid;
}
.camera-option {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dbe2ee;
  padding: 7px 9px;
  text-align: left;
  font-size: 11px;
}
.camera-option:hover,
.camera-option.selected {
  background: #8b5cf624;
  color: #ede9fe;
}
.camera-custom-note {
  padding: 6px 9px 3px;
  color: var(--muted);
  font-size: 9px;
  border-top: 1px solid #293143;
  margin-top: 3px;
}
.shot-details {
  border: 1px solid #293143;
  border-radius: 10px;
  background: #0c1017;
  overflow: hidden;
}
.shot-details > summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}
.shot-details > summary::-webkit-details-marker {
  display: none;
}
.shot-details > summary:after {
  content: "＋";
  float: right;
  color: var(--muted);
}
.shot-details[open] > summary:after {
  content: "−";
}
.shot-details-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}
.scene-list.view-visual .shot-card {
  grid-template-columns: minmax(360px, 560px) minmax(0, 1fr);
  grid-template-areas: "command command" "media content" "editorial editorial";
  align-items: start;
}
.shot-commandbar {
  grid-area: command;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 11px;
  border-bottom: 1px solid #293143;
  background: linear-gradient(90deg, #151b27, #0d121b);
}
.shot-command-title {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
}
.shot-command-title span {
  padding: 4px 7px;
  border: 1px solid #334155;
  border-radius: 7px;
  background: #0b1018;
  color: #a5b4fc;
}
.shot-commandbar .shot-part-type {
  width: 190px;
  min-width: 150px;
  margin: 0;
  padding: 7px 9px;
}
.shot-commandbar .shot-environment {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.shot-commandbar .shot-environment select {
  width: clamp(150px, 17vw, 250px);
  padding: 7px 9px;
}
.shot-commandbar .shot-environment select[data-shot-environment-view] {
  width: clamp(140px, 14vw, 220px);
}
.shot-commandbar .shot-timecode {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.shot-commandbar .shot-timecode:before {
  display: none;
}
.shot-commandbar .shot-timecode label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.shot-commandbar .shot-timecode input {
  width: 118px;
  margin: 0;
  padding: 6px 7px;
}
.shot-commandbar .shot-duration {
  padding: 5px 8px;
  border: 1px solid #334155;
  border-radius: 7px;
  background: #111827;
}
.shot-command-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.shot-command-actions .btn {
  white-space: nowrap;
}
.shot-media-pane {
  grid-area: media;
  min-width: 0;
  border-right: 1px solid #293143;
}
.shot-media-pane .scene-toolbar {
  flex-wrap: wrap;
}
.shot-planning-pane {
  grid-area: content;
  min-width: 0;
}
.shot-planning-pane .shot-fields {
  margin-bottom: 2px;
}
.shot-planning-pane .shot-background-population {
  margin: 8px 0 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.shot-narrative-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
  align-items: stretch;
}
.shot-field-panel {
  display: grid;
  grid-template-rows: auto minmax(94px, 1fr);
  gap: 6px;
  min-width: 0;
}
.shot-field-panel textarea {
  height: 100%;
  min-height: 94px;
}
.shot-field-panel.composition textarea {
  min-height: 120px;
}
.shot-editorial {
  grid-area: editorial;
  margin: 0 10px 10px;
}
.shot-editorial[open] > .shot-details-body {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 10px 10px;
}
.shot-editorial-field {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr);
  gap: 6px;
  min-width: 0;
}
.shot-editorial-field textarea {
  height: 100%;
  min-height: 120px;
}
.shot-editorial-text-window {
  position: relative;
  min-width: 0;
  height: 100%;
}
.shot-editorial-text-window textarea {
  height: 100%;
  padding-right: 52px;
}
.shot-editorial-text-window .text-window-tools {
  top: 9px;
  right: 9px;
}
.scene-list.view-table .shot-commandbar {
  display: none;
}
.scene-list.view-table .shot-media-pane {
  border: 0;
}
.scene-list.view-table .shot-editorial {
  display: none;
}
@media (max-width: 1550px) {
  .shot-commandbar {
    flex-wrap: wrap;
  }
  .shot-commandbar .shot-timecode {
    order: 3;
    margin-left: 0;
  }
  .shot-command-actions {
    order: 3;
    margin-left: auto;
  }
}
@media (max-width: 1350px) {
  .scene-list.view-visual .shot-card {
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  }
  .shot-commandbar .shot-environment {
    flex: 1;
  }
  .shot-commandbar .shot-environment select {
    flex: 1;
    width: auto;
  }
  .shot-narrative-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}
@media (max-width: 900px) {
  .scene-list.view-visual .shot-card {
    grid-template-columns: 1fr;
    grid-template-areas: "command" "media" "content" "editorial";
  }
  .shot-commandbar .shot-timecode {
    order: 3;
    width: 100%;
  }
  .shot-media-pane {
    border-right: 0;
    border-bottom: 1px solid #293143;
  }
  .shot-media-pane .scene-image {
    max-height: none;
  }
  .shot-narrative-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .shot-editorial[open] > .shot-details-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .shot-commandbar {
    align-items: stretch;
  }
  .shot-command-title {
    width: 100%;
  }
  .shot-commandbar .shot-part-type {
    width: 100%;
  }
  .shot-commandbar .shot-environment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .shot-commandbar .shot-environment select,
  .shot-commandbar .shot-environment select[data-shot-environment-view] {
    width: 100%;
  }
  .shot-commandbar .shot-timecode {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
  }
  .shot-commandbar .shot-timecode label {
    display: block;
  }
  .shot-commandbar .shot-timecode input {
    width: 100%;
    margin-top: 4px;
  }
  .shot-command-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }
  .shot-command-actions .btn {
    flex: 1;
  }
  .shot-planning-pane .shot-background-population {
    grid-template-columns: 1fr;
  }
  .shot-narrative-grid {
    grid-template-columns: 1fr;
  }
  .shot-fields {
    grid-template-columns: 1fr;
  }
  .shot-editorial {
    margin-inline: 8px;
  }
}
.expert-direction {
  margin-top: 10px;
  border-color: #4c3f704d;
  background: linear-gradient(180deg, #151326, #0c1017);
}
.expert-direction > summary {
  color: #c4b5fd;
}
.expert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.expert-field {
  display: grid;
  gap: 5px;
}
.expert-field.wide {
  grid-column: 1/-1;
}
.expert-field label {
  color: #9ca8bd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.expert-field textarea {
  min-height: 58px;
  resize: vertical;
  background: #0a0e16;
  border: 1px solid #343b50;
  border-radius: 7px;
  color: #d7dce7;
  padding: 8px;
  font-size: 10px;
  line-height: 1.5;
}
.scene-expert {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #252c3b;
  background: #0c1119;
}
.scene-expert label {
  display: grid;
  gap: 5px;
  color: #8d99ad;
  font-size: 9px;
  font-weight: 700;
}
.scene-expert textarea {
  min-height: 48px;
  resize: vertical;
  background: #10151e;
  border: 1px solid #2c3446;
  border-radius: 7px;
  color: #d8dce7;
  padding: 7px;
  font-size: 10px;
}
@media (max-width: 900px) {
  .scene-expert {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .expert-grid,
  .scene-expert {
    grid-template-columns: 1fr;
  }
  .expert-field.wide {
    grid-column: auto;
  }
}
html[data-theme="light"] .expert-direction,
html[data-theme="light"] .scene-expert {
  background: #f7f5ff;
  border-color: #ddd6fe;
}
html[data-theme="light"] .expert-direction > summary {
  color: #5b21b6 !important;
}
html[data-theme="light"] .expert-field label,
html[data-theme="light"] .scene-expert label {
  color: #475569;
}
html[data-theme="light"] .expert-field textarea,
html[data-theme="light"] .scene-expert textarea {
  background: #fff;
  color: #273449;
  border-color: #cbd5e1;
}
.scene-list.view-table .shot-details {
  display: none;
}
.scene-list.view-table .camera-field small,
.scene-list.view-table .camera-field label {
  display: none !important;
}
html[data-theme="light"] .shot-timecode,
html[data-theme="light"] .shot-details {
  background: #f8fafc;
  border-color: #d7dee9;
}
html[data-theme="light"] .shot-timecode input {
  background: #fff;
  color: #273449;
  border-color: #cbd5e1;
}
html[data-theme="light"] .shot-timecode:before,
html[data-theme="light"] .shot-timecode label,
html[data-theme="light"] .shot-duration,
html[data-theme="light"] .camera-field label,
html[data-theme="light"] .shot-details > summary {
  color: #475569 !important;
}
html[data-theme="light"] .shot-commandbar {
  background: linear-gradient(90deg, #f1f5f9, #fff);
  border-color: #d7dee9;
}
html[data-theme="light"] .shot-command-title {
  color: #1e293b;
}
html[data-theme="light"] .shot-command-title span,
html[data-theme="light"] .shot-commandbar .shot-duration {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
html[data-theme="light"] .shot-media-pane {
  border-color: #d7dee9;
}
.sequence-badge,
.shot-command-title .sequence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #4c4a72;
  border-radius: 7px;
  background: #171124;
  color: #c4b5fd;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.scene-header-environment {
  width: min(360px, 32vw);
  min-width: 220px;
  margin-left: auto;
  border: 1px solid #4c4a72;
  border-radius: 8px;
  background: #10151e;
  color: #ddd6fe;
  padding: 8px 10px;
  outline: 0;
}
.scene-header-environment:focus {
  border-color: #8b5cf6;
}
.scene-group-head > .badge + .scene-header-environment {
  margin-left: 0;
}
.expert-direction {
  display: none !important;
}
html[data-theme="light"] .scene-header-environment {
  background: #fff;
  color: #4338ca;
  border-color: #c7d2fe;
}
html[data-theme="light"] .sequence-badge,
html[data-theme="light"] .shot-command-title .sequence-badge {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}
@media (max-width: 900px) {
  .scene-group-head {
    flex-wrap: wrap;
  }
  .scene-header-environment {
    order: 3;
    width: min(100%, 360px);
    margin-left: 43px;
  }
  .scene-group-head > .badge:last-of-type {
    margin-left: auto;
  }
}
@media (max-width: 620px) {
  .scene-header-environment {
    order: 4;
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
  .scene-group-head input {
    flex-basis: calc(100% - 100px);
  }
}
.scene-group {
  --editor-radius: var(--ui-radius-control);
  --editor-height: var(--ui-control-height);
  --editor-font: var(--fs-control);
}
.scene-group
  :is(
    .scene-group-head input,
    .scene-header-environment,
    .scene-expert textarea,
    .shot-part-type,
    .lyric-relation,
    .shot-environment select,
    .shot-timecode input,
    .camera-field input,
    .shot-background-population select,
    .shot-background-population input,
    .scene-content textarea
  ) {
  box-sizing: border-box;
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  background: var(--editor-bg);
  color: var(--editor-text);
  font-family: inherit;
  font-size: var(--editor-font);
  font-weight: 500;
  line-height: 1.45;
  outline: 0;
  box-shadow: none;
  transition:
    border-color 0.16s,
    background-color 0.16s,
    box-shadow 0.16s;
}
.scene-group
  :is(
    .scene-group-head input,
    .scene-header-environment,
    .shot-part-type,
    .lyric-relation,
    .shot-environment select,
    .shot-timecode input,
    .camera-field input,
    .shot-background-population select,
    .shot-background-population input
  ) {
  height: var(--editor-height);
  min-height: var(--editor-height);
  padding: 7px 10px;
}
.scene-group :is(.scene-expert textarea, .scene-content textarea) {
  padding: 10px;
  resize: vertical;
}
.scene-group
  :is(
    .scene-group-head input,
    .scene-header-environment,
    .scene-expert textarea,
    .shot-part-type,
    .lyric-relation,
    .shot-environment select,
    .shot-timecode input,
    .camera-field input,
    .shot-background-population select,
    .shot-background-population input,
    .scene-content textarea
  ):hover {
  border-color: var(--editor-border-hover);
  background: var(--editor-bg-hover);
}
.scene-group
  :is(
    .scene-group-head input,
    .scene-header-environment,
    .scene-expert textarea,
    .shot-part-type,
    .lyric-relation,
    .shot-environment select,
    .shot-timecode input,
    .camera-field input,
    .shot-background-population select,
    .shot-background-population input,
    .scene-content textarea
  ):focus {
  border-color: var(--editor-focus);
  background: var(--editor-bg-hover);
  box-shadow: 0 0 0 3px #8b5cf620;
}
.scene-group :is(input, textarea)::placeholder {
  color: var(--editor-placeholder);
  opacity: 1;
}
.scene-group :is(input, select, textarea):disabled {
  cursor: not-allowed;
  background: #0a0e14;
  color: #778297;
  border-color: #252d3b;
  opacity: 1;
}
.scene-group
  :is(
    .scene-content > label,
    .shot-field-panel > label,
    .camera-field > label,
    .shot-background-population > label,
    .scene-expert > label
  ) {
  margin: 0;
  color: var(--editor-label) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.scene-group-head input {
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}
.scene-header-environment {
  font-size: 12px;
}
.scene-expert {
  gap: 10px;
  padding: 12px 16px;
}
.scene-expert label {
  gap: 6px;
}
.scene-expert textarea {
  min-height: 64px;
}
.shot-planning-pane {
  gap: 10px;
}
.shot-planning-pane
  :is(.shot-fields, .shot-background-population, .shot-narrative-grid) {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.shot-planning-pane .shot-fields {
  gap: 10px;
  margin-bottom: 0;
}
.camera-field label {
  margin-bottom: 6px !important;
}
.camera-combo-toggle {
  width: 36px;
  height: 36px;
  border-color: var(--editor-border);
  background: var(--editor-bg);
  color: var(--editor-label);
}
.camera-combo:focus-within .camera-combo-toggle {
  border-color: var(--editor-focus);
  color: #c4b5fd;
}
.shot-background-population {
  align-items: end;
  gap: 10px;
  margin: 0;
}
.shot-background-population label {
  min-width: 0;
  gap: 6px;
}
.shot-background-population :is(select, input) {
  display: block;
  width: 100%;
  min-width: 0;
}
.shot-narrative-grid {
  gap: 10px;
}
.shot-field-panel {
  grid-template-rows: auto minmax(96px, 1fr);
  gap: 6px;
}
.shot-field-panel textarea {
  min-height: 96px;
}
.shot-field-panel.composition textarea {
  min-height: 120px;
}
.shot-editorial label {
  color: var(--editor-label) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.shot-editorial textarea {
  border-left-width: 3px !important;
  background: var(--editor-bg) !important;
  color: var(--editor-text) !important;
}
.shot-editorial .video-prompt {
  border-color: var(--editor-border) !important;
  border-left-color: #22d3ee !important;
}
.shot-editorial .edit-guidance {
  min-height: 64px;
  border-color: var(--editor-border) !important;
  border-left-color: #f59e0b !important;
}
.shot-editorial textarea:focus {
  border-color: var(--editor-focus) !important;
  box-shadow: 0 0 0 3px #8b5cf620;
}
.video-prompt-note,
.edit-guidance-note {
  font-size: 10px;
  font-weight: 650;
}
.shot-commandbar .shot-part-type,
.shot-commandbar .lyric-relation,
.shot-commandbar .shot-environment select {
  padding-block: 7px;
}
.shot-commandbar .shot-timecode input {
  font-size: 11px;
}
.shot-commandbar .shot-timecode label {
  color: var(--editor-label) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.shot-planning-pane .shot-background-population > label {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-content: stretch !important;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
}
.shot-planning-pane .shot-background-population > label > select,
.shot-planning-pane .shot-background-population > label > input {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  justify-self: stretch;
}
.scene-group .shot-editorial {
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  background: transparent;
}
.scene-group .shot-editorial > summary {
  min-height: 40px;
  padding: 9px 12px;
  background: var(--editor-bg);
  color: var(--editor-label);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  transition:
    border-color 0.16s,
    background-color 0.16s,
    color 0.16s;
}
.scene-group .shot-editorial > summary:hover {
  background: var(--editor-bg-hover);
  color: var(--editor-text);
}
.scene-group .shot-editorial[open] > summary {
  border-bottom: 1px solid var(--editor-border);
}
.scene-group .shot-editorial[open] > .shot-details-body {
  padding: 12px;
  gap: 10px;
}
.scene-group .shot-editorial-column {
  gap: 10px;
}
.scene-group .shot-editorial label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  margin: 0;
  color: var(--editor-label) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}
.scene-group .shot-editorial textarea,
.scene-group .shot-editorial .video-prompt,
.scene-group .shot-editorial .edit-guidance {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--editor-border) !important;
  border-radius: var(--editor-radius);
  background: var(--editor-bg) !important;
  color: var(--editor-text) !important;
  font-family: inherit;
  font-size: var(--editor-font);
  font-weight: 500;
  line-height: 1.55;
  outline: 0;
  box-shadow: none;
  resize: vertical;
  transition:
    border-color 0.16s,
    background-color 0.16s,
    box-shadow 0.16s;
}
.scene-group .shot-editorial textarea:hover {
  border-color: var(--editor-border-hover) !important;
  background: var(--editor-bg-hover) !important;
}
.scene-group .shot-editorial textarea:focus {
  border-color: var(--editor-focus) !important;
  background: var(--editor-bg-hover) !important;
  box-shadow: 0 0 0 3px #8b5cf620;
}
.scene-group .shot-editorial-primary textarea {
  min-height: 120px;
}
.scene-group .shot-editorial-secondary textarea {
  min-height: 64px;
}
.scene-group .shot-editorial .btn.small {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
}
html[data-theme="light"] .scene-group {
  --editor-bg: #fff;
  --editor-bg-hover: #f8fafc;
  --editor-border: #cbd5e1;
  --editor-border-hover: #94a3b8;
  --editor-focus: #7c3aed;
  --editor-text: #263449;
  --editor-label: #526176;
  --editor-placeholder: #94a3b8;
}
html[data-theme="light"] .scene-group :is(input, select, textarea):disabled {
  background: #f1f5f9;
  color: #64748b;
  border-color: #d7dee9;
}
html[data-theme="light"] .scene-group-head input {
  background: transparent;
}
html[data-theme="light"] .shot-editorial textarea {
  background: #fff !important;
  color: #263449 !important;
}
@media (max-width: 900px) {
  .scene-expert {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .scene-expert {
    grid-template-columns: 1fr;
  }
  .shot-planning-pane .shot-fields,
  .shot-planning-pane .shot-background-population {
    grid-template-columns: 1fr;
  }
}
html[data-theme="light"] .camera-combo-toggle {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
html[data-theme="light"] .camera-options {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 16px 36px #64748b30;
}
html[data-theme="light"] .camera-option {
  color: #334155;
}
html[data-theme="light"] .camera-option:hover,
html[data-theme="light"] .camera-option.selected {
  background: #ede9fe;
  color: #5b21b6;
}
.animatic-export {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #33405a;
  border-radius: 13px;
  background: linear-gradient(120deg, #111827, #0a1019);
}
.animatic-export strong,
.animatic-export small {
  display: block;
}
.animatic-export strong {
  color: var(--text);
  font-size: 13px;
}
.animatic-export small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.animatic-export label {
  display: grid;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 750;
}
.animatic-export select {
  min-width: 100px;
  border: 1px solid #3b4660;
  border-radius: 8px;
  background: #111827;
  color: var(--text);
  padding: 8px;
}
.animatic-progress {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 11px;
}
.animatic-progress progress {
  width: 100%;
  height: 8px;
  accent-color: var(--violet);
}
html[data-theme="light"] .animatic-export {
  background: #f8fafc;
  border-color: #d7dee9;
}
html[data-theme="light"] .animatic-export select {
  background: #fff;
  color: #273449;
  border-color: #cbd5e1;
}
@media (max-width: 760px) {
  .animatic-export {
    grid-template-columns: 1fr 1fr;
  }
  .animatic-export > div:first-child,
  .animatic-progress {
    grid-column: 1/-1;
  }
  .animatic-export .btn {
    width: 100%;
  }
}
.lrc-line.done {
  border-left-color: var(--section-color);
}
/* Unified scene-card system */
.structure-action-row {
  gap: 8px;
  flex-wrap: wrap;
}
#reset-timing {
  min-width: 190px;
}
.scene-list.view-overview {
  gap: 16px;
}
.scene-overview-group {
  overflow: hidden;
  border: 1px solid #30384a;
  border-radius: 14px;
  background: #0b0f16;
}
.scene-overview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 11px;
  border-bottom: 1px solid #293143;
  background: linear-gradient(90deg, #151b27, #0d121b);
}
.scene-overview-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}
.scene-overview-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #334155;
  border-radius: 7px;
  background: #111827;
  color: #9ca8bd;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.scene-overview-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 12px;
}
.scene-overview-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #293143;
  border-radius: 10px;
  background: #10141c;
}
.scene-overview-image {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #171b27, #090b10);
  color: #667187;
  font-size: 11px;
}
.scene-overview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-overview-shot {
  padding: 8px 10px;
  border-top: 1px solid #293143;
  color: #a5b4fc;
  font-size: 10px;
  font-weight: 800;
}
html[data-theme="light"] .scene-overview-group,
html[data-theme="light"] .scene-overview-tile {
  background: #fff;
  border-color: #d7dee9;
}
html[data-theme="light"] .scene-overview-head {
  background: linear-gradient(90deg, #f1f5f9, #fff);
  border-color: #d7dee9;
}
html[data-theme="light"] .scene-overview-title {
  color: #1e293b;
}
html[data-theme="light"] .scene-overview-count {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}
html[data-theme="light"] .scene-overview-image {
  background: #f1f5f9;
  color: #64748b;
}
html[data-theme="light"] .scene-overview-shot {
  color: #5b21b6;
  border-color: #d7dee9;
}
/* App-wide card and control standard */
:is(
  .concept-settings,
  .character,
  .environment,
  .library-card,
  .animatic-export,
  .preflight-panel
) {
  border-radius: var(--ui-radius-group);
}
:is(
  .concept-settings,
  .character-body,
  .environment-body,
  .library-body,
  .animatic-export
) {
  font-size: 12px;
}
:is(
  .concept-settings select,
  .character input,
  .character select,
  .character textarea,
  .environment input,
  .environment select,
  .environment textarea,
  .library-toolbar input,
  .library-toolbar select,
  .library-apply select,
  .animatic-export select
) {
  box-sizing: border-box;
  border: 1px solid var(--editor-border);
  border-radius: var(--ui-radius-control);
  background: var(--editor-bg);
  color: var(--editor-text);
  font-family: inherit;
  font-size: 12px;
  outline: 0;
  box-shadow: none;
  transition:
    border-color 0.16s,
    background-color 0.16s,
    box-shadow 0.16s;
}
:is(
  .concept-settings select,
  .character input,
  .character select,
  .environment input,
  .environment select,
  .library-toolbar input,
  .library-toolbar select,
  .library-apply select,
  .animatic-export select
) {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding: 7px 10px;
}
:is(
  .concept-settings select,
  .character input,
  .character select,
  .character textarea,
  .environment input,
  .environment select,
  .environment textarea,
  .library-toolbar input,
  .library-toolbar select,
  .library-apply select,
  .animatic-export select
):hover {
  border-color: var(--editor-border-hover);
  background: var(--editor-bg-hover);
}
:is(
  .concept-settings select,
  .character input,
  .character select,
  .character textarea,
  .environment input,
  .environment select,
  .environment textarea,
  .library-toolbar input,
  .library-toolbar select,
  .library-apply select,
  .animatic-export select
):focus {
  border-color: var(--editor-focus);
  background: var(--editor-bg-hover);
  box-shadow: 0 0 0 3px #8b5cf620;
}
.standard-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.standard-field > span,
.standard-field > label {
  margin: 0;
  color: var(--editor-label);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.4;
}
.entity-card {
  overflow: hidden;
  border: 1px solid var(--entity-border);
  background: var(--entity-surface);
}
.entity-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--entity-divider);
  background: linear-gradient(
    90deg,
    var(--entity-header-start),
    var(--entity-header-end)
  );
}
.entity-card-head > input {
  flex: 1 1 180px;
  width: auto;
  min-width: 100px;
  margin: 0;
  font-size: 13px;
  font-weight: 750;
}
.entity-card-head > select {
  flex: 0 1 180px;
  width: auto;
  min-width: 130px;
  margin: 0;
}
.entity-card-count {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--entity-chip-border);
  border-radius: 7px;
  background: var(--entity-chip-bg);
  color: #9ca8bd;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.entity-visual {
  position: relative;
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #171b27, #090b10);
  color: #667187;
  font-size: 11px;
}
.entity-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.entity-media-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-top: 1px solid var(--entity-divider);
  border-bottom: 1px solid var(--entity-divider);
}
.entity-body {
  display: grid;
  gap: 10px;
  padding: 11px;
}
.entity-body textarea {
  width: 100%;
  min-height: 110px;
  margin: 0;
  padding: 10px;
  resize: vertical;
}
.entity-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #67e8f9;
  font-size: 10px;
}
.entity-progress:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 9px #22d3ee;
}
.entity-details {
  overflow: hidden;
  border: 1px solid var(--entity-divider);
  border-radius: 10px;
  background: var(--entity-surface-subtle);
}
.entity-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--entity-title);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.entity-details > summary::-webkit-details-marker {
  display: none;
}
.entity-details > summary:after {
  content: "+";
  margin-left: auto;
  color: var(--entity-muted);
  font-size: 15px;
  font-weight: 500;
}
.entity-details[open] > summary:after {
  content: "−";
}
.entity-details-static {
  overflow: visible;
}
.entity-details-title {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--entity-divider);
  color: var(--entity-title);
  font-size: 11px;
  font-weight: 800;
}
.entity-details-body {
  display: grid;
  gap: 9px;
  padding: 0 10px 10px;
}
.entity-details-static .entity-details-body {
  padding-top: 10px;
}
.entity-extra-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.environment-view-regenerate {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 0;
}
.environment-view-regenerate svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.library-toolbar {
  grid-template-columns: minmax(220px, 1fr) 150px auto auto;
  align-items: end;
}
.library-toolbar-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.library-toolbar-field > span {
  color: var(--editor-label);
  font-size: var(--fs-small);
  font-weight: 700;
}
.library-card {
  border-radius: var(--ui-radius-group);
}
.library-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--entity-divider);
  background: linear-gradient(
    90deg,
    var(--entity-header-start),
    var(--entity-header-end)
  );
}
.library-type-badge,
.library-badges span {
  padding: 3px 7px;
  border: 1px solid var(--entity-chip-border);
  border-radius: 7px;
  background: var(--entity-chip-bg);
  color: var(--entity-title);
  font-size: 9px;
  font-weight: 750;
}
.library-card-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.library-card-head time {
  margin-left: auto;
  color: #7f8a9d;
  font-size: 9px;
  white-space: nowrap;
}
.library-preview {
  height: auto;
  aspect-ratio: 16/9;
  border-bottom: 1px solid var(--entity-divider);
}
.library-preview img {
  object-fit: contain;
}
.library-details {
  border-top: 0;
}
.library-details > summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  color: #98a3b6;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.library-details > summary::-webkit-details-marker {
  display: none;
}
.library-details > summary:after {
  content: "+";
  margin-left: auto;
  font-size: 14px;
}
.library-details[open] > summary:after {
  content: "−";
}
.library-details .library-body {
  padding-top: 4px;
}
.library-audio-toggle {
  border-radius: 8px;
}
.animatic-export {
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  border-color: var(--entity-border);
  background: var(--entity-surface);
}
.animatic-export-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preflight-panel {
  overflow: hidden;
  padding: 0;
}
.preflight-panel > details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.preflight-panel > details > summary::-webkit-details-marker {
  display: none;
}
.preflight-panel > details > summary strong {
  margin-right: auto;
}
.preflight-panel .preflight-list {
  padding: 0 14px 12px 32px;
}
.empty,
.library-empty {
  border: 1px dashed var(--entity-empty-border);
  border-radius: var(--ui-radius-group);
  padding: 38px 20px;
  background: linear-gradient(135deg, #10141c88, #0a0d1288);
  color: #768196;
}
html[data-theme="light"]
  :is(.entity-card, .entity-details, .library-card, .animatic-export) {
  background: #fff;
  border-color: #d7dee9;
}
html[data-theme="light"] :is(.entity-card-head, .library-card-head) {
  background: linear-gradient(90deg, #f1f5f9, #fff);
  border-color: #d7dee9;
}
html[data-theme="light"]
  :is(
    .concept-settings select,
    .character input,
    .character select,
    .character textarea,
    .environment input,
    .environment select,
    .environment textarea,
    .library-toolbar input,
    .library-toolbar select,
    .library-apply select,
    .animatic-export select
  ) {
  background: #fff;
  color: #273449;
  border-color: #cbd5e1;
}
html[data-theme="light"]
  :is(.entity-card-head > input, .library-card-head strong) {
  color: #1e293b;
}
html[data-theme="light"]
  :is(.entity-card-count, .library-type-badge, .library-badges span) {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}
html[data-theme="light"] .entity-visual {
  background: #f1f5f9;
  color: #64748b;
}
html[data-theme="light"] .entity-details {
  background: #f8fafc;
}
html[data-theme="light"] .entity-details-title {
  color: #475569;
  border-color: #d7dee9;
}
@media (min-width: 761px) {
  body[data-stage="concept"] #concept.active-panel {
    display: flex;
    min-height: calc(100dvh - 110px);
    flex-direction: column;
  }
  body[data-stage="concept"] #concept > .card-body {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }
  body[data-stage="concept"] #concept .concept-editor-grid {
    flex: 1;
    min-height: 0;
  }
  body[data-stage="concept"] #concept .lyrics-field .text-window {
    min-height: 0;
  }
  body[data-stage="concept"] #concept .lyrics-field #lyrics {
    height: 100%;
    min-height: 0;
  }
  body[data-stage="concept"] #concept .concept-editor-right {
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  body[data-stage="concept"] #concept .concept-editor-right > .field,
  body[data-stage="concept"] #concept #story-wrap,
  body[data-stage="concept"] #concept #story-wrap > .field {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }
  body[data-stage="concept"] #concept #story-wrap > .field {
    flex: 1;
    height: 100%;
  }
  body[data-stage="concept"] #concept .concept-editor-right .text-window {
    display: flex;
    flex: 1;
    min-height: 0;
  }
  body[data-stage="concept"] #concept #direction,
  body[data-stage="concept"] #concept #story {
    flex: 1;
    height: 100%;
    min-height: 0;
  }
}
@media (max-width: 760px) {
  .library-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .concept-editor-right #direction,
  .concept-editor-right #story {
    height: 300px;
    min-height: 300px;
  }
  .audio-review-grid {
    grid-template-columns: 1fr;
  }
  .audio-analysis-workstation .audio-storyboard-live {
    border: 0;
  }
  .library-toolbar-field:first-child {
    grid-column: 1/-1;
  }
  .entity-card-head {
    flex-wrap: wrap;
  }
  .entity-card-head > input {
    flex-basis: calc(100% - 90px);
  }
  .entity-card-head > select {
    order: 4;
    flex: 1 1 100%;
  }
}
.scene-group {
  border-radius: 14px;
}
.scene-group-head {
  min-height: 54px;
  gap: 8px;
  padding: 9px 11px;
  background: linear-gradient(90deg, #151b27, #0d121b);
}
.scene-group-head .sequence-badge {
  flex: 0 0 auto;
}
.scene-group-head input[data-scene-title] {
  flex: 1 1 220px;
  height: 36px;
  min-width: 140px;
  padding: 7px 10px;
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  background: var(--editor-bg);
  font-size: 13px;
  font-weight: 750;
}
.scene-header-environment {
  flex: 0 1 360px;
  width: clamp(220px, 28vw, 360px);
  min-width: 180px;
  margin: 0;
}
.scene-shot-count {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #334155;
  border-radius: 7px;
  background: #111827;
  color: #9ca8bd;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.scene-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.scene-collapse,
.scene-delete-icon,
.item-delete-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 8px;
}
.scene-collapse svg,
.scene-delete-icon svg,
.item-delete-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shot-command-actions .item-delete-icon {
  flex: 0 0 32px;
}
.scene-collapse {
  transform: none !important;
}
.scene-collapse svg {
  transition: transform 0.18s ease;
}
.scene-group.collapsed .scene-collapse svg {
  transform: rotate(-90deg);
}
.scene-group.collapsed
  :is(.scene-meta, .scene-design, .scene-expert, .shot-list) {
  display: none;
}
.scene-design {
  margin: 10px 12px 0;
  border: 1px solid #293143;
  border-radius: 10px;
  background: #0c1119;
  overflow: hidden;
}
.scene-design > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  color: #aeb8c9;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.scene-design > summary::-webkit-details-marker {
  display: none;
}
.scene-design > summary:after {
  content: "+";
  margin-left: auto;
  color: #7f8ba0;
  font-size: 15px;
  font-weight: 500;
}
.scene-design[open] > summary:after {
  content: "−";
}
.scene-design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 11px 11px;
}
.scene-design-grid label {
  display: grid;
  grid-template-rows: auto minmax(72px, 1fr);
  gap: 6px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  color: var(--editor-label);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.scene-design-grid textarea {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 72px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  background: var(--editor-bg);
  color: var(--editor-text);
  font-family: inherit;
  font-size: var(--editor-font);
  font-weight: 500;
  line-height: 1.45;
  outline: 0;
  transition:
    border-color 0.16s,
    background-color 0.16s,
    box-shadow 0.16s;
}
.scene-design-grid textarea:hover {
  border-color: var(--editor-border-hover);
  background: var(--editor-bg-hover);
}
.scene-design-grid textarea:focus {
  border-color: var(--editor-focus);
  background: var(--editor-bg-hover);
  box-shadow: 0 0 0 3px #8b5cf620;
}
.scene-list.view-table .scene-design {
  display: none;
}
html[data-theme="light"] .scene-group-head {
  background: linear-gradient(90deg, #f1f5f9, #fff);
  border-color: #d7dee9;
}
html[data-theme="light"] .scene-group-head input[data-scene-title],
html[data-theme="light"] .scene-design-grid textarea {
  background: #fff;
  color: #273449;
  border-color: #cbd5e1;
}
html[data-theme="light"] .scene-shot-count {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}
html[data-theme="light"] .scene-design {
  background: #f8fafc;
  border-color: #d7dee9;
}
html[data-theme="light"] .scene-design > summary {
  color: #475569;
}
@media (max-width: 900px) {
  .scene-group-head {
    flex-wrap: wrap;
  }
  .scene-group-head input[data-scene-title] {
    flex: 1 1 240px;
  }
  .scene-header-environment {
    order: 4;
    flex: 1 1 calc(100% - 100px);
    width: auto;
    min-width: 220px;
    margin-left: 42px;
  }
  .scene-header-actions {
    margin-left: auto;
  }
}
@media (max-width: 620px) {
  .scene-overview-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }
  .scene-overview-head {
    gap: 7px;
  }
  .scene-overview-title {
    font-size: 12px;
  }
  .scene-group-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }
  .scene-group-head input[data-scene-title] {
    grid-column: 2;
    min-width: 0;
    width: 100%;
  }
  .scene-header-actions {
    grid-column: 3;
    grid-row: 1;
    margin: 0;
  }
  .scene-header-environment {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .scene-design-grid {
    grid-template-columns: 1fr;
  }
  .scene-design-grid textarea {
    height: auto;
  }
  .scene-shot-count {
    display: none;
  }
}
/* Scene construction: app-wide control standard */
#scenes {
  --scene-control-height: var(--ui-control-height);
  --scene-control-radius: var(--ui-radius-control);
  --scene-control-font: var(--fs-control);
  --scene-label-font: var(--fs-small);
  --scene-control-bg: var(--editor-bg);
  --scene-control-border: var(--editor-border);
  --scene-control-hover: var(--editor-bg-hover);
}
#scenes .audio-panel {
  border-color: #30384a;
  border-radius: var(--ui-radius-group);
  background: #0b0f16;
  box-shadow: none;
}
#scenes .audio-analysis-workstation {
  border-color: #30384a;
  border-radius: var(--ui-radius-group);
  background: #0b0f16;
}
#scenes .lrc-head strong {
  color: var(--text);
  font-size: var(--scene-label-font);
  font-weight: 800;
}
#scenes .lrc-head .lrc-progress {
  color: var(--muted);
  font-size: 11px;
}
#scenes .lrc-controls {
  gap: 8px;
}
#scenes .lrc-controls label {
  gap: 6px;
  color: var(--text-secondary);
  font-size: var(--scene-label-font);
  font-weight: 700;
}
#scenes .lrc-controls select,
#scenes .lrc-controls input {
  box-sizing: border-box;
  height: var(--scene-control-height);
  min-height: var(--scene-control-height);
  border: 1px solid var(--scene-control-border);
  border-radius: var(--scene-control-radius);
  background: var(--scene-control-bg);
  color: var(--text);
  padding: 7px 10px;
  font-family: inherit;
  font-size: var(--scene-control-font);
  outline: 0;
  box-shadow: none;
}
#scenes .lrc-controls select:hover,
#scenes .lrc-controls input:hover {
  border-color: #46526a;
  background: var(--scene-control-hover);
}
#scenes .lrc-controls select:focus,
#scenes .lrc-controls input:focus {
  border-color: #8b5cf6;
  background: var(--scene-control-hover);
  box-shadow: 0 0 0 3px #8b5cf620;
}
#scenes .lrc-line {
  min-height: 40px;
  grid-template-columns: 34px 108px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 9px;
  border-color: var(--scene-control-border);
  border-radius: var(--scene-control-radius);
  background: var(--scene-control-bg);
  color: var(--text-secondary);
}
#scenes .lrc-line:hover {
  border-color: #46526a;
  background: var(--scene-control-hover);
}
#scenes .lrc-line .lrc-no {
  font-size: 10px;
}
#scenes .lrc-line input {
  box-sizing: border-box;
  width: 100%;
  height: 32px;
  border: 1px solid var(--scene-control-border);
  border-radius: 7px;
  background: #0a0e15;
  color: #a5f3fc;
  padding: 6px 8px;
  font-size: 11px;
}
#scenes .lrc-line .lrc-text {
  font-size: var(--scene-control-font);
}
#scenes .audio-structure-counts {
  gap: 10px;
  padding: 12px 14px 14px;
}
#scenes .audio-structure-counts .recommendation {
  min-height: var(--scene-control-height);
  padding: 7px 10px;
  border: 1px solid #3b4660;
  border-radius: var(--scene-control-radius);
  background: #111827;
  color: var(--text-secondary);
  font-size: 11px;
}
#scenes .audio-structure-counts .recommendation b {
  color: #c4b5fd;
  font-size: 11px;
}
#scenes .audio-structure-counts .recommendation span {
  color: var(--muted);
  font-size: 10px;
}
#scenes .audio-structure-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 14px;
  flex-wrap: wrap;
}
#scenes .structure-action-row {
  gap: 8px;
}
#scenes .structure-action-row .btn,
#scenes #reset-timing {
  width: auto;
  min-width: 0;
}
#scenes .view-toolbar {
  min-height: 40px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
#scenes .view-toolbar #generate-all-images {
  margin-left: 4px;
}
#scenes .view-toggle {
  box-sizing: border-box;
  min-height: 36px;
  border-color: var(--scene-control-border);
  border-radius: var(--scene-control-radius);
  background: var(--scene-control-bg);
}
#scenes .view-toggle button {
  min-height: 28px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
#scenes .view-toggle button.active {
  background: #292f42;
  color: #fff;
}
html[data-theme="light"] #scenes {
  --scene-control-bg: #fff;
  --scene-control-border: #cbd5e1;
  --scene-control-hover: #f8fafc;
}
html[data-theme="light"] #scenes .audio-panel,
html[data-theme="light"] #scenes .audio-analysis-workstation {
  border-color: #d7dee9;
  background: #fff;
}
html[data-theme="light"] #scenes .lrc-controls select,
html[data-theme="light"] #scenes .lrc-controls input,
html[data-theme="light"] #scenes .lrc-line {
  background: #fff;
  color: #334155;
  border-color: #cbd5e1;
}
html[data-theme="light"] #scenes .lrc-line input {
  background: #fff;
  color: #0e7490;
  border-color: #cbd5e1;
}
html[data-theme="light"] #scenes .audio-structure-counts .recommendation {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}
html[data-theme="light"] #scenes .audio-structure-counts .recommendation b {
  color: #5b21b6;
}
html[data-theme="light"] #scenes .view-toggle {
  background: #fff;
  border-color: #cbd5e1;
}
html[data-theme="light"] #scenes .view-toggle button.active {
  background: #ede9fe;
  color: #5b21b6;
}
@media (max-width: 760px) {
  #scenes .structure-action-row .btn,
  #scenes #reset-timing {
    width: 100%;
  }
  #scenes .audio-structure-actions {
    align-items: stretch;
  }
  #scenes .view-toolbar .view-label {
    order: 1;
    width: 100%;
  }
  #scenes .view-toolbar #generate-all-images {
    order: 2;
    width: 100%;
    margin-left: 0;
  }
  #scenes .view-toolbar .view-toggle {
    order: 3;
    width: 100%;
  }
  #scenes .view-toolbar .view-toggle button {
    flex: 1;
  }
  #scenes .lrc-line {
    grid-template-columns: 28px 96px minmax(0, 1fr);
  }
}
/* Concept workflow: settings → lyrics/direction → treatment → story */
.concept-editor-right {
  grid-template-rows: minmax(0, 1fr);
}
body[data-stage="concept"] #concept .concept-editor-right {
  grid-template-rows: minmax(0, 1fr) !important;
}
body[data-stage="concept"] #concept .concept-editor-right > .field {
  display: flex;
  min-height: 0;
  flex-direction: column;
}
body[data-stage="concept"] #concept .concept-editor-right .text-window {
  display: flex;
  flex: 1;
  min-height: 0;
}
body[data-stage="concept"] #concept #direction {
  flex: 1;
  height: 100%;
  min-height: 0;
}
.creative-treatment,
.concept-story-final {
  margin-top: var(--space-panel);
  padding: var(--space-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
}
.creative-treatment-head {
  min-height: 38px;
  margin: -4px 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.creative-treatment-head strong {
  color: var(--text);
  font-size: var(--fs-title);
  font-weight: 800;
}
.creative-treatment-head span {
  color: var(--muted);
  font-size: var(--fs-caption);
}
.creative-treatment-grid {
  gap: var(--space-toolbar);
}
.creative-treatment-grid .field > label,
.concept-story-final .field-title-row label {
  color: var(--text-secondary);
  font-size: var(--fs-small);
}
.creative-treatment :is(textarea, input),
.concept-story-final textarea {
  border-color: var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-raised);
  color: var(--text);
  font-size: var(--fs-body);
}
.creative-treatment :is(textarea, input)::placeholder,
.concept-story-final textarea::placeholder {
  color: var(--muted-soft);
}
.creative-treatment-actions .btn {
  height: auto;
}
.concept-story-final > .field {
  display: flex;
  min-height: 0;
  flex-direction: column;
}
.concept-story-final .field-title-row {
  min-height: 38px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.concept-story-final .text-window {
  display: flex;
  min-height: 280px;
}
.concept-story-final #story,
body[data-stage="concept"] #concept .concept-story-final #story {
  width: 100%;
  height: auto;
  min-height: 280px;
  resize: vertical;
}
html[data-theme="light"] .creative-treatment,
html[data-theme="light"] .concept-story-final {
  border-color: #d7dee9;
  background: #fff;
  color: #1e293b;
}
html[data-theme="light"] .creative-treatment-head,
html[data-theme="light"] .concept-story-final .field-title-row {
  border-color: #dbe2ec;
}
html[data-theme="light"] .creative-treatment-head strong {
  color: #1e293b;
}
html[data-theme="light"] .creative-treatment-head span {
  color: #64748b;
}
html[data-theme="light"] .creative-treatment-grid .field > label,
html[data-theme="light"] .concept-story-final .field-title-row label {
  color: #475569;
}
html[data-theme="light"] .creative-treatment :is(textarea, input),
html[data-theme="light"] .concept-story-final textarea {
  border-color: #cbd5e1;
  background: #fff;
  color: #273449;
}
.scene-reconfigure-status {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-small);
}
.scene-reconfigure-status.show {
  display: flex;
}
.scene-reconfigure-status:before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}
.scene-reconfigure-status.running:before {
  animation: queuePulse 1s ease-in-out infinite;
}
.scene-reconfigure-status.success:before {
  background: var(--green);
}
.scene-reconfigure-status.error {
  border-color: #fb718566;
  color: #fda4af;
}
.scene-reconfigure-status.error:before {
  background: var(--red);
}
html[data-theme="light"] .scene-reconfigure-status {
  border-color: #d7dee9;
  background: #fff;
  color: #475569;
}
html[data-theme="light"] .scene-reconfigure-status.error {
  border-color: #fda4af;
  background: #fff1f2;
  color: #be123c;
}
@media (max-width: 760px) {
  .concept-story-final .text-window,
  .concept-story-final #story {
    min-height: 320px;
  }
  .creative-treatment,
  .concept-story-final {
    padding: 16px;
    border-radius: 16px;
  }
}
.lrc-line.music-only {
  border-style: dashed;
  background: #101725;
}
.lrc-line.music-only .lrc-text {
  color: #c4b5fd;
  font-weight: 760;
}
.lrc-line.music-only .lrc-no:after {
  content: "♪";
  margin-left: 3px;
  color: #a78bfa;
}
.lrc-line.auto-start {
  cursor: pointer;
}
.lrc-line.auto-start input:disabled {
  opacity: 0.8;
  cursor: default;
}
.lyrics-start-mode {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #2b3548;
  border-radius: 9px;
  background: #0c121c;
}
.lyrics-start-mode > span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 720;
}
.lyrics-start-options {
  display: inline-flex;
  padding: 2px;
  border: 1px solid #303a4d;
  border-radius: 8px;
  background: #080d15;
}
.lyrics-start-options button {
  min-height: 29px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8994a8;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}
.lyrics-start-options button.active {
  background: #6d4bf3;
  color: #fff;
  box-shadow: 0 3px 12px #6d4bf340;
}
html[data-theme="light"] .lrc-line.music-only {
  background: #f5f3ff;
}
html[data-theme="light"] .lrc-line.music-only .lrc-text {
  color: #6d28d9;
}
html[data-theme="light"] .lyrics-start-mode {
  border-color: #d6deea;
  background: #f8fafc;
}
html[data-theme="light"] .lyrics-start-mode > span {
  color: #475569;
}
html[data-theme="light"] .lyrics-start-options {
  border-color: #cbd5e1;
  background: #fff;
}
html[data-theme="light"] .lyrics-start-options button {
  color: #64748b;
}
html[data-theme="light"] .lyrics-start-options button.active {
  background: #5b46d8;
  color: #fff;
}
/* Concept workflow: lyrics | direction + treatment, followed by full-width story. */
@media (min-width: 761px) {
  body[data-stage="concept"] #concept.active-panel {
    min-height: 0;
  }
  body[data-stage="concept"] #concept > .card-body {
    display: block;
    min-height: 0;
  }
  body[data-stage="concept"] #concept .concept-editor-grid {
    min-height: 1280px;
    align-items: stretch;
  }
  body[data-stage="concept"] #concept .lyrics-field,
  body[data-stage="concept"] #concept .lyrics-field .text-window,
  body[data-stage="concept"] #concept .lyrics-field #lyrics {
    height: 100%;
    min-height: 1280px;
  }
  body[data-stage="concept"] #concept .concept-editor-right {
    display: grid;
    height: 100%;
    min-height: 1280px;
    grid-template-rows: minmax(150px, 1fr) minmax(0, 7fr) !important;
    gap: 18px;
  }
  body[data-stage="concept"] #concept .concept-editor-right > .field {
    display: flex;
    height: auto;
    min-height: 0;
    flex-direction: column;
  }
  body[data-stage="concept"]
    #concept
    .concept-editor-right
    > .field
    .text-window {
    display: flex;
    flex: 1;
    height: auto;
    min-height: 0;
  }
  body[data-stage="concept"] #concept #direction {
    flex: 1;
    height: 100%;
    min-height: 110px;
  }
  body[data-stage="concept"]
    #concept
    .concept-editor-right
    > .creative-treatment {
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: visible;
  }
  body[data-stage="concept"] #concept .creative-treatment-grid,
  body[data-stage="concept"] #concept .emotional-arc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-stage="concept"] #concept .creative-treatment-grid .wide {
    grid-column: auto;
  }
  body[data-stage="concept"] #concept .concept-story-final {
    width: 100%;
    min-height: 560px;
  }
  body[data-stage="concept"] #concept .concept-story-final .text-window,
  body[data-stage="concept"] #concept .concept-story-final #story {
    min-height: 500px;
  }
}
@media (max-width: 760px) {
  body[data-stage="concept"] #concept .lyrics-field #lyrics {
    height: 720px;
    min-height: 720px;
  }
  body[data-stage="concept"] #concept .concept-editor-right {
    display: grid;
    grid-template-rows: auto auto !important;
    gap: 18px;
  }
  body[data-stage="concept"] #concept #direction {
    height: 180px;
    min-height: 180px;
  }
  body[data-stage="concept"]
    #concept
    .concept-editor-right
    > .creative-treatment {
    margin: 0;
  }
  body[data-stage="concept"] #concept .concept-story-final .text-window,
  body[data-stage="concept"] #concept .concept-story-final #story {
    min-height: 420px;
  }
}
.timing-input-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
}
.timing-input-tab {
  min-width: 76px;
  height: 30px;
  padding: 4px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 800;
  cursor: pointer;
}
.timing-input-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.timing-input-pane.hidden {
  display: none;
}
.timing-input-pane {
  display: flex;
  height: 420px;
  min-height: 420px;
  flex-direction: column;
  overflow: hidden;
}
.timing-input-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-caption);
  font-variant-numeric: tabular-nums;
}
.cut-timing-controls,
.timing-input-pane .lrc-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.timing-input-pane .lrc-lines,
.cut-timing-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.cut-timing-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-content: start;
  gap: 7px;
  margin-top: 10px;
}
.cut-timing-empty {
  grid-column: 1/-1;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--control-radius);
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: center;
}
.cut-timing-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-raised);
}
.cut-timing-item > span {
  color: var(--muted);
  font-size: var(--fs-caption);
  font-weight: 800;
}
.cut-timing-item input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font:
    11px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.cut-timing-delete {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
}
.audio-timeline .timeline-manual-cut {
  stroke: #f59e0b;
  stroke-width: 1.5;
  pointer-events: none;
}
.audio-timeline .timeline-manual-cut-handle {
  fill: #f59e0b;
  pointer-events: none;
}
.audio-timeline.timing-tab-lrc .timeline-manual-cut,
.audio-timeline.timing-tab-lrc .timeline-manual-cut-handle {
  opacity: 0.34;
}
.audio-timeline.timing-tab-cut .timeline-lyric-marker,
.audio-timeline.timing-tab-cut .timeline-lyric-marker-label {
  opacity: 0.28;
}
.cut-timing-item.playing {
  border-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 12%, var(--surface-raised));
  box-shadow: 0 0 0 2px #f59e0b24;
}
.audio-rate-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-caption);
}
.audio-rate-control select {
  height: 30px;
  padding: 3px 24px 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: var(--fs-small);
}
html[data-theme="light"] .timing-input-tabs {
  background: #f1f5f9;
}
@media (max-width: 760px) {
  .timing-input-pane {
    height: 480px;
    min-height: 480px;
  }
  .cut-timing-controls > .btn,
  .timing-input-pane .lrc-controls > .btn {
    flex: 1 1 auto;
  }
  .cut-timing-list {
    grid-template-columns: 1fr;
  }
}
#structure-recommendation {
  position: relative;
  overflow: visible;
}
.structure-help {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.structure-help-button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  cursor: help;
}
.structure-help-button:hover,
.structure-help-button:focus-visible,
.structure-help.open .structure-help-button {
  border-color: var(--accent);
  color: var(--accent);
}
.structure-help-tooltip {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 10px);
  display: block;
  width: min(390px, calc(100vw - 48px));
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  box-shadow: var(--shadow);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.65;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition:
    opacity 0.14s,
    transform 0.14s,
    visibility 0.14s;
  pointer-events: none;
}
.structure-help-tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: var(--fs-small);
}
.structure-help-tooltip p {
  margin: 0;
}
.structure-help-tooltip p + p {
  margin-top: 7px;
}
.structure-help:hover .structure-help-tooltip,
.structure-help:focus-within .structure-help-tooltip,
.structure-help.open .structure-help-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
html[data-theme="light"] .structure-help-tooltip {
  background: #fff;
}
@media (max-width: 760px) {
  .structure-help-tooltip {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 18px;
    width: auto;
    transform: translateY(8px);
  }
  .structure-help:hover .structure-help-tooltip,
  .structure-help:focus-within .structure-help-tooltip,
  .structure-help.open .structure-help-tooltip {
    transform: none;
  }
}
