:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--ui-black);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 12px max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--ui-ink-4);
  background: rgba(5, 16, 12, .92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand > span:last-child { display: grid; gap: 2px; }
.brand small { color: var(--ui-muted-2); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--ui-ink-2);
  background: var(--ui-muted);
  font-size: 13px;
  font-weight: 900;
}
.settings-link {
  padding: 10px 15px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  color: var(--ui-text);
  background: transparent;
  font: inherit;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}
.settings-link:hover { border-color: var(--ui-muted); background: var(--ui-ink-2); }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 9px; }
.runtime-settings-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  display: grid;
  gap: 12px;
  width: min(350px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  background: var(--ui-ink-2);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
}
.runtime-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.runtime-settings-heading > div { display: grid; gap: 3px; }
.runtime-settings-heading small { color: var(--ui-muted); }
.runtime-settings-heading button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-4);
  font-size: 20px;
  cursor: pointer;
}
.runtime-settings-popover label { display: grid; gap: 6px; color: var(--ui-muted); font-size: 13px; font-weight: 800; }
.runtime-settings-popover select, #defaultDownloadDirectory, #systemDownloadDirectory {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  font: inherit;
}
.runtime-settings-popover .primary-button { width: 100%; min-height: 42px; }
.runtime-settings-popover > a { color: var(--ui-muted); text-align: center; font-size: 13px; }
.runtime-settings-popover .status-message { margin-top: 0; font-size: 13px; }
#runtimeSettingsPopover { max-height: calc(100vh - 82px); overflow-y: auto; }
#downloadDirectoryStatus, #storageDirectoryStatus { overflow-wrap: anywhere; }
.directory-actions { display: flex; gap: 8px; }
.directory-actions button { flex: 1; }
#previousStorageDirectoryButtons { display: grid; gap: 8px; padding: 12px; }
#previousStorageDirectoryButtons button { min-width: 0; overflow-wrap: anywhere; text-align: left; }
#licensePanel > div, #licenseForm { display: grid; gap: 8px; }
#licensePanel > div { padding: 12px; }
#licensePanel p { margin: 0; overflow-wrap: anywhere; }
#licenseForm input { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--ui-line-strong); border-radius: 6px; color: var(--ui-text); background: var(--ui-ink-2); font: inherit; }
.bailian-settings, #bailianSettingsForm { display: grid; gap: 8px; }
.bailian-settings { padding-bottom: 14px; border-bottom: 1px solid var(--ui-line-strong); }
.bailian-settings p { margin: 0; overflow-wrap: anywhere; }
.bailian-settings a { color: var(--ui-text); font-size: 13px; }
#bailianApiKey { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--ui-line-strong); border-radius: 6px; color: var(--ui-text); background: var(--ui-ink-2); font: inherit; }
.bailian-settings-actions { display: flex; gap: 8px; }
.bailian-settings-actions .primary-button { flex: 1; width: auto; }
.bailian-settings-actions .secondary-button { flex-shrink: 0; }
.libtv-account-actions { display: grid; gap: 8px; }
.libtv-account-actions button { width: 100%; }
.libtv-account-picker { margin-bottom: 10px; }

main { width: min(1160px, calc(100% - 32px)); margin: 38px auto 64px; }
.hero { margin-bottom: 24px; }
.hero h1 { margin: 6px 0 10px; font-size: clamp(30px, 5vw, 48px); }
.hero > p:last-child { margin: 0; color: var(--ui-muted); }
.eyebrow {
  margin: 0;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .11em;
}

.panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 18px;
  background: rgba(8, 25, 19, .90);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
}
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-heading h2 { margin: 5px 0 7px; font-size: 27px; }
.section-heading p:not(.eyebrow), .subheading p { margin: 0; color: var(--ui-muted); }
.badge {
  flex: 0 0 auto;
  padding: 6px 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  color: var(--ui-muted);
  background: var(--ui-ink-2);
  font-size: 12px;
  font-weight: 850;
}
.badge.complete, .badge.ok { border-color: var(--ui-muted-2); color: var(--ui-muted); }

.audio-tools { border-color: var(--ui-line-strong); }
.audio-tools-heading { margin-bottom: 10px; }
.audio-tools-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.secondary-button {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.secondary-button:disabled { opacity: .5; cursor: wait; }
.secondary-button[aria-disabled="true"] { opacity: .48; cursor: default; pointer-events: none; }
#audioServiceFrame {
  width: 100%;
  height: min(72vh, 780px);
  min-height: 520px;
  margin-top: 16px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 12px;
  background: #fff;
}

.task-audio { margin-top: 22px; padding: 18px; border: 1px solid var(--ui-line-strong); border-radius: 14px; background: var(--ui-ink-2); }
.task-audio-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.task-audio-heading h3 { margin: 0 0 6px; }
.task-audio-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.task-audio-voices { display: grid; gap: 7px; margin-top: 15px; color: var(--ui-muted); }
#taskAudioVoices { color: var(--ui-muted); }
.task-audio-selection select, .task-audio-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.task-audio-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.task-audio-modes article { padding: 15px; border: 1px solid var(--ui-line-strong); border-radius: 12px; background: var(--ui-ink-2); }
.task-audio-modes p { min-height: 42px; margin: 7px 0 13px; color: var(--ui-muted); }
.task-audio-field { display: grid; gap: 6px; color: var(--ui-muted); font-weight: 750; }
.task-audio-preview { width: 100%; min-height: 40px; }
.task-audio-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.task-audio-metrics span {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-muted);
  background: var(--ui-ink-2);
}
.task-audio-metrics output { color: var(--ui-text); font-weight: 800; }
.task-audio-accompaniment { display: flex; align-items: center; gap: 9px; color: var(--ui-muted); }
.task-audio-accompaniment input { width: 20px; min-height: 20px; margin: 0; }
#taskAudioAccompanimentHelp { display: block; margin: 5px 0 0; color: var(--ui-muted); }
.task-audio-rows { display: grid; gap: 10px; margin: 12px 0; }
.task-audio-authorization { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--ui-muted); }
.task-audio-authorization input { width: 20px; min-height: 20px; margin: 0; }
.task-audio-row { display: grid; gap: 7px; padding: 11px; border: 1px solid var(--ui-line-strong); border-radius: 9px; background: var(--ui-ink-2); }
.task-audio-row p { min-height: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#taskAudioGeneratedReason { overflow-wrap: anywhere; }
.task-audio-row label { display: grid; gap: 6px; color: var(--ui-muted); font-weight: 750; }
.task-audio-row textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 9px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.copy-review {
  margin: 16px 0 0;
  padding: 17px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.copy-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.copy-review-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.copy-review-options label { display: grid; gap: 6px; color: var(--ui-muted); font-weight: 750; }
.copy-review-options select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.copy-review-column-labels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 11px -5px;
  color: var(--ui-muted-2);
}
.copy-review .task-audio-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.copy-review-row-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.copy-review-row-heading label { min-width: 128px; }
.copy-review-row-heading select {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.copy-review-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.copy-dialogue-settings { display: grid; gap: 5px; margin: 9px 0; font-size: 12px; }
.copy-dialogue-settings[hidden] { display: none; }
.copy-dialogue-settings label { display: flex; align-items: center; gap: 7px; }
.copy-dialogue-settings input[type="checkbox"] { width: auto; }
.copy-dialogue-settings small { color: var(--ui-muted); line-height: 1.5; }
.dialogue-segment-column, .dialogue-segment-editor { display: grid; min-width: 0; gap: 8px; }
.dialogue-segment { display: grid; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--ui-line-strong); border-radius: 8px; background: var(--ui-ink-2); }
.dialogue-segment > strong { font-size: 12px; color: var(--ui-muted); }
.dialogue-segment-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dialogue-segment input, .dialogue-segment select { width: 100%; min-width: 0; box-sizing: border-box; min-height: 32px; padding: 6px 8px; border: 1px solid var(--ui-line-strong); border-radius: 6px; color: var(--ui-text); background: var(--ui-ink-1); font: inherit; }
.dialogue-segment audio { width: 100%; height: 32px; }
.dialogue-segment [hidden] { display: none; }
.dialogue-segment-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.dialogue-segment-actions button, .dialogue-segment-editor > button { min-height: 30px; padding: 6px 9px; font-size: 12px; }
.task-audio-confirmed-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-ink-2);
}
.task-audio-confirmed-copy p { margin: 5px 0 0; color: var(--ui-muted); white-space: pre-wrap; }
#taskAudioAdopted { width: 100%; margin: 2px 0 12px; }

.whole-video-setup {
  margin-bottom: 16px;
  padding: 15px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.whole-video-setup-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.whole-video-setup-heading h3 { margin: 0 0 5px; font-size: 20px; }
.whole-video-setup-heading p { margin: 0; color: var(--ui-muted); }
.global-reference-file input {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.global-reference-file input::file-selector-button {
  margin-right: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  color: var(--ui-ink-2);
  background: var(--ui-muted);
  font-weight: 800;
  cursor: pointer;
}
.global-target-input-grid small { color: var(--ui-muted); }
.global-reference-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.global-reference-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--ui-ink-4);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  font-size: 12px;
}
.global-reference-item.pending-reference-item,
.global-reference-item.saved-reference-item {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}
.global-reference-item.is-removed {
  color: var(--ui-muted-2);
  border-style: dashed;
  opacity: .78;
}
.global-reference-thumb {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--ui-ink-2);
}
.global-reference-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-reference-remove {
  padding: 4px 6px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 6px;
  color: var(--ui-text);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.global-reference-remove:hover:not(:disabled) { background: var(--ui-ink-4); }
.global-reference-remove:disabled { opacity: .45; cursor: default; }
.whole-video-setup-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.whole-video-setup .status-message { margin-bottom: 0; }
.auxiliary-reference-fold { margin-top: 12px; }
.auxiliary-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}
.auxiliary-reference-grid .target-input-card > strong { color: var(--ui-text); }

.import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.file-picker { display: grid; gap: 8px; font-weight: 750; }
.file-picker input {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.file-picker input::file-selector-button {
  margin-right: 12px;
  padding: 9px 13px;
  border: 0;
  border-radius: 8px;
  color: var(--ui-ink-2);
  background: var(--ui-muted);
  font-weight: 800;
  cursor: pointer;
}
.primary-button {
  min-width: 150px;
  min-height: 46px;
  padding: 12px 20px;
  border: 0;
  border-radius: 11px;
  color: var(--ui-ink-2);
  background: var(--ui-muted);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}
.primary-button:disabled { opacity: .55; cursor: wait; }
.status-message { min-height: 20px; margin: 14px 0 0; color: var(--ui-muted); }
.status-message.error { color: #ffaaa5; }

.task-heading { align-items: center; }
.task-identity { display: grid; gap: 7px; min-width: min(360px, 100%); margin: 0; }
.task-identity div { display: grid; grid-template-columns: 60px 1fr; gap: 10px; }
.task-identity dt { color: var(--ui-muted-2); }
.task-identity dd { margin: 0; overflow-wrap: anywhere; color: var(--ui-text); }
.one-click-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--ui-muted-2);
  border-radius: 14px;
  background: var(--ui-ink-2);
}
.one-click-progress h3 { margin: 0 0 5px; font-size: 20px; }
.one-click-progress .status-message { margin: 0; }
.workflow-progress { display: grid; gap: 5px; margin-top: 10px; }
.workflow-progress progress {
  width: min(420px, 100%);
  height: 9px;
  accent-color: var(--ui-muted);
}
.workflow-progress small { color: var(--ui-muted); }
.one-click-controls {
  display: flex;
  align-items: end;
  flex: 0 1 640px;
  flex-wrap: wrap;
  gap: 10px;
}
.one-click-model { display: grid; flex: 1; gap: 5px; color: var(--ui-muted); font-weight: 750; }
.one-click-model select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.one-click-model small { color: var(--ui-muted); font-size: 11px; font-weight: 500; }
.one-click-last-error { margin-top: 6px !important; overflow-wrap: anywhere; }
.one-click-target { outline: 2px solid var(--ui-muted); outline-offset: 4px; }
.source-overview, .shots-section { padding-top: 19px; border-top: 1px solid var(--ui-ink-4); }
.subheading { margin-bottom: 13px; }
.subheading h3 { margin: 0 0 5px; font-size: 21px; }
#sourceVideo {
  display: block;
  width: 100%;
  max-height: 560px;
  border-radius: 13px;
  background: var(--ui-ink-2);
}

.waiting-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.waiting-card strong { font-size: 17px; }
.waiting-card p { margin: 5px 0 0; color: var(--ui-muted); }
.waiting-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  color: var(--ui-ink-2);
  background: var(--ui-muted);
  font-size: 20px;
  font-weight: 900;
}
.shots-section { margin-top: 22px; }
.shot-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--ui-line-strong);
  border-radius: 12px;
  background: var(--ui-ink-2);
}
.shot-tab {
  display: grid;
  flex: 0 0 min(260px, 74vw);
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ui-muted);
  background: transparent;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.shot-tab-title { font-size: 15px; }
.shot-tab-range { font-size: 13px; font-weight: 650; }
.shot-tab-frames { font-size: 12px; font-weight: 650; opacity: .78; }
.shot-tab:hover { border-color: var(--ui-line-strong); }
.shot-tab.selected { border-color: var(--ui-muted); color: var(--ui-ink-2); background: var(--ui-muted); }
.shot-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.shot-compare figure { min-width: 0; margin: 0; }
.shot-compare figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ui-muted);
  font-size: 13px;
}
.shot-compare figcaption span { color: var(--ui-muted-2); }
.shot-current-only { grid-template-columns: minmax(0, 1fr); }
.shot-current-only .shot-source-range {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  color: var(--ui-muted);
  font-size: 13px;
}
.shot-current-only .current-shot-player { width: 100%; }
.video-shell {
  display: grid;
  place-items: center;
  min-height: 0;
  height: clamp(260px, 42vh, 420px);
  overflow: hidden;
  border: 1px solid var(--ui-ink-4);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.video-shell video { width: 100%; height: 100%; object-fit: contain; }
.shot-flow-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.shot-flow-action h4 { margin: 0 0 5px; font-size: 17px; }
.shot-flow-action .status-message { margin: 0; }
.shot-flow-action button { flex: 0 0 auto; }
.image-preparation {
  margin: 16px 0 0;
  padding: 17px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.image-preparation legend { padding: 0 7px; color: var(--ui-text); font-size: 18px; font-weight: 850; }
.image-preparation-help { margin: 0 0 13px; color: var(--ui-muted); }
.frame-selection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.frame-selection {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-ink-2);
}
.frame-selection output { color: var(--ui-muted); font-size: 13px; }
.frame-actions { display: flex; gap: 7px; }
.frame-actions button {
  padding: 7px 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  cursor: pointer;
}
.frame-actions button:last-child { color: var(--ui-muted); background: transparent; }
.frame-actions button:disabled { opacity: .45; cursor: default; }
.prepared-frame-strip {
  display: grid;
  gap: 10px;
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-ink-2);
}
.prepared-frame-heading h4 { margin: 0 0 4px; }
.prepared-frame-heading p { margin: 0; color: var(--ui-muted); }
.prepared-frame-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.prepared-frame-card {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: #111;
}
.prepared-frame-open {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #fff;
  background: #090909;
  text-align: left;
  cursor: pointer;
}
.prepared-frame-open.selected { border-color: #fff; }
.prepared-frame-open img,
.prepared-frame-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 9 / 12;
  place-items: center;
  object-fit: contain;
  color: #999;
  background: #000;
}
.prepared-frame-open strong,
.prepared-frame-open small { padding-inline: 9px; }
.prepared-frame-open small { padding-bottom: 9px; color: #aaa; }
.prepared-frame-remove { width: 100%; padding: 6px 9px; }
.prepared-frame-empty { grid-column: 1 / -1; margin: 0; color: #888; }
.reference-library {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-ink-2);
}
.reference-library-heading { display: flex; justify-content: space-between; gap: 14px; }
.reference-library h4 { margin: 0 0 4px; }
.reference-library p { margin: 0; color: var(--ui-muted); }
.reference-binding-summary {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: #111;
}
.reference-binding-summary-list { display: grid; gap: 7px; }
.reference-binding-summary-row {
  display: grid;
  grid-template-columns: minmax(52px, auto) minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #aaa;
}
.reference-binding-summary-row > strong { color: #fff; }
.reference-binding-summary-row > span { overflow-wrap: anywhere; }
.reference-binding-fold { margin-top: 12px; }
.reference-binding-editor { display: grid; gap: 10px; padding: 0 12px 12px; }
.reference-binding-editor .reference-list { margin-top: 0; }
.target-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.target-input-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  background: var(--ui-ink-2);
}
.target-input-card > label { display: grid; gap: 6px; color: var(--ui-muted); }
.target-input-card textarea {
  width: 100%;
  resize: vertical;
  padding: 9px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.target-toggle { display: flex !important; align-items: center; gap: 7px; }
.target-toggle input { accent-color: var(--ui-muted); }
.reference-upload { display: flex; align-items: center; gap: 8px; }
.reference-upload select, .reference-upload input, .reference-upload button {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.reference-upload input { max-width: 230px; }
.target-input-card .reference-upload input { width: 100%; max-width: none; }
.reference-upload button { cursor: pointer; }
.reference-upload button:disabled { opacity: .45; cursor: default; }
.image-region-fold { margin-top: 13px; }
.image-region-editor { display: grid; gap: 11px; padding: 0 12px 12px; }
.image-region-heading,
.image-candidate-history-heading,
.scene-expansion-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.image-region-heading h4,
.image-candidate-history-heading h5,
.scene-expansion-heading h5 { margin: 0 0 4px; font-size: 16px; }
.image-region-heading p,
.image-candidate-history-heading p,
.scene-expansion-heading p { margin: 0; color: var(--ui-muted); }
.image-region-source-row { display: flex; align-items: end; gap: 9px; }
.image-region-source-row label { display: grid; flex: 1; gap: 6px; color: var(--ui-muted); }
.image-region-source-row select,
.image-region-controls select,
.image-region-controls input {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.image-region-stage {
  display: grid;
  min-height: 220px;
  max-height: 440px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-ink-2);
}
.image-region-stage canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  cursor: crosshair;
  touch-action: none;
}
.image-region-stage p { color: var(--ui-muted-2); }
.image-region-controls {
  display: grid;
  grid-template-columns: minmax(130px, .5fr) minmax(260px, 1.5fr) auto auto;
  gap: 9px;
  align-items: end;
}
.image-region-controls label { display: grid; gap: 6px; color: var(--ui-muted); }
.image-region-list { display: flex; flex-wrap: wrap; gap: 7px; }
.image-region-chip {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
}
.image-region-chip.edit { border-color: #ff8a83; }
.image-region-chip.protect { border-color: var(--ui-line-strong); }
.image-region-chip.selected { box-shadow: 0 0 0 2px #a9906733; }
.image-region-chip button {
  border: 0;
  border-radius: 0;
  padding: 6px 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  cursor: pointer;
}
.image-region-chip .danger-button { color: #ffb4aa; background: #2c1816; }
.reference-targets input { accent-color: var(--ui-muted); }
.reference-list { display: grid; gap: 9px; margin-top: 10px; }
.reference-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  background: var(--ui-ink-2);
}
.reference-card img { width: 72px; height: 72px; border-radius: 7px; object-fit: cover; background: var(--ui-ink-2); }
.reference-card-body { display: grid; gap: 6px; min-width: 0; }
.reference-card-body strong { overflow-wrap: anywhere; }
.reference-card-body small { color: var(--ui-muted); }
.reference-targets { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.reference-targets label { display: flex; align-items: center; gap: 5px; color: var(--ui-muted); }
.background-choice { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--ui-text); }
.background-choice input { accent-color: var(--ui-muted); }
.subtitle-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 13px;
  padding: 12px;
  border-radius: 10px;
  background: var(--ui-ink-2);
  cursor: pointer;
}
.subtitle-choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ui-muted); }
.subtitle-choice span { display: grid; gap: 4px; }
.subtitle-choice small { color: var(--ui-muted); }
.image-preparation-footer { display: flex; align-items: center; gap: 14px; margin-top: 13px; }
.image-preparation-footer .primary-button { min-width: 128px; }
.image-preparation-footer .status-message { flex: 1; margin: 0; }
.image-operation {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.image-operation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.image-operation-heading h4 { margin: 0 0 6px; font-size: 18px; }
.image-operation-heading p { max-width: 720px; margin: 0; color: var(--ui-muted); }
.image-operation-config {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 420px);
  gap: 10px;
  margin-top: 14px;
}
.image-operation-config-simple { grid-template-columns: minmax(280px, 520px); }
.image-model-picker { display: flex; align-items: end; gap: 8px; }
.image-model-picker[hidden] { display: none; }
.image-model-picker .image-setting-field { flex: 1; min-width: 0; }
.image-model-picker .secondary-button { flex: none; min-height: 37px; padding: 7px 11px; }
.image-setting-field { display: grid; gap: 6px; color: var(--ui-muted); font-weight: 750; }
.image-setting-field select, .image-setting-field input {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.image-operation-settings { display: grid; gap: 10px; margin-top: 12px; }
.image-operation-settings[hidden] { display: none; }
.image-operation-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ui-muted);
  background: var(--ui-ink-2);
}
.image-operation-summary #imageOperationFrozen { flex-basis: 100%; color: var(--ui-muted); }
.image-candidate-history,
.scene-expansion-card {
  display: grid;
  gap: 10px;
  margin-top: 13px;
  padding: 13px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: var(--ui-ink-2);
}
.image-operation-history { display: grid; gap: 9px; }
.image-primary-compare { margin-top: 13px; }
.image-primary-compare .image-history-preview { flex-basis: min(760px, 100%); }
.professional-reference-list { margin-top: 8px; }
.reference-binding-summary[hidden],
.reference-binding-fold[hidden] { display: none !important; }
.image-history-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  background: var(--ui-ink-2);
}
.image-history-card.current { border-color: var(--ui-line-strong); }
.image-history-card.adopted { border-color: var(--ui-muted); }
.image-history-heading { display: flex; justify-content: space-between; gap: 10px; }
.image-history-previews { display: flex; gap: 8px; overflow-x: auto; }
.image-history-previews img {
  width: 108px;
  height: 150px;
  flex: none;
  border-radius: 8px;
  object-fit: contain;
  background: var(--ui-ink-2);
}
.image-history-preview {
  display: grid;
  flex: 0 0 min(520px, 92vw);
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: #111;
}
.image-candidate-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.image-candidate-compare figure { min-width: 0; margin: 0; }
.image-candidate-compare figcaption {
  margin-bottom: 6px;
  color: #aaa;
  font-size: 12px;
}
.image-history-previews .image-candidate-compare img {
  width: 100%;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  object-fit: contain;
  background: #000;
}
.image-operation-execution-fold { margin-top: 14px; }
.image-operation-execution-fold .image-operation-items { padding: 0 12px 12px; }
.scene-expansion-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--ui-muted); }
.scene-expansion-next { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scene-expansion-next button { width: fit-content; }
.scene-expansion-next small,
.scene-expansion-details > p { margin: 0; color: var(--ui-muted); }
.scene-expansion-details { border-color: var(--ui-line-strong); background: var(--ui-ink-2); }
.scene-expansion-history { display: grid; gap: 9px; padding: 0 12px 12px; }
.scene-expansion-candidate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  padding: 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  background: var(--ui-ink-2);
}
.scene-expansion-candidate.current { border-color: var(--ui-line-strong); }
.scene-expansion-candidate.adopted { border-color: var(--ui-muted); }
.scene-expansion-candidate-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scene-expansion-candidate p { grid-column: 1 / -1; margin: 0; color: var(--ui-muted); }
.scene-expansion-preview {
  grid-column: 1 / -1;
  width: min(100%, 360px);
  max-height: 420px;
  border-radius: 9px;
  object-fit: contain;
  background: var(--ui-ink-2);
}
.scene-expansion-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.scene-expansion-actions a { color: var(--ui-muted); }
.image-operation-items { display: grid; gap: 12px; margin-top: 12px; }
.image-operation-item {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: var(--ui-ink-2);
}
.image-operation-item-heading { display: flex; justify-content: space-between; gap: 10px; }
.image-operation-item-heading strong { overflow-wrap: anywhere; }
.image-operation-item-heading span, .image-operation-item-status { color: var(--ui-muted); }
.image-operation-item a { width: fit-content; color: var(--ui-muted); }
.image-operation-item label { color: var(--ui-muted); font-weight: 750; }
.image-operation-item textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.image-operation-actions, .image-operation-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.image-operation-actions button, .image-operation-upload button {
  padding: 8px 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  cursor: pointer;
}
.image-operation-actions button:disabled, .image-operation-upload button:disabled {
  opacity: .45;
  cursor: default;
}
.image-operation-upload input { max-width: 100%; color: var(--ui-muted); }
.image-operation-result {
  display: block;
  width: min(100%, 360px);
  max-height: 520px;
  object-fit: contain;
  border-radius: 9px;
  background: var(--ui-ink-2);
}
.media-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.media-summary article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: var(--ui-ink-2);
}
.media-summary span { color: var(--ui-muted-2); font-size: 12px; }
.media-summary strong { overflow-wrap: anywhere; color: var(--ui-text); font-size: 13px; line-height: 1.45; }

.video-generation { margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--ui-ink-4); }
.video-generation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.video-generation-heading > div { min-width: 0; }
.video-plan-actions {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.video-plan-actions label, .video-model-field, .video-setting-field {
  display: grid;
  gap: 7px;
  color: var(--ui-muted);
  font-weight: 750;
}
.video-plan-actions label { flex: 1 1 260px; }
.local-assembly-action { min-width: auto; min-height: 38px; padding: 8px 12px; }
.video-plan-actions select, .video-model-field select, .video-setting-field select,
.video-setting-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.video-setting-field input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin: 10px 0;
  accent-color: var(--ui-muted);
}
.video-generation-units { display: grid; gap: 14px; margin-top: 14px; }
.video-unit {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: var(--ui-ink-2);
}
.video-unit-heading, .video-operation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.video-unit-heading h4 { margin: 0 0 5px; font-size: 18px; }
.video-unit-heading p { margin: 0; color: var(--ui-muted); }
.video-unit textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.video-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.video-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: end;
  padding: 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-ink-2);
}
.video-setting-row small { color: var(--ui-muted-2); font-weight: 500; }
.video-unit-actions, .video-operation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.video-unit-actions button, .video-operation-actions button {
  padding: 9px 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  cursor: pointer;
}
.video-unit-actions button:disabled, .video-operation-actions button:disabled {
  opacity: .45;
  cursor: default;
}
.video-request-preview, .video-operation-history {
  padding: 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-ink-2);
}
.video-request-preview summary, .video-operation-history summary { cursor: pointer; font-weight: 800; }
.video-request-preview pre, .video-operation-history pre {
  max-height: 360px;
  margin: 10px 0 0;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.video-history-list { display: grid; gap: 10px; margin-top: 10px; }
.video-history-item {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  background: var(--ui-ink-2);
}
.video-history-item.current { border-color: var(--ui-muted); }
.video-history-item video { width: min(100%, 420px); max-height: 500px; border-radius: 9px; background: #000; }

.final-result { border-color: var(--ui-line-strong); }
.final-video-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.final-video-panel {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  background: var(--ui-ink-2);
}
.final-video-panel figcaption { margin-bottom: 10px; color: var(--ui-text); font-weight: 850; }
.final-video-panel video {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  background: #000;
}
.final-shot-comparison,
.final-shot-comparison-media article { min-width: 0; }
.final-shot-comparison-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.final-shot-comparison-media video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  margin-top: 10px;
  border-radius: 10px;
  background: #000;
}

@media (max-width: 900px) {
  .media-summary, .frame-selection-grid, .video-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .target-input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-region-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar { padding-inline: 16px; }
  .topbar-actions { gap: 6px; }
  .settings-link { padding: 9px 10px; font-size: 13px; }
  main { width: min(100% - 22px, 1160px); margin-top: 24px; }
  .panel { padding: 18px; }
  .section-heading, .task-heading { align-items: stretch; flex-direction: column; }
  .one-click-progress { align-items: stretch; flex-direction: column; }
  .one-click-controls { align-items: stretch; flex-direction: column; flex-basis: auto; }
  .import-row, .shot-compare, .final-video-comparison, .final-shot-comparison-media, .media-summary, .frame-selection-grid, .video-settings { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .audio-tools-actions > button { width: 100%; }
  .task-audio-heading { flex-direction: column; }
  .task-audio-actions > button, .task-audio-modes button { width: 100%; }
  .task-audio-modes { grid-template-columns: 1fr; }
  .task-audio-metrics { grid-template-columns: 1fr; }
  #audioServiceFrame { min-height: 640px; }
  .image-preparation-footer { align-items: stretch; flex-direction: column; }
  .shot-flow-action { align-items: stretch; flex-direction: column; }
  .reference-library-heading, .reference-upload { align-items: stretch; flex-direction: column; }
  .reference-upload input { max-width: none; }
  .target-input-grid, .image-region-controls { grid-template-columns: 1fr; }
  .auxiliary-reference-grid { grid-template-columns: 1fr; }
  .image-region-source-row,
  .image-region-heading,
  .image-candidate-history-heading,
  .scene-expansion-heading { align-items: stretch; flex-direction: column; }
  .image-operation-heading, .image-operation-summary { flex-direction: column; }
  .image-operation-config { grid-template-columns: 1fr; }
  .image-candidate-compare { grid-template-columns: 1fr; }
  .image-history-previews .image-candidate-compare img { height: min(62vh, 420px); }
  .reference-binding-summary-row { grid-template-columns: 1fr; gap: 3px; }
  .video-generation-heading, .video-unit-heading, .video-operation-heading { flex-direction: column; }
  .video-setting-row { grid-template-columns: 1fr; }
  .video-shell { height: clamp(230px, 38vh, 340px); min-height: 0; }
}

/* Approved workbench layout: keep the real controls, reduce visual noise. */
.app-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 100vh;
}
.app-content { min-width: 0; }
.side-rail {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 100vh;
  padding: 18px 12px;
  border-right: 1px solid var(--ui-ink-4);
  background: var(--ui-ink-2);
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 8px 22px;
  color: inherit;
  text-decoration: none;
}
.side-brand strong { overflow-wrap: normal; font-size: 15px; font-weight: 750; }
.side-brand-mark {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--ui-ink-2);
  background: var(--ui-muted);
  font-weight: 900;
}
.side-nav { display: grid; gap: 8px; }
.side-nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ui-text);
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.side-nav-item > span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ui-ink-2);
  font-size: 18px;
}
.side-nav-item > span:last-child { display: grid; gap: 2px; min-width: 0; }
.side-nav-item strong { font-size: 14px; }
.side-nav-item small { color: var(--ui-muted); font-size: 11px; }
.side-nav-item.active,
.side-nav-item[aria-expanded="true"] { border-color: var(--ui-line-strong); background: var(--ui-ink-2); }
.side-nav-item.active > span:first-child,
.side-nav-item[aria-expanded="true"] > span:first-child { color: var(--ui-ink-2); background: var(--ui-muted); }

.topbar { min-height: 64px; padding: 10px 24px; }
.topbar .brand-mark { display: none; }
.topbar .brand small { font-size: 11px; }
main { width: min(1080px, calc(100% - 40px)); margin: 24px auto 54px; }
.hero { margin: 0 0 18px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 38px); font-weight: 700; }
.panel { padding: 20px; border-radius: 16px; box-shadow: none; }
.section-heading h2 { margin-top: 0; }

.task-panel { display: flex; flex-direction: column; }
.task-heading { order: 0; }
.task-identity-fold { order: 1; }
.workflow-steps { order: 2; }
.one-click-progress { order: 3; }
.copy-review { order: 4; }
.source-overview { order: 4; }
.waiting-card { order: 5; }
.shots-section { order: 6; }
.task-audio { order: 7; }
.video-generation { order: 8; }
.media-history-section { order: 9; }

.task-heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-heading-actions > a { display: inline-grid; place-items: center; min-height: 40px; text-decoration: none; }
.history-jump { position: relative; }
.history-jump > summary {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.history-jump > summary::-webkit-details-marker { display: none; }
.history-jump nav {
  position: absolute;
  z-index: 7;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  width: 180px;
  padding: 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: var(--ui-ink-2);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .35);
}
.history-jump nav a { padding: 8px 9px; border-radius: 7px; color: var(--ui-text); text-decoration: none; }
.history-jump nav a:hover { background: var(--ui-ink-4); }

.advanced-fold {
  margin: 12px 0 0;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: var(--ui-ink-2);
}
.advanced-fold:not([open]) > :not(summary) { display: none; }
.advanced-fold > summary {
  padding: 11px 13px;
  color: var(--ui-muted);
  font-weight: 800;
  cursor: pointer;
}
.advanced-fold[open] > summary { border-bottom: 1px solid var(--ui-line-strong); }
.task-identity-fold { margin: 0 0 14px; }
.task-identity-fold .task-identity { padding: 12px 13px; }
.image-settings-fold { margin-top: 12px; }
.image-settings-fold .image-operation-settings { padding: 0 12px 12px; }
.image-region-details { margin: 0; }
.image-region-list { display: grid; gap: 6px; padding: 10px 12px; }
.image-region-list p { margin: 0; }
.media-summary-fold { margin-top: 14px; }
.media-summary-fold .media-summary { margin: 0; padding: 12px; }
.video-advanced-fold { margin: 0; }
.video-advanced-fold > label,
.video-advanced-fold > .video-settings { margin: 12px; }
.video-advanced-fold > .video-settings { margin-top: 0; }

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.workflow-steps button {
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  color: var(--ui-muted);
  background: var(--ui-ink-2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.workflow-steps button[data-state="current"] {
  border-color: var(--ui-muted);
  color: var(--ui-ink-2);
  background: var(--ui-muted);
}
.workflow-steps button[data-state="next"] {
  border-color: var(--ui-line-strong);
  color: var(--ui-text);
  background: var(--ui-ink-4);
}
.workflow-steps button[data-state="completed"] {
  border-color: var(--ui-line-strong);
  color: var(--ui-muted);
  background: var(--ui-ink-2);
}
.workflow-panel { transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease; }
.workflow-panel[data-workflow-state="current"] {
  border-color: var(--ui-muted);
  box-shadow: 0 0 0 1px #a9906733;
}
.workflow-panel[data-workflow-state="next"] { border-color: var(--ui-line-strong); }
.workflow-panel[data-workflow-state="other"]:not([data-workflow-forced="true"]) { display: none; }
.workflow-steps button[data-inspected="true"] { outline: 1px solid var(--ui-muted); outline-offset: 2px; }
.current-step-label { display: block; margin-bottom: 4px; color: var(--ui-muted); font-weight: 800; }

.task-audio-selections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}
.task-audio-selection {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: var(--ui-ink-2);
}
.task-audio-selection output {
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
}
.task-audio-selection small { color: var(--ui-muted); }
.task-audio-selection .secondary-button { width: fit-content; min-height: 38px; padding-block: 8px; }
.task-audio-voices { margin-top: 0; }
.task-history-list,
.media-history-list { display: grid; gap: 9px; }
.task-history-row,
.media-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: var(--ui-ink-2);
}
.task-history-copy,
.media-history-copy { display: grid; gap: 4px; min-width: 0; }
.task-history-copy strong,
.media-history-copy strong { overflow-wrap: anywhere; }
.task-history-copy small,
.media-history-copy small { color: var(--ui-muted); }
.task-history-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.task-history-actions > a {
  min-width: 104px;
  min-height: 38px;
  padding: 8px 12px;
  text-align: center;
  text-decoration: none;
}
.media-history-section {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid var(--ui-ink-4);
}
.media-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.media-history-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.media-kind {
  min-width: 48px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--ui-muted);
  background: var(--ui-ink-4);
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}
.media-status {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--ui-muted);
  background: var(--ui-ink-4);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.media-status.success { color: var(--ui-muted); }
.media-status.failed { color: #ffaaa5; background: #3a201d; }
.media-status.queued { color: #e8d89a; background: #332e1c; }
.media-status.running { color: #a8d9ff; background: #172e3b; }
.media-status.resume { color: #f0c7a1; background: #38271d; }
.media-history-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.media-delete-reason { flex-basis: 100%; max-width: 260px; color: #d7b08f; text-align: right; }
.media-history-actions .secondary-button {
  min-width: auto;
  min-height: 36px;
  padding: 7px 10px;
  text-decoration: none;
}
.danger-button { border-color: #75423d; color: #ffb4aa; background: #2c1816; }
.danger-button:disabled { opacity: .45; }

.action-confirm-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--ui-line-strong);
  border-radius: 16px;
  color: var(--ui-text);
  background: var(--ui-ink-2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.action-confirm-dialog::backdrop { background: rgba(2, 10, 7, .78); }
.action-confirm-form { display: grid; gap: 14px; padding: 22px; }
.action-confirm-form h2 { margin: 0; font-size: 22px; }
.action-confirm-form p {
  margin: 0;
  color: var(--ui-muted);
  line-height: 1.7;
  white-space: pre-line;
}
.action-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.action-confirm-actions button { min-width: 112px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 156px minmax(0, 1fr); }
  .side-brand strong { font-size: 13px; }
  .side-nav-item { grid-template-columns: 30px minmax(0, 1fr); padding: 9px; }
  .side-nav-item > span:first-child { width: 30px; height: 30px; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .side-rail { position: static; width: 100%; height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--ui-ink-4); }
  .side-brand { padding: 4px 4px 10px; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { position: static; padding-inline: 12px; }
  .topbar .brand small { display: none; }
  main { width: min(100% - 20px, 1080px); margin-top: 16px; }
  .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .copy-review-heading, .task-audio-confirmed-copy { flex-direction: column; }
  .copy-review-row-heading { align-items: stretch; flex-direction: column; }
  .copy-review-options, .copy-review-column-labels,
  .copy-review .task-audio-row { grid-template-columns: 1fr; }
  .copy-review-column-labels { display: none; }
  .copy-review-actions > button, .task-audio-confirmed-copy > button { width: 100%; }
  .task-audio-selections { grid-template-columns: 1fr; }
  .task-history-row,
  .media-history-row { grid-template-columns: 1fr; align-items: stretch; }
  .task-history-actions,
  .media-history-actions { justify-content: flex-start; }
  .task-heading-actions { align-items: stretch; flex-direction: column; }
  .task-heading-actions > a, .history-jump > summary { width: 100%; }
  .history-jump nav { position: static; width: 100%; margin-top: 6px; }
  .action-confirm-actions { flex-direction: column-reverse; }
  .action-confirm-actions button { width: 100%; }
}

/* Matte charcoal and ivory; the original brand artwork keeps its own colour. */
:root {
  --ui-black: #121212;
  --ui-ink-1: #0d0d0d;
  --ui-ink-2: #171717;
  --ui-ink-3: #181818;
  --ui-ink-4: #212120;
  --ui-text: #e8e5df;
  --ui-muted: #b2b0aa;
  --ui-muted-2: #92918d;
  --ui-line: #2b2b29;
  --ui-line-strong: #55534e;
  --ui-accent: #a99067;
  --ui-primary: #e2ddd2;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ui-text);
  background: var(--ui-black);
  accent-color: var(--ui-text);
}

html { background: var(--ui-black); }
body {
  color: var(--ui-text);
  background: var(--ui-black);
}
::selection { color: var(--ui-black); background: var(--ui-text); }
* { scrollbar-color: rgba(255, 255, 255, .25) var(--ui-ink-2); }

.app-shell { background: var(--ui-black); }
.app-content { background: transparent; }
.side-rail {
  border-color: var(--ui-line);
  background: var(--ui-ink-1);
}
.topbar {
  border-color: var(--ui-line);
  background: rgba(9, 9, 9, .94);
}
.panel {
  border-color: var(--ui-line);
  background: rgba(16, 16, 16, .96);
  box-shadow: none;
}

/* The approved brand artwork keeps its own wood-and-leaf colour. */
.side-brand { justify-content: center; padding: 2px 8px 22px; }
.side-brand:has(.side-brand-logo) > :not(.side-brand-logo),
.brand:has(.brand-wordmark) > :not(.brand-wordmark) { display: none; }
.side-brand-logo {
  display: block;
  width: 96px;
  height: 72px;
  object-fit: contain;
  mix-blend-mode: lighten;
}
.brand:has(.brand-wordmark) {
  position: relative;
  display: block;
  width: 220px;
  height: 70px;
  overflow: hidden;
}
.brand-wordmark {
  position: absolute;
  top: -25px;
  left: -8px;
  display: block;
  width: 236px;
  max-width: none;
  height: auto;
  mix-blend-mode: lighten;
}
.side-brand-mark,
.brand-mark {
  color: var(--ui-black);
  border: 1px solid var(--ui-text);
  background: var(--ui-text);
}

.side-nav-item {
  grid-template-columns: 42px minmax(0, 1fr);
  color: var(--ui-text);
  border-color: transparent;
  background: transparent;
}
.side-nav-item:hover {
  border-color: var(--ui-line-strong);
  background: rgba(255, 255, 255, .045);
}
.side-nav-item.active,
.side-nav-item[aria-expanded="true"] {
  color: var(--ui-text);
  border-color: var(--ui-line-strong);
  background: var(--ui-ink-4);
}
.side-nav-item > span:first-child,
.side-nav-item > span.side-nav-icon {
  width: 42px;
  height: 42px;
  color: var(--ui-text);
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .045);
}
.side-nav-item.active > span:first-child,
.side-nav-item[aria-expanded="true"] > span:first-child {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .09);
}
.side-nav-icon svg { width: 22px; height: 22px; }

h1, h2, h3, h4, h5, h6,
legend,
.side-nav-item strong,
.task-identity dd,
.media-summary strong,
.final-video-panel figcaption { color: var(--ui-text); }
.eyebrow,
.brand small,
.side-nav-item small,
.hero > p:last-child,
.section-heading p:not(.eyebrow),
.subheading p,
.runtime-settings-heading small,
.task-audio-modes p,
#taskAudioVoices,
#taskAudioAccompanimentHelp,
.task-audio-selection small,
.task-audio-confirmed-copy p,
.whole-video-setup-heading p,
.global-target-input-grid small,
.status-message,
.task-identity dt,
.workflow-progress small,
.one-click-model small,
.waiting-card p,
.shot-compare figcaption span,
.shot-source-range,
.image-preparation-help,
.frame-selection output,
.prepared-frame-heading p,
.reference-library p,
.image-region-heading p,
.image-candidate-history-heading p,
.scene-expansion-heading p,
.image-region-stage p,
.reference-card-body small,
.subtitle-choice small,
.image-operation-heading p,
.image-operation-summary #imageOperationFrozen,
.scene-expansion-next small,
.scene-expansion-details > p,
.scene-expansion-candidate p,
.image-operation-item-heading span,
.image-operation-item-status,
.media-summary span,
.video-unit-heading p,
.video-setting-row small,
.task-history-copy small,
.media-history-copy small,
.action-confirm-form p { color: var(--ui-muted); }

a,
.runtime-settings-popover > a,
.scene-expansion-actions a,
.image-operation-item a,
.history-jump nav a { color: var(--ui-text); }

.settings-link,
.secondary-button,
.frame-actions button,
.reference-upload select,
.reference-upload input,
.reference-upload button,
.image-region-chip button,
.image-operation-actions button,
.image-operation-upload button,
.video-unit-actions button,
.video-operation-actions button,
.history-jump > summary {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .025);
}
.settings-link:hover,
.secondary-button:hover,
.frame-actions button:hover,
.reference-upload button:hover,
.image-operation-actions button:hover,
.image-operation-upload button:hover,
.video-unit-actions button:hover,
.video-operation-actions button:hover,
.history-jump nav a:hover {
  border-color: var(--ui-line-strong);
  background: rgba(255, 255, 255, .06);
}
.primary-button {
  color: var(--ui-black);
  border: 1px solid var(--ui-primary);
  background: var(--ui-primary);
  box-shadow: none;
}
.primary-button:hover { background: #f0ece3; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .86);
  outline-offset: 2px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea,
output,
pre,
.task-audio-selection output,
.task-audio-metrics span {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .14);
  background: #0f0f0f;
}
input::placeholder,
textarea::placeholder { color: #888; }
input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress { accent-color: var(--ui-text); }
input[type="file"]::file-selector-button,
.global-reference-file input::file-selector-button,
.file-picker input::file-selector-button {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .16);
  background: #191919;
}

:is(
  .runtime-settings-popover,
  .task-audio,
  .copy-review,
  .whole-video-setup,
  .one-click-progress,
  .waiting-card,
  .shot-flow-action,
  .image-preparation,
  .image-operation,
  .video-unit,
  .final-video-panel,
  .action-confirm-dialog
) {
  color: var(--ui-text);
  border-color: var(--ui-line);
  background: var(--ui-ink-3);
}
:is(
  .task-audio-modes article,
  .task-audio-selection,
  .task-audio-row,
  .shot-tabs,
  .frame-selection,
  .prepared-frame-strip,
  .prepared-frame-card,
  .reference-library,
  .reference-binding-summary,
  .reference-binding-fold,
  .target-input-card,
  .subtitle-choice,
  .image-operation-summary,
  .image-candidate-history,
  .scene-expansion-card,
  .image-history-card,
  .image-history-preview,
  .scene-expansion-details,
  .scene-expansion-candidate,
  .image-operation-item,
  .media-summary article,
  .video-setting-row,
  .video-request-preview,
  .video-operation-history,
  .video-history-item,
  .advanced-fold,
  .workflow-steps button,
  .task-history-row,
  .media-history-row,
  .history-jump nav
) {
  border-color: rgba(255, 255, 255, .08);
  background: var(--ui-ink-4);
}
.advanced-fold,
.task-audio-selection,
.target-input-card,
.reference-card,
.image-history-card,
.scene-expansion-candidate,
.video-history-item { border-color: rgba(255, 255, 255, .1); }
.source-overview,
.shots-section,
.video-generation,
.media-history-section { border-color: rgba(255, 255, 255, .08); }

.badge,
.media-kind,
.media-status {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .055);
}

.workflow-steps button {
  color: var(--ui-muted);
  border-color: rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .018);
}
.workflow-steps button[data-state="current"],
.workflow-steps button[data-state="next"],
.workflow-steps button[data-state="completed"] {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .045);
  outline: 0;
}
.workflow-steps button[data-inspected="true"],
.shot-tab.selected {
  color: var(--ui-text);
  border-color: var(--ui-text);
  background: rgba(255, 255, 255, .07);
  outline-color: var(--ui-text);
}
.workflow-panel[data-workflow-state="current"],
.workflow-panel[data-workflow-state="next"],
.image-history-card.current,
.image-history-card.adopted,
.scene-expansion-candidate.current,
.scene-expansion-candidate.adopted,
.video-history-item.current {
  border-color: var(--ui-line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.current-step-label { color: var(--ui-text); }
.one-click-target { outline-color: var(--ui-text); }

.image-region-stage,
.video-shell,
#sourceVideo,
.reference-card img,
.image-history-previews img,
.scene-expansion-preview,
.image-operation-result,
.video-history-item video,
.final-video-panel video { background: var(--ui-black); }
.image-region-stage { border-color: rgba(255, 255, 255, .23); }
.image-region-chip { border-color: var(--ui-text); }
.image-region-chip.selected { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.waiting-icon {
  color: var(--ui-black);
  background: var(--ui-text);
}
.workflow-progress progress { accent-color: var(--ui-text); }
.action-confirm-dialog::backdrop { background: rgba(0, 0, 0, .78); }

/* Semantic states stay recognizable; the navigation and work surfaces remain neutral. */
.status-message.error { color: #ffaaa5; }
.badge.complete,
.badge.ok { color: var(--ui-muted); border-color: rgba(255, 255, 255, .16); }
.media-status.success { color: var(--ui-muted); }
.media-status.failed { color: #ffaaa5; background: #3a201d; }
.media-status.queued { color: #e8d89a; background: #332e1c; }
.media-status.running { color: #a8d9ff; background: #172e3b; }
.media-status.resume { color: #f0c7a1; background: #38271d; }
.media-delete-reason { color: #d7b08f; }
.danger-button,
.image-region-chip .danger-button { color: #ffb4aa; border-color: #75423d; background: #2c1816; }
.image-region-chip.edit { border-color: #ff8a83; }
.image-region-chip.protect { border-color: var(--ui-line-strong); }

/* Approved cover layout. The existing task controls remain the only live state. */
main { width: min(1180px, calc(100% - 40px)); }
.replica-mode {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(520px, 1.28fr);
  gap: 22px;
  align-items: center;
  margin: 4px 0 18px;
  padding: 4px 0;
}
.replica-mode h1 { margin: 0 0 7px; color: #fff; font-size: 25px; }
.replica-mode p { margin: 0; color: var(--ui-muted); line-height: 1.65; }
.replica-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.replica-mode-option {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 86px;
  padding: 16px 18px;
  border: 1px solid var(--ui-line);
  border-radius: 15px;
  color: #fff;
  background: rgba(255, 255, 255, .018);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.replica-mode-option:hover { border-color: var(--ui-line-strong); background: rgba(255, 255, 255, .045); }
.replica-mode-option[aria-pressed="true"] {
  border-color: var(--ui-line-strong);
  background: var(--ui-ink-4);
  box-shadow: inset 3px 0 var(--ui-accent);
}
.replica-mode-option strong { font-size: 18px; }
.replica-mode-option span { color: var(--ui-muted); font-size: 13px; line-height: 1.5; }

.one-click-workspace,
.professional-workspace { min-width: 0; }
.professional-workspace:not([hidden]) { display: flex; flex-direction: column; }
.professional-workspace > .task-panel { order: 0; }
.professional-workspace > #professionalFinalSlot { order: 1; }
.professional-workspace > .task-history { order: 2; }
.professional-copy-slot { margin: 14px 0; }
.one-click-surface { padding: 26px; }
.one-click-surface > .section-heading { margin-bottom: 18px; }
.one-click-surface > .section-heading h2 { margin-bottom: 6px; font-size: 29px; }
.one-click-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.one-click-upload-card,
.one-click-settings-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #141414;
}
.one-click-upload-card { display: grid; align-content: start; gap: 14px; }
.one-click-upload-card h3,
.one-click-settings-card h3 { margin: 0 0 5px; color: #fff; font-size: 19px; }
.one-click-upload-card p,
.one-click-settings-card p { margin: 0; color: var(--ui-muted); line-height: 1.6; }
.one-click-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.one-click-card-heading > div,
.one-click-settings-heading > div { min-width: 0; }
.one-click-upload-card .import-row { grid-template-columns: 1fr; align-items: stretch; }
.one-click-upload-card .primary-button { width: 100%; }
.one-click-upload-card .status-message { margin-top: 0; }
.one-click-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.compact-button { min-width: 0; min-height: 36px; padding: 7px 10px; font-size: 13px; }
.one-click-settings-card .one-click-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 11px;
}
.one-click-settings-card .one-click-model { min-width: 0; }
.one-click-copy-controls { display: grid; gap: 12px; margin: 0 0 14px; }
.one-click-visual-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ui-line);
}
.one-click-visual-setting,
.one-click-video-model,
.one-click-video-arrangement,
.one-click-subtitle-choice { min-width: 0; }
.one-click-image-setting,
.one-click-subtitle-choice { grid-column: 1 / -1; }
.one-click-image-setting { min-width: 0; }
.one-click-image-setting > label,
.one-click-image-setting > div { margin: 12px; }
.one-click-video-settings { grid-column: 1 / -1; min-width: 0; }
.one-click-video-settings > .video-settings,
.one-click-video-settings > .status-message { margin: 12px; }
#scenePlateSettingsFold > label,
#scenePlateSettingsFold > button { margin: 12px; }
.video-extra-references { grid-column: 1 / -1; min-width: 0; }
.video-extra-references > p, .video-extra-references > div { margin: 12px; }
.video-extra-reference-upload { display: flex; gap: 10px; flex-wrap: wrap; }
.video-extra-reference-upload input { min-width: 0; max-width: 100%; }
.one-click-source-import { padding-bottom: 2px; }
.one-click-audio-controls .one-click-audio-mode { grid-column: 1 / -1; }
.one-click-audio-field {
  display: grid;
  grid-template-rows: auto auto auto minmax(34px, auto);
  gap: 6px;
  min-width: 0;
  color: var(--ui-text);
  font-weight: 750;
}
.one-click-audio-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  color: #fff;
  background: #0f0f0f;
}
.one-click-audio-field small,
.one-click-check { color: var(--ui-muted); font-size: 12px; font-weight: 500; }
.one-click-audio-field .compact-button { width: 100%; }
.one-click-check { display: flex; align-items: center; gap: 9px; min-height: 36px; }
.one-click-check input { width: 18px; min-height: 18px; margin: 0; }
.one-click-span-two { grid-column: 1 / -1; }

.background-inheritance-choice {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.background-inheritance-choice small { color: var(--ui-muted); }

.one-click-surface > .whole-video-setup { margin: 15px 0 0; padding: 18px; }
.one-click-surface .global-target-input-grid { grid-template-columns: 1fr; }
.one-click-surface .global-target-input-grid .target-input-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 15px;
}
.one-click-surface .global-target-input-grid .target-toggle,
.one-click-surface .global-target-input-grid .target-input-card > small { grid-column: 1 / -1; }
.one-click-action-zone {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #141414;
}
.one-click-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.one-click-action-bar > a { display: inline-grid; place-items: center; text-decoration: none; }
.one-click-action-bar .primary-button { min-width: 168px; }
.one-click-surface .one-click-progress {
  display: block;
  margin: 15px 0 0;
  padding: 16px 18px;
  border-color: var(--ui-line);
  background: #141414;
}
.one-click-progress-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.one-click-progress-heading h3 { margin: 0; }
.one-click-activity-details {
  max-height: 11em;
  overflow-y: auto;
  margin: 8px 0;
  padding: 9px 12px;
  border-left: 2px solid var(--ui-line);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.one-click-surface .workflow-progress progress { width: 100%; }
.professional-copy-slot .copy-review { margin-top: 0; }

@media (max-width: 1040px) {
  .replica-mode { grid-template-columns: 1fr; }
  .one-click-top-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  main { width: min(100% - 20px, 1180px); }
  .replica-mode-options,
  .one-click-settings-card .one-click-controls,
  .one-click-surface .global-target-input-grid .target-input-card { grid-template-columns: 1fr; }
  .one-click-span-two,
  .one-click-surface .global-target-input-grid .target-toggle,
  .one-click-surface .global-target-input-grid .target-input-card > small { grid-column: auto; }
  .one-click-surface { padding: 18px; }
  .one-click-action-bar { align-items: stretch; flex-direction: column; }
  .one-click-action-bar > * { width: 100%; }
}

@media (max-width: 760px) {
  .side-rail { border-color: rgba(255, 255, 255, .1); }
  .side-brand { padding-bottom: 10px; }
  .brand:has(.brand-wordmark) { width: 166px; height: 56px; }
  .brand-wordmark { top: -20px; width: 180px; }
}

/* Copy review remains real workflow state inside the approved 配音 stage. */
.task-audio > .professional-copy-slot .copy-review { margin: 0; }

/* Product navigation owns the whole main surface, so video and voice tools never mix. */
:root[data-product="audio"] #replicaMode,
:root[data-product="audio"] #oneClickWorkspace,
:root[data-product="audio"] #professionalWorkspace,
:root[data-product="replica"] #audioToolsPanel { display: none !important; }
.audio-tools:not([hidden]) {
  display: block;
  min-height: calc(100vh - 142px);
  padding: 26px;
}
.audio-tools iframe {
  width: 100%;
  min-height: calc(100vh - 300px);
  margin-top: 16px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #fff;
}

/* Approved professional-workbench shell.  These rules only change the
   presentation containers; the existing IDs, workflow state and handlers
   remain the source of truth. */
.approved-professional {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.approved-history,
.approved-detail {
  margin-top: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: #121413;
  box-shadow: none;
}
.approved-history .section-heading,
.approved-detail-heading {
  align-items: center;
  margin-bottom: 14px;
}
.approved-history .section-heading h2,
.approved-detail-heading h2 { margin: 0 0 6px; color: #fff; font-size: 25px; }
.approved-history .section-heading p,
.approved-detail-heading p { margin: 0; color: #a8aaa8; }
.approved-detail-heading { padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.approved-detail .task-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.approved-detail .task-heading-actions > a,
.approved-detail .task-heading-actions > button { min-height: 38px; padding: 8px 12px; }
.approved-detail .history-jump { margin: 0; }
.approved-detail .task-identity-fold { margin: 0 0 14px; }
.approved-workflow-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.approved-workflow-steps button {
  min-width: 0;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  color: #aeb1ae;
  background: #171817;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.approved-workflow-steps button[data-state="current"],
.approved-workflow-steps button[data-state="next"],
.approved-workflow-steps button[data-state="completed"] {
  color: #e7e7e7;
  border-color: rgba(255, 255, 255, .16);
  background: #1a1b1a;
  box-shadow: none;
  outline: 0;
}
.approved-workflow-steps button[data-inspected="true"] {
  color: #fff;
  border-color: #fff;
  background: #202120;
  box-shadow: inset 3px 0 #fff;
}
.approved-stage {
  min-width: 0;
  margin-top: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  background: #101110;
}
.approved-stage[data-workflow-state="current"],
.approved-stage[data-workflow-state="next"] { border-color: rgba(255, 255, 255, .2); }
.storyboard-editor { margin: 0; padding: 14px; scroll-margin-top: 96px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: #141514; }
.storyboard-shot-layout { display: block; }
.storyboard-shot-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.storyboard-shot-list button { display: grid; width: 100%; gap: 5px; text-align: left; }
.storyboard-shot-list button small,
.storyboard-frame-strip { color: #b8bab8; font-size: 12px; font-weight: 600; }
.storyboard-shot-list button[data-selected="true"] { color: #fff; border-color: #fff; background: #202120; }
.storyboard-editor-main { min-width: 0; display: grid; gap: 10px; }
.storyboard-frame-toolbar, .storyboard-inline-actions, .storyboard-editor-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.storyboard-export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.storyboard-export-actions .status-message { flex: 1 1 240px; margin: 0; }
.storyboard-frame-toolbar label, .storyboard-grid-two label { display: grid; gap: 4px; min-width: 130px; }
.storyboard-frame-toolbar output { min-width: 86px; padding: 9px 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; }
.storyboard-frame-review { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr); gap: 12px; }
.storyboard-player-panel,
.storyboard-frame-controls,
.storyboard-shot-browser { min-width: 0; padding: 12px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 11px; background: #101110; }
.storyboard-player-panel { display: grid; gap: 10px; }
.storyboard-player-heading,
.storyboard-shot-browser-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.storyboard-player-heading > span,
.storyboard-shot-browser-heading > span,
.storyboard-player-boundary { color: #b8bab8; font-size: 13px; }
.storyboard-player-boundary { text-align: right; }
.storyboard-video-shell { height: clamp(300px, 46vh, 480px); border-radius: 10px; background: #080908; overflow: hidden; }
.storyboard-video-shell video { width: 100%; height: 100%; object-fit: contain; }
.storyboard-timeline-map { position: relative; height: 86px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px; background: #080908; }
.storyboard-timeline-segment { position: absolute; top: 8px; height: 43px; min-width: 2px; overflow: hidden; display: grid; place-content: center; gap: 1px; padding: 4px 7px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; background: #1a1b1a; color: #fff; text-align: center; }
.storyboard-timeline-segment:nth-child(even) { background: #222322; }
.storyboard-timeline-segment[data-selected="true"] { border-color: #fff; background: #303130; box-shadow: inset 0 -3px #fff; }
.storyboard-timeline-segment strong,
.storyboard-timeline-segment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.storyboard-timeline-segment strong { font-size: 12px; }
.storyboard-timeline-segment span { color: #b8bab8; font-size: 10px; }
.storyboard-timeline-cut,
.storyboard-timeline-trim,
.storyboard-timeline-keyframe,
.storyboard-timeline-pollution,
.storyboard-timeline-excluded { position: absolute; z-index: 3; padding: 0; transform: translateX(-50%); border: 0; background: transparent; color: #fff; }
.storyboard-timeline-cut { top: 0; bottom: 0; width: 18px; }
.storyboard-timeline-cut::before { content: ""; position: absolute; top: 4px; bottom: 5px; left: 8px; width: 2px; background: #fff; }
.storyboard-timeline-cut span { position: absolute; right: 11px; bottom: 3px; padding: 1px 4px; border-radius: 4px; background: #fff; color: #080908; font-size: 9px; }
.storyboard-timeline-trim { top: 54px; min-width: 22px; padding: 2px 4px; border: 1px solid rgba(255, 255, 255, .65); border-radius: 4px; background: #202120; font-size: 9px; }
.storyboard-timeline-trim[data-edge="start"] { transform: translateX(2px); }
.storyboard-timeline-trim[data-edge="end"] { transform: translateX(calc(-100% - 2px)); }
.storyboard-timeline-keyframe,
.storyboard-timeline-pollution,
.storyboard-timeline-excluded { top: 55px; min-width: 20px; padding: 2px 4px; border-radius: 4px; font-size: 9px; font-weight: 800; }
.storyboard-timeline-keyframe { background: #f2f2f2; color: #0a0a0a; }
.storyboard-timeline-pollution { background: #b17b31; color: #fff; }
.storyboard-timeline-excluded { background: #7a2831; color: #fff; }
.storyboard-timeline-playhead { position: absolute; z-index: 5; top: 2px; bottom: 2px; width: 2px; transform: translateX(-1px); background: #fff; box-shadow: 0 0 7px rgba(255, 255, 255, .75); pointer-events: none; }
#storyboardTimeline { width: 100%; margin: 2px 0 0; accent-color: #fff; }
.storyboard-timeline-meta { display: grid; grid-template-columns: repeat(3, 1fr); color: #b8bab8; font-variant-numeric: tabular-nums; }
.storyboard-timeline-meta output { text-align: center; color: #fff; }
.storyboard-timeline-meta span:last-child { text-align: right; }
.storyboard-player-actions { align-items: center; }
.storyboard-boundary-fold { margin-top: 2px; }
.storyboard-boundary-fold .storyboard-inline-actions { margin-top: 9px; }
.storyboard-frame-controls { display: grid; gap: 10px; align-content: start; }
.storyboard-frame-controls h5 { margin: 0; color: #fff; font-size: 20px; }
.storyboard-current-frame { display: grid; gap: 5px; }
.storyboard-current-time { padding: 9px 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; color: #fff; font-variant-numeric: tabular-nums; }
.storyboard-shot-browser { display: grid; gap: 10px; }
.storyboard-draft-preview video { display: block; width: 100%; max-height: 520px; margin-top: 10px; border-radius: 10px; background: #080908; object-fit: contain; }
.storyboard-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.storyboard-keyframe-panel { display: grid; gap: 8px; }
.storyboard-keyframe-group { display: grid; gap: 6px; padding: 9px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 9px; }
.storyboard-keyframe-list { display: flex; flex-wrap: wrap; gap: 6px; }
.storyboard-keyframe-list button[data-selected="true"] { color: #fff; border-color: #fff; background: #202120; }
.storyboard-boundary-review { display: grid; gap: 7px; margin-top: 9px; }
.storyboard-pollution-candidates { display: grid; gap: 7px; margin-top: 8px; }
.storyboard-pollution-candidate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 9px; }
.storyboard-pollution-candidate small { display: block; margin-top: 3px; }
.storyboard-pollution-candidate .storyboard-inline-actions { justify-content: end; }
#storyboardPollutionProgress { width: 100%; margin-top: 8px; }
@media (max-width: 760px) {
  .storyboard-frame-review { grid-template-columns: 1fr; }
  .storyboard-video-shell { height: min(56vh, 460px); }
  .storyboard-pollution-candidate { grid-template-columns: 1fr; }
  .storyboard-pollution-candidate .storyboard-inline-actions { justify-content: start; }
}
.approved-stage .subheading,
.approved-stage .section-heading,
.approved-stage .image-operation-heading,
.approved-stage .video-generation-heading { margin-bottom: 12px; }
.approved-stage .subheading h3,
.approved-stage .section-heading h2,
.approved-stage .image-operation-heading h4,
.approved-stage .video-generation-heading h3 { margin: 0 0 5px; color: #fff; }
.approved-stage .subheading p,
.approved-stage .section-heading p,
.approved-stage .image-operation-heading p { margin: 0; color: #a8aaa8; }
.approved-stage .professional-copy-slot #copyReviewSection { display: block; }
.approved-stage .professional-copy-slot { margin: 0 0 14px; }
.approved-stage .task-audio-heading { padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.approved-stage .task-audio-selections,
.approved-stage .task-audio-modes { margin-top: 14px; }
.approved-stage .copy-review,
.approved-stage .image-preparation,
.approved-stage .image-operation,
.approved-stage .video-generation { border-color: rgba(255, 255, 255, .1); background: #141514; }
.approved-stage-image { display: grid; gap: 14px; }
.approved-stage-image > .subheading { margin-bottom: 0; }
.approved-stage-image > .shot-tabs { margin: 0; }
.approved-stage-image > .workflow-panel,
.approved-stage-image > .image-preparation,
.approved-stage-image > .image-operation { margin-top: 0; }
.approved-stage-video { margin-top: 0; }
.approved-stage-final { margin-top: 0; }
.approved-final-slot { min-width: 0; }
#oneClickFinalSlot #finalResult { margin-top: 18px; padding: 0; border: 0; background: none; box-shadow: none; }
#oneClickFinalSlot #finalResult > :not(.final-comparison-stage) { display: none; }
#oneClickFinalSlot .final-comparison-stage { margin-top: 0; }
.approved-advanced-history {
  margin-top: 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  background: #101110;
}
.approved-auxiliary { margin: 0; }
.approved-professional .workflow-panel[data-workflow-state="other"]:not([data-workflow-forced="true"]) { display: none; }
.approved-professional .workflow-panel[data-workflow-state="next"] { display: none; }
.approved-professional [data-approved-stage][data-workflow-state="other"],
.approved-professional [data-approved-stage][data-workflow-state="next"] { display: none; }

@media (max-width: 760px) {
  .approved-history,
  .approved-detail { padding: 16px; }
  .approved-workflow-steps { grid-template-columns: 1fr; }
  .approved-detail .task-heading-actions { justify-content: flex-start; }
}

/* Native voice page shell.  It deliberately contains no task/video iframe;
   the companion status bridge only enables controls once a V2 proxy exists. */
.approved-voice {
  display: grid;
  gap: 16px;
  margin-top: 0;
  padding: 20px;
  border-color: rgba(255, 255, 255, .12);
  background: #121413;
  box-shadow: none;
}
.approved-voice .audio-tools-actions { margin-top: 0; }
.voice-native-grid {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
}
.voice-native-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  background: #101110;
}
.voice-native-card .subheading { margin-bottom: 13px; }
.voice-native-card .subheading h3 { margin: 0 0 5px; color: #fff; font-size: 19px; }
.voice-native-card .subheading p { margin: 0; color: #a8aaa8; }
.voice-native-field,
.voice-native-upload { display: grid; gap: 6px; margin-top: 11px; color: #fff; font-weight: 750; }
.voice-native-field input,
.voice-native-field select,
.voice-native-field textarea,
.voice-native-upload input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  color: #fff;
  background: #0f1010;
  font: inherit;
}
.voice-native-field textarea { min-height: 118px; resize: vertical; }
.voice-native-upload input { padding: 7px; }
.voice-native-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; color: #d7dad7; font-size: 13px; }
.voice-native-check input { width: 18px; min-height: 18px; margin: 0; }
.voice-native-create > .primary-button { width: 100%; margin-top: 13px; }
.voice-native-selection-grid,
.voice-native-preview-grid,
.voice-native-copy-grid,
.voice-native-duration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.voice-native-preview-grid,
.voice-native-copy-grid,
.voice-native-duration-grid { margin-top: 12px; }
.voice-native-audio { display: grid; gap: 8px; padding: 11px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; background: #171817; }
.voice-native-audio audio { width: 100%; min-height: 38px; }
.voice-native-audio small,
.voice-native-card .status-message { color: #a8aaa8; }
.voice-native-duration-grid output { display: grid; align-items: center; min-height: 42px; padding: 9px 10px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; color: #fff; background: #0f1010; }
.voice-native-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.voice-native-current-result {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.voice-native-history { display: grid; gap: 12px; }
.voice-native-history-list,
.voice-native-list { display: grid; gap: 8px; }
.voice-native-list-item,
.voice-native-history-item {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  background: #111312;
}
.voice-native-list-item audio,
.voice-native-history-item audio { width: 100%; min-height: 34px; }
.voice-native-list-item small,
.voice-native-history-item small { color: #a8aaa8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-native-candidates { display: grid; gap: 8px; }
.voice-native-candidates h4 { margin: 4px 0 0; color: #fff; }
.voice-native-history-detail {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.voice-native-list-fold { margin-top: 14px; }
.voice-native-list-fold[open] { padding-bottom: 10px; }
.voice-native-clone { margin: 14px 0; }
.voice-native-clone audio:not([hidden]) { display: block; width: 100%; margin: 12px 0; }
.voice-native-clone .voice-native-actions { margin-top: 12px; }

@media (max-width: 900px) {
  .voice-native-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .voice-native-selection-grid,
  .voice-native-preview-grid,
  .voice-native-copy-grid,
  .voice-native-duration-grid { grid-template-columns: 1fr; }
}

/* Final neutral-surface pass: ordinary work controls stay black/grey. */
:is(
  .panel,
  .one-click-upload-card,
  .one-click-settings-card,
  .whole-video-setup,
  .one-click-action-zone,
  .approved-history,
  .approved-detail,
  .approved-stage,
  .approved-advanced-history,
  .approved-voice,
  .voice-native-card,
  .task-audio,
  .task-audio-modes article,
  .task-audio-selection,
  .task-audio-row,
  .copy-review,
  .image-preparation,
  .image-operation,
  .video-generation,
  .video-unit,
  .final-video-panel,
  .reference-library,
  .prepared-frame-strip,
  .prepared-frame-card,
  .reference-binding-summary,
  .reference-binding-fold,
  .target-input-card,
  .scene-expansion-card,
  .image-history-card,
  .image-history-preview,
  .video-history-item
) {
  border-color: rgba(255, 255, 255, .13);
  background: var(--ui-ink-3);
  box-shadow: none;
}

:is(
  .one-click-settings-card,
  .one-click-upload-card,
  .whole-video-setup,
  .task-audio,
  .approved-history,
  .approved-detail,
  .approved-voice
) { background: #111; }

/* Shared input finish across all workflow panels. */
:is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea,
  output,
  .task-audio-selection output,
  .task-audio-metrics span,
  .one-click-audio-field select,
  .voice-native-field input,
  .voice-native-field select,
  .voice-native-field textarea,
  .voice-native-upload input
) {
  color: #fff;
  border-color: rgba(255, 255, 255, .2);
  background: #0d0d0d;
}

:is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea
):hover { border-color: rgba(255, 255, 255, .34); }

:is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea
):focus { border-color: #fff; }

/* Brand art should sit directly on the rail/topbar, without an image tile. */
.side-brand,
.brand:has(.brand-wordmark),
.side-brand-logo,
.brand-wordmark {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.side-brand-logo,
.brand-wordmark {
  mix-blend-mode: screen;
  filter: contrast(1.45) saturate(1.05);
}
.brand:has(.brand-wordmark) { overflow: hidden; }

/* Keep the one-click audio choices visually equal. */
.one-click-settings-card .one-click-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}
.one-click-settings-card .one-click-audio-mode,
.one-click-settings-card .one-click-check { grid-column: 1 / -1; }
.one-click-settings-card .one-click-audio-field > .compact-button { width: 100%; }
.one-click-settings-card .one-click-check {
  min-height: 0;
  padding-top: 1px;
}
@media (max-width: 760px) {
  .one-click-settings-card .one-click-controls { grid-template-columns: 1fr; }
  .one-click-settings-card .one-click-audio-mode,
  .one-click-settings-card .one-click-check { grid-column: auto; }
}

/* Professional image step: one compact source/result ledger, no duplicate galleries. */
.image-frame-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.image-model-controls {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: #111;
}
.image-model-controls h4,
.image-model-controls .image-operation-config { margin: 0; }
.image-operation-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.image-prompt-workbench {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: #111;
}
.image-prompt-workbench-heading h5,
.image-prompt-workbench-heading p,
.image-prompt-workbench > .status-message { margin: 0; }
.image-prompt-workbench-heading p { color: #aaa; }
.image-prompt-editors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 9px;
}
.image-prompt-editors:empty { display: none; }
.image-prompt-editor { display: grid; gap: 6px; min-width: 0; }
.image-prompt-editor-label { color: #fff; font-weight: 750; }
.image-prompt-editor textarea {
  min-height: 104px;
  resize: vertical;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  background: #080808;
}
#preparedFrameList[hidden],
#sceneExpansionHistory[hidden] { display: none !important; }
.image-result-pairs {
  border-color: rgba(255, 255, 255, .13);
  background: #111;
}
.image-result-pair-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.image-result-pair-actions .secondary-button { white-space: nowrap; }
.image-operation-history { gap: 10px; }
.image-result-pair {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: #0c0c0c;
}
.image-result-pair.expansion {
  border-style: dashed;
  background: #0a0a0a;
}
.image-result-pair-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.image-result-pair-heading strong { color: #fff; }
.image-result-pair-heading small {
  color: #aaa;
  text-align: right;
}
.image-result-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.image-result-pair figure {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: #050505;
}
.image-result-pair figcaption {
  padding: 7px 9px;
  color: #bdbdbd;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
}
.image-result-pair img,
.image-result-pair-placeholder {
  display: grid;
  width: 100%;
  height: clamp(140px, 22vw, 220px);
  place-items: center;
  object-fit: contain;
  color: #898989;
  background: #000;
}
.image-result-pair-source {
  cursor: crosshair;
  outline: none;
}
.image-result-pair-source:hover,
.image-result-pair-source:focus-visible { border-color: rgba(255, 255, 255, .48); }
.image-result-pair-placeholder { padding: 12px; text-align: center; }
.image-result-pair-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  min-height: 36px;
}
.image-result-pair-footer button { min-width: 116px; }
.task-audio-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.image-result-pair-empty { margin: 0; padding: 12px; color: #999; }

@media (max-width: 700px) {
  .image-frame-toolbar button { width: 100%; }
  .image-operation-heading-actions { justify-content: stretch; }
  .image-operation-heading-actions button { width: 100%; }
  .image-prompt-editors { grid-template-columns: 1fr; }
  .image-candidate-history-heading,
  .image-result-pair-heading { align-items: stretch; flex-direction: column; }
  .image-result-pair-actions { justify-content: flex-start; }
  .image-result-pair-grid { grid-template-columns: 1fr; }
  .image-result-pair img,
  .image-result-pair-placeholder { height: min(46vh, 300px); }
  .image-result-pair-heading small { text-align: left; }
}

/* Image workbench shell: the approved five-screen order, using only the real controls. */
#shotsSection.image-workbench-shell {
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-top: 0;
}
#shotsSection.image-workbench-shell > * { min-width: 0; }
#shotsSection .image-stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
}
#shotsSection > .image-stage-heading { order: 1; }
#shotsSection > #shotTabs { order: 2; }
#shotsSection > #imagePreparationSection { order: 3; }
#shotsSection > .image-candidate-history { order: 4; }
#shotsSection > #imageOperationSection { order: 5; }
#shotsSection > .image-model-controls { order: 6; }
#shotsSection > .reference-library { order: 7; }
#shotsSection > .other-image-changes { order: 8; }
#shotsSection > .image-preparation-footer { order: 9; }
#shotsSection > #sceneExpansionCard { order: 10; }
#shotsSection > .shot-flow-action { order: 11; }
#shotsSection > .image-operation-execution-fold { order: 12; }
#shotsSection > .media-summary-fold { order: 13; }
#shotsSection .image-stage-heading h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}
#shotsSection .image-stage-heading p {
  max-width: 920px;
  margin: 4px 0 0;
  color: #aaa;
  font-size: 14px;
  line-height: 1.45;
}
#shotsSection .image-stage-current {
  flex: 0 0 auto;
  color: #aaa;
  font-size: 14px;
}

#shotsSection .shot-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#shotsSection .shot-tab {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  color: #fff;
  background: #111;
}
#shotsSection .shot-tab:hover { border-color: rgba(255, 255, 255, .38); }
#shotsSection .shot-tab.selected {
  border-color: #fff;
  background: #191919;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
}
#shotsSection .shot-tab-title { font-size: 16px; font-weight: 500; }
#shotsSection .shot-tab-range { color: #aaa; font-size: 13px; }
#shotsSection .shot-tab-frames { color: #aaa; font-size: 12px; opacity: 1; }

#shotsSection .image-frame-picker,
#shotsSection .image-candidate-history,
#shotsSection .image-frame-editor,
#shotsSection .image-model-controls,
#shotsSection .reference-library,
#shotsSection .scene-expansion-card,
#shotsSection > .shot-flow-action,
#shotsSection > .image-preparation-footer,
#shotsSection > .other-image-changes,
#shotsSection > .image-operation-execution-fold,
#shotsSection > .media-summary-fold {
  margin: 0;
  border-color: rgba(255, 255, 255, .14);
  background: #111;
  box-shadow: none;
}
#shotsSection .image-frame-picker,
#shotsSection .image-frame-editor {
  padding: 12px;
  border-radius: 14px;
}
#shotsSection .image-frame-picker legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
#shotsSection .image-frame-picker:focus { outline: none; }
#shotsSection .image-frame-picker:focus-visible { outline: none; }
#shotsSection .image-frame-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 0;
}
#shotsSection .image-frame-picker-heading h4 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
}
#shotsSection .image-frame-picker-heading .image-preparation-help {
  margin: 0;
  color: #b8b8b8;
}
#shotsSection .image-frame-picker-heading output {
  flex: 0 0 auto;
  color: #d8d8d8;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#shotsSection .image-frame-picker .shot-current-only { position: relative; }
#shotsSection .image-frame-picker .shot-source-range {
  display: none;
}
#shotsSection .image-frame-scrubber-row {
  display: grid;
  gap: 7px;
  margin-bottom: 0;
}
#shotsSection #imageFrameScrubber {
  width: 100%;
  margin: 0;
  accent-color: #f7f8f8;
  cursor: pointer;
}
#shotsSection #imageFrameScrubber:disabled { cursor: default; opacity: .5; }
#shotsSection .image-frame-scrubber-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #bfc3c7;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#shotsSection .image-frame-player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
#shotsSection .current-shot-player { position: relative; margin: 0; min-width: 0; }
#shotsSection .current-shot-player figcaption {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 48px;
  left: 10px;
  margin: 0;
  pointer-events: none;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 3px #000;
}
#shotsSection .current-shot-player figcaption span { display: none; }
#shotsSection .video-shell {
  position: relative;
  height: clamp(220px, 28vw, 330px);
  max-height: none;
  border-color: rgba(255, 255, 255, .17);
  border-radius: 13px;
  background: #050505;
}
#shotsSection .video-shell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#shotsSection .image-frame-control-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: #151515;
}
#shotsSection .image-frame-control-panel > strong { color: #fff; font-weight: 600; }
#shotsSection .image-frame-control-panel > p {
  margin: 0;
  color: #aaa;
  font-size: 13px;
  line-height: 1.45;
}
#shotsSection .image-frame-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
#shotsSection .image-frame-toolbar button {
  width: 100%;
  min-height: 38px;
}
#shotsSection .image-frame-control-panel .frame-selection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 0;
}
#shotsSection .frame-selection {
  display: contents;
}
#shotsSection .frame-selection > strong,
#shotsSection .frame-selection > output,
#shotsSection .frame-actions [data-clear-frame-role] { display: none; }
#shotsSection .frame-actions { display: block; }
#shotsSection .frame-actions button { width: 100%; min-height: 38px; padding: 7px 8px; }
#shotsSection .frame-selection:nth-child(2) [data-frame-role="key"]:not(:disabled) {
  color: #080808;
  border-color: #f4f4f4;
  background: #f4f4f4;
}

#shotsSection .image-candidate-history,
#shotsSection .image-model-controls,
#shotsSection .reference-library,
#shotsSection .scene-expansion-card,
#shotsSection > .shot-flow-action,
#shotsSection > .image-preparation-footer {
  padding: 12px;
  border-radius: 14px;
}
#shotsSection .image-candidate-history-heading h5,
#shotsSection .scene-expansion-heading h5,
#shotsSection .image-model-controls-heading h4,
#shotsSection .reference-library-heading h4 {
  margin: 0 0 5px;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
}
#shotsSection .image-candidate-history-heading p,
#shotsSection .scene-expansion-heading p,
#shotsSection .image-model-controls-heading p,
#shotsSection .reference-library-heading p {
  margin: 0;
  color: #aaa;
  line-height: 1.5;
}
#shotsSection #imageOperationHistory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#shotsSection .image-result-pair {
  gap: 8px;
  padding: 8px;
  border-color: rgba(255, 255, 255, .14);
  border-radius: 11px;
  background: #151515;
}
#shotsSection .image-result-pair.is-selected {
  border-color: #fff;
  box-shadow: inset 0 0 0 1px #fff;
}
#shotsSection .image-result-pair.expansion { border-style: solid; }
#shotsSection .image-result-pair-grid { gap: 7px; }
#shotsSection .image-result-pair figure {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 5px;
  border: 0;
  background: transparent;
}
#shotsSection .image-result-pair figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  order: 2;
  padding: 0;
  color: #eee;
  border: 0;
  font-size: 12px;
}
#shotsSection .image-result-pair-meta { color: #aaa; }
#shotsSection .image-result-pair img,
#shotsSection .image-result-pair-placeholder {
  order: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  object-fit: contain;
}
#shotsSection .image-result-pair-footer { min-height: 0; }
#shotsSection .image-result-pair-footer button { width: 100%; min-height: 38px; }
#shotsSection .image-result-pair-footer .secondary-button:not(:disabled) {
  color: #080808;
  border-color: #f3f3f3;
  background: #f3f3f3;
}
#shotsSection .image-video-sync-hint { margin: 0; color: #aaa; font-size: 13px; }

#shotsSection .image-frame-editor .image-operation-heading { margin-bottom: 12px; }
#shotsSection .image-frame-editor .image-operation-heading h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}
#shotsSection .image-frame-editor .image-region-fold {
  margin: 0;
  border: 0;
  background: transparent;
}
#shotsSection .image-frame-editor .image-region-fold > summary,
#shotsSection .image-frame-editor .image-region-heading,
#shotsSection .image-frame-editor .image-region-source-row { display: none; }
#shotsSection .image-frame-editor .image-region-editor { padding: 0; }
#shotsSection .image-frame-editor .image-region-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
#shotsSection .image-frame-editor .image-region-pane,
#shotsSection .image-frame-editor .image-region-result-pane {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  gap: 7px;
  margin: 0;
}
#shotsSection .image-frame-editor .image-region-pane-label,
#shotsSection .image-frame-editor .image-region-result-pane figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
}
#shotsSection .image-frame-editor .image-region-result-pane figcaption small {
  display: none;
}
#shotsSection .image-frame-editor [role="button"].image-region-pane,
#shotsSection .image-frame-editor [role="button"].image-region-result-pane { cursor: pointer; border-radius: 10px; }
#shotsSection .image-frame-editor .image-region-compare [role="button"]:focus-visible {
  outline: 2px solid #f1d496;
  outline-offset: 4px;
}
#shotsSection .image-frame-editor .is-edit-source .image-region-stage { border-color: #f1d496; box-shadow: 0 0 0 1px #f1d496; }
#shotsSection .image-frame-editor .is-edit-source > .image-region-pane-label::after,
#shotsSection .image-frame-editor .is-edit-source > figcaption::after { content: "已选中"; color: #f1d496; font-size: 12px; }
#shotsSection .image-frame-editor .image-region-overlay-label {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  left: 10px;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 6px 9px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .72);
  font-size: 12px;
  pointer-events: none;
}
#shotsSection .image-frame-editor .image-region-overlay-label[hidden] { display: none; }
#shotsSection .image-frame-editor .image-region-stage {
  position: relative;
  min-height: 190px;
  max-height: 300px;
  border-style: solid;
  border-color: rgba(255, 255, 255, .16);
  background: #080808;
}
#shotsSection .image-frame-editor .image-region-stage canvas { max-height: 298px; }
#shotsSection .image-frame-editor .image-region-result-pane img,
#shotsSection .image-frame-editor .image-region-result-empty {
  display: grid;
  width: 100%;
  min-height: 190px;
  max-height: 300px;
  place-items: center;
  object-fit: contain;
  color: #888;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  background: #080808;
}
#shotsSection .image-frame-editor .image-region-stage img {
  width: auto;
  max-width: 100%;
  min-height: 0;
  max-height: 298px;
  object-fit: contain;
  border: 0;
}
#shotsSection .image-direct-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 12px;
}
#shotsSection .image-direct-edit .image-region-instruction { min-width: 0; }
#shotsSection .image-direct-edit .image-region-instruction > span { color: #aaa; font-size: 13px; }
#shotsSection .image-direct-edit #imageRegionClear { align-self: end; white-space: nowrap; }
#shotsSection .image-region-list { display: none; }
#shotsSection .image-frame-editor .image-region-result-pane img[hidden],
#shotsSection .image-frame-editor .image-region-stage img[hidden],
#shotsSection .image-frame-editor .image-region-stage canvas[hidden],
#shotsSection .image-frame-editor .image-region-result-empty[hidden] { display: none; }
#shotsSection .image-editor-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}
#shotsSection .image-editor-action-row .status-message { display: none; margin: 0; }
#shotsSection .image-editor-action-row .status-message.error { display: block; }
#shotsSection .image-operation-heading-actions { justify-content: flex-start; }
#shotsSection .image-prompt-workbench {
  margin-top: 13px;
  padding: 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: #151515;
}
#shotsSection .image-prompt-workbench-heading h5 { margin: 0 0 5px; font-size: 17px; }
#shotsSection .image-prompt-workbench-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
#shotsSection .image-prompt-workbench > .status-message { display: none; }
#shotsSection .image-prompt-workbench > .status-message.error { display: block; }
#shotsSection .image-prompt-editor textarea { min-height: 100px; }

#shotsSection .image-model-controls { gap: 12px; }
#shotsSection .image-model-controls-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
#shotsSection .image-model-controls .image-operation-config-simple {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
#shotsSection .image-model-picker { display: block; }
#shotsSection .image-model-picker .image-setting-field { width: 100%; }
#shotsSection #professionalImageSettingsSlot,
#shotsSection #imageSettingsFold { display: block; }
#shotsSection #imageSettingsFold {
  margin: 0;
  border: 0;
  background: transparent;
}
#shotsSection #imageSettingsFold > summary { display: none; }
#shotsSection #imageSettingsFold .image-operation-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 0;
  padding: 0;
}
#shotsSection #imageSettingsFold .video-setting-row {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  border: 0;
  background: transparent;
}
#shotsSection #imageSettingsFold .video-setting-row > .image-setting-field:last-child {
  display: none;
}
#shotsSection #imageFeeStatus { display: none; }
#shotsSection .image-model-controls .image-setting-field small { display: none; }
#shotsSection .image-model-controls-heading h4 { font-weight: 500; }
#shotsSection .advanced-fold > summary,
#shotsSection :is(
  .image-setting-field,
  .image-region-source-row label,
  .image-region-controls label,
  .target-input-card > label
) { color: #f1f1f1; }
#shotsSection .image-setting-field small,
#shotsSection .target-input-card small { color: #aaa; }
#shotsSection .video-setting-row {
  border-color: rgba(255, 255, 255, .1);
  background: #111;
}

#shotsSection .reference-library {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}
#shotsSection .target-input-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 0;
}
#shotsSection .target-input-card {
  padding: 12px;
  border-color: rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: #111;
}
#shotsSection .target-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#shotsSection .target-reference-count { color: #aaa; font-size: 13px; }
#shotsSection .target-toggle strong { color: #fff; font-size: 16px; font-weight: 500; }
#shotsSection .target-input-card > label > span { display: none; }
#shotsSection .image-video-sync-hint { display: none; }
#shotsSection .target-input-card textarea {
  min-height: 52px;
  border-color: rgba(255, 255, 255, .18);
  background: #0c0c0c;
}
#shotsSection .reference-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
#shotsSection .reference-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
#shotsSection .reference-file-trigger {
  min-height: 36px;
  padding: 7px 11px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 9px;
  cursor: pointer;
  background: #191919;
}
#shotsSection .reference-upload > span { color: #aaa; font-size: 13px; }
#shotsSection .reference-upload button:disabled { display: none; }
#shotsSection .professional-reference-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
#shotsSection .professional-reference-list .global-reference-item {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 7px 8px;
  border-color: rgba(255, 255, 255, .13);
  border-radius: 10px;
  color: #fff;
  background: #101010;
}
#shotsSection .professional-reference-list .global-reference-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #080808;
}
#shotsSection .professional-reference-list .global-reference-details {
  display: grid;
  min-width: 0;
  gap: 5px;
}
#shotsSection .professional-reference-list .global-reference-use {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d5d5d5;
  font-size: 13px;
}
#shotsSection .professional-reference-list .global-reference-use input { margin: 0; }
#shotsSection .professional-reference-list .global-reference-remove {
  min-height: 36px;
  padding: 7px 10px;
  color: #ffaaa5;
  border-color: rgba(255, 110, 105, .38);
}
#shotsSection .reference-binding-fold { margin: 0; }
#shotsSection > .shot-flow-action,
#shotsSection > .other-image-changes,
#shotsSection > .image-preparation-footer,
#shotsSection > #sceneExpansionCard,
#shotsSection > .image-operation-execution-fold,
#shotsSection > .media-summary-fold,
#shotsSection .reference-binding-fold,
#shotsSection .image-operation-summary,
#shotsSection #backgroundEditTargetHint {
  display: none !important;
}
#shotsSection > .other-image-changes { border-radius: 13px; }
#shotsSection > .image-preparation-footer {
  display: flex;
  align-items: center;
  gap: 14px;
}
#shotsSection > .image-preparation-footer .primary-button { min-width: 220px; }
#shotsSection .scene-expansion-details { background: #151515; }
#shotsSection > .shot-flow-action { align-items: center; }
#shotsSection > .shot-flow-action label {
  display: grid;
  flex: 0 1 300px;
  gap: 6px;
}
#shotsSection > .image-operation-execution-fold,
#shotsSection > .media-summary-fold { border-radius: 13px; }

@media (max-width: 900px) {
  #shotsSection #imageOperationHistory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  #shotsSection.image-workbench-shell { gap: 12px; }
  #shotsSection .image-frame-picker,
  #shotsSection .image-frame-editor,
  #shotsSection .image-candidate-history,
  #shotsSection .image-model-controls,
  #shotsSection .reference-library,
  #shotsSection .scene-expansion-card,
  #shotsSection > .shot-flow-action,
  #shotsSection > .image-preparation-footer { padding: 13px; }
  #shotsSection .image-frame-picker-heading,
  #shotsSection .image-editor-action-row { align-items: stretch; flex-direction: column; }
  #shotsSection .image-frame-picker-heading output { align-self: flex-start; }
  #shotsSection .current-shot-player figcaption {
    align-items: flex-start;
    flex-direction: column;
  }
  #shotsSection .image-frame-player-grid { grid-template-columns: minmax(0, 1fr); }
  #shotsSection .video-shell { height: clamp(180px, 56vw, 220px); max-height: none; }
  #shotsSection .image-frame-editor .image-region-compare { grid-template-columns: minmax(0, 1fr); }
  #shotsSection .image-frame-editor .image-region-stage { min-height: 230px; }
  #shotsSection .image-frame-editor .image-region-result-pane img,
  #shotsSection .image-frame-editor .image-region-result-empty { min-height: 230px; }
  #shotsSection .image-operation-heading-actions button,
  #shotsSection > .image-preparation-footer .primary-button { width: 100%; }
  #shotsSection .professional-reference-list .global-reference-item {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    min-height: 72px;
  }
  #shotsSection .professional-reference-list .global-reference-thumb { width: 54px; height: 54px; }
}

@media (max-width: 560px) {
  #shotsSection .shot-tabs,
  #shotsSection .image-frame-control-panel .frame-selection-grid,
  #shotsSection #imageOperationHistory,
  #shotsSection .professional-reference-list,
  #shotsSection .image-model-controls .image-operation-config-simple {
    grid-template-columns: minmax(0, 1fr);
  }
  #shotsSection .image-stage-heading,
  #shotsSection .image-model-controls-heading,
  #shotsSection .image-prompt-workbench-heading,
  #shotsSection .image-editor-action-row {
    align-items: stretch;
    flex-direction: column;
  }
  #shotsSection .image-stage-current { align-self: flex-start; }
  #shotsSection .image-direct-edit,
  #shotsSection .reference-upload { grid-template-columns: minmax(0, 1fr); }
  #shotsSection .reference-file-trigger { text-align: center; }
  #shotsSection .image-frame-scrubber-labels { font-size: 12px; }
}

/* 2026-08-26 approved one-click/video/final layout: neutral surfaces, one real selection. */
.one-click-surface :is(
  .whole-video-setup-heading h3,
  .target-toggle strong,
  .target-input-card > label > span,
  .one-click-model > span,
  .one-click-audio-field > label,
  .subtitle-choice strong
) { color: var(--ui-text); }
.one-click-surface :is(
  .whole-video-setup-heading p,
  .global-target-input-grid small,
  .one-click-model small,
  .subtitle-choice small
) { color: var(--ui-muted); }
.global-reference-item,
.global-reference-item.pending-reference-item,
.global-reference-item.saved-reference-item {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .14);
  background: #101010;
}
.global-reference-item.is-removed { color: var(--ui-muted-2); }
.global-reference-thumb { background: #080808; }
.global-reference-remove {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .22);
  background: transparent;
}
.global-reference-remove:hover:not(:disabled) { background: rgba(255, 255, 255, .07); }
.one-click-subtitle-choice {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, .11);
  background: #101010;
}

.one-click-audio-card {
  display: flex;
  flex-direction: column;
}
.one-click-audio-card .one-click-action-zone {
  margin-top: 12px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--ui-line);
  border-radius: 0;
  background: transparent;
}
.one-click-audio-card .one-click-action-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.one-click-audio-card .one-click-action-bar > * { width: 100%; min-width: 0; }

/* Person, product and background stay side by side; each card reads top to bottom. */
.one-click-surface .global-target-input-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.one-click-surface .global-target-input-grid .target-input-card {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
.one-click-surface .global-target-input-grid .target-toggle,
.one-click-surface .global-target-input-grid .target-input-card > small { grid-column: auto; }

#shotsSection .reference-library > .target-input-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
#shotsSection .reference-library > .target-input-grid > .target-input-card {
  min-width: 0;
  align-content: start;
}
#shotsSection .professional-reference-list { grid-template-columns: minmax(0, 1fr); }

/* Internal provider request JSON remains wired, but is not customer-facing. */
.video-operation-history { display: none !important; }

/* Neutralize the last status cards that still inherited the old green theme. */
.task-audio-confirmed-copy,
.copy-review-options select,
.global-reference-file input {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, .14);
  background: #0f0f0f;
}
.task-audio-confirmed-copy p { color: var(--ui-muted); }

/* Before a result exists, reserve exactly the two comparison positions. */
.final-comparison-stage:empty {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.final-comparison-stage:empty::before,
.final-comparison-stage:empty::after {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  color: var(--ui-muted);
  background: #0b0b0b;
}
.final-comparison-stage:empty::before { content: "原视频"; }
.final-comparison-stage:empty::after { content: "成片"; }

@media (max-width: 820px) {
  .one-click-surface .global-target-input-grid,
  #shotsSection .reference-library > .target-input-grid,
  .final-comparison-stage:empty { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .one-click-audio-card .one-click-action-bar { grid-template-columns: minmax(0, 1fr); }
}

.video-unit-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  min-height: 0;
  margin-top: 14px;
}
.video-unit-tabs:empty { display: none; }
.video-unit-tabs button {
  min-width: 0;
  min-height: 50px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: var(--ui-muted);
  background: #171817;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.video-unit-tab { width: 100%; }
.video-unit-tabs .video-unit-tab[aria-selected="true"],
.video-unit-tabs .video-unit-tab[data-selected="true"] {
  color: var(--ui-text);
  border-color: var(--ui-text);
  background: #202120;
  box-shadow: inset 3px 0 var(--ui-text);
}
.video-unit-tabs button small { display: block; margin-top: 3px; color: var(--ui-muted-2); }

.video-upstream-materials {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  background: #111;
}
.video-upstream-materials h5 { margin: 0; color: var(--ui-text); font-size: 15px; }
.video-upstream-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 148px));
  gap: 9px;
  min-width: 0;
}
.video-upstream-images > .status-message { grid-column: 1 / -1; margin: 0; }
.video-upstream-image {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: #0b0b0b;
}
.video-upstream-image img,
.video-upstream-empty {
  width: 100%;
  height: 88px;
  border-radius: 7px;
  background: #070707;
}
.video-upstream-image img { display: block; object-fit: contain; }
.video-upstream-empty {
  display: grid;
  place-items: center;
  color: var(--ui-muted-2);
  font-size: 12px;
  text-align: center;
}
.video-upstream-image figcaption {
  overflow-wrap: anywhere;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.4;
}
.task-history-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.task-history-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.task-history-select-all { display: inline-flex; align-items: center; gap: 6px; color: var(--ui-muted); white-space: nowrap; }
.task-history-select { width: 18px; height: 18px; accent-color: var(--ui-muted-2); }
.video-upstream-image select { width: 100%; min-width: 0; }
.video-upstream-audio {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.video-upstream-audio > strong { color: var(--ui-text); }
.video-upstream-audio > .status-message { margin: 0; }
.video-upstream-audio-row {
  display: grid;
  grid-template-columns: minmax(170px, .42fr) minmax(240px, .58fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: #0b0b0b;
}
.video-upstream-audio-row span { min-width: 0; overflow-wrap: anywhere; color: var(--ui-muted); font-size: 13px; }
.video-upstream-audio-row audio { width: 100%; min-width: 0; height: 36px; }

.final-assembly-selection,
.final-shot-comparison {
  min-width: 0;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 13px;
  background: #141514;
}
.final-assembly-selection-heading { margin-bottom: 12px; }
.video-shot-comparison { min-width: 0; margin: 12px 0; }
.video-shot-comparison > h4 { margin: 0 0 10px; }
.video-shot-comparison-media { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.final-assembly-candidates { display: grid; gap: 12px; }
.final-assembly-candidates:empty { display: none; }
.final-assembly-unit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  background: #101010;
}
.final-assembly-unit > h4,
.final-assembly-unit > small,
.final-assembly-unit > .status-message { grid-column: 1 / -1; }
.final-assembly-unit > h4 { margin: 0; color: var(--ui-text); font-size: 16px; }
.final-assembly-unit > small { color: var(--ui-muted-2); }
.final-assembly-unit > .status-message { margin: 0; }
.final-video-candidate {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: #151515;
}
.final-video-candidate.adopted {
  border-color: var(--ui-text);
  box-shadow: inset 3px 0 var(--ui-text);
}
.final-video-candidate > strong { min-width: 0; overflow-wrap: anywhere; color: var(--ui-text); font-size: 13px; }
.final-video-candidate video {
  display: block;
  width: 100%;
  height: clamp(150px, 22vw, 230px);
  max-height: 230px;
  border: 0;
  border-radius: 8px;
  background: #070707;
  object-fit: contain;
}
.final-video-candidate > button { width: 100%; min-height: 38px; }
.final-video-empty {
  width: 100%;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
}
#finalResult[data-has-final="false"] > :is(
  .section-heading,
  #finalReadyStatus,
  .final-result-actions:not(.final-assembly-actions),
  .final-shot-comparison
) { display: none !important; }
#finalResult[data-has-final="false"] > .final-comparison-stage { margin-top: 0; }
#finalResult[data-has-final="false"] > .final-assembly-selection[data-has-candidates="false"] {
  display: none;
}
.final-assembly-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.final-assembly-actions .status-message { flex: 1 1 auto; margin: 0; }
.final-assembly-actions .local-assembly-action { flex: 0 0 auto; min-width: 128px; }

/* Current/next/completed describe progress; only the tab being viewed owns the white frame. */
.approved-workflow-steps button:not([data-inspected="true"]) {
  border-color: rgba(255, 255, 255, .14);
  box-shadow: none;
  outline: 0;
}
.approved-workflow-steps button[data-inspected="true"] {
  color: var(--ui-text);
  border-color: var(--ui-text);
  background: #202120;
  box-shadow: inset 3px 0 var(--ui-text);
  outline: 0;
}

@media (max-width: 760px) {
  .video-shot-comparison-media { grid-template-columns: minmax(0, 1fr); }
  .one-click-visual-controls,
  .one-click-settings-card .one-click-controls { grid-template-columns: minmax(0, 1fr); }
  .one-click-image-setting,
  .one-click-subtitle-choice,
  .one-click-settings-card .one-click-audio-mode,
  .one-click-settings-card .one-click-check { grid-column: auto; }
  .one-click-card-heading,
  .final-assembly-actions { align-items: stretch; flex-direction: column; }
  .one-click-card-heading .compact-button,
  .final-assembly-actions .local-assembly-action { width: 100%; }
  .video-upstream-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-upstream-audio-row { grid-template-columns: minmax(0, 1fr); }
  .final-assembly-unit { grid-template-columns: minmax(0, 1fr); }
  .final-video-candidate video { height: min(54vw, 220px); }
  .final-video-empty { min-height: min(54vw, 220px); }
}

@media (max-width: 420px) {
  .video-upstream-images { grid-template-columns: minmax(0, 1fr); }
}

/* Compact the approved cover into one continuous brand-and-action layer. */
.app-content {
  background: var(--ui-black);
}
.side-brand { padding: 0 8px 8px; }
.topbar {
  position: relative;
  justify-content: space-between;
  min-height: 44px;
  padding-block: 3px;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}
main { margin-top: 0; }
.replica-mode {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0 0 12px;
  padding: 0;
}
.replica-mode > :first-child { display: none; }
.replica-mode-options {
  width: min(100%, 780px);
  justify-self: start;
}

/* Keep only the useful one-click controls and remove inherited empty height. */
.one-click-surface > .section-heading { display: none; }
.one-click-top-grid { align-items: stretch; }
.one-click-audio-card .one-click-controls { flex: none; }
.one-click-audio-card .one-click-action-zone { margin-top: auto; }
.one-click-top-grid:has(#oneClickGeneratedAudioSettings[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.one-click-audio-card:has(#oneClickGeneratedAudioSettings[hidden]) .one-click-action-zone {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.one-click-audio-card .one-click-audio-field {
  grid-template-rows: auto auto auto auto;
  gap: 5px;
  font-size: 14px;
}
.one-click-audio-card .one-click-audio-field select {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 13px;
}
.one-click-audio-card .one-click-audio-field .compact-button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}
.one-click-audio-card .one-click-audio-field small,
.one-click-audio-card .one-click-check {
  min-height: 0;
  font-size: 11px;
  line-height: 1.4;
}

/* These legacy professional audio blocks stay wired for compatibility only. */
.task-audio-modes { display: none !important; }
.task-audio-quick-actions {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  background: #101110;
}
.task-audio-quick-actions .task-audio-authorization { margin: 0; }
.task-audio-next-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.task-audio-next-actions #taskAudioGenerated { grid-column: 1 / -1; }
.task-audio-next-actions:has(#taskAudioAdopt:not([hidden])) #taskAudioGenerated {
  grid-column: auto;
}
.task-audio-quick-actions #taskAudioAdopted { margin: 0; }
@media (max-width: 620px) {
  .task-audio-next-actions { grid-template-columns: 1fr; }
}

/* Canvas materialization stays on the real image/video steps, not the main card. */
#materializeCurrentLibtv { display: none !important; }

/* Keep manual copy editing available without turning it into another long page. */
#oneClickCopySlot, #oneClickAudioSettings { min-width: 0; }
#oneClickCopySlot > #copyReviewSection:not([hidden]),
#oneClickAudioSettings > #taskAudioSection { display: block; }
#oneClickCopySlot > .copy-review { margin: 14px 0; }
#oneClickAudioSettings > .task-audio { margin: 14px 0; padding: 14px; }
#oneClickAudioSettings .task-audio-heading,
#oneClickAudioSettings .task-audio-confirmed-copy,
#oneClickAudioSettings .task-audio-next-actions,
#oneClickAudioSettings .task-audio-modes > article:first-child,
#oneClickAudioSettings .task-audio-history { display: none; }
#oneClickAudioSettings .task-audio-modes { grid-template-columns: minmax(0, 1fr); }
.copy-review {
  padding: 14px;
  border-color: rgba(255, 255, 255, .12);
  background: #121212;
}
.copy-review-heading { align-items: center; }
.copy-review-heading h3 { margin: 0; font-size: 20px; }
.copy-review-options { display: none !important; }
.copy-review-heading p,
.copy-review > small { color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
.copy-review-column-labels { color: var(--ui-text); }
.copy-review > .status-message {
  margin: 6px 0 9px;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.45;
}
.copy-review-rows {
  max-height: min(46vh, 420px);
  margin: 8px 0;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.copy-review .task-audio-row {
  gap: 8px 10px;
  padding: 10px;
  border-color: rgba(255, 255, 255, .1);
  background: #0d0d0d;
}
.copy-review .task-audio-row textarea {
  min-height: 64px;
  padding: 8px;
  border-color: rgba(255, 255, 255, .14);
  color: var(--ui-text);
  background: #111;
  font-size: 13px;
  line-height: 1.45;
}
.copy-review-row-heading { align-items: center; }
.copy-review-actions { margin: 9px 0 0; }
.copy-review-actions > button[disabled],
.copy-review-actions > button[hidden] { display: none; }
.copy-review-actions:not(:has(button:not([disabled]):not([hidden]))) { display: none; }

@media (min-width: 501px) and (max-width: 680px) {
  .copy-review .task-audio-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .copy-review-row-heading { align-items: center; flex-direction: row; }
}

@media (max-width: 500px) {
  .copy-review { padding: 11px; }
  .copy-review-rows { max-height: 55vh; }
}

@media (max-width: 760px) {
  .replica-mode-options { width: 100%; }
}

@media (max-width: 760px) { .task-history-row { grid-template-columns: 1fr; } }

/* 488 skin: compact shared chrome, original controls and workflow state. */
.app-shell { grid-template-columns: 104px minmax(0, 1fr); }
.side-rail { padding: 14px 9px; }
.side-brand { padding: 0 0 18px; }
.side-brand-logo { width: 84px; height: 62px; }
.side-nav { gap: 8px; }
.side-nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 5px;
  padding: 11px 4px;
  border-radius: 8px;
  text-align: center;
}
.side-nav-item strong { font-size: 12px; font-weight: 600; }
.side-nav-item > span:first-child,
.side-nav-item > span.side-nav-icon { width: 30px; height: 26px; border: 0; background: transparent; }
.side-nav-item.active > span:first-child,
.side-nav-item[aria-expanded="true"] > span:first-child { color: var(--ui-primary); background: transparent; }
.side-nav-icon svg { width: 20px; height: 20px; }
.topbar { min-height: 54px; padding: 3px 18px; }
.brand:has(.brand-wordmark) { width: 160px; height: 48px; background: var(--ui-black); }
.brand-wordmark { top: -19px; left: 0; width: 145px; }
.topbar-actions { gap: 7px; }
main { width: calc(100% - 36px); max-width: 1920px; margin: 0 auto 18px; }
.replica-mode { margin-bottom: 12px; }
.replica-mode-options { width: min(100%, 760px); gap: 7px; }
.replica-mode-option { min-height: 46px; gap: 1px; padding: 7px 13px; border-radius: 8px; }
.replica-mode-option strong { font-size: 14px; font-weight: 650; }
.replica-mode-option span { font-size: 11px; line-height: 1.4; }
.panel,
.approved-history,
.approved-detail,
.approved-voice { padding: 16px; border-radius: 10px; background: var(--ui-ink-3); }
h1, h2, h3, h4, h5, h6 { font-weight: 650; }
.section-heading { gap: 12px; margin-bottom: 13px; }
.section-heading h2,
.approved-history .section-heading h2,
.approved-detail-heading h2 { font-size: 21px; }
.section-heading p, .subheading p { line-height: 1.5; }
.settings-link,
.primary-button,
.secondary-button,
.compact-button,
.history-jump > summary { min-height: 34px; padding: 7px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.primary-button { min-width: 136px; }
.badge { padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 550; }
.badge.complete, .badge.ok, .media-status.success { color: #c7b99c; }
.status-message { font-size: 12px; line-height: 1.5; }
.advanced-fold { border-radius: 7px; }
.advanced-fold > summary { padding: 9px 11px; color: var(--ui-text); font-size: 12px; font-weight: 600; }
.advanced-fold[open] > summary { border-bottom-color: var(--ui-line); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select, textarea { font-family: inherit; font-size: 12px; font-weight: 400; border-radius: 6px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select { min-height: 34px; padding: 7px 9px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select, textarea, output { color: var(--ui-text); border-color: var(--ui-line); background: var(--ui-ink-2); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ui-primary); }
input[type="file"]::file-selector-button,
.global-reference-file input::file-selector-button,
.file-picker input::file-selector-button { padding: 6px 9px; border-radius: 5px; background: #2a2926; color: var(--ui-text); font-size: 12px; font-weight: 500; }
textarea { line-height: 1.55; }
.runtime-settings-popover { z-index: 30; padding: 16px; border-color: var(--ui-line-strong); border-radius: 10px; background: #20201e; box-shadow: 0 12px 35px #0008; }
.runtime-settings-heading strong { font-size: 15px; }
.runtime-settings-heading button { background: #2b2a27; }
.runtime-settings-popover label { color: var(--ui-muted); font-weight: 550; }
.runtime-settings-popover select { min-height: 36px; padding: 8px 10px; background: var(--ui-ink-2); }
.runtime-settings-popover .primary-button { min-height: 36px; }

/* One-click: source across the top, settings and replacements beside the preview. */
.one-click-surface { margin: 0; padding: 0; border: 0; background: transparent; }
.one-click-import-header { padding: 10px 13px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-ink-3); }
.one-click-import-header .import-row { gap: 12px; align-items: center; }
.one-click-import-header .file-picker { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; font-weight: 550; }
.one-click-import-header .file-picker input { min-height: 35px; padding: 4px 6px; }
.one-click-import-header .status-message { margin: 5px 0 0; }
.one-click-top-grid,
.one-click-top-grid:has(#oneClickGeneratedAudioSettings[hidden]) { grid-template-columns: minmax(0, 1fr); gap: 0; align-content: start; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-ink-3); }
.one-click-top-grid { container-type: inline-size; }
.one-click-upload-card,
.one-click-settings-card { padding: 13px; border: 0; border-radius: 0; background: transparent; }
.one-click-upload-card { gap: 12px; }
.one-click-settings-card { padding-top: 0; }
.one-click-settings-card:has(#oneClickGeneratedAudioSettings[hidden]):has(#oneClickCopySlot:empty):has(#oneClickAudioSettings[hidden]) { padding: 0; }
.one-click-card-heading { gap: 8px; align-items: center; }
.one-click-card-heading h3,
.one-click-settings-heading h3,
.whole-video-setup-heading h3 { font-size: 15px; line-height: 1.4; margin: 0 0 4px; }
.one-click-card-heading p,
.one-click-settings-heading p { font-size: 11px; line-height: 1.45; }
.one-click-card-heading > .compact-button { flex: 0 0 auto; min-height: 30px; padding: 5px 8px; font-size: 11px; }
.one-click-copy-controls { gap: 9px; margin: 0; }
.one-click-visual-controls { gap: 10px; padding-top: 12px; }
.one-click-model { gap: 5px; font-size: 12px; font-weight: 550; }
.one-click-model select { min-height: 34px; padding: 7px 8px; font-size: 12px; }
.one-click-model small { font-size: 11px; line-height: 1.5; }
.one-click-visual-controls > .advanced-fold { margin: 0; }
.one-click-video-settings { grid-column: 1 / -1; }
.one-click-video-settings > :not(summary),
.one-click-image-setting > label { margin: 10px; }
.one-click-video-settings > .video-settings { margin: 10px; }
.one-click-video-settings .video-settings,
#oneClickImageSettingsSlot .video-settings { grid-template-columns: minmax(0, 1fr); gap: 7px; }
.one-click-top-grid .video-setting-row { grid-template-columns: minmax(0, 1fr) 82px; gap: 7px; padding: 8px; border-radius: 6px; background: var(--ui-ink-2); }
.one-click-top-grid .video-setting-row small { font-size: 11px; }
.one-click-top-grid .video-setting-row :is(input, select) { min-width: 0; }
.one-click-top-grid .video-setting-row label { min-width: 0; font-size: 11px; }
.one-click-settings-card .one-click-controls { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.one-click-settings-heading { margin: 5px 0 9px; }
#oneClickCopySlot > .copy-review,
#oneClickAudioSettings > .task-audio { margin: 10px 0 0; padding: 10px; border-radius: 7px; background: var(--ui-ink-2); }
#oneClickCopySlot .copy-review-heading { align-items: start; gap: 7px; flex-wrap: wrap; }
#oneClickCopySlot .copy-review-heading h3 { font-size: 14px; }
#oneClickCopySlot .copy-review-rows { max-height: none; overflow: visible; padding: 0; scrollbar-gutter: auto; }
#oneClickCopySlot .copy-review .task-audio-row { grid-template-columns: minmax(0, 1fr); }
#oneClickCopySlot .copy-review-column-labels { grid-template-columns: minmax(0, 1fr); margin: 8px 0 0; gap: 2px; }
#oneClickCopySlot .copy-review-row-heading { flex-wrap: wrap; }
#oneClickCopySlot .copy-review-actions { gap: 6px; }
#oneClickCopySlot .copy-review-actions > button { min-width: 0; flex: 1 1 120px; }
#oneClickAudioSettings .task-audio-selections { grid-template-columns: minmax(0, 1fr); gap: 8px; }
#oneClickAudioSettings .task-audio-selection { padding: 9px; }
#oneClickAudioSettings .task-audio-metrics { grid-template-columns: minmax(0, 1fr); }
.one-click-surface .whole-video-setup { min-width: 0; margin: 0; padding: 13px; border-radius: 9px; background: var(--ui-ink-3); }
.whole-video-setup-heading { gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.whole-video-setup-heading > div { flex: 1 1 190px; }
.whole-video-setup-heading p { font-size: 11px; line-height: 1.5; }
.one-click-surface .global-target-input-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
.one-click-surface .global-target-input-grid .target-input-card { padding: 10px; gap: 7px; border-color: var(--ui-line); border-radius: 7px; background: var(--ui-ink-2); }
.one-click-surface .target-toggle { gap: 7px; font-size: 12px; }
.one-click-surface .target-toggle input { width: 15px; height: 15px; }
.one-click-surface .target-input-card > label { gap: 4px; font-size: 11px; font-weight: 500; }
.one-click-surface .target-input-card textarea { min-height: 56px; height: 56px; padding: 7px 8px; border-radius: 6px; resize: vertical; }
.one-click-surface .global-reference-file input { min-height: 32px; padding: 3px 5px; }
.one-click-surface .target-input-card small { font-size: 11px; line-height: 1.45; }
.one-click-surface .global-reference-list { gap: 6px; }
.one-click-surface .global-reference-item { padding: 6px; border-radius: 6px; }
.one-click-surface .global-reference-thumb { width: 44px; height: 44px; }
#oneClickFinalSlot { min-width: 0; padding: 12px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-ink-3); }
#oneClickFinalSlot:not(:has(#finalResult:not([hidden]))) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#oneClickFinalSlot:not(:has(#finalResult:not([hidden])))::before,
#oneClickFinalSlot:not(:has(#finalResult:not([hidden])))::after { display: grid; place-items: center; min-height: 240px; border: 1px solid var(--ui-line); border-radius: 7px; color: var(--ui-muted-2); background: #0d0d0d; font-size: 13px; }
#oneClickFinalSlot:not(:has(#finalResult:not([hidden])))::before { content: "原视频"; }
#oneClickFinalSlot:not(:has(#finalResult:not([hidden])))::after { content: "复刻成片"; }
#oneClickFinalSlot #finalResult { margin: 0; }
#oneClickFinalSlot .final-video-comparison { gap: 10px; }
#oneClickFinalSlot .final-video-panel { padding: 9px; border-radius: 7px; background: #0d0d0d; }
#oneClickFinalSlot .final-video-panel figcaption { margin-bottom: 8px; font-size: 12px; font-weight: 550; }
#oneClickFinalSlot .final-video-panel :is(video, .final-video-empty) { width: 100%; height: 100%; min-height: 0; max-height: none; object-fit: contain; border-radius: 4px; }
.one-click-surface .one-click-progress { margin: 0; padding: 11px 13px; border-radius: 9px; background: var(--ui-ink-3); }
.one-click-progress-heading { align-items: center; gap: 8px; }
.one-click-progress-heading > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.one-click-progress-heading h3 { font-size: 14px; }
.one-click-progress .current-step-label { color: var(--ui-muted-2); font-size: 11px; }
.one-click-progress .status-message { margin: 6px 0; font-size: 11px; }
.one-click-progress .workflow-progress { gap: 5px; margin-top: 6px; }
.one-click-progress .workflow-progress progress { height: 5px; }
.one-click-progress .workflow-progress small { font-size: 10px; }
.one-click-surface > .one-click-action-zone { margin: 0; padding: 10px 13px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-ink-3); }
.one-click-surface > .one-click-action-zone .one-click-action-bar { margin: 0; gap: 7px; align-items: center; }
.one-click-action-bar .primary-button { min-width: 166px; }
.one-click-action-bar #oneClickDownloadResult { margin-left: auto; }

/* Shared detail pages use the same quiet hierarchy and compact controls. */
.approved-detail-heading { padding-bottom: 8px; }
.approved-detail .approved-detail-heading { margin-bottom: 8px; }
.approved-detail-heading > div:first-child { min-width: 0; }
.approved-detail-heading h2 { margin-bottom: 2px; }
.approved-detail-heading #taskSourceName { font-size: 11px; overflow-wrap: anywhere; }
.approved-detail .task-identity-fold { margin-bottom: 8px; }
.approved-detail .task-identity-fold > summary { padding: 6px 10px; }
.approved-detail > #professionalAudioSlot { order: 7; }
.approved-detail .task-heading-actions > a,
.approved-detail .task-heading-actions > button { min-height: 32px; padding: 6px 10px; }
.approved-workflow-steps { gap: 0; margin-bottom: 10px; padding: 4px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-ink-2); }
.approved-workflow-steps button { min-height: 35px; padding: 6px 12px; border-radius: 5px; font-size: 13px; font-weight: 550; }
.approved-workflow-steps button:not([data-inspected="true"]) { border-color: transparent; background: transparent; }
.approved-workflow-steps button[data-inspected="true"],
.approved-workflow-steps:not(:has(button[data-inspected="true"])) button[aria-current="step"] { color: var(--ui-primary); border-color: #51493c; background: #292720; box-shadow: inset 0 -2px var(--ui-accent); }
.approved-stage { padding: 13px; border-radius: 8px; background: var(--ui-ink-2); }
.approved-stage .subheading h3,
.approved-stage .video-generation-heading h3,
.approved-stage .image-operation-heading h4 { font-size: 17px; }
.task-history-list { gap: 7px; }
.task-history-row { padding: 12px 14px; gap: 12px; border-radius: 7px; background: var(--ui-ink-2); }
.task-history-row:hover { border-color: var(--ui-line-strong); }
.task-history-copy strong { font-size: 13px; font-weight: 550; }
.task-history-copy small { font-size: 11px; }
.task-history-select-all { color: var(--ui-muted); font-size: 12px; }
.task-history-select { accent-color: var(--ui-primary); }
.task-history-actions { gap: 6px; }
.task-history-actions .secondary-button { min-height: 30px; padding: 5px 9px; }
.task-history-row .badge { max-width: 140px; white-space: normal; }
.voice-native-grid { gap: 12px; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr); }
.voice-native-card { padding: 13px; border-radius: 8px; background: var(--ui-ink-2); }
.voice-native-card .subheading h3 { font-size: 16px; }
.voice-native-field, .voice-native-upload { margin-top: 9px; font-size: 12px; font-weight: 500; }
.voice-native-field input, .voice-native-field select,
.voice-native-field textarea, .voice-native-upload input { min-height: 34px; padding: 7px 9px; border-radius: 6px; color: var(--ui-text); background: var(--ui-ink-2); }
.voice-native-field textarea { min-height: 102px; }
.voice-native-audio { gap: 6px; padding: 9px; border-radius: 7px; }
.voice-native-check { font-size: 11px; line-height: 1.6; }
.voice-native-history-item, .voice-native-list-item { border-radius: 6px; }
.copy-review-heading h3 { font-size: 17px; }
.task-audio-selections { gap: 10px; }
.task-audio-selection { padding: 12px; border-radius: 8px; }
.task-audio-selection strong { font-weight: 600; }
.approved-stage-storyboard { padding: 10px; }
.approved-stage-storyboard > .shot-flow-action { margin: 0 0 8px; padding: 9px 11px; gap: 10px; }
.approved-stage-storyboard > .shot-flow-action h4 { margin: 0 0 3px; font-size: 14px; }
.approved-stage-storyboard > .shot-flow-action .status-message { margin: 0; font-size: 11px; }
.approved-stage-storyboard > .shot-flow-action > button { flex: 0 0 auto; min-height: 31px; padding: 6px 9px; }
.storyboard-editor { padding: 10px; border-radius: 8px; }
.storyboard-editor .storyboard-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.storyboard-editor-heading > div { min-width: 0; }
.storyboard-editor-heading > .badge { max-width: 36%; white-space: normal; }
.storyboard-editor-heading h4 { margin: 0 0 3px; font-size: 15px; }
.storyboard-editor-heading p { font-size: 11px; line-height: 1.45; }
.storyboard-player-panel, .storyboard-frame-controls, .storyboard-shot-browser { padding: 9px; gap: 7px; border-radius: 7px; }
.storyboard-shot-browser-heading { gap: 7px; }
.storyboard-shot-browser-heading > span { font-size: 11px; }
.storyboard-player-heading { font-size: 12px; }
.storyboard-player-heading > span, .storyboard-player-boundary { font-size: 11px; }
.storyboard-player-panel { display: flex; flex-direction: column; }
.storyboard-player-panel > * { order: 2; }
.storyboard-player-panel > .storyboard-player-heading { order: 0; }
.storyboard-player-panel > .storyboard-video-shell { order: 1; flex: 0 0 auto; }
.storyboard-video-shell { height: clamp(250px, 42vh, 470px); }
.storyboard-frame-controls h5 { font-size: 16px; }
.storyboard-shot-list { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.storyboard-shot-list button { min-height: 32px; padding: 7px 9px; gap: 2px; }
.storyboard-shot-list button small { font-size: 11px; }
.storyboard-timeline-playhead { box-shadow: none; }
#shotsSection.image-workbench-shell { gap: 10px; padding: 12px; }
#shotsSection .image-stage-heading h3 { font-size: 17px; font-weight: 600; }
#shotsSection .image-stage-heading p,
#shotsSection .image-stage-current { font-size: 11px; line-height: 1.5; }
#shotsSection .shot-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
#shotsSection .shot-tab { flex: 0 0 auto; width: auto; grid-template-columns: auto auto; gap: 0 9px; min-height: 43px; padding: 6px 9px; border-radius: 6px; }
#shotsSection .shot-tab-title { font-size: 12px; font-weight: 600; }
#shotsSection .shot-tab-range { font-size: 11px; }
#shotsSection .shot-tab-frames { grid-column: 1 / -1; font-size: 10px; }
#shotsSection .shot-tab.selected { border-color: #51493c; background: #292720; box-shadow: inset 0 -2px var(--ui-accent); }
#shotsSection .image-frame-picker,
#shotsSection .image-frame-editor,
#shotsSection .image-candidate-history,
#shotsSection .image-model-controls { padding: 10px; border-radius: 8px; }
#shotsSection .image-frame-picker-heading { gap: 9px; flex-wrap: wrap; }
#shotsSection .image-frame-picker-heading h4,
#shotsSection .image-frame-editor .image-operation-heading h4,
#shotsSection .image-model-controls-heading h4,
#shotsSection .image-candidate-history-heading h5 { font-size: 15px; }
#shotsSection .image-frame-picker-heading .image-preparation-help,
#shotsSection .image-frame-picker-heading output,
#shotsSection .image-frame-scrubber-labels,
#shotsSection .image-candidate-history-heading p,
#shotsSection .image-model-controls-heading p { font-size: 11px; line-height: 1.45; }
#shotsSection .image-frame-player-grid { gap: 9px; }
#shotsSection .video-shell { height: 245px; border-radius: 7px; }
#shotsSection .image-frame-control-panel { gap: 7px; padding: 9px; border-radius: 7px; }
#shotsSection .image-frame-control-panel > strong { font-size: 12px; }
#shotsSection .image-frame-control-panel > p { font-size: 11px; }
#shotsSection .image-frame-toolbar button,
#shotsSection .frame-actions button { min-height: 31px; padding: 6px 8px; font-size: 11px; }
#shotsSection .image-frame-editor .image-operation-heading { margin-bottom: 8px; }
#shotsSection .image-frame-editor .image-operation-heading p { font-size: 11px; }
#shotsSection .image-frame-editor .image-region-compare { gap: 9px; }
#shotsSection .image-direct-edit { gap: 9px; margin-top: 9px; }
#shotsSection .image-prompt-workbench { padding: 10px; margin-top: 10px; border-radius: 7px; }
#shotsSection .image-prompt-workbench-heading h5 { font-size: 14px; }
#shotsSection .image-prompt-workbench-heading p { font-size: 11px; line-height: 1.45; }
#shotsSection .image-prompt-workbench-heading button { flex: 0 0 auto; }
#shotsSection .image-editor-action-row { gap: 8px; margin-top: 8px; }
#shotsSection .image-model-controls .image-operation-config-simple,
#shotsSection #imageSettingsFold .image-operation-settings { gap: 9px; }
#shotsSection .image-candidate-history-heading { gap: 8px; flex-wrap: wrap; }
#shotsSection .image-result-pair-actions { gap: 6px; }
#shotsSection .image-result-pair-actions .primary-button { min-width: 0; }
.video-unit-tabs { gap: 6px; }
.video-unit-tabs button { min-height: 42px; padding: 7px 10px; border-radius: 6px; }
.video-unit-tabs .video-unit-tab[aria-selected="true"],
.video-unit-tabs .video-unit-tab[data-selected="true"] { border-color: #51493c; background: #292720; box-shadow: inset 0 -2px var(--ui-accent); }
.video-upstream-materials, .final-assembly-selection, .final-shot-comparison { padding: 12px; border-radius: 8px; }
.final-video-panel { padding: 11px; border-radius: 8px; }
.final-video-panel figcaption { font-size: 13px; font-weight: 550; }
.final-video-candidate.adopted { border-color: #51493c; box-shadow: inset 0 -2px var(--ui-accent); }
.action-confirm-dialog { border-radius: 10px; }
.action-confirm-form { padding: 20px; }

@container (max-width: 340px) {
  .one-click-video-model, .one-click-video-arrangement { grid-column: 1 / -1; }
}

@media (min-width: 1180px) {
  .approved-detail > .approved-workflow-steps { position: sticky; top: 8px; z-index: 8; }
  #professionalFinalSlot #finalResult > .final-comparison-stage > .final-video-comparison > .final-video-panel > video { height: clamp(240px, calc(100dvh - 590px), 620px); max-height: clamp(240px, calc(100dvh - 590px), 620px); object-fit: contain; }
  #professionalFinalSlot .final-assembly-candidates:not(:empty) { grid-auto-flow: column; grid-auto-columns: minmax(270px, 320px); align-items: start; gap: 9px; max-width: 100%; overflow-x: auto; padding-bottom: 7px; overscroll-behavior-x: contain; }
  #professionalFinalSlot .final-assembly-unit { grid-template-columns: minmax(0, 1fr); gap: 8px; max-height: min(58vh, 530px); overflow-y: auto; overscroll-behavior-y: contain; padding: 10px; border-radius: 7px; }
  #professionalFinalSlot .final-assembly-unit > h4 { font-size: 13px; }
  #professionalFinalSlot .final-assembly-unit > small { font-size: 11px; }
  #professionalFinalSlot .final-video-candidate { gap: 7px; padding: 8px; }
  #professionalFinalSlot .final-video-candidate video { height: 158px; max-height: 158px; }
  #professionalFinalSlot .final-video-candidate > button { min-height: 32px; }
  #professionalAudioSlot > #taskAudioSection[data-workflow-state="current"] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 9px 12px; align-items: start; }
  #professionalAudioSlot > #taskAudioSection > * { grid-column: 1 / -1; }
  #professionalAudioSlot > #taskAudioSection > .task-audio-heading { grid-row: 1; margin-bottom: 0; padding-bottom: 9px; }
  #professionalAudioSlot > #taskAudioSection > #professionalCopySlot { grid-column: 1; grid-row: 2 / 7; margin: 0; min-width: 0; }
  #professionalAudioSlot > #taskAudioSection > #taskAudioStatus { grid-column: 2; grid-row: 2; align-self: center; margin: 0; padding-right: 110px; font-size: 11px; }
  #professionalAudioSlot > #taskAudioSection > .task-audio-actions { grid-column: 2; grid-row: 2; justify-self: end; margin-top: 0; }
  #professionalAudioSlot > #taskAudioSection > .task-audio-confirmed-copy { grid-column: 2; grid-row: 3; margin: 0; padding: 9px; }
  #professionalAudioSlot > #taskAudioSection > .task-audio-selections { grid-column: 2; grid-row: 4; margin: 0; gap: 8px; }
  #professionalAudioSlot > #taskAudioSection > .task-audio-quick-actions { grid-column: 2; grid-row: 5; margin: 0; padding: 9px; }
  #professionalAudioSlot:has(#copyReviewSection[hidden]) > #taskAudioSection { grid-template-columns: minmax(0, 1fr); }
  #professionalAudioSlot:has(#copyReviewSection[hidden]) > #taskAudioSection > :is(#taskAudioStatus, .task-audio-actions, .task-audio-confirmed-copy, .task-audio-selections, .task-audio-quick-actions) { grid-column: 1; }
  #professionalAudioSlot .task-audio-selection { gap: 6px; padding: 9px; }
  #professionalAudioSlot .task-audio-selection select { min-height: 34px; padding: 7px; }
  #professionalAudioSlot .task-audio-selection small { font-size: 11px; line-height: 1.5; }
  #professionalAudioSlot .copy-review-heading { gap: 8px; align-items: start; flex-wrap: wrap; }
  #professionalAudioSlot .copy-review-heading h3 { font-size: 15px; }
  #professionalAudioSlot .copy-review-column-labels { gap: 8px; margin: 10px 0 0; font-size: 11px; }
  #professionalAudioSlot .copy-review { padding: 11px; }
  #professionalAudioSlot .copy-review-actions { gap: 6px; }
  #professionalAudioSlot .copy-review-actions > button { flex: 1 1 145px; min-width: 0; }
  #shotsSection.image-workbench-shell { grid-template-columns: minmax(340px, .85fr) minmax(0, 1.15fr); align-items: start; }
  #shotsSection.image-workbench-shell > * { grid-column: 1 / -1; }
  #shotsSection > .image-stage-heading { grid-row: 1; }
  #shotsSection > #shotTabs { grid-row: 2; }
  #shotsSection > #imagePreparationSection { grid-column: 1; grid-row: 3; }
  #shotsSection > #imageOperationSection { grid-column: 2; grid-row: 3; }
  #shotsSection > .image-candidate-history { grid-column: 1; grid-row: 4; }
  #shotsSection > .image-model-controls { grid-column: 2; grid-row: 4; }
  #shotsSection #imageOperationHistory { grid-template-columns: minmax(0, 1fr); }
  #shotsSection .image-prompt-editors { grid-template-columns: minmax(0, 1fr); }
  #shotsSection #imageSettingsFold .image-operation-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #shotsSection .video-shell { height: clamp(190px, calc(100dvh - 530px), 280px); }
  #shotsSection .image-frame-editor .image-region-stage,
  #shotsSection .image-frame-editor .image-region-result-pane img,
  #shotsSection .image-frame-editor .image-region-result-empty { max-height: clamp(190px, calc(100dvh - 500px), 300px); }
  #shotsSection .image-frame-editor .image-region-stage canvas,
  #shotsSection .image-frame-editor .image-region-stage img { max-height: clamp(188px, calc(100dvh - 502px), 298px); }
  .approved-detail-heading > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
  .approved-detail-heading > div:first-child h2 { margin: 0; font-size: 18px; }
  .approved-detail-heading > div:first-child p { max-width: 280px; }
  .storyboard-editor-main { grid-template-columns: 158px minmax(0, 1fr); gap: 9px; }
  .storyboard-editor-main > * { grid-column: 1 / -1; }
  .storyboard-editor-main > .storyboard-shot-browser { grid-column: 1; grid-row: 1; align-self: start; max-height: calc(100dvh - 332px); overflow-y: auto; overscroll-behavior: contain; }
  .storyboard-shot-browser-heading { align-items: start; flex-direction: column; }
  .storyboard-shot-list { grid-template-columns: minmax(0, 1fr); }
  .storyboard-editor-main > .storyboard-frame-review { grid-column: 2; grid-row: 1; grid-template-columns: minmax(0, 1fr) minmax(230px, .49fr); gap: 9px; }
  .storyboard-video-shell { height: clamp(220px, calc(100dvh - 478px), 440px); }
  .storyboard-frame-controls { max-height: calc(100dvh - 390px); min-height: 290px; overflow-y: auto; overscroll-behavior: contain; }
  .one-click-surface {
    display: grid;
    grid-template-columns: minmax(270px, .95fr) minmax(270px, 1fr) minmax(360px, 1.75fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 11px;
    height: calc(100dvh - 138px);
    min-height: 460px;
  }
  .one-click-import-header { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .48fr); gap: 16px; align-items: center; }
  .one-click-import-header .status-message { margin: 0; }
  .one-click-top-grid { grid-column: 1; grid-row: 2 / 4; }
  .one-click-surface .whole-video-setup { grid-column: 2; grid-row: 2 / 4; }
  .one-click-top-grid,
  .one-click-surface .whole-video-setup { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  #oneClickFinalSlot { grid-column: 3; grid-row: 2; min-height: 0; overflow: hidden; }
  #oneClickFinalSlot #finalResult,
  #oneClickFinalSlot .final-comparison-stage,
  #oneClickFinalSlot .final-video-comparison { height: 100%; min-height: 0; }
  #oneClickFinalSlot .final-video-panel { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  #oneClickFinalSlot:not(:has(#finalResult:not([hidden])))::before,
  #oneClickFinalSlot:not(:has(#finalResult:not([hidden])))::after { min-height: 0; }
  .one-click-surface .one-click-progress { grid-column: 3; grid-row: 3; }
  .one-click-surface > .one-click-action-zone { grid-column: 1 / -1; grid-row: 4; }
}

@media (min-width: 1700px) {
  #shotsSection .image-frame-player-grid { grid-template-columns: minmax(0, 1fr) 210px; }
  #shotsSection .video-shell { height: 280px; }
  #shotsSection .image-frame-control-panel .frame-selection-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 761px) and (max-width: 1179px) {
  .one-click-surface { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .one-click-import-header, #oneClickFinalSlot,
  .one-click-surface .one-click-progress,
  .one-click-surface > .one-click-action-zone { grid-column: 1 / -1; }
  .one-click-top-grid { grid-column: 1; grid-row: 2; }
  .one-click-surface .whole-video-setup { grid-column: 2; grid-row: 2; }
  .one-click-top-grid, .one-click-surface .whole-video-setup { max-height: 64vh; overflow-y: auto; overscroll-behavior: contain; }
  #oneClickFinalSlot .final-video-panel :is(video, .final-video-empty) { height: min(54vh, 440px); }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .side-rail { position: static; height: auto; padding: 8px 12px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--ui-line); }
  .side-brand { flex: 0 0 64px; padding: 0; }
  .side-brand-logo { width: 64px; height: 40px; }
  .side-nav { display: flex; gap: 6px; }
  .side-nav-item { grid-template-columns: 24px auto; min-width: 110px; padding: 7px 10px; gap: 6px; }
  .side-nav-item > span:first-child, .side-nav-item > span.side-nav-icon { width: 24px; height: 24px; }
  .topbar { min-height: 48px; padding-inline: 12px; }
  main { width: calc(100% - 24px); }
  .one-click-surface { display: grid; gap: 10px; }
  .one-click-import-header .file-picker { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .one-click-card-heading { flex-direction: row; }
  .one-click-card-heading .compact-button { width: auto; }
  .one-click-top-grid, .one-click-surface .whole-video-setup { max-height: none; }
  .one-click-action-bar { flex-direction: row; flex-wrap: wrap; }
  .one-click-action-bar > * { flex: 1 1 130px; width: auto; }
  .approved-workflow-steps { grid-template-columns: repeat(6, minmax(72px, 1fr)); overflow-x: auto; }
  .approved-workflow-steps button { min-height: 36px; padding: 7px 5px; font-size: 12px; }
  .voice-native-grid { grid-template-columns: minmax(0, 1fr); }
  .task-history-row { grid-template-columns: auto minmax(0, 1fr); gap: 9px; }
  .task-history-row .task-history-actions { grid-column: 2; }
  .task-history-row > .badge { grid-column: 2; justify-self: start; }
  #oneClickFinalSlot .final-video-panel :is(video, .final-video-empty) { height: min(65vh, 420px); }
}

/* Sentence editing keeps one source/rewrite pair together across shot cuts. */
.sentence-copy-help { color: var(--muted, #aaa); font-size: 12px; line-height: 1.65; }
.sentence-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 100px; gap: 10px; padding: 12px; border: 1px solid var(--border, #333); border-radius: 10px; }
.sentence-copy-row > label { display: grid; gap: 6px; min-width: 0; font-size: 12px; }
.sentence-copy-source { display: grid; align-content: start; gap: 6px; min-width: 0; font-size: 12px; }
.sentence-copy-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sentence-copy-source-heading button { flex: 0 0 auto; min-height: 26px; padding: 3px 7px; font-size: 12px; white-space: nowrap; }
.sentence-copy-row textarea { width: 100%; min-height: 78px; resize: vertical; font-size: 14px; line-height: 1.6; }
.sentence-copy-row textarea[readonly] { color: var(--muted, #aaa); caret-color: #f4bd76; }
.sentence-split-preview { display: block; min-width: 0; padding: 5px 7px; border-radius: 5px; background: rgba(244, 189, 118, .06); color: var(--muted, #aaa); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.sentence-split-preview[data-valid="true"] { color: var(--text, #eee); }
.sentence-split-preview [data-split-marker] { display: inline-block; margin: 0 3px; color: #f4bd76; font-size: 18px; font-weight: 800; line-height: 1; vertical-align: -1px; }
.sentence-copy-row select, .sentence-copy-row input { width: 100%; min-width: 0; }
.sentence-copy-actions { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }
.sentence-copy-actions button, .sentence-split-fields button { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.sentence-split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-column: 1 / -1; }
.sentence-copy-times { grid-column: 1 / -1; font-size: 12px; }
.sentence-copy-times summary { cursor: pointer; padding: 4px 0; color: var(--muted, #aaa); }
.sentence-copy-times > label { display: inline-grid; gap: 5px; width: calc(25% - 9px); margin: 6px 8px 0 0; }
.sentence-copy-row audio { grid-column: 1 / -1; max-width: 100%; height: 34px; }
.copy-editor-dialog.action-confirm-dialog { box-sizing: border-box; width: min(1160px, calc(100vw - 32px)); max-width: none; height: min(850px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); padding: 18px; overflow: auto; }
.copy-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.copy-editor-heading h2 { font-size: 18px; margin: 0; }
.copy-translation-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.copy-translation-controls .status-message { flex: 1 1 240px; margin: 6px 0; }
.copy-translation-text { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--ui-border); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-translation-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ui-border); }
.copy-translation-pair p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-translation-pair strong { display: block; margin-bottom: 6px; color: var(--ui-muted); }
@media (max-width: 600px) { .copy-translation-pair { grid-template-columns: 1fr; } }
.copy-editor-dialog[open] #copyReviewSection:not([hidden]) { display: block; margin: 0; padding: 0; border: 0; background: transparent; }
.copy-editor-dialog .copy-review-rows { max-height: none; overflow: visible; }
.copy-editor-dialog #copyEditorOpen, .copy-editor-dialog .copy-review-column-labels { display: none; }
.copy-editor-dialog .copy-review-actions { position: sticky; bottom: -18px; padding: 12px 0; background: var(--surface, #191a1e); z-index: 1; }
#oneClickCopySlot .sentence-copy-row { grid-template-columns: minmax(0, 1fr); }
#oneClickCopySlot .sentence-copy-times > label { width: calc(50% - 9px); }
#copyEditorOpen { white-space: nowrap; }
@media (max-width: 680px) {
  .sentence-copy-row { grid-template-columns: minmax(0, 1fr); }
  .sentence-copy-times > label { width: calc(50% - 9px); }
  .copy-editor-dialog.action-confirm-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); padding: 12px; }
}

#oneClickCopySlot .copy-review-heading { flex-wrap: wrap; }
.copy-review[data-sentence-mode="true"] .copy-review-column-labels { display: none; }

.copy-review[data-sentence-mode="true"] .copy-review-actions { display: flex; }
.copy-review[data-sentence-mode="true"] #copyReviewSave[disabled] { display: inline-flex; cursor: not-allowed; }

.sentence-copy-count { grid-column: 1 / -1; color: var(--ui-muted); font-size: 12px; }

/* Keep shot navigation visible while editing the current image or reviewing its final video. */
#shotsSection, #professionalFinalSlot #finalResult { scroll-margin-top: 64px; }
@media (min-width: 761px) {
  #shotsSection.image-workbench-shell { grid-template-columns: 158px minmax(0, 1fr); align-items: start; }
  #shotsSection.image-workbench-shell > * { grid-column: 2; grid-row: auto; }
  #shotsSection > .image-stage-heading { grid-column: 1 / -1; grid-row: 1; }
  #shotsSection > #shotTabs {
    grid-column: 1; grid-row: 2 / span 12; display: grid; grid-template-columns: minmax(0, 1fr);
    align-content: start; position: sticky; top: 64px; max-height: max(240px, calc(100dvh - 240px));
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
    padding: 2px 5px 2px 0; gap: 7px;
  }
  #shotsSection .shot-tab { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 3px; min-height: 74px; text-align: left; white-space: normal; }
  #shotsSection .shot-tab-title { font-size: 13px; }
  #shotsSection .shot-tab-range { font-size: 12px; }
  #shotsSection .shot-tab-frames { grid-column: 1; font-size: 11px; }
  #shotsSection > .image-model-controls { grid-row: 2; gap: 7px; }
  #shotsSection > #imagePreparationSection { grid-row: 4; }
  #shotsSection > #imageOperationSection { grid-row: 3; }
  #shotsSection > .image-candidate-history { grid-row: 5; }
  #shotsSection .image-model-controls-heading p { margin: 2px 0 0; }
  #shotsSection .image-model-controls .image-operation-config-simple { grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); align-items: start; }
  #shotsSection #imageSettingsFold .image-operation-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #shotsSection #imageOperationSection { display: flex; flex-direction: column; }
  #shotsSection #imageOperationSection > * { order: 3; }
  #shotsSection #imageOperationSection > .image-operation-heading { order: 0; }
  #shotsSection #imageOperationSection > .image-editor-action-row {
    order: 1; position: sticky; top: 64px; z-index: 4; margin: 0 0 8px; padding: 7px 0;
    background: #141514; border-bottom: 1px solid var(--ui-line);
  }
  #shotsSection #imageOperationSection > .image-region-fold { order: 2; }
  #professionalFinalSlot .final-shot-comparison { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 8px 12px; align-items: start; }
  #professionalFinalSlot .final-shot-comparison > .subheading { grid-column: 1 / -1; margin: 0; }
  #professionalFinalSlot .final-shot-choice { grid-column: 1; grid-row: 2 / 4; display: grid; gap: 6px; }
  #professionalFinalSlot #finalShotCompareChoice { width: 100%; min-width: 0; min-height: 240px; max-height: max(240px, min(58vh, calc(100dvh - 390px), 530px)); padding: 5px; }
  #professionalFinalSlot #finalShotCompareChoice option { padding: 10px 7px; margin: 3px 0; border-radius: 6px; }
  #professionalFinalSlot #finalShotCompareStatus { grid-column: 2; grid-row: 2; margin: 0; }
  #professionalFinalSlot #finalShotCompareMedia { grid-column: 2; grid-row: 3; }
  #professionalFinalSlot .final-shot-comparison-media video { height: clamp(200px, 38vh, 400px); max-height: 400px; object-fit: contain; }
  #professionalFinalSlot .final-assembly-actions { position: sticky; top: 64px; z-index: 4; padding: 10px; background: #141514; }
}

@media (min-width: 1180px) {
  #shotsSection.image-workbench-shell { grid-template-columns: 158px minmax(260px, .85fr) minmax(0, 1.15fr); }
  #shotsSection.image-workbench-shell > * { grid-column: 2 / 4; }
  #shotsSection > .image-stage-heading { grid-column: 1 / -1; }
  #shotsSection > #shotTabs { grid-column: 1; }
  #shotsSection > #imagePreparationSection { grid-column: 2; grid-row: 3; }
  #shotsSection > #imageOperationSection { grid-column: 3; grid-row: 3; }
  #shotsSection > .image-candidate-history { grid-column: 2 / 4; grid-row: 4; }
  #shotsSection .video-shell { height: clamp(180px, calc(100dvh - 550px), 270px); }
  #shotsSection .image-frame-editor .image-region-stage,
  #shotsSection .image-frame-editor .image-region-result-pane img,
  #shotsSection .image-frame-editor .image-region-result-empty { min-height: 180px; max-height: clamp(180px, calc(100dvh - 550px), 270px); }
  #shotsSection .image-frame-editor .image-region-stage canvas,
  #shotsSection .image-frame-editor .image-region-stage img { max-height: clamp(178px, calc(100dvh - 552px), 268px); }
}

@media (max-width: 760px) {
  #professionalFinalSlot #finalShotCompareChoice { width: 100%; min-height: 130px; max-height: 190px; }
  #professionalFinalSlot #finalShotCompareChoice option { padding: 7px; }
}

/* The shot list and generation controls stay in view; references keep their existing owners. */
.final-assembly-actions { justify-content: flex-start; flex-wrap: wrap; }
.final-assembly-actions #finalMediaActions { display: contents; }
#professionalFinalSlot #sourceAdjacentStatus { margin: 6px 0; font-size: 12px; }
#videoGenerationSection { scroll-margin-top: 64px; }
#videoGenerationSection .video-unit { gap: 9px; padding: 10px; }
#videoGenerationSection .video-unit > [data-video-control="single"] { justify-self: start; }
#videoGenerationSection .video-unit > [data-video-control="heading"] { margin: 0; }
#videoGenerationSection .video-shot-comparison video { height: clamp(180px, 28vh, 260px); max-height: 260px; object-fit: contain; }
#videoGenerationSection .video-shot-comparison h4 { margin: 0 0 7px; font-size: 13px; }
#videoGenerationSection .video-shot-comparison-media { gap: 8px; }
#videoGenerationSection .video-shot-comparison-media article > button { margin-top: 5px; padding: 6px 8px; min-height: 32px; }
#videoGenerationSection .video-advanced-fold[open],
#professionalVideoSettingsSlot details[open] { max-height: 32vh; overflow-y: auto; overscroll-behavior: contain; }
#videoGenerationSection .video-advanced-fold .video-settings { grid-template-columns: minmax(0, 1fr); }
#videoGenerationSection :is(.video-person-reference-picker, .video-product-reference-picker) { min-width: 0; }
#videoGenerationSection :is(.video-person-reference-picker, .video-product-reference-picker) h5 { margin: 0 0 6px; }
#videoGenerationSection :is(.video-person-reference-picker, .video-product-reference-picker) .reference-list {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-height: 170px; overflow-y: auto; overscroll-behavior: contain;
}
#videoGenerationSection :is(.video-person-reference-picker, .video-product-reference-picker) .reference-card { padding: 6px; gap: 7px; grid-template-columns: 52px minmax(0, 1fr); }
#videoGenerationSection :is(.video-person-reference-picker, .video-product-reference-picker) .reference-card img { width: 52px; height: 62px; object-fit: contain; }
#videoGenerationSection :is(.video-person-reference-picker, .video-product-reference-picker) .status-message { margin: 5px 0 0; font-size: 12px; }
#videoGenerationSection .video-upstream-audio-row { grid-template-columns: minmax(0, 1fr) minmax(160px, 1fr); }

@media (min-width: 761px) {
  #videoGenerationSection[data-workflow-state="current"] { display: grid; grid-template-columns: 158px 190px minmax(0, 1fr); gap: 10px; align-items: start; }
  #videoGenerationSection > * { grid-column: 2 / -1; min-width: 0; margin: 0; }
  #videoGenerationSection > .video-generation-heading { grid-column: 1 / -1; }
  #videoGenerationSection > #videoUnitTabs {
    grid-column: 1; grid-row: 2 / span 6; grid-template-columns: minmax(0, 1fr); align-content: start;
    position: sticky; top: 64px; max-height: max(240px, calc(100dvh - 170px)); overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 5px;
  }
  #videoGenerationSection .video-unit-tabs button { min-height: 65px; }
  #videoGenerationSection > .video-plan-actions { grid-column: 2; grid-row: 2; }
  #videoGenerationSection .video-plan-actions select { min-height: 34px; padding: 6px 10px; }
  #videoGenerationSection #videoGenerationUnits { margin: 0; }
  #professionalVideoSettingsSlot:not([hidden]) { grid-column: 3; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
  #professionalVideoSettingsSlot > * { min-width: 0; margin: 0; }
  #professionalVideoSettingsSlot .one-click-video-settings { grid-column: auto; }
}

@media (min-width: 1180px) {
  #professionalVideoSettingsSlot:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #videoGenerationSection .video-unit { grid-template-columns: minmax(0, 1.3fr) minmax(300px, .8fr); align-items: start; }
  #videoGenerationSection .video-unit > * { grid-column: 1 / -1; min-width: 0; margin: 0; }
  #videoGenerationSection .video-unit > [data-video-control="heading"] { grid-row: 1; }
  #videoGenerationSection .video-unit > [data-video-control="model-field"] { grid-column: 2; grid-row: 2; }
  #videoGenerationSection .video-unit > [data-video-control="actions"] { grid-column: 2; grid-row: 3; }
  #videoGenerationSection .video-unit > [data-video-control="advanced"] { grid-column: 2; grid-row: 4; }
  #videoGenerationSection .video-unit > [data-video-control="status"] { grid-column: 2; grid-row: 7; }
  #videoGenerationSection .video-unit > [data-video-control="fee"] { grid-column: 2; grid-row: 8; }
  #videoGenerationSection .video-unit > [data-video-control="compliance"] { grid-column: 2; grid-row: 9; }
  #videoGenerationSection .video-unit > [data-video-control="request-preview"] { grid-column: 2; grid-row: 10; }
  #videoGenerationSection .video-unit > .video-shot-comparison { grid-column: 1; grid-row: 2 / 6; }
  #videoGenerationSection .video-upstream-materials { display: contents; }
  #videoGenerationSection .video-upstream-materials > h5 { grid-column: 1; grid-row: 6; margin: 0; }
  #videoGenerationSection .video-upstream-materials > .video-upstream-images { grid-column: 1; grid-row: 7; }
  #videoGenerationSection .video-upstream-materials > .video-upstream-audio { grid-column: 1; grid-row: 8; }
  #videoGenerationSection .video-upstream-materials > .video-person-reference-picker { grid-column: 2; grid-row: 5; }
  #videoGenerationSection .video-upstream-materials > .video-product-reference-picker { grid-column: 2; grid-row: 6; }
  #videoGenerationSection .video-unit-missing > [data-video-control="heading"] { grid-column: 1; }
  #videoGenerationSection .video-unit-missing > [data-video-control="single"] { grid-column: 2; grid-row: 1; justify-self: start; }
  #videoGenerationSection .video-unit-missing > [data-video-control="status"] { grid-column: 2; grid-row: 2; }
  #videoGenerationSection .video-unit-missing .video-person-reference-picker { grid-row: 3; }
  #videoGenerationSection .video-unit-missing .video-product-reference-picker { grid-row: 4; }
  #videoGenerationSection .video-unit-missing > .video-shot-comparison { grid-row: 2 / 5; }
  #videoGenerationSection .video-unit-missing .video-upstream-materials > h5 { grid-row: 5; }
  #videoGenerationSection .video-unit-missing .video-upstream-images { grid-row: 6; }
}

@media (max-width: 760px) {
  #videoGenerationSection .video-unit-tabs { max-height: 190px; overflow-y: auto; overscroll-behavior: contain; }
  #videoGenerationSection .video-upstream-audio-row { grid-template-columns: minmax(0, 1fr); }
}


/* Keep image generation controls next to the current frame. */
#shotsSection .image-prompt-workbench { display: none; }
#shotsSection #imageOperationSection > .image-model-controls { order: 2; margin: 0 0 8px; padding: 8px; gap: 6px; }
#shotsSection #imageOperationSection > .reference-library { order: 3; margin: 0 0 8px; gap: 6px; }
#shotsSection #imageOperationSection > .image-region-fold { order: 4; }
#shotsSection #imageOperationSection .image-model-controls-heading { gap: 8px; align-items: center; }
#shotsSection #imageOperationSection .image-model-controls-heading h4 { font-size: 13px; }
#shotsSection #imageOperationSection .image-model-controls-heading p { display: none; }
#shotsSection #refreshImageModels { min-height: 28px; padding: 4px 7px; font-size: 11px; }
#shotsSection #imageOperationSection .image-operation-config-simple { grid-template-columns: minmax(0, 1fr); gap: 6px; }
#shotsSection #imageOperationSection #imageSettingsFold .image-operation-settings { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
#shotsSection #imageOperationSection .image-setting-field { gap: 3px; font-size: 11px; }
#shotsSection #imageOperationSection .image-setting-field select { min-height: 30px; height: 30px; padding: 4px 6px; font-size: 12px; }
#shotsSection #imageOperationSection .target-input-grid { gap: 6px; }
#shotsSection #imageOperationSection .target-input-card { padding: 7px; gap: 6px; border-radius: 7px; }
#shotsSection #imageOperationSection .target-card-heading { flex-wrap: wrap; gap: 4px; }
#shotsSection #imageOperationSection .target-toggle strong { font-size: 12px; }
#shotsSection #imageOperationSection .target-reference-count { font-size: 10px; }
#shotsSection #imageOperationSection .image-target-options { min-width: 0; }
#shotsSection #imageOperationSection .image-target-options > summary { font-size: 11px; color: #bbb; cursor: pointer; }
#shotsSection #imageOperationSection .image-target-options[open] { display: grid; gap: 6px; }
#shotsSection #imageOperationSection .image-target-options > label > span { display: none; }
#shotsSection #imageOperationSection .image-target-options > small { font-size: 10px; line-height: 1.3; }
#shotsSection #imageOperationSection .target-input-card textarea { min-height: 52px; height: 52px; font-size: 12px; padding: 6px; }
#shotsSection #imageOperationSection .target-input-card > small { font-size: 10px; line-height: 1.3; }
#shotsSection #imageOperationSection .reference-upload { display: flex; flex-wrap: wrap; gap: 5px; }
#shotsSection #imageOperationSection .reference-upload > span { display: none; }
#shotsSection #imageOperationSection .reference-file-trigger { min-height: 28px; padding: 5px 6px; font-size: 11px; border-radius: 5px; }
#shotsSection #imageOperationSection .professional-reference-list { gap: 5px; }
#shotsSection #imageOperationSection .professional-reference-list .global-reference-item { grid-template-columns: 38px minmax(0, 1fr) auto; min-height: 44px; padding: 4px; gap: 4px; }
#shotsSection #imageOperationSection .professional-reference-list .global-reference-thumb { width: 38px; height: 38px; }
#shotsSection #imageOperationSection .professional-reference-list .global-reference-copy { font-size: 10px; }
#shotsSection #imageOperationSection .background-inheritance-choice select { min-height: 28px; height: 28px; font-size: 11px; padding: 4px; }
#shotsSection #imageOperationSection .reference-binding-fold { margin: 0; padding: 6px 8px; }
#shotsSection #imageOperationSection .reference-binding-fold > summary { font-size: 11px; }
#shotsSection .image-candidate-history > summary { font-size: 13px; cursor: pointer; }
#shotsSection .image-result-pair img, #shotsSection .image-result-pair-placeholder { height: 120px; aspect-ratio: auto; }
#shotsSection .image-candidate-history-heading > div:first-child { display: none; }
#shotsSection .image-result-pair-footer { display: flex; flex-wrap: wrap; gap: 6px; }
#shotsSection .image-result-pair-footer button { width: auto; min-height: 30px; padding: 5px 10px; }
@media (min-width: 761px) {
  #shotsSection > #imageOperationSection { grid-row: 2; }
  #shotsSection > #imagePreparationSection { grid-row: 3; }
  #shotsSection > .image-candidate-history { grid-row: 4; }
}
@media (min-width: 1180px) {
  #shotsSection.image-workbench-shell { grid-template-columns: 158px minmax(240px, .65fr) minmax(0, 1.35fr); }
  #shotsSection > #imagePreparationSection, #shotsSection > #imageOperationSection { grid-row: 2; }
  #shotsSection > .image-candidate-history { grid-row: 3; }
}
@media (max-width: 760px) {
  #shotsSection > #imageOperationSection { order: 3; }
  #shotsSection > #imagePreparationSection { order: 4; }
  #shotsSection > .image-candidate-history { order: 5; }
  #shotsSection #imageOperationSection { display: flex; flex-direction: column; }
  #shotsSection #imageOperationSection > .image-operation-heading { order: 0; }
  #shotsSection #imageOperationSection > .image-editor-action-row { order: 1; }
  #shotsSection #imageOperationSection #imageSettingsFold .image-operation-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.shot-tab-choice { display: flex; flex-direction: column; flex: 0 0 auto; gap: 4px; }
.shot-video-toggle { font-size: 11px; padding: 4px 6px; }
.one-click-confirm-choice { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }

/* The existing editor moves into its dialog; the workbench keeps only its entry and status. */
:is(#oneClickCopySlot, #professionalCopySlot) > #copyReviewSection > :not(.copy-review-heading):not(#copyReviewStatus),
:is(#oneClickCopySlot, #professionalCopySlot) > #copyReviewSection > .copy-review-heading > div { display: none; }

/* Keep the everyday voice choices together; errors and recovery remain visible. */
.one-click-copy-controls :is(#oneClickCopyModeHint, #oneClickAudioGenerationMethodHint,
  .one-click-music-hint, #oneClickGeneratedAudioHeading),
:is(#oneClickDialogueSlot, #professionalCopySlot) > #copyDialogueSettings > small,
#taskAudioSpeakerSettings > small,
#oneClickAudioSettings :is(.task-audio-actions, #taskAudioSentenceReference),
:is(#oneClickCopySlot, #professionalCopySlot) #copyReviewBadge,
:is(#oneClickCopySlot, #professionalCopySlot) #copyReviewStatus:not(.error) { display: none; }
#oneClickDialogueSlot > #copyDialogueSettings { margin: 0; padding: 0; border: 0; }
#oneClickAudioSettings > .task-audio { margin: 0; padding: 0; border: 0; }
#taskAudioSpeakerVoices { display: grid; gap: 12px; }
#taskAudioSpeakerVoices audio { display: block; width: 100%; margin-top: 6px; }
#taskAudioSpeakerVoices audio[hidden] { display: none; }
.task-audio-details { margin-top: 10px; font-size: 12px; }
.task-audio-details > summary { cursor: pointer; color: var(--muted); }
