/* 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);
  content-visibility: auto;
  contain-intrinsic-size: auto 310px;
}
.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 auto;
  border-color: var(--entity-border);
  background: var(--entity-surface);
}
.animatic-subtitle-option {
  align-self: center;
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px !important;
  max-width: 170px;
}
.animatic-subtitle-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
}
body.animatic-running :is(.topbar, .sidebar, main > section:not(#storyboard), #storyboard > .card-head, #storyboard .panel-description, #storyboard .panel-toolbar, #preflight-panel, #queue-drawer) {
  pointer-events: none;
  user-select: none;
}
.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;
  }
}
