:root {
  color-scheme: light;
  --bg: #f7f7f6;
  --paper: #ffffff;
  --ink: #090909;
  --muted: #7f828a;
  --soft: #e8e8e5;
  --line: #d9d9d4;
  --accent: #101010;
  --good: #0b7f62;
  --warn: #9b6500;
  --danger: #b3261e;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.08);
}

/* Tech cockpit refresh: top navigation becomes the single workflow guide. */
:root {
  --tech-bg: #061014;
  --tech-panel: rgba(10, 24, 30, 0.88);
  --tech-panel-soft: rgba(13, 31, 38, 0.78);
  --tech-line: rgba(110, 231, 255, 0.2);
  --tech-line-strong: rgba(110, 231, 255, 0.42);
  --tech-text: #e9fbff;
  --tech-muted: #8facb4;
  --tech-cyan: #63e6ff;
  --tech-mint: #55f1c2;
  --tech-amber: #f6c96b;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(93, 230, 255, 0.18), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(85, 241, 194, 0.12), transparent 32%),
    linear-gradient(180deg, #07141a 0%, #061014 42%, #04090d 100%) !important;
  color: var(--tech-text);
}

.shell {
  width: min(100vw - 28px, 1880px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(560px, 1.8fr) minmax(170px, 0.58fr);
  align-items: center;
  gap: 16px;
  min-height: 92px;
  border: 1px solid var(--tech-line);
  background:
    linear-gradient(180deg, rgba(13, 31, 38, 0.92), rgba(7, 18, 24, 0.94)),
    rgba(7, 18, 24, 0.94) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark {
  min-width: 0;
  gap: 14px;
}

.brand-mark .bars {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(99, 230, 255, 0.46);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(99, 230, 255, 0.16), rgba(85, 241, 194, 0.06)),
    #071116;
  box-shadow: 0 0 0 4px rgba(99, 230, 255, 0.05), 0 12px 26px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.brand-mark .bars::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  pointer-events: none;
}

.brand-mark .bars span {
  width: 100%;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--tech-cyan), #1f9fbd);
  box-shadow: 0 0 16px rgba(99, 230, 255, 0.42);
}

.brand-mark .bars span:nth-child(1) { height: 58%; }
.brand-mark .bars span:nth-child(2) { height: 82%; background: linear-gradient(180deg, var(--tech-mint), #1ba78b); }
.brand-mark .bars span:nth-child(3) { height: 46%; }

.brand-mark strong {
  color: var(--tech-text) !important;
  font-size: 18px;
  letter-spacing: 0;
}

.brand-mark span:not(.bars span) {
  display: block;
  margin-top: 3px;
  border-left: 0;
  padding-left: 0;
  color: var(--tech-muted) !important;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.nav-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 8px 18px;
  max-width: 690px;
  min-width: 0;
  margin: 0 auto;
  overflow: visible;
  scrollbar-width: none;
}

.nav-tabs::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: calc(50% - 1px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(99, 230, 255, 0.32), rgba(85, 241, 194, 0.28), transparent);
  pointer-events: none;
}

.nav-tabs button,
.nav-tabs a {
  position: relative;
  z-index: 1;
  min-width: 76px;
  min-height: 34px;
  border: 1px solid rgba(99, 230, 255, 0.16);
  border-radius: 10px;
  background: rgba(8, 20, 26, 0.88);
  color: #b7d0d7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-tabs button::after,
.nav-tabs a::after {
  content: "→";
  position: absolute;
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(99, 230, 255, 0.58);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.nav-tabs button:nth-child(6)::after,
.nav-tabs button:last-child::after,
.nav-tabs a:nth-child(6)::after,
.nav-tabs a:last-child::after {
  display: none;
}

.nav-tabs button:hover,
.nav-tabs a:hover,
.nav-tabs button.active,
.nav-tabs button[aria-current="page"],
.nav-tabs a:first-child {
  border-color: rgba(99, 230, 255, 0.58);
  background: linear-gradient(180deg, rgba(61, 220, 240, 0.24), rgba(18, 55, 66, 0.92));
  color: #f4feff;
  box-shadow: 0 0 0 3px rgba(99, 230, 255, 0.09), inset 0 -2px 0 rgba(85, 241, 194, 0.6);
}

.topbar-actions {
  justify-content: end;
}

.icon-button,
.status-pill {
  border-color: var(--tech-line);
  background: rgba(11, 24, 30, 0.82);
  color: var(--tech-text);
}

.status-pill {
  color: var(--tech-mint);
  white-space: nowrap;
}

.workspace-intro {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
  margin-top: 18px;
  padding: 28px 4px 20px;
}

.workspace-intro h1 {
  margin: 8px auto 0;
  color: var(--tech-text);
  text-shadow: 0 0 34px rgba(99, 230, 255, 0.14);
}

.workspace-intro p {
  max-width: 760px;
  margin: 8px auto 0;
  color: var(--tech-muted);
  font-size: 13px;
}

.workspace-intro span,
.eyebrow {
  color: var(--tech-cyan);
}

.workflow-cockpit {
  display: none !important;
}

.config-board,
.control-panel,
.panel,
.preview-stage,
.global-model-workbench,
.global-storage-workbench,
.global-creative-workbench,
.reference-basket,
.reference-flow-node,
.asset-group-nav,
.shot-ref-card,
.shot-video-card,
.asset-item,
.task-item,
.project-item,
.model-config,
.json-details,
.shot {
  border-color: var(--tech-line) !important;
  background: var(--tech-panel) !important;
  color: var(--tech-text);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.panel-head,
.config-board-summary,
.review-stage-head,
.preview-caption,
.shot-video-preflight,
.provider-status,
.asset-group-card {
  border-color: var(--tech-line) !important;
  background: var(--tech-panel-soft) !important;
  color: var(--tech-text);
}

input,
textarea,
select {
  border-color: rgba(110, 231, 255, 0.2) !important;
  background: rgba(3, 11, 15, 0.82) !important;
  color: var(--tech-text) !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(181, 211, 219, 0.5);
}

button.primary,
.primary {
  border-color: rgba(99, 230, 255, 0.46) !important;
  background: linear-gradient(135deg, #1fc7df, #1f9f86) !important;
  color: #041114 !important;
  box-shadow: 0 10px 26px rgba(31, 199, 223, 0.22);
}

button.secondary,
button.ghost,
.secondary,
.ghost,
.mini-button {
  border-color: rgba(110, 231, 255, 0.22) !important;
  background: rgba(8, 20, 26, 0.86) !important;
  color: #d9f8ff !important;
}

.status-badge.done,
.provider-status.ok,
.config-board-status {
  border-color: rgba(85, 241, 194, 0.42) !important;
  background: rgba(85, 241, 194, 0.12) !important;
  color: var(--tech-mint) !important;
}

.status-badge.warn,
.provider-status.warn {
  border-color: rgba(246, 201, 107, 0.42) !important;
  background: rgba(246, 201, 107, 0.12) !important;
  color: var(--tech-amber) !important;
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr);
  }

  .nav-tabs {
    grid-column: 1 / -1;
    order: initial;
    max-width: 100%;
  }

  .topbar-actions {
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 16px, 760px);
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .brand-mark {
    justify-content: center;
  }

  .brand-mark .bars {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .brand-mark span:not(.bars span) {
    display: block;
    font-size: 10px;
  }

  .nav-tabs {
    justify-content: flex-start;
    max-height: 92px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .nav-tabs::before,
  .nav-tabs button::after,
  .nav-tabs a::after {
    display: none;
  }

  .nav-tabs button,
  .nav-tabs a {
    min-width: 68px;
  }

  .topbar-actions {
    justify-content: center;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.lightbox-open {
  overflow: hidden;
}

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

h1,
h2,
p {
  margin: 0;
}

.shell {
  width: min(1740px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 38px 0 68px;
}

.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 320px;
  font-size: 26px;
  font-weight: 900;
}

.brand-mark > div:last-child {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark strong {
  font-size: 18px;
  line-height: 1;
}

.brand-mark span {
  border-left: 2px solid #111;
  padding-left: 18px;
  font-size: 28px;
  font-weight: 850;
}

.bars {
  display: grid;
  grid-auto-flow: column;
  align-items: end;
  gap: 5px;
  width: 42px;
  height: 36px;
}

.bars span {
  display: block;
  width: 9px;
  background: #000;
  border-left: 0;
  padding: 0;
}

.bars span:nth-child(1) {
  height: 23px;
}

.bars span:nth-child(2) {
  height: 34px;
}

.bars span:nth-child(3) {
  height: 18px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 92px);
  flex: 1;
}

.nav-tabs a {
  color: #60636b;
  text-decoration: none;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
}

.nav-tabs a:first-child {
  color: #111;
  font-weight: 900;
}

.status-pill {
  min-width: 112px;
  border-radius: 999px;
  background: #eeeeec;
  color: #111;
  padding: 12px 18px;
  text-align: center;
  font-weight: 850;
}

.workspace-intro {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(320px, 1fr);
  align-items: end;
  gap: 24px;
  padding: 28px 0 20px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.workspace-intro span,
.eyebrow {
  display: block;
  color: #7f828a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace-intro h1 {
  margin-top: 8px;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 950;
}

.workspace-intro p {
  max-width: 760px;
  color: #565a62;
  font-size: 16px;
  line-height: 1.65;
}

.config-board {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.04);
}

.config-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.config-board-head h2 {
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 950;
}

.config-board-status {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f7f6;
  color: #3b3e45;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 950;
}

.config-board-status.ok {
  border-color: #b9ddce;
  background: #f0faf5;
  color: var(--good);
}

.config-board-status.warn {
  border-color: #ead29b;
  background: #fff8e8;
  color: var(--warn);
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.pipeline-strip span {
  min-width: 0;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 9px 10px;
  color: #393c43;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-matrix {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.config-panel {
  min-width: 0;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fcfcfb;
  padding: 12px;
}

.config-panel.ok {
  border-color: #cfe8dd;
}

.config-panel.warn {
  border-color: #ead29b;
  background: #fffdfa;
}

.config-panel.bad {
  border-color: #efc7c2;
  background: #fffafa;
}

.config-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 10px;
}

.config-panel h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 950;
}

.config-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4e535b;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.config-badge.ok {
  border-color: #b9ddce;
  color: var(--good);
}

.config-badge.warn {
  border-color: #ead29b;
  color: var(--warn);
}

.config-badge.bad {
  border-color: #efc7c2;
  color: var(--danger);
}

.config-rows {
  display: grid;
  gap: 6px;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.72fr) minmax(0, 1.28fr);
  gap: 8px;
  align-items: baseline;
  min-height: 24px;
  border-top: 1px solid rgba(217, 217, 212, 0.72);
  padding-top: 6px;
}

.config-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.config-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.config-row strong {
  min-width: 0;
  color: #20242b;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.config-row strong.ok {
  color: var(--good);
}

.config-row strong.warn {
  color: var(--warn);
}

.config-row strong.bad {
  color: var(--danger);
}

.config-row strong.muted {
  color: var(--muted);
}

.config-control-row {
  align-items: center;
}

.config-inline-select {
  min-width: 0;
}

.config-inline-select select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 900;
}

.config-panel p {
  margin-top: 10px;
  color: #6b6f77;
  font-size: 11px;
  line-height: 1.5;
}

.config-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--soft);
  padding-top: 12px;
}

.config-issues strong,
.config-issues span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 850;
}

.config-issues strong {
  background: #111;
  color: #fff;
}

.config-issues span {
  border: 1px solid #ead29b;
  background: #fff8e8;
  color: #765000;
}

.config-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.control-panel,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 22px;
}

.control-panel {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.05);
}

.preview-stage {
  min-width: 0;
}

.stage-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: #a3a5aa;
  font-size: 18px;
  margin: 0 6px 26px;
  text-align: center;
}

.stage-labels .active {
  color: #7e8087;
  font-weight: 800;
}

.preview-shell {
  display: grid;
  grid-template-columns: 90px minmax(340px, 920px) 90px;
  justify-content: center;
  align-items: center;
  gap: 28px;
}

.round-nav {
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  color: white;
  font-size: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1216;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 28px;
  font-weight: 800;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.preview-caption {
  width: min(920px, calc(100% - 236px));
  margin: 26px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.preview-caption h2 {
  font-size: 36px;
  font-weight: 900;
}

.preview-caption p {
  margin-top: 10px;
  color: #6f727a;
  font-size: 18px;
}

.preview-caption > span {
  font-size: 34px;
  font-weight: 800;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(480px, 1.15fr);
  gap: 18px;
  margin-top: 42px;
}

.storyboard-panel,
.cinematic-panel,
.reference-panel {
  margin-top: 18px;
}

.storyboard-actions,
.cinematic-actions,
.reference-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.reference-basket {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #d8d8d2;
  border-radius: 8px;
  background: #fbfbfa;
  padding: 12px 14px;
  margin: 0 0 14px;
}

.reference-basket.has-selection {
  border-color: #b9ddce;
  background: #f7fffb;
}

.reference-basket strong,
.reference-basket span,
.reference-basket small {
  display: block;
}

.reference-basket strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.reference-basket span,
.reference-basket small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.reference-basket small {
  flex: 0 0 min(420px, 42%);
  text-align: right;
}

.storyboard-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.storyboard-image-box {
  min-height: 420px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 12px;
}

.storyboard-image-box img {
  display: block;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f0ea;
}

.storyboard-preview-section + .storyboard-preview-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.storyboard-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.storyboard-preview-head span {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.storyboard-meta {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.storyboard-meta small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cinematic-summary {
  margin-bottom: 14px;
}

.cinematic-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cinematic-stats span {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 10px 12px;
  color: #2b2e33;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.shot-ref-card {
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.video-readiness-card {
  grid-column: 1 / -1;
  background: #fffefa;
}

.video-readiness-card.ok {
  border-color: rgba(29, 127, 83, 0.34);
  background: #f5fff9;
}

.video-readiness-card.warn {
  border-color: rgba(155, 101, 0, 0.32);
}

.video-readiness-card.error {
  border-color: rgba(190, 42, 42, 0.28);
  background: #fff8f6;
}

.video-readiness-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.video-readiness-head strong,
.video-readiness-head span {
  display: block;
}

.video-readiness-head strong {
  font-size: 15px;
  font-weight: 950;
}

.video-readiness-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.video-readiness-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
}

.video-readiness-list,
.shot-video-preflight {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.video-readiness-list span,
.shot-video-preflight span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.shot-video-preflight.ok span:first-child,
.shot-video-preflight.ok span:last-child {
  color: var(--good);
}

.shot-video-preflight.warn span:first-child,
.shot-video-preflight.warn span:last-child {
  color: var(--warn);
}

.master-ref-card {
  grid-column: 1 / -1;
  background: #fbfbfa;
}

.legacy-ref-card {
  background: #f5f5f3;
  color: var(--muted);
}

.legacy-ref-card summary {
  cursor: pointer;
  font-weight: 900;
}

.legacy-ref-card summary span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
}

.ai-asset-card {
  background: #fffdfa;
}

.ai-asset-section + .ai-asset-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--soft);
}

.ai-asset-section-head {
  margin-bottom: 10px;
}

.ai-asset-section-head strong,
.ai-asset-section-head span {
  display: block;
}

.ai-asset-section-head strong {
  font-size: 13px;
  font-weight: 950;
}

.ai-asset-section-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.shot-ref-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.shot-ref-head strong,
.shot-ref-head span {
  display: block;
}

.shot-ref-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.shot-ref-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shot-ref-images.single {
  grid-template-columns: minmax(220px, 420px);
}

.shot-ref-image {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.shot-ref-image.selected-for-video {
  border-color: rgba(28, 122, 90, 0.32);
  background: #f1f8f2;
  box-shadow: inset 0 0 0 1px rgba(28, 122, 90, 0.08);
}

.shot-ref-image.ai-asset-reference.selected-for-video {
  border-color: rgba(29, 112, 135, 0.34);
  background: #eef8f9;
}

.shot-ref-image.shot-reference-selection.selected-for-video {
  border-color: rgba(28, 122, 90, 0.38);
  background: #f0fbf4;
}

.shot-ref-image.selected-for-video .image-select-row {
  color: var(--good);
}

.shot-ref-image.pending-reference-selection {
  border-color: rgba(177, 132, 63, 0.42);
  background: #fff8eb;
  box-shadow: inset 0 0 0 1px rgba(177, 132, 63, 0.08);
}

.shot-ref-image.pending-reference-selection .image-select-row {
  color: #8a651f;
}

.reference-state-label {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  border: 1px solid rgba(28, 122, 90, 0.22);
  border-radius: 999px;
  background: #e7f4eb;
  color: var(--good);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 950;
}

.shot-ref-title {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shot-ref-title .ok {
  color: var(--good);
}

.shot-ref-title .warn {
  color: var(--warn);
}

.shot-ref-title .error {
  color: var(--danger);
}

.shot-readiness-line {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 850;
}

.shot-readiness-line.ok {
  color: var(--good);
}

.shot-readiness-line.warn {
  color: var(--warn);
}

.shot-readiness-line.error {
  color: var(--danger);
}

.image-preview-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: clamp(320px, 42vw, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    #f7f7f3;
  background-size: 18px 18px;
  padding: 8px;
  cursor: zoom-in;
  overflow: hidden;
}

.image-preview-button img {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(300px, 40vw, 640px);
  object-fit: contain;
  border-radius: 6px;
}

.image-preview-button span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 950;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.image-preview-button:hover span,
.image-preview-button:focus-visible span {
  opacity: 1;
}

.placeholder-image .image-preview-button {
  opacity: 0.72;
  border-style: dashed;
}

.placeholder-image .image-preview-button::after {
  content: "占位/失败图";
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--warn);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 950;
}

.storyboard-preview-button {
  min-height: 420px;
}

.compact-preview-button {
  min-height: 112px;
  padding: 4px;
}

.compact-preview-button img {
  max-height: 132px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(10, 10, 10, 0.88);
  color: #fff;
}

.image-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding: 12px 16px;
}

.image-lightbox-toolbar strong,
.image-lightbox-toolbar span {
  display: block;
}

.image-lightbox-toolbar strong {
  font-size: 14px;
  font-weight: 950;
}

.image-lightbox-toolbar span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.image-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-lightbox-actions a,
.image-lightbox-actions button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 7px 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.image-lightbox-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
}

.image-lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 92px);
  object-fit: contain;
  border-radius: 8px;
  background: #f7f7f3;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.shot-ref-image small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  word-break: break-all;
}

.image-select-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  border: 1px solid rgba(212, 202, 189, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 6px 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.image-select-row input {
  width: 16px;
  height: 16px;
}

.image-select-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.image-select-hint.warn {
  color: var(--warn);
}

.image-prompt-box {
  margin-top: 9px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 8px 10px;
}

.image-prompt-box summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prompt-submit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.prompt-submit-meta span {
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 999px;
  background: #eef8f6;
  color: var(--text);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.prompt-endpoint {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.image-prompt-box label {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-prompt-box textarea {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.reference-edit-box {
  margin-top: 9px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 8px;
}

.reference-edit-box summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  user-select: none;
}

.reference-edit-box label {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.reference-edit-box textarea {
  min-height: 88px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.45;
}

.reference-edit-upload {
  border: 1px dashed #b8babf;
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}

.reference-edit-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
}

.reference-edit-check input {
  width: 16px;
  height: 16px;
}

.reference-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.reference-edit-actions small {
  margin: 0;
  text-align: right;
  word-break: normal;
}

.mini-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
  white-space: nowrap;
  cursor: pointer;
}

.mini-button:hover {
  background: #111;
  color: #fff;
}

.error-text {
  color: var(--danger) !important;
}

.cinematic-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.cinematic-natural-layer {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.cinematic-layer-head,
.cinematic-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cinematic-layer-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.cinematic-layer-head span:last-child,
.cinematic-reference-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cinematic-shot-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.cinematic-shot-tabs button {
  flex: 0 0 auto;
  min-width: 112px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
  color: var(--ink);
  font-weight: 900;
}

.cinematic-shot-tabs button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.cinematic-shot-tabs button.active,
.cinematic-shot-tabs button[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.cinematic-shot-tabs button.active span,
.cinematic-shot-tabs button[aria-selected="true"] span {
  color: rgba(255, 255, 255, 0.72);
}

.cinematic-shot-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(260px, 0.36fr);
  gap: 14px;
  align-items: start;
}

.cinematic-prompt-field {
  display: grid;
  gap: 8px;
}

.cinematic-reference-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 12px;
  background: #fbfbfa;
}

.cinematic-reference-chips {
  display: grid;
  gap: 8px;
  max-height: 506px;
  overflow: auto;
}

.cinematic-reference-chip {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-areas:
    "image token"
    "image label"
    "image meta";
  gap: 3px 10px;
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: copy;
}

.cinematic-reference-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.cinematic-reference-chip img {
  grid-area: image;
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: #e8e8e5;
}

.cinematic-reference-chip .chip-token {
  grid-area: token;
  color: var(--good);
  font-size: 12px;
  font-weight: 950;
}

.cinematic-reference-chip .chip-label {
  grid-area: label;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cinematic-reference-chip small {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wide-field {
  min-width: 0;
}

.cinematic-json,
.prompt-preview,
.readable-prompt-view {
  min-height: 420px;
  font-size: 12px;
  line-height: 1.6;
}

.cinematic-json,
.prompt-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.readable-prompt-view {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.75;
  color: #20242b;
  background: #fbfaf7;
  border-color: #ddd6ca;
}

.prompt-preview {
  background: #111;
  color: #f6f6f2;
  border-color: #111;
}

.json-details {
  grid-column: 1 / -1;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.json-details summary {
  cursor: pointer;
  font-weight: 950;
  color: var(--muted);
  user-select: none;
}

.json-details[open] summary {
  color: var(--ink);
}

.json-details textarea {
  width: 100%;
  margin-top: 12px;
}

.reference-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.reference-json-details {
  grid-column: 1 / -1;
}

.shot-video-panel {
  margin-top: 18px;
}

.shot-video-params {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
}

.shot-video-workbench {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(460px, 1fr);
  gap: 14px;
  align-items: start;
}

.third-party-provider-guide {
  display: grid;
  gap: 12px;
  margin: -4px 0 16px;
  padding: 14px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fffdfa;
}

.third-party-provider-guide.ok {
  background: #f7fbf8;
}

.third-party-provider-guide.warn {
  border-color: rgba(212, 202, 189, 0.95);
  background: #fff7e8;
}

.third-provider-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.third-provider-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.third-provider-head strong {
  color: #211f1a;
  font-size: 15px;
  font-weight: 950;
}

.third-provider-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.third-provider-switch {
  min-width: 210px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.third-provider-switch input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.third-provider-switch span,
.third-provider-switch strong {
  font-size: 12px;
}

.third-provider-switch strong {
  grid-column: 1 / -1;
  color: var(--warn);
}

.third-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.third-provider-fact {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(212, 202, 189, 0.86);
  border-radius: 8px;
  background: #fffdf8;
}

.third-provider-fact span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.third-provider-fact strong {
  color: #2a261e;
  font-size: 12px;
  line-height: 1.4;
}

.third-provider-risk {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.third-provider-risk strong {
  color: var(--warn);
  font-size: 13px;
  font-weight: 950;
}

.third-provider-risk span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.submit-observation {
  margin-top: 14px;
}

.shot-video-column {
  min-width: 0;
}

.shot-video-column h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 950;
}

.shot-video-list {
  display: grid;
  gap: 12px;
}

.shot-video-card {
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.submit-observation-card {
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fffdfa;
  padding: 14px;
}

.submit-observation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.submit-observation-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.submit-prompt-view {
  min-height: 220px;
  font-size: 12px;
  line-height: 1.5;
}

.submit-reference-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.submit-reference-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
}

.submit-reference-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.submit-reference-item {
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 9px;
  min-width: 0;
}

.submit-reference-item strong,
.submit-reference-item span,
.submit-reference-item small {
  display: block;
}

.submit-reference-item strong {
  font-size: 12px;
  font-weight: 950;
}

.submit-reference-item span,
.submit-reference-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  word-break: break-all;
}

.shot-video-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.shot-video-card-head strong {
  font-size: 15px;
  font-weight: 950;
}

.shot-video-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.compact-ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.compact-ref-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-ref-head .mini-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  font-size: 11px;
}

.shot-video-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.shot-video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 8px;
  background: #0b1216;
}

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

.compact-ref {
  min-width: 0;
}

.compact-ref strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 950;
}

.compact-ref img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7f7f3;
}

.compact-ref small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  word-break: break-all;
}

.shot-video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.segment-video-player {
  display: grid;
  gap: 8px;
}

.segment-video-player video {
  width: 100%;
  max-height: 420px;
  display: block;
  border: 1px solid rgba(28, 42, 45, 0.18);
  border-radius: 7px;
  background: #0f1719;
}

.segment-video-player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segment-video-player-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(18, 59, 58, 0.28);
  border-radius: 6px;
  background: #f4f8f7;
  color: #123b3a;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.shot-video-meta span,
.shot-video-meta a {
  min-height: 0;
  border: 1px solid var(--soft);
  border-radius: 999px;
  background: #fbfbfa;
  padding: 5px 8px;
  color: var(--muted);
  text-decoration: none;
}

.shot-video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.shot-video-actions button {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
}

.shot-video-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-failure-details {
  margin-top: 10px;
  border: 1px solid #e5b3a8;
  border-radius: 6px;
  background: #fff8f6;
  color: #7a2d20;
}

.task-failure-details summary {
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.task-failure-item {
  padding: 9px 10px;
  border-top: 1px solid #f0d4ce;
}

.task-failure-item strong,
.task-failure-item span,
.task-failure-item p {
  display: block;
}

.task-failure-item span {
  margin-top: 4px;
  font-size: 12px;
}

.task-failure-item p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.storage-box {
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 14px;
  background: #fbfbfa;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.render-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.2fr) minmax(340px, 0.8fr) minmax(360px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 22px;
  font-weight: 900;
}

.panel-head span,
.panel-head button {
  flex: 0 0 auto;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.panel-head.small {
  margin-top: 20px;
}

.panel-head.small h2 {
  font-size: 16px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 13px;
  color: #2d3035;
  font-size: 13px;
  font-weight: 850;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  font-weight: 650;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.58;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

button,
.task-actions a,
.download-links a {
  min-height: 40px;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 850;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

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

.primary {
  background: #111;
  color: #fff;
}

.secondary {
  background: #f0f0ee;
}

.ghost {
  border-color: var(--line);
  background: #f7f7f6;
}

.prompt-input {
  min-height: 280px;
}

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

.prompt-actions,
.subtitle-actions,
.video-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 13px 0;
}

.model-settings {
  display: none;
  border-top: 1px solid var(--soft);
  margin-top: 16px;
  padding-top: 14px;
}

.model-settings.visible {
  display: block;
}

.model-config-list,
.notes,
.task-list,
.asset-list,
.project-list,
.download-links {
  display: grid;
  gap: 10px;
}

.model-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 10px;
}

.script-textarea {
  min-height: 330px;
}

.note {
  border: 1px solid #cfecdf;
  background: #f2fbf6;
  color: #176046;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.script-review-card {
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, rgba(238, 249, 255, 0.96), rgba(255, 252, 244, 0.96));
  color: #152b36;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 26px rgba(20, 54, 78, 0.08);
}

.script-review-card.warn {
  border-color: rgba(217, 139, 31, 0.38);
  background: linear-gradient(135deg, rgba(255, 249, 235, 0.98), rgba(244, 251, 255, 0.96));
}

.script-review-card.bad {
  border-color: rgba(210, 57, 57, 0.35);
  background: linear-gradient(135deg, rgba(255, 242, 242, 0.98), rgba(246, 250, 255, 0.96));
}

.script-review-card.ok {
  border-color: rgba(20, 146, 110, 0.3);
}

.script-review-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.script-review-head strong {
  font-size: 14px;
}

.script-review-head span,
.script-review-card small {
  color: #60717c;
  font-size: 12px;
}

.script-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.script-review-grid > div {
  border: 1px solid rgba(46, 84, 105, 0.13);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.72);
  min-width: 0;
}

.script-review-grid b,
.script-review-grid p,
.script-review-grid small {
  display: block;
}

.script-review-grid p {
  margin: 5px 0;
  color: #17313f;
  font-size: 13px;
  line-height: 1.45;
}

.script-review-issues {
  margin-top: 9px;
  border-top: 1px solid rgba(46, 84, 105, 0.12);
  padding-top: 9px;
  color: #875100;
  font-size: 12px;
  line-height: 1.5;
}

.warn-note {
  border-color: #eddcae;
  background: #fff8e8;
  color: #8a5d00;
}

.shots-list {
  display: grid;
  gap: 10px;
  max-height: 780px;
  overflow: auto;
}

.shot {
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.shot-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
}

.shot-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-weight: 900;
}

.shot textarea {
  min-height: 66px;
}

.srt-preview {
  display: none;
  white-space: pre-wrap;
  background: #111;
  color: #fff;
  border-radius: 8px;
  padding: 14px;
  max-height: 360px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
}

.srt-preview.visible {
  display: block;
  margin-top: 14px;
}

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

.toggle-row {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.toggle-row input,
.confirm-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.confirm-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-status {
  border-radius: 8px;
  background: #f1fbf6;
  color: var(--good);
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.provider-status.warn {
  background: #fff7e8;
  color: var(--warn);
}

.provider-status.error {
  background: #fff0ee;
  color: var(--danger);
}

.download-box {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.download-box img {
  width: 118px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #f0f0ee;
  display: none;
}

.download-box img.visible {
  display: block;
}

.download-links a,
.download-links button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-color: var(--line);
}

.download-links span,
.project-item span,
.task-item span,
.task-item small,
.asset-meta span,
.asset-meta small {
  color: var(--muted);
  font-size: 12px;
}

.upload-drop {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  border: 1px dashed #b8babf;
  border-radius: 8px;
  padding: 20px;
  background: #fbfbfa;
  cursor: pointer;
}

.upload-drop input {
  display: none;
}

.upload-drop strong {
  font-size: 18px;
}

.upload-drop span {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.5;
}

.asset-list,
.task-list,
.project-list {
  max-height: 460px;
  overflow: auto;
}

.asset-item,
.task-item,
.project-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.asset-item {
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
}

.asset-item img,
.asset-item video,
.asset-icon {
  width: 86px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #ececea;
}

.asset-icon {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #7c7f86;
}

.asset-item audio {
  width: 86px;
}

.asset-meta,
.task-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.asset-select-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.asset-select-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.asset-meta strong,
.task-item strong,
.project-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.project-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  cursor: pointer;
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.delete-button {
  border-color: rgba(179, 38, 30, 0.28);
  color: var(--danger);
  background: #fff;
}

.delete-button:hover {
  background: var(--danger);
  color: #fff;
}

.task-item.running {
  border-color: #d9c591;
  background: #fffaf0;
}

.task-item.done {
  border-color: #cfe8dd;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  line-height: 1.55;
}

.empty-state.compact {
  padding: 12px;
  font-size: 13px;
}

.role-voice-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfbf8;
}

.role-voice-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.role-voice-head span {
  color: var(--muted);
  font-size: 13px;
}

.role-voice-list {
  display: grid;
  gap: 10px;
}

.role-voice-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0;
}

.role-voice-row span {
  font-weight: 800;
}

@media (max-width: 1100px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-tabs {
    width: 100%;
    justify-content: flex-start;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .status-pill {
    align-self: flex-start;
  }
}

@media (max-width: 1320px) {
  .studio-grid,
  .workflow-grid,
  .storyboard-layout,
  .cinematic-editor,
  .reference-layout,
  .render-grid {
    grid-template-columns: 1fr;
  }

  .preview-shell {
    grid-template-columns: 64px minmax(280px, 1fr) 64px;
  }

  .preview-caption {
    width: 100%;
  }

  .config-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 22px, 1740px);
    padding-top: 16px;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-mark {
    min-width: 0;
  }

  .nav-tabs {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .workspace-intro,
  .config-board-head {
    grid-template-columns: 1fr;
  }

  .workspace-intro {
    padding: 22px 0 16px;
  }

  .workspace-intro h1 {
    font-size: 32px;
  }

  .preview-shell,
  .generation-grid,
  .provider-grid,
  .cinematic-stats,
  .shot-reference-grid,
  .shot-ref-images,
  .storage-grid,
  .download-box,
  .asset-item,
  .task-item,
  .model-config {
    grid-template-columns: 1fr;
  }

  .round-nav {
    display: none;
  }

  .shot-row {
    grid-template-columns: 1fr;
  }

  .config-board {
    padding: 14px;
  }

  .config-board-head {
    display: grid;
  }

  .config-board-status {
    width: fit-content;
  }

  .config-matrix,
  .pipeline-strip {
    grid-template-columns: 1fr;
  }

  .pipeline-strip span {
    white-space: normal;
  }

  .config-row {
    grid-template-columns: minmax(86px, 0.58fr) minmax(0, 1.42fr);
  }
}

/* Studio v2: horizontal production workbench */
:root {
  color-scheme: dark;
  --bg: #101417;
  --paper: #171d21;
  --ink: #edf3f1;
  --muted: #9aa8a8;
  --soft: #2a3438;
  --line: #344147;
  --accent: #d7f4ec;
  --good: #55d7b4;
  --warn: #e9b96e;
  --danger: #ff786f;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}

body {
  background: #101417;
  color: var(--ink);
}

.shell {
  width: min(1800px, calc(100vw - 40px));
  padding: 18px 0 56px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 100;
  height: 66px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 33, 0.96);
  box-shadow: var(--shadow);
}

.brand-mark {
  min-width: 250px;
  gap: 12px;
}

.brand-mark strong { color: var(--ink); }
.brand-mark span { border-color: var(--line); color: #b8c5c5; font-size: 14px; padding-left: 12px; }
.bars span { background: #e9b96e; }

.nav-tabs { gap: 6px; }

.nav-tabs button,
.icon-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.nav-tabs button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 14px;
}

.nav-tabs button:hover,
.nav-tabs button.active {
  border-color: #45615e;
  background: #22302f;
  color: #d7f4ec;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
}

.icon-button:hover,
.icon-button.active { background: #2b383a; color: #d7f4ec; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.status-pill { min-width: 96px; border: 1px solid #45615e; border-radius: 6px; background: #182926; color: #8be4c8; padding: 7px 10px; font-size: 12px; }

.workspace-intro {
  grid-template-columns: 1fr auto;
  margin-top: 16px;
  padding: 18px 4px;
  border-top: 0;
}
.workspace-intro h1 { color: var(--ink); font-size: 30px; }
.workspace-intro p { max-width: 600px; color: var(--muted); font-size: 14px; }
.workspace-intro span, .eyebrow { color: #75b8b2; }

.config-board,
.panel,
.control-panel,
.preview-stage,
.workflow-cockpit {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.config-board { margin-top: 16px; }
.config-board-summary { color: var(--ink); }
.config-board-summary small { color: var(--muted); }
.config-board-status { border-radius: 6px; background: #202a2e; color: var(--muted); }
.config-matrix { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.global-model-workbench {
  display: grid;
  grid-template-columns: minmax(240px, 0.35fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.global-model-workbench > .panel-head { grid-column: 1 / -1; }
.global-model-workbench label { color: var(--muted); font-weight: 800; }
.global-model-workbench .model-settings { margin: 0; }

.workflow-cockpit {
  position: sticky;
  top: 90px;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  padding: 10px 12px;
}

.workflow-cockpit-head { display: contents; }
.workflow-cockpit-head > div:first-child { display: none; }
.workflow-cockpit-status { grid-column: 1; grid-row: 1; border-color: #45615e; background: #182926; color: #8be4c8; }
.workflow-steps { grid-column: 2; display: flex; gap: 6px; overflow-x: auto; padding: 1px; scrollbar-width: thin; }
.workflow-step { flex: 0 0 auto; display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 7px; min-width: 104px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #1b2328; cursor: pointer; }
.workflow-step-index { grid-row: 1 / span 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #2e3b3e; color: #d5e4e2; font-size: 11px; }
.workflow-step strong { color: #d7e2e0; font-size: 12px; }
.workflow-step small { color: #8ea09f; font-size: 10px; }
.workflow-step.current { border-color: #75b8b2; background: #203231; }
.workflow-step.done { border-color: #3b7566; }
.workflow-step.blocked { border-color: #865b42; }
.workflow-next-action { display: none; }

[data-workbench-panel] { display: none !important; }
[data-workbench-panel].workbench-panel-active { display: block !important; }
.workspace-intro.workbench-panel-active { display: grid !important; }
.studio-grid.workbench-panel-active,
.workflow-grid.workbench-panel-active { display: grid !important; }
[data-workbench-subpanel] { display: none !important; }
[data-workbench-subpanel].workbench-subpanel-active { display: block !important; }
.preview-stage[data-workbench-subpanel].workbench-subpanel-active { display: grid !important; }

body[data-active-stage="script"] .workflow-grid,
body[data-active-stage="shots"] .workflow-grid { grid-template-columns: minmax(0, 1fr); }
body[data-active-stage="creative"] .studio-grid { grid-template-columns: minmax(0, 1fr); }
body[data-active-stage="video"] .studio-grid { grid-template-columns: minmax(0, 1fr); }

.control-panel { border: 1px solid var(--line); padding: 22px; }
.control-panel h2, .panel h2, .preview-stage h2 { color: var(--ink); }
.control-panel label, .panel label { color: #bac8c6; }
input, textarea, select { border-color: #3a484e; background: #11171a; color: #edf3f1; }
textarea:focus, input:focus, select:focus { outline: 2px solid rgba(85, 215, 180, 0.42); outline-offset: 1px; }

button.primary { border-color: #4eb89d; background: #267b67; color: #f4fffc; }
button.primary:hover { background: #31947b; }
button.secondary, button.ghost, .mini-button { border-color: #46565c; background: #20292e; color: #d9e3e1; }
button.secondary:hover, button.ghost:hover, .mini-button:hover { border-color: #75b8b2; background: #2a393d; color: #eafff8; }

.preview-stage { padding: 18px; }
.review-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.review-stage-head h2 { margin-top: 3px; font-size: 20px; }
.review-stage-meta { border: 1px solid #45615e; border-radius: 6px; background: #182926; color: #8be4c8; padding: 7px 10px; font-size: 12px; font-weight: 800; }
.stage-labels { display: none; }
.preview-shell { border-color: #344147; background: #090d0f; }
.preview-caption { border-top-color: #344147; }
.preview-caption h2 { color: var(--ink); }
.preview-caption p { color: var(--muted); }

.reference-panel { padding: 20px; }
.reference-flow-nodes { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.reference-flow-node { flex: 0 0 244px; border-color: #3a484e; background: #1b2328; }
.reference-flow-node p, .reference-flow-node span { color: var(--muted); }
.reference-flow-node.current { border-color: #75b8b2; background: #203231; }
.reference-flow-actions { display: flex; gap: 6px; }
.reference-flow-actions .ghost:last-child { display: none; }

#references[data-reference-focus] .reference-actions,
#references[data-reference-focus] .reference-basket,
#references[data-reference-focus] .reference-layout { display: none; }
#references[data-reference-focus="role"] [data-asset-group]:not([data-asset-group="role"]),
#references[data-reference-focus="ai"] [data-asset-group]:not([data-asset-group="ai"]),
#references[data-reference-focus="shot"] [data-asset-group]:not([data-asset-group="shot"]) { display: none; }

.shot-ref-card, .reference-basket, .shot-video-params, .config-panel, .asset-card, .history-card { border-color: #3a484e; background: #1b2328; }
.empty-state { border-color: #3a484e; background: #151b1f; color: #94a3a3; }
.readable-prompt-view { background: #13191d; border-color: #3a484e; color: #dce8e5; }
.prompt-preview { background: #090d0f; border-color: #344147; }

@media (max-width: 980px) {
  .shell { width: min(100% - 24px, 1200px); }
  .topbar { top: 6px; }
  .brand-mark { min-width: auto; }
  .brand-mark > div:last-child { display: block; }
  .brand-mark span { display: block; margin-top: 4px; border-left: 0; padding-left: 0; }
  .nav-tabs { justify-content: flex-start; overflow-x: auto; }
  .status-pill { display: none; }
  .config-matrix, .global-model-workbench { grid-template-columns: 1fr; }
  .workflow-cockpit { top: 78px; grid-template-columns: minmax(0, 1fr); }
  .workflow-cockpit-status { display: none; }
  .workflow-steps { grid-column: 1; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 16px, 760px); padding-top: 8px; }
  .topbar { height: auto; min-height: 58px; flex-wrap: wrap; padding: 8px; }
  .brand-mark { display: none; }
  .nav-tabs { order: 2; width: calc(100% - 42px); }
  .topbar-actions { margin-left: auto; }
  .nav-tabs button { padding: 7px 9px; font-size: 12px; }
  .workspace-intro { grid-template-columns: 1fr; padding: 14px 2px; }
  .workspace-intro h1 { font-size: 25px; }
  .workflow-cockpit { top: 70px; }
  .workflow-step { min-width: 96px; }
  .workflow-step small { display: none; }
  .reference-flow-node { flex-basis: 216px; }
}

/* Product-grade studio skin */
:root {
  --bg: #f3f1ec;
  --paper: #fffdf8;
  --ink: #171716;
  --muted: #74706a;
  --soft: #e6e0d5;
  --line: #d4cabd;
  --accent: #171716;
  --studio: #11110f;
  --studio-2: #1d1c19;
  --studio-3: #2b2924;
  --amber: #b1843f;
  --amber-soft: #f1e1c6;
  --good: #1c7a5a;
  --warn: #9a6817;
  --danger: #b74335;
  --shadow: 0 26px 70px rgba(42, 34, 20, 0.12);
  --shadow-tight: 0 14px 36px rgba(42, 34, 20, 0.1);
}

html {
  background: var(--bg);
  scroll-padding-top: 108px;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(177, 132, 63, 0.14), transparent 34%),
    linear-gradient(180deg, #faf8f2 0%, #f3f1ec 42%, #ece8df 100%);
  color: var(--ink);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 23, 22, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 22, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 72%);
}

.shell {
  width: min(1640px, calc(100vw - 48px));
  padding: 22px 0 72px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  height: 72px;
  border: 1px solid rgba(212, 202, 189, 0.86);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(42, 34, 20, 0.08);
  padding: 0 14px 0 18px;
}

.brand-mark {
  min-width: 270px;
  gap: 13px;
}

.brand-mark > div:last-child {
  display: grid;
  gap: 2px;
}

.brand-mark strong {
  color: #141311;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-mark span {
  border-left: 0;
  padding-left: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bars {
  width: 38px;
  height: 38px;
  place-content: center;
  border: 1px solid #28251f;
  border-radius: 8px;
  background: #171716;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.bars span {
  width: 6px;
  background: linear-gradient(180deg, #f6d99f, #aa7c35);
  border-radius: 999px;
}

.bars span:nth-child(1) {
  height: 18px;
}

.bars span:nth-child(2) {
  height: 27px;
}

.bars span:nth-child(3) {
  height: 14px;
}

.nav-tabs {
  justify-content: flex-start;
  gap: 8px;
}

.nav-tabs a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #68645d;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 900;
}

.nav-tabs a:hover,
.nav-tabs a:first-child {
  border-color: rgba(177, 132, 63, 0.28);
  background: #f7efe1;
  color: #171716;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.status-pill {
  min-width: 0;
  border: 1px solid rgba(28, 122, 90, 0.22);
  background: #edf8f1;
  color: var(--good);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.workspace-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
  text-align: center;
  gap: 10px;
  margin-top: 14px;
  padding: 30px 4px 22px;
  border-top: 0;
}

.workspace-intro::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(23, 23, 22, 0.18), transparent);
}

.workspace-intro span,
.eyebrow {
  color: #8a7960;
  font-size: 11px;
  font-weight: 950;
}

.workspace-intro h1 {
  margin: 10px auto 0;
  max-width: 900px;
  color: #151411;
  font-size: clamp(34px, 3.45vw, 54px);
  line-height: 1.02;
  font-weight: 950;
}

.workspace-intro p {
  max-width: 720px;
  margin: 0 auto;
  color: #5c574f;
  font-size: 13px;
  line-height: 1.7;
}

.workspace-metrics {
  min-width: 250px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.workspace-metrics span {
  min-height: 48px;
  border: 1px solid rgba(212, 202, 189, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-tight);
  color: #6b6255;
  padding: 9px 11px;
  line-height: 1.35;
  text-transform: none;
}

.workspace-metrics strong {
  display: inline;
  margin-right: 6px;
  color: #171716;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 950;
}

.config-board {
  position: relative;
  margin: 18px 0 22px;
  border-color: rgba(212, 202, 189, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(252, 248, 239, 0.95));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.config-board-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title status"
    "hint status";
  align-items: center;
  gap: 4px 14px;
  list-style: none;
  cursor: pointer;
  padding: 2px 0 0;
}

.config-board-summary::-webkit-details-marker {
  display: none;
}

.config-board-summary::before {
  content: "展开";
  grid-area: title;
  justify-self: end;
  border: 1px solid rgba(212, 202, 189, 0.86);
  border-radius: 999px;
  background: #fffaf1;
  color: #756d61;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 950;
}

.config-board[open] .config-board-summary::before {
  content: "收起";
}

.config-board-summary > span {
  grid-area: title;
  color: #171716;
  font-size: 16px;
  font-weight: 950;
}

.config-board-summary > small {
  grid-area: hint;
  color: #756d61;
  font-size: 12px;
  line-height: 1.45;
}

.config-board-summary .config-board-status {
  grid-area: status;
}

.config-board::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #171716, #b1843f, #e5cf9b);
}

.config-board-head {
  position: relative;
  margin-top: 16px;
}

.config-board-head h2 {
  color: #171716;
  font-size: 21px;
}

.config-board-status {
  border-color: rgba(177, 132, 63, 0.22);
  background: #fbf4e6;
  color: #8c641e;
}

.config-board-status.ok {
  border-color: rgba(28, 122, 90, 0.24);
  background: #eef8f1;
}

.pipeline-strip {
  gap: 10px;
}

.pipeline-strip span {
  border-color: rgba(212, 202, 189, 0.76);
  background: rgba(255, 253, 248, 0.72);
  color: #3f3a32;
  padding: 10px 12px;
}

.config-matrix {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.config-panel {
  border-color: rgba(212, 202, 189, 0.8);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.config-panel.ok {
  border-color: rgba(28, 122, 90, 0.23);
}

.config-panel.warn {
  border-color: rgba(177, 132, 63, 0.32);
  background: #fff9ed;
}

.config-panel.bad {
  border-color: rgba(183, 67, 53, 0.28);
}

.config-panel h3 {
  color: #1b1915;
  font-size: 13px;
}

.config-panel-head {
  min-height: 24px;
  margin-bottom: 8px;
}

.config-badge {
  background: #fffaf0;
  color: #806024;
}

.config-badge.ok {
  background: #f0faf3;
}

.config-row {
  border-top-color: rgba(212, 202, 189, 0.72);
}

.config-rows {
  gap: 4px;
}

.config-row {
  min-height: 20px;
  padding-top: 4px;
}

.config-row span {
  color: #827a70;
}

.config-row strong {
  color: #25221d;
}

.config-row span,
.config-row strong {
  font-size: 11px;
  line-height: 1.25;
}

.config-inline-select select {
  border-color: rgba(212, 202, 189, 0.95);
  background: #fffaf1;
}

.config-issues {
  border-top-color: rgba(212, 202, 189, 0.86);
}

.config-issues strong {
  background: var(--studio);
}

.config-issues span {
  border-color: rgba(177, 132, 63, 0.22);
  background: #fff7e8;
}

.studio-grid {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 20px;
}

.control-panel,
.panel {
  border-color: rgba(212, 202, 189, 0.92);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-tight);
}

.control-panel {
  position: sticky;
  top: 102px;
  box-shadow: var(--shadow);
}

.panel-head {
  border-bottom: 1px solid rgba(212, 202, 189, 0.62);
  padding-bottom: 12px;
}

.panel-head h2 {
  color: #1b1915;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-head span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(212, 202, 189, 0.68);
  border-radius: 999px;
  background: rgba(250, 246, 238, 0.86);
  color: #756b5e;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
}

label {
  color: #3d382f;
  font-size: 12px;
  font-weight: 920;
}

input,
textarea,
select {
  border-color: rgba(212, 202, 189, 0.95);
  background: #fffdf8;
  color: #1b1915;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(177, 132, 63, 0.72);
  box-shadow: 0 0 0 4px rgba(177, 132, 63, 0.14);
}

textarea {
  scrollbar-color: rgba(177, 132, 63, 0.42) transparent;
}

button,
.task-actions a,
.download-links a {
  border-color: rgba(23, 23, 22, 0.16);
  background: #fffaf1;
  color: #1c1a16;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

button:hover,
.task-actions a:hover,
.download-links a:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(42, 34, 20, 0.1);
}

.primary {
  border-color: #171716;
  background: linear-gradient(180deg, #25231f, #11110f);
  color: #fff9ed;
}

.secondary {
  background: #f5ecdc;
}

.ghost {
  background: transparent;
}

.prompt-input {
  min-height: 240px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(250, 246, 238, 0.96));
}

.preview-stage {
  position: relative;
  border: 1px solid rgba(28, 27, 24, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(34, 32, 27, 0.96), rgba(13, 13, 12, 0.98));
  box-shadow: 0 30px 80px rgba(20, 17, 13, 0.24);
  padding: 18px;
  overflow: hidden;
}

.preview-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.56;
}

.stage-labels,
.preview-shell,
.preview-caption {
  position: relative;
}

.stage-labels {
  margin: 0 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
}

.stage-labels span {
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.stage-labels .active {
  background: rgba(255, 255, 255, 0.11);
  color: #f7dfad;
}

.preview-shell {
  grid-template-columns: 44px minmax(320px, 920px) 44px;
  gap: 14px;
}

.round-nav {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f8e7c4;
  font-size: 21px;
}

.video-frame {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 45%, rgba(177, 132, 63, 0.22), transparent 32%),
    #070706;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 24px 70px rgba(0, 0, 0, 0.36);
}

.preview-empty {
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(20px, 2.4vw, 34px);
}

.preview-caption {
  width: min(920px, calc(100% - 116px));
  margin-top: 18px;
  color: #fff7e8;
}

.preview-caption h2 {
  font-size: 22px;
}

.preview-caption p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.preview-caption > span {
  color: #f1cc83;
  font-size: 24px;
}

.workflow-grid {
  margin-top: 22px;
}

.storyboard-panel,
.cinematic-panel,
.reference-panel,
.shot-video-panel {
  margin-top: 20px;
}

.storyboard-actions,
.cinematic-actions,
.reference-actions,
.prompt-actions,
.subtitle-actions,
.video-actions,
.shot-video-actions {
  gap: 8px;
}

.storyboard-image-box,
.storage-box,
.shot-ref-card,
.shot-video-card,
.submit-observation-card,
.submit-reference-details,
.submit-reference-item,
.model-config,
.shot,
.asset-item,
.task-item,
.project-item,
.role-voice-panel,
.json-details,
.image-prompt-box,
.reference-edit-box {
  border-color: rgba(212, 202, 189, 0.82);
  background: rgba(255, 253, 248, 0.82);
}

.master-ref-card,
.storage-box,
.role-voice-panel,
.shot-video-params {
  background: rgba(250, 246, 238, 0.88);
}

.shot-video-params,
.provider-grid,
.generation-grid,
.storage-grid {
  gap: 10px;
}

.shot-ref-head strong,
.shot-video-card-head strong,
.asset-meta strong,
.task-item strong,
.project-item strong {
  color: #211f1a;
}

.image-preview-button {
  border-color: rgba(212, 202, 189, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 23, 22, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 23, 22, 0.035) 1px, transparent 1px),
    #f1ece1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.image-preview-button span {
  border-color: rgba(23, 23, 22, 0.12);
  background: rgba(255, 253, 248, 0.92);
}

.compact-preview-button {
  min-height: 132px;
}

.compact-preview-button img {
  max-height: 150px;
}

.image-lightbox {
  background: rgba(10, 9, 8, 0.92);
}

.image-lightbox-toolbar {
  background: rgba(20, 19, 17, 0.9);
}

.image-lightbox-actions a,
.image-lightbox-actions button {
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
}

.readable-prompt-view {
  background: #fffaf1;
  border-color: rgba(212, 202, 189, 0.95);
  color: #2f2a23;
}

.prompt-preview,
.srt-preview {
  background: #11110f;
  color: #f9edda;
}

.provider-status {
  border: 1px solid rgba(28, 122, 90, 0.2);
  background: #eff9f3;
}

.provider-status.warn {
  border-color: rgba(154, 104, 23, 0.22);
  background: #fff7e8;
}

.provider-status.error {
  border-color: rgba(183, 67, 53, 0.24);
}

.toggle-row {
  border-color: rgba(212, 202, 189, 0.95);
  background: #fffdf8;
}

.shot-index {
  border-radius: 8px;
  background: linear-gradient(180deg, #2a2823, #12110f);
  color: #f6d99f;
}

.upload-drop {
  border-color: rgba(177, 132, 63, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.9), rgba(247, 239, 225, 0.86));
}

.empty-state {
  border-color: rgba(177, 132, 63, 0.25);
  background: rgba(255, 250, 241, 0.5);
}

.workflow-cockpit {
  position: relative;
  margin: 0 0 22px;
  border: 1px solid rgba(212, 202, 189, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-tight);
  padding: 18px;
  overflow: hidden;
}

.workflow-cockpit::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #171716, #b1843f, #e5cf9b);
}

.workflow-cockpit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.workflow-cockpit-head h2 {
  margin: 4px 0 0;
  color: #171716;
  font-size: 19px;
  line-height: 1.2;
}

.workflow-cockpit-status {
  max-width: 360px;
  border: 1px solid rgba(177, 132, 63, 0.24);
  border-radius: 999px;
  background: #fff7e8;
  color: #7d5a1f;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.25;
  text-align: right;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.workflow-step {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 6px;
  border: 1px solid rgba(212, 202, 189, 0.82);
  border-radius: 8px;
  background: rgba(250, 246, 238, 0.76);
  padding: 10px;
  cursor: default;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.workflow-step[data-workflow-target] {
  cursor: zoom-in;
}

.workflow-step[data-workflow-target]:hover {
  transform: translateY(-1px);
  border-color: rgba(177, 132, 63, 0.46);
  box-shadow: 0 8px 20px rgba(70, 54, 28, 0.08);
}

.workflow-step-index {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #ede4d5;
  color: #665d50;
  font-size: 11px;
  font-weight: 950;
}

.workflow-step strong {
  color: #211f1a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
}

.workflow-step small {
  color: #756d61;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.35;
}

.workflow-step.done {
  border-color: rgba(28, 122, 90, 0.22);
  background: #f1f8f2;
}

.workflow-step.done .workflow-step-index {
  background: #dceee3;
  color: var(--good);
}

.workflow-step.current {
  border-color: rgba(177, 132, 63, 0.42);
  background: #fff7e8;
  box-shadow: inset 0 0 0 1px rgba(177, 132, 63, 0.1);
}

.workflow-step.current .workflow-step-index {
  background: #171716;
  color: #f6d99f;
}

.workflow-step.blocked {
  border-color: rgba(154, 104, 23, 0.24);
  background: #fbf4e6;
}

.workflow-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(212, 202, 189, 0.86);
  border-radius: 8px;
  background: #171716;
  color: #fff8e8;
  padding: 14px;
}

.workflow-next-action.warn {
  background: #3a2b15;
}

.workflow-next-action.ok {
  background: #143827;
}

.next-action-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.next-action-copy strong {
  color: #fff8e8;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
}

.next-action-copy span {
  color: rgba(255, 248, 232, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.workflow-next-action button {
  white-space: nowrap;
}

.asset-group-nav {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(212, 202, 189, 0.82);
  border-radius: 8px;
  background: rgba(250, 246, 238, 0.86);
  padding: 14px;
}

.asset-group-nav > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.asset-group-nav strong {
  color: #1d1b17;
  font-size: 14px;
  font-weight: 950;
}

.asset-group-nav span,
.asset-group-nav p,
.asset-group-nav small {
  color: #756d61;
  font-size: 12px;
  line-height: 1.45;
}

.asset-group-nav p {
  margin: 0;
}

.reference-flow-nodes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.reference-flow-node {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  border: 1px solid rgba(212, 202, 189, 0.86);
  border-radius: 8px;
  background: rgba(250, 246, 238, 0.82);
  padding: 12px;
  cursor: zoom-in;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.reference-flow-node:hover {
  transform: translateY(-1px);
  border-color: rgba(177, 132, 63, 0.46);
  box-shadow: 0 8px 20px rgba(70, 54, 28, 0.08);
}

.reference-flow-node.done {
  border-color: rgba(28, 122, 90, 0.24);
  background: #f1f8f2;
}

.reference-flow-node.current {
  border-color: rgba(177, 132, 63, 0.4);
  background: #fff7e8;
}

.reference-flow-node > div:first-child {
  display: grid;
  gap: 4px;
}

.reference-flow-node strong {
  color: #211f1a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
}

.reference-flow-node span,
.reference-flow-node p {
  color: #756d61;
  font-size: 11px;
  line-height: 1.45;
}

.reference-flow-node p {
  margin: 0;
}

.reference-flow-actions,
.asset-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reference-flow-actions button,
.asset-quick-actions button {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 11px;
}

.reference-confirm-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(28, 122, 90, 0.24);
  border-radius: 999px;
  background: #f1f8f2;
  color: var(--good);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.reference-confirm-strip {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(212, 202, 189, 0.78);
  border-radius: 8px;
  background: #fffaf1;
  padding: 10px 12px;
  margin: 0 0 14px;
}

.reference-confirm-strip strong {
  color: #171716;
  font-size: 13px;
  font-weight: 950;
}

.reference-confirm-strip span {
  color: #756d61;
  font-size: 12px;
  line-height: 1.45;
}

.asset-group-pills {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.asset-group-pill {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 3px 8px;
  border: 1px solid rgba(212, 202, 189, 0.9);
  border-radius: 8px;
  background: #fffaf1;
  padding: 9px;
  text-align: left;
}

.asset-group-pill strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.asset-group-pill span {
  grid-row: 1 / 3;
  grid-column: 2;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #171716;
  color: #f6d99f;
  font-size: 12px;
  font-weight: 950;
}

.asset-group-pill small {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.reference-basket {
  align-items: stretch;
  border-color: rgba(212, 202, 189, 0.88);
  background: rgba(255, 253, 248, 0.82);
}

.reference-basket > div {
  flex: 1 1 auto;
  min-width: 0;
}

.reference-basket #referenceBasketStatus {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.basket-meter {
  min-width: 118px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  border: 1px solid rgba(212, 202, 189, 0.82);
  border-radius: 8px;
  background: #fffaf1;
  padding: 8px 9px;
}

.basket-meter strong {
  margin: 0;
  color: #171716;
  font-size: 18px;
  line-height: 1;
}

.basket-meter small {
  flex: none;
  text-align: left;
  color: #756d61;
  font-size: 11px;
  line-height: 1.2;
}

.basket-meter.ok {
  border-color: rgba(28, 122, 90, 0.24);
  background: #f1f8f2;
}

.basket-meter.warn {
  border-color: rgba(154, 104, 23, 0.24);
  background: #fff7e8;
}

.basket-meter.danger {
  border-color: rgba(183, 67, 53, 0.24);
  background: #fff1ee;
}

.asset-duty {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(212, 202, 189, 0.76);
  border-radius: 8px;
  background: rgba(250, 246, 238, 0.76);
  padding: 8px;
}

.asset-duty strong {
  margin: 0;
  color: #211f1a;
  font-size: 11px;
  font-weight: 950;
}

.asset-duty span,
.asset-duty small {
  color: #756d61;
  font-size: 11px;
  line-height: 1.35;
}

.shot-video-runway {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid rgba(212, 202, 189, 0.86);
  border-radius: 8px;
  background: #fff7e8;
  padding: 14px;
}

.shot-video-runway.ok {
  border-color: rgba(28, 122, 90, 0.24);
  background: #f1f8f2;
}

.shot-video-runway.blocked {
  border-color: rgba(183, 67, 53, 0.22);
  background: #fff3ef;
}

.shot-video-runway > div:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.shot-video-runway strong {
  color: #211f1a;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
}

.shot-video-runway span {
  color: #756d61;
  font-size: 12px;
  line-height: 1.45;
}

.shot-video-runway-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shot-video-runway-chips span {
  border: 1px solid rgba(212, 202, 189, 0.86);
  border-radius: 999px;
  background: #fffdf8;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
}

.shot-video-runway-chips span.ok {
  color: var(--good);
}

.shot-video-runway-chips span.warn {
  color: var(--warn);
}

.focus-pulse {
  animation: focusPulse 1.1s ease-out;
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(177, 132, 63, 0.42);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(177, 132, 63, 0);
  }
}

@media (max-width: 1440px) {
  .workspace-intro {
    grid-template-columns: minmax(0, 900px);
  }

  .workspace-metrics {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

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

  .config-row {
    grid-template-columns: minmax(70px, 0.72fr) minmax(0, 1.28fr);
    gap: 7px;
  }

  .config-panel {
    padding: 10px;
  }

  .config-panel p {
    font-size: 10px;
  }

  .config-inline-select select {
    min-height: 32px;
    padding: 5px 8px;
  }
}

@media (max-width: 1100px) {
  .topbar {
    position: static;
  }

  .brand-mark {
    min-width: 0;
  }

  .control-panel {
    position: static;
  }

  .workspace-intro {
    grid-template-columns: 1fr;
  }

  .reference-flow-nodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .round-nav {
    display: none;
  }

  .preview-caption {
    width: 100%;
  }

  .studio-grid,
  .workflow-grid,
  .render-grid {
    grid-template-columns: 1fr;
  }

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

  .asset-group-pills {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1640px);
    padding-top: 10px;
  }

  .topbar {
    padding: 14px;
    gap: 14px;
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .brand-mark > div:last-child {
    gap: 1px;
  }

  .brand-mark strong {
    font-size: 15px;
  }

  .brand-mark span {
    font-size: 10px;
  }

  .nav-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
    min-height: 38px;
  }

  .nav-tabs a {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .topbar-actions {
    align-self: flex-start;
  }

  .workspace-intro {
    gap: 14px;
    padding: 24px 0 16px;
  }

  .workspace-intro h1 {
    font-size: 34px;
  }

  .workspace-intro p {
    font-size: 14px;
  }

  .workspace-metrics {
    grid-template-columns: 1fr;
  }

  .workspace-metrics span {
    min-height: 54px;
  }

  .config-board,
  .control-panel,
  .panel,
  .preview-stage {
    padding: 14px;
  }

  .config-matrix {
    grid-template-columns: 1fr;
  }

  .config-board-summary {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "hint"
      "status";
  }

  .config-board-summary::before {
    justify-self: start;
    margin-top: 6px;
  }

  .workflow-cockpit-head,
  .workflow-next-action,
  .reference-basket,
  .asset-group-nav > div:first-child,
  .shot-video-runway {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .workflow-cockpit-status,
  .reference-basket small {
    max-width: none;
    text-align: left;
  }

  .workflow-steps,
  .asset-group-pills,
  .reference-flow-nodes {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .workflow-step {
    min-width: 180px;
    scroll-snap-align: start;
  }

  .asset-group-pill {
    min-width: 154px;
    scroll-snap-align: start;
  }

  .reference-flow-node {
    min-width: 230px;
    scroll-snap-align: start;
  }

  .workflow-next-action button,
  .shot-video-runway button {
    width: 100%;
  }

  .basket-meter {
    min-width: min(100%, 160px);
  }

  .config-row {
    grid-template-columns: minmax(92px, 0.6fr) minmax(0, 1.4fr);
  }

  .stage-labels {
    grid-template-columns: 1fr;
    border-radius: 8px;
  }

  .video-frame {
    aspect-ratio: 9 / 16;
  }

  .image-preview-button {
    min-height: 260px;
  }

  .storyboard-preview-button {
    min-height: 320px;
  }

  .shot-video-workbench,
  .storyboard-layout,
  .cinematic-editor,
  .reference-layout {
    grid-template-columns: 1fr;
  }
}

/* CEO visual pass final override: keep this block last. */
:root {
  color-scheme: light;
  --bg: #eef1f2;
  --paper: #fbfcfb;
  --ink: #15191b;
  --muted: #647074;
  --soft: #dfe5e5;
  --line: #c7d0d1;
  --accent: #123b3a;
  --good: #14785f;
  --warn: #a66919;
  --danger: #b33a32;
  --console: #0f1719;
  --console-2: #172123;
  --signal: #2f8f83;
  --shadow: 0 18px 44px rgba(21, 30, 32, 0.08);
  --shadow-tight: 0 8px 22px rgba(21, 30, 32, 0.07);
}

body {
  background: linear-gradient(180deg, #f5f7f7 0, #eef1f2 360px, #e9eeee 100%);
  color: var(--ink);
}

.shell {
  width: min(1760px, calc(100vw - 40px));
  padding-top: 16px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 120;
  min-height: 64px;
  height: auto;
  border: 1px solid rgba(28, 42, 45, 0.18);
  border-radius: 8px;
  background: rgba(250, 252, 252, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-tight);
  padding: 10px 12px;
}

.brand-mark {
  min-width: 238px;
  gap: 12px;
}

.brand-mark strong {
  color: #111719;
  font-size: 15px;
}

.brand-mark span {
  border-color: #c4cccc;
  color: #536065;
  font-size: 13px;
  padding-left: 11px;
}

.bars {
  width: 34px;
  height: 30px;
}

.bars span {
  width: 7px;
  background: #172123;
}

.nav-tabs {
  min-width: 0;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-tabs a,
.nav-tabs button {
  appearance: none;
  min-width: 76px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #5f6b70;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.nav-tabs a:hover,
.nav-tabs button:hover,
.nav-tabs a:first-child,
.nav-tabs button.active,
.nav-tabs button[aria-current="page"] {
  border-color: rgba(18, 59, 58, 0.25);
  background: #e4eeee;
  color: #112829;
  box-shadow: inset 0 -2px 0 rgba(47, 143, 131, 0.45);
}

.topbar-actions {
  gap: 8px;
}

.icon-button {
  flex: 0 0 auto;
  border-radius: 7px;
  border-color: rgba(28, 42, 45, 0.16);
  background: #f4f7f7;
}

.icon-button.active,
.icon-button:hover {
  background: #dfeaea;
  color: #123b3a;
}

.status-pill {
  border-color: rgba(20, 120, 95, 0.2);
  background: #e9f6f1;
  color: #11654f;
  padding: 8px 11px;
}

.workspace-intro {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 560px);
  text-align: left;
  justify-content: stretch;
  align-items: end;
  gap: 24px;
  margin-top: 12px;
  padding: 22px 4px 16px;
}

.workspace-intro::before {
  background: rgba(20, 33, 35, 0.14);
}

.workspace-intro h1 {
  margin-left: 0;
  font-size: clamp(28px, 2.3vw, 40px);
  line-height: 1.08;
}

.workspace-intro p {
  margin: 0;
  max-width: 620px;
  color: #5f696d;
}

.workspace-intro span,
.eyebrow {
  color: #366b67;
}

.workflow-cockpit {
  position: sticky;
  top: 88px;
  z-index: 90;
  border: 1px solid rgba(28, 42, 45, 0.16);
  border-radius: 8px;
  background: rgba(251, 252, 251, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-tight);
}

.workflow-steps {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.workflow-step {
  flex: 0 0 138px;
  min-width: 0;
  border-color: rgba(28, 42, 45, 0.14);
  background: #f4f7f7;
}

.workflow-step.current {
  border-color: rgba(47, 143, 131, 0.48);
  background: #e6f3f1;
}

.workflow-step.done {
  border-color: rgba(20, 120, 95, 0.34);
  background: #edf7f2;
}

.workflow-step.blocked {
  border-color: rgba(166, 105, 25, 0.28);
  background: #fff6e8;
}

.workflow-step strong,
.workflow-step small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-workbench-panel] {
  display: none !important;
}

[data-workbench-panel].workbench-panel-active {
  display: block !important;
}

.workspace-intro.workbench-panel-active,
.studio-grid.workbench-panel-active,
.workflow-grid.workbench-panel-active,
.render-grid.workbench-panel-active {
  display: grid !important;
}

[data-workbench-subpanel] {
  display: none !important;
}

[data-workbench-subpanel].workbench-subpanel-active {
  display: block !important;
}

.preview-stage[data-workbench-subpanel].workbench-subpanel-active {
  display: grid !important;
}

body:not([data-active-stage]) [data-workbench-panel] {
  display: none !important;
}

body:not([data-active-stage]) [data-workbench-panel~="creative"],
body:not([data-active-stage]) .studio-grid[data-workbench-panel~="creative"] {
  display: grid !important;
}

body:not([data-active-stage]) [data-workbench-subpanel="creative"] {
  display: block !important;
}

body[data-active-stage="creative"] .studio-grid,
body[data-active-stage="video"] .studio-grid,
body[data-active-stage="script"] .workflow-grid,
body[data-active-stage="shots"] .workflow-grid {
  grid-template-columns: minmax(0, 1fr);
}

.config-board,
.control-panel,
.panel {
  border-color: rgba(28, 42, 45, 0.16);
  background: rgba(251, 252, 251, 0.92);
  box-shadow: var(--shadow-tight);
}

.config-board {
  margin: 16px 0 18px;
  padding: 14px;
  overflow: visible;
}

.config-board::before {
  height: 2px;
  background: linear-gradient(90deg, #172123, #2f8f83, #a7b7b6);
}

.config-board-summary {
  grid-template-columns: minmax(180px, 0.42fr) minmax(260px, 1fr) auto;
  grid-template-areas: "title hint status";
  gap: 10px;
  padding: 4px 0;
}

.config-board-summary::before {
  grid-area: status;
  justify-self: end;
  border-radius: 7px;
  background: #eef4f4;
}

.config-board-summary > span {
  font-size: 15px;
}

.config-board-summary > small {
  align-self: center;
  font-size: 12px;
}

.config-board-summary .config-board-status {
  margin-right: 58px;
}

.pipeline-strip {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.pipeline-strip span {
  border-color: rgba(28, 42, 45, 0.12);
  background: #f4f7f7;
  color: #2f3a3d;
}

.config-matrix {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.config-panel {
  min-height: 148px;
  border-color: rgba(28, 42, 45, 0.14);
  background: #fbfcfb;
}

.config-panel-head {
  align-items: center;
}

.config-badge,
.config-board-status,
.panel-head span {
  border-radius: 7px;
}

.global-model-workbench,
.global-storage-workbench,
.global-creative-workbench {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
  gap: 12px 14px;
  margin-top: 14px;
  border-top: 1px solid rgba(28, 42, 45, 0.12);
  padding-top: 14px;
}

.global-model-workbench > .panel-head,
.global-storage-workbench > .panel-head,
.global-creative-workbench > .panel-head {
  grid-column: 1;
  align-self: start;
  margin: 0;
  border: 0;
  padding: 0;
}

.global-model-workbench > label,
.global-model-workbench > .model-settings,
.global-storage-workbench > .storage-grid,
.global-storage-workbench > button,
.global-storage-workbench > .provider-status,
.global-creative-workbench > .generation-grid {
  grid-column: 2;
}

.storage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.storage-grid input:first-child,
.storage-grid input:nth-child(4) {
  grid-column: span 2;
}

.model-config {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  min-width: 0;
}

input,
textarea,
select {
  min-width: 0;
  border-color: rgba(28, 42, 45, 0.18);
  background: #ffffff;
  color: #172123;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47, 143, 131, 0.72);
  box-shadow: 0 0 0 3px rgba(47, 143, 131, 0.16);
}

button,
.task-actions a,
.download-links a {
  max-width: 100%;
  min-width: 0;
  border-radius: 7px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.studio-grid {
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  gap: 18px;
}

.control-panel {
  position: sticky;
  top: 104px;
}

.preview-stage {
  min-height: 520px;
  align-content: start;
  border: 1px solid rgba(15, 23, 25, 0.92);
  border-radius: 8px;
  background: linear-gradient(180deg, #172123, #0f1719);
  box-shadow: 0 24px 60px rgba(15, 23, 25, 0.22);
  padding: 18px;
}

.preview-stage::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.38;
}

.review-stage-head {
  position: relative;
  z-index: 1;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  padding-bottom: 12px;
}

.review-stage-head .eyebrow {
  color: #8ebeba;
}

.review-stage-head h2 {
  color: #f2f7f6;
  font-size: 19px;
}

.review-stage-head h2::after {
  content: "Video Viewing";
  display: inline-flex;
  margin-left: 10px;
  border: 1px solid rgba(142, 190, 186, 0.28);
  border-radius: 999px;
  color: #a9cbc8;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.review-stage-meta {
  border-color: rgba(142, 190, 186, 0.28);
  background: rgba(47, 143, 131, 0.12);
  color: #b9dfdc;
}

.preview-shell {
  grid-template-columns: 40px minmax(260px, 980px) 40px;
  gap: 12px;
  margin-top: 16px;
}

.round-nav {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #d5e3e1;
  font-size: 20px;
}

.video-frame {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #050808;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 18px 50px rgba(0,0,0,0.36);
}

.video-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 5px;
  pointer-events: none;
}

.preview-empty {
  color: rgba(230, 240, 238, 0.74);
  font-size: clamp(18px, 2vw, 28px);
  letter-spacing: 0;
}

.preview-empty::after {
  content: " / 等待可审看的视频文件";
  color: rgba(230, 240, 238, 0.44);
  font-size: 13px;
  font-weight: 750;
}

.preview-caption {
  width: min(980px, calc(100% - 104px));
  margin-top: 16px;
  color: #f1f6f5;
}

.preview-caption h2 {
  font-size: 18px;
}

.preview-caption p {
  color: rgba(230, 240, 238, 0.64);
  font-size: 13px;
}

.reference-flow-nodes {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  overflow: visible;
  margin-bottom: 14px;
  counter-reset: refnode;
}

.reference-flow-node {
  position: relative;
  min-width: 0;
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid rgba(28, 42, 45, 0.14);
  border-radius: 8px;
  background: #f6f8f8;
  padding: 12px 12px 12px 42px;
  box-shadow: none;
  counter-increment: refnode;
}

.reference-flow-node::before {
  content: counter(refnode, decimal-leading-zero);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #172123;
  color: #edf4f3;
  font-size: 10px;
  font-weight: 950;
}

.reference-flow-node::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 40px;
  bottom: 12px;
  width: 1px;
  background: rgba(28, 42, 45, 0.16);
}

.reference-flow-node:hover {
  transform: none;
  border-color: rgba(47, 143, 131, 0.42);
}

.reference-flow-node.current {
  border-color: rgba(47, 143, 131, 0.5);
  background: #e9f5f3;
}

.reference-flow-node.done {
  border-color: rgba(20, 120, 95, 0.32);
  background: #eef7f3;
}

.reference-flow-node > div:first-child {
  display: grid;
  gap: 4px;
}

.reference-flow-node strong {
  color: #172123;
  font-size: 13px;
  line-height: 1.25;
}

.reference-flow-node span,
.reference-flow-node p {
  color: #687579;
  font-size: 11px;
  line-height: 1.35;
}

.reference-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reference-flow-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.reference-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.reference-basket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  border-color: rgba(28, 42, 45, 0.14);
  background: #f5f8f8;
}

.shot-ref-card,
.shot-video-card,
.asset-item,
.task-item,
.project-item,
.json-details,
.model-config,
.shot {
  border-color: rgba(28, 42, 45, 0.14);
  background: #fbfcfb;
}

.shot-video-params,
.provider-grid,
.generation-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.shot-video-workbench {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.asset-list,
.task-list,
.project-list {
  scrollbar-width: thin;
}

@media (max-width: 1440px) {
  .config-board-summary {
    grid-template-columns: minmax(160px, 0.38fr) minmax(240px, 1fr) auto;
  }

  .storage-grid,
  .model-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-flow-nodes {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 1100px) {
  .topbar {
    position: sticky;
    top: 6px;
    flex-wrap: wrap;
  }

  .brand-mark {
    min-width: 190px;
  }

  .nav-tabs {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
  }

  .workflow-cockpit {
    top: 120px;
  }

  .workspace-intro,
  .studio-grid,
  .workflow-grid,
  .render-grid,
  .shot-video-workbench,
  .storyboard-layout,
  .cinematic-editor,
  .reference-layout {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }

  .global-model-workbench,
  .global-storage-workbench,
  .global-creative-workbench {
    grid-template-columns: 1fr;
  }

  .global-model-workbench > .panel-head,
  .global-storage-workbench > .panel-head,
  .global-creative-workbench > .panel-head,
  .global-model-workbench > label,
  .global-model-workbench > .model-settings,
  .global-storage-workbench > .storage-grid,
  .global-storage-workbench > button,
  .global-storage-workbench > .provider-status,
  .global-creative-workbench > .generation-grid {
    grid-column: 1;
  }

  .reference-flow-nodes {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .preview-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .round-nav {
    display: none;
  }

  .preview-caption {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 18px, 760px);
    padding-top: 8px;
  }

  .topbar {
    align-items: stretch;
    padding: 9px;
  }

  .brand-mark {
    min-width: 0;
  }

  .brand-mark span {
    display: none;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .status-pill {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-tabs button,
  .nav-tabs a {
    min-width: 64px;
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .workflow-cockpit {
    position: static;
  }

  .workflow-step {
    flex-basis: 156px;
  }

  .workspace-intro {
    padding: 18px 0 12px;
  }

  .workspace-intro h1 {
    font-size: 28px;
  }

  .config-board,
  .control-panel,
  .panel,
  .preview-stage {
    padding: 13px;
  }

  .config-board-summary {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "hint"
      "status";
  }

  .config-board-summary .config-board-status {
    width: fit-content;
    margin-right: 0;
  }

  .config-board-summary::before {
    grid-area: status;
    justify-self: end;
  }

  .pipeline-strip,
  .config-matrix,
  .storage-grid,
  .model-config,
  .reference-actions,
  .reference-basket,
  .shot-video-params,
  .provider-grid,
  .generation-grid {
    grid-template-columns: 1fr;
  }

  .storage-grid input:first-child,
  .storage-grid input:nth-child(4) {
    grid-column: auto;
  }

  .reference-flow-nodes {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .reference-flow-node {
    flex: 0 0 224px;
    scroll-snap-align: start;
  }

  .review-stage-head,
  .preview-caption,
  .reference-basket {
    align-items: stretch;
  }

  .review-stage-head h2::after {
    display: flex;
    width: fit-content;
    margin: 6px 0 0;
  }

  .video-frame {
    aspect-ratio: 9 / 16;
  }

  .preview-empty::after {
    display: block;
    margin-top: 5px;
  }
}

/* Final visual override for the public-facing tech studio theme. */
:root {
  color-scheme: dark;
}

body {
  background:
    radial-gradient(circle at 14% -8%, rgba(99, 230, 255, 0.2), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(85, 241, 194, 0.12), transparent 32%),
    linear-gradient(180deg, #07141a 0%, #061014 46%, #03080c 100%) !important;
  color: var(--tech-text) !important;
}

.shell {
  width: min(100vw - 28px, 1880px) !important;
}

.topbar {
  display: grid !important;
  grid-template-columns: minmax(250px, 0.72fr) minmax(560px, 1.8fr) minmax(170px, 0.58fr) !important;
  align-items: center !important;
  gap: 16px !important;
  min-height: 92px !important;
  border: 1px solid var(--tech-line) !important;
  background:
    linear-gradient(180deg, rgba(13, 31, 38, 0.93), rgba(7, 18, 24, 0.96)),
    rgba(7, 18, 24, 0.96) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.brand-mark {
  min-width: 0 !important;
  gap: 14px !important;
}

.brand-mark .bars {
  position: relative !important;
  flex: 0 0 52px !important;
  width: 52px !important;
  height: 52px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: end !important;
  gap: 5px !important;
  padding: 10px !important;
  border: 1px solid rgba(99, 230, 255, 0.46) !important;
  border-radius: 15px !important;
  background:
    linear-gradient(135deg, rgba(99, 230, 255, 0.16), rgba(85, 241, 194, 0.06)),
    #071116 !important;
  box-shadow: 0 0 0 4px rgba(99, 230, 255, 0.05), 0 12px 26px rgba(0, 0, 0, 0.38) !important;
  overflow: hidden !important;
}

.brand-mark .bars span {
  width: 100% !important;
  min-width: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, var(--tech-cyan), #1f9fbd) !important;
  box-shadow: 0 0 16px rgba(99, 230, 255, 0.42) !important;
}

.brand-mark .bars span:nth-child(1) { height: 58% !important; }
.brand-mark .bars span:nth-child(2) { height: 82% !important; background: linear-gradient(180deg, var(--tech-mint), #1ba78b) !important; }
.brand-mark .bars span:nth-child(3) { height: 46% !important; }

.brand-mark strong {
  color: var(--tech-text) !important;
  font-size: 18px !important;
}

.brand-mark span:not(.bars span) {
  display: block !important;
  margin-top: 3px !important;
  border-left: 0 !important;
  padding-left: 0 !important;
  color: var(--tech-muted) !important;
  font-size: 12px !important;
  letter-spacing: 0.08em !important;
}

.nav-tabs {
  position: relative !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: center !important;
  gap: 8px 18px !important;
  max-width: 690px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  overflow: visible !important;
  scrollbar-width: none !important;
}

.nav-tabs::before {
  content: "" !important;
  position: absolute !important;
  left: 22px !important;
  right: 22px !important;
  top: calc(50% - 1px) !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, transparent, rgba(99, 230, 255, 0.32), rgba(85, 241, 194, 0.28), transparent) !important;
  pointer-events: none !important;
}

.nav-tabs button,
.nav-tabs a {
  position: relative !important;
  z-index: 1 !important;
  min-width: 76px !important;
  min-height: 34px !important;
  border: 1px solid rgba(99, 230, 255, 0.16) !important;
  border-radius: 10px !important;
  background: rgba(8, 20, 26, 0.9) !important;
  color: #b7d0d7 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.nav-tabs button::after,
.nav-tabs a::after {
  content: "→" !important;
  position: absolute !important;
  right: -15px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: rgba(99, 230, 255, 0.58) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  pointer-events: none !important;
}

.nav-tabs button:nth-child(7)::after,
.nav-tabs button:last-child::after,
.nav-tabs a:nth-child(7)::after,
.nav-tabs a:last-child::after {
  display: none !important;
}

.nav-tabs button:hover,
.nav-tabs a:hover,
.nav-tabs button.active,
.nav-tabs button[aria-current="page"],
.nav-tabs a:first-child {
  border-color: rgba(99, 230, 255, 0.58) !important;
  background: linear-gradient(180deg, rgba(61, 220, 240, 0.24), rgba(18, 55, 66, 0.92)) !important;
  color: #f4feff !important;
  box-shadow: 0 0 0 3px rgba(99, 230, 255, 0.09), inset 0 -2px 0 rgba(85, 241, 194, 0.6) !important;
}

.topbar-actions {
  justify-content: end !important;
}

.icon-button,
.status-pill {
  border-color: var(--tech-line) !important;
  background: rgba(11, 24, 30, 0.82) !important;
  color: var(--tech-text) !important;
}

.status-pill {
  color: var(--tech-mint) !important;
  white-space: nowrap !important;
}

.workspace-intro {
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: center !important;
  text-align: center !important;
  margin-top: 18px !important;
  padding: 28px 4px 20px !important;
}

.workspace-intro h1 {
  margin: 8px auto 0 !important;
  color: var(--tech-text) !important;
  text-shadow: 0 0 34px rgba(99, 230, 255, 0.14) !important;
}

.workspace-intro p {
  max-width: 760px !important;
  margin: 8px auto 0 !important;
  color: var(--tech-muted) !important;
  font-size: 13px !important;
}

.workspace-intro span,
.eyebrow {
  color: var(--tech-cyan) !important;
}

.workflow-cockpit {
  display: none !important;
}

.config-board,
.control-panel,
.panel,
.preview-stage,
.global-model-workbench,
.global-storage-workbench,
.global-creative-workbench,
.reference-basket,
.reference-flow-node,
.asset-group-nav,
.shot-ref-card,
.shot-video-card,
.asset-item,
.task-item,
.project-item,
.model-config,
.json-details,
.shot {
  border-color: var(--tech-line) !important;
  background: var(--tech-panel) !important;
  color: var(--tech-text) !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24) !important;
}

.panel-head,
.config-board-summary,
.review-stage-head,
.preview-caption,
.shot-video-preflight,
.provider-status,
.asset-group-card {
  border-color: var(--tech-line) !important;
  background: var(--tech-panel-soft) !important;
  color: var(--tech-text) !important;
}

input,
textarea,
select {
  border-color: rgba(110, 231, 255, 0.2) !important;
  background: rgba(3, 11, 15, 0.82) !important;
  color: var(--tech-text) !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(181, 211, 219, 0.5) !important;
}

button.primary,
.primary {
  border-color: rgba(99, 230, 255, 0.46) !important;
  background: linear-gradient(135deg, #1fc7df, #1f9f86) !important;
  color: #041114 !important;
  box-shadow: 0 10px 26px rgba(31, 199, 223, 0.22) !important;
}

button.secondary,
button.ghost,
.secondary,
.ghost,
.mini-button {
  border-color: rgba(110, 231, 255, 0.22) !important;
  background: rgba(8, 20, 26, 0.86) !important;
  color: #d9f8ff !important;
}

.status-badge.done,
.provider-status.ok,
.config-board-status {
  border-color: rgba(85, 241, 194, 0.42) !important;
  background: rgba(85, 241, 194, 0.12) !important;
  color: var(--tech-mint) !important;
}

.status-badge.warn,
.provider-status.warn {
  border-color: rgba(246, 201, 107, 0.42) !important;
  background: rgba(246, 201, 107, 0.12) !important;
  color: var(--tech-amber) !important;
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr) !important;
  }

  .nav-tabs {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
  }

  .topbar-actions {
    justify-self: end !important;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 16px, 760px) !important;
  }

  .topbar {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .brand-mark {
    justify-content: center !important;
  }

  .brand-mark .bars {
    flex-basis: 44px !important;
    width: 44px !important;
    height: 44px !important;
  }

  .brand-mark span:not(.bars span) {
    display: block !important;
    font-size: 10px !important;
  }

  .nav-tabs {
    justify-content: flex-start !important;
    max-height: 92px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 4px !important;
  }

  .nav-tabs::before,
  .nav-tabs button::after,
  .nav-tabs a::after {
    display: none !important;
  }

  .nav-tabs button,
  .nav-tabs a {
    min-width: 68px !important;
  }

  .topbar-actions {
    justify-content: center !important;
  }
}

/* Youthful bright theme override: restore readability with fresh studio colors. */
:root {
  color-scheme: light;
  --fresh-bg: #f7fbff;
  --fresh-paper: rgba(255, 255, 255, 0.94);
  --fresh-paper-strong: #ffffff;
  --fresh-ink: #10202a;
  --fresh-muted: #60707b;
  --fresh-soft: #edf6fb;
  --fresh-line: rgba(42, 91, 112, 0.16);
  --fresh-cyan: #21b7d7;
  --fresh-teal: #22c3a6;
  --fresh-blue: #5b8cff;
  --fresh-coral: #ff7a8a;
  --fresh-sun: #ffd166;
  --fresh-lilac: #9b8cff;
}

body {
  background:
    radial-gradient(circle at 10% -8%, rgba(91, 140, 255, 0.2), transparent 32%),
    radial-gradient(circle at 82% 0%, rgba(255, 122, 138, 0.16), transparent 30%),
    radial-gradient(circle at 65% 42%, rgba(34, 195, 166, 0.12), transparent 38%),
    linear-gradient(180deg, #fbfdff 0%, #f2f9ff 46%, #fff8fb 100%) !important;
  color: var(--fresh-ink) !important;
}

body,
input,
textarea,
select,
button {
  color: var(--fresh-ink) !important;
}

.topbar {
  display: grid !important;
  grid-template-columns: minmax(260px, 0.76fr) minmax(560px, 1.75fr) minmax(170px, 0.56fr) !important;
  min-height: 92px !important;
  border: 1px solid rgba(31, 98, 126, 0.16) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 18px 42px rgba(31, 80, 120, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
}

.brand-mark .bars {
  flex: 0 0 52px !important;
  width: 52px !important;
  height: 52px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: end !important;
  gap: 5px !important;
  padding: 10px !important;
  border: 1px solid rgba(33, 183, 215, 0.32) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(135deg, rgba(33, 183, 215, 0.18), rgba(255, 122, 138, 0.14)),
    #ffffff !important;
  box-shadow: 0 10px 24px rgba(33, 183, 215, 0.16) !important;
}

.brand-mark .bars span {
  display: block !important;
  width: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #40d9ee, #1aa9c9) !important;
  box-shadow: none !important;
}

.brand-mark .bars span:nth-child(1) { height: 58% !important; background: linear-gradient(180deg, #ffd166, #ff9f5c) !important; }
.brand-mark .bars span:nth-child(2) { height: 84% !important; background: linear-gradient(180deg, #35e0bd, #16a98e) !important; }
.brand-mark .bars span:nth-child(3) { height: 48% !important; background: linear-gradient(180deg, #7aa2ff, #5277e7) !important; }

.brand-mark strong {
  color: var(--fresh-ink) !important;
  font-size: 18px !important;
  text-shadow: none !important;
}

.brand-mark > div:last-child > span {
  display: block !important;
  margin-top: 3px !important;
  border-left: 0 !important;
  padding-left: 0 !important;
  color: #62727c !important;
  font-size: 12px !important;
  letter-spacing: 0.08em !important;
}

.nav-tabs {
  max-width: 690px !important;
  gap: 8px 18px !important;
}

.nav-tabs::before {
  background: linear-gradient(90deg, transparent, rgba(33, 183, 215, 0.26), rgba(255, 122, 138, 0.22), transparent) !important;
}

.nav-tabs button,
.nav-tabs a {
  border-color: rgba(40, 100, 130, 0.16) !important;
  background: rgba(255, 255, 255, 0.86) !important;
  color: #40515c !important;
  box-shadow: 0 6px 16px rgba(31, 80, 120, 0.08) !important;
}

.nav-tabs button::after,
.nav-tabs a::after {
  color: rgba(33, 183, 215, 0.75) !important;
}

.nav-tabs button:hover,
.nav-tabs a:hover,
.nav-tabs button.active,
.nav-tabs button[aria-current="page"],
.nav-tabs a:first-child {
  border-color: rgba(33, 183, 215, 0.42) !important;
  background: linear-gradient(135deg, rgba(210, 248, 255, 0.98), rgba(232, 255, 247, 0.98)) !important;
  color: #10202a !important;
  box-shadow: 0 10px 22px rgba(33, 183, 215, 0.18), inset 0 -3px 0 rgba(34, 195, 166, 0.46) !important;
}

.icon-button,
.status-pill {
  border-color: rgba(33, 183, 215, 0.22) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #23414c !important;
}

.status-pill {
  background: #e7fbf5 !important;
  color: #0c7b66 !important;
}

.workspace-intro h1,
.panel h2,
.panel-head h2,
.control-panel h2,
.config-board h2,
.shot h3,
.shot-ref-card h3,
.shot-video-card h3,
.task-item h3,
.asset-item h3 {
  color: var(--fresh-ink) !important;
  text-shadow: none !important;
}

.workspace-intro p,
.workspace-intro span,
.eyebrow,
.panel p,
.hint,
small,
label,
.provider-status,
.config-board-summary small {
  color: var(--fresh-muted) !important;
}

.workspace-intro span,
.eyebrow {
  color: #168aa2 !important;
}

.config-board,
.control-panel,
.panel,
.preview-stage,
.global-model-workbench,
.global-storage-workbench,
.global-creative-workbench,
.reference-basket,
.reference-flow-node,
.asset-group-nav,
.shot-ref-card,
.shot-video-card,
.asset-item,
.task-item,
.project-item,
.model-config,
.json-details,
.shot {
  border-color: var(--fresh-line) !important;
  background: var(--fresh-paper) !important;
  color: var(--fresh-ink) !important;
  box-shadow: 0 16px 38px rgba(31, 80, 120, 0.1) !important;
}

.panel-head,
.config-board-summary,
.review-stage-head,
.preview-caption,
.shot-video-preflight,
.asset-group-card,
.provider-status,
.reference-basket-toolbar,
.asset-purpose-card {
  border-color: var(--fresh-line) !important;
  background: linear-gradient(135deg, rgba(240, 250, 255, 0.96), rgba(255, 249, 252, 0.96)) !important;
  color: var(--fresh-ink) !important;
}

input,
textarea,
select {
  border-color: rgba(42, 91, 112, 0.22) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--fresh-ink) !important;
  box-shadow: inset 0 1px 2px rgba(31, 80, 120, 0.05) !important;
}

input::placeholder,
textarea::placeholder {
  color: #93a1aa !important;
}

.prompt-input,
.cinematic-prompt-textarea,
textarea {
  background: #ffffff !important;
  color: #182832 !important;
}

.empty-state,
.config-empty,
.preview-empty,
.cinematic-summary,
.cinematic-output,
.json-view,
pre,
code {
  border-color: rgba(42, 91, 112, 0.16) !important;
  background: linear-gradient(135deg, #ffffff, #f1fbff) !important;
  color: #31444f !important;
}

.empty-state {
  font-weight: 700 !important;
}

#cinematicStatus,
#storyboardStatus,
#referenceStatus,
#modelStatus,
#projectMeta {
  border-color: rgba(42, 91, 112, 0.16) !important;
  background: #fff7df !important;
  color: #71510a !important;
}

button.primary,
.primary {
  border-color: rgba(18, 165, 190, 0.3) !important;
  background: linear-gradient(135deg, #27d0e7, #25c59f) !important;
  color: #062028 !important;
  box-shadow: 0 12px 24px rgba(33, 183, 215, 0.22) !important;
}

button.secondary,
button.ghost,
.secondary,
.ghost,
.mini-button {
  border-color: rgba(42, 91, 112, 0.18) !important;
  background: #ffffff !important;
  color: #29424e !important;
  box-shadow: 0 8px 18px rgba(31, 80, 120, 0.08) !important;
}

.status-badge,
.provider-chip,
.asset-type-pill {
  color: #27414d !important;
}

.status-badge.done,
.provider-status.ok,
.config-board-status {
  border-color: rgba(34, 195, 166, 0.32) !important;
  background: #e4fbf3 !important;
  color: #0b755f !important;
}

.status-badge.warn,
.provider-status.warn {
  border-color: rgba(255, 185, 89, 0.36) !important;
  background: #fff5dc !important;
  color: #8a5a00 !important;
}

.status-badge.error,
.provider-status.error {
  border-color: rgba(255, 122, 138, 0.34) !important;
  background: #fff0f3 !important;
  color: #a73345 !important;
}

.workflow-cockpit {
  display: none !important;
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr) !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr !important;
  }

  .nav-tabs {
    max-height: 92px !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
  }

  .brand-mark {
    justify-content: center !important;
  }
}

/* Product polish pass: creative mode, visible logo, and cleaner video review. */
.brand-mark .bars {
  background:
    linear-gradient(180deg, #ffd166, #ff9f5c) 13px 21px / 7px 20px no-repeat,
    linear-gradient(180deg, #35e0bd, #16a98e) 23px 13px / 8px 28px no-repeat,
    linear-gradient(180deg, #7aa2ff, #5277e7) 35px 24px / 7px 17px no-repeat,
    linear-gradient(135deg, rgba(229, 248, 255, 0.98), rgba(255, 241, 247, 0.98)) !important;
  border: 1px solid rgba(33, 183, 215, 0.34) !important;
  box-shadow: 0 10px 26px rgba(33, 183, 215, 0.18) !important;
}

.brand-mark .bars span {
  display: none !important;
}

.brand-mark .bars::before {
  inset: 9px !important;
  border-color: rgba(33, 183, 215, 0.18) !important;
  border-radius: 12px !important;
}

.creative-mode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 4px 0 18px;
  padding: 16px;
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(234, 249, 255, 0.94), rgba(255, 247, 251, 0.94)),
    #ffffff;
  box-shadow: 0 12px 24px rgba(31, 80, 120, 0.08);
}

.creative-mode-card strong {
  display: block;
  margin-top: 4px;
  color: #10202a;
  font-size: 18px;
  font-weight: 900;
}

.creative-mode-card small {
  display: block;
  margin-top: 5px;
  color: #60707b !important;
  font-size: 12px;
  line-height: 1.5;
}

.mode-segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.mode-segmented button {
  min-height: 40px;
  border: 0 !important;
  border-radius: 10px;
  background: transparent !important;
  color: #52636e !important;
  font-size: 13px;
  font-weight: 900;
  box-shadow: none !important;
  cursor: pointer;
}

.mode-segmented button.active {
  background: linear-gradient(135deg, #27d0e7, #35e0bd) !important;
  color: #062028 !important;
  box-shadow: 0 8px 18px rgba(33, 183, 215, 0.22) !important;
}

.preview-stage {
  min-height: auto !important;
  padding: 18px !important;
  border-color: rgba(42, 91, 112, 0.14) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 250, 255, 0.96)),
    #ffffff !important;
  box-shadow: 0 18px 42px rgba(31, 80, 120, 0.1) !important;
}

.preview-stage::before {
  display: none !important;
}

.review-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px !important;
  border-bottom: 1px solid rgba(42, 91, 112, 0.12) !important;
  padding-bottom: 12px !important;
}

.review-stage-head h2 {
  color: #10202a !important;
  font-size: 20px !important;
}

.review-stage-head h2::after {
  content: "竖屏监看" !important;
  border-color: rgba(33, 183, 215, 0.26) !important;
  background: #e8fbff !important;
  color: #168aa2 !important;
}

.review-stage-meta {
  border-color: rgba(255, 185, 89, 0.34) !important;
  background: #fff5dc !important;
  color: #8a5a00 !important;
}

.preview-shell {
  grid-template-columns: 44px minmax(240px, 380px) 44px !important;
  gap: 18px !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: min(74vh, 720px) !important;
  margin-top: 18px !important;
  padding: 22px !important;
  border: 1px solid rgba(42, 91, 112, 0.12) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 50% 12%, rgba(33, 183, 215, 0.14), transparent 34%),
    linear-gradient(180deg, #f8fdff, #eef8ff) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

.round-nav {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid rgba(42, 91, 112, 0.14) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: #168aa2 !important;
  font-size: 20px !important;
  box-shadow: 0 8px 18px rgba(31, 80, 120, 0.1) !important;
}

.video-frame {
  justify-self: center !important;
  width: min(100%, 360px) !important;
  max-height: min(70vh, 640px) !important;
  aspect-ratio: 9 / 16 !important;
  border: 9px solid #172833 !important;
  border-radius: 34px !important;
  background: #0d161c !important;
  box-shadow: 0 28px 62px rgba(31, 80, 120, 0.22), inset 0 0 0 1px rgba(255,255,255,0.08) !important;
}

.video-frame::before {
  content: "" !important;
  position: absolute !important;
  z-index: 2 !important;
  inset: 10px auto auto 50% !important;
  width: 86px !important;
  height: 18px !important;
  transform: translateX(-50%) !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #172833 !important;
  pointer-events: none !important;
}

.video-frame video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #0d161c !important;
}

.video-frame .preview-empty {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 34px;
  background:
    radial-gradient(circle at 50% 32%, rgba(33, 183, 215, 0.16), transparent 30%),
    linear-gradient(180deg, #f9feff, #edf8ff) !important;
  color: #233b47 !important;
  font-size: 26px !important;
  font-weight: 900 !important;
}

.video-frame .preview-empty::before {
  content: "▶";
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding-left: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #27d0e7, #35e0bd);
  color: #062028;
  font-size: 22px;
  box-shadow: 0 12px 26px rgba(33, 183, 215, 0.22);
}

.video-frame .preview-empty::after {
  content: "等待可审看的分镜或完整视频" !important;
  color: #6a7d88 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.video-frame .preview-empty.hidden {
  display: none !important;
}

.preview-caption {
  width: min(760px, 100%) !important;
  margin: 16px auto 0 !important;
  padding: 14px 16px;
  border: 1px solid rgba(42, 91, 112, 0.12) !important;
  border-radius: 18px;
  background: #ffffff !important;
  color: #10202a !important;
  box-shadow: 0 10px 24px rgba(31, 80, 120, 0.08) !important;
}

.preview-caption h2 {
  color: #10202a !important;
  font-size: 18px !important;
}

.preview-caption p {
  color: #60707b !important;
  font-size: 13px !important;
}

.director-prompt-view {
  min-height: 320px !important;
  background: linear-gradient(135deg, #ffffff, #f1fbff) !important;
}

.reference-director-view {
  margin: 18px 0 16px;
  padding: 14px;
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(241, 251, 255, 0.94), rgba(255, 249, 252, 0.94)) !important;
  box-shadow: 0 16px 34px rgba(31, 80, 120, 0.08);
}

.reference-director-view label {
  margin: 0;
}

.reference-director-view .director-prompt-view {
  min-height: 240px !important;
}

.image-prompt-mode-control {
  min-width: min(100%, 220px);
}

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

.prompt-summary-card {
  min-width: 0;
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.prompt-summary-card.director {
  background: linear-gradient(135deg, rgba(241, 251, 255, 0.96), rgba(255, 249, 252, 0.96));
}

.prompt-summary-card strong,
.prompt-summary-card p,
.prompt-summary-card small {
  display: block;
}

.prompt-summary-card strong {
  color: #10202a;
  font-size: 11px;
  font-weight: 950;
}

.prompt-summary-card p {
  margin: 5px 0 0;
  color: #42515b;
  font-size: 12px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.prompt-summary-card small {
  margin-top: 6px;
  color: #60707b;
  font-size: 11px;
  line-height: 1.38;
}

.prompt-diff-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.prompt-diff-tags span {
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #60707b;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.prompt-diff-tags span.ok {
  border-color: rgba(31, 159, 134, 0.28);
  background: rgba(31, 159, 134, 0.09);
  color: #0b7f62;
}

.cinematic-editor .json-details {
  grid-column: 1 / -1;
}

.creative-parameter-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(3, minmax(156px, 0.95fr)) minmax(118px, 0.65fr) minmax(136px, 0.75fr);
  gap: 10px;
  align-items: end;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240, 250, 255, 0.94), rgba(255, 249, 252, 0.94)) !important;
  box-shadow: 0 12px 28px rgba(31, 80, 120, 0.08);
}

.creative-parameter-strip label {
  margin: 0;
  color: #42515b !important;
  font-size: 12px;
}

.creative-parameter-strip select,
.creative-parameter-strip input {
  min-height: 40px;
  background: #ffffff !important;
}

.creative-style-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin: -4px 0 16px;
  padding: 12px;
  border: 1px solid rgba(25, 137, 132, 0.24);
  border-radius: 8px;
  background: #f7fbfa;
}

.creative-style-strip label {
  margin: 0;
  color: #42515b !important;
  font-size: 12px;
}

.creative-style-strip select {
  min-height: 40px;
  background: #ffffff !important;
}

.creative-style-summary {
  grid-column: 1 / span 3;
  min-height: 44px;
  padding: 8px 10px;
  border-left: 3px solid #168b86;
  background: rgba(255, 255, 255, 0.74);
  color: #54656e;
}

.creative-style-summary strong,
.creative-style-summary span {
  display: block;
}

.creative-style-summary strong {
  color: #153a3c;
  font-size: 13px;
}

.creative-style-summary span {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.creative-style-save {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .creative-mode-card {
    grid-template-columns: 1fr;
  }

  .creative-parameter-strip {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .creative-style-strip {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .creative-style-summary {
    grid-column: 1;
  }

  .prompt-compare-grid {
    grid-template-columns: 1fr;
  }

  .script-review-head,
  .script-review-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .preview-shell {
    grid-template-columns: 34px minmax(190px, 1fr) 34px !important;
    gap: 8px !important;
    padding: 14px !important;
  }

  .round-nav {
    width: 34px !important;
    height: 34px !important;
  }

  .video-frame {
    width: min(100%, 300px) !important;
    border-width: 7px !important;
    border-radius: 28px !important;
  }
}

.cinematic-natural-layer,
.cinematic-reference-panel,
.cinematic-reference-chip {
  border-color: rgba(42, 91, 112, 0.14);
  background: linear-gradient(135deg, rgba(241, 251, 255, 0.94), rgba(255, 249, 252, 0.94)) !important;
  box-shadow: 0 16px 34px rgba(31, 80, 120, 0.08);
}

.cinematic-layer-head h3,
.cinematic-reference-head strong,
.cinematic-reference-chip .chip-label {
  color: #10202a !important;
}

.cinematic-layer-head span:last-child,
.cinematic-reference-head span,
.cinematic-reference-chip small {
  color: #60707b !important;
}

.cinematic-shot-tabs button {
  border-color: rgba(42, 91, 112, 0.16) !important;
  background: #ffffff !important;
  color: #233642 !important;
}

.cinematic-shot-tabs button.active,
.cinematic-shot-tabs button[aria-selected="true"] {
  border-color: rgba(42, 91, 112, 0.32) !important;
  background: linear-gradient(135deg, #1fc7df, #1f9f86) !important;
  color: #041114 !important;
}

.cinematic-shot-tabs button.active span,
.cinematic-shot-tabs button[aria-selected="true"] span {
  color: rgba(4, 17, 20, 0.7) !important;
}

.cinematic-reference-chip:hover {
  border-color: rgba(31, 199, 223, 0.52) !important;
  box-shadow: 0 12px 28px rgba(31, 80, 120, 0.16);
}

.cinematic-reference-chip .chip-token {
  color: #0b7f62 !important;
}

@media (max-width: 980px) {
  .cinematic-shot-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .cinematic-reference-chips {
    max-height: none;
  }
}

#thirdPartyProviderGuide,
.shot-video-results-column {
  display: none !important;
}

.shot-video-workbench {
  grid-template-columns: minmax(0, 1fr) !important;
}

.video-unit-chain-card {
  display: grid;
  gap: 12px;
  border-color: rgba(31, 199, 223, 0.22) !important;
  background:
    linear-gradient(135deg, rgba(240, 250, 255, 0.96), rgba(255, 249, 252, 0.96)),
    #fff !important;
}

.video-unit-chain-card .shot-video-card-head {
  margin-bottom: 0;
}

.video-unit-chain {
  display: grid;
  gap: 10px;
  position: relative;
}

.video-unit-step {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(42, 91, 112, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 12px;
}

.video-unit-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-unit-step-head span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1fc7df, #1f9f86);
  color: #041114;
  font-size: 12px;
  font-weight: 950;
}

.video-unit-step-head strong {
  color: #10202a;
  font-size: 14px;
  font-weight: 950;
}

.video-unit-step small {
  color: #60707b;
  font-size: 12px;
  line-height: 1.45;
}

.video-unit-prompt-view {
  min-height: 220px;
  resize: vertical;
  border-color: rgba(31, 199, 223, 0.22) !important;
  background: rgba(248, 253, 255, 0.96) !important;
  color: #10202a !important;
  font-size: 13px;
  line-height: 1.65;
}

.video-unit-generate-step video {
  max-height: 420px;
  object-fit: contain;
}

.video-unit-auxiliary {
  border: 1px dashed rgba(42, 91, 112, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.video-unit-auxiliary summary {
  cursor: pointer;
  color: #60707b;
  font-size: 12px;
  font-weight: 950;
}

.video-unit-auxiliary .compact-ref-grid {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.video-unit-chain .compact-ref {
  display: grid;
  gap: 6px;
}

.video-unit-chain .compact-ref strong {
  margin: 0;
}

.video-unit-chain .compact-ref img {
  max-height: 360px;
  object-fit: contain;
  background: rgba(235, 245, 249, 0.84);
}

.video-unit-chain .empty-state.compact {
  min-height: 112px;
  display: grid;
  place-items: center;
}

/* Story-first review layers keep narrative, character, and unit decisions visible together. */
.story-review-overview,
.character-design-overview,
.scene-unit-runway {
  margin: 4px 0 18px;
  border: 1px solid #cbdad8;
  border-radius: 8px;
  background: #f8fcfb;
  padding: 16px;
}

.story-review-head,
.character-design-head,
.scene-unit-runway-head,
.scene-script-group-head,
.scene-unit-card-group-head,
.character-design-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.story-review-head h3,
.character-design-head h3,
.scene-unit-runway-head h3,
.scene-script-group-head h3,
.scene-unit-card-group-head h4 {
  margin: 3px 0 0;
  color: #152a35;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

.story-review-stats,
.character-scene-tags,
.scene-script-context,
.scene-unit-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.story-review-stats span,
.character-design-head > span,
.character-design-title span,
.character-scene-tags span,
.scene-script-context span,
.scene-unit-card-group-head > div > span {
  border: 1px solid #b7d4d0;
  border-radius: 6px;
  background: #fff;
  color: #27615f;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.story-logline {
  margin: 14px 0 12px;
  color: #253d48;
  font-size: 14px;
  line-height: 1.65;
}

.story-revision-note {
  margin: 0 0 14px;
  border-left: 4px solid #a6761c;
  background: #fffaf0;
  padding: 10px 12px;
}

.story-revision-note > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.story-revision-note strong {
  color: #5f4317;
  font-size: 13px;
}

.story-revision-note span {
  border: 1px solid #dfca95;
  border-radius: 5px;
  background: #fff;
  color: #756036;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
}

.story-revision-note p,
.story-revision-note small {
  display: block;
  margin: 7px 0 0;
  color: #604d29;
  font-size: 12px;
  line-height: 1.5;
}

.story-revision-note small { color: #756c57; }

.story-emotion-arc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.story-emotion-arc span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #5d4a1d;
  font-size: 12px;
  font-weight: 800;
}

.story-emotion-arc b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f4dc93;
  color: #5d4a1d;
  font-size: 11px;
}

.story-scene-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
}

.story-scene-node,
.scene-unit-token {
  min-width: 0;
  border: 1px solid #c7d7dc;
  border-radius: 6px;
  background: #fff;
  color: #1c3742;
  padding: 10px;
  text-align: left;
}

.story-scene-node:hover,
.scene-unit-token:hover {
  border-color: #237b78;
  background: #f0fbf9;
}

.story-scene-node > span,
.story-scene-node strong,
.story-scene-node small,
.scene-unit-token strong,
.scene-unit-token span,
.scene-unit-token small {
  display: block;
}

.story-scene-node > span {
  color: #a76821;
  font-size: 11px;
  font-weight: 900;
}

.story-scene-node strong {
  margin: 3px 0;
  font-size: 13px;
  font-weight: 900;
}

.story-scene-node small,
.scene-unit-token small {
  color: #60707b;
  font-size: 11px;
  line-height: 1.4;
}

.story-review-empty {
  color: #60707b;
  font-size: 13px;
  line-height: 1.5;
}

.character-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.character-design-card {
  min-width: 0;
  border-top: 3px solid #d7a44b;
  background: #fff;
  padding: 12px;
}

.character-design-title strong {
  color: #162a34;
  font-size: 15px;
  font-weight: 900;
}

.character-design-card p {
  margin: 9px 0 7px;
  color: #304852;
  font-size: 13px;
  line-height: 1.55;
}

.character-design-card > small {
  display: block;
  color: #64747c;
  font-size: 12px;
  line-height: 1.5;
}

.character-scene-tags {
  margin-top: 10px;
}

.scene-script-group,
.scene-unit-card-group {
  margin-bottom: 14px;
  border-top: 2px solid #2c7b78;
  background: #f5faf9;
  padding: 14px;
}

.scene-script-group-head p,
.scene-unit-card-group-head p {
  margin: 3px 0 0;
  color: #35615f;
  font-size: 13px;
  font-weight: 850;
}

.scene-script-group-head small,
.scene-unit-card-group-head small {
  display: block;
  margin-top: 8px;
  color: #60707b;
  font-size: 12px;
  line-height: 1.45;
}

.scene-script-context {
  margin: 12px 0;
}

.scene-script-units,
.scene-unit-card-list {
  display: grid;
  gap: 10px;
}

.shot-unit-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.shot-unit-meta strong {
  color: #1d5e5b;
  font-size: 13px;
  font-weight: 900;
}

.shot-unit-meta span {
  color: #63747b;
  font-size: 12px;
}

.scene-unit-runway {
  background: #f5faff;
  border-color: #c5d8e4;
}

.scene-unit-runway-head > span {
  color: #60707b;
  font-size: 12px;
  font-weight: 800;
}

.scene-unit-runway-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.scene-unit-runway-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(0, 2.1fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid #d6e1e7;
  padding-top: 10px;
}

.scene-unit-runway-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.scene-unit-runway-scene strong,
.scene-unit-runway-scene span {
  display: block;
}

.scene-unit-runway-scene strong {
  color: #183849;
  font-size: 13px;
  font-weight: 900;
}

.scene-unit-runway-scene span {
  margin-top: 4px;
  color: #60707b;
  font-size: 12px;
}

.scene-unit-token {
  flex: 1 1 138px;
  padding: 8px;
}

.scene-unit-token strong {
  color: #1e5d76;
  font-size: 12px;
  font-weight: 900;
}

.scene-unit-token span {
  min-height: 33px;
  margin: 3px 0;
  color: #314b59;
  font-size: 11px;
  line-height: 1.35;
}

.scene-unit-token.done { border-color: #73a98f; background: #f4fbf6; }
.scene-unit-token.ready { border-color: #82b5cf; background: #f4faff; }
.scene-unit-token.pending { border-color: #d9bc7c; background: #fffdf7; }
.scene-unit-token.active { border: 2px solid #167a78; background: #e6f6f3; }

/* Current production flow: roles are identity references; all scene imagery belongs to one Unit. */
#storyboard[hidden],
#cinematic[hidden],
.legacy-reference-surface[hidden],
.shot-video-workbench[hidden] {
  display: none !important;
}

.character-image-workspace,
.unit-production-workspace {
  margin: 4px 0 18px;
}

.character-image-head,
.unit-production-head,
.unit-production-step > header,
.character-image-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.character-image-head h3,
.unit-production-head h3 {
  margin: 3px 0 0;
  color: #152a35;
  font-size: 18px;
  line-height: 1.35;
}

.character-generation-progress {
  width: min(100%, 360px);
  margin-top: 10px;
  border: 1px solid #b7d4d0;
  border-radius: 6px;
  background: #f7fcfb;
  padding: 9px 10px;
}

.character-generation-progress.is-processing {
  border-color: #89cbd0;
  background: #f1fcfd;
}

.character-generation-progress.has-errors {
  border-color: #dfb064;
  background: #fffaf0;
}

.character-generation-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #244d5b;
  font-size: 12px;
}

.character-generation-progress-head strong { font-weight: 850; }
.character-generation-progress-head b { color: #087c88; font-size: 15px; }
.character-generation-progress-head span {
  border: 1px solid #a9d6d4;
  border-radius: 999px;
  background: #fff;
  color: #27615f;
  padding: 2px 6px;
  font-weight: 800;
}

.character-generation-progress.has-errors .character-generation-progress-head span {
  border-color: #e3bd7b;
  color: #8a5b15;
}

.character-generation-progress progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 8px 0 5px;
  accent-color: #168e96;
}

.character-generation-progress small {
  display: block;
  color: #60707b;
  font-size: 11px;
  line-height: 1.35;
}

.character-generation-errors { margin-top: 7px; }
.character-generation-errors summary {
  cursor: pointer;
  color: #8a5b15;
  font-size: 11px;
  font-weight: 800;
}
.character-generation-errors ul {
  margin: 6px 0 0;
  padding-left: 17px;
  color: #704e21;
  font-size: 11px;
  line-height: 1.45;
}

.character-image-head-actions {
  display: flex;
  align-items: start;
  justify-content: end;
  flex-wrap: wrap;
  gap: 8px;
}

.character-global-edit {
  min-width: min(100%, 380px);
  border: 1px solid #b7d4d0;
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
}

.character-global-edit summary {
  cursor: pointer;
  color: #27615f;
  font-size: 13px;
  font-weight: 850;
}

.character-global-edit-content {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.character-global-edit textarea {
  width: 100%;
  min-height: 88px;
  box-sizing: border-box;
  resize: vertical;
}

.character-global-role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.character-global-role-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #35505d;
  font-size: 12px;
}

.character-global-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.character-global-edit-actions small {
  color: #60707b;
  font-size: 11px;
  line-height: 1.35;
}

.character-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.character-image-card,
.unit-production-card {
  min-width: 0;
  border: 1px solid #cbdad8;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 14px;
}

.character-image-card > header strong {
  color: #183849;
  font-size: 16px;
  font-weight: 900;
}

.character-image-card > header span,
.unit-production-head > small {
  border: 1px solid #b7d4d0;
  border-radius: 6px;
  background: #fff;
  color: #27615f;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
}

.unit-production-head-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.unit-production-head-side > small {
  border: 1px solid #b7d4d0;
  border-radius: 6px;
  background: #fff;
  color: #276864;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
}

.unit-duration-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #355360;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.unit-duration-control input {
  width: 54px;
  min-height: 30px;
  padding: 3px 5px;
  text-align: center;
}

.unit-duration-control em {
  color: #60707b;
  font-style: normal;
}

.character-image-pair,
.unit-role-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.character-reference-image {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.character-reference-image .compact-preview-button,
.unit-role-reference-grid .compact-preview-button {
  display: block;
  padding: 0;
  border: 1px solid #c7d7dc;
  border-radius: 7px;
  overflow: hidden;
  background: #f5f8f7;
}

.character-reference-image img,
.unit-role-reference-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f5f8f7;
}

.character-reference-image small {
  color: #60707b;
  font-size: 11px;
  line-height: 1.4;
}

.character-reference-actions {
  display: flex;
  align-items: start;
  flex-wrap: wrap;
  gap: 8px;
}

.character-image-edit {
  flex: 1 1 150px;
  min-width: 0;
  border: 1px solid #d3dfdd;
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}

.character-image-edit summary {
  cursor: pointer;
  color: #35615f;
  font-size: 12px;
  font-weight: 850;
}

.character-image-edit textarea {
  width: 100%;
  min-height: 86px;
  box-sizing: border-box;
  margin: 8px 0;
  resize: vertical;
}

.scene-unit-runway-row {
  display: block;
}

.scene-unit-runway-row summary {
  cursor: pointer;
  list-style: none;
}

.scene-unit-runway-row summary::-webkit-details-marker { display: none; }
.scene-unit-runway-row .scene-unit-tokens { margin-top: 10px; }

.unit-production-card {
  border-color: #b8d8e0;
  background: #f7fcfd;
}

.unit-production-head > div > span {
  color: #1e5d76;
  font-size: 12px;
  font-weight: 900;
}

.unit-production-summary {
  margin: 12px 0 14px;
  color: #304852;
  font-size: 14px;
  line-height: 1.55;
}

.unit-production-steps {
  display: grid;
  gap: 10px;
}

.unit-production-step {
  min-width: 0;
  border: 1px solid #d4e1e4;
  border-radius: 7px;
  background: #fff;
  padding: 12px;
}

.unit-production-step > header > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #167a78;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.unit-production-step > header > div { flex: 1; min-width: 0; }
.unit-production-step > header strong,
.unit-production-step > header small { display: block; }
.unit-production-step > header strong { color: #183849; font-size: 14px; font-weight: 900; }
.unit-production-step > header small { margin-top: 3px; color: #60707b; font-size: 12px; line-height: 1.4; }
.unit-production-step .compact-ref { margin-top: 10px; max-width: 520px; }
.unit-production-step .compact-ref img { aspect-ratio: 16 / 9; object-fit: contain; }
.unit-production-step .video-unit-prompt-view { margin-top: 10px; min-height: 180px; }
.unit-production-step .shot-video-meta { margin-top: 10px; }
.three-stage-keyframe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.three-stage-keyframe {
  min-width: 0;
  padding: 10px;
  border: 1px solid #d8e1e4;
  border-radius: 6px;
  background: #fbfdfd;
}
.three-stage-keyframe.is-selected {
  border-color: #62b7ad;
  box-shadow: inset 0 0 0 1px #b7e3dc;
}
.three-stage-keyframe-head,
.three-stage-keyframe-actions,
.keyframe-submit-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.keyframe-selection-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid #bfd2d9;
  border-radius: 5px;
  background: #fff;
  color: #41606b;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.keyframe-selection-toggle.is-selected {
  border-color: #2e9f90;
  background: #eaf8f4;
  color: #146c60;
  font-weight: 700;
}
.keyframe-selection-toggle input[type="checkbox"] {
  appearance: auto;
  opacity: 1;
  width: 14px;
  height: 14px;
  accent-color: #198f81;
}
.video-reference-binding {
  margin: 10px 0 8px;
  padding: 8px 10px;
  border-left: 3px solid #3aa899;
  background: #edf8f5;
  color: #2e5360;
  font-size: 12px;
}
.three-stage-keyframe .compact-ref {
  margin-top: 8px;
  max-width: none;
}
.three-stage-keyframe .compact-ref img { aspect-ratio: 16 / 9; }
.three-stage-keyframe-actions { margin-top: 8px; }
.three-stage-keyframe > small {
  display: block;
  margin-top: 7px;
  color: #60707b;
  font-size: 12px;
  line-height: 1.45;
}
.keyframe-submit-preview {
  justify-content: flex-start;
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 3px solid #5bb7aa;
  background: #f1faf8;
  color: #31535a;
  font-size: 12px;
}
@media (max-width: 900px) {
  .three-stage-keyframe-grid { grid-template-columns: 1fr; }
}

.story-frame-identity-review {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d5c9a6;
  background: #fffaf0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.story-frame-identity-review > div:first-child { min-width: 0; }
.story-frame-identity-review strong,
.story-frame-identity-review small { display: block; }
.story-frame-identity-review small { margin-top: 4px; color: #5f6f77; line-height: 1.5; }
.story-frame-identity-review p { margin: 7px 0 0; color: #8b2f2f; }
.story-frame-identity-review.is-accepted { border-color: #84c8b6; background: #f0fbf7; }
.story-frame-identity-review.is-rejected { border-color: #e2a2a2; background: #fff3f3; }
.story-frame-identity-review.is-legacy { border-color: #ccd5da; background: #f7f9fa; }
.story-frame-identity-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.story-frame-keyframe-blocker {
  margin-top: 10px;
  padding: 9px 11px;
  border-left: 3px solid #c28827;
  background: #fff8e8;
  color: #6f5324;
  font-size: 12px;
}
@media (max-width: 760px) {
  .story-frame-identity-review { align-items: stretch; flex-direction: column; }
  .story-frame-identity-actions { width: 100%; }
  .story-frame-identity-actions button { flex: 1; }
}

.story-frame-reference-assets {
  margin-top: 12px;
  border-top: 1px solid #d7e4e6;
  padding-top: 10px;
}

.story-frame-reference-assets > summary {
  cursor: pointer;
  color: #254f5a;
  font-size: 12px;
  font-weight: 850;
}

.story-frame-reference-assets > summary em {
  margin-left: 6px;
  color: #60707b;
  font-style: normal;
  font-weight: 700;
}

.story-frame-style-contract {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid #b9d8d5;
  border-radius: 6px;
  background: #f1faf8;
}

.story-frame-style-contract strong { color: #176663; font-size: 11px; }
.story-frame-style-contract span { color: #294d55; font-size: 11px; }
.story-frame-style-contract small { grid-column: 1 / -1; color: #61757b; font-size: 10px; line-height: 1.4; }

.story-frame-reference-groups {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.story-frame-reference-groups > section {
  min-width: 0;
  border-left: 3px solid #82b9b6;
  padding-left: 10px;
}

.story-frame-reference-groups > section.is-empty {
  border-left-color: #d6e0e2;
}

.story-frame-reference-groups > section > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.story-frame-reference-groups > section > header strong { color: #244d58; font-size: 12px; }
.story-frame-reference-groups > section > header small { color: #71808a; font-size: 11px; }
.story-frame-reference-groups > section > p { margin: 6px 0 0; color: #61717b; font-size: 11px; line-height: 1.45; }

.story-frame-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 7px;
}

.story-frame-reference-grid .compact-ref { margin-top: 0; max-width: none; }
.story-frame-reference-grid .compact-ref-head strong { font-size: 11px; }
.story-frame-reference-grid .compact-ref img { aspect-ratio: 16 / 9; object-fit: contain; }

.story-frame-reference-empty {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px dashed #bfd2d6;
  border-radius: 6px;
  color: #6b7c85;
  font-size: 11px;
  line-height: 1.45;
}

.unit-video-review-rejected {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e5a29a;
  border-left: 4px solid #b94f45;
  border-radius: 6px;
  background: #fff6f4;
  color: #71322d;
}

.unit-video-review-rejected strong { font-size: 13px; }
.unit-video-review-rejected span { font-size: 12px; line-height: 1.5; }

.scene-transition-step {
  border-color: #d9c58d;
  background: #fffdf7;
}

.scene-transition-step > header > span {
  background: #a6761c;
}

.scene-transition-step > header > em {
  flex: 0 0 auto;
  color: #756036;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.scene-transition-step p {
  margin: 8px 0 0 38px;
  color: #394e55;
  font-size: 13px;
  line-height: 1.5;
}

.scene-transition-step > small {
  display: block;
  margin: 8px 0 0 38px;
  color: #756c57;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .character-image-grid { grid-template-columns: 1fr; }
  .character-image-pair,
  .unit-role-reference-grid { grid-template-columns: 1fr; }
  .character-image-head,
  .unit-production-head { display: grid; grid-template-columns: 1fr; }
  .character-image-head-actions { justify-content: stretch; }
  .character-global-edit { width: 100%; }
}

.scene-unit-card-group-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(170px, 1fr) minmax(200px, 1.2fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

@media (max-width: 760px) {
  .story-review-overview,
  .character-design-overview,
  .scene-unit-runway,
  .scene-script-group,
  .scene-unit-card-group {
    padding: 12px;
  }

  .story-review-head,
  .character-design-head,
  .scene-unit-runway-head,
  .scene-script-group-head,
  .scene-unit-card-group-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .story-review-stats { margin-top: 8px; }
  .story-scene-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-unit-runway-row { grid-template-columns: 1fr; }
  .scene-unit-card-group-head { gap: 6px; }
  .character-design-grid { grid-template-columns: 1fr; }
}

/* Unit preproduction review and human-controlled generation inputs. */
.unit-preproduction-card {
  border-color: #c5d9dc;
  background: #fff;
  padding: 14px;
}

.unit-preproduction-head,
.unit-preproduction-actions,
.shot-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shot-row-heading {
  min-width: 0;
  justify-content: flex-start;
}

.shot-row-heading .shot-unit-meta {
  min-width: 0;
  margin: 0;
}

.unit-preproduction-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.unit-preproduction-field {
  min-width: 0;
}

.unit-preproduction-field > span,
.unit-preproduction-field > span strong,
.unit-preproduction-field > span small {
  display: block;
}

.unit-preproduction-field > span strong,
.unit-action-rhythm legend {
  color: #183f4b;
  font-size: 13px;
  font-weight: 900;
}

.unit-preproduction-field > span small {
  min-height: 32px;
  margin-top: 3px;
  color: #687a82;
  font-size: 11px;
  line-height: 1.4;
}

.unit-preproduction-field textarea {
  width: 100%;
  min-height: 132px;
  margin-top: 7px;
  box-sizing: border-box;
  resize: vertical;
}

.unit-action-rhythm {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 1px solid #d5e1e3;
  border-radius: 7px;
  padding: 11px;
  background: #f7fbfb;
}

.unit-action-rhythm legend {
  padding: 0 5px;
}

.unit-action-rhythm label,
.unit-action-rhythm label > span {
  display: block;
}

.unit-action-rhythm label > span {
  margin-bottom: 6px;
  color: #216d70;
  font-size: 12px;
  font-weight: 900;
}

.unit-action-rhythm textarea {
  width: 100%;
  min-height: 92px;
  box-sizing: border-box;
  resize: vertical;
}

.unit-preproduction-actions {
  justify-content: flex-end;
  margin-top: 12px;
  border-top: 1px solid #e0e8e9;
  padding-top: 11px;
}

.unit-save-state {
  margin-right: auto;
  color: #667980;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.unit-save-state.is-saved { color: #24745c; }
.unit-save-state.is-dirty { color: #976319; }
.unit-save-state.is-saving { color: #256b82; }
.unit-save-state.is-error { color: #a3443d; }

.manual-story-references {
  margin-top: 12px;
  border-top: 1px solid #d7e4e6;
  padding-top: 11px;
}

.manual-story-references > header,
.manual-story-reference-upload,
.manual-story-reference-item > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.manual-story-references > header {
  justify-content: space-between;
}

.manual-story-references > header > div,
.manual-story-references > header strong,
.manual-story-references > header small,
.manual-story-reference-item > div strong,
.manual-story-reference-item > div span {
  display: block;
}

.manual-story-references > header strong {
  color: #254f5a;
  font-size: 12px;
  font-weight: 900;
}

.manual-story-references > header small {
  margin-top: 3px;
  color: #6b7c84;
  font-size: 11px;
  line-height: 1.4;
}

.manual-story-references > header > span,
.unit-production-step > header > .unit-prompt-source {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  border: 1px solid #bfd6d4;
  border-radius: 6px;
  background: #f4faf9;
  color: #35706d;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 850;
}

.manual-story-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.manual-story-reference-item {
  position: relative;
  min-width: 0;
  border: 1px solid #d3e0e2;
  border-radius: 7px;
  overflow: hidden;
  background: #f8fbfb;
}

.manual-story-reference-item .image-preview-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #eef3f3;
}

.manual-story-reference-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.manual-story-reference-item > div {
  display: grid;
  gap: 2px;
  padding: 8px 34px 8px 9px;
}

.manual-story-reference-item > div strong {
  overflow: hidden;
  color: #294b56;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-story-reference-item > div span {
  color: #6a7b83;
  font-size: 10px;
}

.manual-reference-remove {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 6px;
  color: #8a4c47;
  font-size: 18px;
}

.manual-story-reference-upload {
  align-items: end;
  flex-wrap: wrap;
  margin-top: 10px;
}

.manual-story-reference-upload label {
  display: grid;
  gap: 4px;
  color: #405e68;
  font-size: 11px;
  font-weight: 850;
}

.manual-story-reference-upload select {
  min-width: 150px;
  min-height: 34px;
  padding: 5px 8px;
}

.manual-story-reference-upload small {
  flex: 1 1 240px;
  color: #6b7c84;
  font-size: 11px;
  line-height: 1.4;
}

.unit-production-step > header > .unit-prompt-source.is-human {
  border-color: #82b9a0;
  background: #eff9f3;
  color: #236b4e;
}

.unit-production-step > header > .unit-prompt-source.is-stale {
  border-color: #d6a19c;
  background: #fff3f1;
  color: #9b3f38;
}

.unit-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.unit-prompt-actions > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.unit-prompt-actions > button {
  margin-left: auto;
}

[data-motion-check-shot] { min-width: 0; }
[data-motion-check-shot] label { min-width: 0; }
[data-motion-check-shot] select,
[data-motion-check-shot] textarea { max-width: 100%; }
[data-motion-report] { overflow-wrap: anywhere; }
[data-motion-report] blockquote { margin: 6px 0 12px; color: #60707b; }

@media (max-width: 760px) {
  .unit-preproduction-head,
  .unit-preproduction-actions,
  .unit-prompt-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .unit-preproduction-fields,
  .unit-action-rhythm {
    grid-template-columns: 1fr;
  }

  .unit-action-rhythm { grid-column: auto; }
  .unit-save-state { margin-right: 0; }
  .unit-prompt-actions > div { justify-content: stretch; }
  .unit-prompt-actions button { flex: 1 1 auto; }
}

/* Post-production video merge workbench. */
.video-merge-workbench {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
  color: var(--ink);
}

.video-merge-header,
.merge-inspector-head,
.merge-final-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.video-merge-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.video-merge-header h3,
.merge-inspector-head h4 {
  margin: 3px 0 0;
  letter-spacing: 0;
}

.video-merge-header h3 { font-size: 22px; }
.merge-inspector-head h4 { font-size: 16px; }

.video-merge-header p,
.merge-inspector-head span,
.merge-final-bar span {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.section-kicker {
  color: #147c83;
  font-size: 11px;
  font-weight: 950;
}

.video-merge-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
}

.video-merge-metrics span {
  min-width: 96px;
  border-left: 2px solid #54bfc3;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.video-merge-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.merge-timeline {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 86px;
  overflow-x: auto;
  padding: 10px 2px 14px;
  scrollbar-width: thin;
}

.merge-unit {
  flex: 0 0 104px;
  min-height: 68px;
  border: 1px solid #d4dfe0;
  border-radius: 6px;
  background: #f7faf9;
  padding: 9px 10px;
}

.merge-unit span,
.merge-unit strong,
.merge-unit small {
  display: block;
}

.merge-unit span {
  color: #41767a;
  font-size: 10px;
  font-weight: 900;
}

.merge-unit strong {
  margin-top: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.merge-unit small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.merge-unit.is-missing {
  border-color: #d6a19c;
  background: #fff3f1;
}

.merge-boundary {
  flex: 0 0 62px;
  min-width: 62px;
  min-height: 50px;
  border: 1px solid #cad7d8;
  border-radius: 6px;
  background: #fff;
  color: #4c666b;
  padding: 6px;
}

.merge-boundary span,
.merge-boundary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merge-boundary span { font-size: 10px; font-weight: 950; }
.merge-boundary small { margin-top: 4px; font-size: 9px; }

.merge-boundary.is-cross-scene {
  border-color: #d9a84c;
  background: #fff9ec;
  color: #755414;
}

.merge-boundary.is-selected {
  outline: 2px solid #43b8bd;
  outline-offset: 2px;
}

.merge-boundary.is-accepted::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto 0;
  background: #16815f;
}

.merge-inspector {
  display: grid;
  gap: 15px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.merge-review-pill {
  flex: 0 0 auto;
  border: 1px solid #d4b26d;
  border-radius: 999px;
  background: #fff9e9;
  color: #7a5917 !important;
  padding: 6px 9px;
  font-size: 10px !important;
  font-weight: 950;
}

.merge-review-pill.is-accepted {
  border-color: #83bda5;
  background: #eef8f2;
  color: #176848 !important;
}

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

.merge-source-grid article {
  min-width: 0;
}

.merge-source-grid article > span,
.merge-source-grid article > small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.merge-source-grid video,
.merge-preview-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 7px 0;
  border: 1px solid #d6dfdf;
  border-radius: 6px;
  background: #101416;
  object-fit: contain;
}

.merge-preview-placeholder {
  display: grid;
  place-items: center;
  color: #9ba8aa;
  padding: 12px;
  text-align: center;
}

.merge-recommendation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-left: 3px solid #d7a544;
  background: #fffaf0;
  padding: 10px 12px;
}

.merge-recommendation strong { font-size: 12px; }
.merge-recommendation span { color: #6f6c64; font-size: 11px; line-height: 1.45; }

.merge-control-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
}

.merge-control-grid label {
  display: grid;
  gap: 5px;
  color: #526a70;
  font-size: 10px;
  font-weight: 850;
}

.merge-control-grid input,
.merge-control-grid select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
}

.merge-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.bridge-policy,
.bridge-preflight,
.bridge-task-state {
  display: grid;
  gap: 4px;
  border-left: 3px solid #d7a544;
  background: #fffaf0;
  padding: 11px 13px;
}

.bridge-policy strong,
.bridge-preflight strong,
.bridge-task-state strong { font-size: 12px; }

.bridge-policy span,
.bridge-preflight span,
.bridge-task-state span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.bridge-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
}

.bridge-reference-card {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid #d7dfdf;
  border-radius: 6px;
  background: #fff;
  padding: 7px;
}

.bridge-reference-card.is-missing { border-color: #d7a19b; background: #fff5f3; }

.bridge-reference-image {
  display: grid;
  width: 70px;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f1;
  color: var(--muted);
  font-size: 9px;
}

.bridge-reference-image img { width: 100%; height: 100%; object-fit: cover; }
.bridge-reference-card strong,
.bridge-reference-card small { display: block; }
.bridge-reference-card strong { padding-right: 50px; font-size: 10px; line-height: 1.35; }
.bridge-reference-card small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.bridge-ref-status {
  position: absolute;
  top: 7px;
  right: 7px;
  color: #9a641c;
  font-size: 8px;
  font-weight: 900;
}
.bridge-ref-status.is-ready { color: #167454; }
.bridge-preflight.is-ready { border-color: #48a986; background: #f0f8f4; }
.bridge-preflight.is-blocked { border-color: #c86f62; background: #fff4f1; }

.bridge-prompt-field {
  display: grid;
  gap: 6px;
  color: #526a70;
  font-size: 11px;
  font-weight: 850;
}
.bridge-prompt-field textarea {
  width: 100%;
  min-height: 230px;
  resize: vertical;
  border-color: #cad8d9;
  line-height: 1.65;
}

.bridge-control-grid {
  display: grid;
  grid-template-columns: 1.2fr .7fr .7fr 2fr;
  gap: 10px;
}
.bridge-control-grid label,
.bridge-audio-lock {
  display: grid;
  gap: 5px;
  color: #526a70;
  font-size: 10px;
  font-weight: 850;
}
.bridge-control-grid input,
.bridge-control-grid select { width: 100%; min-height: 38px; }
.bridge-audio-lock { border-left: 2px solid #4bb4b8; padding: 5px 9px; }
.bridge-audio-lock span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.bridge-task-state.processing { border-color: #4a91ba; background: #f0f7fb; }
.bridge-task-state.failed { border-color: #c86f62; background: #fff4f1; }

.bridge-video-preview { display: grid; gap: 6px; }
.bridge-video-preview video { width: min(100%, 920px); aspect-ratio: 16 / 9; background: #080b0d; }
.bridge-video-preview span { color: var(--muted); font-size: 10px; }

.bridge-paid-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #665b43;
  font-size: 11px;
  font-weight: 800;
}
.bridge-paid-confirm input { width: 18px; height: 18px; }

.merge-final-bar {
  align-items: center;
  background: #f5f8f7;
  padding: 13px 14px;
}

.merge-final-bar > div:first-child {
  flex: 1 1 auto;
}

.merge-final-bar strong,
.merge-final-bar span { display: block; }

.merge-final-preview {
  display: grid;
  gap: 8px;
}

.merge-final-preview video {
  width: min(100%, 980px);
  aspect-ratio: 16 / 9;
  background: #080b0d;
}

.merge-final-preview span { color: var(--muted); font-size: 11px; }

.video-merge-empty {
  display: grid;
  gap: 6px;
  min-height: 120px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.video-merge-empty strong { color: var(--ink); }
.video-merge-empty.is-error strong { color: var(--danger); }

.post-later-settings {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.post-later-settings > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.post-later-settings > summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.post-later-settings[open] > summary { margin-bottom: 16px; }

/* Scheme A production refresh: workflow navigation and selected review surfaces. */
:root {
  --scheme-a-ink: #152026;
  --scheme-a-muted: #718087;
  --scheme-a-line: #d8e3df;
  --scheme-a-mint: #1f8268;
  --scheme-a-mint-soft: #e8f5ef;
  --scheme-a-surface: #ffffff;
}

body {
  background: #f4f7f6 !important;
  color: var(--scheme-a-ink) !important;
}

.shell {
  width: min(100vw - 32px, 1880px) !important;
}

.topbar {
  grid-template-columns: minmax(210px, .58fr) minmax(560px, 1.85fr) minmax(140px, .42fr) !important;
  min-height: 106px !important;
  padding: 13px 22px !important;
  border: 1px solid var(--scheme-a-line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 12px 34px rgba(30, 70, 56, .07) !important;
}

.brand-mark .bars {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: end !important;
  gap: 4px !important;
  padding: 9px !important;
  width: 48px !important;
  height: 48px !important;
  flex-basis: 48px !important;
  border-color: #b8ddd0 !important;
  border-radius: 7px !important;
  background: #edf5f0 !important;
  box-shadow: none !important;
}

.brand-mark .bars::before { display: none !important; }
.brand-mark .bars::after {
  content: "" !important;
  position: absolute !important;
  left: 11px !important;
  bottom: 10px !important;
  width: 7px !important;
  height: 16px !important;
  background: #f0b35d !important;
  box-shadow: 10px -10px 0 #47bd9b, 20px 4px 0 #688be5 !important;
}
.brand-mark .bars span { display: block !important; width: 100% !important; box-shadow: none !important; }
.brand-mark .bars span:nth-child(1) { height: 56% !important; background: #f0b35d !important; }
.brand-mark .bars span:nth-child(2) { height: 82% !important; background: #47bd9b !important; }
.brand-mark .bars span:nth-child(3) { height: 44% !important; background: #688be5 !important; }
.brand-mark strong { color: var(--scheme-a-ink) !important; font-size: 21px !important; }
.brand-mark > div:last-child > span { color: var(--scheme-a-muted) !important; font-size: 10px !important; }

.topbar-navigation {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.nav-tabs,
.nav-tabs-primary,
.nav-tabs-utility {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px 21px !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: visible !important;
}

.nav-tabs::before { display: none !important; }

.nav-tabs button,
.nav-tabs a {
  min-width: 78px !important;
  min-height: 35px !important;
  border: 1px solid #d9e3df !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #4c5d64 !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.nav-tabs button::after,
.nav-tabs a::after {
  right: -16px !important;
  color: #65bed1 !important;
  font-size: 14px !important;
}

.nav-tabs-primary button:last-child::after,
.nav-tabs-utility button:last-child::after { display: none !important; }
.nav-tabs-utility { gap: 12px !important; }
.nav-tabs-utility button::after { display: none !important; }

.nav-tabs button:hover,
.nav-tabs a:hover,
.nav-tabs button.active,
.nav-tabs button[aria-current="page"] {
  border-color: #91d7c1 !important;
  background: #e8f7f0 !important;
  color: #176f57 !important;
  box-shadow: inset 0 -3px 0 #76cfb0 !important;
}

.topbar-actions { justify-content: flex-end !important; }
.icon-button,
.status-pill {
  border-color: #d6e5df !important;
  background: #fff !important;
  color: #39545e !important;
  box-shadow: none !important;
}
.status-pill { background: #eef8f2 !important; color: #177251 !important; }

.config-board,
.panel,
.control-panel,
.preview-stage {
  border-color: var(--scheme-a-line) !important;
  background: var(--scheme-a-surface) !important;
  box-shadow: 0 10px 28px rgba(26, 62, 50, .055) !important;
}

.config-board { padding: 22px !important; }
.config-board-summary { background: transparent !important; color: var(--scheme-a-ink) !important; }
.config-board-summary > span { color: var(--scheme-a-ink) !important; font-size: 18px !important; }
.config-board-summary > small { color: var(--scheme-a-muted) !important; }
.config-board-status { background: #edf8f2 !important; border-color: #b8e0cb !important; color: #187555 !important; }
.config-board-head { margin-top: 20px; }
.config-board-head h2 { color: var(--scheme-a-ink) !important; font-size: 29px !important; }
.config-board .eyebrow { color: var(--scheme-a-mint) !important; }
.pipeline-strip,
.config-issues,
.global-model-workbench,
.global-storage-workbench { display: none !important; }

.config-matrix {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.config-panel {
  min-height: 205px !important;
  padding: 18px !important;
  border-color: var(--scheme-a-line) !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
}
.config-panel:nth-child(5) { background: #f1f8f4 !important; }
.config-panel-head { margin-bottom: 27px !important; }
.config-panel h3 { color: var(--scheme-a-ink) !important; font-size: 17px !important; }
.config-badge { border-color: #b7dec9 !important; border-radius: 5px !important; background: #effaf3 !important; color: #197755 !important; }
.config-rows { display: grid !important; gap: 12px !important; }
.config-row { display: grid !important; gap: 7px !important; border: 0 !important; padding: 0 !important; }
.config-row > span { color: #708087 !important; font-size: 12px !important; font-weight: 800 !important; }
.config-row > strong { color: #267c64 !important; font-size: 14px !important; }
.config-inline-select { display: block !important; }
.config-inline-select select {
  width: 100% !important;
  min-height: 42px !important;
  border-color: #bfd1ca !important;
  border-radius: 5px !important;
  background: #f8fbf9 !important;
  color: #17252a !important;
  font-weight: 750 !important;
}
.config-panel > p { color: #78868b !important; font-size: 12px !important; line-height: 1.58 !important; }

.script-panel { max-width: none !important; padding: 0 !important; overflow: hidden; }
.script-panel > .panel-head { padding: 21px 24px 17px !important; border-bottom: 1px solid #e0e9e5 !important; background: #fff !important; }
.script-panel > .panel-head h2 { color: var(--scheme-a-ink) !important; }
.script-panel > #storyReviewOverview,
.script-panel > label { display: none !important; }
.script-panel > #complianceNotes { margin: 0 !important; padding: 0 !important; }
.script-panel .script-review-card {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}
.script-panel .script-review-head {
  align-items: center !important;
  padding: 20px 24px !important;
  border-bottom: 1px solid #e1e9e5 !important;
  background: #f7fbf9 !important;
}
.script-panel .script-review-head strong { color: #183128 !important; font-size: 17px !important; }
.script-panel .script-review-head span { color: #668078 !important; }
.script-panel .script-review-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.script-panel .script-review-grid > div { min-height: 142px !important; padding: 22px !important; border-color: #e1e9e5 !important; background: #fff !important; }
.script-panel .script-review-grid b { color: #1b2e34 !important; }
.script-panel .script-review-grid p { color: #25836a !important; font-weight: 800 !important; }
.script-panel .script-review-grid small,
.script-panel .script-review-issues { color: #748289 !important; }
.script-panel .script-review-issues { margin: 0 !important; border-top: 1px solid #e1e9e5 !important; background: #f3faf6 !important; }

.shot-video-panel { padding: 24px !important; }
.shot-video-panel > .panel-head { margin-bottom: 12px !important; }
.shot-video-panel > .panel-head h2 { color: var(--scheme-a-ink) !important; font-size: 29px !important; }
.video-view-tabs {
  display: flex;
  gap: 22px;
  margin: 0 0 22px;
  border-bottom: 1px solid #dce7e2;
}
.video-view-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #748188;
  font-size: 14px;
  font-weight: 800;
  padding: 0 2px;
}
.video-view-tabs button[aria-selected="true"] { border-bottom-color: var(--scheme-a-mint); color: #187157; }
.video-global-overview { min-width: 0; }
.video-global-empty { display: grid; min-height: 180px; place-content: center; gap: 8px; color: var(--scheme-a-muted); text-align: center; }
.video-global-empty strong { color: var(--scheme-a-ink); }
.global-unit-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.global-unit-head .eyebrow { margin-bottom: 7px; color: var(--scheme-a-mint) !important; }
.global-unit-head h3 { margin: 0 0 5px; color: var(--scheme-a-ink); font-size: 19px; }
.global-unit-head p { margin: 0; color: var(--scheme-a-muted); font-size: 13px; }
.unit-legend { display: flex; gap: 15px; }
.unit-legend span { display: inline-flex; align-items: center; gap: 5px; color: #738187; font-size: 11px; font-weight: 750; }
.unit-legend i { width: 8px; height: 8px; border-radius: 50%; }
.state-ready { background: #279d77; }.state-pending { background: #c7cecc; }
.global-unit-stats { display: flex; align-items: center; gap: 0; margin-bottom: 16px; padding: 12px 16px; border: 1px solid #d2e4db; border-radius: 7px; background: #edf5f1; }
.global-unit-stats > div { display: flex; flex: 0 0 auto; flex-direction: column; min-width: 88px; padding-right: 20px; border-right: 1px solid #cfe0d7; }
.global-unit-stats > div + div { padding-left: 20px; }
.global-unit-stats b { color: #1e735d; font-size: 21px; line-height: 1.1; }
.global-unit-stats span { margin-top: 4px; color: #74838a; font-size: 11px; }
.global-unit-stats p { margin: 0 0 0 22px; color: #4e6e64; font-size: 12px; line-height: 1.5; }
.global-unit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.global-unit-card { overflow: hidden; padding: 0 0 10px; border: 1px solid #d8e2de; border-radius: 6px; background: #fff; color: #1b282e; text-align: left; }
.global-unit-card:hover { border-color: #80c8ad; box-shadow: 0 8px 18px rgba(40, 100, 80, .1); }
.global-unit-card img,
.pending-art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.global-unit-card img { filter: saturate(.86) brightness(.9); }
.pending-art { display: grid; place-items: center; background: #e8edeb; color: #a0aaa7; font-size: 25px; }
.global-unit-id { display: block; margin: 10px 10px 5px; color: #247a63; font-size: 11px; font-weight: 850; }
.global-unit-card strong { display: block; min-height: 36px; padding: 0 10px; color: #1b282e; font-size: 13px; line-height: 1.35; }
.global-unit-card em { display: block; margin: 7px 10px 0; color: #2c876c; font-size: 11px; font-style: normal; font-weight: 700; }
.global-unit-card.is-pending { border-color: #d6ddda; background: #f1f4f3; color: #879491; }
.global-unit-card.is-pending .global-unit-id,
.global-unit-card.is-pending em { color: #879491; }
.video-production-view[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto !important; }
  .nav-tabs { gap: 4px 15px !important; }
  .nav-tabs button { min-width: 70px !important; }
  .config-matrix { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .shell { width: min(100vw - 16px, 760px) !important; }
  .topbar { display: grid !important; grid-template-columns: 1fr auto !important; min-height: auto !important; padding: 14px !important; }
  .topbar-navigation { grid-column: 1 / -1; width: 100%; }
  .nav-tabs-primary { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px !important; }
  .nav-tabs-primary button { min-width: 0 !important; font-size: 12px !important; }
  .nav-tabs-primary button::after { display: none !important; }
  .nav-tabs-utility { justify-content: center !important; }
  .topbar-actions .status-pill { display: none !important; }
  .config-board { padding: 16px !important; }
  .config-board-summary { grid-template-columns: 1fr auto !important; grid-template-areas: "title status" "hint hint" !important; }
  .config-board-summary .config-board-status { margin-right: 0 !important; }
  .config-matrix { grid-template-columns: 1fr !important; }
  .config-panel { min-height: auto !important; }
  .script-panel .script-review-grid { grid-template-columns: 1fr !important; }
  .script-panel .script-review-grid > div { min-height: auto !important; border-right: 0 !important; border-bottom: 1px solid #e1e9e5 !important; }
  .global-unit-head { align-items: flex-start; flex-direction: column; }
  .global-unit-stats { align-items: flex-start; flex-wrap: wrap; }
  .global-unit-stats > div { min-width: 0; padding-right: 14px; }
  .global-unit-stats > div + div { padding-left: 14px; }
  .global-unit-stats p { width: 100%; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #cfe0d7; }
  .global-unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
}

@media (max-width: 1100px) {
  .video-merge-header { display: grid; }
  .merge-control-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bridge-control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .video-merge-metrics,
  .merge-source-grid,
  .merge-control-grid,
  .bridge-control-grid { grid-template-columns: 1fr; }
  .merge-inspector-head,
  .merge-final-bar,
  .merge-actions,
  .post-later-settings > summary { align-items: stretch; display: grid; }
  .merge-recommendation { grid-template-columns: 1fr; }
  .merge-actions button,
  .merge-final-bar button,
  .merge-final-bar .button { width: 100%; }
}

/* Production navigation v2: a single, quiet menu line with a living studio mark. */
@keyframes cineagent-mark-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57, 174, 136, 0), 0 8px 18px rgba(40, 100, 80, .08); }
  50% { box-shadow: 0 0 0 5px rgba(57, 174, 136, .11), 0 10px 22px rgba(40, 100, 80, .14); }
}

@keyframes cineagent-bars-rise {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.topbar {
  grid-template-columns: minmax(290px, .66fr) minmax(0, 1.9fr) !important;
  min-height: 118px !important;
  padding: 17px 24px !important;
}

.topbar-actions { display: none !important; }

.brand-mark .bars {
  overflow: visible !important;
  animation: cineagent-mark-breathe 3.2s ease-in-out infinite !important;
}

.brand-mark .bars::after {
  animation: cineagent-bars-rise 2.4s ease-in-out infinite !important;
}

.topbar-navigation { display: flex !important; align-items: center; min-width: 0; }

.nav-tabs,
.nav-tabs-primary {
  width: 100%;
  justify-content: flex-start !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
}

.nav-tabs button,
.nav-tabs a {
  min-width: 0 !important;
  min-height: 56px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #65747b !important;
  box-shadow: none !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  padding: 0 16px !important;
  white-space: nowrap;
}

.nav-tabs button::after,
.nav-tabs a::after { display: none !important; }

.nav-tabs button:hover,
.nav-tabs a:hover,
.nav-tabs button.active,
.nav-tabs button[aria-current="page"] {
  border: 0 !important;
  background: #e1f2eb !important;
  color: #167156 !important;
  box-shadow: none !important;
}

/* The script remains a reading surface: story and dialogue stay available, while release metadata stays out of the production flow. */
.script-panel > .script-detail-field {
  display: grid !important;
  gap: 8px;
  margin: 0 !important;
  padding: 20px 24px !important;
  border-bottom: 1px solid #e1e9e5;
  color: #52636a;
  font-size: 13px;
  font-weight: 800;
}

.script-panel > .script-detail-field textarea {
  min-height: 150px;
  resize: vertical;
  border: 1px solid #d8e4df !important;
  border-radius: 6px !important;
  background: #fbfdfc !important;
  color: #1c2a2f !important;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.7;
  padding: 14px !important;
}

.script-panel > .script-detail-field #sourceStory { min-height: 180px; }

/* Video is a continuous production surface: global state first, selected Unit controls second. */
.preview-stage[data-workbench-subpanel="video"],
.preview-stage[data-workbench-subpanel="video"].workbench-subpanel-active { display: none !important; }

.shot-video-panel > .panel-head { margin-bottom: 18px !important; }
.shot-video-panel > .panel-head {
  align-items: flex-start !important;
  flex-direction: column !important;
  gap: 7px;
}
.shot-video-panel > .panel-head h2 {
  inline-size: max-content;
  max-width: 100%;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.shot-video-panel > .panel-head > span { max-width: 100%; }
.video-global-overview { padding-bottom: 28px; border-bottom: 1px solid #dbe7e1; }
.video-production-view {
  display: block !important;
  margin-top: 0;
  padding-top: 26px;
}

.video-production-intro { margin-bottom: 18px; }
.video-production-intro .eyebrow { color: var(--scheme-a-mint) !important; }
.video-production-intro h3 { margin: 4px 0 6px; color: var(--scheme-a-ink); font-size: 20px; }
.video-production-intro p { margin: 0; color: var(--scheme-a-muted); font-size: 13px; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(230px, .62fr) minmax(0, 1.8fr) !important; }
  .nav-tabs button,
  .nav-tabs a { font-size: 15px !important; padding: 0 11px !important; }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr !important; padding: 14px !important; }
  .brand-mark { display: flex !important; }
  .topbar-navigation { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .nav-tabs-primary { display: flex !important; width: max-content; grid-template-columns: none !important; }
  .nav-tabs button,
  .nav-tabs a { min-height: 44px !important; font-size: 14px !important; padding: 0 11px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark .bars,
  .brand-mark .bars::after { animation: none !important; }
}

/* Production navigation v3: full-width utility workspaces and a refined equalizer mark. */
body[data-active-stage="post"] .render-grid,
body[data-active-stage="assets"] .render-grid,
body[data-active-stage="history"] .render-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

body[data-active-stage="post"] .output-panel,
body[data-active-stage="assets"] .asset-panel,
body[data-active-stage="history"] .history-panel {
  grid-column: 1 / -1;
  width: 100%;
}

@keyframes cineagent-equalizer-one {
  0%, 100% { transform: scaleY(.62); opacity: .78; }
  28% { transform: scaleY(1); opacity: 1; }
  62% { transform: scaleY(.78); opacity: .9; }
}

@keyframes cineagent-equalizer-two {
  0%, 100% { transform: scaleY(.72); opacity: .84; }
  42% { transform: scaleY(.5); opacity: .7; }
  70% { transform: scaleY(1); opacity: 1; }
}

@keyframes cineagent-equalizer-three {
  0%, 100% { transform: scaleY(.5); opacity: .7; }
  35% { transform: scaleY(.9); opacity: .94; }
  64% { transform: scaleY(.66); opacity: .8; }
}

.brand-mark .bars {
  overflow: hidden !important;
  animation: none !important;
  background: #f2f8f5 !important;
  box-shadow: inset 0 0 0 1px rgba(33, 126, 95, .06) !important;
}

.brand-mark .bars::after { display: none !important; }

.brand-mark .bars span {
  align-self: end;
  height: 24px !important;
  border-radius: 1px !important;
  transform-origin: bottom;
  will-change: transform;
}

.brand-mark .bars span:nth-child(1) { height: 18px !important; animation: cineagent-equalizer-one 1.8s ease-in-out infinite !important; }
.brand-mark .bars span:nth-child(2) { height: 30px !important; animation: cineagent-equalizer-two 2.2s ease-in-out infinite !important; }
.brand-mark .bars span:nth-child(3) { height: 15px !important; animation: cineagent-equalizer-three 1.55s ease-in-out infinite !important; }

.topbar {
  grid-template-columns: minmax(300px, .72fr) minmax(0, 1.78fr) !important;
  min-height: 126px !important;
  padding: 18px 28px !important;
  border-color: #dfe9e4 !important;
  box-shadow: 0 8px 26px rgba(22, 56, 44, .045) !important;
}

.brand-mark { gap: 15px !important; }
.brand-mark strong {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 24px !important;
  font-weight: 780 !important;
  line-height: 1 !important;
}
.brand-mark > div:last-child > span {
  margin-top: 6px !important;
  font-size: 10px !important;
  font-weight: 760 !important;
}

.nav-tabs,
.nav-tabs-primary {
  justify-content: space-between !important;
  gap: 3px !important;
}

.nav-tabs button,
.nav-tabs a {
  min-height: 62px !important;
  border-radius: 6px !important;
  color: #5d6b70 !important;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 0 15px !important;
  transition: color .18s ease, background-color .18s ease !important;
}

.nav-tabs button:hover,
.nav-tabs a:hover {
  background: #f2f8f5 !important;
  color: #286d58 !important;
}

.nav-tabs button.active,
.nav-tabs button[aria-current="page"] {
  position: relative;
  background: #e3f2eb !important;
  color: #176d55 !important;
}

.nav-tabs button.active::before,
.nav-tabs button[aria-current="page"]::before {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 9px;
  left: 15px;
  height: 2px;
  border-radius: 2px;
  background: #2f9a78;
}

@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(245px, .65fr) minmax(0, 1.75fr) !important; }
  .nav-tabs button,
  .nav-tabs a { font-size: 14px !important; padding: 0 10px !important; }
}

@media (max-width: 760px) {
  .topbar { min-height: auto !important; padding: 14px !important; }
  .nav-tabs,
  .nav-tabs-primary { justify-content: flex-start !important; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark .bars span { animation: none !important; }
}

/* Production integration: confirmed water-ripple main menu and creative guide. */
@keyframes production-water-glint {
  0%, 38% { transform: translateX(-38%); opacity: .28; }
  68% { transform: translateX(38%); opacity: .46; }
  100% { transform: translateX(38%); opacity: .18; }
}

@keyframes production-water-current {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: .64; }
  50% { transform: translate3d(1.2%, -3%, 0); opacity: .88; }
}

@keyframes production-ripple-spread {
  0% {
    opacity: .9;
    transform: translate(-50%, -50%) scale(.16);
  }
  72% { opacity: .38; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(12);
  }
}

@keyframes creative-phone-sweep {
  0%, 46% { transform: translateX(-56%) rotate(-5deg); }
  78%, 100% { transform: translateX(56%) rotate(-5deg); }
}

@keyframes creative-phone-mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes creative-guide-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes creative-guide-fill-pulse {
  0% {
    border-color: rgba(25, 154, 120, .66);
    box-shadow: 0 0 0 5px rgba(25, 154, 120, .13);
  }
  100% {
    border-color: rgba(110, 231, 255, .2);
    box-shadow: none;
  }
}

.topbar-navigation {
  overflow: hidden;
}

.water-nav-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(82, 225, 212, .2);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 52% -18%, rgba(99, 230, 255, .16), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(99, 230, 255, .075)),
    rgba(9, 24, 30, .54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 14px 34px rgba(0, 0, 0, .13);
}

.water-nav-shell::before,
.water-nav-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.water-nav-shell::before {
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .12) 46%, transparent 74%),
    radial-gradient(ellipse at 50% 118%, rgba(85, 241, 194, .14), transparent 64%);
  background-repeat: no-repeat;
  background-size: 360px 100%, 100% 100%;
  animation: production-water-glint 7.6s ease-in-out infinite;
}

.water-nav-shell::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 44%, rgba(99, 230, 255, .08)),
    radial-gradient(ellipse at 18% 50%, rgba(85, 241, 194, .12), transparent 54%),
    radial-gradient(ellipse at 84% 48%, rgba(99, 230, 255, .09), transparent 58%);
  animation: production-water-current 10s ease-in-out infinite;
}

.water-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.water-ripple {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  width: var(--size, 24px);
  height: var(--size, 24px);
  border: 1px solid rgba(100, 236, 255, .42);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .72) 0 7%, transparent 8%),
    radial-gradient(circle, rgba(99, 230, 255, .22) 0 18%, transparent 46%);
  box-shadow:
    0 0 0 5px rgba(99, 230, 255, .12),
    0 0 0 16px rgba(85, 241, 194, .06);
  transform: translate(-50%, -50%) scale(.18);
  animation: production-ripple-spread var(--duration, 860ms) ease-out forwards;
}

.water-ripple.strong {
  --size: 34px;
  --duration: 1060ms;
  border-color: rgba(99, 230, 255, .58);
  box-shadow:
    0 0 0 7px rgba(99, 230, 255, .16),
    0 0 0 24px rgba(85, 241, 194, .08),
    0 14px 34px rgba(0, 0, 0, .14);
}

.nav-tabs.water-nav,
.nav-tabs-primary.water-nav {
  position: relative;
  z-index: 2;
  padding: 5px !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
}

.nav-tabs.water-nav button,
.nav-tabs-primary.water-nav button {
  min-height: 52px !important;
  border-radius: 14px !important;
  background: transparent !important;
  color: #b8c9ce !important;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

.nav-tabs.water-nav button:hover {
  background: rgba(255, 255, 255, .1) !important;
  color: #f4feff !important;
  transform: translateY(-1px);
}

.nav-tabs.water-nav button.active,
.nav-tabs.water-nav button[aria-current="page"] {
  background:
    radial-gradient(circle at 35% 26%, rgba(255, 255, 255, .26), transparent 34%),
    linear-gradient(135deg, rgba(99, 230, 255, .27), rgba(85, 241, 194, .31)) !important;
  color: #f5ffff !important;
  box-shadow:
    inset 0 0 0 1px rgba(99, 230, 255, .22),
    0 8px 20px rgba(0, 0, 0, .12) !important;
}

.nav-tabs.water-nav button.active::before,
.nav-tabs.water-nav button[aria-current="page"]::before {
  right: 18px !important;
  bottom: 8px !important;
  left: 18px !important;
  height: 3px !important;
  background: linear-gradient(90deg, var(--tech-cyan), var(--tech-mint)) !important;
}

.creative-production-layout {
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.creative-guide-panel,
.creative-fields-panel {
  min-width: 0;
}

.creative-guide-panel {
  display: grid;
  place-items: center;
  border: 1px solid rgba(110, 231, 255, .17);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(99, 230, 255, .12), transparent 35%),
    rgba(8, 20, 26, .58);
  padding: 16px;
}

.creative-phone {
  position: relative;
  width: min(100%, 386px);
  height: 760px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 7px solid #10162a;
  border-radius: 38px;
  background: #f6f7fa;
  box-shadow: 0 28px 62px rgba(0, 0, 0, .24), inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.creative-phone::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  z-index: 3;
  width: 82px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  transform: translateX(-50%);
}

.creative-phone-header {
  position: relative;
  min-height: 128px;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 24px 18px 17px;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(99, 230, 255, .16), transparent 40%),
    linear-gradient(180deg, #15192e, #0f1427);
}

.creative-phone-header::after {
  content: "";
  position: absolute;
  inset: auto -25% -38px;
  height: 74px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent);
  transform: rotate(-5deg);
  animation: creative-phone-sweep 5.5s ease-in-out infinite;
}

.creative-phone-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 8px;
  color: #dde7ff;
  background: rgba(255, 255, 255, .1);
  font-size: 17px;
  font-weight: 900;
  animation: creative-phone-mark-float 3.8s ease-in-out infinite;
}

.creative-phone-header strong {
  color: #fff;
  font-size: 24px;
  line-height: 1.18;
}

.creative-phone-header small {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.45;
}

.creative-guide-progress {
  height: 5px;
  background: #e7e8ee;
}

.creative-guide-progress span {
  display: block;
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, #1677ff, #6557f2);
  box-shadow: 0 0 18px rgba(22, 119, 255, .42);
  transition: width .26s ease;
}

.creative-guide-log {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 8px;
}

.creative-guide-message {
  max-width: 100%;
  margin-bottom: 12px;
  animation: creative-guide-card-in .22s ease both;
}

.creative-guide-message.bot {
  padding: 15px;
  border: 1px solid rgba(217, 220, 230, .9);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(26, 30, 48, .08);
}

.creative-guide-message.bot h3 {
  margin: 0 0 10px;
  color: #172035;
  font-size: 16px;
  line-height: 1.36;
}

.creative-guide-message.bot p {
  color: #293142;
  font-size: 14px;
  line-height: 1.7;
}

.creative-guide-message.user {
  margin-left: auto;
  padding: 10px 13px;
  border-radius: 14px 14px 5px 14px;
  color: #fff;
  background: #1677ff;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 10px 22px rgba(22, 119, 255, .18);
}

.creative-guide-review-card textarea {
  width: 100%;
  min-height: 150px;
  margin-top: 11px;
  resize: vertical;
  border: 1px solid #d9dce6 !important;
  border-radius: 12px !important;
  padding: 12px !important;
  color: #172035 !important;
  background: #fbfcff !important;
  font-size: 14px !important;
  font-weight: 650;
  line-height: 1.72;
}

.creative-guide-review-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: #7b8294;
  font-size: 12px;
}

.creative-guide-ai-state {
  min-height: 34px;
  margin-top: 9px;
  padding: 8px 10px;
  border-left: 3px solid #aeb5c4;
  border-radius: 4px;
  color: #626b7e;
  background: #f4f6f9;
  font-size: 12px;
  line-height: 1.45;
}

.creative-guide-ai-state.is-loading {
  border-left-color: #1677ff;
  color: #075ed0;
  background: #edf5ff;
}

.creative-guide-ai-state.is-success,
.creative-guide-ai-state.is-edited {
  border-left-color: #13957b;
  color: #0f775f;
  background: #effaf7;
}

.creative-guide-ai-state.is-stale,
.creative-guide-ai-state.is-error {
  border-left-color: #d68a22;
  color: #8a5612;
  background: #fff7e8;
}

.creative-guide-replies {
  min-height: 88px;
  max-height: 134px;
  margin: 0 10px 10px;
  padding: 9px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  overflow-y: auto;
  border: 1px solid rgba(222, 223, 230, .88);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 22px rgba(31, 37, 58, .06);
}

.creative-guide-replies.action-zone {
  min-height: 78px;
  max-height: 108px;
}

.creative-guide-label {
  width: 100%;
  color: #7b8294;
  font-size: 12px;
  font-weight: 800;
}

.creative-guide-pill {
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid #dedfe6 !important;
  border-radius: 999px !important;
  color: #3d4250 !important;
  background: #fff !important;
  font-size: 12px;
  font-weight: 750;
  box-shadow: none !important;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}

.creative-guide-pill:hover {
  transform: translateY(-1px);
}

.creative-guide-pill:disabled,
.creative-guide-send:disabled {
  opacity: .58;
  cursor: wait;
  transform: none;
}

.creative-guide-pill.is-selected {
  border-color: rgba(22, 119, 255, .42) !important;
  color: #075ed0 !important;
  background: #edf5ff !important;
  font-weight: 850;
}

.creative-guide-pill.primary-action {
  border-color: rgba(25, 154, 120, .35) !important;
  color: #13957b !important;
  background: #effaf7 !important;
  font-weight: 900;
}

.creative-guide-composer {
  min-height: 74px;
  padding: 10px 11px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  border-top: 1px solid #e1e3ea;
  background: #fff;
}

.creative-guide-back {
  width: 36px;
  height: 36px;
  border: 0 !important;
  border-radius: 50% !important;
  color: #5d6576 !important;
  background: #f1f3f7 !important;
  font-size: 24px;
  line-height: 1;
  box-shadow: none !important;
}

.creative-guide-back:disabled {
  opacity: .38;
  cursor: default;
}

.creative-guide-composer input {
  min-width: 0;
  height: 46px;
  border: 2px solid #dddddf !important;
  border-radius: 999px !important;
  padding: 0 13px !important;
  color: #172035 !important;
  background: #fff !important;
  font-size: 14px !important;
  font-weight: 650;
}

.creative-guide-composer input::placeholder {
  color: #a4a6ad;
}

.creative-guide-send {
  min-width: 58px;
  height: 46px;
  border: 0 !important;
  border-radius: 16px !important;
  color: #fff !important;
  background: #1677ff !important;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(22, 119, 255, .22) !important;
}

.creative-guide-send.submitting {
  background: #13957b !important;
}

.creative-fields-panel {
  border: 1px solid rgba(110, 231, 255, .17);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(13, 31, 38, .86), rgba(8, 20, 26, .82)),
    rgba(8, 20, 26, .78);
  padding: 18px;
}

.creative-fields-panel .creative-mode-card {
  margin-top: 0;
}

.creative-fields-panel .prompt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.creative-guide-status {
  flex: 1 1 240px;
  color: #8facb4;
  font-size: 12px;
  line-height: 1.5;
}

#promptInput.prompt-input-guide-filled {
  animation: creative-guide-fill-pulse .98s ease both;
}

@media (max-width: 1280px) {
  .creative-production-layout {
    grid-template-columns: minmax(300px, 386px) minmax(0, 1fr);
  }

  .creative-phone {
    height: 720px;
  }
}

@media (max-width: 980px) {
  .creative-production-layout {
    grid-template-columns: 1fr;
  }

  .creative-guide-panel {
    place-items: center;
  }
}

@media (max-width: 760px) {
  .water-nav-shell {
    border-radius: 14px;
  }

  .nav-tabs.water-nav,
  .nav-tabs-primary.water-nav {
    width: max-content !important;
  }

  .nav-tabs.water-nav button {
    min-height: 44px !important;
  }

  .creative-guide-panel,
  .creative-fields-panel {
    border-radius: 18px;
    padding: 12px;
  }

  .creative-phone {
    width: min(100%, 370px);
    height: 740px;
    border-width: 5px;
    border-radius: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .water-nav-shell::before,
  .water-nav-shell::after,
  .water-ripple,
  .creative-phone-header::after,
  .creative-phone-mark,
  .creative-guide-message,
  #promptInput.prompt-input-guide-filled {
    animation: none !important;
  }
}

/* Production polish v5: align the confirmed light water menu and creative guide demo. */
.topbar {
  grid-template-columns: auto minmax(0, 1fr) !important;
  min-height: 78px !important;
  padding: 12px 22px !important;
  align-items: center !important;
  gap: 22px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(42, 91, 112, .12) !important;
  border-radius: 0 !important;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .96), rgba(246, 253, 255, .9)),
    rgba(255, 255, 255, .9) !important;
  box-shadow: 0 12px 28px rgba(31, 80, 120, .07) !important;
}

.brand-mark {
  min-width: 190px !important;
  gap: 10px !important;
}

.brand-mark .bars {
  flex: 0 0 42px !important;
  width: 42px !important;
  height: 42px !important;
  padding: 9px !important;
  gap: 4px !important;
  border: 1px solid rgba(33, 183, 215, .34) !important;
  border-radius: 13px !important;
  background: linear-gradient(135deg, rgba(229, 248, 255, .98), rgba(255, 241, 247, .98)) !important;
  box-shadow: 0 10px 26px rgba(33, 183, 215, .18) !important;
}

.brand-mark .bars span {
  display: block !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

.brand-mark .bars span:nth-child(1) {
  height: 15px !important;
  background: linear-gradient(180deg, #ffd166, #ff9f5c) !important;
}

.brand-mark .bars span:nth-child(2) {
  height: 24px !important;
  background: linear-gradient(180deg, #35e0bd, #16a98e) !important;
}

.brand-mark .bars span:nth-child(3) {
  height: 18px !important;
  background: linear-gradient(180deg, #7aa2ff, #5277e7) !important;
}

.brand-mark strong {
  color: #10202a !important;
  font-size: 18px !important;
  font-weight: 950 !important;
}

.brand-mark > div:last-child > span {
  margin-top: 2px !important;
  color: #60707b !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

.topbar-navigation {
  display: block !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.water-nav-shell {
  border: 1px solid rgba(31, 135, 168, .18) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(226, 250, 255, .66)),
    rgba(255, 255, 255, .46) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .92),
    0 14px 32px rgba(25, 118, 160, .08) !important;
}

.water-nav-shell::before {
  opacity: .34 !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .54), transparent 46%, rgba(39, 208, 231, .06)) !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  animation: none !important;
}

.water-nav-shell::after {
  opacity: 0 !important;
  background: none !important;
  animation: none !important;
}

.nav-tabs.water-nav,
.nav-tabs-primary.water-nav {
  width: 100% !important;
  max-width: none !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 5px !important;
  overflow-x: auto !important;
  scrollbar-width: thin !important;
}

.nav-tabs.water-nav::before,
.nav-tabs-primary.water-nav::before {
  display: none !important;
}

.nav-tabs.water-nav button,
.nav-tabs-primary.water-nav button {
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 15px !important;
  border: 0 !important;
  border-radius: 14px !important;
  color: #435660 !important;
  background: rgba(255, 255, 255, .18) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 950 !important;
}

.nav-tabs.water-nav button::after,
.nav-tabs-primary.water-nav button::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: 7px !important;
  top: auto !important;
  width: 18px !important;
  height: 3px !important;
  border-radius: 999px !important;
  opacity: 0 !important;
  background: linear-gradient(90deg, #257bff, #35e0bd) !important;
  transform: translateX(-50%) scaleX(.4) !important;
  transition: opacity .18s ease, transform .22s ease !important;
}

.nav-tabs.water-nav button:hover {
  color: #102f39 !important;
  background: rgba(255, 255, 255, .46) !important;
  transform: translateY(-1px);
}

.nav-tabs.water-nav button.active,
.nav-tabs.water-nav button[aria-current="page"] {
  color: #062028 !important;
  background: rgba(255, 255, 255, .76) !important;
  box-shadow:
    inset 0 0 0 1px rgba(39, 208, 231, .26),
    0 8px 22px rgba(31, 150, 180, .14) !important;
}

.nav-tabs.water-nav button.active::before,
.nav-tabs.water-nav button[aria-current="page"]::before {
  content: "" !important;
  position: absolute !important;
  inset: 6px !important;
  height: auto !important;
  border-radius: 999px !important;
  opacity: 1 !important;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .86), transparent 32%),
    linear-gradient(135deg, rgba(39, 208, 231, .2), rgba(53, 224, 189, .22)) !important;
  transform: scale(1) !important;
}

.nav-tabs.water-nav button.active::after,
.nav-tabs.water-nav button[aria-current="page"]::after {
  opacity: 1 !important;
  transform: translateX(-50%) scaleX(1) !important;
}

.water-ripple {
  border-color: rgba(27, 170, 205, .38) !important;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .82) 0 7%, transparent 8%),
    radial-gradient(circle, rgba(39, 208, 231, .22) 0 18%, transparent 46%) !important;
  box-shadow:
    0 0 0 5px rgba(39, 208, 231, .12),
    0 0 0 16px rgba(37, 123, 255, .05) !important;
}

.water-ripple.strong {
  border-color: rgba(9, 141, 176, .48) !important;
  box-shadow:
    0 0 0 7px rgba(39, 208, 231, .18),
    0 0 0 24px rgba(37, 123, 255, .08),
    0 14px 34px rgba(37, 123, 255, .13) !important;
}

.control-panel[data-workbench-subpanel="creative"] {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(241, 251, 255, .94)),
    #ffffff !important;
  color: #10202a !important;
}

.creative-production-layout {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr) !important;
  gap: 18px !important;
}

.creative-guide-panel {
  border-color: rgba(42, 91, 112, .15) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(241, 251, 255, .94)),
    #ffffff !important;
  box-shadow: 0 18px 44px rgba(31, 80, 120, .12) !important;
}

.creative-phone {
  width: min(100%, 390px) !important;
  height: 780px !important;
}

.creative-fields-panel {
  border-color: rgba(42, 91, 112, .15) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(241, 251, 255, .94)),
    #ffffff !important;
  color: #10202a !important;
  box-shadow: 0 18px 44px rgba(31, 80, 120, .12) !important;
}

.creative-fields-panel label,
.creative-fields-panel .creative-parameter-strip label,
.creative-fields-panel .creative-style-strip label {
  color: #42515b !important;
}

.creative-fields-panel .eyebrow {
  color: #168aa2 !important;
}

.creative-fields-panel .creative-guide-status {
  color: #60707b !important;
}

.creative-fields-panel select,
.creative-fields-panel input,
.creative-fields-panel textarea {
  border-color: rgba(42, 91, 112, .18) !important;
  background: #ffffff !important;
  color: #10202a !important;
}

.creative-fields-panel .prompt-input {
  min-height: 320px !important;
  font-size: 14px !important;
  line-height: 1.72 !important;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }
}

@media (max-width: 980px) {
  .creative-production-layout {
    grid-template-columns: 1fr !important;
  }

  .creative-guide-panel {
    place-items: center !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
    padding: 10px !important;
  }

  .topbar-navigation {
    width: 100% !important;
    overflow-x: auto !important;
  }

  .nav-tabs.water-nav,
  .nav-tabs-primary.water-nav {
    width: max-content !important;
    justify-content: flex-start !important;
  }

  .nav-tabs.water-nav button,
  .nav-tabs-primary.water-nav button {
    min-height: 44px !important;
    padding: 0 11px !important;
    font-size: 14px !important;
  }

  .creative-phone {
    width: min(100%, 370px) !important;
    height: 740px !important;
  }
}
.scene-direct-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 20px; border-top: 1px solid #d5e3e8; background: #f4fbfb; }
.scene-direct-toolbar:has([data-direct-status]:empty):not(:has(label)) { display: none; }
.scene-direct-toolbar label { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.scene-direct-toolbar select { max-width: 100%; min-height: 38px; }
.scene-direct-toolbar > span { color: #60707b; font-size: 13px; }
.scene-direct-toolbar [data-direct-status] { flex-basis: 100%; overflow-wrap: anywhere; }
.scene-direct-scenes, .scene-direct-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.scene-direct-asset { min-width: 0; }
.scene-direct-asset .compact-ref { max-width: none; }
.scene-direct-asset > small { display: block; margin: 8px 0; }
.scene-direct-image-edit, .scene-direct-rewrite { display: block; margin: 12px 0; color: #60707b; font-size: 13px; }
.scene-direct-image-edit textarea, .scene-direct-rewrite textarea, .scene-direct-comparison textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; }
.scene-direct-asset pre, .scene-direct-planning pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.7; }
.scene-direct-asset details, .scene-direct-planning details { margin-top: 12px; }
.scene-direct-planning > textarea { min-height: 290px; width: 100%; box-sizing: border-box; }
@media (max-width: 720px) { .scene-direct-scenes, .scene-direct-comparison { grid-template-columns: 1fr; } .scene-direct-toolbar { padding: 12px; } }
/* Asset identity and version controls. */
#assetList .asset-meta { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
#assetList .asset-select-row, #assetList .asset-meta > small, #assetList .asset-meta > details, #assetList .asset-meta > span { grid-column: 1 / -1; overflow-wrap: anywhere; }
#assetList .asset-project-link { display: flex; align-items: center; gap: 8px; }
#assetList input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; }
#assetList [data-asset-rename] { align-self: end; width: auto; }
#assetList input[type="file"] { max-width: 100%; }
@media (max-width: 600px) { #assetList .asset-meta { grid-template-columns: minmax(0, 1fr); } }
 .material-mode { display:flex; align-items:center; gap:10px; margin:16px 0; }
 .material-mode input, .material-choice input { width:18px; height:18px; flex:0 0 18px; }
 #materialCreativePanel { border-top:1px solid #cbdcde; padding:16px 0; }
 #materialCreativePanel[hidden] { display:none; }
 .material-choices { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:12px; margin-bottom:16px; }
 .material-choice { display:flex; align-items:center; gap:10px; border:1px solid #cbdcde; border-radius:6px; padding:10px; min-width:0; }
 .material-choice img { width:64px; height:72px; object-fit:contain; }
 .material-choice span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
 .material-choices { max-height:340px; overflow:auto; }
 .material-choice small { display:block; }
 #materialCreativePanel textarea { width:100%; box-sizing:border-box; }
/* Completed films and editable history names. */
.final-video-count { padding: 18px 22px; margin: 16px 0 24px; background: #eaf5f1; color: #207960; border: 1px solid #cee3dc; border-radius: 8px; font-weight: 700; }
.final-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.final-video-card { min-width: 0; border: 1px solid #d4e1df; border-radius: 8px; overflow: hidden; background: white; }
.final-video-card video { display: block; width: 100%; height: 260px; object-fit: contain; background: #101616; }
.final-video-info { padding: 16px; }
.final-video-info h3 { font-size: 18px; line-height: 1.5; margin: 0 0 8px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.final-video-info p { color: #687c81; font-size: 14px; }
.final-video-actions, .history-name-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.final-video-actions a { color: #167b76; }
.history-name-dialog { width: min(460px, calc(100vw - 32px)); box-sizing: border-box; border: 1px solid #cadcda; border-radius: 8px; padding: 24px; color: #18313b; }
.history-name-dialog::backdrop { background: #0006; }
.history-name-dialog input { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px; border: 1px solid #cadcda; border-radius: 6px; }
.history-name-dialog [role=alert] { color: #b53535; }
.task-item > div:first-child { min-width: 0; flex: 1; }
.task-item > div:first-child strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-actions { flex-wrap: wrap; }
.creative-prompt-field { display: block !important; width: 100%; min-width: 0; margin: 16px 0; }
.creative-prompt-field > label { display: block !important; margin-bottom: 8px; }
#promptInput { display: block !important; visibility: visible !important; width: 100% !important; height: 320px !important; min-height: 240px !important; box-sizing: border-box; resize: vertical; }
.project-loading-notice { position: fixed; inset: 76px 0 auto; z-index: 10000; padding: 16px; background: #e2f7f5; color: #12483e; text-align: center; box-shadow: 0 3px 12px #0002; }
@media (max-width: 640px) { .task-item { flex-wrap: wrap; } .task-item > div:first-child { flex-basis: 100%; } .final-video-card video { height: 300px; } }
